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;
goto cleanup;
case VIR_DOMAIN_BLOCK_JOB_CANCELED:
- vshPrint(ctl, "\n%s", _("Commit aborted"));
+ vshPrintExtra(ctl, "\n%s", _("Commit aborted"));
goto cleanup;
break;
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;
}
if (!blocking) {
- vshPrint(ctl, "%s", _("Block Copy started"));
+ vshPrintExtra(ctl, "%s", _("Block Copy started"));
ret = true;
goto cleanup;
}
goto cleanup;
case VIR_DOMAIN_BLOCK_JOB_CANCELED:
- vshPrint(ctl, "\n%s", _("Copy aborted"));
+ vshPrintExtra(ctl, "\n%s", _("Copy aborted"));
goto cleanup;
break;
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;
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;
}
}
if (!blocking) {
- vshPrint(ctl, "%s", _("Block Pull started"));
+ vshPrintExtra(ctl, "%s", _("Block Pull started"));
ret = true;
goto cleanup;
}
goto cleanup;
case VIR_DOMAIN_BLOCK_JOB_CANCELED:
- vshPrint(ctl, "\n%s", _("Pull aborted"));
+ vshPrintExtra(ctl, "\n%s", _("Pull aborted"));
goto cleanup;
break;
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;
}
#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:
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))
#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;
goto cleanup;
}
- vshPrint(ctl, _("Froze %d filesystem(s)\n"), ret);
+ vshPrintExtra(ctl, _("Froze %d filesystem(s)\n"), ret);
cleanup:
VIR_FREE(mountpoints);
goto cleanup;
}
- vshPrint(ctl, _("Thawed %d filesystem(s)\n"), ret);
+ vshPrintExtra(ctl, _("Thawed %d filesystem(s)\n"), ret);
cleanup:
VIR_FREE(mountpoints);
* 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.
*
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;
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) {
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;
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) {
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;
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;
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;
#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; \
(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;
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
}
#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;
#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>") ? \
}
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,
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--)
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]));