]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Process DEVICE_DELETED event in a separate thread
authorJiri Denemark <jdenemar@redhat.com>
Mon, 26 May 2014 15:02:05 +0000 (17:02 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 2 Jun 2014 14:47:36 +0000 (16:47 +0200)
commit47f424c2d929a820f9bde6819013457e53dbee56
treeb73564d76a46a2b376cd7c941724d83af1fe5be8
parent4670f1dd0235f90883e97a29e8b564d69b3e7729
qemu: Process DEVICE_DELETED event in a separate thread

Currently, we don not acquire any job when removing a device after
DEVICE_DELETED event was received from QEMU. This means that if there is
another API running at the time DEVICE_DELETED is delivered and the API
acquired a job, we may happily change the definition of the domain the
API is working with whenever it unlocks the domain object (e.g., to talk
with its monitor). That said, we have to acquire a job before finishing
device removal to make things safe. However, doing so in the main event
loop would cause a deadlock so we need to move most of the event handler
into a separate thread.

Another good reason for both acquiring a job and handling the event in a
separate thread is that we currently remove a device backend immediately
after removing its frontend while we should only remove the backend once
we already received DEVICE_DELETED event. That is, we will have to talk
to QEMU monitor from the event handler.

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