]> xenbits.xensource.com Git - libvirt.git/commit
conf/openvz: eliminate incorrect/undocumented use of <source dev='blah'/>
authorLaine Stump <laine@laine.org>
Tue, 21 Jun 2016 19:20:57 +0000 (15:20 -0400)
committerLaine Stump <laine@laine.org>
Sun, 26 Jun 2016 23:33:08 +0000 (19:33 -0400)
commit9658e70f7d957570bb0682a9aadc64ae67b3b201
treecbffe200cf52490aa8dbe62281afcc0ca5cdf9a8
parenta71fd239bd1dad7ac7d656331c386e3fe1ad535c
conf/openvz: eliminate incorrect/undocumented use of <source dev='blah'/>

When support for <interface type='ethernet'> was added in commit
9a4b705f back in 2010, it erroneously looked at <source dev='blah'/>
for a user-specified guest-side interface name. This was never
documented though. (that attribute already existed at the time in the
data.ethernet union member of virDomainNetDef, but apparently had no
practical use - it was only used as a storage place for a NetDef's
bridge name during qemuDomainXMLToNative(), but even then that was
never used for anything).

When support for similar guest-side device naming was added to the lxc
driver several years later, it was put in a new subelement <guest
dev='blah'/>.

In the intervening years, since there was no validation that
ethernet.dev was NULL in the other drivers that didn't actually use
it, innocent souls who were adding other features assuming they needed
to account for non-NULL ethernet.dev when really they didn't, so
little bits of the usual pointless cargo-cult code showed up.

This patch not only switches the openvz driver to use the documented
<guest dev='blah'/> notation for naming the guest-side device (just in
case anyone is still using the openvz driver), and logs an error if
anyone tries to set <source dev='blah'/> for a type='ethernet'
interface, it also removes the cargo-cult uses of ethernet.dev and
<source dev='blah'/>, and eliminates if from the RNG and from
virDomainNetDef.

NB: I decided on this course of action after mentioning the
inconsistency here:

  https://www.redhat.com/archives/libvir-list/2016-May/msg02038.html

and getting encouragement do eliminate it in a later IRC discussion
with danpb.
docs/schemas/domaincommon.rng
src/conf/domain_conf.c
src/conf/domain_conf.h
src/openvz/openvz_driver.c
src/qemu/qemu_hotplug.c
tests/xml2sexprdata/xml2sexpr-net-routed.xml