if (virStorageFileBackendsCount >= VIR_STORAGE_BACKENDS_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Too many drivers, cannot register storage file "
- "backend '%s'"),
+ _("Too many drivers, cannot register storage file backend '%1$s'"),
virStorageTypeToString(backend->type));
return -1;
}
if (type == VIR_STORAGE_TYPE_NETWORK) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("missing storage backend for network files "
- "using %s protocol"),
+ _("missing storage backend for network files using %1$s protocol"),
virStorageNetProtocolTypeToString(protocol));
} else {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("missing storage backend for '%s' storage"),
+ _("missing storage backend for '%1$s' storage"),
virStorageTypeToString(type));
}
if ((fd = virFileOpenAs(src->path, O_RDONLY, 0,
drv->uid, drv->gid, 0)) < 0) {
- virReportSystemError(-fd, _("Failed to open file '%s'"),
+ virReportSystemError(-fd, _("Failed to open file '%1$s'"),
src->path);
return -1;
}
if (offset > 0) {
if (lseek(fd, offset, SEEK_SET) == (off_t) -1) {
- virReportSystemError(errno, _("cannot seek into '%s'"), src->path);
+ virReportSystemError(errno, _("cannot seek into '%1$s'"), src->path);
return -1;
}
}
if ((ret = virFileReadHeaderFD(fd, len, buf)) < 0) {
- virReportSystemError(errno, _("cannot read header '%s'"), src->path);
+ virReportSystemError(errno, _("cannot read header '%1$s'"), src->path);
return -1;
}
if (glfs_set_volfile_server(priv->vol, transport, hoststr, port) < 0) {
virReportSystemError(errno,
- _("failed to set gluster volfile server '%s'"),
+ _("failed to set gluster volfile server '%1$s'"),
hoststr);
return -1;
}
if (!src->volume) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("missing gluster volume name for path '%s'"),
+ _("missing gluster volume name for path '%1$s'"),
src->path);
return -1;
}
if (!(priv->vol = glfs_new(src->volume))) {
virReportError(VIR_ERR_OPERATION_FAILED,
- _("failed to create glfs object for '%s'"), src->volume);
+ _("failed to create glfs object for '%1$s'"), src->volume);
goto error;
}
if (glfs_init(priv->vol) < 0) {
virReportSystemError(errno,
- _("failed to initialize gluster connection "
- "(src=%p priv=%p)"), src, priv);
+ _("failed to initialize gluster connection (src=%1$p priv=%2$p)"),
+ src, priv);
goto error;
}
*buf = NULL;
if (!(fd = glfs_open(priv->vol, src->path, O_RDONLY))) {
- virReportSystemError(errno, _("Failed to open file '%s'"),
+ virReportSystemError(errno, _("Failed to open file '%1$s'"),
src->path);
return -1;
}
if (offset > 0) {
if (glfs_lseek(fd, offset, SEEK_SET) == (off_t) -1) {
- virReportSystemError(errno, _("cannot seek into '%s'"), src->path);
+ virReportSystemError(errno, _("cannot seek into '%1$s'"), src->path);
goto cleanup;
}
}
continue;
if (r < 0) {
VIR_FREE(*buf);
- virReportSystemError(errno, _("unable to read '%s'"), src->path);
+ virReportSystemError(errno, _("unable to read '%1$s'"), src->path);
return r;
}
if (r == 0)
if (meta->format <= VIR_STORAGE_FILE_NONE ||
meta->format >= VIR_STORAGE_FILE_LAST) {
- virReportSystemError(EINVAL, _("unknown storage file meta->format %d"),
+ virReportSystemError(EINVAL, _("unknown storage file meta->format %1$d"),
meta->format);
return -1;
}
} else {
if (meta->encryption->format != expt_fmt) {
virReportError(VIR_ERR_XML_ERROR,
- _("encryption format %d doesn't match "
- "expected format %d"),
+ _("encryption format %1$d doesn't match expected format %2$d"),
meta->encryption->format, expt_fmt);
return -1;
}
g_autofree char *header = NULL;
if ((fd = virFileOpenAs(path, O_RDONLY, 0, uid, gid, 0)) < 0) {
- virReportSystemError(-fd, _("Failed to open file '%s'"), path);
+ virReportSystemError(-fd, _("Failed to open file '%1$s'"), path);
return -1;
}
if (fstat(fd, &sb) < 0) {
- virReportSystemError(errno, _("cannot stat file '%s'"), path);
+ virReportSystemError(errno, _("cannot stat file '%1$s'"), path);
return -1;
}
return VIR_STORAGE_FILE_DIR;
if (lseek(fd, 0, SEEK_SET) == (off_t)-1) {
- virReportSystemError(errno, _("cannot set to start of '%s'"), path);
+ virReportSystemError(errno, _("cannot set to start of '%1$s'"), path);
return -1;
}
if ((len = virFileReadHeaderFD(fd, len, &header)) < 0) {
- virReportSystemError(errno, _("cannot read header '%s'"), path);
+ virReportSystemError(errno, _("cannot read header '%1$s'"), path);
return -1;
}
if (fstat(fd, &sb) < 0) {
virReportSystemError(errno,
- _("cannot stat file '%s'"), path);
+ _("cannot stat file '%1$s'"), path);
return NULL;
}
}
if (lseek(fd, 0, SEEK_SET) == (off_t)-1) {
- virReportSystemError(errno, _("cannot seek to start of '%s'"), meta->path);
+ virReportSystemError(errno, _("cannot seek to start of '%1$s'"), meta->path);
return NULL;
}
if ((len = virFileReadHeaderFD(fd, len, &buf)) < 0) {
- virReportSystemError(errno, _("cannot read header '%s'"), meta->path);
+ virReportSystemError(errno, _("cannot read header '%1$s'"), meta->path);
return NULL;
}
idx != 0 &&
STRNEQ(diskTarget, target)) {
virReportError(VIR_ERR_INVALID_ARG,
- _("requested target '%s' does not match target '%s'"),
+ _("requested target '%1$s' does not match target '%2$s'"),
target, diskTarget);
return NULL;
}
error:
if (idx) {
virReportError(VIR_ERR_INVALID_ARG,
- _("could not find backing store index '%u' in chain for '%s'"),
+ _("could not find backing store index '%1$u' in chain for '%2$s'"),
idx, NULLSTR(start));
} else if (name) {
if (startFrom)
virReportError(VIR_ERR_INVALID_ARG,
- _("could not find image '%s' beneath '%s' in chain for '%s'"),
+ _("could not find image '%1$s' beneath '%2$s' in chain for '%3$s'"),
name, NULLSTR(startFrom->path), NULLSTR(start));
else
virReportError(VIR_ERR_INVALID_ARG,
- _("could not find image '%s' in chain for '%s'"),
+ _("could not find image '%1$s' in chain for '%2$s'"),
name, NULLSTR(start));
} else {
virReportError(VIR_ERR_INVALID_ARG,
- _("could not find base image in chain for '%s'"),
+ _("could not find base image in chain for '%1$s'"),
NULLSTR(start));
}
*parent = NULL;
*/
if ((end = lseek(fd, 0, SEEK_END)) == (off_t)-1) {
virReportSystemError(errno,
- _("failed to seek to end of %s"), src->path);
+ _("failed to seek to end of %1$s"), src->path);
return -1;
}
src->physical = end;
* physical size. */
if (format == VIR_STORAGE_FILE_NONE) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("no disk format for %s was specified"),
+ _("no disk format for %1$s was specified"),
src->path);
return -1;
}
if (src == parent) {
virReportSystemError(errcode,
- _("Cannot access storage file '%s' "
- "(as uid:%u, gid:%u)"),
+ _("Cannot access storage file '%1$s' (as uid:%2$u, gid:%3$u)"),
src->path, access_user, access_group);
} else {
virReportSystemError(errcode,
- _("Cannot access backing file '%s' "
- "of storage file '%s' (as uid:%u, gid:%u)"),
+ _("Cannot access backing file '%1$s' of storage file '%2$s' (as uid:%3$u, gid:%4$u)"),
src->path, parent->path, access_user, access_group);
}
} else {
if (src == parent) {
virReportSystemError(errcode,
- _("Cannot access storage file '%s'"),
+ _("Cannot access storage file '%1$s'"),
src->path);
} else {
virReportSystemError(errcode,
- _("Cannot access backing file '%s' "
- "of storage file '%s'"),
+ _("Cannot access backing file '%1$s' of storage file '%2$s'"),
src->path, parent->path);
}
}
if (depth > max_depth) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("backing store for %s is self-referential or too deeply nested"),
+ _("backing store for %1$s is self-referential or too deeply nested"),
NULLSTR(src->path));
return -1;
}
if (rv == -2) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("format of backing image '%s' of image '%s' was not specified in the image metadata "
- "(See https://libvirt.org/kbase/backing_chains.html for troubleshooting)"),
+ _("format of backing image '%1$s' of image '%2$s' was not specified in the image metadata (See https://libvirt.org/kbase/backing_chains.html for troubleshooting)"),
src->backingStoreRaw, NULLSTR(src->path));
}
if (!(uri = virURIParse(uristr))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to parse backing file location '%s'"),
+ _("failed to parse backing file location '%1$s'"),
uristr);
return -1;
}
if (!scheme[0] ||
(src->protocol = virStorageNetProtocolTypeFromString(scheme[0])) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("invalid backing protocol '%s'"),
+ _("invalid backing protocol '%1$s'"),
NULLSTR(scheme[0]));
return -1;
}
if (scheme[1] &&
(src->hosts->transport = virStorageNetHostTransportTypeFromString(scheme[1])) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("invalid protocol transport type '%s'"),
+ _("invalid protocol transport type '%1$s'"),
scheme[1]);
return -1;
}
if (!(tmp = strchr(src->path, '/')) ||
tmp == src->path) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("missing volume name or file name in "
- "gluster source path '%s'"), src->path);
+ _("missing volume name or file name in gluster source path '%1$s'"),
+ src->path);
return -1;
}
/* formulate authdef for src->auth */
if (src->auth) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("duplicate 'id' found in '%s'"), src->path);
+ _("duplicate 'id' found in '%1$s'"), src->path);
return -1;
}
malformed:
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("malformed nbd string '%s'"), nbdstr);
+ _("malformed nbd string '%1$s'"), nbdstr);
return -1;
}
if (!(p = strchr(path, ':'))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("invalid backing protocol string '%s'"),
+ _("invalid backing protocol string '%1$s'"),
path);
return -1;
}
if ((src->protocol = virStorageNetProtocolTypeFromString(protocol)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("invalid backing protocol '%s'"),
+ _("invalid backing protocol '%1$s'"),
protocol);
return -1;
}
case VIR_STORAGE_NET_PROTOCOL_LAST:
case VIR_STORAGE_NET_PROTOCOL_NONE:
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("backing store parser is not implemented for protocol %s"),
+ _("backing store parser is not implemented for protocol %1$s"),
protocol);
return -1;
case VIR_STORAGE_NET_PROTOCOL_VXHS:
case VIR_STORAGE_NET_PROTOCOL_NFS:
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("malformed backing store path for protocol %s"),
+ _("malformed backing store path for protocol %1$s"),
protocol);
return -1;
}
if (src->protocol != protocol) {
virReportError(VIR_ERR_INVALID_ARG,
- _("expected protocol '%s' but got '%s' in URI JSON volume "
- "definition"),
+ _("expected protocol '%1$s' but got '%2$s' in URI JSON volume definition"),
virStorageNetProtocolTypeToString(protocol),
virStorageNetProtocolTypeToString(src->protocol));
return -1;
if (!(cookiestr = virJSONValueObjectGetString(json, "cookie"))) {
virReportError(VIR_ERR_INVALID_ARG,
- _("wrong format of 'cookie' field in backing store definition '%s'"),
+ _("wrong format of 'cookie' field in backing store definition '%1$s'"),
jsonstr);
return -1;
}
if (!(cookievalue = strchr(cookiename, '='))) {
virReportError(VIR_ERR_INVALID_ARG,
- _("malformed http cookie '%s' in backing store definition '%s'"),
+ _("malformed http cookie '%1$s' in backing store definition '%2$s'"),
cookies[i], jsonstr);
return -1;
}
} else {
if (virJSONValueObjectGetBoolean(json, "sslverify", &tmp) < 0) {
virReportError(VIR_ERR_INVALID_ARG,
- _("malformed 'sslverify' field in backing store definition '%s'"),
+ _("malformed 'sslverify' field in backing store definition '%1$s'"),
jsonstr);
return -1;
}
if (virJSONValueObjectHasKey(json, "readahead") &&
virJSONValueObjectGetNumberUlong(json, "readahead", &src->readahead) < 0) {
virReportError(VIR_ERR_INVALID_ARG,
- _("malformed 'readahead' field in backing store definition '%s'"),
+ _("malformed 'readahead' field in backing store definition '%1$s'"),
jsonstr);
return -1;
}
if (virJSONValueObjectHasKey(json, "timeout") &&
virJSONValueObjectGetNumberUlong(json, "timeout", &src->timeout) < 0) {
virReportError(VIR_ERR_INVALID_ARG,
- _("malformed 'timeout' field in backing store definition '%s'"),
+ _("malformed 'timeout' field in backing store definition '%1$s'"),
jsonstr);
return -1;
}
host->socket = g_strdup(socket);
} else {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("backing store protocol '%s' is not yet supported"),
+ _("backing store protocol '%1$s' is not yet supported"),
type);
return -1;
}
/* 'raw' is a format driver so it can have protocol driver children */
if (!(file = virJSONValueObjectGetObject(json, "file"))) {
virReportError(VIR_ERR_INVALID_ARG,
- _("JSON backing volume definition '%s' lacks 'file' object"),
+ _("JSON backing volume definition '%1$s' lacks 'file' object"),
jsonstr);
return -1;
}
if (!(drvname = virJSONValueObjectGetString(json, "driver"))) {
virReportError(VIR_ERR_INVALID_ARG,
- _("JSON backing volume definition '%s' lacks driver name"),
+ _("JSON backing volume definition '%1$s' lacks driver name"),
jsonstr);
return -1;
}
if (jsonParsers[i].formatdriver && !allowformat) {
virReportError(VIR_ERR_INVALID_ARG,
- _("JSON backing volume definition '%s' must not have nested format drivers"),
+ _("JSON backing volume definition '%1$s' must not have nested format drivers"),
jsonstr);
return -1;
}
}
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("missing parser implementation for JSON backing volume "
- "driver '%s'"), drvname);
+ _("missing parser implementation for JSON backing volume driver '%1$s'"),
+ drvname);
return -1;
}