]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: Improve change-media success message
authorCole Robinson <crobinso@redhat.com>
Mon, 6 Apr 2015 17:59:46 +0000 (13:59 -0400)
committerCole Robinson <crobinso@redhat.com>
Wed, 15 Apr 2015 17:50:52 +0000 (13:50 -0400)
$ sudo virsh change-media f19 hdc /mnt/data/devel/media/Fedora-16-x86_64-Live-KDE.iso
succeeded to complete action update on media

Change the message to:

  Successfully {inserted,ejected,changed} media.

https://bugzilla.redhat.com/show_bug.cgi?id=967946
(cherry picked from commit e3aa4c91c8b54cdfb1c312a142fd9fb79daec65a)

tools/virsh-domain.c

index 80a96b2ae065e346d0f4c872f9c4f4cd6ca2ccfc..c737ad4d39eb8dbebbc47acb11927df2dd7407e2 100644 (file)
@@ -12104,6 +12104,7 @@ cmdChangeMedia(vshControl *ctl, const vshCmd *cmd)
     bool ret = false;
     int prepare_type = 0;
     const char *action = NULL;
+    const char *success_msg = NULL;
     bool config = vshCommandOptBool(cmd, "config");
     bool live = vshCommandOptBool(cmd, "live");
     bool current = vshCommandOptBool(cmd, "current");
@@ -12120,16 +12121,19 @@ cmdChangeMedia(vshControl *ctl, const vshCmd *cmd)
     if (eject) {
         prepare_type = VSH_PREPARE_DISK_XML_EJECT;
         action = "eject";
+        success_msg = _("Successfully ejected media.");
     }
 
     if (insert) {
         prepare_type = VSH_PREPARE_DISK_XML_INSERT;
         action = "insert";
+        success_msg = _("Successfully inserted media.");
     }
 
     if (update || (!eject && !insert)) {
         prepare_type = VSH_PREPARE_DISK_XML_UPDATE;
         action = "update";
+        success_msg = _("Successfully updated media.");
     }
 
     VSH_EXCLUSIVE_OPTIONS_VAR(current, live);
@@ -12174,7 +12178,7 @@ cmdChangeMedia(vshControl *ctl, const vshCmd *cmd)
         goto cleanup;
     }
 
-    vshPrint(ctl, _("succeeded to complete action %s on media\n"), action);
+    vshPrint(ctl, "%s", success_msg);
     ret = true;
 
  cleanup: