]> xenbits.xensource.com Git - libvirt.git/commitdiff
tools: Replace vshPrint with vshPrintExtra on places we forgot about
authorErik Skultety <eskultet@redhat.com>
Fri, 4 Nov 2016 14:22:26 +0000 (15:22 +0100)
committerErik Skultety <eskultet@redhat.com>
Mon, 14 Nov 2016 11:14:11 +0000 (12:14 +0100)
Although there already was an effort (b620bdee) to replace vshPrint occurrences
with vshPrintExtra due to '--quiet' flag, there were still some leftovers. So
this patch fixes them, hopefully for good.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1356881

Signed-off-by: Erik Skultety <eskultet@redhat.com>
tools/virsh-domain.c
tools/virsh-edit.c
tools/virsh-interface.c
tools/virsh-network.c
tools/virsh-nwfilter.c
tools/virsh-pool.c
tools/virsh-snapshot.c
tools/virsh-volume.c
tools/virt-admin.c

index a4f7eb15564f9e892dbf0e7d4444a842c3f91264..a133c81ace15fbd46c1670c9d8aebaf457b4f9bd 100644 (file)
@@ -2080,9 +2080,9 @@ cmdBlockCommit(vshControl *ctl, const vshCmd *cmd)
 
     if (!blocking) {
         if (active)
-            vshPrint(ctl, "%s", _("Active Block Commit started"));
+            vshPrintExtra(ctl, "%s", _("Active Block Commit started"));
         else
-            vshPrint(ctl, "%s", _("Block Commit started"));
+            vshPrintExtra(ctl, "%s", _("Block Commit started"));
 
         ret = true;
         goto cleanup;
@@ -2094,7 +2094,7 @@ cmdBlockCommit(vshControl *ctl, const vshCmd *cmd)
             goto cleanup;
 
         case VIR_DOMAIN_BLOCK_JOB_CANCELED:
-            vshPrint(ctl, "\n%s", _("Commit aborted"));
+            vshPrintExtra(ctl, "\n%s", _("Commit aborted"));
             goto cleanup;
             break;
 
@@ -2116,19 +2116,20 @@ cmdBlockCommit(vshControl *ctl, const vshCmd *cmd)
                 goto cleanup;
             }
 
-            vshPrint(ctl, "\n%s", _("Successfully pivoted"));
+            vshPrintExtra(ctl, "\n%s", _("Successfully pivoted"));
         } else if (finish) {
             if (virDomainBlockJobAbort(dom, path, abort_flags) < 0) {
                 vshError(ctl, _("failed to finish job for disk %s"), path);
                 goto cleanup;
             }
 
-            vshPrint(ctl, "\n%s", _("Commit complete, overlay image kept"));
+            vshPrintExtra(ctl, "\n%s", _("Commit complete, overlay "
+                                         "image kept"));
         } else {
-            vshPrint(ctl, "\n%s", _("Now in synchronized phase"));
+            vshPrintExtra(ctl, "\n%s", _("Now in synchronized phase"));
         }
     } else {
-        vshPrint(ctl, "\n%s", _("Commit complete"));
+        vshPrintExtra(ctl, "\n%s", _("Commit complete"));
     }
 
     ret = true;
@@ -2392,7 +2393,7 @@ cmdBlockCopy(vshControl *ctl, const vshCmd *cmd)
     }
 
     if (!blocking) {
-        vshPrint(ctl, "%s", _("Block Copy started"));
+        vshPrintExtra(ctl, "%s", _("Block Copy started"));
         ret = true;
         goto cleanup;
     }
@@ -2403,7 +2404,7 @@ cmdBlockCopy(vshControl *ctl, const vshCmd *cmd)
             goto cleanup;
 
         case VIR_DOMAIN_BLOCK_JOB_CANCELED:
-            vshPrint(ctl, "\n%s", _("Copy aborted"));
+            vshPrintExtra(ctl, "\n%s", _("Copy aborted"));
             goto cleanup;
             break;
 
@@ -2424,16 +2425,16 @@ cmdBlockCopy(vshControl *ctl, const vshCmd *cmd)
             goto cleanup;
         }
 
-        vshPrint(ctl, "\n%s", _("Successfully pivoted"));
+        vshPrintExtra(ctl, "\n%s", _("Successfully pivoted"));
     } else if (finish) {
         if (virDomainBlockJobAbort(dom, path, abort_flags) < 0) {
             vshError(ctl, _("failed to finish job for disk %s"), path);
             goto cleanup;
         }
 
-        vshPrint(ctl, "\n%s", _("Successfully copied"));
+        vshPrintExtra(ctl, "\n%s", _("Successfully copied"));
     } else {
-        vshPrint(ctl, "\n%s", _("Now in mirroring phase"));
+        vshPrintExtra(ctl, "\n%s", _("Now in mirroring phase"));
     }
 
     ret = true;
@@ -2571,7 +2572,7 @@ virshBlockJobInfo(vshControl *ctl,
 
     if (rc == 0) {
         if (!raw)
-            vshPrint(ctl, _("No current block job for %s"), path);
+            vshPrintExtra(ctl, _("No current block job for %s"), path);
         ret = true;
         goto cleanup;
     }
@@ -2802,7 +2803,7 @@ cmdBlockPull(vshControl *ctl, const vshCmd *cmd)
     }
 
     if (!blocking) {
-        vshPrint(ctl, "%s", _("Block Pull started"));
+        vshPrintExtra(ctl, "%s", _("Block Pull started"));
         ret = true;
         goto cleanup;
     }
@@ -2813,7 +2814,7 @@ cmdBlockPull(vshControl *ctl, const vshCmd *cmd)
             goto cleanup;
 
         case VIR_DOMAIN_BLOCK_JOB_CANCELED:
-            vshPrint(ctl, "\n%s", _("Pull aborted"));
+            vshPrintExtra(ctl, "\n%s", _("Pull aborted"));
             goto cleanup;
             break;
 
@@ -2824,7 +2825,7 @@ cmdBlockPull(vshControl *ctl, const vshCmd *cmd)
 
         case VIR_DOMAIN_BLOCK_JOB_READY:
         case VIR_DOMAIN_BLOCK_JOB_COMPLETED:
-            vshPrint(ctl, "\n%s", _("Pull complete"));
+            vshPrintExtra(ctl, "\n%s", _("Pull complete"));
             break;
     }
 
@@ -4563,18 +4564,18 @@ cmdSaveImageEdit(vshControl *ctl, const vshCmd *cmd)
 
 #define EDIT_GET_XML \
     virDomainSaveImageGetXMLDesc(priv->conn, file, getxml_flags)
-#define EDIT_NOT_CHANGED                                        \
-    do {                                                        \
-        vshPrint(ctl, _("Saved image %s XML configuration "     \
-                        "not changed.\n"), file);               \
-        ret = true;                                             \
-        goto edit_cleanup;                                      \
+#define EDIT_NOT_CHANGED                                             \
+    do {                                                             \
+        vshPrintExtra(ctl, _("Saved image %s XML configuration "     \
+                             "not changed.\n"), file);               \
+        ret = true;                                                  \
+        goto edit_cleanup;                                           \
     } while (0)
 #define EDIT_DEFINE \
     (virDomainSaveImageDefineXML(priv->conn, file, doc_edited, define_flags) == 0)
 #include "virsh-edit.c"
 
-    vshPrint(ctl, _("State file %s edited.\n"), file);
+    vshPrintExtra(ctl, _("State file %s edited.\n"), file);
     ret = true;
 
  cleanup:
@@ -12041,12 +12042,12 @@ cmdEdit(vshControl *ctl, const vshCmd *cmd)
         define_flags &= ~VIR_DOMAIN_DEFINE_VALIDATE;
 
 #define EDIT_GET_XML virDomainGetXMLDesc(dom, query_flags)
-#define EDIT_NOT_CHANGED                                                \
-    do {                                                                \
-        vshPrint(ctl, _("Domain %s XML configuration not changed.\n"),  \
-                 virDomainGetName(dom));                                \
-        ret = true;                                                     \
-        goto edit_cleanup;                                              \
+#define EDIT_NOT_CHANGED                                                     \
+    do {                                                                     \
+        vshPrintExtra(ctl, _("Domain %s XML configuration not changed.\n"),  \
+                      virDomainGetName(dom));                                \
+        ret = true;                                                          \
+        goto edit_cleanup;                                                   \
     } while (0)
 #define EDIT_DEFINE \
     (dom_edited = virshDomainDefine(priv->conn, doc_edited, define_flags))
@@ -12058,8 +12059,8 @@ cmdEdit(vshControl *ctl, const vshCmd *cmd)
 #include "virsh-edit.c"
 #undef EDIT_RELAX
 
-    vshPrint(ctl, _("Domain %s XML configuration edited.\n"),
-             virDomainGetName(dom_edited));
+    vshPrintExtra(ctl, _("Domain %s XML configuration edited.\n"),
+                  virDomainGetName(dom_edited));
 
     ret = true;
 
@@ -13177,7 +13178,7 @@ cmdDomFSFreeze(vshControl *ctl, const vshCmd *cmd)
         goto cleanup;
     }
 
-    vshPrint(ctl, _("Froze %d filesystem(s)\n"), ret);
+    vshPrintExtra(ctl, _("Froze %d filesystem(s)\n"), ret);
 
  cleanup:
     VIR_FREE(mountpoints);
@@ -13230,7 +13231,7 @@ cmdDomFSThaw(vshControl *ctl, const vshCmd *cmd)
         goto cleanup;
     }
 
-    vshPrint(ctl, _("Thawed %d filesystem(s)\n"), ret);
+    vshPrintExtra(ctl, _("Thawed %d filesystem(s)\n"), ret);
 
  cleanup:
     VIR_FREE(mountpoints);
index 1b39cb7d4525e2ade5e2c94d6134a134c7b72e69..16d6705fbbbdee73b3d5c087261aad7215015143 100644 (file)
@@ -25,8 +25,8 @@
  * EDIT_NOT_CHANGED - this action is taken if the XML wasn't changed.
  *      Note, that you don't want to jump to cleanup but edit_cleanup label
  *      where temporary variables are free()-d and temporary file is deleted:
- *      #define EDIT_NOT_CHANGED vshPrint(ctl, _("Domain %s XML not changed"), \
- *                                        virDomainGetName(dom)); \
+ *      #define EDIT_NOT_CHANGED vshPrintExtra (ctl, _("Domain %s XML not changed"), \
+ *                                              virDomainGetName(dom)); \
  *                               ret = true; goto edit_cleanup;
  *      Note that this is a statement.
  *
index 7274527a19982a6c76d1bc90cb57e71bc508a85d..9f7d1bd0d4a691538777e939d395a126a1edffc6 100644 (file)
@@ -125,19 +125,19 @@ cmdInterfaceEdit(vshControl *ctl, const vshCmd *cmd)
         goto cleanup;
 
 #define EDIT_GET_XML virInterfaceGetXMLDesc(iface, flags)
-#define EDIT_NOT_CHANGED                                                \
-    do {                                                                \
-        vshPrint(ctl, _("Interface %s XML configuration not changed.\n"), \
-                 virInterfaceGetName(iface));                           \
-        ret = true;                                                     \
-        goto edit_cleanup;                                              \
+#define EDIT_NOT_CHANGED                                                       \
+    do {                                                                       \
+        vshPrintExtra(ctl, _("Interface %s XML configuration not changed.\n"), \
+                 virInterfaceGetName(iface));                                  \
+        ret = true;                                                            \
+        goto edit_cleanup;                                                     \
     } while (0)
 #define EDIT_DEFINE \
     (iface_edited = virInterfaceDefineXML(priv->conn, doc_edited, 0))
 #include "virsh-edit.c"
 
-    vshPrint(ctl, _("Interface %s XML configuration edited.\n"),
-             virInterfaceGetName(iface_edited));
+    vshPrintExtra(ctl, _("Interface %s XML configuration edited.\n"),
+                  virInterfaceGetName(iface_edited));
 
     ret = true;
 
@@ -969,8 +969,8 @@ cmdInterfaceBridge(vshControl *ctl, const vshCmd *cmd)
         goto cleanup;
     }
 
-    vshPrint(ctl, _("Created bridge %s with attached device %s\n"),
-             br_name, if_name);
+    vshPrintExtra(ctl, _("Created bridge %s with attached device %s\n"),
+                  br_name, if_name);
 
     /* start it up unless requested not to */
     if (!nostart) {
@@ -978,7 +978,7 @@ cmdInterfaceBridge(vshControl *ctl, const vshCmd *cmd)
             vshError(ctl, _("Failed to start bridge interface %s"), br_name);
             goto cleanup;
         }
-        vshPrint(ctl, _("Bridge interface %s started\n"), br_name);
+        vshPrintExtra(ctl, _("Bridge interface %s started\n"), br_name);
     }
 
     ret = true;
@@ -1170,8 +1170,8 @@ cmdInterfaceUnbridge(vshControl *ctl, const vshCmd *cmd)
         goto cleanup;
     }
 
-    vshPrint(ctl, _("Device %s un-attached from bridge %s\n"),
-             if_name, br_name);
+    vshPrintExtra(ctl, _("Device %s un-attached from bridge %s\n"),
+                  if_name, br_name);
 
     /* unless requested otherwise, undefine the bridge device */
     if (!nostart) {
@@ -1179,7 +1179,7 @@ cmdInterfaceUnbridge(vshControl *ctl, const vshCmd *cmd)
             vshError(ctl, _("Failed to start interface %s"), if_name);
             goto cleanup;
         }
-        vshPrint(ctl, _("Interface %s started\n"), if_name);
+        vshPrintExtra(ctl, _("Interface %s started\n"), if_name);
     }
 
     ret = true;
index 431a750fb6ead18283de61f718afd19d5c7efea7..eacc2771b3d98d973a6c3a50c5244785e5c19770 100644 (file)
@@ -977,20 +977,21 @@ cmdNetworkUpdate(vshControl *ctl, const vshCmd *cmd)
 
     if (config) {
         if (live)
-            vshPrint(ctl, _("Updated network %s persistent config and live state"),
-                     virNetworkGetName(network));
+            vshPrintExtra(ctl, _("Updated network %s persistent config and "
+                                 "live state"),
+                          virNetworkGetName(network));
         else
-            vshPrint(ctl, _("Updated network %s persistent config"),
-                     virNetworkGetName(network));
+            vshPrintExtra(ctl, _("Updated network %s persistent config"),
+                          virNetworkGetName(network));
     } else if (live) {
-        vshPrint(ctl, _("Updated network %s live state"),
-                 virNetworkGetName(network));
+        vshPrintExtra(ctl, _("Updated network %s live state"),
+                      virNetworkGetName(network));
     } else if (virNetworkIsActive(network)) {
-        vshPrint(ctl, _("Updated network %s live state"),
-                 virNetworkGetName(network));
+        vshPrintExtra(ctl, _("Updated network %s live state"),
+                      virNetworkGetName(network));
     } else {
-        vshPrint(ctl, _("Updated network %s persistent config"),
-                 virNetworkGetName(network));
+        vshPrintExtra(ctl, _("Updated network %s persistent config"),
+                      virNetworkGetName(network));
     }
 
     ret = true;
@@ -1089,19 +1090,19 @@ cmdNetworkEdit(vshControl *ctl, const vshCmd *cmd)
         goto cleanup;
 
 #define EDIT_GET_XML virshNetworkGetXMLDesc(network)
-#define EDIT_NOT_CHANGED                                                \
-    do {                                                                \
-        vshPrint(ctl, _("Network %s XML configuration not changed.\n"), \
-                 virNetworkGetName(network));                           \
-        ret = true;                                                     \
-        goto edit_cleanup;                                              \
+#define EDIT_NOT_CHANGED                                                     \
+    do {                                                                     \
+        vshPrintExtra(ctl, _("Network %s XML configuration not changed.\n"), \
+                      virNetworkGetName(network));                           \
+        ret = true;                                                          \
+        goto edit_cleanup;                                                   \
     } while (0)
 #define EDIT_DEFINE \
     (network_edited = virNetworkDefineXML(priv->conn, doc_edited))
 #include "virsh-edit.c"
 
-    vshPrint(ctl, _("Network %s XML configuration edited.\n"),
-             virNetworkGetName(network_edited));
+    vshPrintExtra(ctl, _("Network %s XML configuration edited.\n"),
+                  virNetworkGetName(network_edited));
 
     ret = true;
 
index daf58a5a1a83fd0e473aa0f9617b94939669a244..d4a88b23ef0f63c2dad6b3d04785fc63ca906061 100644 (file)
@@ -416,7 +416,7 @@ cmdNWFilterEdit(vshControl *ctl, const vshCmd *cmd)
 #define EDIT_GET_XML virNWFilterGetXMLDesc(nwfilter, 0)
 #define EDIT_NOT_CHANGED                                        \
     do {                                                        \
-        vshPrint(ctl, _("Network filter %s XML "                \
+        vshPrintExtra(ctl, _("Network filter %s XML "           \
                         "configuration not changed.\n"),        \
                  virNWFilterGetName(nwfilter));                 \
         ret = true;                                             \
@@ -426,8 +426,8 @@ cmdNWFilterEdit(vshControl *ctl, const vshCmd *cmd)
     (nwfilter_edited = virNWFilterDefineXML(priv->conn, doc_edited))
 #include "virsh-edit.c"
 
-    vshPrint(ctl, _("Network filter %s XML configuration edited.\n"),
-             virNWFilterGetName(nwfilter_edited));
+    vshPrintExtra(ctl, _("Network filter %s XML configuration edited.\n"),
+                  virNWFilterGetName(nwfilter_edited));
 
     ret = true;
 
index 3bc96b204dd913c4ce705d387ccf5e0a2da411e6..7118a6cc18893654e95830d6d26d373da09cbb02 100644 (file)
@@ -1384,8 +1384,9 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
         goto cleanup;
 
     /* Display the header */
-    vshPrint(ctl, outputStr, _("Name"), _("State"), _("Autostart"),
-             _("Persistent"), _("Capacity"), _("Allocation"), _("Available"));
+    vshPrintExtra(ctl, outputStr, _("Name"), _("State"), _("Autostart"),
+                  _("Persistent"), _("Capacity"), _("Allocation"),
+                  _("Available"));
     for (i = nameStrLength + stateStrLength + autostartStrLength
                            + persistStrLength + capStrLength
                            + allocStrLength + availStrLength
@@ -1865,19 +1866,19 @@ cmdPoolEdit(vshControl *ctl, const vshCmd *cmd)
     }
 
 #define EDIT_GET_XML virStoragePoolGetXMLDesc(pool, flags)
-#define EDIT_NOT_CHANGED                                                \
-    do {                                                                \
-        vshPrint(ctl, _("Pool %s XML configuration not changed.\n"),    \
-                 virStoragePoolGetName(pool));                          \
-        ret = true;                                                     \
-        goto edit_cleanup;                                              \
+#define EDIT_NOT_CHANGED                                                     \
+    do {                                                                     \
+        vshPrintExtra(ctl, _("Pool %s XML configuration not changed.\n"),    \
+                 virStoragePoolGetName(pool));                               \
+        ret = true;                                                          \
+        goto edit_cleanup;                                                   \
     } while (0)
 #define EDIT_DEFINE \
     (pool_edited = virStoragePoolDefineXML(priv->conn, doc_edited, 0))
 #include "virsh-edit.c"
 
-    vshPrint(ctl, _("Pool %s XML configuration edited.\n"),
-             virStoragePoolGetName(pool_edited));
+    vshPrintExtra(ctl, _("Pool %s XML configuration edited.\n"),
+                  virStoragePoolGetName(pool_edited));
 
     ret = true;
 
index 95db0969e4084842b404da4b25224e52de595ae1..e4d0df7a2b0d5f5b6f17829e52dcc239dd4c3fb4 100644 (file)
@@ -556,16 +556,16 @@ cmdSnapshotEdit(vshControl *ctl, const vshCmd *cmd)
 
 #define EDIT_GET_XML \
     virDomainSnapshotGetXMLDesc(snapshot, getxml_flags)
-#define EDIT_NOT_CHANGED                                                \
-    do {                                                                \
-        /* Depending on flags, we re-edit even if XML is unchanged.  */ \
-        if (!(define_flags & VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT)) {     \
-            vshPrint(ctl,                                               \
-                     _("Snapshot %s XML configuration not changed.\n"), \
-                     name);                                             \
-            ret = true;                                                 \
-            goto edit_cleanup;                                          \
-        }                                                               \
+#define EDIT_NOT_CHANGED                                                     \
+    do {                                                                     \
+        /* Depending on flags, we re-edit even if XML is unchanged.  */      \
+        if (!(define_flags & VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT)) {          \
+            vshPrintExtra(ctl,                                               \
+                          _("Snapshot %s XML configuration not changed.\n"), \
+                          name);                                             \
+            ret = true;                                                      \
+            goto edit_cleanup;                                               \
+        }                                                                    \
     } while (0)
 #define EDIT_DEFINE \
     (strstr(doc, "<state>disk-snapshot</state>") ? \
index 8831f44d0d4b57416e1037dd437a1d4537b01309..96b4a7b1663d64509f88829434448271a733ff82 100644 (file)
@@ -1123,10 +1123,10 @@ cmdVolResize(vshControl *ctl, const vshCmd *cmd)
     }
 
     if (virStorageVolResize(vol, capacity, flags) == 0) {
-        vshPrint(ctl,
-                 delta ? _("Size of volume '%s' successfully changed by %s\n")
-                 : _("Size of volume '%s' successfully changed to %s\n"),
-                 virStorageVolGetName(vol), capacityStr);
+        vshPrintExtra(ctl,
+                      delta ? _("Size of volume '%s' successfully changed by %s\n")
+                      : _("Size of volume '%s' successfully changed to %s\n"),
+                      virStorageVolGetName(vol), capacityStr);
         ret = true;
     } else {
         vshError(ctl,
@@ -1502,8 +1502,8 @@ cmdVolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
         goto cleanup;
 
     /* Display the header */
-    vshPrint(ctl, outputStr, _("Name"), _("Path"), _("Type"),
-             ("Capacity"), _("Allocation"));
+    vshPrintExtra(ctl, outputStr, _("Name"), _("Path"), _("Type"),
+                  _("Capacity"), _("Allocation"));
     for (i = nameStrLength + pathStrLength + typeStrLength
                            + capStrLength + allocStrLength
                            + 10; i > 0; i--)
index b1e0c4900e24848bdf60408cd5c827c12e7597c2..70b0e517f42a747cf03ecdba840d4ab6cc2bd23b 100644 (file)
@@ -391,8 +391,8 @@ cmdSrvList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
         goto cleanup;
     }
 
-    printf(" %-5s %-15s\n", "Id", "Name");
-    printf("---------------\n");
+    vshPrintExtra(ctl, " %-5s %-15s\n", "Id", "Name");
+    vshPrintExtra(ctl, "---------------\n");
     for (i = 0; i < nsrvs; i++)
         vshPrint(ctl, " %-5zu %-15s\n", i, virAdmServerGetName(srvs[i]));