]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Fix race between device rebind and kvm cleanup
authorChris Lalancette <clalance@redhat.com>
Wed, 20 Jan 2010 20:53:59 +0000 (15:53 -0500)
committerChris Lalancette <clalance@redhat.com>
Fri, 22 Jan 2010 17:03:49 +0000 (12:03 -0500)
commitbe34c3c7efbb1ea8999530f98b99c5dde3793f84
treed96f60ecf7ce29eae562e5cfdd4c74d875666fdc
parent654dd2902d44ca2e7d2d162543680f94d1a00fda
qemu: Fix race between device rebind and kvm cleanup

Certain hypervisors (like qemu/kvm) map the PCI bar(s) on
the host when doing device passthrough.  This can lead to a race
condition where the hypervisor is still cleaning up the device while
libvirt is trying to re-attach it to the host device driver.  To avoid
this situation, we look through /proc/iomem, and if the hypervisor is
still holding onto the bar (denoted by the string in the matcher variable),
then we can wait around a bit for that to clear up.

v2: Thanks to review by DV, make sure we wait the full timeout per-device

Signed-off-by: Chris Lalancette <clalance@redhat.com>
src/libvirt_private.syms
src/qemu/qemu_driver.c
src/util/pci.c
src/util/pci.h