I was looking at other uses of qemuDomainObjEndJob and saw this:
From f8ccc44e7890c1b2ae2ebc266ca5d6215fe9c80d Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Tue, 27 Apr 2010 22:16:02 +0200
Subject: [PATCH] qemudDomainCreate: correct a slightly misdirected goto
* src/qemu/qemu_driver.c (qemudDomainCreate): Goto cleanup,
not "endjob", since we know "vm" is already NULL. No semantic
change.
---
src/qemu/qemu_driver.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e1b1af3..2daf038 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4033,35 +4033,35 @@ static virDomainPtr qemudDomainCreate(virConnectPtr conn, const
char *xml,
goto cleanup;
if (!(vm = virDomainAssignDef(driver->caps,
&driver->domains,
def, false)))
goto cleanup;
def = NULL;
if (qemuDomainObjBeginJobWithDriver(driver, vm) < 0)
goto cleanup; /* XXXX free the 'vm' we created ? */
if (qemudStartVMDaemon(conn, driver, vm, NULL, -1) < 0) {
if (qemuDomainObjEndJob(vm) > 0)
virDomainRemoveInactive(&driver->domains,
vm);
vm = NULL;
- goto endjob;
+ goto cleanup;
}
event = virDomainEventNewFromObj(vm,
VIR_DOMAIN_EVENT_STARTED,
VIR_DOMAIN_EVENT_STARTED_BOOTED);
dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
if (dom) dom->id = vm->def->id;
endjob:
if (vm &&
qemuDomainObjEndJob(vm) == 0)
vm = NULL;
cleanup:
virDomainDefFree(def);
if (vm)
--
1.7.1.328.g9993c