]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
qemu: Finish device removal in the original thread
authorJiri Denemark <jdenemar@redhat.com>
Mon, 26 May 2014 15:01:52 +0000 (17:01 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 2 Jun 2014 14:47:36 +0000 (16:47 +0200)
commit4670f1dd0235f90883e97a29e8b564d69b3e7729
tree6ed69c04cd5d4baf37e0d5eda646cc07362c12ef
parentf8a0c9edf0a22ff8481d01611e5100db46f41c94
qemu: Finish device removal in the original thread

If QEMU supports DEVICE_DELETED event, we always call
qemuDomainRemoveDevice from the event handler. However, we will need to
push this call away from the main event loop and begin a job for it (see
the following commit), we need to make sure the device is fully removed
by the original thread (and within its existing job) in case the
DEVICE_DELETED event arrives before qemuDomainWaitForDeviceRemoval times
out.

Without this patch, device removals would be guaranteed to never finish
before the timeout because the could would be blocked by the original
job being still active.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_hotplug.c
src/qemu/qemu_hotplug.h
src/qemu/qemu_process.c