提交 3d52d5e6 编写于 作者: P Peter Krempa 提交者: Cole Robinson

qemu: restore: Fix restoring of VM when the restore hook returns empty XML

The documentation for the restore hook states that returning an empty
XML is equivalent with copying the input. There was a bug in the code
checking the returned string by checking the string instead of the
contents. Use the new helper to check if the string is empty.

(cherry picked from commit e3867799)
上级 1bcf7e10
......@@ -5720,7 +5720,7 @@ qemuDomainRestoreFlags(virConnectPtr conn,
&xmlout)) < 0)
goto cleanup;
if (hookret == 0 && xmlout) {
if (hookret == 0 && !virStringIsEmpty(xmlout)) {
VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout);
hook_taint = true;
newxml = xmlout;
......@@ -5936,7 +5936,7 @@ qemuDomainObjRestore(virConnectPtr conn,
NULL, xml, &xmlout)) < 0)
goto cleanup;
if (hookret == 0 && xmlout) {
if (hookret == 0 && !virStringIsEmpty(xmlout)) {
virDomainDefPtr tmp;
VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册