Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx> --- tools/virsh-checkpoint.c | 28 ++-- tools/virsh-domain-event.c | 65 ++++---- tools/virsh-domain-monitor.c | 24 +-- tools/virsh-domain.c | 312 +++++++++++++++++------------------ tools/virsh-edit.c | 2 +- tools/virsh-host.c | 46 +++--- tools/virsh-interface.c | 84 +++++----- tools/virsh-network.c | 71 ++++---- 8 files changed, 310 insertions(+), 322 deletions(-) diff --git a/tools/virsh-checkpoint.c b/tools/virsh-checkpoint.c index 9605c893af..727de34abb 100644 --- a/tools/virsh-checkpoint.c +++ b/tools/virsh-checkpoint.c @@ -59,10 +59,10 @@ virshCheckpointCreate(vshControl *ctl, } if (from) - vshPrintExtra(ctl, _("Domain checkpoint %s created from '%s'"), + vshPrintExtra(ctl, _("Domain checkpoint %1$s created from '%2$s'"), name, from); else - vshPrintExtra(ctl, _("Domain checkpoint %s created"), name); + vshPrintExtra(ctl, _("Domain checkpoint %1$s created"), name); return true; } @@ -179,7 +179,7 @@ virshParseCheckpointDiskspec(vshControl *ctl, ret = 0; cleanup: if (ret < 0) - vshError(ctl, _("unable to parse diskspec: %s"), str); + vshError(ctl, _("unable to parse diskspec: %1$s"), str); return ret; } @@ -293,7 +293,7 @@ virshLookupCheckpoint(vshControl *ctl, if (chkname) { *chk = virDomainCheckpointLookupByName(dom, chkname, 0); } else { - vshError(ctl, _("--%s is required"), arg); + vshError(ctl, _("--%1$s is required"), arg); return -1; } if (!*chk) { @@ -354,7 +354,7 @@ cmdCheckpointEdit(vshControl *ctl, #define EDIT_NOT_CHANGED \ do { \ vshPrintExtra(ctl, \ - _("Checkpoint %s XML configuration not changed.\n"), \ + _("Checkpoint %1$s XML configuration not changed.\n"), \ name); \ ret = true; \ goto edit_cleanup; \ @@ -365,16 +365,16 @@ cmdCheckpointEdit(vshControl *ctl, edited_name = virDomainCheckpointGetName(edited); if (STREQ(name, edited_name)) { - vshPrintExtra(ctl, _("Checkpoint %s edited.\n"), name); + vshPrintExtra(ctl, _("Checkpoint %1$s edited.\n"), name); } else { unsigned int delete_flags = VIR_DOMAIN_CHECKPOINT_DELETE_METADATA_ONLY; if (virDomainCheckpointDelete(edited, delete_flags) < 0) { vshReportError(ctl); - vshError(ctl, _("Failed to clean up %s"), edited_name); + vshError(ctl, _("Failed to clean up %1$s"), edited_name); goto cleanup; } - vshError(ctl, _("Cannot rename checkpoint %s to %s"), + vshError(ctl, _("Cannot rename checkpoint %1$s to %2$s"), name, edited_name); goto cleanup; } @@ -383,7 +383,7 @@ cmdCheckpointEdit(vshControl *ctl, cleanup: if (!ret && name) - vshError(ctl, _("Failed to update %s"), name); + vshError(ctl, _("Failed to update %1$s"), name); return ret; } @@ -705,7 +705,7 @@ cmdCheckpointList(vshControl *ctl, if (vshCommandOptBool(cmd, option)) { \ if (tree) { \ vshError(ctl, \ - _("--%s and --tree are mutually exclusive"), \ + _("--%1$s and --tree are mutually exclusive"), \ option); \ return false; \ } \ @@ -944,7 +944,7 @@ cmdCheckpointParent(vshControl *ctl, if (virshGetCheckpointParent(ctl, checkpoint, &parent) < 0) return false; if (!parent) { - vshError(ctl, _("checkpoint '%s' has no parent"), name); + vshError(ctl, _("checkpoint '%1$s' has no parent"), name); return false; } @@ -1016,11 +1016,11 @@ cmdCheckpointDelete(vshControl *ctl, if (virDomainCheckpointDelete(checkpoint, flags) == 0) { if (flags & VIR_DOMAIN_CHECKPOINT_DELETE_CHILDREN_ONLY) - vshPrintExtra(ctl, _("Domain checkpoint %s children deleted\n"), name); + vshPrintExtra(ctl, _("Domain checkpoint %1$s children deleted\n"), name); else - vshPrintExtra(ctl, _("Domain checkpoint %s deleted\n"), name); + vshPrintExtra(ctl, _("Domain checkpoint %1$s deleted\n"), name); } else { - vshError(ctl, _("Failed to delete checkpoint %s"), name); + vshError(ctl, _("Failed to delete checkpoint %1$s"), name); return false; } diff --git a/tools/virsh-domain-event.c b/tools/virsh-domain-event.c index 9531a5435c..2ad4573ee9 100644 --- a/tools/virsh-domain-event.c +++ b/tools/virsh-domain-event.c @@ -327,7 +327,7 @@ virshEventGenericPrint(virConnectPtr conn G_GNUC_UNUSED, { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virBufferAsprintf(&buf, _("event '%s' for domain '%s'\n"), + virBufferAsprintf(&buf, _("event '%1$s' for domain '%2$s'\n"), ((virshDomEventData *) opaque)->cb->name, virDomainGetName(dom)); virshEventPrint(opaque, &buf); @@ -342,7 +342,7 @@ virshEventLifecyclePrint(virConnectPtr conn G_GNUC_UNUSED, { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virBufferAsprintf(&buf, _("event 'lifecycle' for domain '%s': %s %s\n"), + virBufferAsprintf(&buf, _("event 'lifecycle' for domain '%1$s': %2$s %3$s\n"), virDomainGetName(dom), virshDomainEventToString(event), virshDomainEventDetailToString(event, detail)); @@ -357,7 +357,7 @@ virshEventRTCChangePrint(virConnectPtr conn G_GNUC_UNUSED, { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virBufferAsprintf(&buf, _("event 'rtc-change' for domain '%s': %lld\n"), + virBufferAsprintf(&buf, _("event 'rtc-change' for domain '%1$s': %2$lld\n"), virDomainGetName(dom), utcoffset); virshEventPrint(opaque, &buf); @@ -371,7 +371,7 @@ virshEventWatchdogPrint(virConnectPtr conn G_GNUC_UNUSED, { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virBufferAsprintf(&buf, _("event 'watchdog' for domain '%s': %s\n"), + virBufferAsprintf(&buf, _("event 'watchdog' for domain '%1$s': %2$s\n"), virDomainGetName(dom), virshDomainEventWatchdogToString(action)); virshEventPrint(opaque, &buf); @@ -387,7 +387,7 @@ virshEventIOErrorPrint(virConnectPtr conn G_GNUC_UNUSED, { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virBufferAsprintf(&buf, _("event 'io-error' for domain '%s': %s (%s) %s\n"), + virBufferAsprintf(&buf, _("event 'io-error' for domain '%1$s': %2$s (%3$s) %4$s\n"), virDomainGetName(dom), srcPath, devAlias, @@ -408,8 +408,8 @@ virshEventGraphicsPrint(virConnectPtr conn G_GNUC_UNUSED, g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; size_t i; - virBufferAsprintf(&buf, _("event 'graphics' for domain '%s': " - "%s local[%s %s %s] remote[%s %s %s] %s\n"), + virBufferAsprintf(&buf, _("event 'graphics' for domain '%1$s': " + "%2$s local[%3$s %4$s %5$s] remote[%6$s %7$s %8$s] %9$s\n"), virDomainGetName(dom), virshGraphicsPhaseToString(phase), virshGraphicsAddressToString(local->family), @@ -438,8 +438,8 @@ virshEventIOErrorReasonPrint(virConnectPtr conn G_GNUC_UNUSED, { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virBufferAsprintf(&buf, _("event 'io-error-reason' for domain '%s': " - "%s (%s) %s due to %s\n"), + virBufferAsprintf(&buf, _("event 'io-error-reason' for domain '%1$s': " + "%2$s (%3$s) %4$s due to %5$s\n"), virDomainGetName(dom), srcPath, devAlias, @@ -458,7 +458,7 @@ virshEventBlockJobPrint(virConnectPtr conn G_GNUC_UNUSED, { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virBufferAsprintf(&buf, _("event '%s' for domain '%s': %s for %s %s\n"), + virBufferAsprintf(&buf, _("event '%1$s' for domain '%2$s': %3$s for %4$s %5$s\n"), ((virshDomEventData *) opaque)->cb->name, virDomainGetName(dom), virshDomainBlockJobToString(type), @@ -478,8 +478,8 @@ virshEventDiskChangePrint(virConnectPtr conn G_GNUC_UNUSED, { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virBufferAsprintf(&buf, _("event 'disk-change' for domain '%s' disk %s: " - "%s -> %s: %s\n"), + virBufferAsprintf(&buf, _("event 'disk-change' for domain '%1$s' disk %2$s: " + "%3$s -> %4$s: %5$s\n"), virDomainGetName(dom), alias, NULLSTR(oldSrc), @@ -497,7 +497,7 @@ virshEventTrayChangePrint(virConnectPtr conn G_GNUC_UNUSED, { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virBufferAsprintf(&buf, _("event 'tray-change' for domain '%s' disk %s: %s\n"), + virBufferAsprintf(&buf, _("event 'tray-change' for domain '%1$s' disk %2$s: %3$s\n"), virDomainGetName(dom), alias, virshDomainEventTrayChangeToString(reason)); @@ -523,7 +523,7 @@ virshEventBalloonChangePrint(virConnectPtr conn G_GNUC_UNUSED, { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virBufferAsprintf(&buf, _("event 'balloon-change' for domain '%s': %lluKiB\n"), + virBufferAsprintf(&buf, _("event 'balloon-change' for domain '%1$s': %2$lluKiB\n"), virDomainGetName(dom), actual); virshEventPrint(opaque, &buf); @@ -537,7 +537,7 @@ virshEventDeviceRemovedPrint(virConnectPtr conn G_GNUC_UNUSED, { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virBufferAsprintf(&buf, _("event 'device-removed' for domain '%s': %s\n"), + virBufferAsprintf(&buf, _("event 'device-removed' for domain '%1$s': %2$s\n"), virDomainGetName(dom), alias); virshEventPrint(opaque, &buf); @@ -551,7 +551,7 @@ virshEventDeviceAddedPrint(virConnectPtr conn G_GNUC_UNUSED, { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virBufferAsprintf(&buf, _("event 'device-added' for domain '%s': %s\n"), + virBufferAsprintf(&buf, _("event 'device-added' for domain '%1$s': %2$s\n"), virDomainGetName(dom), alias); virshEventPrint(opaque, &buf); @@ -568,7 +568,7 @@ virshEventTunablePrint(virConnectPtr conn G_GNUC_UNUSED, size_t i; char *value; - virBufferAsprintf(&buf, _("event 'tunable' for domain '%s':\n"), + virBufferAsprintf(&buf, _("event 'tunable' for domain '%1$s':\n"), virDomainGetName(dom)); for (i = 0; i < nparams; i++) { value = virTypedParameterToString(¶ms[i]); @@ -604,8 +604,8 @@ virshEventAgentLifecyclePrint(virConnectPtr conn G_GNUC_UNUSED, { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virBufferAsprintf(&buf, _("event 'agent-lifecycle' for domain '%s': state: " - "'%s' reason: '%s'\n"), + virBufferAsprintf(&buf, _("event 'agent-lifecycle' for domain '%1$s': state: " + "'%2$s' reason: '%3$s'\n"), virDomainGetName(dom), UNKNOWNSTR(virshEventAgentLifecycleStateTypeToString(state)), UNKNOWNSTR(virshEventAgentLifecycleReasonTypeToString(reason))); @@ -620,8 +620,8 @@ virshEventMigrationIterationPrint(virConnectPtr conn G_GNUC_UNUSED, { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virBufferAsprintf(&buf, _("event 'migration-iteration' for domain '%s': " - "iteration: '%d'\n"), + virBufferAsprintf(&buf, _("event 'migration-iteration' for domain '%1$s': " + "iteration: '%2$d'\n"), virDomainGetName(dom), iteration); @@ -638,7 +638,7 @@ virshEventJobCompletedPrint(virConnectPtr conn G_GNUC_UNUSED, g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; size_t i; - virBufferAsprintf(&buf, _("event 'job-completed' for domain '%s':\n"), + virBufferAsprintf(&buf, _("event 'job-completed' for domain '%1$s':\n"), virDomainGetName(dom)); for (i = 0; i < nparams; i++) { g_autofree char *value = virTypedParameterToString(¶ms[i]); @@ -657,7 +657,7 @@ virshEventDeviceRemovalFailedPrint(virConnectPtr conn G_GNUC_UNUSED, { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virBufferAsprintf(&buf, _("event 'device-removal-failed' for domain '%s': %s\n"), + virBufferAsprintf(&buf, _("event 'device-removal-failed' for domain '%1$s': %2$s\n"), virDomainGetName(dom), alias); virshEventPrint(opaque, &buf); @@ -679,7 +679,7 @@ virshEventMetadataChangePrint(virConnectPtr conn G_GNUC_UNUSED, { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virBufferAsprintf(&buf, _("event 'metadata-change' for domain '%s': type %s, uri %s\n"), + virBufferAsprintf(&buf, _("event 'metadata-change' for domain '%1$s': type %2$s, uri %3$s\n"), virDomainGetName(dom), UNKNOWNSTR(virshEventMetadataChangeTypeTypeToString(type)), NULLSTR(nsuri)); @@ -698,8 +698,8 @@ virshEventBlockThresholdPrint(virConnectPtr conn G_GNUC_UNUSED, { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virBufferAsprintf(&buf, _("event 'block-threshold' for domain '%s': " - "dev: %s(%s) %llu %llu\n"), + virBufferAsprintf(&buf, _("event 'block-threshold' for domain '%1$s': " + "dev: %2$s(%3$s) %4$llu %5$llu\n"), virDomainGetName(dom), dev, NULLSTR(path), threshold, excess); virshEventPrint(opaque, &buf); @@ -730,13 +730,11 @@ virshEventMemoryFailurePrint(virConnectPtr conn G_GNUC_UNUSED, { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virBufferAsprintf(&buf, _("event 'memory-failure' for domain '%s':\n" - "recipient: %s\naction: %s\n"), + virBufferAsprintf(&buf, _("event 'memory-failure' for domain '%1$s':\nrecipient: %2$s\naction: %3$s\n"), virDomainGetName(dom), UNKNOWNSTR(virshEventMemoryFailureRecipientTypeTypeToString(recipient)), UNKNOWNSTR(virshEventMemoryFailureActionTypeTypeToString(action))); - virBufferAsprintf(&buf, _("flags:\n" - "\taction required: %d\n\trecursive: %d\n"), + virBufferAsprintf(&buf, _("flags:\n\taction required: %1$d\n\trecursive: %2$d\n"), !!(flags & VIR_DOMAIN_MEMORY_FAILURE_ACTION_REQUIRED), !!(flags & VIR_DOMAIN_MEMORY_FAILURE_RECURSIVE)); @@ -754,8 +752,7 @@ virshEventMemoryDeviceSizeChangePrint(virConnectPtr conn G_GNUC_UNUSED, g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; virBufferAsprintf(&buf, - _("event 'memory-device-size-change' for domain '%s':\n" - "alias: %s\nsize: %llu\n"), + _("event 'memory-device-size-change' for domain '%1$s':\nalias: %2$s\nsize: %3$llu\n"), virDomainGetName(dom), alias, size); virshEventPrint(opaque, &buf); @@ -932,7 +929,7 @@ cmdEvent(vshControl *ctl, const vshCmd *cmd) } if (ndata == 0) { - vshError(ctl, _("unknown event type %s"), eventName); + vshError(ctl, _("unknown event type %1$s"), eventName); return false; } @@ -975,7 +972,7 @@ cmdEvent(vshControl *ctl, const vshCmd *cmd) default: goto cleanup; } - vshPrint(ctl, _("events received: %d\n"), count); + vshPrint(ctl, _("events received: %1$d\n"), count); if (count) ret = true; diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index c2134faba1..ed426431a1 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -327,7 +327,7 @@ cmdDomMemStat(vshControl *ctl, const vshCmd *cmd) return false; if (rv > 0) { if (period < 0) { - vshError(ctl, _("Invalid collection period value '%d'"), period); + vshError(ctl, _("Invalid collection period value '%1$d'"), period); return false; } @@ -341,7 +341,7 @@ cmdDomMemStat(vshControl *ctl, const vshCmd *cmd) nr_stats = virDomainMemoryStats(dom, stats, VIR_DOMAIN_MEMORY_STAT_NR, 0); if (nr_stats == -1) { - vshError(ctl, _("Failed to get memory statistics for domain %s"), name); + vshError(ctl, _("Failed to get memory statistics for domain %1$s"), name); return false; } @@ -811,9 +811,9 @@ cmdDomIfGetLink(vshControl *ctl, const vshCmd *cmd) if (ninterfaces < 1) { if (macstr[0]) - vshError(ctl, _("Interface (mac: %s) not found."), macstr); + vshError(ctl, _("Interface (mac: %1$s) not found."), macstr); else - vshError(ctl, _("Interface (dev: %s) not found."), iface); + vshError(ctl, _("Interface (dev: %1$s) not found."), iface); return false; } else if (ninterfaces > 1) { @@ -986,14 +986,14 @@ cmdDomblkstat(vshControl *ctl, const vshCmd *cmd) if (virDomainBlockStats(dom, device, &stats, sizeof(stats)) == -1) { - vshError(ctl, _("Failed to get block stats %s %s"), + vshError(ctl, _("Failed to get block stats %1$s %2$s"), name, device); return false; } /* human friendly output */ if (human) { - vshPrint(ctl, N_("Device: %s\n"), device); + vshPrint(ctl, N_("Device: %1$s\n"), device); device = ""; } @@ -1005,13 +1005,13 @@ cmdDomblkstat(vshControl *ctl, const vshCmd *cmd) } else { params = g_new0(virTypedParameter, nparams); if (virDomainBlockStatsFlags(dom, device, params, &nparams, 0) < 0) { - vshError(ctl, _("Failed to get block stats for domain '%s' device '%s'"), name, device); + vshError(ctl, _("Failed to get block stats for domain '%1$s' device '%2$s'"), name, device); return false; } /* set for prettier output */ if (human) { - vshPrint(ctl, N_("Device: %s\n"), device); + vshPrint(ctl, N_("Device: %1$s\n"), device); device = ""; } @@ -1097,7 +1097,7 @@ cmdDomIfstat(vshControl *ctl, const vshCmd *cmd) return false; if (virDomainInterfaceStats(dom, device, &stats, sizeof(stats)) == -1) { - vshError(ctl, _("Failed to get interface stats %s %s"), name, device); + vshError(ctl, _("Failed to get interface stats %1$s %2$s"), name, device); return false; } @@ -1462,9 +1462,9 @@ cmdDomTime(vshControl *ctl, const vshCmd *cmd) then = g_date_time_new_from_unix_utc(seconds); thenstr = g_date_time_format(then, "%Y-%m-%d %H:%M:%S"); - vshPrint(ctl, _("Time: %s"), thenstr); + vshPrint(ctl, _("Time: %1$s"), thenstr); } else { - vshPrint(ctl, _("Time: %lld"), seconds); + vshPrint(ctl, _("Time: %1$lld"), seconds); } } @@ -2320,7 +2320,7 @@ cmdDomIfAddr(vshControl *ctl, const vshCmd *cmd) if (sourcestr && (source = virshDomainInterfaceAddressesSourceTypeFromString(sourcestr)) < 0) { - vshError(ctl, _("Unknown data source '%s'"), sourcestr); + vshError(ctl, _("Unknown data source '%1$s'"), sourcestr); return false; } diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index a4abcb1b03..6850843a25 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -248,7 +248,7 @@ virshFetchPassFdsList(vshControl *ctl, return 0; if (!(fdlist = g_strsplit(fdopt, ",", -1))) { - vshError(ctl, _("Unable to split FD list '%s'"), fdopt); + vshError(ctl, _("Unable to split FD list '%1$s'"), fdopt); return -1; } @@ -257,7 +257,7 @@ virshFetchPassFdsList(vshControl *ctl, for (i = 0; i < nfds; i++) { if (virStrToLong_i(fdlist[i], NULL, 10, fds + i) < 0) { - vshError(ctl, _("Unable to parse FD number '%s'"), fdlist[i]); + vshError(ctl, _("Unable to parse FD number '%1$s'"), fdlist[i]); return -1; } } @@ -405,7 +405,7 @@ cmdAttachDevice(vshControl *ctl, const vshCmd *cmd) rv = virDomainAttachDevice(dom, buffer); if (rv < 0) { - vshError(ctl, _("Failed to attach device from %s"), from); + vshError(ctl, _("Failed to attach device from %1$s"), from); return false; } @@ -677,7 +677,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd) if (stype && (type = virshAttachDiskSourceTypeFromString(stype)) < 0) { - vshError(ctl, _("Unknown source type: '%s'"), stype); + vshError(ctl, _("Unknown source type: '%1$s'"), stype); return false; } @@ -701,7 +701,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd) } if (mode && STRNEQ(mode, "readonly") && STRNEQ(mode, "shareable")) { - vshError(ctl, _("No support for %s in command 'attach-disk'"), mode); + vshError(ctl, _("No support for %1$s in command 'attach-disk'"), mode); return false; } @@ -902,7 +902,7 @@ VIR_ENUM_IMPL(virshDomainInterfaceSourceMode, if (index < ntok && \ *tok[index] != '\0' && \ virStrToLong_ullp(tok[index], NULL, 10, &rate->name) < 0) { \ - vshError(ctl, _("field '%s' is malformed"), #name); \ + vshError(ctl, _("field '%1$s' is malformed"), #name); \ return -1; \ } \ } while (0) @@ -919,7 +919,7 @@ virshParseRateStr(vshControl *ctl, return -1; if ((ntok = g_strv_length(tok)) > 4) { - vshError(ctl, _("Rate string '%s' has too many fields"), rateStr); + vshError(ctl, _("Rate string '%1$s' has too many fields"), rateStr); return -1; } @@ -978,14 +978,14 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd) /* check interface type */ if ((int)(typ = virDomainNetTypeFromString(type)) < 0) { - vshError(ctl, _("No support for %s in command 'attach-interface'"), + vshError(ctl, _("No support for %1$s in command 'attach-interface'"), type); return false; } if (sourceModeStr && (sourceMode = virshDomainInterfaceSourceModeTypeFromString(sourceModeStr)) < 0) { - vshError(ctl, _("Invalid source mode: %s"), sourceModeStr); + vshError(ctl, _("Invalid source mode: %1$s"), sourceModeStr); return false; } @@ -1036,7 +1036,7 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd) struct virshAddress addr = { 0 }; if (virshAddressParse(pciaddrstr, false, &addr) < 0) { - vshError(ctl, _("cannot parse pci address '%s' for network interface"), + vshError(ctl, _("cannot parse pci address '%1$s' for network interface"), source); return false; } @@ -1070,7 +1070,7 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd) case VIR_DOMAIN_NET_TYPE_NULL: case VIR_DOMAIN_NET_TYPE_VDS: case VIR_DOMAIN_NET_TYPE_LAST: - vshError(ctl, _("No support for %s in command 'attach-interface'"), + vshError(ctl, _("No support for %1$s in command 'attach-interface'"), type); return false; break; @@ -1183,16 +1183,16 @@ cmdAutostart(vshControl *ctl, const vshCmd *cmd) if (virDomainSetAutostart(dom, autostart) < 0) { if (autostart) - vshError(ctl, _("Failed to mark domain '%s' as autostarted"), name); + vshError(ctl, _("Failed to mark domain '%1$s' as autostarted"), name); else - vshError(ctl, _("Failed to unmark domain '%s' as autostarted"), name); + vshError(ctl, _("Failed to unmark domain '%1$s' as autostarted"), name); return false; } if (autostart) - vshPrintExtra(ctl, _("Domain '%s' marked as autostarted\n"), name); + vshPrintExtra(ctl, _("Domain '%1$s' marked as autostarted\n"), name); else - vshPrintExtra(ctl, _("Domain '%s' unmarked as autostarted\n"), name); + vshPrintExtra(ctl, _("Domain '%1$s' unmarked as autostarted\n"), name); return true; } @@ -1610,7 +1610,7 @@ cmdBlkiotune(vshControl * ctl, const vshCmd * cmd) goto cleanup; } else if (rv > 0) { if (weight <= 0) { - vshError(ctl, _("Invalid value of %d for I/O weight"), weight); + vshError(ctl, _("Invalid value of %1$d for I/O weight"), weight); goto cleanup; } if (virTypedParamsAddUInt(¶ms, &nparams, &maxparams, @@ -1936,7 +1936,7 @@ virshBlockJobWait(virshBlockJobWaitData *data) #endif /* !WIN32 */ if (result < 0) { - vshError(data->ctl, _("failed to query job for disk %s"), data->dev); + vshError(data->ctl, _("failed to query job for disk %1$s"), data->dev); goto cleanup; } @@ -1978,7 +1978,7 @@ virshBlockJobWait(virshBlockJobWaitData *data) if (intCaught || (data->timeout && (curr - start > data->timeout))) { if (virDomainBlockJobAbort(data->dom, data->dev, abort_flags) < 0) { - vshError(data->ctl, _("failed to abort job for disk '%s'"), + vshError(data->ctl, _("failed to abort job for disk '%1$s'"), data->dev); goto cleanup; } @@ -2205,14 +2205,14 @@ cmdBlockcommit(vshControl *ctl, const vshCmd *cmd) if (pivot) { abort_flags |= VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT; if (virDomainBlockJobAbort(dom, path, abort_flags) < 0) { - vshError(ctl, _("failed to pivot job for disk %s"), path); + vshError(ctl, _("failed to pivot job for disk %1$s"), path); goto cleanup; } 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); + vshError(ctl, _("failed to finish job for disk %1$s"), path); goto cleanup; } @@ -2451,7 +2451,7 @@ cmdBlockcopy(vshControl *ctl, const vshCmd *cmd) * ullong bytes/s; make sure we don't overflow */ unsigned long long limit = MIN(ULONG_MAX, ULLONG_MAX >> 20); if (bandwidth > limit) { - vshError(ctl, _("bandwidth must be less than %llu"), limit); + vshError(ctl, _("bandwidth must be less than %1$llu"), limit); goto cleanup; } @@ -2546,14 +2546,14 @@ cmdBlockcopy(vshControl *ctl, const vshCmd *cmd) if (pivot) { abort_flags |= VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT; if (virDomainBlockJobAbort(dom, path, abort_flags) < 0) { - vshError(ctl, _("failed to pivot job for disk %s"), path); + vshError(ctl, _("failed to pivot job for disk %1$s"), path); goto cleanup; } 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); + vshError(ctl, _("failed to finish job for disk %1$s"), path); goto cleanup; } @@ -2669,7 +2669,7 @@ virshBlockJobInfo(vshControl *ctl, if (!raw) { speed <<= 20; if (speed >> 20 != info.bandwidth) { - vshError(ctl, _("overflow in converting %ld MiB/s to bytes\n"), + vshError(ctl, _("overflow in converting %1$ld MiB/s to bytes\n"), info.bandwidth); return false; } @@ -2678,12 +2678,12 @@ virshBlockJobInfo(vshControl *ctl, if (rc == 0) { if (!raw) - vshPrintExtra(ctl, _("No current block job for %s"), path); + vshPrintExtra(ctl, _("No current block job for %1$s"), path); return true; } if (raw) { - vshPrint(ctl, _(" type=%s\n bandwidth=%lu\n cur=%llu\n end=%llu\n"), + vshPrint(ctl, _(" type=%1$s\n bandwidth=%2$lu\n cur=%3$llu\n end=%4$llu\n"), virshDomainBlockJobTypeToString(info.type), info.bandwidth, info.cur, info.end); } else { @@ -2692,7 +2692,7 @@ virshBlockJobInfo(vshControl *ctl, if (speed) { const char *unit; double val = vshPrettyCapacity(speed, &unit); - vshPrint(ctl, _(" Bandwidth limit: %llu bytes/s (%-.3lf %s/s)"), + vshPrint(ctl, _(" Bandwidth limit: %1$llu bytes/s (%2$-.3lf %3$s/s)"), speed, val, unit); } vshPrint(ctl, "\n"); @@ -2986,11 +2986,11 @@ cmdBlockresize(vshControl *ctl, const vshCmd *cmd) return false; if (virDomainBlockResize(dom, path, size, flags) < 0) { - vshError(ctl, _("Failed to resize block device '%s'"), path); + vshError(ctl, _("Failed to resize block device '%1$s'"), path); return false; } - vshPrintExtra(ctl, _("Block device '%s' is resized"), path); + vshPrintExtra(ctl, _("Block device '%1$s' is resized"), path); return true; } @@ -3049,8 +3049,8 @@ cmdRunConsole(vshControl *ctl, virDomainPtr dom, return false; } - vshPrintExtra(ctl, _("Connected to domain '%s'\n"), virDomainGetName(dom)); - vshPrintExtra(ctl, _("Escape character is %s"), priv->escapeChar); + vshPrintExtra(ctl, _("Connected to domain '%1$s'\n"), virDomainGetName(dom)); + vshPrintExtra(ctl, _("Escape character is %1$s"), priv->escapeChar); if (priv->escapeChar[0] == '^') vshPrintExtra(ctl, " (Ctrl + %c)", priv->escapeChar[1]); vshPrintExtra(ctl, "\n"); @@ -3150,7 +3150,7 @@ cmdDomIfSetLink(vshControl *ctl, const vshCmd *cmd) return false; if (STRNEQ(state, "up") && STRNEQ(state, "down")) { - vshError(ctl, _("invalid link state '%s'"), state); + vshError(ctl, _("invalid link state '%1$s'"), state); return false; } @@ -3192,7 +3192,7 @@ cmdDomIfSetLink(vshControl *ctl, const vshCmd *cmd) } if (!ifaceNode) { - vshError(ctl, _("interface '%s' not found"), iface); + vshError(ctl, _("interface '%1$s' not found"), iface); return false; } @@ -3318,7 +3318,7 @@ cmdDomIftune(vshControl *ctl, const vshCmd *cmd) * only accepts UINT */ if (inbound.average > UINT_MAX || inbound.peak > UINT_MAX || inbound.burst > UINT_MAX) { - vshError(ctl, _("inbound rate larger than maximum %u"), + vshError(ctl, _("inbound rate larger than maximum %1$u"), UINT_MAX); goto cleanup; } @@ -3358,7 +3358,7 @@ cmdDomIftune(vshControl *ctl, const vshCmd *cmd) goto cleanup; if (outbound.average > UINT_MAX || outbound.peak > UINT_MAX || outbound.burst > UINT_MAX) { - vshError(ctl, _("outbound rate larger than maximum %u"), + vshError(ctl, _("outbound rate larger than maximum %1$u"), UINT_MAX); goto cleanup; } @@ -3462,11 +3462,11 @@ cmdSuspend(vshControl *ctl, const vshCmd *cmd) return false; if (virDomainSuspend(dom) != 0) { - vshError(ctl, _("Failed to suspend domain '%s'"), name); + vshError(ctl, _("Failed to suspend domain '%1$s'"), name); return false; } - vshPrintExtra(ctl, _("Domain '%s' suspended\n"), name); + vshPrintExtra(ctl, _("Domain '%1$s' suspended\n"), name); return true; } @@ -3528,12 +3528,12 @@ cmdDomPMSuspend(vshControl *ctl, const vshCmd *cmd) } if (virDomainPMSuspendForDuration(dom, suspendTarget, duration, 0) < 0) { - vshError(ctl, _("Domain '%s' could not be suspended"), + vshError(ctl, _("Domain '%1$s' could not be suspended"), virDomainGetName(dom)); return false; } - vshPrintExtra(ctl, _("Domain '%s' successfully suspended"), + vshPrintExtra(ctl, _("Domain '%1$s' successfully suspended"), virDomainGetName(dom)); return true; @@ -3570,12 +3570,12 @@ cmdDomPMWakeup(vshControl *ctl, const vshCmd *cmd) return false; if (virDomainPMWakeup(dom, flags) < 0) { - vshError(ctl, _("Domain '%s' could not be woken up"), + vshError(ctl, _("Domain '%1$s' could not be woken up"), virDomainGetName(dom)); return false; } - vshPrintExtra(ctl, _("Domain '%s' successfully woken up"), + vshPrintExtra(ctl, _("Domain '%1$s' successfully woken up"), virDomainGetName(dom)); return true; @@ -3858,7 +3858,7 @@ cmdUndefine(vshControl *ctl, const vshCmd *cmd) if (!source) { vshError(ctl, - _("Missing storage volume name for disk '%s'"), + _("Missing storage volume name for disk '%1$s'"), target); continue; } @@ -3866,7 +3866,7 @@ cmdUndefine(vshControl *ctl, const vshCmd *cmd) if (!(storagepool = virStoragePoolLookupByName(priv->conn, pool))) { vshError(ctl, - _("Storage pool '%s' for volume '%s' not found."), + _("Storage pool '%1$s' for volume '%2$s' not found."), pool, target); vshResetLibvirtError(); continue; @@ -3880,8 +3880,8 @@ cmdUndefine(vshControl *ctl, const vshCmd *cmd) if (!vol.vol) { vshError(ctl, - _("Storage volume '%s'(%s) is not managed by libvirt. " - "Remove it manually.\n"), target, source); + _("Storage volume '%1$s'(%2$s) is not managed by libvirt. Remove it manually.\n"), + target, source); vshResetLibvirtError(); continue; } @@ -3897,8 +3897,8 @@ cmdUndefine(vshControl *ctl, const vshCmd *cmd) for (i = 0; i < nvol_list; i++) { if (vol_list[i]) { vshError(ctl, - _("Volume '%s' was not found in domain's " - "definition.\n"), vol_list[i]); + _("Volume '%1$s' was not found in domain's definition.\n"), + vol_list[i]); found = true; } } @@ -3945,10 +3945,10 @@ cmdUndefine(vshControl *ctl, const vshCmd *cmd) * without support for the newer flags. Oh well. */ if (has_snapshots_metadata) { if (snapshots_metadata) - vshError(ctl, _("Unable to remove metadata of %d snapshots"), + vshError(ctl, _("Unable to remove metadata of %1$d snapshots"), has_snapshots_metadata); else - vshError(ctl, _("Refusing to undefine while %d snapshots exist"), + vshError(ctl, _("Refusing to undefine while %1$d snapshots exist"), has_snapshots_metadata); goto cleanup; @@ -3958,10 +3958,10 @@ cmdUndefine(vshControl *ctl, const vshCmd *cmd) out: if (rc == 0) { - vshPrintExtra(ctl, _("Domain '%s' has been undefined\n"), name); + vshPrintExtra(ctl, _("Domain '%1$s' has been undefined\n"), name); ret = true; } else { - vshError(ctl, _("Failed to undefine domain '%s'"), name); + vshError(ctl, _("Failed to undefine domain '%1$s'"), name); goto cleanup; } @@ -3969,7 +3969,7 @@ cmdUndefine(vshControl *ctl, const vshCmd *cmd) if (nvols) { for (i = 0; i < nvols; i++) { if (wipe_storage) { - vshPrintExtra(ctl, _("Wiping volume '%s'(%s) ... "), + vshPrintExtra(ctl, _("Wiping volume '%1$s'(%2$s) ... "), vols[i].target, vols[i].source); fflush(stdout); if (virStorageVolWipe(vols[i].vol, 0) < 0) { @@ -3983,11 +3983,11 @@ cmdUndefine(vshControl *ctl, const vshCmd *cmd) /* delete the volume */ if (virStorageVolDelete(vols[i].vol, vol_flags) < 0) { - vshError(ctl, _("Failed to remove storage volume '%s'(%s)"), + vshError(ctl, _("Failed to remove storage volume '%1$s'(%2$s)"), vols[i].target, vols[i].source); ret = false; } else { - vshPrintExtra(ctl, _("Volume '%s'(%s) removed.\n"), + vshPrintExtra(ctl, _("Volume '%1$s'(%2$s) removed.\n"), vols[i].target, vols[i].source); } } @@ -4140,12 +4140,12 @@ cmdStart(vshControl *ctl, const vshCmd *cmd) } if (rc < 0) { - vshError(ctl, _("Failed to start domain '%s'"), virDomainGetName(dom)); + vshError(ctl, _("Failed to start domain '%1$s'"), virDomainGetName(dom)); return false; } started: - vshPrintExtra(ctl, _("Domain '%s' started\n"), + vshPrintExtra(ctl, _("Domain '%1$s' started\n"), virDomainGetName(dom)); #ifndef WIN32 if (console && !cmdRunConsole(ctl, dom, NULL, 0)) @@ -4250,7 +4250,7 @@ doSave(void *opaque) } if (rc < 0) { - vshError(ctl, _("Failed to save domain '%s' to %s"), name, to); + vshError(ctl, _("Failed to save domain '%1$s' to %2$s"), name, to); goto out; } @@ -4505,7 +4505,7 @@ cmdSave(vshControl *ctl, const vshCmd *cmd) virThreadJoin(&workerThread); if (!data.ret) - vshPrintExtra(ctl, _("\nDomain '%s' saved to %s\n"), name, to); + vshPrintExtra(ctl, _("\nDomain '%1$s' saved to %2$s\n"), name, to); return !data.ret; } @@ -4632,11 +4632,11 @@ cmdSaveImageDefine(vshControl *ctl, const vshCmd *cmd) return false; if (virDomainSaveImageDefineXML(priv->conn, file, xml, flags) < 0) { - vshError(ctl, _("Failed to update %s"), file); + vshError(ctl, _("Failed to update %1$s"), file); return false; } - vshPrintExtra(ctl, _("State file %s updated.\n"), file); + vshPrintExtra(ctl, _("State file %1$s updated.\n"), file); return true; } @@ -4697,8 +4697,8 @@ cmdSaveImageEdit(vshControl *ctl, const vshCmd *cmd) virDomainSaveImageGetXMLDesc(priv->conn, file, getxml_flags) #define EDIT_NOT_CHANGED \ do { \ - vshPrintExtra(ctl, _("Saved image %s XML configuration " \ - "not changed.\n"), file); \ + vshPrintExtra(ctl, _("Saved image %1$s XML configuration not changed.\n"), \ + file); \ ret = true; \ goto edit_cleanup; \ } while (0) @@ -4706,7 +4706,7 @@ cmdSaveImageEdit(vshControl *ctl, const vshCmd *cmd) (virDomainSaveImageDefineXML(priv->conn, file, doc_edited, define_flags) == 0) #include "virsh-edit.c" - vshPrintExtra(ctl, _("State file %s edited.\n"), file); + vshPrintExtra(ctl, _("State file %1$s edited.\n"), file); ret = true; cleanup: @@ -4779,7 +4779,7 @@ doManagedsave(void *opaque) goto out; if (virDomainManagedSave(dom, flags) < 0) { - vshError(ctl, _("Failed to save domain '%s' state"), name); + vshError(ctl, _("Failed to save domain '%1$s' state"), name); goto out; } @@ -4826,7 +4826,7 @@ cmdManagedSave(vshControl *ctl, const vshCmd *cmd) virThreadJoin(&workerThread); if (!data.ret) - vshPrintExtra(ctl, _("\nDomain '%s' state saved by libvirt\n"), name); + vshPrintExtra(ctl, _("\nDomain '%1$s' state saved by libvirt\n"), name); return !data.ret; } @@ -4866,18 +4866,18 @@ cmdManagedSaveRemove(vshControl *ctl, const vshCmd *cmd) } if (hassave == 0) { - vshPrintExtra(ctl, _("Domain '%s' has no manage save image; removal skipped"), + vshPrintExtra(ctl, _("Domain '%1$s' has no manage save image; removal skipped"), name); return true; } if (virDomainManagedSaveRemove(dom, 0) < 0) { - vshError(ctl, _("Failed to remove managed save image for domain '%s'"), + vshError(ctl, _("Failed to remove managed save image for domain '%1$s'"), name); return false; } - vshPrintExtra(ctl, _("Removed managedsave image for domain '%s'"), name); + vshPrintExtra(ctl, _("Removed managedsave image for domain '%1$s'"), name); return true; } @@ -4930,8 +4930,8 @@ cmdManagedSaveEdit(vshControl *ctl, const vshCmd *cmd) #define EDIT_GET_XML virDomainManagedSaveGetXMLDesc(dom, getxml_flags) #define EDIT_NOT_CHANGED \ do { \ - vshPrintExtra(ctl, _("Managed save image of domain '%s' XML configuration " \ - "not changed.\n"), virDomainGetName(dom)); \ + vshPrintExtra(ctl, _("Managed save image of domain '%1$s' XML configuration not changed.\n"), \ + virDomainGetName(dom)); \ ret = true; \ goto edit_cleanup; \ } while (0) @@ -4939,7 +4939,7 @@ cmdManagedSaveEdit(vshControl *ctl, const vshCmd *cmd) (virDomainManagedSaveDefineXML(dom, doc_edited, define_flags) == 0) #include "virsh-edit.c" - vshPrintExtra(ctl, _("Managed save image of Domain '%s' XML configuration edited.\n"), + vshPrintExtra(ctl, _("Managed save image of Domain '%1$s' XML configuration edited.\n"), virDomainGetName(dom)); ret = true; @@ -5060,12 +5060,12 @@ cmdManagedSaveDefine(vshControl *ctl, const vshCmd *cmd) return false; if (virDomainManagedSaveDefineXML(dom, xml, flags) < 0) { - vshError(ctl, _("Failed to update %s XML configuration"), + vshError(ctl, _("Failed to update %1$s XML configuration"), virDomainGetName(dom)); return false; } - vshPrintExtra(ctl, _("Managed save state file of domain '%s' updated.\n"), + vshPrintExtra(ctl, _("Managed save state file of domain '%1$s' updated.\n"), virDomainGetName(dom)); return true; } @@ -5131,7 +5131,7 @@ cmdSchedInfoUpdateOne(vshControl *ctl, return 0; } - vshError(ctl, _("invalid scheduler option: %s"), field); + vshError(ctl, _("invalid scheduler option: %1$s"), field); return -1; } @@ -5370,11 +5370,11 @@ cmdRestore(vshControl *ctl, const vshCmd *cmd) } if (rc < 0) { - vshError(ctl, _("Failed to restore domain from %s"), from); + vshError(ctl, _("Failed to restore domain from %1$s"), from); return false; } - vshPrintExtra(ctl, _("Domain restored from %s\n"), from); + vshPrintExtra(ctl, _("Domain restored from %1$s\n"), from); return true; } @@ -5482,9 +5482,8 @@ doDump(void *opaque) if (vshCommandOptStringQuiet(ctl, cmd, "format", &format) > 0) { if ((dumpformat = virshDomainCoreDumpFormatTypeFromString(format)) < 0) { - vshError(ctl, _("format '%s' is not supported, expecting " - "'kdump-zlib', 'kdump-lzo', 'kdump-snappy', " - "'win-dmp' or 'elf'"), format); + vshError(ctl, _("format '%1$s' is not supported, expecting 'kdump-zlib', 'kdump-lzo', 'kdump-snappy', 'win-dmp' or 'elf'"), + format); goto out; } } @@ -5492,12 +5491,12 @@ doDump(void *opaque) if (dumpformat != VIR_DOMAIN_CORE_DUMP_FORMAT_RAW) { if (virDomainCoreDumpWithFormat(dom, to, dumpformat, flags) < 0) { - vshError(ctl, _("Failed to core dump domain '%s' to %s"), name, to); + vshError(ctl, _("Failed to core dump domain '%1$s' to %2$s"), name, to); goto out; } } else { if (virDomainCoreDump(dom, to, flags) < 0) { - vshError(ctl, _("Failed to core dump domain '%s' to %s"), name, to); + vshError(ctl, _("Failed to core dump domain '%1$s' to %2$s"), name, to); goto out; } } @@ -5551,7 +5550,7 @@ cmdDump(vshControl *ctl, const vshCmd *cmd) if (data.ret) return false; - vshPrintExtra(ctl, _("\nDomain '%s' dumped to %s\n"), name, to); + vshPrintExtra(ctl, _("\nDomain '%1$s' dumped to %2$s\n"), name, to); return true; } @@ -5639,7 +5638,7 @@ cmdScreenshot(vshControl *ctl, const vshCmd *cmd) mime = virDomainScreenshot(dom, st, screen, flags); if (!mime) { - vshError(ctl, _("could not take a screenshot of %s"), name); + vshError(ctl, _("could not take a screenshot of %1$s"), name); goto cleanup; } @@ -5652,7 +5651,7 @@ cmdScreenshot(vshControl *ctl, const vshCmd *cmd) if ((fd = open(file, O_WRONLY|O_CREAT|O_EXCL, 0666)) < 0) { if (errno != EEXIST || (fd = open(file, O_WRONLY|O_TRUNC, 0666)) < 0) { - vshError(ctl, _("cannot create file %s"), file); + vshError(ctl, _("cannot create file %1$s"), file); goto cleanup; } } else { @@ -5663,21 +5662,21 @@ cmdScreenshot(vshControl *ctl, const vshCmd *cmd) cbdata.fd = fd; if (virStreamRecvAll(st, virshStreamSink, &cbdata) < 0) { - vshError(ctl, _("could not receive data from domain '%s'"), name); + vshError(ctl, _("could not receive data from domain '%1$s'"), name); goto cleanup; } if (VIR_CLOSE(fd) < 0) { - vshError(ctl, _("cannot close file %s"), file); + vshError(ctl, _("cannot close file %1$s"), file); goto cleanup; } if (virStreamFinish(st) < 0) { - vshError(ctl, _("cannot close stream on domain '%s'"), name); + vshError(ctl, _("cannot close stream on domain '%1$s'"), name); goto cleanup; } - vshPrintExtra(ctl, _("Screenshot saved to %s, with type of %s"), file, mime); + vshPrintExtra(ctl, _("Screenshot saved to %1$s, with type of %2$s"), file, mime); ret = true; cleanup: @@ -5764,13 +5763,13 @@ cmdSetLifecycleAction(vshControl *ctl, const vshCmd *cmd) } if ((tmpVal = virshDomainLifecycleTypeFromString(typeStr)) < 0) { - vshError(ctl, _("Invalid lifecycle type '%s'."), typeStr); + vshError(ctl, _("Invalid lifecycle type '%1$s'."), typeStr); return false; } type = tmpVal; if ((tmpVal = virshDomainLifecycleActionTypeFromString(actionStr)) < 0) { - vshError(ctl, _("Invalid lifecycle action '%s'."), actionStr); + vshError(ctl, _("Invalid lifecycle action '%1$s'."), actionStr); return false; } action = tmpVal; @@ -5842,7 +5841,7 @@ cmdSetUserPassword(vshControl *ctl, const vshCmd *cmd) if (virDomainSetUserPassword(dom, user, password, flags) < 0) return false; - vshPrintExtra(ctl, _("Password set successfully for %s in %s"), user, name); + vshPrintExtra(ctl, _("Password set successfully for %1$s in %2$s"), user, name); return true; } /* @@ -5873,11 +5872,11 @@ cmdResume(vshControl *ctl, const vshCmd *cmd) return false; if (virDomainResume(dom) != 0) { - vshError(ctl, _("Failed to resume domain '%s'"), name); + vshError(ctl, _("Failed to resume domain '%1$s'"), name); return false; } - vshPrintExtra(ctl, _("Domain '%s' resumed\n"), name); + vshPrintExtra(ctl, _("Domain '%1$s' resumed\n"), name); return true; } @@ -5937,9 +5936,8 @@ cmdShutdown(vshControl *ctl, const vshCmd *cmd) } else if (STREQ(mode, "paravirt")) { flags |= VIR_DOMAIN_SHUTDOWN_PARAVIRT; } else { - vshError(ctl, _("Unknown mode %s value, expecting " - "'acpi', 'agent', 'initctl', 'signal', " - "or 'paravirt'"), mode); + vshError(ctl, _("Unknown mode %1$s value, expecting 'acpi', 'agent', 'initctl', 'signal', or 'paravirt'"), + mode); return false; } tmp++; @@ -5954,11 +5952,11 @@ cmdShutdown(vshControl *ctl, const vshCmd *cmd) rv = virDomainShutdown(dom); if (rv != 0) { - vshError(ctl, _("Failed to shutdown domain '%s'"), name); + vshError(ctl, _("Failed to shutdown domain '%1$s'"), name); return false; } - vshPrintExtra(ctl, _("Domain '%s' is being shutdown\n"), name); + vshPrintExtra(ctl, _("Domain '%1$s' is being shutdown\n"), name); return true; } @@ -6017,9 +6015,8 @@ cmdReboot(vshControl *ctl, const vshCmd *cmd) } else if (STREQ(mode, "paravirt")) { flags |= VIR_DOMAIN_REBOOT_PARAVIRT; } else { - vshError(ctl, _("Unknown mode %s value, expecting " - "'acpi', 'agent', 'initctl', 'signal' " - "or 'paravirt'"), mode); + vshError(ctl, _("Unknown mode %1$s value, expecting 'acpi', 'agent', 'initctl', 'signal' or 'paravirt'"), + mode); return false; } tmp++; @@ -6029,11 +6026,11 @@ cmdReboot(vshControl *ctl, const vshCmd *cmd) return false; if (virDomainReboot(dom, flags) != 0) { - vshError(ctl, _("Failed to reboot domain '%s'"), name); + vshError(ctl, _("Failed to reboot domain '%1$s'"), name); return false; } - vshPrintExtra(ctl, _("Domain '%s' is being rebooted\n"), name); + vshPrintExtra(ctl, _("Domain '%1$s' is being rebooted\n"), name); return true; } @@ -6065,11 +6062,11 @@ cmdReset(vshControl *ctl, const vshCmd *cmd) return false; if (virDomainReset(dom, 0) != 0) { - vshError(ctl, _("Failed to reset domain '%s'"), name); + vshError(ctl, _("Failed to reset domain '%1$s'"), name); return false; } - vshPrintExtra(ctl, _("Domain '%s' was reset\n"), name); + vshPrintExtra(ctl, _("Domain '%1$s' was reset\n"), name); return true; } @@ -6762,7 +6759,7 @@ virshVcpuinfoPrintAffinity(vshControl *ctl, if (pretty) { if (!(str = virBitmapDataFormat(cpumap, VIR_CPU_MAPLEN(maxcpu)))) return -1; - vshPrint(ctl, _("%s (out of %d)"), str, maxcpu); + vshPrint(ctl, _("%1$s (out of %2$d)"), str, maxcpu); } else { for (i = 0; i < maxcpu; i++) { if (VIR_CPU_USED(cpumap, i)) @@ -7026,11 +7023,11 @@ virshVcpuPinQuery(vshControl *ctl, (!(flags & VIR_DOMAIN_AFFECT_CONFIG) && virDomainIsActive(dom) == 1)) vshError(ctl, - _("vcpu %d is out of range of live cpu count %d"), + _("vcpu %1$d is out of range of live cpu count %2$d"), vcpu, ncpus); else vshError(ctl, - _("vcpu %d is out of range of persistent cpu count %d"), + _("vcpu %1$d is out of range of persistent cpu count %2$d"), vcpu, ncpus); return false; } @@ -7081,12 +7078,12 @@ virshParseCPUList(vshControl *ctl, int *cpumaplen, if (virBitmapParse(cpulist, &map, 1024) < 0 || virBitmapIsAllClear(map)) { - vshError(ctl, _("Invalid cpulist '%s'"), cpulist); + vshError(ctl, _("Invalid cpulist '%1$s'"), cpulist); return NULL; } lastcpu = virBitmapLastSetBit(map); if (lastcpu >= maxcpu) { - vshError(ctl, _("CPU %d in cpulist '%s' exceed the maxcpu %d"), + vshError(ctl, _("CPU %1$d in cpulist '%2$s' exceed the maxcpu %3$d"), lastcpu, cpulist, maxcpu); return NULL; } @@ -7786,7 +7783,7 @@ cmdIOThreadAdd(vshControl *ctl, const vshCmd *cmd) if (vshCommandOptInt(ctl, cmd, "id", &iothread_id) < 0) return false; if (iothread_id <= 0) { - vshError(ctl, _("Invalid IOThread id value: '%d'"), iothread_id); + vshError(ctl, _("Invalid IOThread id value: '%1$d'"), iothread_id); return false; } @@ -7876,7 +7873,7 @@ cmdIOThreadSet(vshControl *ctl, const vshCmd *cmd) if (vshCommandOptInt(ctl, cmd, "id", &id) < 0) goto cleanup; if (id <= 0) { - vshError(ctl, _("Invalid IOThread id value: '%d'"), id); + vshError(ctl, _("Invalid IOThread id value: '%1$d'"), id); goto cleanup; } @@ -7986,7 +7983,7 @@ cmdIOThreadDel(vshControl *ctl, const vshCmd *cmd) if (vshCommandOptInt(ctl, cmd, "id", &iothread_id) < 0) return false; if (iothread_id <= 0) { - vshError(ctl, _("Invalid IOThread id value: '%d'"), iothread_id); + vshError(ctl, _("Invalid IOThread id value: '%1$d'"), iothread_id); return false; } @@ -8102,7 +8099,7 @@ cmdCPUStats(vshControl *ctl, const vshCmd *cmd) if (show_count < 0 || show_count > max_id) { if (show_count > max_id) - vshPrint(ctl, _("Only %d CPUs available to show\n"), max_id); + vshPrint(ctl, _("Only %1$d CPUs available to show\n"), max_id); show_count = max_id - cpu; } @@ -8172,7 +8169,7 @@ cmdCPUStats(vshControl *ctl, const vshCmd *cmd) return ret; failed_stats: - vshError(ctl, _("Failed to retrieve CPU statistics for domain '%s'"), + vshError(ctl, _("Failed to retrieve CPU statistics for domain '%1$s'"), virDomainGetName(dom)); goto cleanup; } @@ -8260,11 +8257,11 @@ cmdCreate(vshControl *ctl, const vshCmd *cmd) dom = virDomainCreateXML(priv->conn, buffer, flags); if (!dom) { - vshError(ctl, _("Failed to create domain from %s"), from); + vshError(ctl, _("Failed to create domain from %1$s"), from); return false; } - vshPrintExtra(ctl, _("Domain '%s' created from %s\n"), + vshPrintExtra(ctl, _("Domain '%1$s' created from %2$s\n"), virDomainGetName(dom), from); #ifndef WIN32 if (console) @@ -8319,11 +8316,11 @@ cmdDefine(vshControl *ctl, const vshCmd *cmd) dom = virDomainDefineXML(priv->conn, buffer); if (!dom) { - vshError(ctl, _("Failed to define domain from %s"), from); + vshError(ctl, _("Failed to define domain from %1$s"), from); return false; } - vshPrintExtra(ctl, _("Domain '%s' defined from %s\n"), + vshPrintExtra(ctl, _("Domain '%1$s' defined from %2$s\n"), virDomainGetName(dom), from); return true; } @@ -8376,11 +8373,11 @@ cmdDestroy(vshControl *ctl, const vshCmd *cmd) result = virDomainDestroy(dom); if (result < 0) { - vshError(ctl, _("Failed to destroy domain '%s'"), name); + vshError(ctl, _("Failed to destroy domain '%1$s'"), name); return false; } - vshPrintExtra(ctl, _("Domain '%s' destroyed\n"), name); + vshPrintExtra(ctl, _("Domain '%1$s' destroyed\n"), name); return true; } @@ -8538,9 +8535,9 @@ cmdDesc(vshControl *ctl, const vshCmd *cmd) vshPrint(ctl, "%s", desc); } else { if (title) - vshPrintExtra(ctl, _("No title for domain: %s"), virDomainGetName(dom)); + vshPrintExtra(ctl, _("No title for domain: %1$s"), virDomainGetName(dom)); else - vshPrintExtra(ctl, _("No description for domain: %s"), virDomainGetName(dom)); + vshPrintExtra(ctl, _("No description for domain: %1$s"), virDomainGetName(dom)); } } @@ -8795,7 +8792,7 @@ cmdSendKey(vshControl *ctl, const vshCmd *cmd) codeset = virKeycodeSetTypeFromString(codeset_option); if (codeset < 0) { - vshError(ctl, _("unknown codeset: '%s'"), codeset_option); + vshError(ctl, _("unknown codeset: '%1$s'"), codeset_option); return false; } @@ -8807,7 +8804,7 @@ cmdSendKey(vshControl *ctl, const vshCmd *cmd) if ((keycode = virshKeyCodeGetInt(opt->data)) < 0) { if ((keycode = virKeycodeValueFromString(codeset, opt->data)) < 0) { - vshError(ctl, _("invalid keycode: '%s'"), opt->data); + vshError(ctl, _("invalid keycode: '%1$s'"), opt->data); return false; } } @@ -8907,7 +8904,7 @@ cmdSendProcessSignal(vshControl *ctl, const vshCmd *cmd) return false; if ((signum = getSignalNumber(signame)) < 0) { - vshError(ctl, _("malformed signal name: %s"), signame); + vshError(ctl, _("malformed signal name: %1$s"), signame); return false; } @@ -9327,7 +9324,7 @@ cmdMemtune(vshControl *ctl, const vshCmd *cmd) #define PARSE_MEMTUNE_PARAM(NAME, FIELD) \ if ((rc = virshMemtuneGetSize(ctl, cmd, NAME, &tmpVal)) < 0) { \ - vshError(ctl, _("Unable to parse integer parameter %s"), NAME); \ + vshError(ctl, _("Unable to parse integer parameter %1$s"), NAME); \ goto cleanup; \ } \ if (rc == 1) { \ @@ -9603,7 +9600,7 @@ cmdNumatune(vshControl * ctl, const vshCmd * cmd) */ if ((m = virDomainNumatuneMemModeTypeFromString(mode)) < 0 && virStrToLong_i(mode, NULL, 0, &m) < 0) { - vshError(ctl, _("Invalid mode: %s"), mode); + vshError(ctl, _("Invalid mode: %1$s"), mode); goto cleanup; } @@ -9992,7 +9989,7 @@ cmdQemuMonitorCommandQMPWrap(vshControl *ctl, virBufferAddLit(&buf, "}"); if (!(arguments = virJSONValueFromString(virBufferCurrentContent(&buf)))) { - vshError(ctl, _("failed to wrap arguments '%s' into a QMP command wrapper"), + vshError(ctl, _("failed to wrap arguments '%1$s' into a QMP command wrapper"), fullargs); return NULL; } @@ -10232,7 +10229,7 @@ cmdQemuMonitorEvent(vshControl *ctl, const vshCmd *cmd) default: goto cleanup; } - vshPrint(ctl, _("events received: %d\n"), data.count); + vshPrint(ctl, _("events received: %1$d\n"), data.count); if (data.count) ret = true; @@ -10280,11 +10277,11 @@ cmdQemuAttach(vshControl *ctl, const vshCmd *cmd) return false; if (!(dom = virDomainQemuAttach(priv->conn, pid_value, flags))) { - vshError(ctl, _("Failed to attach to pid %u"), pid_value); + vshError(ctl, _("Failed to attach to pid %1$u"), pid_value); return false; } - vshPrintExtra(ctl, _("Domain '%s' attached to pid %u\n"), + vshPrintExtra(ctl, _("Domain '%1$s' attached to pid %2$u\n"), virDomainGetName(dom), pid_value); return true; } @@ -11247,7 +11244,7 @@ doMigrate(void *opaque) g_autofree char *xml = NULL; if (virFileReadAll(opt, VSH_MAX_XML_FILE, &xml) < 0) { - vshError(ctl, _("cannot read file '%s'"), opt); + vshError(ctl, _("cannot read file '%1$s'"), opt); goto save_error; } @@ -11263,7 +11260,7 @@ doMigrate(void *opaque) g_autofree char *xml = NULL; if (virFileReadAll(opt, VSH_MAX_XML_FILE, &xml) < 0) { - vshError(ctl, _("cannot read file '%s'"), opt); + vshError(ctl, _("cannot read file '%1$s'"), opt); goto save_error; } @@ -11697,7 +11694,7 @@ cmdMigrateCompCache(vshControl *ctl, const vshCmd *cmd) return false; value = vshPrettyCapacity(size, &unit); - vshPrint(ctl, _("Compression cache: %.3lf %s"), value, unit); + vshPrint(ctl, _("Compression cache: %1$.3lf %2$s"), value, unit); return true; } @@ -11874,7 +11871,7 @@ virshGetDBusDisplay(vshControl *ctl, xmlXPathContext *ctxt) return g_strdup_printf("dbus+unix://%s", addr + 10); } - vshError(ctl, _("'%s' D-Bus address is not handled"), addr); + vshError(ctl, _("'%1$s' D-Bus address is not handled"), addr); return NULL; } @@ -12073,7 +12070,7 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd) if (!ret) { if (type) - vshError(ctl, _("No graphical display with type '%s' found"), type); + vshError(ctl, _("No graphical display with type '%1$s' found"), type); else vshError(ctl, _("No graphical display found")); } @@ -12230,7 +12227,7 @@ cmdDomHostname(vshControl *ctl, const vshCmd *cmd) int source = virshDomainHostnameSourceTypeFromString(sourcestr); if (source < 0) { - vshError(ctl, _("Unknown data source '%s'"), sourcestr); + vshError(ctl, _("Unknown data source '%1$s'"), sourcestr); return false; } @@ -12323,7 +12320,7 @@ cmdDetachDevice(vshControl *ctl, const vshCmd *cmd) ret = virDomainDetachDevice(dom, buffer); if (ret < 0) { - vshError(ctl, _("Failed to detach device from %s"), from); + vshError(ctl, _("Failed to detach device from %1$s"), from); return false; } @@ -12384,7 +12381,7 @@ cmdDetachDeviceAlias(vshControl *ctl, const vshCmd *cmd) return false; if (virDomainDetachDeviceAlias(dom, alias, flags) < 0) { - vshError(ctl, _("Failed to detach device with alias %s"), alias); + vshError(ctl, _("Failed to detach device with alias %1$s"), alias); return false; } @@ -12461,7 +12458,7 @@ cmdUpdateDevice(vshControl *ctl, const vshCmd *cmd) flags |= VIR_DOMAIN_DEVICE_MODIFY_FORCE; if (virDomainUpdateDeviceFlags(dom, buffer, flags) < 0) { - vshError(ctl, _("Failed to update device from %s"), from); + vshError(ctl, _("Failed to update device from %1$s"), from); return false; } @@ -12532,7 +12529,7 @@ virshDomainDetachInterface(char *doc, } if ((nnodes = virXPathNodeSet(xpath, ctxt, &nodes)) <= 0) { - vshError(ctl, _("No interface found whose type is %s"), type); + vshError(ctl, _("No interface found whose type is %1$s"), type); return false; } @@ -12547,9 +12544,8 @@ virshDomainDetachInterface(char *doc, if (virMacAddrCompare(tmp_mac, mac) == 0) { if (matchNode) { /* this is the 2nd match, so it's ambiguous */ - vshError(ctl, _("Domain has multiple interfaces matching " - "MAC address %s. You must use detach-device and " - "specify the device pci address to remove it."), + vshError(ctl, _("Domain has multiple interfaces matching MAC address %1$s. " + "You must use detach-device and specify the device pci address to remove it."), mac); return false; } @@ -12560,7 +12556,7 @@ virshDomainDetachInterface(char *doc, } } else { if (nnodes > 1) { - vshError(ctl, _("Domain has %zd interfaces. Please specify which one to detach using --mac"), + vshError(ctl, _("Domain has %1$zd interfaces. Please specify which one to detach using --mac"), nnodes); return false; } @@ -12569,7 +12565,7 @@ virshDomainDetachInterface(char *doc, } if (!matchNode) { - vshError(ctl, _("No interface with MAC address %s was found"), mac); + vshError(ctl, _("No interface with MAC address %1$s was found"), mac); return false; } @@ -12750,7 +12746,7 @@ virshFindDisk(const char *doc, } } - vshError(NULL, _("No disk found whose source path or target is %s"), path); + vshError(NULL, _("No disk found whose source path or target is %1$s"), path); return NULL; } @@ -12789,7 +12785,7 @@ virshUpdateDiskXML(xmlNodePtr disk_node, if (!(STREQ_NULLABLE(device_type, "cdrom") || STREQ_NULLABLE(device_type, "floppy"))) { - vshError(NULL, _("The disk device '%s' is not removable"), target); + vshError(NULL, _("The disk device '%1$s' is not removable"), target); return NULL; } @@ -12823,7 +12819,7 @@ virshUpdateDiskXML(xmlNodePtr disk_node, if (type == VIRSH_UPDATE_DISK_XML_EJECT) { if (!source) { - vshError(NULL, _("The disk device '%s' doesn't have media"), target); + vshError(NULL, _("The disk device '%1$s' doesn't have media"), target); return NULL; } @@ -12843,7 +12839,7 @@ virshUpdateDiskXML(xmlNodePtr disk_node, source_path = virXMLPropString(source, "name"); if (source_path && type == VIRSH_UPDATE_DISK_XML_INSERT) { - vshError(NULL, _("The disk device '%s' already has media"), target); + vshError(NULL, _("The disk device '%1$s' already has media"), target); return NULL; } @@ -13042,7 +13038,7 @@ cmdEdit(vshControl *ctl, const vshCmd *cmd) #define EDIT_GET_XML virDomainGetXMLDesc(dom, query_flags) #define EDIT_NOT_CHANGED \ do { \ - vshPrintExtra(ctl, _("Domain '%s' XML configuration not changed.\n"), \ + vshPrintExtra(ctl, _("Domain '%1$s' XML configuration not changed.\n"), \ virDomainGetName(dom)); \ ret = true; \ goto edit_cleanup; \ @@ -13057,7 +13053,7 @@ cmdEdit(vshControl *ctl, const vshCmd *cmd) #include "virsh-edit.c" #undef EDIT_RELAX - vshPrintExtra(ctl, _("Domain '%s' XML configuration edited.\n"), + vshPrintExtra(ctl, _("Domain '%1$s' XML configuration edited.\n"), virDomainGetName(dom_edited)); ret = true; @@ -13217,7 +13213,7 @@ cmdChangeMedia(vshControl *ctl, const vshCmd *cmd) } if (virDomainUpdateDeviceFlags(dom, disk_xml, flags) != 0) { - vshError(ctl, _("Failed to complete action %s on media"), action); + vshError(ctl, _("Failed to complete action %1$s on media"), action); return false; } @@ -13315,7 +13311,7 @@ cmdDomFSFreeze(vshControl *ctl, const vshCmd *cmd) return false; } - vshPrintExtra(ctl, _("Froze %d filesystem(s)\n"), count); + vshPrintExtra(ctl, _("Froze %1$d filesystem(s)\n"), count); return true; } @@ -13360,7 +13356,7 @@ cmdDomFSThaw(vshControl *ctl, const vshCmd *cmd) return false; } - vshPrintExtra(ctl, _("Thawed %d filesystem(s)\n"), count); + vshPrintExtra(ctl, _("Thawed %1$d filesystem(s)\n"), count); return true; } @@ -13712,7 +13708,7 @@ cmdSetUserSSHKeys(vshControl *ctl, const vshCmd *cmd) nkeys = g_strv_length(keys); if (nkeys == 0) { - vshError(ctl, _("File %s contains no keys"), from); + vshError(ctl, _("File %1$s contains no keys"), from); return false; } } @@ -13785,7 +13781,7 @@ cmdDomDirtyRateCalc(vshControl *ctl, const vshCmd *cmd) int mode = virshDomainDirtyRateCalcModeTypeFromString(modestr); if (mode < 0) { - vshError(ctl, _("Unknown calculation mode '%s'"), modestr); + vshError(ctl, _("Unknown calculation mode '%1$s'"), modestr); return false; } diff --git a/tools/virsh-edit.c b/tools/virsh-edit.c index 5dc1a1fe5a..990dd97516 100644 --- a/tools/virsh-edit.c +++ b/tools/virsh-edit.c @@ -25,7 +25,7 @@ * 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 vshPrintExtra (ctl, _("Domain %s XML not changed"), \ + * #define EDIT_NOT_CHANGED vshPrintExtra (ctl, _("Domain %1$s XML not changed"), \ * virDomainGetName(dom)); \ * ret = true; goto edit_cleanup; * Note that this is a statement. diff --git a/tools/virsh-host.c b/tools/virsh-host.c index 21d479fd01..4df599afdf 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -219,8 +219,8 @@ cmdFreecell(vshControl *ctl, const vshCmd *cmd) nodes_id[i] = id; if (virNodeGetCellsFreeMemory(priv->conn, &(nodes_free[i]), id, 1) != 1) { - vshError(ctl, _("failed to get free memory for NUMA node " - "number: %lu"), id); + vshError(ctl, _("failed to get free memory for NUMA node number: %1$lu"), + id); return false; } } @@ -337,7 +337,7 @@ cmdFreepages(vshControl *ctl, const vshCmd *cmd) g_autofree char *val = virXMLPropString(nodes[i], "size"); if (virStrToLong_uip(val, NULL, 10, &pagesize[i]) < 0) { - vshError(ctl, _("unable to parse page size: %s"), val); + vshError(ctl, _("unable to parse page size: %1$s"), val); goto cleanup; } } @@ -374,7 +374,7 @@ cmdFreepages(vshControl *ctl, const vshCmd *cmd) g_autofree char *val = virXMLPropString(nodes[i], "id"); if (virStrToLong_i(val, NULL, 10, &cell) < 0) { - vshError(ctl, _("unable to parse numa node id: %s"), val); + vshError(ctl, _("unable to parse numa node id: %1$s"), val); goto cleanup; } @@ -382,7 +382,7 @@ cmdFreepages(vshControl *ctl, const vshCmd *cmd) cell, 1, counts, 0) < 0) goto cleanup; - vshPrint(ctl, _("Node %d:\n"), cell); + vshPrint(ctl, _("Node %1$d:\n"), cell); for (j = 0; j < npages; j++) vshPrint(ctl, "%uKiB: %lld\n", pagesize[j], counts[j]); vshPrint(ctl, "%c", '\n'); @@ -1135,9 +1135,8 @@ vshExtractCPUDefXMLs(vshControl *ctl, return NULL; if (n == 0) { - vshError(ctl, _("File '%s' does not contain any <cpu> element or " - "valid domain XML, host capabilities XML, or " - "domain capabilities XML"), xmlFile); + vshError(ctl, _("File '%1$s' does not contain any <cpu> element or valid domain XML, host capabilities XML, or domain capabilities XML"), + xmlFile); return NULL; } @@ -1219,24 +1218,24 @@ cmdCPUCompare(vshControl *ctl, const vshCmd *cmd) switch (result) { case VIR_CPU_COMPARE_INCOMPATIBLE: - vshPrint(ctl, _("CPU described in %s is incompatible with host CPU\n"), + vshPrint(ctl, _("CPU described in %1$s is incompatible with host CPU\n"), from); return false; break; case VIR_CPU_COMPARE_IDENTICAL: - vshPrint(ctl, _("CPU described in %s is identical to host CPU\n"), + vshPrint(ctl, _("CPU described in %1$s is identical to host CPU\n"), from); break; case VIR_CPU_COMPARE_SUPERSET: - vshPrint(ctl, _("Host CPU is a superset of CPU described in %s\n"), + vshPrint(ctl, _("Host CPU is a superset of CPU described in %1$s\n"), from); break; case VIR_CPU_COMPARE_ERROR: default: - vshError(ctl, _("Failed to compare host CPU with %s"), from); + vshError(ctl, _("Failed to compare host CPU with %1$s"), from); return false; } @@ -1397,7 +1396,7 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) includeVersion %= 1000000; minor = includeVersion / 1000; rel = includeVersion % 1000; - vshPrint(ctl, _("Compiled against library: libvirt %d.%d.%d\n"), + vshPrint(ctl, _("Compiled against library: libvirt %1$d.%2$d.%3$d\n"), major, minor, rel); if (virGetVersion(&libVersion, hvType, &apiVersion) < 0) { @@ -1408,14 +1407,14 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) libVersion %= 1000000; minor = libVersion / 1000; rel = libVersion % 1000; - vshPrint(ctl, _("Using library: libvirt %d.%d.%d\n"), + vshPrint(ctl, _("Using library: libvirt %1$d.%2$d.%3$d\n"), major, minor, rel); major = apiVersion / 1000000; apiVersion %= 1000000; minor = apiVersion / 1000; rel = apiVersion % 1000; - vshPrint(ctl, _("Using API: %s %d.%d.%d\n"), hvType, + vshPrint(ctl, _("Using API: %1$s %2$d.%3$d.%4$d\n"), hvType, major, minor, rel); if (virConnectGetVersion(priv->conn, &hvVersion) < 0) { @@ -1424,14 +1423,14 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) } if (hvVersion == 0) { vshPrint(ctl, - _("Cannot extract running %s hypervisor version\n"), hvType); + _("Cannot extract running %1$s hypervisor version\n"), hvType); } else { major = hvVersion / 1000000; hvVersion %= 1000000; minor = hvVersion / 1000; rel = hvVersion % 1000; - vshPrint(ctl, _("Running hypervisor: %s %d.%d.%d\n"), + vshPrint(ctl, _("Running hypervisor: %1$s %2$d.%3$d.%4$d\n"), hvType, major, minor, rel); } @@ -1443,7 +1442,7 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) daemonVersion %= 1000000; minor = daemonVersion / 1000; rel = daemonVersion % 1000; - vshPrint(ctl, _("Running against daemon: %d.%d.%d\n"), + vshPrint(ctl, _("Running against daemon: %1$d.%2$d.%3$d\n"), major, minor, rel); } } @@ -1644,29 +1643,26 @@ cmdHypervisorCPUCompare(vshControl *ctl, switch (result) { case VIR_CPU_COMPARE_INCOMPATIBLE: vshPrint(ctl, - _("CPU described in %s is incompatible with the CPU provided " - "by hypervisor on the host\n"), + _("CPU described in %1$s is incompatible with the CPU provided by hypervisor on the host\n"), from); return false; break; case VIR_CPU_COMPARE_IDENTICAL: vshPrint(ctl, - _("CPU described in %s is identical to the CPU provided by " - "hypervisor on the host\n"), + _("CPU described in %1$s is identical to the CPU provided by hypervisor on the host\n"), from); break; case VIR_CPU_COMPARE_SUPERSET: vshPrint(ctl, - _("The CPU provided by hypervisor on the host is a superset " - "of CPU described in %s\n"), + _("The CPU provided by hypervisor on the host is a superset of CPU described in %1$s\n"), from); break; case VIR_CPU_COMPARE_ERROR: default: - vshError(ctl, _("Failed to compare hypervisor CPU with %s"), from); + vshError(ctl, _("Failed to compare hypervisor CPU with %1$s"), from); return false; } diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index 39ea53ec9d..77c0fff847 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -83,7 +83,7 @@ virshCommandOptInterfaceBy(vshControl *ctl, const vshCmd *cmd, } if (!iface) - vshError(ctl, _("failed to get interface '%s'"), n); + vshError(ctl, _("failed to get interface '%1$s'"), n); return iface; } @@ -122,7 +122,7 @@ cmdInterfaceEdit(vshControl *ctl, const vshCmd *cmd) #define EDIT_GET_XML virInterfaceGetXMLDesc(iface, flags) #define EDIT_NOT_CHANGED \ do { \ - vshPrintExtra(ctl, _("Interface %s XML configuration not changed.\n"), \ + vshPrintExtra(ctl, _("Interface %1$s XML configuration not changed.\n"), \ virInterfaceGetName(iface)); \ ret = true; \ goto edit_cleanup; \ @@ -131,7 +131,7 @@ cmdInterfaceEdit(vshControl *ctl, const vshCmd *cmd) (iface_edited = virInterfaceDefineXML(priv->conn, doc_edited, 0)) #include "virsh-edit.c" - vshPrintExtra(ctl, _("Interface %s XML configuration edited.\n"), + vshPrintExtra(ctl, _("Interface %1$s XML configuration edited.\n"), virInterfaceGetName(iface_edited)); ret = true; @@ -550,11 +550,11 @@ cmdInterfaceDefine(vshControl *ctl, const vshCmd *cmd) return false; if (!(iface = virInterfaceDefineXML(priv->conn, buffer, flags))) { - vshError(ctl, _("Failed to define interface from %s"), from); + vshError(ctl, _("Failed to define interface from %1$s"), from); return false; } - vshPrintExtra(ctl, _("Interface %s defined from %s\n"), + vshPrintExtra(ctl, _("Interface %1$s defined from %2$s\n"), virInterfaceGetName(iface), from); return true; } @@ -587,11 +587,11 @@ cmdInterfaceUndefine(vshControl *ctl, const vshCmd *cmd) return false; if (virInterfaceUndefine(iface) < 0) { - vshError(ctl, _("Failed to undefine interface %s"), name); + vshError(ctl, _("Failed to undefine interface %1$s"), name); return false; } - vshPrintExtra(ctl, _("Interface %s undefined\n"), name); + vshPrintExtra(ctl, _("Interface %1$s undefined\n"), name); return true; } @@ -623,11 +623,11 @@ cmdInterfaceStart(vshControl *ctl, const vshCmd *cmd) return false; if (virInterfaceCreate(iface, 0) < 0) { - vshError(ctl, _("Failed to start interface %s"), name); + vshError(ctl, _("Failed to start interface %1$s"), name); return false; } - vshPrintExtra(ctl, _("Interface %s started\n"), name); + vshPrintExtra(ctl, _("Interface %1$s started\n"), name); return true; } @@ -659,11 +659,11 @@ cmdInterfaceDestroy(vshControl *ctl, const vshCmd *cmd) return false; if (virInterfaceDestroy(iface, 0) < 0) { - vshError(ctl, _("Failed to destroy interface %s"), name); + vshError(ctl, _("Failed to destroy interface %1$s"), name); return false; } - vshPrintExtra(ctl, _("Interface %s destroyed\n"), name); + vshPrintExtra(ctl, _("Interface %1$s destroyed\n"), name); return false; } @@ -832,7 +832,7 @@ cmdInterfaceBridge(vshControl *ctl, const vshCmd *cmd) /* make sure "new" device doesn't already exist */ if ((br_handle = virInterfaceLookupByName(priv->conn, br_name))) { - vshError(ctl, _("Network device %s already exists"), br_name); + vshError(ctl, _("Network device %1$s already exists"), br_name); goto cleanup; } @@ -849,26 +849,26 @@ cmdInterfaceBridge(vshControl *ctl, const vshCmd *cmd) goto cleanup; if (!(xml_doc = virXMLParseStringCtxt(if_xml, _("(interface definition)"), &ctxt))) { - vshError(ctl, _("Failed to parse configuration of %s"), if_name); + vshError(ctl, _("Failed to parse configuration of %1$s"), if_name); goto cleanup; } top_node = ctxt->node; /* Verify that the original device isn't already a bridge. */ if (!(if_type = virXMLPropString(top_node, "type"))) { - vshError(ctl, _("Existing device %s has no type"), if_name); + vshError(ctl, _("Existing device %1$s has no type"), if_name); goto cleanup; } if (STREQ(if_type, "bridge")) { - vshError(ctl, _("Existing device %s is already a bridge"), if_name); + vshError(ctl, _("Existing device %1$s is already a bridge"), if_name); goto cleanup; } /* verify the name in the XML matches the device name */ if (!(if2_name = virXMLPropString(top_node, "name")) || STRNEQ(if2_name, if_name)) { - vshError(ctl, _("Interface name from config %s doesn't match given supplied name %s"), + vshError(ctl, _("Interface name from config %1$s doesn't match given supplied name %2$s"), if2_name, if_name); goto cleanup; } @@ -890,7 +890,7 @@ cmdInterfaceBridge(vshControl *ctl, const vshCmd *cmd) if (stp) { delay_str = g_strdup_printf("%d", delay); if (!xmlSetProp(br_node, BAD_CAST "delay", BAD_CAST delay_str)) { - vshError(ctl, _("Failed to set bridge delay %d in xml document"), delay); + vshError(ctl, _("Failed to set bridge delay %1$d in xml document"), delay); goto cleanup; } } @@ -904,7 +904,7 @@ cmdInterfaceBridge(vshControl *ctl, const vshCmd *cmd) } if (!xmlSetProp(top_node, BAD_CAST "name", BAD_CAST br_name)) { - vshError(ctl, _("Failed to set master bridge interface name to '%s' in xml document"), + vshError(ctl, _("Failed to set master bridge interface name to '%1$s' in xml document"), br_name); goto cleanup; } @@ -921,13 +921,13 @@ cmdInterfaceBridge(vshControl *ctl, const vshCmd *cmd) * if_type, and the name to the original if_name. */ if (!xmlSetProp(if_node, BAD_CAST "type", BAD_CAST if_type)) { - vshError(ctl, _("Failed to set new attached interface type to '%s' in xml document"), + vshError(ctl, _("Failed to set new attached interface type to '%1$s' in xml document"), if_type); goto cleanup; } if (!xmlSetProp(if_node, BAD_CAST "name", BAD_CAST if_name)) { - vshError(ctl, _("Failed to set new attached interface name to '%s' in xml document"), + vshError(ctl, _("Failed to set new attached interface name to '%1$s' in xml document"), if_name); goto cleanup; } @@ -947,7 +947,7 @@ cmdInterfaceBridge(vshControl *ctl, const vshCmd *cmd) virXMLNodeNameEqual(old, "vlan"))) { /* vlan stuff to move down */ xmlUnlinkNode(old); if (!xmlAddChild(if_node, old)) { - vshError(ctl, _("Failed to move '%s' element in xml document"), old->name); + vshError(ctl, _("Failed to move '%1$s' element in xml document"), old->name); xmlFreeNode(old); goto cleanup; } @@ -958,7 +958,7 @@ cmdInterfaceBridge(vshControl *ctl, const vshCmd *cmd) xmlDocDumpMemory(xml_doc, &br_xml, &br_xml_size); if (!br_xml || br_xml_size <= 0) { - vshError(ctl, _("Failed to format new xml document for bridge %s"), br_name); + vshError(ctl, _("Failed to format new xml document for bridge %1$s"), br_name); goto cleanup; } @@ -967,21 +967,21 @@ cmdInterfaceBridge(vshControl *ctl, const vshCmd *cmd) * independent original interface. */ if (!(br_handle = virInterfaceDefineXML(priv->conn, (char *) br_xml, 0))) { - vshError(ctl, _("Failed to define new bridge interface %s"), + vshError(ctl, _("Failed to define new bridge interface %1$s"), br_name); goto cleanup; } - vshPrintExtra(ctl, _("Created bridge %s with attached device %s\n"), + vshPrintExtra(ctl, _("Created bridge %1$s with attached device %2$s\n"), br_name, if_name); /* start it up unless requested not to */ if (!nostart) { if (virInterfaceCreate(br_handle, 0) < 0) { - vshError(ctl, _("Failed to start bridge interface %s"), br_name); + vshError(ctl, _("Failed to start bridge interface %1$s"), br_name); goto cleanup; } - vshPrintExtra(ctl, _("Bridge interface %s started\n"), br_name); + vshPrintExtra(ctl, _("Bridge interface %1$s started\n"), br_name); } ret = true; @@ -1051,19 +1051,19 @@ cmdInterfaceUnbridge(vshControl *ctl, const vshCmd *cmd) if (!(xml_doc = virXMLParseStringCtxt(br_xml, _("(bridge interface definition)"), &ctxt))) { - vshError(ctl, _("Failed to parse configuration of %s"), br_name); + vshError(ctl, _("Failed to parse configuration of %1$s"), br_name); goto cleanup; } top_node = ctxt->node; /* Verify that the device really is a bridge. */ if (!(if_type = virXMLPropString(top_node, "type"))) { - vshError(ctl, _("Existing device %s has no type"), br_name); + vshError(ctl, _("Existing device %1$s has no type"), br_name); goto cleanup; } if (STRNEQ(if_type, "bridge")) { - vshError(ctl, _("Device %s is not a bridge"), br_name); + vshError(ctl, _("Device %1$s is not a bridge"), br_name); goto cleanup; } VIR_FREE(if_type); @@ -1071,7 +1071,7 @@ cmdInterfaceUnbridge(vshControl *ctl, const vshCmd *cmd) /* verify the name in the XML matches the device name */ if (!(if_name = virXMLPropString(top_node, "name")) || STRNEQ(if_name, br_name)) { - vshError(ctl, _("Interface name from config %s doesn't match given supplied name %s"), + vshError(ctl, _("Interface name from config %1$s doesn't match given supplied name %2$s"), if_name, br_name); goto cleanup; } @@ -1097,23 +1097,23 @@ cmdInterfaceUnbridge(vshControl *ctl, const vshCmd *cmd) * the type/name of the attached interface. */ if (!(if_name = virXMLPropString(if_node, "name"))) { - vshError(ctl, _("Device attached to bridge %s has no name"), br_name); + vshError(ctl, _("Device attached to bridge %1$s has no name"), br_name); goto cleanup; } if (!(if_type = virXMLPropString(if_node, "type"))) { - vshError(ctl, _("Attached device %s has no type"), if_name); + vshError(ctl, _("Attached device %1$s has no type"), if_name); goto cleanup; } if (!xmlSetProp(top_node, BAD_CAST "type", BAD_CAST if_type)) { - vshError(ctl, _("Failed to set interface type to '%s' in xml document"), + vshError(ctl, _("Failed to set interface type to '%1$s' in xml document"), if_type); goto cleanup; } if (!xmlSetProp(top_node, BAD_CAST "name", BAD_CAST if_name)) { - vshError(ctl, _("Failed to set interface name to '%s' in xml document"), + vshError(ctl, _("Failed to set interface name to '%1$s' in xml document"), if_name); goto cleanup; } @@ -1133,7 +1133,7 @@ cmdInterfaceUnbridge(vshControl *ctl, const vshCmd *cmd) virXMLNodeNameEqual(old, "vlan"))) { /* vlan stuff to move down */ xmlUnlinkNode(old); if (!xmlAddChild(top_node, old)) { - vshError(ctl, _("Failed to move '%s' element in xml document"), old->name); + vshError(ctl, _("Failed to move '%1$s' element in xml document"), old->name); xmlFreeNode(old); goto cleanup; } @@ -1144,7 +1144,7 @@ cmdInterfaceUnbridge(vshControl *ctl, const vshCmd *cmd) xmlDocDumpMemory(xml_doc, &if_xml, &if_xml_size); if (!if_xml || if_xml_size <= 0) { - vshError(ctl, _("Failed to format new xml document for detached interface %s"), + vshError(ctl, _("Failed to format new xml document for detached interface %1$s"), if_name); goto cleanup; } @@ -1153,31 +1153,31 @@ cmdInterfaceUnbridge(vshControl *ctl, const vshCmd *cmd) * can't safely define the unattached device. */ if (virInterfaceDestroy(br_handle, 0) < 0) { - vshError(ctl, _("Failed to destroy bridge interface %s"), br_name); + vshError(ctl, _("Failed to destroy bridge interface %1$s"), br_name); goto cleanup; } if (virInterfaceUndefine(br_handle) < 0) { - vshError(ctl, _("Failed to undefine bridge interface %s"), br_name); + vshError(ctl, _("Failed to undefine bridge interface %1$s"), br_name); goto cleanup; } /* if_xml is the new interface to define. */ if (!(if_handle = virInterfaceDefineXML(priv->conn, (char *) if_xml, 0))) { - vshError(ctl, _("Failed to define new interface %s"), if_name); + vshError(ctl, _("Failed to define new interface %1$s"), if_name); goto cleanup; } - vshPrintExtra(ctl, _("Device %s un-attached from bridge %s\n"), + vshPrintExtra(ctl, _("Device %1$s un-attached from bridge %2$s\n"), if_name, br_name); /* unless requested otherwise, undefine the bridge device */ if (!nostart) { if (virInterfaceCreate(if_handle, 0) < 0) { - vshError(ctl, _("Failed to start interface %s"), if_name); + vshError(ctl, _("Failed to start interface %1$s"), if_name); goto cleanup; } - vshPrintExtra(ctl, _("Interface %s started\n"), if_name); + vshPrintExtra(ctl, _("Interface %1$s started\n"), if_name); } ret = true; diff --git a/tools/virsh-network.c b/tools/virsh-network.c index 13f2e729eb..42b7dba761 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -97,7 +97,7 @@ virshCommandOptNetworkBy(vshControl *ctl, const vshCmd *cmd, } if (!network) - vshError(ctl, _("failed to get network '%s'"), n); + vshError(ctl, _("failed to get network '%1$s'"), n); return network; } @@ -126,7 +126,7 @@ virshCommandOptNetworkPort(vshControl *ctl, const vshCmd *cmd, port = virNetworkPortLookupByUUIDString(net, n); if (!port) - vshError(ctl, _("failed to get network port '%s'"), n); + vshError(ctl, _("failed to get network port '%1$s'"), n); return port; } @@ -167,16 +167,16 @@ cmdNetworkAutostart(vshControl *ctl, const vshCmd *cmd) if (virNetworkSetAutostart(network, autostart) < 0) { if (autostart) - vshError(ctl, _("failed to mark network %s as autostarted"), name); + vshError(ctl, _("failed to mark network %1$s as autostarted"), name); else - vshError(ctl, _("failed to unmark network %s as autostarted"), name); + vshError(ctl, _("failed to unmark network %1$s as autostarted"), name); return false; } if (autostart) - vshPrintExtra(ctl, _("Network %s marked as autostarted\n"), name); + vshPrintExtra(ctl, _("Network %1$s marked as autostarted\n"), name); else - vshPrintExtra(ctl, _("Network %s unmarked as autostarted\n"), name); + vshPrintExtra(ctl, _("Network %1$s unmarked as autostarted\n"), name); return true; } @@ -227,11 +227,11 @@ cmdNetworkCreate(vshControl *ctl, const vshCmd *cmd) network = virNetworkCreateXML(priv->conn, buffer); if (!network) { - vshError(ctl, _("Failed to create network from %s"), from); + vshError(ctl, _("Failed to create network from %1$s"), from); return false; } - vshPrintExtra(ctl, _("Network %s created from %s\n"), + vshPrintExtra(ctl, _("Network %1$s created from %2$s\n"), virNetworkGetName(network), from); return true; } @@ -283,11 +283,11 @@ cmdNetworkDefine(vshControl *ctl, const vshCmd *cmd) network = virNetworkDefineXML(priv->conn, buffer); if (!network) { - vshError(ctl, _("Failed to define network from %s"), from); + vshError(ctl, _("Failed to define network from %1$s"), from); return false; } - vshPrintExtra(ctl, _("Network %s defined from %s\n"), + vshPrintExtra(ctl, _("Network %1$s defined from %2$s\n"), virNetworkGetName(network), from); return true; } @@ -321,9 +321,9 @@ cmdNetworkDestroy(vshControl *ctl, const vshCmd *cmd) return false; if (virNetworkDestroy(network) == 0) { - vshPrintExtra(ctl, _("Network %s destroyed\n"), name); + vshPrintExtra(ctl, _("Network %1$s destroyed\n"), name); } else { - vshError(ctl, _("Failed to destroy network %s"), name); + vshError(ctl, _("Failed to destroy network %1$s"), name); ret = false; } @@ -866,9 +866,9 @@ cmdNetworkStart(vshControl *ctl, const vshCmd *cmd) return false; if (virNetworkCreate(network) == 0) { - vshPrintExtra(ctl, _("Network %s started\n"), name); + vshPrintExtra(ctl, _("Network %1$s started\n"), name); } else { - vshError(ctl, _("Failed to start network %s"), name); + vshError(ctl, _("Failed to start network %1$s"), name); ret = false; } return ret; @@ -903,9 +903,9 @@ cmdNetworkUndefine(vshControl *ctl, const vshCmd *cmd) return false; if (virNetworkUndefine(network) == 0) { - vshPrintExtra(ctl, _("Network %s has been undefined\n"), name); + vshPrintExtra(ctl, _("Network %1$s has been undefined\n"), name); } else { - vshError(ctl, _("Failed to undefine network %s"), name); + vshError(ctl, _("Failed to undefine network %1$s"), name); ret = false; } @@ -996,7 +996,7 @@ cmdNetworkUpdate(vshControl *ctl, const vshCmd *cmd) } else { command = virshNetworkUpdateCommandTypeFromString(commandStr); if (command <= 0) { - vshError(ctl, _("unrecognized command name '%s'"), commandStr); + vshError(ctl, _("unrecognized command name '%1$s'"), commandStr); goto cleanup; } } @@ -1006,7 +1006,7 @@ cmdNetworkUpdate(vshControl *ctl, const vshCmd *cmd) section = virshNetworkSectionTypeFromString(sectionStr); if (section <= 0) { - vshError(ctl, _("unrecognized section name '%s'"), sectionStr); + vshError(ctl, _("unrecognized section name '%1$s'"), sectionStr); goto cleanup; } @@ -1043,27 +1043,26 @@ cmdNetworkUpdate(vshControl *ctl, const vshCmd *cmd) if (virNetworkUpdate(network, command, section, parentIndex, xml, flags) < 0) { - vshError(ctl, _("Failed to update network %s"), + vshError(ctl, _("Failed to update network %1$s"), virNetworkGetName(network)); goto cleanup; } if (config) { if (live) - vshPrintExtra(ctl, _("Updated network %s persistent config and " - "live state"), + vshPrintExtra(ctl, _("Updated network %1$s persistent config and live state"), virNetworkGetName(network)); else - vshPrintExtra(ctl, _("Updated network %s persistent config"), + vshPrintExtra(ctl, _("Updated network %1$s persistent config"), virNetworkGetName(network)); } else if (live) { - vshPrintExtra(ctl, _("Updated network %s live state"), + vshPrintExtra(ctl, _("Updated network %1$s live state"), virNetworkGetName(network)); } else if (virNetworkIsActive(network)) { - vshPrintExtra(ctl, _("Updated network %s live state"), + vshPrintExtra(ctl, _("Updated network %1$s live state"), virNetworkGetName(network)); } else { - vshPrintExtra(ctl, _("Updated network %s persistent config"), + vshPrintExtra(ctl, _("Updated network %1$s persistent config"), virNetworkGetName(network)); } @@ -1158,7 +1157,7 @@ cmdNetworkEdit(vshControl *ctl, const vshCmd *cmd) #define EDIT_GET_XML virshNetworkGetXMLDesc(network) #define EDIT_NOT_CHANGED \ do { \ - vshPrintExtra(ctl, _("Network %s XML configuration not changed.\n"), \ + vshPrintExtra(ctl, _("Network %1$s XML configuration not changed.\n"), \ virNetworkGetName(network)); \ ret = true; \ goto edit_cleanup; \ @@ -1167,7 +1166,7 @@ cmdNetworkEdit(vshControl *ctl, const vshCmd *cmd) (network_edited = virNetworkDefineXML(priv->conn, doc_edited)) #include "virsh-edit.c" - vshPrintExtra(ctl, _("Network %s XML configuration edited.\n"), + vshPrintExtra(ctl, _("Network %1$s XML configuration edited.\n"), virNetworkGetName(network_edited)); ret = true; @@ -1227,11 +1226,11 @@ vshEventLifecyclePrint(virConnectPtr conn G_GNUC_UNUSED, if (virTimeStringNowRaw(timestamp) < 0) timestamp[0] = '\0'; - vshPrint(data->ctl, _("%s: event 'lifecycle' for network %s: %s\n"), + vshPrint(data->ctl, _("%1$s: event 'lifecycle' for network %2$s: %3$s\n"), timestamp, virNetworkGetName(net), virshNetworkEventToString(event)); } else { - vshPrint(data->ctl, _("event 'lifecycle' for network %s: %s\n"), + vshPrint(data->ctl, _("event 'lifecycle' for network %1$s: %2$s\n"), virNetworkGetName(net), virshNetworkEventToString(event)); } @@ -1312,7 +1311,7 @@ cmdNetworkEvent(vshControl *ctl, const vshCmd *cmd) if (STREQ(eventName, virshNetworkEventCallbacks[event].name)) break; if (event == VIR_NETWORK_EVENT_ID_LAST) { - vshError(ctl, _("unknown event type %s"), eventName); + vshError(ctl, _("unknown event type %1$s"), eventName); return false; } @@ -1345,7 +1344,7 @@ cmdNetworkEvent(vshControl *ctl, const vshCmd *cmd) default: goto cleanup; } - vshPrint(ctl, _("events received: %d\n"), data.count); + vshPrint(ctl, _("events received: %1$d\n"), data.count); if (data.count) ret = true; @@ -1417,7 +1416,7 @@ cmdNetworkDHCPLeases(vshControl *ctl, const vshCmd *cmd) return false; if ((nleases = virNetworkGetDHCPLeases(network, mac, &leases, flags)) < 0) { - vshError(ctl, _("Failed to get leases info for %s"), name); + vshError(ctl, _("Failed to get leases info for %1$s"), name); goto cleanup; } @@ -1523,10 +1522,10 @@ cmdNetworkPortCreate(vshControl *ctl, const vshCmd *cmd) if (port != NULL) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virNetworkPortGetUUIDString(port, uuidstr); - vshPrintExtra(ctl, _("Network port %s created from %s\n"), + vshPrintExtra(ctl, _("Network port %1$s created from %2$s\n"), uuidstr, from); } else { - vshError(ctl, _("Failed to create network from %s"), from); + vshError(ctl, _("Failed to create network from %1$s"), from); goto cleanup; } @@ -1635,10 +1634,10 @@ cmdNetworkPortDelete(vshControl *ctl, const vshCmd *cmd) goto cleanup; if (virNetworkPortDelete(port, 0) < 0) { - vshError(ctl, _("Failed to delete network port %s"), uuidstr); + vshError(ctl, _("Failed to delete network port %1$s"), uuidstr); goto cleanup; } else { - vshPrintExtra(ctl, _("Network port %s deleted\n"), uuidstr); + vshPrintExtra(ctl, _("Network port %1$s deleted\n"), uuidstr); } ret = true; -- 2.39.2