On 07/04/2018 10:05 PM, Jie Wang wrote:
>From 29482622218f525f0133be0b7db74835174035d9 Mon Sep 17 00:00:00
2001
From: Jie Wang <wangjie88(a)huawei.com>
Date: Thu, 5 Jul 2018 09:52:03 +0800
Subject: [PATCH] qemu: stop qemu progress when restore failed
Strange stuff in the comment message...
if qemuProcessStartCPUs perform failed in qemuDomainSaveImageStartVM,
we need to stop qemu progress, otherwise will remains a wild VM
which can't be managed by libvirt.
So essentially if the qemuProcessStartCPUs fails when trying to resume
after after the Restore then we have to undo the qemuProcessStart since
the VM's state will be inconsistent.
Signed-off-by: Jie Wang <wangjie88.huawei.com>
---
src/qemu/qemu_driver.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 9a35e04a85..639b57316d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6621,6 +6621,8 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
if (virGetLastErrorCode() == VIR_ERR_OK)
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("failed to resume domain"));
+
+ qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED, asyncJob, 0);
Don't think this is SHUTOFF_FAILED - seems to be something new perhaps
VIR_DOMAIN_SHUTOFF_RESTORE_FAILED
Hopefully a more cheery Peter will also respond with ideas ;-)...
John
goto cleanup;
}
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm,
driver->caps) < 0) {