]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
qemu: Hack around asynchronous device_del
authorJiri Denemark <jdenemar@redhat.com>
Mon, 9 Aug 2010 12:14:34 +0000 (14:14 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 10 Aug 2010 14:59:49 +0000 (16:59 +0200)
commitd1e5676c0d9e4ab51dc37f4fc882f630ef2f15e0
tree6d4ceb6f8a904ba1258de34ac6d872b194c263e3
parent1ddefd181bfc8b4ef43ae164566163c52fcf6971
qemu: Hack around asynchronous device_del

device_del command is not synchronous for PCI devices, it merely asks
the guest to release the device and returns. If the host wants to use
that device before the guest actually releases it, we are in big
trouble. To avoid this, we already added a loop which waits up to 10
seconds until the device is actually released before we do anything else
with that device. But we only added this loop for managed PCI devices
before we try reattach them back to the host.

However, we need to wait even for non-managed devices. We don't reattach
them automatically, but we still want to prevent the host from using it.
This was revealed thanks to sVirt: when we relabel sysfs files
corresponding to the PCI device before the guest finished releasing the
device, qemu is no longer allowed to access those files and if it wants
(as a result of guest's request) to write anything to them, it just
exits, which kills the guest.

This is not a proper fix and needs some further work both on libvirt and
qemu side in the future.
src/qemu/qemu_driver.c