]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix crash in QEMU auto-destroy with transient guests
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 28 Feb 2013 12:18:48 +0000 (12:18 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 1 Mar 2013 10:16:29 +0000 (10:16 +0000)
When the auto-destroy callback runs it is supposed to return
NULL if the virDomainObjPtr is no longer valid. It was not
doing this for transient guests, so we tried to virObjectUnlock
a mutex which had been freed. This often led to a crash.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/qemu/qemu_process.c

index db95d6ee1c371349d6cf5900a39cbda8e082a93c..1b9eedec4c160f0f6b1b7a4c1237fff0d8e0e2e2 100644 (file)
@@ -4629,8 +4629,10 @@ qemuProcessAutoDestroy(virQEMUDriverPtr driver,
 
     if (!qemuDomainObjEndJob(driver, dom))
         dom = NULL;
-    if (dom && !dom->persistent)
+    if (dom && !dom->persistent) {
         qemuDomainRemoveInactive(driver, dom);
+        dom = NULL;
+    }
     if (event)
         qemuDomainEventQueue(driver, event);