]> git.ipfire.org Git - thirdparty/libvirt.git/commit
network: centralize check for active network during interface attach
authorLaine Stump <laine@laine.org>
Thu, 10 Apr 2014 11:44:07 +0000 (14:44 +0300)
committerLaine Stump <laine@laine.org>
Sun, 27 Apr 2014 09:22:36 +0000 (12:22 +0300)
commit34cc3b2f106e296df5e64309620c79d16fd76c85
tree9526ba883fa5724496dd769b4b1191be619c2ec4
parent411c5486685b81d0c04ad7c83ac3552ec011968c
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
src/lxc/lxc_driver.c
src/lxc/lxc_process.c
src/network/bridge_driver.c
src/qemu/qemu_command.c
src/qemu/qemu_hotplug.c