mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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:
@@ -449,7 +449,7 @@ cmdSnapshotEdit(vshControl *ctl, const vshCmd *cmd)
|
||||
_("Snapshot %s XML configuration not changed.\n"), \
|
||||
name); \
|
||||
ret = true; \
|
||||
goto cleanup; \
|
||||
goto edit_cleanup; \
|
||||
}
|
||||
#define EDIT_DEFINE \
|
||||
(strstr(doc, "<state>disk-snapshot</state>") ? \
|
||||
@@ -487,10 +487,10 @@ cmdSnapshotEdit(vshControl *ctl, const vshCmd *cmd)
|
||||
ret = true;
|
||||
|
||||
cleanup:
|
||||
if (!ret)
|
||||
vshError(ctl, _("Failed to update %s"), name);
|
||||
if (edited)
|
||||
virDomainSnapshotFree(edited);
|
||||
else
|
||||
vshError(ctl, _("Failed to update %s"), name);
|
||||
if (snapshot)
|
||||
virDomainSnapshotFree(snapshot);
|
||||
if (dom)
|
||||
|
||||
Reference in New Issue
Block a user