mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
virsh: don't print error info when snapshot xml is not changed
If xml is not changed, error message is printed. So check ret value instead of edit variable for error message.
This commit is contained in:
parent
66473616c8
commit
44574a8789
@ -449,7 +449,7 @@ cmdSnapshotEdit(vshControl *ctl, const vshCmd *cmd)
|
|||||||
_("Snapshot %s XML configuration not changed.\n"), \
|
_("Snapshot %s XML configuration not changed.\n"), \
|
||||||
name); \
|
name); \
|
||||||
ret = true; \
|
ret = true; \
|
||||||
goto cleanup; \
|
goto edit_cleanup; \
|
||||||
}
|
}
|
||||||
#define EDIT_DEFINE \
|
#define EDIT_DEFINE \
|
||||||
(strstr(doc, "<state>disk-snapshot</state>") ? \
|
(strstr(doc, "<state>disk-snapshot</state>") ? \
|
||||||
@ -487,10 +487,10 @@ cmdSnapshotEdit(vshControl *ctl, const vshCmd *cmd)
|
|||||||
ret = true;
|
ret = true;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
if (!ret)
|
||||||
|
vshError(ctl, _("Failed to update %s"), name);
|
||||||
if (edited)
|
if (edited)
|
||||||
virDomainSnapshotFree(edited);
|
virDomainSnapshotFree(edited);
|
||||||
else
|
|
||||||
vshError(ctl, _("Failed to update %s"), name);
|
|
||||||
if (snapshot)
|
if (snapshot)
|
||||||
virDomainSnapshotFree(snapshot);
|
virDomainSnapshotFree(snapshot);
|
||||||
if (dom)
|
if (dom)
|
||||||
|
Loading…
Reference in New Issue
Block a user