]> git.ipfire.org Git - thirdparty/libvirt.git/commit
network: internal API functions to manage assignment of physdev to guest
authorLaine Stump <laine@laine.org>
Mon, 4 Jul 2011 06:27:12 +0000 (02:27 -0400)
committerLaine Stump <laine@laine.org>
Thu, 21 Jul 2011 18:47:19 +0000 (14:47 -0400)
commit04711a0f32ac2e9c44081911295b436b2c0a11cf
tree8c845e717ae69909ee51f46050007d5fea3cbcb7
parente9949a586a9a2e6642d6394f85bd58955740b69d
network: internal API functions to manage assignment of physdev to guest

The network driver needs to assign physical devices for use by modes
that use macvtap, keeping track of which physical devices are in use
(and how many instances, when the devices can be shared). Three calls
are added:

networkAllocateActualDevice - finds a physical device for use by the
domain, and sets up the virDomainActualNetDef accordingly.

networkNotifyActualDevice - assumes that the domain was already
running, but libvirtd was restarted, and needs to be notified by each
already-running domain about what interfaces they are using.

networkReleaseActualDevice - decrements the usage count of the
allocated physical device, and frees the virDomainActualNetDef to
avoid later accidentally using the device.

bridge_driver.[hc] - the new APIs. When WITH_NETWORK is false, these
functions are all #defined to be "0" in the .h file (effectively
becoming a NOP) to prevent link errors.

qemu_(command|driver|hotplug|process).c - add calls to the above APIs
    in the appropriate places.

tests/Makefile.am - we need to include libvirt_driver_network.la
    whenever libvirt_driver_qemu.la is linked, to avoid unreferenced
    symbols (in functions that are never called by the test
    programs...)
src/libvirt_network.syms
src/network/bridge_driver.c
src/network/bridge_driver.h
src/qemu/qemu_command.c
src/qemu/qemu_hotplug.c
src/qemu/qemu_process.c
tests/Makefile.am