34cc3b2 network: centralize check for active network during interface attach

Authored and Committed by Laine Stump 9 years ago
    network: centralize check for active network during interface attach
    
    The check for a network being active during interface attach was being
    done individually in several places (by both the lxc driver and the
    qemu driver), but those places were too specific, leading to it *not*
    being checked when allocating a connection/device from a macvtap or
    hostdev network.
    
    This patch puts a single check in networkAllocateActualDevice(), which
    is always called before the any network interface is attached to any
    type of domain. It also removes all the other now-redundant checks
    from the lxc and qemu drivers.
    
    NB: the following patches are prerequisites for this patch, in the
    case that it is backported to any branch:
    
      440beeb network: fix virNetworkObjAssignDef and persistence
      8aaa5b6 network: create statedir during driver initialization
      b9e9549 network: change location of network state xml files
      411c548 network: set macvtap/hostdev networks active if their state
              file exists
    
    This fixes:
    
      https://bugzilla.redhat.com/show_bug.cgi?id=880483
    
        
file modified
+3 -18
file modified
+2 -16
file modified
+9 -1
file modified
+2 -16
file modified
+1 -10