]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuProcessInit: Jump onto correct label in case of error
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 23 Feb 2017 16:10:55 +0000 (17:10 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 24 Feb 2017 13:19:42 +0000 (14:19 +0100)
After eca76884ea in case of error in qemuDomainSetPrivatePaths()
in pretended start we jump to stop. I've changed this during
review from 'cleanup' which turned out to be correct. Well, sort
of. We can't call qemuProcessStop() as it decrements
driver->nactive and we did not increment it. However, it calls
virDomainObjRemoveTransientDef() which is basically the only
function we need to call. So call that function and goto cleanup;

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_process.c

index 8b8b9d9cc01c1965fa689440b8a9f5501a27dbb5..96edd9171ce4ada7f35392f48a18961a2e3a2055 100644 (file)
@@ -4757,8 +4757,10 @@ qemuProcessInit(virQEMUDriverPtr driver,
         goto cleanup;
 
     if (flags & VIR_QEMU_PROCESS_START_PRETEND) {
-        if (qemuDomainSetPrivatePaths(driver, vm) < 0)
-            goto stop;
+        if (qemuDomainSetPrivatePaths(driver, vm) < 0) {
+            virDomainObjRemoveTransientDef(vm);
+            goto cleanup;
+        }
     } else {
         vm->def->id = qemuDriverAllocateID(driver);
         qemuDomainSetFakeReboot(driver, vm, false);