提交 eca76884 编写于 作者: M Marc Hartmayer 提交者: Michal Privoznik

qemu: Fix incorrect jump labels in error paths

Fix incorrect jump labels in error paths as the stop jump is only
needed if the driver has already changed the state. For example
'virAtomicIntInc(&driver->nactive)' will be 'reverted' in the
qemuProcessStop call.
Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 3cddd63a
......@@ -4755,9 +4755,12 @@ qemuProcessInit(virQEMUDriverPtr driver,
*/
VIR_DEBUG("Setting current domain def as transient");
if (virDomainObjSetDefTransient(caps, driver->xmlopt, vm) < 0)
goto stop;
goto cleanup;
if (!(flags & VIR_QEMU_PROCESS_START_PRETEND)) {
if (flags & VIR_QEMU_PROCESS_START_PRETEND) {
if (qemuDomainSetPrivatePaths(driver, vm) < 0)
goto stop;
} else {
vm->def->id = qemuDriverAllocateID(driver);
qemuDomainSetFakeReboot(driver, vm, false);
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_STARTING_UP);
......@@ -4770,10 +4773,10 @@ qemuProcessInit(virQEMUDriverPtr driver,
VIR_HOOK_QEMU_OP_PREPARE,
VIR_HOOK_SUBOP_BEGIN) < 0)
goto stop;
}
if (qemuDomainSetPrivatePaths(driver, vm) < 0)
goto cleanup;
if (qemuDomainSetPrivatePaths(driver, vm) < 0)
goto stop;
}
ret = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册