提交 16e31fb3 编写于 作者: J Jiri Denemark

qemu: Fix starting a domain with corrupted managed save file

Commit v3.4.0-44-gac793bd7 fixed a memory leak, but failed to return
the special -3 value. Thus an attempt to start a domain with corrupted
managed save file would removed the corrupted file and report
"An error occurred, but the cause is unknown" instead of starting the
domain from scratch.

https://bugzilla.redhat.com/show_bug.cgi?id=1460962
上级 2502a0fa
...@@ -6450,17 +6450,15 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, ...@@ -6450,17 +6450,15 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
*ret_def = def; *ret_def = def;
*ret_data = data; *ret_data = data;
cleanup:
virObjectUnref(caps); virObjectUnref(caps);
return fd; return fd;
error: error:
virDomainDefFree(def); virDomainDefFree(def);
virQEMUSaveDataFree(data); virQEMUSaveDataFree(data);
VIR_FORCE_CLOSE(fd); VIR_FORCE_CLOSE(fd);
virObjectUnref(caps); goto cleanup;
return -1;
} }
static int ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6) static int ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册