]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix hang in qemudDomainCoreDump.
authorChris Lalancette <clalance@redhat.com>
Wed, 10 Mar 2010 21:50:13 +0000 (16:50 -0500)
committerChris Lalancette <clalance@redhat.com>
Thu, 11 Mar 2010 17:45:05 +0000 (12:45 -0500)
Currently if you dump the core of a qemu guest with
qemudDomainCoreDump, subsequent commands will hang
up libvirtd.  This is because qemudDomainCoreDump
uses qemuDomainWaitForMigrationComplete, which expects
the qemuDriverLock to be held when it's called.  This
patch does the simple thing and moves the qemuDriveUnlock
to the end of the qemudDomainCoreDump so that the driver
lock is held for the entirety of the call (as it is done
in qemudDomainSave).  We will probably want to make the
lock more fine-grained than that in the future, but
we can fix both qemudDomainCoreDump and qemudDomainSave
at the same time.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
src/qemu/qemu_driver.c

index be1490e44637ca867911d8e9b8d0ce075cf4271d..f8ab545c1f07eec520818617342687cc9cca4c21 100644 (file)
@@ -4389,7 +4389,6 @@ static int qemudDomainCoreDump(virDomainPtr dom,
 
     qemuDriverLock(driver);
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
-    qemuDriverUnlock(driver);
 
     if (!vm) {
         char uuidstr[VIR_UUID_STRING_BUFLEN];
@@ -4400,7 +4399,7 @@ static int qemudDomainCoreDump(virDomainPtr dom,
     }
     priv = vm->privateData;
 
-    if (qemuDomainObjBeginJob(vm) < 0)
+    if (qemuDomainObjBeginJobWithDriver(driver, vm) < 0)
         goto cleanup;
 
     if (!virDomainObjIsActive(vm)) {
@@ -4498,6 +4497,7 @@ cleanup:
         virDomainObjUnlock(vm);
     if (event)
         qemuDomainEventQueue(driver, event);
+    qemuDriverUnlock(driver);
     return ret;
 }