tools: Replace vshPrint with vshPrintExtra on places we forgot about

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>
This commit is contained in:
Erik Skultety 2016-11-04 15:22:26 +01:00
parent 53525f914d
commit bdd6899b55
9 changed files with 101 additions and 98 deletions

View 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);

View 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.
*

View 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;

View 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;

View 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;

View 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;

View 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>") ? \

View 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--)

View 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]));