9658e70 conf/openvz: eliminate incorrect/undocumented use of <source dev='blah'/>

Authored and Committed by Laine Stump 7 years ago
    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 
    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.
    
        
file modified
+24 -16
file modified
+0 -3
file modified
+2 -3
file modified
+1 -5