aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorGuannan Ren <gren@redhat.com>2012-08-22 04:37:34 +0800
committerGuannan Ren <gren@redhat.com>2012-08-22 19:15:03 +0800
commit44574a8789c4e97b0cf4ec020aec1f3927572b3a (patch)
treeb0d4e7add271092fcbf15a4a629ff3a86fb36469 /tools
parentFix typo in Makefile.am s/LDFOAGS/LDFLAGS/ (diff)
downloadlibvirt-44574a8789c4e97b0cf4ec020aec1f3927572b3a.tar.gz
libvirt-44574a8789c4e97b0cf4ec020aec1f3927572b3a.tar.bz2
libvirt-44574a8789c4e97b0cf4ec020aec1f3927572b3a.zip
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.
Diffstat (limited to 'tools')
-rw-r--r--tools/virsh-snapshot.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c
index aff91d3a8..5d84f7a5f 100644
--- a/tools/virsh-snapshot.c
+++ b/tools/virsh-snapshot.c
@@ -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)