struct virshAddress diskAddr;
if (virshAddressParse(straddr, multifunction, &diskAddr) < 0) {
- vshError(ctl, _("Invalid address."));
+ vshError(ctl, "%s", _("Invalid address."));
return -1;
}
}
if ((type == VIRSH_ATTACH_DISK_SOURCE_TYPE_NETWORK) != !!source_protocol) {
- vshError(ctl, _("--source-protocol option requires --sourcetype network"));
+ vshError(ctl, "%s", _("--source-protocol option requires --sourcetype network"));
return false;
}
if (virshParseRateStr(ctl, inboundStr, &inbound) < 0)
return false;
if (!inbound.average && !inbound.floor) {
- vshError(ctl, _("either inbound average or floor is mandatory"));
+ vshError(ctl, "%s", _("either inbound average or floor is mandatory"));
return false;
}
}
if (virshParseRateStr(ctl, outboundStr, &outbound) < 0)
return false;
if (outbound.average == 0) {
- vshError(ctl, _("outbound average is mandatory"));
+ vshError(ctl, "%s", _("outbound average is mandatory"));
return false;
}
if (outbound.floor) {
- vshError(ctl, _("outbound floor is unsupported yet"));
+ vshError(ctl, "%s", _("outbound floor is unsupported yet"));
return false;
}
}
case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
if (sourceMode < 0) {
- vshError(ctl, _("source-mode is mandatory"));
+ vshError(ctl, "%s", _("source-mode is mandatory"));
return false;
}
virBufferAsprintf(&buf, "<source type='unix' path='%s' mode='%s'/>\n",
return false;
if ((nnodes = virXPathNodeSet("/domain/devices/interface", ctxt, &nodes)) <= 0) {
- vshError(ctl, _("Failed to extract interface information or no interfaces found"));
+ vshError(ctl, "%s", _("Failed to extract interface information or no interfaces found"));
return false;
}
/* try to find <link> element or create new one */
if (!(linkNode = virXPathNode("./link", ctxt))) {
if (!(linkNode = xmlNewChild(ifaceNode, NULL, BAD_CAST "link", NULL))) {
- vshError(ctl, _("failed to create XML node"));
+ vshError(ctl, "%s", _("failed to create XML node"));
return false;
}
}
stateAttr = xmlNewProp(linkNode, BAD_CAST "state", BAD_CAST state);
if (!stateAttr) {
- vshError(ctl, _("Failed to create or modify the state XML attribute"));
+ vshError(ctl, "%s", _("Failed to create or modify the state XML attribute"));
return false;
}
if (!(xml_buf = virXMLNodeToString(xml, ifaceNode))) {
vshSaveLibvirtError();
- vshError(ctl, _("Failed to create XML"));
+ vshError(ctl, "%s", _("Failed to create XML"));
return false;
}
}
if (virDomainUpdateDeviceFlags(dom, xml_buf, flags) < 0) {
- vshError(ctl, _("Failed to update interface link state"));
+ vshError(ctl, "%s", _("Failed to update interface link state"));
return false;
}
if ((!inbound.average && (inbound.burst || inbound.peak)) &&
!inbound.floor) {
- vshError(ctl, _("either inbound average or floor is mandatory"));
+ vshError(ctl, "%s", _("either inbound average or floor is mandatory"));
goto cleanup;
}
goto cleanup;
}
if (outbound.average == 0 && (outbound.burst || outbound.peak)) {
- vshError(ctl, _("outbound average is mandatory"));
+ vshError(ctl, "%s", _("outbound average is mandatory"));
goto cleanup;
}
if (outbound.floor) {
- vshError(ctl, _("outbound floor is unsupported yet"));
+ vshError(ctl, "%s", _("outbound floor is unsupported yet"));
goto cleanup;
}
ignore_value(vshCommandOptStringQuiet(ctl, cmd, "storage", &vol_string));
if (!(vol_string || remove_all_storage) && wipe_storage) {
- vshError(ctl,
+ vshError(ctl, "%s",
_("'--wipe-storage' requires '--storage <string>' or '--remove-all-storage'"));
return false;
}
/* Stash domain description for later use */
if (vol_string || remove_all_storage) {
if (running) {
- vshError(ctl,
+ vshError(ctl, "%s",
_("Storage volume deletion is supported only on stopped domains"));
goto cleanup;
}
if (vol_string && remove_all_storage) {
- vshError(ctl,
+ vshError(ctl, "%s",
_("Specified both --storage and --remove-all-storage"));
goto cleanup;
}
vols[i].target, vols[i].source);
fflush(stdout);
if (virStorageVolWipe(vols[i].vol, 0) < 0) {
- vshError(ctl, _("Failed! Volume not removed."));
+ vshError(ctl, "%s", _("Failed! Volume not removed."));
ret = false;
continue;
} else {
return false;
if (count == 0) {
- vshError(ctl, _("Can't set 0 processors for a VM"));
+ vshError(ctl, "%s", _("Can't set 0 processors for a VM"));
return false;
}
return false;
if (cpulist && !(enable || disable)) {
- vshError(ctl, _("One of options --enable or --disable is required by option --cpulist"));
+ vshError(ctl, "%s", _("One of options --enable or --disable is required by option --cpulist"));
return false;
}
return false;
if ((rc = virDomainGetIOThreadInfo(dom, &info, flags)) < 0) {
- vshError(ctl, _("Unable to get domain IOThreads information"));
+ vshError(ctl, "%s", _("Unable to get domain IOThreads information"));
goto cleanup;
}
niothreads = rc;
return false;
if (npar == 0) {
- vshError(ctl, _("Not enough arguments passed, nothing to set"));
+ vshError(ctl, "%s", _("Not enough arguments passed, nothing to set"));
return false;
}
for (opt = vshCommandOptArgv(cmd, "keycode"); opt && *opt; opt++) {
if (count == VIR_DOMAIN_SEND_KEY_MAX_KEYS) {
- vshError(ctl, _("too many keycodes"));
+ vshError(ctl, "%s", _("too many keycodes"));
return false;
}
vshSaveLibvirtError();
return -1;
} else if (nmems == 0) {
- vshError(ctl, _("no memory device found"));
+ vshError(ctl, "%s", _("no memory device found"));
return -1;
} else if (nmems > 1) {
- vshError(ctl, _("multiple memory devices found, use --alias or --node to select one"));
+ vshError(ctl, "%s", _("multiple memory devices found, use --alias or --node to select one"));
return -1;
}
requestedSizeNode = virXPathNode("./target/requested", ctxt);
if (!requestedSizeNode) {
- vshError(ctl, _("virtio-mem device is missing <requested/>"));
+ vshError(ctl, "%s", _("virtio-mem device is missing <requested/>"));
return -1;
}
return false;
if (!virDomainIsActive(dom)) {
- vshError(ctl, _("Domain is not running"));
+ vshError(ctl, "%s", _("Domain is not running"));
return false;
}
if (type)
vshError(ctl, _("No graphical display with type '%1$s' found"), type);
else
- vshError(ctl, _("No graphical display found"));
+ vshError(ctl, "%s", _("No graphical display found"));
}
return ret;
/* Check if the domain is active and don't rely on -1 for this */
if (!virDomainIsActive(dom)) {
- vshError(ctl, _("Domain is not running"));
+ vshError(ctl, "%s", _("Domain is not running"));
return false;
}
/* Get the VNC port */
if (virXPathInt("string(/domain/devices/graphics[@type='vnc']/@port)",
ctxt, &port)) {
- vshError(ctl, _("Failed to get VNC port. Is this domain using VNC?"));
+ vshError(ctl, "%s", _("Failed to get VNC port. Is this domain using VNC?"));
return false;
}
source_block = false;
new_source = NULL;
} else if (!new_source) {
- vshError(NULL, _("New disk media source was not specified"));
+ vshError(NULL, "%s", _("New disk media source was not specified"));
return NULL;
}
return false;
if (virDomainFSTrim(dom, mountPoint, minimum, flags) < 0) {
- vshError(ctl, _("Unable to invoke fstrim"));
+ vshError(ctl, "%s", _("Unable to invoke fstrim"));
return false;
}
nmountpoints = g_strv_length((GStrv) mountpoints);
if ((count = virDomainFSFreeze(dom, mountpoints, nmountpoints, 0)) < 0) {
- vshError(ctl, _("Unable to freeze filesystems"));
+ vshError(ctl, "%s", _("Unable to freeze filesystems"));
return false;
}
nmountpoints = g_strv_length((GStrv) mountpoints);
if ((count = virDomainFSThaw(dom, mountpoints, nmountpoints, 0)) < 0) {
- vshError(ctl, _("Unable to thaw filesystems"));
+ vshError(ctl, "%s", _("Unable to thaw filesystems"));
return false;
}
rc = virDomainGetFSInfo(dom, &info, 0);
if (rc < 0) {
- vshError(ctl, _("Unable to get filesystem information"));
+ vshError(ctl, "%s", _("Unable to get filesystem information"));
goto cleanup;
}
ninfos = rc;
flags |= VIR_DOMAIN_AUTHORIZED_SSH_KEYS_SET_APPEND;
if (!from) {
- vshError(ctl, _("Option --file is required"));
+ vshError(ctl, "%s", _("Option --file is required"));
return false;
}
}