From: "Jason J. Herne" <jjherne(a)us.ibm.com>
qemuDomainObjStart is checking the return code from qemuDomainObjRestore for
errors even after determining that the return code is 0. This causes the
following error message to appear even when the restore was successful.
Unable to restore from managed state [path]. Maybe the file is corrupted?
A simple conditional to handle the error case takes care of the problem.
Signed-off-by: Jason J. Herne <jjherne(a)us.ibm.com>
---
src/qemu/qemu_driver.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 2b852eb..cec2b6c 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6081,14 +6081,15 @@ qemuDomainObjStart(virConnectPtr conn,
else
vm->hasManagedSave = false;
}
-
- if (ret > 0) {
- VIR_WARN("Ignoring incomplete managed state %s",
managed_save);
- } else {
- VIR_WARN("Unable to restore from managed state %s. "
- "Maybe the file is corrupted?", managed_save);
- goto cleanup;
+ else {
+ if (ret > 0) {
+ VIR_WARN("Ignoring incomplete managed state %s",
managed_save);
+ } else {
+ VIR_WARN("Unable to restore from managed state %s. "
+ "Maybe the file is corrupted?", managed_save);
+ }
}
+ goto cleanup;
}
}
--
1.8.3.2