]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: move virtPortProfile out of unions in virDomainNetDef
authorLaine Stump <laine@laine.org>
Mon, 30 Jul 2012 06:03:25 +0000 (02:03 -0400)
committerLaine Stump <laine@laine.org>
Tue, 14 Aug 2012 19:47:28 +0000 (15:47 -0400)
commit1d1744285bbe8c90d3147e3112f1ed15edc625fe
treeaa7ce91f09f981a4b483eb91799a90899abd1317
parent1c02ed14217f383a77d16c24310503ff165292f2
conf: move virtPortProfile out of unions in virDomainNetDef

virtPortProfile is now used by 4 different types of network devices
(NETWORK, BRIDGE, DIRECT, and HOSTDEV), and it's getting cumbersome to
replicate so much code in 4 different places just because each type
has the virtPortProfile in a slightly different place. This patch puts
a single virtPortProfile in a common place (outside the type-specific
union) in both virDomainNetDef and virDomainActualNetDef, and adjusts
the parse and format code (and the few other places where it is used)
accordingly.

Note that when a <virtualport> element is found, the parse functions
verify that the interface is of a type that supports one, otherwise an
error is generated (CONFIG_UNSUPPORTED in the case of <interface>, and
INTERNAL in the case of <actual>, since the contents of <actual> are
always generated by libvirt itself).
src/conf/domain_conf.c
src/conf/domain_conf.h
src/network/bridge_driver.c
src/qemu/qemu_driver.c
src/qemu/qemu_hotplug.c