mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
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.
This commit is contained in:
parent
0eeafeedeb
commit
e386779937
@ -5831,7 +5831,7 @@ qemuDomainRestoreFlags(virConnectPtr conn,
|
|||||||
&xmlout)) < 0)
|
&xmlout)) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (hookret == 0 && xmlout) {
|
if (hookret == 0 && !virStringIsEmpty(xmlout)) {
|
||||||
VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout);
|
VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout);
|
||||||
hook_taint = true;
|
hook_taint = true;
|
||||||
newxml = xmlout;
|
newxml = xmlout;
|
||||||
@ -6047,7 +6047,7 @@ qemuDomainObjRestore(virConnectPtr conn,
|
|||||||
NULL, xml, &xmlout)) < 0)
|
NULL, xml, &xmlout)) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (hookret == 0 && xmlout) {
|
if (hookret == 0 && !virStringIsEmpty(xmlout)) {
|
||||||
virDomainDefPtr tmp;
|
virDomainDefPtr tmp;
|
||||||
|
|
||||||
VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout);
|
VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout);
|
||||||
|
Loading…
Reference in New Issue
Block a user