}
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;
}
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;
}
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) {
#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; \
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;
}
cleanup:
if (!ret && name)
- vshError(ctl, _("Failed to update %s"), name);
+ vshError(ctl, _("Failed to update %1$s"), name);
return ret;
}
if (vshCommandOptBool(cmd, option)) { \
if (tree) { \
vshError(ctl, \
- _("--%s and --tree are mutually exclusive"), \
+ _("--%1$s and --tree are mutually exclusive"), \
option); \
return false; \
} \
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;
}
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;
}
{
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);
{
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));
{
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);
{
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);
{
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,
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),
{
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,
{
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),
{
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),
{
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));
{
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);
{
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);
{
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);
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]);
{
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)));
{
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);
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]);
{
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);
{
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));
{
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);
{
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));
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);
}
if (ndata == 0) {
- vshError(ctl, _("unknown event type %s"), eventName);
+ vshError(ctl, _("unknown event type %1$s"), eventName);
return false;
}
default:
goto cleanup;
}
- vshPrint(ctl, _("events received: %d\n"), count);
+ vshPrint(ctl, _("events received: %1$d\n"), count);
if (count)
ret = true;
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;
}
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;
}
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) {
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 = "";
}
} 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 = "";
}
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;
}
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);
}
}
if (sourcestr &&
(source = virshDomainInterfaceAddressesSourceTypeFromString(sourcestr)) < 0) {
- vshError(ctl, _("Unknown data source '%s'"), sourcestr);
+ vshError(ctl, _("Unknown data source '%1$s'"), sourcestr);
return false;
}
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;
}
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;
}
}
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;
}
if (stype &&
(type = virshAttachDiskSourceTypeFromString(stype)) < 0) {
- vshError(ctl, _("Unknown source type: '%s'"), stype);
+ vshError(ctl, _("Unknown source type: '%1$s'"), stype);
return false;
}
}
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;
}
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)
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;
}
/* 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;
}
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;
}
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;
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;
}
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,
#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;
}
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;
}
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;
}
* 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;
}
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;
}
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;
}
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 {
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");
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;
}
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");
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;
}
}
if (!ifaceNode) {
- vshError(ctl, _("interface '%s' not found"), iface);
+ vshError(ctl, _("interface '%1$s' not found"), iface);
return false;
}
* 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;
}
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;
}
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;
}
}
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;
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;
if (!source) {
vshError(ctl,
- _("Missing storage volume name for disk '%s'"),
+ _("Missing storage volume name for disk '%1$s'"),
target);
continue;
}
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;
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;
}
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;
}
}
* 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;
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;
}
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) {
/* 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);
}
}
}
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))
}
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;
}
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;
}
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;
}
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)
(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:
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;
}
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;
}
}
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;
}
#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)
(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;
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;
}
return 0;
}
- vshError(ctl, _("invalid scheduler option: %s"), field);
+ vshError(ctl, _("invalid scheduler option: %1$s"), field);
return -1;
}
}
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;
}
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;
}
}
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;
}
}
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;
}
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;
}
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 {
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:
}
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;
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;
}
/*
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;
}
} 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++;
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;
}
} 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++;
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;
}
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;
}
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))
(!(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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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)
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;
}
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;
}
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));
}
}
codeset = virKeycodeSetTypeFromString(codeset_option);
if (codeset < 0) {
- vshError(ctl, _("unknown codeset: '%s'"), codeset_option);
+ vshError(ctl, _("unknown codeset: '%1$s'"), codeset_option);
return false;
}
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;
}
}
return false;
if ((signum = getSignalNumber(signame)) < 0) {
- vshError(ctl, _("malformed signal name: %s"), signame);
+ vshError(ctl, _("malformed signal name: %1$s"), signame);
return false;
}
#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) { \
*/
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;
}
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;
}
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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"));
}
int source = virshDomainHostnameSourceTypeFromString(sourcestr);
if (source < 0) {
- vshError(ctl, _("Unknown data source '%s'"), sourcestr);
+ vshError(ctl, _("Unknown data source '%1$s'"), sourcestr);
return false;
}
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;
}
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;
}
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;
}
}
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;
}
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;
}
}
} 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;
}
}
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;
}
}
}
- 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;
}
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;
}
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;
}
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;
}
#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; \
#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;
}
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;
}
return false;
}
- vshPrintExtra(ctl, _("Froze %d filesystem(s)\n"), count);
+ vshPrintExtra(ctl, _("Froze %1$d filesystem(s)\n"), count);
return true;
}
return false;
}
- vshPrintExtra(ctl, _("Thawed %d filesystem(s)\n"), count);
+ vshPrintExtra(ctl, _("Thawed %1$d filesystem(s)\n"), count);
return true;
}
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;
}
}
int mode = virshDomainDirtyRateCalcModeTypeFromString(modestr);
if (mode < 0) {
- vshError(ctl, _("Unknown calculation mode '%s'"), modestr);
+ vshError(ctl, _("Unknown calculation mode '%1$s'"), modestr);
return false;
}
* 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.
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;
}
}
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;
}
}
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;
}
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');
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;
}
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;
}
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) {
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) {
}
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);
}
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);
}
}
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;
}
}
if (!iface)
- vshError(ctl, _("failed to get interface '%s'"), n);
+ vshError(ctl, _("failed to get interface '%1$s'"), n);
return iface;
}
#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; \
(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;
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;
}
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;
}
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;
}
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;
}
/* 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;
}
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;
}
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;
}
}
}
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;
}
* 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;
}
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;
}
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;
}
* 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;
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);
/* 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;
}
* 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;
}
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;
}
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;
}
* 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;
}
if (!network)
- vshError(ctl, _("failed to get network '%s'"), n);
+ vshError(ctl, _("failed to get network '%1$s'"), n);
return network;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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;
}
} else {
command = virshNetworkUpdateCommandTypeFromString(commandStr);
if (command <= 0) {
- vshError(ctl, _("unrecognized command name '%s'"), commandStr);
+ vshError(ctl, _("unrecognized command name '%1$s'"), commandStr);
goto cleanup;
}
}
section = virshNetworkSectionTypeFromString(sectionStr);
if (section <= 0) {
- vshError(ctl, _("unrecognized section name '%s'"), sectionStr);
+ vshError(ctl, _("unrecognized section name '%1$s'"), sectionStr);
goto cleanup;
}
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));
}
#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; \
(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;
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));
}
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;
}
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;
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;
}
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;
}
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;