]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: fix missing prompt message for 'snapshot-delete' command
authorNan Zhang <nzhang@redhat.com>
Wed, 13 Jul 2011 08:36:32 +0000 (16:36 +0800)
committerEric Blake <eblake@redhat.com>
Wed, 13 Jul 2011 17:28:42 +0000 (11:28 -0600)
Make the command 'virsh snapshot-delete' has the appropriate prompt
message when executing sucessful or failed.

AUTHORS
tools/virsh.c

diff --git a/AUTHORS b/AUTHORS
index 636fa63250b2afbb1d4b0afe0bea3f9fcfbb4633..64c5f8d0db4ac5ec22f07a03037051598a15fa6a 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -186,6 +186,7 @@ Patches have also been contributed by:
   Alex Jia             <ajia@redhat.com>
   Oskari Saarenmaa     <os@ohmu.fi>
   Peter Krempa         <pkrempa@redhat.com>
+  Nan Zhang            <nzhang@redhat.com>
 
   [....send patches to get your name here....]
 
index cd17f4249f8ff1dc8daba386b5a06b90047758a4..b7cea58a572ea855286eeb11151722cabf80f0ad 100644 (file)
@@ -11534,8 +11534,12 @@ cmdSnapshotDelete(vshControl *ctl, const vshCmd *cmd)
     if (snapshot == NULL)
         goto cleanup;
 
-    if (virDomainSnapshotDelete(snapshot, flags) < 0)
+    if (virDomainSnapshotDelete(snapshot, flags) == 0) {
+        vshPrint(ctl, _("Domain snapshot %s deleted\n"), name);
+    } else {
+        vshError(ctl, _("Failed to delete snapshot %s"), name);
         goto cleanup;
+    }
 
     ret = true;