]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Fix qemuProcessAutoDestroy
authorJohn Ferlan <jferlan@redhat.com>
Tue, 27 Mar 2018 15:53:41 +0000 (11:53 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 9 Apr 2018 22:25:51 +0000 (18:25 -0400)
Upon entry from virCloseCallbacksRun, the @dom will have a
Ref and Lock from virDomainObjListFindByUUIDRef, so there's
no need to take an extra reference nor should the code call
virDomainObjEndAPI when done since that both Unref's and
Unlock's the @dom which means the callers call to EndAPI
would be unlocking an unlocked object. At least the Ref
saved the code from referencing something already freed.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
src/qemu/qemu_process.c

index c0105c8b8464b58466a4f2b76ce2e4d216cbb636..0e7965fc0836dffb260f893c6ea2be2b6cd3212d 100644 (file)
@@ -7058,8 +7058,6 @@ qemuProcessAutoDestroy(virDomainObjPtr dom,
 
     VIR_DEBUG("vm=%s, conn=%p", dom->def->name, conn);
 
-    virObjectRef(dom);
-
     if (priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_IN)
         stopFlags |= VIR_QEMU_PROCESS_STOP_MIGRATED;
 
@@ -7089,7 +7087,6 @@ qemuProcessAutoDestroy(virDomainObjPtr dom,
     qemuDomainEventQueue(driver, event);
 
  cleanup:
-    virDomainObjEndAPI(&dom);
     return dom;
 }