]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Avoid entering monitor with locked driver
authorJiri Denemark <jdenemar@redhat.com>
Tue, 27 Mar 2012 11:32:43 +0000 (13:32 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 27 Mar 2012 12:18:12 +0000 (14:18 +0200)
This avoids possible deadlock of the qemu driver in case a domain is
begin migrated (in Begin phase) and unrelated connection to qemu driver
is closed at the right time.

I checked all callers of qemuDomainCheckEjectableMedia() and they are
calling this function with qemu driver locked.

src/qemu/qemu_hotplug.c

index f1c1283c7579ed7fe432fbb8c80fdfa2f7783dfa..38163badb8050a76e7e929bcde6c418d554d865b 100644 (file)
@@ -160,9 +160,9 @@ qemuDomainCheckEjectableMedia(struct qemud_driver *driver,
     int ret = -1;
     int i;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    qemuDomainObjEnterMonitorWithDriver(driver, vm);
     table = qemuMonitorGetBlockInfo(priv->mon);
-    qemuDomainObjExitMonitor(driver, vm);
+    qemuDomainObjExitMonitorWithDriver(driver, vm);
 
     if (!table)
         goto cleanup;