qemu: Update format strings in translated messages

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Jiri Denemark 2023-03-09 13:15:22 +01:00
parent 21833b5564
commit 71b19c4f08
30 changed files with 303 additions and 340 deletions

View File

@ -169,7 +169,7 @@ qemuAgentOpenUnix(const char *socketpath)
addr.sun_family = AF_UNIX; addr.sun_family = AF_UNIX;
if (virStrcpyStatic(addr.sun_path, socketpath) < 0) { if (virStrcpyStatic(addr.sun_path, socketpath) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Socket path %s too big for destination"), socketpath); _("Socket path %1$s too big for destination"), socketpath);
goto error; goto error;
} }
@ -226,7 +226,7 @@ qemuAgentIOProcessLine(qemuAgent *agent,
if (virJSONValueGetType(obj) != VIR_JSON_TYPE_OBJECT) { if (virJSONValueGetType(obj) != VIR_JSON_TYPE_OBJECT) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Parsed JSON reply '%s' isn't an object"), line); _("Parsed JSON reply '%1$s' isn't an object"), line);
return -1; return -1;
} }
@ -264,7 +264,7 @@ qemuAgentIOProcessLine(qemuAgent *agent,
} }
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown JSON reply '%s'"), line); _("Unknown JSON reply '%1$s'"), line);
return -1; return -1;
} }
@ -375,7 +375,7 @@ qemuAgentIORead(qemuAgent *agent)
if (avail < 1024) { if (avail < 1024) {
if (agent->bufferLength >= QEMU_AGENT_MAX_RESPONSE) { if (agent->bufferLength >= QEMU_AGENT_MAX_RESPONSE) {
virReportSystemError(ERANGE, virReportSystemError(ERANGE,
_("No complete agent response found in %d bytes"), _("No complete agent response found in %1$d bytes"),
QEMU_AGENT_MAX_RESPONSE); QEMU_AGENT_MAX_RESPONSE);
return -1; return -1;
} }
@ -616,7 +616,7 @@ qemuAgentOpen(virDomainObj *vm,
if (config->type != VIR_DOMAIN_CHR_TYPE_UNIX) { if (config->type != VIR_DOMAIN_CHR_TYPE_UNIX) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to handle agent type: %s"), _("unable to handle agent type: %1$s"),
virDomainChrTypeToString(config->type)); virDomainChrTypeToString(config->type));
goto cleanup; goto cleanup;
} }
@ -633,7 +633,7 @@ qemuAgentOpen(virDomainObj *vm,
agent->socket = g_socket_new_from_fd(agent->fd, &gerr); agent->socket = g_socket_new_from_fd(agent->fd, &gerr);
if (!agent->socket) { if (!agent->socket) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to create socket object: %s"), _("Unable to create socket object: %1$s"),
gerr->message); gerr->message);
goto cleanup; goto cleanup;
} }
@ -973,7 +973,7 @@ qemuAgentCheckError(virJSONValue *cmd,
/* Only send the user the command name + friendly error */ /* Only send the user the command name + friendly error */
if (!error) { if (!error) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to execute QEMU agent command '%s'"), _("unable to execute QEMU agent command '%1$s'"),
qemuAgentCommandName(cmd)); qemuAgentCommandName(cmd));
return -1; return -1;
} }
@ -987,7 +987,7 @@ qemuAgentCheckError(virJSONValue *cmd,
} }
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to execute QEMU agent command '%s': %s"), _("unable to execute QEMU agent command '%1$s': %2$s"),
qemuAgentCommandName(cmd), qemuAgentCommandName(cmd),
qemuAgentStringifyError(error)); qemuAgentStringifyError(error));
@ -1000,7 +1000,7 @@ qemuAgentCheckError(virJSONValue *cmd,
VIR_DEBUG("Neither 'return' nor 'error' is set in the JSON reply %s: %s", VIR_DEBUG("Neither 'return' nor 'error' is set in the JSON reply %s: %s",
NULLSTR(cmdstr), NULLSTR(replystr)); NULLSTR(cmdstr), NULLSTR(replystr));
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to execute QEMU agent command '%s'"), _("unable to execute QEMU agent command '%1$s'"),
qemuAgentCommandName(cmd)); qemuAgentCommandName(cmd));
return -1; return -1;
} }
@ -1283,8 +1283,7 @@ qemuAgentArbitraryCommand(qemuAgent *agent,
*result = NULL; *result = NULL;
if (timeout < VIR_DOMAIN_QEMU_AGENT_COMMAND_MIN) { if (timeout < VIR_DOMAIN_QEMU_AGENT_COMMAND_MIN) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("guest agent timeout '%d' is " _("guest agent timeout '%1$d' is less than the minimum '%2$d'"),
"less than the minimum '%d'"),
timeout, VIR_DOMAIN_QEMU_AGENT_COMMAND_MIN); timeout, VIR_DOMAIN_QEMU_AGENT_COMMAND_MIN);
return -1; return -1;
} }
@ -1654,7 +1653,7 @@ qemuAgentSetTime(qemuAgent *agent,
* not ULLONG_MAX. */ * not ULLONG_MAX. */
if (seconds > LLONG_MAX / 1000000000LL) { if (seconds > LLONG_MAX / 1000000000LL) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("Time '%lld' is too big for guest agent"), _("Time '%1$lld' is too big for guest agent"),
seconds); seconds);
return -1; return -1;
} }
@ -1739,7 +1738,7 @@ qemuAgentGetDiskAddress(virJSONValue *json)
do { \ do { \
if (virJSONValueObjectGetNumberUint(jsonObject, name, var) < 0) { \ if (virJSONValueObjectGetNumberUint(jsonObject, name, var) < 0) { \
virReportError(VIR_ERR_INTERNAL_ERROR, \ virReportError(VIR_ERR_INTERNAL_ERROR, \
_("'%s' missing"), name); \ _("'%1$s' missing"), name); \
return NULL; \ return NULL; \
} \ } \
} while (0) } while (0)
@ -1796,8 +1795,7 @@ qemuAgentGetFSInfoFillDisks(virJSONValue *jsondisks,
if (!jsondisk) { if (!jsondisk) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("array element '%zd' of '%zd' missing in " _("array element '%1$zd' of '%2$zd' missing in guest-get-fsinfo 'disk' data"),
"guest-get-fsinfo 'disk' data"),
i, fsinfo->ndisks); i, fsinfo->ndisks);
return -1; return -1;
} }
@ -1859,8 +1857,7 @@ qemuAgentGetFSInfo(qemuAgent *agent,
if (!entry) { if (!entry) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("array element '%zd' of '%zd' missing in " _("array element '%1$zd' of '%2$zd' missing in guest-get-fsinfo return data"),
"guest-get-fsinfo return data"),
i, ndata); i, ndata);
goto cleanup; goto cleanup;
} }
@ -1951,14 +1948,14 @@ qemuAgentGetInterfaceOneAddress(virDomainIPAddressPtr ip_addr,
type = virJSONValueObjectGetString(ip_addr_obj, "ip-address-type"); type = virJSONValueObjectGetString(ip_addr_obj, "ip-address-type");
if (!type) { if (!type) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("qemu agent didn't provide 'ip-address-type'" _("qemu agent didn't provide 'ip-address-type' field for interface '%1$s'"),
" field for interface '%s'"), name); name);
return -1; return -1;
} }
if (STRNEQ(type, "ipv4") && STRNEQ(type, "ipv6")) { if (STRNEQ(type, "ipv4") && STRNEQ(type, "ipv6")) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown ip address type '%s'"), _("unknown ip address type '%1$s'"),
type); type);
return -1; return -1;
} }
@ -1966,8 +1963,8 @@ qemuAgentGetInterfaceOneAddress(virDomainIPAddressPtr ip_addr,
addr = virJSONValueObjectGetString(ip_addr_obj, "ip-address"); addr = virJSONValueObjectGetString(ip_addr_obj, "ip-address");
if (!addr) { if (!addr) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("qemu agent didn't provide 'ip-address'" _("qemu agent didn't provide 'ip-address' field for interface '%1$s'"),
" field for interface '%s'"), name); name);
return -1; return -1;
} }

View File

@ -206,7 +206,7 @@ qemuBackupDiskPrepareOneBitmaps(struct qemuBackupDiskData *dd,
dd->backupdisk->incremental, dd->backupdisk->incremental,
blockNamedNodeData)) { blockNamedNodeData)) {
virReportError(VIR_ERR_CHECKPOINT_INCONSISTENT, virReportError(VIR_ERR_CHECKPOINT_INCONSISTENT,
_("missing or broken bitmap '%s' for disk '%s'"), _("missing or broken bitmap '%1$s' for disk '%2$s'"),
dd->backupdisk->incremental, dd->domdisk->dst); dd->backupdisk->incremental, dd->domdisk->dst);
return -1; return -1;
} }
@ -256,7 +256,7 @@ qemuBackupDiskPrepareDataOne(virDomainObj *vm,
if (!(dd->domdisk = virDomainDiskByTarget(vm->def, dd->backupdisk->name))) { if (!(dd->domdisk = virDomainDiskByTarget(vm->def, dd->backupdisk->name))) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("no disk named '%s'"), dd->backupdisk->name); _("no disk named '%1$s'"), dd->backupdisk->name);
return -1; return -1;
} }
@ -268,7 +268,7 @@ qemuBackupDiskPrepareDataOne(virDomainObj *vm,
} else if (dd->store->format != VIR_STORAGE_FILE_QCOW2) { } else if (dd->store->format != VIR_STORAGE_FILE_QCOW2) {
if (pull) { if (pull) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("pull mode backup for disk '%s' requires qcow2 driver"), _("pull mode backup for disk '%1$s' requires qcow2 driver"),
dd->backupdisk->name); dd->backupdisk->name);
return -1; return -1;
} }
@ -298,7 +298,7 @@ qemuBackupDiskPrepareDataOne(virDomainObj *vm,
* has corresponding bitmap. */ * has corresponding bitmap. */
if (!virDomainCheckpointFindByName(vm->checkpoints, dd->backupdisk->incremental)) { if (!virDomainCheckpointFindByName(vm->checkpoints, dd->backupdisk->incremental)) {
virReportError(VIR_ERR_NO_DOMAIN_CHECKPOINT, virReportError(VIR_ERR_NO_DOMAIN_CHECKPOINT,
_("Checkpoint '%s' for incremental backup of disk '%s' not found"), _("Checkpoint '%1$s' for incremental backup of disk '%2$s' not found"),
dd->backupdisk->incremental, dd->backupdisk->name); dd->backupdisk->incremental, dd->backupdisk->name);
return -1; return -1;
} }
@ -428,7 +428,7 @@ qemuBackupDiskPrepareOneStorage(virDomainObj *vm,
if (virFileExists(dd->store->path)) { if (virFileExists(dd->store->path)) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("store '%s' for backup of '%s' exists"), _("store '%1$s' for backup of '%2$s' exists"),
dd->store->path, dd->domdisk->dst); dd->store->path, dd->domdisk->dst);
return -1; return -1;
} }
@ -440,7 +440,7 @@ qemuBackupDiskPrepareOneStorage(virDomainObj *vm,
if (virStorageSourceCreate(dd->store) < 0) { if (virStorageSourceCreate(dd->store) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("failed to create image file '%s'"), _("failed to create image file '%1$s'"),
NULLSTR(dd->store->path)); NULLSTR(dd->store->path));
return -1; return -1;
} }

View File

@ -44,7 +44,7 @@ qemuBlockNodeNameValidate(const char *nn)
if (strlen(nn) >= qemuBlockNodeNameBufSize) { if (strlen(nn) >= qemuBlockNodeNameBufSize) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("node-name '%s' too long for qemu"), nn); _("node-name '%1$s' too long for qemu"), nn);
return -1; return -1;
} }
@ -80,7 +80,7 @@ qemuBlockStorageSourceGetURI(virStorageSource *src)
if (src->nhosts != 1) { if (src->nhosts != 1) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("protocol '%s' accepts only one host"), _("protocol '%1$s' accepts only one host"),
virStorageNetProtocolTypeToString(src->protocol)); virStorageNetProtocolTypeToString(src->protocol));
return NULL; return NULL;
} }
@ -153,7 +153,7 @@ qemuBlockStorageSourceBuildJSONSocketAddress(virStorageNetHostDef *host)
case VIR_STORAGE_NET_HOST_TRANS_RDMA: case VIR_STORAGE_NET_HOST_TRANS_RDMA:
case VIR_STORAGE_NET_HOST_TRANS_LAST: case VIR_STORAGE_NET_HOST_TRANS_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("transport protocol '%s' is not yet supported"), _("transport protocol '%1$s' is not yet supported"),
virStorageNetHostTransportTypeToString(host->transport)); virStorageNetHostTransportTypeToString(host->transport));
return NULL; return NULL;
} }
@ -469,7 +469,7 @@ qemuBlockStorageSourceGetISCSIProps(virStorageSource *src,
*(lunStr++) = '\0'; *(lunStr++) = '\0';
if (virStrToLong_ui(lunStr, NULL, 10, &lun) < 0) { if (virStrToLong_ui(lunStr, NULL, 10, &lun) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot parse target for lunStr '%s'"), _("cannot parse target for lunStr '%1$s'"),
target); target);
return NULL; return NULL;
} }
@ -880,7 +880,7 @@ qemuBlockStorageSourceGetBackendProps(virStorageSource *src,
case VIR_STORAGE_TYPE_VOLUME: case VIR_STORAGE_TYPE_VOLUME:
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("storage source pool '%s' volume '%s' is not translated"), _("storage source pool '%1$s' volume '%2$s' is not translated"),
src->srcpool->pool, src->srcpool->volume); src->srcpool->pool, src->srcpool->volume);
return NULL; return NULL;
@ -1226,7 +1226,7 @@ qemuBlockStorageSourceGetBlockdevFormatProps(virStorageSource *src)
case VIR_STORAGE_FILE_ISO: case VIR_STORAGE_FILE_ISO:
case VIR_STORAGE_FILE_DIR: case VIR_STORAGE_FILE_DIR:
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("mishandled storage format '%s'"), _("mishandled storage format '%1$s'"),
virStorageFileFormatTypeToString(src->format)); virStorageFileFormatTypeToString(src->format));
return NULL; return NULL;
@ -1285,7 +1285,7 @@ qemuBlockStorageSourceGetBlockdevProps(virStorageSource *src,
} else { } else {
if (virStorageSourceIsBacking(backingStore)) { if (virStorageSourceIsBacking(backingStore)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("storage format '%s' does not support backing store"), _("storage format '%1$s' does not support backing store"),
virStorageFileFormatTypeToString(src->format)); virStorageFileFormatTypeToString(src->format));
return NULL; return NULL;
} }
@ -2231,7 +2231,7 @@ qemuBlockStorageSourceCreateGetFormatProps(virStorageSource *src,
case VIR_STORAGE_FILE_AUTO: case VIR_STORAGE_FILE_AUTO:
case VIR_STORAGE_FILE_NONE: case VIR_STORAGE_FILE_NONE:
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("mishandled storage format '%s'"), _("mishandled storage format '%1$s'"),
virStorageFileFormatTypeToString(src->format)); virStorageFileFormatTypeToString(src->format));
return -1; return -1;
@ -2385,7 +2385,7 @@ qemuBlockStorageSourceCreateGeneric(virDomainObj *vm,
_("blockdev-create job was cancelled")); _("blockdev-create job was cancelled"));
} else { } else {
virReportError(VIR_ERR_OPERATION_FAILED, virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to format image: '%s'"), NULLSTR(job->errmsg)); _("failed to format image: '%1$s'"), NULLSTR(job->errmsg));
} }
goto cleanup; goto cleanup;
} }
@ -2454,7 +2454,7 @@ qemuBlockStorageSourceCreateFormat(virDomainObj *vm,
if (!createformatprops) { if (!createformatprops) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("can't create storage format '%s'"), _("can't create storage format '%1$s'"),
virStorageFileFormatTypeToString(src->format)); virStorageFileFormatTypeToString(src->format));
return -1; return -1;
} }
@ -2585,7 +2585,7 @@ qemuBlockStorageSourceCreateDetectSize(GHashTable *blockNamedNodeData,
if (!(entry = virHashLookup(blockNamedNodeData, templ->nodeformat))) { if (!(entry = virHashLookup(blockNamedNodeData, templ->nodeformat))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to update capacity data for block node '%s'"), _("failed to update capacity data for block node '%1$s'"),
templ->nodeformat); templ->nodeformat);
return -1; return -1;
} }
@ -3315,7 +3315,7 @@ qemuBlockCommit(virDomainObj *vm,
if (virStorageSourceIsEmpty(disk->src)) { if (virStorageSourceIsEmpty(disk->src)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("disk %s has no source file to be committed"), _("disk %1$s has no source file to be committed"),
disk->dst); disk->dst);
return NULL; return NULL;
} }
@ -3330,20 +3330,20 @@ qemuBlockCommit(virDomainObj *vm,
/* XXX Should we auto-pivot when COMMIT_ACTIVE is not specified? */ /* XXX Should we auto-pivot when COMMIT_ACTIVE is not specified? */
if (!(flags & VIR_DOMAIN_BLOCK_COMMIT_ACTIVE)) { if (!(flags & VIR_DOMAIN_BLOCK_COMMIT_ACTIVE)) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("commit of '%s' active layer requires active flag"), _("commit of '%1$s' active layer requires active flag"),
disk->dst); disk->dst);
return NULL; return NULL;
} }
} else if (flags & VIR_DOMAIN_BLOCK_COMMIT_ACTIVE) { } else if (flags & VIR_DOMAIN_BLOCK_COMMIT_ACTIVE) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("active commit requested but '%s' is not active"), _("active commit requested but '%1$s' is not active"),
topSource->path); topSource->path);
return NULL; return NULL;
} }
if (!virStorageSourceHasBacking(topSource)) { if (!virStorageSourceHasBacking(topSource)) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("top '%s' in chain for '%s' has no backing file"), _("top '%1$s' in chain for '%2$s' has no backing file"),
topSource->path, disk->src->path); topSource->path, disk->src->path);
return NULL; return NULL;
} }
@ -3351,8 +3351,7 @@ qemuBlockCommit(virDomainObj *vm,
if ((flags & VIR_DOMAIN_BLOCK_COMMIT_SHALLOW) && if ((flags & VIR_DOMAIN_BLOCK_COMMIT_SHALLOW) &&
baseSource != topSource->backingStore) { baseSource != topSource->backingStore) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("base '%s' is not immediately below '%s' in chain " _("base '%1$s' is not immediately below '%2$s' in chain for '%3$s'"),
"for '%s'"),
baseSource->path, topSource->path, disk->src->path); baseSource->path, topSource->path, disk->src->path);
return NULL; return NULL;
} }
@ -3481,7 +3480,7 @@ qemuBlockPivot(virDomainObj *vm,
if (job->state != QEMU_BLOCKJOB_STATE_READY) { if (job->state != QEMU_BLOCKJOB_STATE_READY) {
virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, virReportError(VIR_ERR_BLOCK_COPY_ACTIVE,
_("block job '%s' not ready for pivot yet"), _("block job '%1$s' not ready for pivot yet"),
job->name); job->name);
return -1; return -1;
} }
@ -3490,7 +3489,7 @@ qemuBlockPivot(virDomainObj *vm,
case QEMU_BLOCKJOB_TYPE_NONE: case QEMU_BLOCKJOB_TYPE_NONE:
case QEMU_BLOCKJOB_TYPE_LAST: case QEMU_BLOCKJOB_TYPE_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("invalid job type '%d'"), job->type); _("invalid job type '%1$d'"), job->type);
return -1; return -1;
case QEMU_BLOCKJOB_TYPE_PULL: case QEMU_BLOCKJOB_TYPE_PULL:
@ -3500,7 +3499,7 @@ qemuBlockPivot(virDomainObj *vm,
case QEMU_BLOCKJOB_TYPE_CREATE: case QEMU_BLOCKJOB_TYPE_CREATE:
case QEMU_BLOCKJOB_TYPE_BROKEN: case QEMU_BLOCKJOB_TYPE_BROKEN:
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("job type '%s' does not support pivot"), _("job type '%1$s' does not support pivot"),
qemuBlockjobTypeToString(job->type)); qemuBlockjobTypeToString(job->type));
return -1; return -1;

View File

@ -175,7 +175,7 @@ qemuBlockJobRegister(qemuBlockJobData *job,
if (disk && QEMU_DOMAIN_DISK_PRIVATE(disk)->blockjob) { if (disk && QEMU_DOMAIN_DISK_PRIVATE(disk)->blockjob) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("disk '%s' has a blockjob assigned"), disk->dst); _("disk '%1$s' has a blockjob assigned"), disk->dst);
return -1; return -1;
} }

View File

@ -1811,7 +1811,7 @@ int virQEMUCapsGetDefaultVersion(virCaps *caps,
VIR_DOMAIN_OSTYPE_HVM, hostarch, VIR_DOMAIN_VIRT_NONE, VIR_DOMAIN_OSTYPE_HVM, hostarch, VIR_DOMAIN_VIRT_NONE,
NULL, NULL))) { NULL, NULL))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot find suitable emulator for %s"), _("Cannot find suitable emulator for %1$s"),
virArchToString(hostarch)); virArchToString(hostarch));
return -1; return -1;
} }
@ -3669,8 +3669,7 @@ virQEMUCapsInitCPUModelS390(virQEMUCaps *qemuCaps,
if (!modelInfo) { if (!modelInfo) {
if (type == VIR_DOMAIN_VIRT_KVM) { if (type == VIR_DOMAIN_VIRT_KVM) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("missing host CPU model info from QEMU " _("missing host CPU model info from QEMU capabilities for binary %1$s"),
"capabilities for binary %s"),
qemuCaps->binary); qemuCaps->binary);
return -1; return -1;
} }
@ -4038,8 +4037,7 @@ virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsAccel *caps,
prop->value.string = virXMLPropString(ctxt->node, "value"); prop->value.string = virXMLPropString(ctxt->node, "value");
if (!prop->value.string) { if (!prop->value.string) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("invalid string value for '%s' host CPU " _("invalid string value for '%1$s' host CPU model property in QEMU capabilities cache"),
"model property in QEMU capabilities cache"),
prop->name); prop->name);
return -1; return -1;
} }
@ -4049,8 +4047,7 @@ virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsAccel *caps,
if (virXPathLongLong("string(./@value)", ctxt, if (virXPathLongLong("string(./@value)", ctxt,
&prop->value.number) < 0) { &prop->value.number) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("invalid number value for '%s' host CPU " _("invalid number value for '%1$s' host CPU model property in QEMU capabilities cache"),
"model property in QEMU capabilities cache"),
prop->name); prop->name);
return -1; return -1;
} }
@ -4109,7 +4106,7 @@ virQEMUCapsLoadCPUModels(virArch arch,
if ((strUsable = virXMLPropString(nodes[i], "usable")) && if ((strUsable = virXMLPropString(nodes[i], "usable")) &&
(usable = virDomainCapsCPUUsableTypeFromString(strUsable)) < 0) { (usable = virDomainCapsCPUUsableTypeFromString(strUsable)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown value '%s' in attribute 'usable'"), _("unknown value '%1$s' in attribute 'usable'"),
strUsable); strUsable);
return -1; return -1;
} }
@ -4461,7 +4458,7 @@ virQEMUCapsParseHypervCapabilities(virQEMUCaps *qemuCaps,
if ((val = virDomainHypervTypeFromString(name)) < 0) { if ((val = virDomainHypervTypeFromString(name)) < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unsupported HyperV Enlightenment feature: %s"), _("unsupported HyperV Enlightenment feature: %1$s"),
name); name);
return -1; return -1;
} }
@ -4501,7 +4498,7 @@ virQEMUCapsParseFlags(virQEMUCaps *qemuCaps, xmlXPathContextPtr ctxt)
flag = virQEMUCapsTypeFromString(str); flag = virQEMUCapsTypeFromString(str);
if (flag < 0) { if (flag < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown qemu capabilities flag %s"), str); _("Unknown qemu capabilities flag %1$s"), str);
return -1; return -1;
} }
@ -4601,7 +4598,7 @@ virQEMUCapsValidateEmulator(virQEMUCaps *qemuCaps, xmlXPathContextPtr ctxt)
if (STRNEQ(str, qemuCaps->binary)) { if (STRNEQ(str, qemuCaps->binary)) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Expected caps for '%s' but saw '%s'"), _("Expected caps for '%1$s' but saw '%2$s'"),
qemuCaps->binary, str); qemuCaps->binary, str);
return -1; return -1;
} }
@ -4622,7 +4619,7 @@ virQEMUCapsValidateArch(virQEMUCaps *qemuCaps, xmlXPathContextPtr ctxt)
} }
if (!(qemuCaps->arch = virArchFromString(str))) { if (!(qemuCaps->arch = virArchFromString(str))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown arch %s in QEMU capabilities cache"), str); _("unknown arch %1$s in QEMU capabilities cache"), str);
return -1; return -1;
} }
@ -5132,7 +5129,7 @@ virQEMUCapsSaveFile(void *data,
if (virFileWriteStr(filename, xml, 0600) < 0) { if (virFileWriteStr(filename, xml, 0600) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to save '%s' for '%s'"), _("Failed to save '%1$s' for '%2$s'"),
filename, qemuCaps->binary); filename, qemuCaps->binary);
return -1; return -1;
} }
@ -5263,7 +5260,7 @@ virQEMUCapsKVMUsable(virQEMUCapsCachePriv *priv)
if (stat(kvm_device, &sb) < 0) { if (stat(kvm_device, &sb) < 0) {
if (errno != ENOENT) { if (errno != ENOENT) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to stat %s"), kvm_device); _("Failed to stat %1$s"), kvm_device);
} }
return false; return false;
} }
@ -5460,7 +5457,7 @@ virQEMUCapsInitQMPArch(virQEMUCaps *qemuCaps,
if ((qemuCaps->arch = virQEMUCapsArchFromString(archstr)) == VIR_ARCH_NONE) { if ((qemuCaps->arch = virQEMUCapsArchFromString(archstr)) == VIR_ARCH_NONE) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown QEMU arch %s"), archstr); _("Unknown QEMU arch %1$s"), archstr);
return -1; return -1;
} }
@ -5605,7 +5602,7 @@ virQEMUCapsInitQMPMonitor(virQEMUCaps *qemuCaps,
if (major < QEMU_MIN_MAJOR || if (major < QEMU_MIN_MAJOR ||
(major == QEMU_MIN_MAJOR && minor < QEMU_MIN_MINOR)) { (major == QEMU_MIN_MAJOR && minor < QEMU_MIN_MINOR)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("QEMU version >= %d.%d.%d is required, but %d.%d.%d found"), _("QEMU version >= %1$d.%2$d.%3$d is required, but %4$d.%5$d.%6$d found"),
QEMU_MIN_MAJOR, QEMU_MIN_MINOR, QEMU_MIN_MICRO, QEMU_MIN_MAJOR, QEMU_MIN_MINOR, QEMU_MIN_MICRO,
major, minor, micro); major, minor, micro);
return -1; return -1;
@ -5706,7 +5703,7 @@ virQEMUCapsLogProbeFailure(const char *binary)
VIR_LOG_WARN, VIR_LOG_WARN,
__FILE__, __LINE__, __func__, __FILE__, __LINE__, __func__,
meta, meta,
_("Failed to probe capabilities for %s: %s"), _("Failed to probe capabilities for %1$s: %2$s"),
binary, virGetLastErrorMessage()); binary, virGetLastErrorMessage());
} }
@ -5781,7 +5778,7 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch,
/* We would also want to check faccessat if we cared about ACLs, /* We would also want to check faccessat if we cared about ACLs,
* but we don't. */ * but we don't. */
if (stat(binary, &sb) < 0) { if (stat(binary, &sb) < 0) {
virReportSystemError(errno, _("Cannot check QEMU binary %s"), virReportSystemError(errno, _("Cannot check QEMU binary %1$s"),
binary); binary);
return NULL; return NULL;
} }
@ -5792,14 +5789,14 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch,
* in a sub-process so it's hard to feed back a useful error. * in a sub-process so it's hard to feed back a useful error.
*/ */
if (!virFileIsExecutable(binary)) { if (!virFileIsExecutable(binary)) {
virReportSystemError(errno, _("QEMU binary %s is not executable"), virReportSystemError(errno, _("QEMU binary %1$s is not executable"),
binary); binary);
return NULL; return NULL;
} }
if (virFileExists(QEMU_MODDIR)) { if (virFileExists(QEMU_MODDIR)) {
if (stat(QEMU_MODDIR, &sb) < 0) { if (stat(QEMU_MODDIR, &sb) < 0) {
virReportSystemError(errno, _("Cannot check QEMU module directory %s"), virReportSystemError(errno, _("Cannot check QEMU module directory %1$s"),
QEMU_MODDIR); QEMU_MODDIR);
return NULL; return NULL;
} }
@ -6040,14 +6037,14 @@ virQEMUCapsCacheLookupDefault(virFileCache *cache,
if (virttypeStr && if (virttypeStr &&
(virttype = virDomainVirtTypeFromString(virttypeStr)) < 0) { (virttype = virDomainVirtTypeFromString(virttypeStr)) < 0) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("unknown virttype: %s"), virttypeStr); _("unknown virttype: %1$s"), virttypeStr);
return NULL; return NULL;
} }
if (archStr && if (archStr &&
(arch = virArchFromString(archStr)) == VIR_ARCH_NONE) { (arch = virArchFromString(archStr)) == VIR_ARCH_NONE) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("unknown architecture: %s"), archStr); _("unknown architecture: %1$s"), archStr);
return NULL; return NULL;
} }
@ -6057,7 +6054,7 @@ virQEMUCapsCacheLookupDefault(virFileCache *cache,
} }
if (!binary) { if (!binary) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unable to find any emulator to serve '%s' architecture"), _("unable to find any emulator to serve '%1$s' architecture"),
archStr); archStr);
return NULL; return NULL;
} }
@ -6073,8 +6070,7 @@ virQEMUCapsCacheLookupDefault(virFileCache *cache,
(ARCH_IS_ARM(arch) && ARCH_IS_ARM(arch_from_caps)) || (ARCH_IS_ARM(arch) && ARCH_IS_ARM(arch_from_caps)) ||
(ARCH_IS_S390(arch) && ARCH_IS_S390(arch_from_caps)))) { (ARCH_IS_S390(arch) && ARCH_IS_S390(arch_from_caps)))) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("architecture from emulator '%s' doesn't " _("architecture from emulator '%1$s' doesn't match given architecture '%2$s'"),
"match given architecture '%s'"),
virArchToString(arch_from_caps), virArchToString(arch_from_caps),
virArchToString(arch)); virArchToString(arch));
return NULL; return NULL;
@ -6087,7 +6083,7 @@ virQEMUCapsCacheLookupDefault(virFileCache *cache,
if (virQEMUCapsTypeIsAccelerated(virttype) && capsType == VIR_DOMAIN_VIRT_QEMU) { if (virQEMUCapsTypeIsAccelerated(virttype) && capsType == VIR_DOMAIN_VIRT_QEMU) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("the accel '%s' is not supported by '%s' on this host"), _("the accel '%1$s' is not supported by '%2$s' on this host"),
virQEMUCapsAccelStr(virttype), binary); virQEMUCapsAccelStr(virttype), binary);
return NULL; return NULL;
} }
@ -6098,7 +6094,7 @@ virQEMUCapsCacheLookupDefault(virFileCache *cache,
if (!virQEMUCapsIsMachineSupported(qemuCaps, virttype, machine)) { if (!virQEMUCapsIsMachineSupported(qemuCaps, virttype, machine)) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("the machine '%s' is not supported by emulator '%s'"), _("the machine '%1$s' is not supported by emulator '%2$s'"),
machine, binary); machine, binary);
return NULL; return NULL;
} }

View File

@ -171,7 +171,7 @@ qemuSetupImagePathCgroup(virDomainObj *vm,
if (virDevMapperGetTargets(path, &targetPaths) < 0 && if (virDevMapperGetTargets(path, &targetPaths) < 0 &&
errno != ENOSYS) { errno != ENOSYS) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to get devmapper targets for %s"), _("Unable to get devmapper targets for %1$s"),
path); path);
return -1; return -1;
} }
@ -865,7 +865,7 @@ qemuSetupCgroupAppid(virDomainObj *vm)
if (virFileWriteStr(path, appid, 0) < 0) { if (virFileWriteStr(path, appid, 0) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to write '%s' to '%s'"), appid, path); _("Unable to write '%1$s' to '%2$s'"), appid, path);
return -1; return -1;
} }

View File

@ -87,7 +87,7 @@ qemuCheckpointObjFromName(virDomainObj *vm,
chk = virDomainCheckpointFindByName(vm->checkpoints, name); chk = virDomainCheckpointFindByName(vm->checkpoints, name);
if (!chk) if (!chk)
virReportError(VIR_ERR_NO_DOMAIN_CHECKPOINT, virReportError(VIR_ERR_NO_DOMAIN_CHECKPOINT,
_("no domain checkpoint with matching name '%s'"), _("no domain checkpoint with matching name '%1$s'"),
name); name);
return chk; return chk;
@ -121,7 +121,7 @@ qemuCheckpointWriteMetadata(virDomainObj *vm,
chkDir = g_strdup_printf("%s/%s", checkpointDir, vm->def->name); chkDir = g_strdup_printf("%s/%s", checkpointDir, vm->def->name);
if (g_mkdir_with_parents(chkDir, 0777) < 0) { if (g_mkdir_with_parents(chkDir, 0777) < 0) {
virReportSystemError(errno, _("cannot create checkpoint directory '%s'"), virReportSystemError(errno, _("cannot create checkpoint directory '%1$s'"),
chkDir); chkDir);
return -1; return -1;
} }
@ -164,7 +164,7 @@ qemuCheckpointDiscardDiskBitmaps(virStorageSource *src,
if (!found) { if (!found) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("bitmap '%s' not found in backing chain of '%s'"), _("bitmap '%1$s' not found in backing chain of '%2$s'"),
delbitmap, diskdst); delbitmap, diskdst);
return -1; return -1;
} }
@ -205,7 +205,7 @@ qemuCheckpointDiscardBitmaps(virDomainObj *vm,
if (!chkdisk->bitmap) { if (!chkdisk->bitmap) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("missing bitmap name for disk '%s' of checkpoint '%s'"), _("missing bitmap name for disk '%1$s' of checkpoint '%2$s'"),
chkdisk->name, chkdef->parent.name); chkdisk->name, chkdef->parent.name);
return -1; return -1;
} }
@ -357,15 +357,14 @@ qemuCheckpointPrepare(virQEMUDriver *driver,
if (STRNEQ(disk->bitmap, def->parent.name)) { if (STRNEQ(disk->bitmap, def->parent.name)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("bitmap for disk '%s' must match checkpoint name '%s'"), _("bitmap for disk '%1$s' must match checkpoint name '%2$s'"),
disk->name, def->parent.name); disk->name, def->parent.name);
return -1; return -1;
} }
if (vm->def->disks[i]->src->format != VIR_STORAGE_FILE_QCOW2) { if (vm->def->disks[i]->src->format != VIR_STORAGE_FILE_QCOW2) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("checkpoint for disk %s unsupported " _("checkpoint for disk %1$s unsupported for storage type %2$s"),
"for storage type %s"),
disk->name, disk->name,
virStorageFileFormatTypeToString( virStorageFileFormatTypeToString(
vm->def->disks[i]->src->format)); vm->def->disks[i]->src->format));
@ -431,7 +430,7 @@ qemuCheckpointRedefineValidateBitmaps(virDomainObj *vm,
if (!qemuBlockBitmapChainIsValid(domdisk->src, chkdef->parent.name, if (!qemuBlockBitmapChainIsValid(domdisk->src, chkdef->parent.name,
blockNamedNodeData)) { blockNamedNodeData)) {
virReportError(VIR_ERR_CHECKPOINT_INCONSISTENT, virReportError(VIR_ERR_CHECKPOINT_INCONSISTENT,
_("missing or broken bitmap '%s' for disk '%s'"), _("missing or broken bitmap '%1$s' for disk '%2$s'"),
chkdef->parent.name, domdisk->dst); chkdef->parent.name, domdisk->dst);
return -1; return -1;
} }
@ -547,7 +546,7 @@ qemuCheckpointCreateFinalize(virQEMUDriver *driver,
/* if writing of metadata fails, error out rather than trying /* if writing of metadata fails, error out rather than trying
* to silently carry on without completing the checkpoint */ * to silently carry on without completing the checkpoint */
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to save metadata for checkpoint %s"), _("unable to save metadata for checkpoint %1$s"),
chk->def->name); chk->def->name);
qemuCheckpointRollbackMetadata(vm, chk); qemuCheckpointRollbackMetadata(vm, chk);
return -1; return -1;
@ -889,7 +888,7 @@ qemuCheckpointDelete(virDomainObj *vm,
driver->xmlopt, driver->xmlopt,
cfg->checkpointDir) < 0) { cfg->checkpointDir) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to set checkpoint '%s' as current"), _("failed to set checkpoint '%1$s' as current"),
chk->def->name); chk->def->name);
virDomainCheckpointSetCurrent(vm->checkpoints, NULL); virDomainCheckpointSetCurrent(vm->checkpoints, NULL);
goto endjob; goto endjob;

View File

@ -546,8 +546,7 @@ virQEMUDriverConfigLoadRemoteDisplayEntry(virQEMUDriverConfig *cfg,
* to tell to vnc (usually subtract 5700, e.g. localhost:1 * to tell to vnc (usually subtract 5700, e.g. localhost:1
* for port 5701) */ * for port 5701) */
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("%s: remote_websocket_port_min: port must be greater " _("%1$s: remote_websocket_port_min: port must be greater than or equal to %2$d"),
"than or equal to %d"),
filename, QEMU_WEBSOCKET_PORT_MIN); filename, QEMU_WEBSOCKET_PORT_MIN);
return -1; return -1;
} }
@ -557,16 +556,15 @@ virQEMUDriverConfigLoadRemoteDisplayEntry(virQEMUDriverConfig *cfg,
if (cfg->webSocketPortMax > QEMU_WEBSOCKET_PORT_MAX || if (cfg->webSocketPortMax > QEMU_WEBSOCKET_PORT_MAX ||
cfg->webSocketPortMax < cfg->webSocketPortMin) { cfg->webSocketPortMax < cfg->webSocketPortMin) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("%s: remote_websocket_port_max: port must be between " _("%1$s: remote_websocket_port_max: port must be between the minimal port and %2$d"),
"the minimal port and %d"),
filename, QEMU_WEBSOCKET_PORT_MAX); filename, QEMU_WEBSOCKET_PORT_MAX);
return -1; return -1;
} }
if (cfg->webSocketPortMin > cfg->webSocketPortMax) { if (cfg->webSocketPortMin > cfg->webSocketPortMax) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("%s: remote_websocket_port_min: min port must not be " _("%1$s: remote_websocket_port_min: min port must not be greater than max port"),
"greater than max port"), filename); filename);
return -1; return -1;
} }
@ -577,8 +575,7 @@ virQEMUDriverConfigLoadRemoteDisplayEntry(virQEMUDriverConfig *cfg,
* to tell to vnc (usually subtract 5900, e.g. localhost:1 * to tell to vnc (usually subtract 5900, e.g. localhost:1
* for port 5901) */ * for port 5901) */
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("%s: remote_display_port_min: port must be greater " _("%1$s: remote_display_port_min: port must be greater than or equal to %2$d"),
"than or equal to %d"),
filename, QEMU_REMOTE_PORT_MIN); filename, QEMU_REMOTE_PORT_MIN);
return -1; return -1;
} }
@ -588,16 +585,15 @@ virQEMUDriverConfigLoadRemoteDisplayEntry(virQEMUDriverConfig *cfg,
if (cfg->remotePortMax > QEMU_REMOTE_PORT_MAX || if (cfg->remotePortMax > QEMU_REMOTE_PORT_MAX ||
cfg->remotePortMax < cfg->remotePortMin) { cfg->remotePortMax < cfg->remotePortMin) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("%s: remote_display_port_max: port must be between " _("%1$s: remote_display_port_max: port must be between the minimal port and %2$d"),
"the minimal port and %d"),
filename, QEMU_REMOTE_PORT_MAX); filename, QEMU_REMOTE_PORT_MAX);
return -1; return -1;
} }
if (cfg->remotePortMin > cfg->remotePortMax) { if (cfg->remotePortMin > cfg->remotePortMax) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("%s: remote_display_port_min: min port must not be " _("%1$s: remote_display_port_min: min port must not be greater than max port"),
"greater than max port"), filename); filename);
return -1; return -1;
} }
@ -686,7 +682,7 @@ virQEMUDriverConfigLoadProcessEntry(virQEMUDriverConfig *cfg,
cfg->maxCore = ULLONG_MAX; cfg->maxCore = ULLONG_MAX;
} else { } else {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unknown core size '%s'"), _("Unknown core size '%1$s'"),
corestr); corestr);
return -1; return -1;
} }
@ -705,7 +701,7 @@ virQEMUDriverConfigLoadProcessEntry(virQEMUDriverConfig *cfg,
cfg->stdioLogD = false; cfg->stdioLogD = false;
} else { } else {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unknown stdio handler %s"), _("Unknown stdio handler %1$s"),
stdioHandler); stdioHandler);
return -1; return -1;
} }
@ -718,7 +714,7 @@ virQEMUDriverConfigLoadProcessEntry(virQEMUDriverConfig *cfg,
if (val < 0) { if (val < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unknown sched_core value %s"), _("Unknown sched_core value %1$s"),
schedCore); schedCore);
return -1; return -1;
} }
@ -794,7 +790,7 @@ virQEMUDriverConfigLoadNetworkEntry(virQEMUDriverConfig *cfg,
return -1; return -1;
if (cfg->migrationPortMin <= 0) { if (cfg->migrationPortMin <= 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("%s: migration_port_min: port must be greater than 0"), _("%1$s: migration_port_min: port must be greater than 0"),
filename); filename);
return -1; return -1;
} }
@ -804,8 +800,7 @@ virQEMUDriverConfigLoadNetworkEntry(virQEMUDriverConfig *cfg,
if (cfg->migrationPortMax > 65535 || if (cfg->migrationPortMax > 65535 ||
cfg->migrationPortMax < cfg->migrationPortMin) { cfg->migrationPortMax < cfg->migrationPortMin) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("%s: migration_port_max: port must be between " _("%1$s: migration_port_max: port must be between the minimal port %2$d and 65535"),
"the minimal port %d and 65535"),
filename, cfg->migrationPortMin); filename, cfg->migrationPortMin);
return -1; return -1;
} }
@ -817,8 +812,7 @@ virQEMUDriverConfigLoadNetworkEntry(virQEMUDriverConfig *cfg,
(STRPREFIX(cfg->migrateHost, "localhost") || (STRPREFIX(cfg->migrateHost, "localhost") ||
virSocketAddrIsNumericLocalhost(cfg->migrateHost))) { virSocketAddrIsNumericLocalhost(cfg->migrateHost))) {
virReportError(VIR_ERR_CONF_SYNTAX, virReportError(VIR_ERR_CONF_SYNTAX,
_("migration_host must not be the address of" _("migration_host must not be the address of the local machine: %1$s"),
" the local machine: %s"),
cfg->migrateHost); cfg->migrateHost);
return -1; return -1;
} }
@ -830,8 +824,7 @@ virQEMUDriverConfigLoadNetworkEntry(virQEMUDriverConfig *cfg,
(STRPREFIX(cfg->migrationAddress, "localhost") || (STRPREFIX(cfg->migrationAddress, "localhost") ||
virSocketAddrIsNumericLocalhost(cfg->migrationAddress))) { virSocketAddrIsNumericLocalhost(cfg->migrationAddress))) {
virReportError(VIR_ERR_CONF_SYNTAX, virReportError(VIR_ERR_CONF_SYNTAX,
_("migration_address must not be the address of" _("migration_address must not be the address of the local machine: %1$s"),
" the local machine: %s"),
cfg->migrationAddress); cfg->migrationAddress);
return -1; return -1;
} }
@ -923,7 +916,7 @@ virQEMUDriverConfigLoadSecurityEntry(virQEMUDriverConfig *cfg,
if (STREQ(cfg->securityDriverNames[i], if (STREQ(cfg->securityDriverNames[i],
cfg->securityDriverNames[j])) { cfg->securityDriverNames[j])) {
virReportError(VIR_ERR_CONF_SYNTAX, virReportError(VIR_ERR_CONF_SYNTAX,
_("Duplicate security driver %s"), _("Duplicate security driver %1$s"),
cfg->securityDriverNames[i]); cfg->securityDriverNames[i]);
return -1; return -1;
} }
@ -961,7 +954,7 @@ virQEMUDriverConfigLoadSecurityEntry(virQEMUDriverConfig *cfg,
int ctl; int ctl;
if ((ctl = virCgroupControllerTypeFromString(controllers[i])) < 0) { if ((ctl = virCgroupControllerTypeFromString(controllers[i])) < 0) {
virReportError(VIR_ERR_CONF_SYNTAX, virReportError(VIR_ERR_CONF_SYNTAX,
_("Unknown cgroup controller '%s'"), _("Unknown cgroup controller '%1$s'"),
controllers[i]); controllers[i]);
return -1; return -1;
} }
@ -987,7 +980,7 @@ virQEMUDriverConfigLoadSecurityEntry(virQEMUDriverConfig *cfg,
if (ns < 0) { if (ns < 0) {
virReportError(VIR_ERR_CONF_SYNTAX, virReportError(VIR_ERR_CONF_SYNTAX,
_("Unknown namespace: %s"), _("Unknown namespace: %1$s"),
namespaces[i]); namespaces[i]);
return -1; return -1;
} }
@ -1000,14 +993,14 @@ virQEMUDriverConfigLoadSecurityEntry(virQEMUDriverConfig *cfg,
if (!qemuDomainNamespaceAvailable(ns)) { if (!qemuDomainNamespaceAvailable(ns)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("%s namespace is not available"), _("%1$s namespace is not available"),
namespaces[i]); namespaces[i]);
return -1; return -1;
} }
if (virBitmapSetBit(cfg->namespaces, ns) < 0) { if (virBitmapSetBit(cfg->namespaces, ns) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to enable namespace: %s"), _("Unable to enable namespace: %1$s"),
namespaces[i]); namespaces[i]);
return -1; return -1;
} }
@ -1158,8 +1151,7 @@ virQEMUDriverConfigValidate(virQEMUDriverConfig *cfg)
if (cfg->defaultTLSx509certdirPresent) { if (cfg->defaultTLSx509certdirPresent) {
if (!virFileExists(cfg->defaultTLSx509certdir)) { if (!virFileExists(cfg->defaultTLSx509certdir)) {
virReportError(VIR_ERR_CONF_SYNTAX, virReportError(VIR_ERR_CONF_SYNTAX,
_("default_tls_x509_cert_dir directory '%s' " _("default_tls_x509_cert_dir directory '%1$s' does not exist"),
"does not exist"),
cfg->defaultTLSx509certdir); cfg->defaultTLSx509certdir);
return -1; return -1;
} }
@ -1168,7 +1160,7 @@ virQEMUDriverConfigValidate(virQEMUDriverConfig *cfg)
if (cfg->vncTLSx509certdir && if (cfg->vncTLSx509certdir &&
!virFileExists(cfg->vncTLSx509certdir)) { !virFileExists(cfg->vncTLSx509certdir)) {
virReportError(VIR_ERR_CONF_SYNTAX, virReportError(VIR_ERR_CONF_SYNTAX,
_("vnc_tls_x509_cert_dir directory '%s' does not exist"), _("vnc_tls_x509_cert_dir directory '%1$s' does not exist"),
cfg->vncTLSx509certdir); cfg->vncTLSx509certdir);
return -1; return -1;
} }
@ -1176,7 +1168,7 @@ virQEMUDriverConfigValidate(virQEMUDriverConfig *cfg)
if (cfg->spiceTLSx509certdir && if (cfg->spiceTLSx509certdir &&
!virFileExists(cfg->spiceTLSx509certdir)) { !virFileExists(cfg->spiceTLSx509certdir)) {
virReportError(VIR_ERR_CONF_SYNTAX, virReportError(VIR_ERR_CONF_SYNTAX,
_("spice_tls_x509_cert_dir directory '%s' does not exist"), _("spice_tls_x509_cert_dir directory '%1$s' does not exist"),
cfg->spiceTLSx509certdir); cfg->spiceTLSx509certdir);
return -1; return -1;
} }
@ -1184,7 +1176,7 @@ virQEMUDriverConfigValidate(virQEMUDriverConfig *cfg)
if (cfg->chardevTLSx509certdir && if (cfg->chardevTLSx509certdir &&
!virFileExists(cfg->chardevTLSx509certdir)) { !virFileExists(cfg->chardevTLSx509certdir)) {
virReportError(VIR_ERR_CONF_SYNTAX, virReportError(VIR_ERR_CONF_SYNTAX,
_("chardev_tls_x509_cert_dir directory '%s' does not exist"), _("chardev_tls_x509_cert_dir directory '%1$s' does not exist"),
cfg->chardevTLSx509certdir); cfg->chardevTLSx509certdir);
return -1; return -1;
} }
@ -1192,7 +1184,7 @@ virQEMUDriverConfigValidate(virQEMUDriverConfig *cfg)
if (cfg->migrateTLSx509certdir && if (cfg->migrateTLSx509certdir &&
!virFileExists(cfg->migrateTLSx509certdir)) { !virFileExists(cfg->migrateTLSx509certdir)) {
virReportError(VIR_ERR_CONF_SYNTAX, virReportError(VIR_ERR_CONF_SYNTAX,
_("migrate_tls_x509_cert_dir directory '%s' does not exist"), _("migrate_tls_x509_cert_dir directory '%1$s' does not exist"),
cfg->migrateTLSx509certdir); cfg->migrateTLSx509certdir);
return -1; return -1;
} }
@ -1200,7 +1192,7 @@ virQEMUDriverConfigValidate(virQEMUDriverConfig *cfg)
if (cfg->backupTLSx509certdir && if (cfg->backupTLSx509certdir &&
!virFileExists(cfg->backupTLSx509certdir)) { !virFileExists(cfg->backupTLSx509certdir)) {
virReportError(VIR_ERR_CONF_SYNTAX, virReportError(VIR_ERR_CONF_SYNTAX,
_("backup_tls_x509_cert_dir directory '%s' does not exist"), _("backup_tls_x509_cert_dir directory '%1$s' does not exist"),
cfg->backupTLSx509certdir); cfg->backupTLSx509certdir);
return -1; return -1;
} }
@ -1208,7 +1200,7 @@ virQEMUDriverConfigValidate(virQEMUDriverConfig *cfg)
if (cfg->vxhsTLSx509certdir && if (cfg->vxhsTLSx509certdir &&
!virFileExists(cfg->vxhsTLSx509certdir)) { !virFileExists(cfg->vxhsTLSx509certdir)) {
virReportError(VIR_ERR_CONF_SYNTAX, virReportError(VIR_ERR_CONF_SYNTAX,
_("vxhs_tls_x509_cert_dir directory '%s' does not exist"), _("vxhs_tls_x509_cert_dir directory '%1$s' does not exist"),
cfg->vxhsTLSx509certdir); cfg->vxhsTLSx509certdir);
return -1; return -1;
} }
@ -1216,7 +1208,7 @@ virQEMUDriverConfigValidate(virQEMUDriverConfig *cfg)
if (cfg->nbdTLSx509certdir && if (cfg->nbdTLSx509certdir &&
!virFileExists(cfg->nbdTLSx509certdir)) { !virFileExists(cfg->nbdTLSx509certdir)) {
virReportError(VIR_ERR_CONF_SYNTAX, virReportError(VIR_ERR_CONF_SYNTAX,
_("nbd_tls_x509_cert_dir directory '%s' does not exist"), _("nbd_tls_x509_cert_dir directory '%1$s' does not exist"),
cfg->nbdTLSx509certdir); cfg->nbdTLSx509certdir);
return -1; return -1;
} }
@ -1457,21 +1449,21 @@ virQEMUDriverGetDomainCapabilities(virQEMUDriver *driver,
if (!virQEMUCapsIsArchSupported(qemuCaps, arch)) { if (!virQEMUCapsIsArchSupported(qemuCaps, arch)) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("Emulator '%s' does not support arch '%s'"), _("Emulator '%1$s' does not support arch '%2$s'"),
path, virArchToString(arch)); path, virArchToString(arch));
return NULL; return NULL;
} }
if (!virQEMUCapsIsVirtTypeSupported(qemuCaps, virttype)) { if (!virQEMUCapsIsVirtTypeSupported(qemuCaps, virttype)) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("Emulator '%s' does not support virt type '%s'"), _("Emulator '%1$s' does not support virt type '%2$s'"),
path, virDomainVirtTypeToString(virttype)); path, virDomainVirtTypeToString(virttype));
return NULL; return NULL;
} }
if (!virQEMUCapsIsMachineSupported(qemuCaps, virttype, machine)) { if (!virQEMUCapsIsMachineSupported(qemuCaps, virttype, machine)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Emulator '%s' does not support machine type '%s'"), _("Emulator '%1$s' does not support machine type '%2$s'"),
path, NULLSTR(machine)); path, NULLSTR(machine));
return NULL; return NULL;
} }
@ -1567,8 +1559,7 @@ qemuGetDomainHupageMemPath(virQEMUDriver *driver,
if (i == cfg->nhugetlbfs) { if (i == cfg->nhugetlbfs) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to find any usable hugetlbfs " _("Unable to find any usable hugetlbfs mount for %1$llu KiB"),
"mount for %llu KiB"),
pagesize); pagesize);
return -1; return -1;
} }
@ -1652,7 +1643,7 @@ qemuHugepageMakeBasedir(virQEMUDriver *driver,
if (g_mkdir_with_parents(hugepagePath, 0777) < 0) { if (g_mkdir_with_parents(hugepagePath, 0777) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("unable to create hugepage path %s"), _("unable to create hugepage path %1$s"),
hugepagePath); hugepagePath);
return -1; return -1;
} }

View File

@ -190,7 +190,7 @@ qemuDBusStart(virQEMUDriver *driver,
if (!virFileIsExecutable(cfg->dbusDaemonName)) { if (!virFileIsExecutable(cfg->dbusDaemonName)) {
virReportSystemError(errno, virReportSystemError(errno,
_("'%s' is not a suitable dbus-daemon"), _("'%1$s' is not a suitable dbus-daemon"),
cfg->dbusDaemonName); cfg->dbusDaemonName);
return -1; return -1;
} }
@ -203,7 +203,7 @@ qemuDBusStart(virQEMUDriver *driver,
sockpath = qemuDBusCreateSocketPath(cfg, shortName); sockpath = qemuDBusCreateSocketPath(cfg, shortName);
if (qemuDBusWriteConfig(configfile, sockpath) < 0) { if (qemuDBusWriteConfig(configfile, sockpath) < 0) {
virReportSystemError(errno, _("Failed to write '%s'"), configfile); virReportSystemError(errno, _("Failed to write '%1$s'"), configfile);
return -1; return -1;
} }
@ -222,7 +222,7 @@ qemuDBusStart(virQEMUDriver *driver,
if (virPidFileReadPath(pidfile, &cpid) < 0) { if (virPidFileReadPath(pidfile, &cpid) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("dbus-daemon %s didn't show up"), _("dbus-daemon %1$s didn't show up"),
cfg->dbusDaemonName); cfg->dbusDaemonName);
goto cleanup; goto cleanup;
} }
@ -240,11 +240,11 @@ qemuDBusStart(virQEMUDriver *driver,
if (saferead(errfd, errbuf, sizeof(errbuf) - 1) < 0) { if (saferead(errfd, errbuf, sizeof(errbuf) - 1) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("dbus-daemon %s died unexpectedly"), _("dbus-daemon %1$s died unexpectedly"),
cfg->dbusDaemonName); cfg->dbusDaemonName);
} else { } else {
virReportError(VIR_ERR_OPERATION_FAILED, virReportError(VIR_ERR_OPERATION_FAILED,
_("dbus-daemon died and reported: %s"), errbuf); _("dbus-daemon died and reported: %1$s"), errbuf);
} }
goto cleanup; goto cleanup;
@ -252,7 +252,7 @@ qemuDBusStart(virQEMUDriver *driver,
if (!virFileExists(sockpath)) { if (!virFileExists(sockpath)) {
virReportError(VIR_ERR_OPERATION_TIMEOUT, virReportError(VIR_ERR_OPERATION_TIMEOUT,
_("DBus daemon %s didn't show up"), _("DBus daemon %1$s didn't show up"),
cfg->dbusDaemonName); cfg->dbusDaemonName);
goto cleanup; goto cleanup;
} }

View File

@ -68,7 +68,7 @@ qemuDomainGetSCSIControllerModel(const virDomainDef *def,
return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_NCR53C90; return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_NCR53C90;
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to determine model for SCSI controller idx=%d"), _("Unable to determine model for SCSI controller idx=%1$d"),
cont->idx); cont->idx);
return -1; return -1;
} }
@ -116,7 +116,7 @@ qemuDomainFindSCSIControllerModel(const virDomainDef *def,
if (!(cont = virDomainDeviceFindSCSIController(def, &info->addr.drive))) { if (!(cont = virDomainDeviceFindSCSIController(def, &info->addr.drive))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to find a SCSI controller for idx=%d"), _("unable to find a SCSI controller for idx=%1$d"),
info->addr.drive.controller); info->addr.drive.controller);
return -1; return -1;
} }
@ -207,7 +207,7 @@ qemuDomainAssignSpaprVIOAddress(virDomainDef *def,
while (ret != 0) { while (ret != 0) {
if (user_reg) { if (user_reg) {
virReportError(VIR_ERR_XML_ERROR, virReportError(VIR_ERR_XML_ERROR,
_("spapr-vio address %#llx already in use"), _("spapr-vio address %1$#llx already in use"),
info->addr.spaprvio.reg); info->addr.spaprvio.reg);
return -EEXIST; return -EEXIST;
} }
@ -1710,8 +1710,8 @@ qemuDomainPCIAddressSetCreate(virDomainDef *def,
if (idx >= addrs->nbuses) { if (idx >= addrs->nbuses) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Inappropriate new pci controller index %zu " _("Inappropriate new pci controller index %1$zu exceeds addrs array length"),
"exceeds addrs array length"), idx); idx);
goto error; goto error;
} }
@ -2306,7 +2306,7 @@ qemuDomainAssignDevicePCISlots(virDomainDef *def,
if (!virDeviceInfoPCIAddressIsWanted(&def->disks[i]->info)) { if (!virDeviceInfoPCIAddressIsWanted(&def->disks[i]->info)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("virtio disk cannot have an address of type '%s'"), _("virtio disk cannot have an address of type '%1$s'"),
virDomainDeviceAddressTypeToString(def->disks[i]->info.type)); virDomainDeviceAddressTypeToString(def->disks[i]->info.type));
return -1; return -1;
} }
@ -2807,8 +2807,7 @@ qemuDomainAssignPCIAddresses(virDomainDef *def,
if (contIndex < 0) { if (contIndex < 0) {
/* this should never happen - we just added it */ /* this should never happen - we just added it */
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not find auto-added %s controller " _("Could not find auto-added %1$s controller with index %2$zu"),
"with index %zu"),
virDomainControllerModelPCITypeToString(bus->model), virDomainControllerModelPCITypeToString(bus->model),
i); i);
goto cleanup; goto cleanup;
@ -2896,10 +2895,7 @@ qemuDomainAssignPCIAddresses(virDomainDef *def,
options->busNr = qemuDomainAddressFindNewBusNr(def); options->busNr = qemuDomainAddressFindNewBusNr(def);
if (options->busNr == -1) { if (options->busNr == -1) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("No free busNr lower than current " _("No free busNr lower than current lowest busNr is available to auto-assign to bus %1$d. Must be manually assigned"),
"lowest busNr is available to "
"auto-assign to bus %d. Must be "
"manually assigned"),
addr->bus); addr->bus);
goto cleanup; goto cleanup;
} }
@ -2923,7 +2919,7 @@ qemuDomainAssignPCIAddresses(virDomainDef *def,
} }
if (options->targetIndex == -1) { if (options->targetIndex == -1) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("No usable target index found for %d"), _("No usable target index found for %1$d"),
addr->bus); addr->bus);
goto cleanup; goto cleanup;
} }
@ -2943,9 +2939,7 @@ qemuDomainAssignPCIAddresses(virDomainDef *def,
if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE && if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE &&
idx <= addr->bus) { idx <= addr->bus) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("PCI controller at index %d (0x%02x) has " _("PCI controller at index %1$d (0x%2$02x) has bus='0x%3$02x', but index must be larger than bus"),
"bus='0x%02x', but index must be "
"larger than bus"),
idx, idx, addr->bus); idx, idx, addr->bus);
goto cleanup; goto cleanup;
} }

View File

@ -725,7 +725,7 @@ qemuDomainObjPrivateXMLParseJob(virDomainObj *vm,
if ((type = virDomainJobTypeFromString(tmp)) < 0) { if ((type = virDomainJobTypeFromString(tmp)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown job type %s"), tmp); _("Unknown job type %1$s"), tmp);
return -1; return -1;
} }
VIR_FREE(tmp); VIR_FREE(tmp);
@ -738,7 +738,7 @@ qemuDomainObjPrivateXMLParseJob(virDomainObj *vm,
if ((async = virDomainAsyncJobTypeFromString(tmp)) < 0) { if ((async = virDomainAsyncJobTypeFromString(tmp)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown async job type %s"), tmp); _("Unknown async job type %1$s"), tmp);
return -1; return -1;
} }
VIR_FREE(tmp); VIR_FREE(tmp);
@ -748,7 +748,7 @@ qemuDomainObjPrivateXMLParseJob(virDomainObj *vm,
vm->job->phase = qemuDomainAsyncJobPhaseFromString(async, tmp); vm->job->phase = qemuDomainAsyncJobPhaseFromString(async, tmp);
if (vm->job->phase < 0) { if (vm->job->phase < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown job phase %s"), tmp); _("Unknown job phase %1$s"), tmp);
return -1; return -1;
} }
VIR_FREE(tmp); VIR_FREE(tmp);

View File

@ -49,7 +49,7 @@ qemuExtDeviceLogCommand(virQEMUDriver *driver,
return -1; return -1;
return qemuDomainLogAppendMessage(driver, vm, return qemuDomainLogAppendMessage(driver, vm,
_("%s: Starting external device: %s\n%s\n"), _("%1$s: Starting external device: %2$s\n%3$s\n"),
timestamp, info, cmds); timestamp, info, cmds);
} }

View File

@ -221,7 +221,7 @@ qemuFDPassTransferMonitor(qemuFDPass *fdpass,
for (i = 0; i < fdsets->nfdsets; i++) { for (i = 0; i < fdsets->nfdsets; i++) {
if (fdsets->fdsets[i].id == fdpass->fdSetID) { if (fdsets->fdsets[i].id == fdpass->fdSetID) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("fdset '%u' is already in use by qemu"), _("fdset '%1$u' is already in use by qemu"),
fdpass->fdSetID); fdpass->fdSetID);
return -1; return -1;
} }

View File

@ -307,7 +307,7 @@ qemuFirmwareInterfaceParse(const char *path,
if (!(interfacesJSON = virJSONValueObjectGetArray(doc, "interface-types"))) { if (!(interfacesJSON = virJSONValueObjectGetArray(doc, "interface-types"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to get interface-types from '%s'"), _("failed to get interface-types from '%1$s'"),
path); path);
return -1; return -1;
} }
@ -323,7 +323,7 @@ qemuFirmwareInterfaceParse(const char *path,
if ((tmp = qemuFirmwareOSInterfaceTypeFromString(tmpStr)) <= 0) { if ((tmp = qemuFirmwareOSInterfaceTypeFromString(tmpStr)) <= 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown interface type: '%s'"), _("unknown interface type: '%1$s'"),
tmpStr); tmpStr);
return -1; return -1;
} }
@ -351,7 +351,7 @@ qemuFirmwareFlashFileParse(const char *path,
if (!(filename = virJSONValueObjectGetString(doc, "filename"))) { if (!(filename = virJSONValueObjectGetString(doc, "filename"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("missing 'filename' in '%s'"), _("missing 'filename' in '%1$s'"),
path); path);
return -1; return -1;
} }
@ -360,7 +360,7 @@ qemuFirmwareFlashFileParse(const char *path,
if (!(format = virJSONValueObjectGetString(doc, "format"))) { if (!(format = virJSONValueObjectGetString(doc, "format"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("missing 'format' in '%s'"), _("missing 'format' in '%1$s'"),
path); path);
return -1; return -1;
} }
@ -394,7 +394,7 @@ qemuFirmwareMappingFlashParse(const char *path,
modeval = qemuFirmwareFlashModeTypeFromString(modestr); modeval = qemuFirmwareFlashModeTypeFromString(modestr);
if (modeval < 0) { if (modeval < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Firmware flash mode value '%s' unexpected"), _("Firmware flash mode value '%1$s' unexpected"),
modestr); modestr);
return -1; return -1;
} }
@ -403,7 +403,7 @@ qemuFirmwareMappingFlashParse(const char *path,
if (!(executable = virJSONValueObjectGet(doc, "executable"))) { if (!(executable = virJSONValueObjectGet(doc, "executable"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("missing 'executable' in '%s'"), _("missing 'executable' in '%1$s'"),
path); path);
return -1; return -1;
} }
@ -414,7 +414,7 @@ qemuFirmwareMappingFlashParse(const char *path,
if (flash->mode == QEMU_FIRMWARE_FLASH_MODE_SPLIT) { if (flash->mode == QEMU_FIRMWARE_FLASH_MODE_SPLIT) {
if (!(nvram_template = virJSONValueObjectGet(doc, "nvram-template"))) { if (!(nvram_template = virJSONValueObjectGet(doc, "nvram-template"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("missing 'nvram-template' in '%s'"), _("missing 'nvram-template' in '%1$s'"),
path); path);
return -1; return -1;
} }
@ -436,7 +436,7 @@ qemuFirmwareMappingKernelParse(const char *path,
if (!(filename = virJSONValueObjectGetString(doc, "filename"))) { if (!(filename = virJSONValueObjectGetString(doc, "filename"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("missing 'filename' in '%s'"), _("missing 'filename' in '%1$s'"),
path); path);
} }
@ -455,7 +455,7 @@ qemuFirmwareMappingMemoryParse(const char *path,
if (!(filename = virJSONValueObjectGetString(doc, "filename"))) { if (!(filename = virJSONValueObjectGetString(doc, "filename"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("missing 'filename' in '%s'"), _("missing 'filename' in '%1$s'"),
path); path);
} }
@ -476,21 +476,21 @@ qemuFirmwareMappingParse(const char *path,
if (!(mapping = virJSONValueObjectGet(doc, "mapping"))) { if (!(mapping = virJSONValueObjectGet(doc, "mapping"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("missing mapping in '%s'"), _("missing mapping in '%1$s'"),
path); path);
return -1; return -1;
} }
if (!(deviceStr = virJSONValueObjectGetString(mapping, "device"))) { if (!(deviceStr = virJSONValueObjectGetString(mapping, "device"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("missing device type in '%s'"), _("missing device type in '%1$s'"),
path); path);
return -1; return -1;
} }
if ((tmp = qemuFirmwareDeviceTypeFromString(deviceStr)) <= 0) { if ((tmp = qemuFirmwareDeviceTypeFromString(deviceStr)) <= 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown device type in '%s'"), _("unknown device type in '%1$s'"),
path); path);
return -1; return -1;
} }
@ -533,7 +533,7 @@ qemuFirmwareTargetParse(const char *path,
if (!(targetsJSON = virJSONValueObjectGetArray(doc, "targets"))) { if (!(targetsJSON = virJSONValueObjectGetArray(doc, "targets"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to get targets from '%s'"), _("failed to get targets from '%1$s'"),
path); path);
return -1; return -1;
} }
@ -554,21 +554,21 @@ qemuFirmwareTargetParse(const char *path,
if (!(architectureStr = virJSONValueObjectGetString(item, "architecture"))) { if (!(architectureStr = virJSONValueObjectGetString(item, "architecture"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("missing 'architecture' in '%s'"), _("missing 'architecture' in '%1$s'"),
path); path);
goto cleanup; goto cleanup;
} }
if ((t->architecture = virQEMUCapsArchFromString(architectureStr)) == VIR_ARCH_NONE) { if ((t->architecture = virQEMUCapsArchFromString(architectureStr)) == VIR_ARCH_NONE) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown architecture '%s'"), _("unknown architecture '%1$s'"),
architectureStr); architectureStr);
goto cleanup; goto cleanup;
} }
if (!(machines = virJSONValueObjectGetArray(item, "machines"))) { if (!(machines = virJSONValueObjectGetArray(item, "machines"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("missing 'machines' in '%s'"), _("missing 'machines' in '%1$s'"),
path); path);
goto cleanup; goto cleanup;
} }
@ -615,7 +615,7 @@ qemuFirmwareFeatureParse(const char *path,
if (!(featuresJSON = virJSONValueObjectGetArray(doc, "features"))) { if (!(featuresJSON = virJSONValueObjectGetArray(doc, "features"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to get features from '%s'"), _("failed to get features from '%1$s'"),
path); path);
return -1; return -1;
} }
@ -659,7 +659,7 @@ qemuFirmwareParse(const char *path)
if (!(doc = virJSONValueFromString(cont))) { if (!(doc = virJSONValueFromString(cont))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to parse json file '%s'"), _("unable to parse json file '%1$s'"),
path); path);
return NULL; return NULL;
} }
@ -1732,7 +1732,7 @@ qemuFirmwareFillDomain(virQEMUDriver *driver,
loader->format != VIR_STORAGE_FILE_RAW && loader->format != VIR_STORAGE_FILE_RAW &&
loader->format != VIR_STORAGE_FILE_QCOW2) { loader->format != VIR_STORAGE_FILE_QCOW2) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported loader format '%s'"), _("Unsupported loader format '%1$s'"),
virStorageFileFormatTypeToString(loader->format)); virStorageFileFormatTypeToString(loader->format));
return -1; return -1;
} }
@ -1740,7 +1740,7 @@ qemuFirmwareFillDomain(virQEMUDriver *driver,
nvram->format != VIR_STORAGE_FILE_RAW && nvram->format != VIR_STORAGE_FILE_RAW &&
nvram->format != VIR_STORAGE_FILE_QCOW2) { nvram->format != VIR_STORAGE_FILE_QCOW2) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported nvram format '%s'"), _("Unsupported nvram format '%1$s'"),
virStorageFileFormatTypeToString(nvram->format)); virStorageFileFormatTypeToString(nvram->format));
return -1; return -1;
} }
@ -1771,7 +1771,7 @@ qemuFirmwareFillDomain(virQEMUDriver *driver,
return -1; return -1;
} else { } else {
virReportError(VIR_ERR_OPERATION_FAILED, virReportError(VIR_ERR_OPERATION_FAILED,
_("Unable to find any firmware to satisfy '%s'"), _("Unable to find any firmware to satisfy '%1$s'"),
virDomainOsDefFirmwareTypeToString(def->os.firmware)); virDomainOsDefFirmwareTypeToString(def->os.firmware));
return -1; return -1;
} }

View File

@ -339,7 +339,7 @@ qemuCreateInBridgePortWithHelper(virQEMUDriverConfig *cfg,
} }
if (!virFileIsExecutable(cfg->bridgeHelperName)) { if (!virFileIsExecutable(cfg->bridgeHelperName)) {
virReportSystemError(errno, _("'%s' is not a suitable bridge helper"), virReportSystemError(errno, _("'%1$s' is not a suitable bridge helper"),
cfg->bridgeHelperName); cfg->bridgeHelperName);
return -1; return -1;
} }
@ -377,7 +377,7 @@ qemuCreateInBridgePortWithHelper(virQEMUDriverConfig *cfg,
errstr = g_strdup_printf("stderr=%s", errbuf); errstr = g_strdup_printf("stderr=%s", errbuf);
virReportSystemError(errno, virReportSystemError(errno,
_("%s: failed to communicate with bridge helper: %s"), _("%1$s: failed to communicate with bridge helper: %2$s"),
cmdstr, cmdstr,
NULLSTR_EMPTY(errstr)); NULLSTR_EMPTY(errstr));
VIR_FREE(errstr); VIR_FREE(errstr);
@ -650,7 +650,7 @@ qemuInterfaceVDPAConnect(virDomainNetDef *net)
if ((fd = open(net->data.vdpa.devicepath, O_RDWR)) < 0) { if ((fd = open(net->data.vdpa.devicepath, O_RDWR)) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to open '%s' for vdpa device"), _("Unable to open '%1$s' for vdpa device"),
net->data.vdpa.devicepath); net->data.vdpa.devicepath);
return -1; return -1;
} }

View File

@ -58,7 +58,7 @@ qemuBuildFileList(GHashTable *files, const char *dir)
path = g_strdup_printf("%s/%s", dir, filename); path = g_strdup_printf("%s/%s", dir, filename);
if (stat(path, &sb) < 0) { if (stat(path, &sb) < 0) {
virReportSystemError(errno, _("Unable to access %s"), path); virReportSystemError(errno, _("Unable to access %1$s"), path);
return -1; return -1;
} }
@ -141,7 +141,7 @@ qemuInteropFetchConfigs(const char *name,
if ((len = virFileLength(path, -1)) < 0) { if ((len = virFileLength(path, -1)) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("unable to get size of '%s'"), _("unable to get size of '%1$s'"),
path); path);
return -1; return -1;
} }

View File

@ -188,14 +188,14 @@ qemuDomainExtractTLSSubject(const char *certdir)
if (virFileReadAll(certfile, 8192, &pemdata) < 0) { if (virFileReadAll(certfile, 8192, &pemdata) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to read server cert %s"), certfile); _("unable to read server cert %1$s"), certfile);
return NULL; return NULL;
} }
rc = gnutls_x509_crt_init(&cert); rc = gnutls_x509_crt_init(&cert);
if (rc < 0) { if (rc < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot initialize cert object: %s"), _("cannot initialize cert object: %1$s"),
gnutls_strerror(rc)); gnutls_strerror(rc));
return NULL; return NULL;
} }
@ -206,7 +206,7 @@ qemuDomainExtractTLSSubject(const char *certdir)
rc = gnutls_x509_crt_import(cert, &pemdatum, GNUTLS_X509_FMT_PEM); rc = gnutls_x509_crt_import(cert, &pemdatum, GNUTLS_X509_FMT_PEM);
if (rc < 0) { if (rc < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot load cert data from %s: %s"), _("cannot load cert data from %1$s: %2$s"),
certfile, gnutls_strerror(rc)); certfile, gnutls_strerror(rc));
return NULL; return NULL;
} }
@ -219,7 +219,7 @@ qemuDomainExtractTLSSubject(const char *certdir)
} }
if (rc != 0) { if (rc != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot get cert distinguished name: %s"), _("cannot get cert distinguished name: %1$s"),
gnutls_strerror(rc)); gnutls_strerror(rc));
return NULL; return NULL;
} }
@ -287,8 +287,8 @@ qemuMigrationCookieNetworkAlloc(virQEMUDriver *driver G_GNUC_UNUSED,
if (virNetDevOpenvswitchGetMigrateData(&mig->net[i].portdata, if (virNetDevOpenvswitchGetMigrateData(&mig->net[i].portdata,
netptr->ifname) != 0) { netptr->ifname) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to run command to get OVS port data for " _("Unable to run command to get OVS port data for interface %1$s"),
"interface %s"), netptr->ifname); netptr->ifname);
return NULL; return NULL;
} }
break; break;
@ -910,7 +910,7 @@ qemuMigrationCookieGraphicsXMLParse(xmlXPathContextPtr ctxt)
} }
if ((grap->type = virDomainGraphicsTypeFromString(graphicstype)) < 0) { if ((grap->type = virDomainGraphicsTypeFromString(graphicstype)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown graphics type %s"), graphicstype); _("unknown graphics type %1$s"), graphicstype);
return NULL; return NULL;
} }
if (virXPathInt("string(./graphics/@port)", ctxt, &grap->port) < 0) { if (virXPathInt("string(./graphics/@port)", ctxt, &grap->port) < 0) {
@ -987,7 +987,7 @@ qemuMigrationCookieNBDXMLParse(xmlXPathContextPtr ctxt)
port = virXPathString("string(./nbd/@port)", ctxt); port = virXPathString("string(./nbd/@port)", ctxt);
if (port && virStrToLong_i(port, NULL, 10, &ret->port) < 0) { if (port && virStrToLong_i(port, NULL, 10, &ret->port) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Malformed nbd port '%s'"), _("Malformed nbd port '%1$s'"),
port); port);
return NULL; return NULL;
} }
@ -1015,7 +1015,7 @@ qemuMigrationCookieNBDXMLParse(xmlXPathContextPtr ctxt)
virStrToLong_ull(capacity, NULL, 10, virStrToLong_ull(capacity, NULL, 10,
&ret->disks[i].capacity) < 0) { &ret->disks[i].capacity) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Malformed disk capacity: '%s'"), _("Malformed disk capacity: '%1$s'"),
NULLSTR(capacity)); NULLSTR(capacity));
return NULL; return NULL;
} }
@ -1180,13 +1180,13 @@ qemuMigrationCookieXMLParseMandatoryFeatures(xmlXPathContextPtr ctxt,
if ((val = qemuMigrationCookieFlagTypeFromString(str)) < 0) { if ((val = qemuMigrationCookieFlagTypeFromString(str)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown migration cookie feature %s"), str); _("Unknown migration cookie feature %1$s"), str);
return -1; return -1;
} }
if ((flags & (1 << val)) == 0) { if ((flags & (1 << val)) == 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unsupported migration cookie feature %s"), str); _("Unsupported migration cookie feature %1$s"), str);
return -1; return -1;
} }
} }
@ -1279,7 +1279,7 @@ qemuMigrationCookieXMLParse(qemuMigrationCookie *mig,
} }
if (STRNEQ(name, mig->name)) { if (STRNEQ(name, mig->name)) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Incoming cookie data had unexpected name %s vs %s"), _("Incoming cookie data had unexpected name %1$s vs %2$s"),
name, mig->name); name, mig->name);
return -1; return -1;
} }
@ -1293,7 +1293,7 @@ qemuMigrationCookieXMLParse(qemuMigrationCookie *mig,
virUUIDFormat(mig->uuid, localdomuuid); virUUIDFormat(mig->uuid, localdomuuid);
if (STRNEQ(uuid, localdomuuid)) { if (STRNEQ(uuid, localdomuuid)) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Incoming cookie data had unexpected UUID %s vs %s"), _("Incoming cookie data had unexpected UUID %1$s vs %2$s"),
uuid, localdomuuid); uuid, localdomuuid);
return -1; return -1;
} }
@ -1321,7 +1321,7 @@ qemuMigrationCookieXMLParse(qemuMigrationCookie *mig,
} }
if (memcmp(mig->remoteHostuuid, mig->localHostuuid, VIR_UUID_BUFLEN) == 0) { if (memcmp(mig->remoteHostuuid, mig->localHostuuid, VIR_UUID_BUFLEN) == 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Attempt to migrate guest to the same host %s"), _("Attempt to migrate guest to the same host %1$s"),
hostuuid); hostuuid);
return -1; return -1;
} }
@ -1527,14 +1527,14 @@ qemuMigrationCookieParse(virQEMUDriver *driver,
if (!mig->lockDriver) { if (!mig->lockDriver) {
if (virLockManagerPluginUsesState(driver->lockManager)) { if (virLockManagerPluginUsesState(driver->lockManager)) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Missing %s lock state for migration cookie"), _("Missing %1$s lock state for migration cookie"),
virLockManagerPluginGetName(driver->lockManager)); virLockManagerPluginGetName(driver->lockManager));
return NULL; return NULL;
} }
} else if (STRNEQ(mig->lockDriver, } else if (STRNEQ(mig->lockDriver,
virLockManagerPluginGetName(driver->lockManager))) { virLockManagerPluginGetName(driver->lockManager))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Source host lock driver %s different from target %s"), _("Source host lock driver %1$s different from target %2$s"),
mig->lockDriver, mig->lockDriver,
virLockManagerPluginGetName(driver->lockManager)); virLockManagerPluginGetName(driver->lockManager));
return NULL; return NULL;
@ -1567,7 +1567,7 @@ qemuMigrationCookieBlockDirtyBitmapsMatchDisks(virDomainDef *def,
if (!(disk->disk = virDomainDiskByTarget(def, disk->target))) { if (!(disk->disk = virDomainDiskByTarget(def, disk->target))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Can't find disk '%s' in domain definition"), _("Can't find disk '%1$s' in domain definition"),
disk->target); disk->target);
return -1; return -1;
} }

View File

@ -330,7 +330,7 @@ qemuMigrationParamsCheckType(qemuMigrationParam param,
{ {
if (qemuMigrationParamInfo[param].type != type) { if (qemuMigrationParamInfo[param].type != type) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Type mismatch for '%s' migration parameter"), _("Type mismatch for '%1$s' migration parameter"),
qemuMigrationParamTypeToString(param)); qemuMigrationParamTypeToString(param));
return -1; return -1;
} }
@ -363,7 +363,7 @@ qemuMigrationParamsGetTPInt(qemuMigrationParams *migParams,
unsigned int max = UINT_MAX / unit; unsigned int max = UINT_MAX / unit;
if (migParams->params[param].value.i > max) { if (migParams->params[param].value.i > max) {
virReportError(VIR_ERR_OVERFLOW, virReportError(VIR_ERR_OVERFLOW,
_("migration parameter '%s' must be less than %u"), _("migration parameter '%1$s' must be less than %2$u"),
name, max + 1); name, max + 1);
return -1; return -1;
} }
@ -424,7 +424,7 @@ qemuMigrationParamsGetTPULL(qemuMigrationParams *migParams,
unsigned long long max = ULLONG_MAX / unit; unsigned long long max = ULLONG_MAX / unit;
if (migParams->params[param].value.ull > max) { if (migParams->params[param].value.ull > max) {
virReportError(VIR_ERR_OVERFLOW, virReportError(VIR_ERR_OVERFLOW,
_("migration parameter '%s' must be less than %llu"), _("migration parameter '%1$s' must be less than %2$llu"),
name, max + 1); name, max + 1);
return -1; return -1;
} }
@ -523,14 +523,14 @@ qemuMigrationParamsSetCompression(virTypedParameterPtr params,
method = qemuMigrationCompressMethodTypeFromString(params[i].value.s); method = qemuMigrationCompressMethodTypeFromString(params[i].value.s);
if (method < 0) { if (method < 0) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("Unsupported compression method '%s'"), _("Unsupported compression method '%1$s'"),
params[i].value.s); params[i].value.s);
return -1; return -1;
} }
if (migParams->compMethods & (1ULL << method)) { if (migParams->compMethods & (1ULL << method)) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("Compression method '%s' is specified twice"), _("Compression method '%1$s' is specified twice"),
params[i].value.s); params[i].value.s);
return -1; return -1;
} }
@ -1229,7 +1229,7 @@ qemuMigrationParamsCheck(virDomainObj *vm,
if (state && !qemuMigrationCapsGet(vm, cap)) { if (state && !qemuMigrationCapsGet(vm, cap)) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
_("Migration option '%s' is not supported by QEMU binary"), _("Migration option '%1$s' is not supported by QEMU binary"),
qemuMigrationCapabilityTypeToString(cap)); qemuMigrationCapabilityTypeToString(cap));
return -1; return -1;
} }
@ -1398,14 +1398,14 @@ qemuMigrationParamsParse(xmlXPathContextPtr ctxt,
if ((param = qemuMigrationParamTypeFromString(name)) < 0) { if ((param = qemuMigrationParamTypeFromString(name)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown migration parameter '%s'"), name); _("unknown migration parameter '%1$s'"), name);
return -1; return -1;
} }
pv = &params->params[param]; pv = &params->params[param];
if (!(value = virXMLPropString(nodes[i], "value"))) { if (!(value = virXMLPropString(nodes[i], "value"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("missing value for migration parameter '%s'"), _("missing value for migration parameter '%1$s'"),
name); name);
return -1; return -1;
} }
@ -1431,7 +1431,7 @@ qemuMigrationParamsParse(xmlXPathContextPtr ctxt,
if (rc < 0) { if (rc < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("invalid value '%s' for migration parameter '%s'"), _("invalid value '%1$s' for migration parameter '%2$s'"),
value, name); value, name);
return -1; return -1;
} }

View File

@ -241,7 +241,7 @@ qemuMonitorOpenUnix(const char *monitor)
addr.sun_family = AF_UNIX; addr.sun_family = AF_UNIX;
if (virStrcpyStatic(addr.sun_path, monitor) < 0) { if (virStrcpyStatic(addr.sun_path, monitor) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Monitor path %s too big for destination"), monitor); _("Monitor path %1$s too big for destination"), monitor);
return -1; return -1;
} }
@ -401,7 +401,7 @@ qemuMonitorIORead(qemuMonitor *mon)
if (avail < 1024) { if (avail < 1024) {
if (mon->bufferLength >= QEMU_MONITOR_MAX_RESPONSE) { if (mon->bufferLength >= QEMU_MONITOR_MAX_RESPONSE) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("QEMU monitor reply exceeds buffer size (%d bytes)"), _("QEMU monitor reply exceeds buffer size (%1$d bytes)"),
QEMU_MONITOR_MAX_RESPONSE); QEMU_MONITOR_MAX_RESPONSE);
return -1; return -1;
} }
@ -506,7 +506,7 @@ qemuMonitorIO(GSocket *socket G_GNUC_UNUSED,
if (!error && !mon->goteof && if (!error && !mon->goteof &&
cond & G_IO_ERR) { cond & G_IO_ERR) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid file descriptor while waiting for monitor (vm='%s')"), mon->domainName); _("Invalid file descriptor while waiting for monitor (vm='%1$s')"), mon->domainName);
mon->goteof = true; mon->goteof = true;
} }
} }
@ -532,7 +532,7 @@ qemuMonitorIO(GSocket *socket G_GNUC_UNUSED,
} else { } else {
if (virGetLastErrorCode() == VIR_ERR_OK && !mon->goteof) if (virGetLastErrorCode() == VIR_ERR_OK && !mon->goteof)
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Error while processing monitor IO (vm='%s')"), mon->domainName); _("Error while processing monitor IO (vm='%1$s')"), mon->domainName);
virCopyLastError(&mon->lastError); virCopyLastError(&mon->lastError);
virResetLastError(); virResetLastError();
} }
@ -636,7 +636,7 @@ qemuMonitorOpenInternal(virDomainObj *vm,
mon->socket = g_socket_new_from_fd(fd, &gerr); mon->socket = g_socket_new_from_fd(fd, &gerr);
if (!mon->socket) { if (!mon->socket) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to create socket object: %s"), _("Unable to create socket object: %1$s"),
gerr->message); gerr->message);
goto cleanup; goto cleanup;
} }
@ -684,7 +684,7 @@ qemuMonitorOpen(virDomainObj *vm,
if (config->type != VIR_DOMAIN_CHR_TYPE_UNIX) { if (config->type != VIR_DOMAIN_CHR_TYPE_UNIX) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to handle monitor type: %s"), _("unable to handle monitor type: %1$s"),
virDomainChrTypeToString(config->type)); virDomainChrTypeToString(config->type));
return NULL; return NULL;
} }
@ -851,7 +851,7 @@ qemuMonitorSend(qemuMonitor *mon,
} }
if (mon->goteof) { if (mon->goteof) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("End of file from qemu monitor (vm='%s')"), mon->domainName); _("End of file from qemu monitor (vm='%1$s')"), mon->domainName);
return -1; return -1;
} }
@ -865,7 +865,7 @@ qemuMonitorSend(qemuMonitor *mon,
while (!mon->msg->finished) { while (!mon->msg->finished) {
if (virCondWait(&mon->notify, &mon->parent.lock) < 0) { if (virCondWait(&mon->notify, &mon->parent.lock) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to wait on monitor condition (vm='%s')"), mon->domainName); _("Unable to wait on monitor condition (vm='%1$s')"), mon->domainName);
goto cleanup; goto cleanup;
} }
} }
@ -1010,8 +1010,8 @@ qemuMonitorUpdateVideoMemorySize(qemuMonitor *mon,
if (rc < 0) { if (rc < 0) {
if (rc == -2) if (rc == -2)
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to find QOM Object path for " _("Failed to find QOM Object path for device '%1$s'"),
"device '%s'"), videoName); videoName);
return -1; return -1;
} }
@ -1040,8 +1040,8 @@ qemuMonitorUpdateVideoVram64Size(qemuMonitor *mon,
if (rc < 0) { if (rc < 0) {
if (rc == -2) if (rc == -2)
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to find QOM Object path for " _("Failed to find QOM Object path for device '%1$s'"),
"device '%s'"), videoName); videoName);
return -1; return -1;
} }
@ -1897,7 +1897,7 @@ qemuMonitorBlockIOStatusToError(const char *status)
if (st < 0) { if (st < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown block IO status: %s"), status); _("unknown block IO status: %1$s"), status);
return -1; return -1;
} }
@ -2046,7 +2046,7 @@ qemuMonitorTypeToProtocol(int type)
return "spice"; return "spice";
default: default:
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("unsupported protocol type %s"), _("unsupported protocol type %1$s"),
virDomainGraphicsTypeToString(type)); virDomainGraphicsTypeToString(type));
return NULL; return NULL;
} }
@ -2683,7 +2683,7 @@ qemuMonitorAddObject(qemuMonitor *mon,
if (!id || !type) { if (!id || !type) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("missing alias or qom-type for qemu object '%s'"), _("missing alias or qom-type for qemu object '%1$s'"),
NULLSTR(type)); NULLSTR(type));
return -1; return -1;
} }

View File

@ -49,7 +49,7 @@ qemuMonitorTextCreateSnapshot(qemuMonitor *mon,
strstr(reply, "Error: ") || strstr(reply, "Error: ") ||
(strstr(reply, "Error") && strstr(reply, "while writing VM"))) { (strstr(reply, "Error") && strstr(reply, "while writing VM"))) {
virReportError(VIR_ERR_OPERATION_FAILED, virReportError(VIR_ERR_OPERATION_FAILED,
_("Failed to take snapshot: %s"), reply); _("Failed to take snapshot: %1$s"), reply);
return -1; return -1;
} else if (strstr(reply, "No block device can accept snapshots")) { } else if (strstr(reply, "No block device can accept snapshots")) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s", virReportError(VIR_ERR_OPERATION_INVALID, "%s",
@ -80,7 +80,7 @@ int qemuMonitorTextDeleteSnapshot(qemuMonitor *mon, const char *name)
(strstr(reply, "Error") && (strstr(reply, "Error") &&
strstr(reply, "while deleting snapshot"))) { strstr(reply, "while deleting snapshot"))) {
virReportError(VIR_ERR_OPERATION_FAILED, virReportError(VIR_ERR_OPERATION_FAILED,
_("Failed to delete snapshot: %s"), reply); _("Failed to delete snapshot: %1$s"), reply);
return -1; return -1;
} }

View File

@ -283,7 +283,7 @@ qemuDomainSetupDisk(virStorageSource *src,
if (virDevMapperGetTargets(next->path, &targetPaths) < 0 && if (virDevMapperGetTargets(next->path, &targetPaths) < 0 &&
errno != ENOSYS) { errno != ENOSYS) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to get devmapper targets for %s"), _("Unable to get devmapper targets for %1$s"),
next->path); next->path);
return -1; return -1;
} }
@ -778,7 +778,7 @@ qemuDomainUnshareNamespace(virQEMUDriverConfig *cfg,
if (stat(devMountsPath[i], &sb) < 0) { if (stat(devMountsPath[i], &sb) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to stat: %s"), _("Unable to stat: %1$s"),
devMountsPath[i]); devMountsPath[i]);
goto cleanup; goto cleanup;
} }
@ -789,7 +789,7 @@ qemuDomainUnshareNamespace(virQEMUDriverConfig *cfg,
if ((S_ISDIR(sb.st_mode) && g_mkdir_with_parents(devMountsSavePath[i], 0777) < 0) || if ((S_ISDIR(sb.st_mode) && g_mkdir_with_parents(devMountsSavePath[i], 0777) < 0) ||
(!S_ISDIR(sb.st_mode) && virFileTouch(devMountsSavePath[i], sb.st_mode) < 0)) { (!S_ISDIR(sb.st_mode) && virFileTouch(devMountsSavePath[i], sb.st_mode) < 0)) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to create %s"), _("Failed to create %1$s"),
devMountsSavePath[i]); devMountsSavePath[i]);
goto cleanup; goto cleanup;
} }
@ -816,21 +816,21 @@ qemuDomainUnshareNamespace(virQEMUDriverConfig *cfg,
if (stat(devMountsSavePath[i], &sb) < 0) { if (stat(devMountsSavePath[i], &sb) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to stat: %s"), _("Unable to stat: %1$s"),
devMountsSavePath[i]); devMountsSavePath[i]);
goto cleanup; goto cleanup;
} }
if (S_ISDIR(sb.st_mode)) { if (S_ISDIR(sb.st_mode)) {
if (g_mkdir_with_parents(devMountsPath[i], 0777) < 0) { if (g_mkdir_with_parents(devMountsPath[i], 0777) < 0) {
virReportSystemError(errno, _("Cannot create %s"), virReportSystemError(errno, _("Cannot create %1$s"),
devMountsPath[i]); devMountsPath[i]);
goto cleanup; goto cleanup;
} }
} else { } else {
if (virFileMakeParentPath(devMountsPath[i]) < 0 || if (virFileMakeParentPath(devMountsPath[i]) < 0 ||
virFileTouch(devMountsPath[i], sb.st_mode) < 0) { virFileTouch(devMountsPath[i], sb.st_mode) < 0) {
virReportSystemError(errno, _("Cannot create %s"), virReportSystemError(errno, _("Cannot create %1$s"),
devMountsPath[i]); devMountsPath[i]);
goto cleanup; goto cleanup;
} }
@ -878,7 +878,7 @@ qemuDomainEnableNamespace(virDomainObj *vm,
if (virBitmapSetBit(priv->namespaces, ns) < 0) { if (virBitmapSetBit(priv->namespaces, ns) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to enable namespace: %s"), _("Unable to enable namespace: %1$s"),
qemuDomainNamespaceTypeToString(ns)); qemuDomainNamespaceTypeToString(ns));
return -1; return -1;
} }
@ -1006,7 +1006,7 @@ qemuNamespaceMknodOne(qemuNamespaceMknodItem *data)
if (virFileMakeParentPath(data->file) < 0) { if (virFileMakeParentPath(data->file) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to create %s"), data->file); _("Unable to create %1$s"), data->file);
goto cleanup; goto cleanup;
} }
@ -1026,14 +1026,14 @@ qemuNamespaceMknodOne(qemuNamespaceMknodItem *data)
if (unlink(data->file) < 0 && if (unlink(data->file) < 0 &&
errno != ENOENT) { errno != ENOENT) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to remove symlink %s"), _("Unable to remove symlink %1$s"),
data->file); data->file);
goto cleanup; goto cleanup;
} }
if (symlink(data->target, data->file) < 0) { if (symlink(data->target, data->file) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to create symlink %s (pointing to %s)"), _("Unable to create symlink %1$s (pointing to %2$s)"),
data->file, data->target); data->file, data->target);
goto cleanup; goto cleanup;
} else { } else {
@ -1053,7 +1053,7 @@ qemuNamespaceMknodOne(qemuNamespaceMknodItem *data)
unlink(data->file); unlink(data->file);
if (mknod(data->file, data->sb.st_mode, data->sb.st_rdev) < 0) { if (mknod(data->file, data->sb.st_mode, data->sb.st_rdev) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to create device %s"), _("Unable to create device %1$s"),
data->file); data->file);
goto cleanup; goto cleanup;
} else { } else {
@ -1068,7 +1068,7 @@ qemuNamespaceMknodOne(qemuNamespaceMknodItem *data)
if (umount(data->file) < 0 && if (umount(data->file) < 0 &&
errno != ENOENT && errno != EINVAL) { errno != ENOENT && errno != EINVAL) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to umount %s"), _("Unable to umount %1$s"),
data->file); data->file);
goto cleanup; goto cleanup;
} }
@ -1080,14 +1080,14 @@ qemuNamespaceMknodOne(qemuNamespaceMknodItem *data)
* proper owner and mode. Move the mount only after that. */ * proper owner and mode. Move the mount only after that. */
} else { } else {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("unsupported device type %s 0%o"), _("unsupported device type %1$s 0%2$o"),
data->file, data->sb.st_mode); data->file, data->sb.st_mode);
goto cleanup; goto cleanup;
} }
if (lchown(data->file, data->sb.st_uid, data->sb.st_gid) < 0) { if (lchown(data->file, data->sb.st_uid, data->sb.st_gid) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to chown device %s"), _("Failed to chown device %1$s"),
data->file); data->file);
goto cleanup; goto cleanup;
} }
@ -1096,7 +1096,7 @@ qemuNamespaceMknodOne(qemuNamespaceMknodItem *data)
if (!isLink && if (!isLink &&
chmod(data->file, data->sb.st_mode) < 0) { chmod(data->file, data->sb.st_mode) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to set permissions for device %s"), _("Failed to set permissions for device %1$s"),
data->file); data->file);
goto cleanup; goto cleanup;
} }
@ -1105,7 +1105,7 @@ qemuNamespaceMknodOne(qemuNamespaceMknodItem *data)
virFileSetACLs(data->file, data->acl) < 0 && virFileSetACLs(data->file, data->acl) < 0 &&
errno != ENOTSUP) { errno != ENOTSUP) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to set ACLs on %s"), data->file); _("Unable to set ACLs on %1$s"), data->file);
goto cleanup; goto cleanup;
} }
@ -1116,7 +1116,7 @@ qemuNamespaceMknodOne(qemuNamespaceMknodItem *data)
if (errno != EOPNOTSUPP && errno != ENOTSUP) { if (errno != EOPNOTSUPP && errno != ENOTSUP) {
VIR_WARNINGS_RESET VIR_WARNINGS_RESET
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to set SELinux label on %s"), _("Unable to set SELinux label on %1$s"),
data->file); data->file);
goto cleanup; goto cleanup;
} }
@ -1196,7 +1196,7 @@ qemuNamespaceMknodItemInit(qemuNamespaceMknodItem *item,
return -2; return -2;
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to access %s"), file); _("Unable to access %1$s"), file);
return -1; return -1;
} }
@ -1213,7 +1213,7 @@ qemuNamespaceMknodItemInit(qemuNamespaceMknodItem *item,
if (!(target = g_file_read_link(file, &gerr))) { if (!(target = g_file_read_link(file, &gerr))) {
virReportError(VIR_ERR_SYSTEM_ERROR, virReportError(VIR_ERR_SYSTEM_ERROR,
_("failed to resolve symlink %s: %s"), file, gerr->message); _("failed to resolve symlink %1$s: %2$s"), file, gerr->message);
return -1; return -1;
} }
@ -1238,7 +1238,7 @@ qemuNamespaceMknodItemInit(qemuNamespaceMknodItem *item,
virFileGetACLs(file, &item->acl) < 0 && virFileGetACLs(file, &item->acl) < 0 &&
errno != ENOTSUP) { errno != ENOTSUP) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to get ACLs on %s"), file); _("Unable to get ACLs on %1$s"), file);
return -1; return -1;
} }
@ -1246,7 +1246,7 @@ qemuNamespaceMknodItemInit(qemuNamespaceMknodItem *item,
if (lgetfilecon_raw(file, &item->tcon) < 0 && if (lgetfilecon_raw(file, &item->tcon) < 0 &&
(errno != ENOTSUP && errno != ENODATA)) { (errno != ENOTSUP && errno != ENODATA)) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to get SELinux label from %s"), file); _("Unable to get SELinux label from %1$s"), file);
return -1; return -1;
} }
# endif # endif
@ -1307,7 +1307,7 @@ qemuNamespacePrepareOneItem(qemuNamespaceMknodData *data,
if (ttl-- == 0) { if (ttl-- == 0) {
virReportSystemError(ELOOP, virReportSystemError(ELOOP,
_("Too many levels of symbolic links: %s"), _("Too many levels of symbolic links: %1$s"),
next); next);
return -1; return -1;
} }
@ -1413,7 +1413,7 @@ qemuNamespaceUnlinkHelper(pid_t pid G_GNUC_UNUSED,
VIR_DEBUG("Unlinking %s", path); VIR_DEBUG("Unlinking %s", path);
if (unlink(path) < 0 && errno != ENOENT) { if (unlink(path) < 0 && errno != ENOENT) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to remove device %s"), path); _("Unable to remove device %1$s"), path);
return -1; return -1;
} }
} }

View File

@ -229,7 +229,7 @@ qemuPasstStart(virDomainObj *vm,
} else { } else {
/* validation guarantees this will never happen */ /* validation guarantees this will never happen */
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid portForward proto value %u"), pf->proto); _("Invalid portForward proto value %1$u"), pf->proto);
return -1; return -1;
} }

View File

@ -498,11 +498,11 @@ virQEMUQAPISchemaPathGet(const char *query,
if (rc == -2) { if (rc == -2) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("malformed QAPI schema when querying '%s' of '%s'"), _("malformed QAPI schema when querying '%1$s' of '%2$s'"),
NULLSTR(ctxt.prevquery), query); NULLSTR(ctxt.prevquery), query);
} else if (rc == -3) { } else if (rc == -3) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("terminal QAPI query component '%s' of '%s' must not have followers"), _("terminal QAPI query component '%1$s' of '%2$s' must not have followers"),
NULLSTR(ctxt.prevquery), query); NULLSTR(ctxt.prevquery), query);
} }

View File

@ -172,14 +172,14 @@ virQEMUSaveDataWrite(virQEMUSaveData *data,
if (safewrite(fd, header, sizeof(*header)) != sizeof(*header)) { if (safewrite(fd, header, sizeof(*header)) != sizeof(*header)) {
virReportSystemError(errno, virReportSystemError(errno,
_("failed to write header to domain save file '%s'"), _("failed to write header to domain save file '%1$s'"),
path); path);
return -1; return -1;
} }
if (safewrite(fd, data->xml, xml_len) != xml_len) { if (safewrite(fd, data->xml, xml_len) != xml_len) {
virReportSystemError(errno, virReportSystemError(errno,
_("failed to write domain xml to '%s'"), _("failed to write domain xml to '%1$s'"),
path); path);
return -1; return -1;
} }
@ -187,14 +187,14 @@ virQEMUSaveDataWrite(virQEMUSaveData *data,
if (data->cookie && if (data->cookie &&
safewrite(fd, data->cookie, cookie_len) != cookie_len) { safewrite(fd, data->cookie, cookie_len) != cookie_len) {
virReportSystemError(errno, virReportSystemError(errno,
_("failed to write cookie to '%s'"), _("failed to write cookie to '%1$s'"),
path); path);
return -1; return -1;
} }
if (safewrite(fd, zeros, zerosLen) != zerosLen) { if (safewrite(fd, zeros, zerosLen) != zerosLen) {
virReportSystemError(errno, virReportSystemError(errno,
_("failed to write padding to '%s'"), _("failed to write padding to '%1$s'"),
path); path);
return -1; return -1;
} }
@ -215,7 +215,7 @@ virQEMUSaveDataFinish(virQEMUSaveData *data,
if (safewrite(*fd, header, sizeof(*header)) != sizeof(*header) || if (safewrite(*fd, header, sizeof(*header)) != sizeof(*header) ||
VIR_CLOSE(*fd) < 0) { VIR_CLOSE(*fd) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("failed to write header to domain save file '%s'"), _("failed to write header to domain save file '%1$s'"),
path); path);
return -1; return -1;
} }
@ -232,7 +232,7 @@ qemuSaveImageGetCompressionCommand(virQEMUSaveFormat compression)
if (!prog) { if (!prog) {
virReportError(VIR_ERR_OPERATION_FAILED, virReportError(VIR_ERR_OPERATION_FAILED,
_("Invalid compressed save format %d"), _("Invalid compressed save format %1$d"),
compression); compression);
return NULL; return NULL;
} }
@ -304,7 +304,7 @@ qemuSaveImageCreate(virQEMUDriver *driver,
* trigger a single page of file system cache pollution, but * trigger a single page of file system cache pollution, but
* that's acceptable. */ * that's acceptable. */
if (VIR_CLOSE(fd) < 0) { if (VIR_CLOSE(fd) < 0) {
virReportSystemError(errno, _("unable to close %s"), path); virReportSystemError(errno, _("unable to close %1$s"), path);
goto cleanup; goto cleanup;
} }
@ -387,8 +387,7 @@ qemuSaveImageGetCompressionProgram(const char *imageFormat,
styleFormat); styleFormat);
else else
virReportError(VIR_ERR_OPERATION_FAILED, virReportError(VIR_ERR_OPERATION_FAILED,
_("Invalid %s image format specified " _("Invalid %1$s image format specified in configuration file"),
"in configuration file"),
styleFormat); styleFormat);
} else { } else {
if (use_raw_on_fail) if (use_raw_on_fail)
@ -397,8 +396,7 @@ qemuSaveImageGetCompressionProgram(const char *imageFormat,
styleFormat); styleFormat);
else else
virReportError(VIR_ERR_OPERATION_FAILED, virReportError(VIR_ERR_OPERATION_FAILED,
_("Compression program for %s image format " _("Compression program for %1$s image format in configuration file isn't available"),
"in configuration file isn't available"),
styleFormat); styleFormat);
} }
@ -473,7 +471,7 @@ qemuSaveImageOpen(virQEMUDriver *driver,
if (unlink_corrupt) { if (unlink_corrupt) {
if (unlink(path) < 0) { if (unlink(path) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot remove corrupt file: %s"), _("cannot remove corrupt file: %1$s"),
path); path);
return -1; return -1;
} else { } else {
@ -491,7 +489,7 @@ qemuSaveImageOpen(virQEMUDriver *driver,
if (unlink_corrupt) { if (unlink_corrupt) {
if (unlink(path) < 0) { if (unlink(path) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot remove corrupt file: %s"), _("cannot remove corrupt file: %1$s"),
path); path);
return -1; return -1;
} else { } else {
@ -516,14 +514,14 @@ qemuSaveImageOpen(virQEMUDriver *driver,
if (header->version > QEMU_SAVE_VERSION) { if (header->version > QEMU_SAVE_VERSION) {
virReportError(VIR_ERR_OPERATION_FAILED, virReportError(VIR_ERR_OPERATION_FAILED,
_("image version is not supported (%d > %d)"), _("image version is not supported (%1$d > %2$d)"),
header->version, QEMU_SAVE_VERSION); header->version, QEMU_SAVE_VERSION);
return -1; return -1;
} }
if (header->data_len <= 0) { if (header->data_len <= 0) {
virReportError(VIR_ERR_OPERATION_FAILED, virReportError(VIR_ERR_OPERATION_FAILED,
_("invalid header data length: %d"), header->data_len); _("invalid header data length: %1$d"), header->data_len);
return -1; return -1;
} }
@ -654,7 +652,7 @@ qemuSaveImageStartVM(virConnectPtr conn,
virErrorRestore(&orig_err); virErrorRestore(&orig_err);
} }
if (VIR_CLOSE(*fd) < 0) { if (VIR_CLOSE(*fd) < 0) {
virReportSystemError(errno, _("cannot close file: %s"), path); virReportSystemError(errno, _("cannot close file: %1$s"), path);
rc = -1; rc = -1;
} }

View File

@ -101,7 +101,7 @@ qemuSlirpNewForHelper(const char *helper)
slirp = qemuSlirpNew(); slirp = qemuSlirpNew();
if (!slirp) { if (!slirp) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to allocate slirp for '%s'"), helper); _("Failed to allocate slirp for '%1$s'"), helper);
return NULL; return NULL;
} }
@ -113,7 +113,7 @@ qemuSlirpNewForHelper(const char *helper)
if (!(doc = virJSONValueFromString(output)) || if (!(doc = virJSONValueFromString(output)) ||
!(featuresJSON = virJSONValueObjectGetArray(doc, "features"))) { !(featuresJSON = virJSONValueObjectGetArray(doc, "features"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to parse json capabilities '%s'"), _("unable to parse json capabilities '%1$s'"),
helper); helper);
return NULL; return NULL;
} }
@ -331,7 +331,7 @@ qemuSlirpStart(virDomainObj *vm,
rc = virPidFileReadPath(pidfile, &pid); rc = virPidFileReadPath(pidfile, &pid);
if (rc < 0) { if (rc < 0) {
virReportSystemError(-rc, virReportSystemError(-rc,
_("Unable to read slirp pidfile '%s'"), _("Unable to read slirp pidfile '%1$s'"),
pidfile); pidfile);
goto error; goto error;
} }

View File

@ -84,7 +84,7 @@ qemuSnapObjFromName(virDomainObj *vm,
snap = virDomainSnapshotFindByName(vm->snapshots, name); snap = virDomainSnapshotFindByName(vm->snapshots, name);
if (!snap) if (!snap)
virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT,
_("no domain snapshot with matching name '%s'"), _("no domain snapshot with matching name '%1$s'"),
name); name);
return snap; return snap;
@ -351,8 +351,8 @@ qemuSnapshotPrepareDiskShared(virDomainSnapshotDiskDef *snapdisk,
if (!qemuBlockStorageSourceSupportsConcurrentAccess(snapdisk->src)) { if (!qemuBlockStorageSourceSupportsConcurrentAccess(snapdisk->src)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("shared access for disk '%s' requires use of " _("shared access for disk '%1$s' requires use of supported storage format"),
"supported storage format"), domdisk->dst); domdisk->dst);
return -1; return -1;
} }
@ -390,8 +390,7 @@ qemuSnapshotPrepareDiskExternalInactive(virDomainSnapshotDiskDef *snapdisk,
case VIR_STORAGE_NET_PROTOCOL_NFS: case VIR_STORAGE_NET_PROTOCOL_NFS:
case VIR_STORAGE_NET_PROTOCOL_LAST: case VIR_STORAGE_NET_PROTOCOL_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("external inactive snapshots are not supported on " _("external inactive snapshots are not supported on 'network' disks using '%1$s' protocol"),
"'network' disks using '%s' protocol"),
virStorageNetProtocolTypeToString(domdisk->src->protocol)); virStorageNetProtocolTypeToString(domdisk->src->protocol));
return -1; return -1;
} }
@ -404,8 +403,8 @@ qemuSnapshotPrepareDiskExternalInactive(virDomainSnapshotDiskDef *snapdisk,
case VIR_STORAGE_TYPE_NONE: case VIR_STORAGE_TYPE_NONE:
case VIR_STORAGE_TYPE_LAST: case VIR_STORAGE_TYPE_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("external inactive snapshots are not supported on " _("external inactive snapshots are not supported on '%1$s' disks"),
"'%s' disks"), virStorageTypeToString(domDiskType)); virStorageTypeToString(domDiskType));
return -1; return -1;
} }
@ -422,8 +421,8 @@ qemuSnapshotPrepareDiskExternalInactive(virDomainSnapshotDiskDef *snapdisk,
case VIR_STORAGE_TYPE_NONE: case VIR_STORAGE_TYPE_NONE:
case VIR_STORAGE_TYPE_LAST: case VIR_STORAGE_TYPE_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("external inactive snapshots are not supported on " _("external inactive snapshots are not supported on '%1$s' disks"),
"'%s' disks"), virStorageTypeToString(snapDiskType)); virStorageTypeToString(snapDiskType));
return -1; return -1;
} }
@ -466,8 +465,8 @@ qemuSnapshotPrepareDiskExternalActive(virDomainSnapshotDiskDef *snapdisk,
case VIR_STORAGE_TYPE_NONE: case VIR_STORAGE_TYPE_NONE:
case VIR_STORAGE_TYPE_LAST: case VIR_STORAGE_TYPE_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("external active snapshots are not supported on " _("external active snapshots are not supported on '%1$s' disks"),
"'%s' disks"), virStorageTypeToString(actualType)); virStorageTypeToString(actualType));
return -1; return -1;
} }
@ -514,21 +513,21 @@ qemuSnapshotPrepareDiskExternal(virDomainDiskDef *disk,
if (rc < 0) { if (rc < 0) {
if (err != ENOENT) { if (err != ENOENT) {
virReportSystemError(err, virReportSystemError(err,
_("unable to stat for disk %s: %s"), _("unable to stat for disk %1$s: %2$s"),
snapdisk->name, snapdisk->src->path); snapdisk->name, snapdisk->src->path);
return -1; return -1;
} }
if (reuse) { if (reuse) {
virReportSystemError(err, virReportSystemError(err,
_("missing existing file for disk %s: %s"), _("missing existing file for disk %1$s: %2$s"),
snapdisk->name, snapdisk->src->path); snapdisk->name, snapdisk->src->path);
return -1; return -1;
} }
if (snapdisk->src->type == VIR_STORAGE_TYPE_BLOCK) { if (snapdisk->src->type == VIR_STORAGE_TYPE_BLOCK) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("block device snapshot target '%s' doesn't exist"), _("block device snapshot target '%1$s' doesn't exist"),
snapdisk->src->path); snapdisk->src->path);
return -1; return -1;
} }
@ -537,7 +536,7 @@ qemuSnapshotPrepareDiskExternal(virDomainDiskDef *disk,
if ((snapdisk->src->type == VIR_STORAGE_TYPE_BLOCK && !S_ISBLK(st.st_mode)) || if ((snapdisk->src->type == VIR_STORAGE_TYPE_BLOCK && !S_ISBLK(st.st_mode)) ||
(snapdisk->src->type == VIR_STORAGE_TYPE_FILE && !S_ISREG(st.st_mode))) { (snapdisk->src->type == VIR_STORAGE_TYPE_FILE && !S_ISREG(st.st_mode))) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("mismatch between configured type for snapshot disk '%s' and the type of existing file '%s'"), _("mismatch between configured type for snapshot disk '%1$s' and the type of existing file '%2$s'"),
snapdisk->name, snapdisk->src->path); snapdisk->name, snapdisk->src->path);
return -1; return -1;
} }
@ -546,7 +545,7 @@ qemuSnapshotPrepareDiskExternal(virDomainDiskDef *disk,
snapdisk->src->type == VIR_STORAGE_TYPE_FILE && snapdisk->src->type == VIR_STORAGE_TYPE_FILE &&
st.st_size > 0) { st.st_size > 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("external snapshot file for disk %s already exists and is not a block device: %s"), _("external snapshot file for disk %1$s already exists and is not a block device: %2$s"),
snapdisk->name, snapdisk->src->path); snapdisk->name, snapdisk->src->path);
return -1; return -1;
} }
@ -595,8 +594,7 @@ qemuSnapshotPrepareDiskInternal(virDomainDiskDef *disk,
case VIR_STORAGE_NET_PROTOCOL_NFS: case VIR_STORAGE_NET_PROTOCOL_NFS:
case VIR_STORAGE_NET_PROTOCOL_LAST: case VIR_STORAGE_NET_PROTOCOL_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("internal inactive snapshots are not supported on " _("internal inactive snapshots are not supported on 'network' disks using '%1$s' protocol"),
"'network' disks using '%s' protocol"),
virStorageNetProtocolTypeToString(disk->src->protocol)); virStorageNetProtocolTypeToString(disk->src->protocol));
return -1; return -1;
} }
@ -609,8 +607,8 @@ qemuSnapshotPrepareDiskInternal(virDomainDiskDef *disk,
case VIR_STORAGE_TYPE_NONE: case VIR_STORAGE_TYPE_NONE:
case VIR_STORAGE_TYPE_LAST: case VIR_STORAGE_TYPE_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("internal inactive snapshots are not supported on " _("internal inactive snapshots are not supported on '%1$s' disks"),
"'%s' disks"), virStorageTypeToString(actualType)); virStorageTypeToString(actualType));
return -1; return -1;
} }
@ -645,8 +643,7 @@ qemuSnapshotPrepare(virDomainObj *vm,
if (def->state == VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT && active) { if (def->state == VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT && active) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("active qemu domains require external disk " _("active qemu domains require external disk snapshots; disk %1$s requested internal"),
"snapshots; disk %s requested internal"),
disk->name); disk->name);
return -1; return -1;
} }
@ -658,8 +655,7 @@ qemuSnapshotPrepare(virDomainObj *vm,
if (dom_disk->src->format > 0 && if (dom_disk->src->format > 0 &&
dom_disk->src->format != VIR_STORAGE_FILE_QCOW2) { dom_disk->src->format != VIR_STORAGE_FILE_QCOW2) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("internal snapshot for disk %s unsupported " _("internal snapshot for disk %1$s unsupported for storage type %2$s"),
"for storage type %s"),
disk->name, disk->name,
virStorageFileFormatTypeToString(dom_disk->src->format)); virStorageFileFormatTypeToString(dom_disk->src->format));
return -1; return -1;
@ -672,8 +668,7 @@ qemuSnapshotPrepare(virDomainObj *vm,
} else if (disk->src->format != VIR_STORAGE_FILE_QCOW2 && } else if (disk->src->format != VIR_STORAGE_FILE_QCOW2 &&
disk->src->format != VIR_STORAGE_FILE_QED) { disk->src->format != VIR_STORAGE_FILE_QED) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("external snapshot format for disk %s " _("external snapshot format for disk %1$s is unsupported: %2$s"),
"is unsupported: %s"),
disk->name, disk->name,
virStorageFileFormatTypeToString(disk->src->format)); virStorageFileFormatTypeToString(disk->src->format));
return -1; return -1;
@ -1034,7 +1029,7 @@ qemuSnapshotDiskPrepareOne(qemuSnapshotDiskContext *snapctxt,
/* pre-create the image file so that we can label it before handing it to qemu */ /* pre-create the image file so that we can label it before handing it to qemu */
if (dd->src->type != VIR_STORAGE_TYPE_BLOCK) { if (dd->src->type != VIR_STORAGE_TYPE_BLOCK) {
if (virStorageSourceCreate(dd->src) < 0) { if (virStorageSourceCreate(dd->src) < 0) {
virReportSystemError(errno, _("failed to create image file '%s'"), virReportSystemError(errno, _("failed to create image file '%1$s'"),
NULLSTR(dd->src->path)); NULLSTR(dd->src->path));
return -1; return -1;
} }
@ -1116,7 +1111,7 @@ qemuSnapshotGetTransientDiskDef(virDomainDiskDef *domdisk,
if (virFileExists(snapdisk->src->path)) { if (virFileExists(snapdisk->src->path)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("Overlay file '%s' for transient disk '%s' already exists"), _("Overlay file '%1$s' for transient disk '%2$s' already exists"),
snapdisk->src->path, domdisk->dst); snapdisk->src->path, domdisk->dst);
return NULL; return NULL;
} }
@ -1469,16 +1464,14 @@ qemuSnapshotCreateXMLValidateDef(virDomainObj *vm,
if (!(flags & VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA)) { if (!(flags & VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA)) {
if (strchr(def->parent.name, '/')) { if (strchr(def->parent.name, '/')) {
virReportError(VIR_ERR_XML_DETAIL, virReportError(VIR_ERR_XML_DETAIL,
_("invalid snapshot name '%s': " _("invalid snapshot name '%1$s': name can't contain '/'"),
"name can't contain '/'"),
def->parent.name); def->parent.name);
return -1; return -1;
} }
if (def->parent.name[0] == '.') { if (def->parent.name[0] == '.') {
virReportError(VIR_ERR_XML_DETAIL, virReportError(VIR_ERR_XML_DETAIL,
_("invalid snapshot name '%s': " _("invalid snapshot name '%1$s': name can't start with '.'"),
"name can't start with '.'"),
def->parent.name); def->parent.name);
return -1; return -1;
} }
@ -1507,7 +1500,7 @@ qemuSnapshotCreateXMLValidateDef(virDomainObj *vm,
case VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT: case VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT:
if (!redefine) { if (!redefine) {
virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid domain state %s"), virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid domain state %1$s"),
virDomainSnapshotStateTypeToString(state)); virDomainSnapshotStateTypeToString(state));
return -1; return -1;
} }
@ -1523,7 +1516,7 @@ qemuSnapshotCreateXMLValidateDef(virDomainObj *vm,
case VIR_DOMAIN_SNAPSHOT_NOSTATE: case VIR_DOMAIN_SNAPSHOT_NOSTATE:
case VIR_DOMAIN_SNAPSHOT_BLOCKED: /* invalid state, unused in qemu */ case VIR_DOMAIN_SNAPSHOT_BLOCKED: /* invalid state, unused in qemu */
case VIR_DOMAIN_SNAPSHOT_LAST: case VIR_DOMAIN_SNAPSHOT_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid domain state %s"), virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid domain state %1$s"),
virDomainSnapshotStateTypeToString(state)); virDomainSnapshotStateTypeToString(state));
return -1; return -1;
} }
@ -1603,7 +1596,7 @@ qemuSnapshotCreateWriteMetadata(virDomainObj *vm,
driver->xmlopt, driver->xmlopt,
cfg->snapshotDir) < 0) { cfg->snapshotDir) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to save metadata for snapshot %s"), _("unable to save metadata for snapshot %1$s"),
snap->def->name); snap->def->name);
return -1; return -1;
} }
@ -1829,7 +1822,7 @@ qemuSnapshotRevertValidate(virDomainObj *vm,
if (!snap->def->dom) { if (!snap->def->dom) {
virReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, virReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY,
_("snapshot '%s' lacks domain '%s' rollback info"), _("snapshot '%1$s' lacks domain '%2$s' rollback info"),
snap->def->name, vm->def->name); snap->def->name, vm->def->name);
return -1; return -1;
} }
@ -2227,8 +2220,7 @@ qemuSnapshotRevert(virDomainObj *vm,
case VIR_DOMAIN_SNAPSHOT_BLOCKED: case VIR_DOMAIN_SNAPSHOT_BLOCKED:
case VIR_DOMAIN_SNAPSHOT_LAST: case VIR_DOMAIN_SNAPSHOT_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid target domain state '%s'. Refusing " _("Invalid target domain state '%1$s'. Refusing snapshot reversion"),
"snapshot reversion"),
virDomainSnapshotStateTypeToString(snapdef->state)); virDomainSnapshotStateTypeToString(snapdef->state));
goto endjob; goto endjob;
} }
@ -2327,7 +2319,7 @@ qemuSnapshotDeleteExternalPrepare(virDomainObj *vm,
if (snapDisk->snapshotDeleteInProgress) { if (snapDisk->snapshotDeleteInProgress) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("snapshot disk '%s' was target of not completed snapshot delete"), _("snapshot disk '%1$s' was target of not completed snapshot delete"),
snapDisk->name); snapDisk->name);
return -1; return -1;
} }
@ -2343,7 +2335,7 @@ qemuSnapshotDeleteExternalPrepare(virDomainObj *vm,
data->snapDisk->name); data->snapDisk->name);
if (!data->parentDomDisk) { if (!data->parentDomDisk) {
virReportError(VIR_ERR_OPERATION_FAILED, virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to find disk '%s' in snapshot VM XML"), _("failed to find disk '%1$s' in snapshot VM XML"),
snapDisk->name); snapDisk->name);
return -1; return -1;
} }
@ -2735,7 +2727,7 @@ qemuSnapshotDiscardExternal(virDomainObj *vm,
if (data->job->state == QEMU_BLOCKJOB_STATE_FAILED) { if (data->job->state == QEMU_BLOCKJOB_STATE_FAILED) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("block commit failed while deleting disk '%s' snapshot: '%s'"), _("block commit failed while deleting disk '%1$s' snapshot: '%2$s'"),
data->snapDisk->name, data->job->errmsg); data->snapDisk->name, data->job->errmsg);
goto error; goto error;
} }
@ -2757,7 +2749,7 @@ qemuSnapshotDiscardExternal(virDomainObj *vm,
if (data->job->state == QEMU_BLOCKJOB_STATE_FAILED) { if (data->job->state == QEMU_BLOCKJOB_STATE_FAILED) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("finishing block job failed while deleting disk '%s' snapshot: '%s'"), _("finishing block job failed while deleting disk '%1$s' snapshot: '%2$s'"),
data->snapDisk->name, data->job->errmsg); data->snapDisk->name, data->job->errmsg);
goto error; goto error;
} }
@ -3087,7 +3079,7 @@ qemuSnapshotDeleteValidate(virDomainObj *vm,
if (!virStorageSourceIsSameLocation(vmdisk->src, disk->src)) { if (!virStorageSourceIsSameLocation(vmdisk->src, disk->src)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("disk image '%s' for internal snapshot '%s' is not the same as disk image currently used by VM"), _("disk image '%1$s' for internal snapshot '%2$s' is not the same as disk image currently used by VM"),
snapDisk->name, snap->def->name); snapDisk->name, snap->def->name);
return -1; return -1;
} }

View File

@ -179,7 +179,7 @@ qemuTPMEmulatorCreateStorage(virDomainTPMDef *tpm,
/* allow others to cd into this dir */ /* allow others to cd into this dir */
if (g_mkdir_with_parents(swtpmStorageDir, 0711) < 0) { if (g_mkdir_with_parents(swtpmStorageDir, 0711) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Could not create TPM directory %s"), _("Could not create TPM directory %1$s"),
swtpmStorageDir); swtpmStorageDir);
return -1; return -1;
} }
@ -192,7 +192,7 @@ qemuTPMEmulatorCreateStorage(virDomainTPMDef *tpm,
if (virDirCreate(storagepath, 0700, swtpm_user, swtpm_group, if (virDirCreate(storagepath, 0700, swtpm_user, swtpm_group,
VIR_DIR_CREATE_ALLOW_EXIST) < 0) { VIR_DIR_CREATE_ALLOW_EXIST) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not create directory %s as %u:%d"), _("Could not create directory %1$s as %2$u:%3$d"),
storagepath, swtpm_user, swtpm_group); storagepath, swtpm_user, swtpm_group);
return -1; return -1;
} }
@ -294,8 +294,7 @@ qemuTPMCreateConfigFiles(const char *swtpm_setup)
return -1; return -1;
if (exitstatus != 0) { if (exitstatus != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not run '%s' to create config files. " _("Could not run '%1$s' to create config files. exitstatus: %2$d;\nError: %3$s"),
"exitstatus: %d;\nError: %s"),
swtpm_setup, exitstatus, errbuf); swtpm_setup, exitstatus, errbuf);
return -1; return -1;
} }
@ -323,8 +322,8 @@ qemuTPMVirCommandAddEncryption(virCommand *cmd,
if (!virTPMSwtpmSetupCapsGet(VIR_TPM_SWTPM_SETUP_FEATURE_CMDARG_PWDFILE_FD)) { if (!virTPMSwtpmSetupCapsGet(VIR_TPM_SWTPM_SETUP_FEATURE_CMDARG_PWDFILE_FD)) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
_("%s does not support passing a passphrase using a file " _("%1$s does not support passing a passphrase using a file descriptor"),
"descriptor"), swtpm_setup); swtpm_setup);
return -1; return -1;
} }
@ -436,8 +435,7 @@ qemuTPMEmulatorRunSetup(const char *storagepath,
if (virCommandRun(cmd, &exitstatus) < 0 || exitstatus != 0) { if (virCommandRun(cmd, &exitstatus) < 0 || exitstatus != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not run '%s'. exitstatus: %d; " _("Could not run '%1$s'. exitstatus: %2$d; Check error log '%3$s' for details."),
"Check error log '%s' for details."),
swtpm_setup, exitstatus, logfile); swtpm_setup, exitstatus, logfile);
return -1; return -1;
} }
@ -523,8 +521,7 @@ qemuTPMEmulatorReconfigure(const char *storagepath,
if (virCommandRun(cmd, &exitstatus) < 0 || exitstatus != 0) { if (virCommandRun(cmd, &exitstatus) < 0 || exitstatus != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not run '%s --reconfigure'. exitstatus: %d; " _("Could not run '%1$s --reconfigure'. exitstatus: %2$d; Check error log '%3$s' for details."),
"Check error log '%s' for details."),
swtpm_setup, exitstatus, logfile); swtpm_setup, exitstatus, logfile);
return -1; return -1;
} }
@ -636,8 +633,8 @@ qemuTPMEmulatorBuildCommand(virDomainTPMDef *tpm,
if (tpm->data.emulator.hassecretuuid) { if (tpm->data.emulator.hassecretuuid) {
if (!virTPMSwtpmCapsGet(VIR_TPM_SWTPM_FEATURE_CMDARG_PWD_FD)) { if (!virTPMSwtpmCapsGet(VIR_TPM_SWTPM_FEATURE_CMDARG_PWD_FD)) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
_("%s does not support passing passphrase via file descriptor"), _("%1$s does not support passing passphrase via file descriptor"),
swtpm); swtpm);
goto error; goto error;
} }
@ -674,8 +671,8 @@ qemuTPMEmulatorBuildCommand(virDomainTPMDef *tpm,
*/ */
if (incomingMigration && on_shared_storage) { if (incomingMigration && on_shared_storage) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
_("%s (on destination side) does not support the --migration option needed for migration with shared storage"), _("%1$s (on destination side) does not support the --migration option needed for migration with shared storage"),
swtpm); swtpm);
goto error; goto error;
} }
} }
@ -809,7 +806,7 @@ qemuTPMEmulatorPrepareHost(virDomainTPMDef *tpm,
/* ... and make sure it can be accessed by swtpm_user */ /* ... and make sure it can be accessed by swtpm_user */
if (chown(tpm->data.emulator.logfile, swtpm_user, swtpm_group) < 0) { if (chown(tpm->data.emulator.logfile, swtpm_user, swtpm_group) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Could not chown on swtpm logfile %s"), _("Could not chown on swtpm logfile %1$s"),
tpm->data.emulator.logfile); tpm->data.emulator.logfile);
return -1; return -1;
} }
@ -989,7 +986,7 @@ qemuTPMEmulatorStart(virQEMUDriver *driver,
_("swtpm died unexpectedly")); _("swtpm died unexpectedly"));
} else { } else {
virReportError(VIR_ERR_OPERATION_FAILED, virReportError(VIR_ERR_OPERATION_FAILED,
_("swtpm died and reported: %s"), errbuf); _("swtpm died and reported: %1$s"), errbuf);
} }
goto error; goto error;
} }

View File

@ -150,7 +150,7 @@ qemuVhostUserTypeParse(const char *path,
if ((tmp = qemuVhostUserTypeTypeFromString(type)) <= 0) { if ((tmp = qemuVhostUserTypeTypeFromString(type)) <= 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown vhost-user type: '%s'"), _("unknown vhost-user type: '%1$s'"),
type); type);
return -1; return -1;
} }
@ -189,7 +189,7 @@ qemuVhostUserParse(const char *path)
if (!(doc = virJSONValueFromString(cont))) { if (!(doc = virJSONValueFromString(cont))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to parse json file '%s'"), _("unable to parse json file '%1$s'"),
path); path);
return NULL; return NULL;
} }
@ -285,7 +285,7 @@ qemuVhostUserGPUFillCapabilities(qemuVhostUser *vu,
if (!(featuresJSON = virJSONValueObjectGetArray(doc, "features"))) { if (!(featuresJSON = virJSONValueObjectGetArray(doc, "features"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to get features from '%s'"), _("failed to get features from '%1$s'"),
vu->binary); vu->binary);
return -1; return -1;
} }
@ -359,7 +359,7 @@ qemuVhostUserFillDomainGPU(virQEMUDriver *driver,
if (!(doc = virJSONValueFromString(output))) { if (!(doc = virJSONValueFromString(output))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to parse json capabilities '%s'"), _("unable to parse json capabilities '%1$s'"),
vu->binary); vu->binary);
continue; continue;
} }

View File

@ -158,7 +158,7 @@ int qemuExtVhostUserGPUStart(virQEMUDriver *driver,
rc = virPidFileReadPath(pidfile, &pid); rc = virPidFileReadPath(pidfile, &pid);
if (rc < 0) { if (rc < 0) {
virReportSystemError(-rc, virReportSystemError(-rc,
_("Unable to read vhost-user-gpu pidfile '%s'"), _("Unable to read vhost-user-gpu pidfile '%1$s'"),
pidfile); pidfile);
goto cleanup; goto cleanup;
} }

View File

@ -190,14 +190,14 @@ qemuVirtioFSStart(virQEMUDriver *driver,
if (!virFileIsExecutable(fs->binary)) { if (!virFileIsExecutable(fs->binary)) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("virtiofsd binary '%s' is not executable"), _("virtiofsd binary '%1$s' is not executable"),
fs->binary); fs->binary);
return -1; return -1;
} }
if (!virFileExists(fs->src->path)) { if (!virFileExists(fs->src->path)) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("the virtiofs export directory '%s' does not exist"), _("the virtiofs export directory '%1$s' does not exist"),
fs->src->path); fs->src->path);
return -1; return -1;
} }
@ -228,12 +228,12 @@ qemuVirtioFSStart(virQEMUDriver *driver,
goto error; goto error;
} else { } else {
if ((logfd = open(logpath, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR)) < 0) { if ((logfd = open(logpath, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR)) < 0) {
virReportSystemError(errno, _("failed to create logfile %s"), virReportSystemError(errno, _("failed to create logfile %1$s"),
logpath); logpath);
goto error; goto error;
} }
if (virSetCloseExec(logfd) < 0) { if (virSetCloseExec(logfd) < 0) {
virReportSystemError(errno, _("failed to set close-on-exec flag on %s"), virReportSystemError(errno, _("failed to set close-on-exec flag on %1$s"),
logpath); logpath);
goto error; goto error;
} }
@ -276,7 +276,7 @@ qemuVirtioFSStart(virQEMUDriver *driver,
rc = virPidFileReadPath(pidfile, &pid); rc = virPidFileReadPath(pidfile, &pid);
if (rc < 0) { if (rc < 0) {
virReportSystemError(-rc, virReportSystemError(-rc,
_("Unable to read virtiofsd pidfile '%s'"), _("Unable to read virtiofsd pidfile '%1$s'"),
pidfile); pidfile);
goto error; goto error;
} }