Libvirt provides a portable, long term stable C API for managing the virtualization technologies provided by many operating systems. It includes support for QEMU, KVM, Xen, LXC, bhyve, Virtuozzo, VMware vCenter and ESX, VMware Desktop, Hyper-V, VirtualBox and the POWER Hypervisor.
Go to file
Laine Stump cf90342be0 qemu: support type=hostdev network device live hotplug attach/detach
qemuDomainAttachNetDevice

  - re-ordered some things at start of function because
    networkAllocateActualDevice should always be run and a slot
    in def->nets always allocated, but host_net_add isn't needed
    if the actual type is hostdev.

  - if actual type is hostdev, defer to
    qemuDomainAttachHostDevice (which will reach up to the NetDef
    for things like MAC address when necessary). After return
    from qemuDomainAttachHostDevice, slip directly to cleanup,
    since the rest of the function is specific to emulated net
    devices.

  - put assignment of new NetDef into expanded def->nets down
    below cleanup: (but only on success) since it is also needed
    for emulated and hostdev net devices.

qemuDomainDetachHostDevice

  - after locating the exact device to detach, check if it's a
    network device and, if so, use toplevel
    qemuDomainDetachNetDevice instead so that the def->nets list
    is properly updated, and 'actual device' properly returned to
    network pool if appropriate. Otherwise, for normal hostdevs,
    call the lower level qemuDomainDetachThisDevice.

qemuDomainDetachNetDevice

  - This is where it gets a bit tricky. After locating the device
    on the def->nets list, if the network device type == hostdev,
    call the *lower level* qemuDomainDetachThisDevice (which will
    reach back up to the parent net device for MAC address /
    virtualport when appropriate, then clear the device out of
    def->hostdevs) before skipping past all the emulated
    net-device-specific code to cleanup:, where the network
    device is removed from def->nets, and the network device
    object is freed.

In short, any time a hostdev-type network device is detached, we must
go through the toplevel virDomaineDetachNetDevice function first and
last, to make sure 1) the def->nnets list is properly managed, and 2)
any device allocated with networkAllocateActualDevice is properly
freed. At the same time, in the middle we need to go through the
lower-level vidDomainDetach*This*HostDevice to be sure that 1) the
def->hostdevs list is properly managed, 2) the PCI device is properly
detached from the guest and reattached to the host (if appropriate),
and 3) any higher level teardown is called at the appropriate time, by
reaching back up to the NetDef config (part (3) will be covered in a
separate patch).
2012-03-05 23:24:50 -05:00
.gnulib@d5612c714c build: prohibit cross-inclusion 2012-03-02 06:22:43 -07:00
daemon daemon: Remove deprecated HAL from init script dependencies 2012-03-02 16:32:37 +01:00
docs conf: parse/format type='hostdev' network interfaces 2012-03-05 23:24:28 -05:00
examples maint: consolidate several .gitignore files 2012-02-03 15:27:16 -07:00
gnulib build: update to latest gnulib 2012-01-12 15:47:54 -07:00
include blockResize: add flag for bytes 2012-03-05 10:06:52 -07:00
m4 build: silence some compiler warnings from gnulib 2012-01-19 13:14:10 -07:00
po util: Add helpers for safe domain console operations 2012-02-27 15:05:17 +01:00
python python: Expose virDomain{G,S}etInterfaceParameters APIs in python binding 2012-02-16 10:15:16 +08:00
src qemu: support type=hostdev network device live hotplug attach/detach 2012-03-05 23:24:50 -05:00
tests qemu: support type='hostdev' network devices at domain start 2012-03-05 23:24:34 -05:00
tools libvirt-guests: Add parallel startup and shutdown of guests 2012-03-05 13:18:24 +01:00
.dir-locals.el maint: let emacs avoid tabs in rng files 2011-08-13 08:56:26 -06:00
.gitignore qemu: unescape HMP commands before converting them to json 2012-02-27 16:06:02 -07:00
.gitmodules make .gnulib a submodule 2009-07-08 16:17:51 +02:00
.mailmap maint: prune duplicate listings in AUTHORS 2012-02-03 09:56:45 -07:00
AUTHORS virterror: Misleading error message when name is missing 2012-02-23 16:31:45 -07:00
autobuild.sh Disable python explicitly in mingw32 autobuild 2011-12-19 13:44:18 +00:00
autogen.sh build: allow for local gnulib diffs 2011-11-09 09:03:33 -07:00
bootstrap build: update to latest gnulib 2012-02-29 10:27:40 -07:00
bootstrap.conf Replace hashing algorithm with murmurhash 2012-01-26 14:18:53 +00:00
cfg.mk build: use correct type for pid and similar types 2012-03-02 06:57:43 -07:00
ChangeLog-old virterror.c: Fix several spelling mistakes 2012-02-03 11:32:51 -07:00
configure.ac util: Add helpers for safe domain console operations 2012-02-27 15:05:17 +01:00
COPYING.LIB remove all trailing blank lines 2009-07-16 15:06:42 +02:00
HACKING Document STREQ_NULLABLE and STRNEQ_NULLABLE 2011-10-06 16:50:38 +02:00
libvirt.pc.in Fix typos in API XML file paths 2012-02-15 11:29:38 +00:00
libvirt.spec.in Fixed service handling in specfile 2012-02-24 16:31:04 -07:00
Makefile.am maint: add missing copyright notices 2011-07-28 15:01:17 -06:00
Makefile.nonreentrant Ban use of all inet_* functions 2010-10-22 11:59:23 +01:00
mingw32-libvirt.spec.in Fix typos in API XML file paths 2012-02-15 11:29:38 +00:00
README Correct typos in the documentation (Atsushi SAKAI) 2008-01-24 10:15:13 +00:00
README-hacking maint: relax git minimum version 2010-02-24 14:29:27 -05:00
TODO Update todo list file to point at bugzilla/website 2010-10-13 16:45:26 +01:00

         LibVirt : simple API for virtualization

  Libvirt is a C toolkit to interact with the virtualization capabilities
of recent versions of Linux (and other OSes). It is free software
available under the GNU Lesser General Public License. Virtualization of
the Linux Operating System means the ability to run multiple instances of
Operating Systems concurrently on a single hardware system where the basic
resources are driven by a Linux instance. The library aim at providing
long term stable C API initially for the Xen paravirtualization but
should be able to integrate other virtualization mechanisms if needed.

Daniel Veillard <veillard@redhat.com>