storage: 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:46:00 +01:00
parent 181d61fd5c
commit ce0c2010a8
14 changed files with 270 additions and 285 deletions

View File

@ -75,7 +75,7 @@ int main(int argc, char **argv)
} else if (argc == 3 && STREQ(argv[2], "-p")) { } else if (argc == 3 && STREQ(argv[2], "-p")) {
devmap_partsep = true; devmap_partsep = true;
} else if (argc != 2) { } else if (argc != 2) {
fprintf(stderr, _("syntax: %s DEVICE [-g]|[-p]\n"), argv[0]); fprintf(stderr, _("syntax: %1$s DEVICE [-g]|[-p]\n"), argv[0]);
return 1; return 1;
} }
@ -101,7 +101,7 @@ int main(int argc, char **argv)
} }
if ((dev = ped_device_get(path)) == NULL) { if ((dev = ped_device_get(path)) == NULL) {
fprintf(stderr, _("unable to access device %s\n"), path); fprintf(stderr, _("unable to access device %1$s\n"), path);
return 2; return 2;
} }
@ -115,7 +115,7 @@ int main(int argc, char **argv)
} }
if ((disk = ped_disk_new(dev)) == NULL) { if ((disk = ped_disk_new(dev)) == NULL) {
fprintf(stderr, _("unable to access disk %s\n"), argv[1]); fprintf(stderr, _("unable to access disk %1$s\n"), argv[1]);
return 2; return 2;
} }

View File

@ -149,7 +149,7 @@ virStorageBackendRegister(virStorageBackend *backend)
if (virStorageBackendsCount >= VIR_STORAGE_BACKENDS_MAX) { if (virStorageBackendsCount >= VIR_STORAGE_BACKENDS_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Too many drivers, cannot register storage backend '%s'"), _("Too many drivers, cannot register storage backend '%1$s'"),
virStoragePoolTypeToString(backend->type)); virStoragePoolTypeToString(backend->type));
return -1; return -1;
} }
@ -169,7 +169,7 @@ virStorageBackendForType(int type)
return virStorageBackends[i]; return virStorageBackends[i];
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("missing backend for pool type %d (%s)"), _("missing backend for pool type %1$d (%2$s)"),
type, NULLSTR(virStoragePoolTypeToString(type))); type, NULLSTR(virStoragePoolTypeToString(type)));
return NULL; return NULL;
} }

View File

@ -100,7 +100,7 @@ virStorageBackendDiskMakeDataVol(virStoragePoolObj *pool,
*/ */
if (STRNEQ(vol->name, partname)) { if (STRNEQ(vol->name, partname)) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("invalid partition name '%s', expected '%s'"), _("invalid partition name '%1$s', expected '%2$s'"),
vol->name, partname); vol->name, partname);
/* Let's see if by chance parthelper created a name that won't be /* Let's see if by chance parthelper created a name that won't be
@ -436,7 +436,7 @@ virStorageBackendDiskRefreshPool(virStoragePoolObj *pool)
if (!virFileExists(def->source.devices[0].path)) { if (!virFileExists(def->source.devices[0].path)) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("device path '%s' doesn't exist"), _("device path '%1$s' doesn't exist"),
def->source.devices[0].path); def->source.devices[0].path);
return -1; return -1;
} }
@ -462,7 +462,7 @@ virStorageBackendDiskStartPool(virStoragePoolObj *pool)
if (!virFileExists(path)) { if (!virFileExists(path)) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("device path '%s' doesn't exist"), path); _("device path '%1$s' doesn't exist"), path);
return -1; return -1;
} }
@ -814,7 +814,7 @@ virStorageBackendDiskDeleteVol(virStoragePoolObj *pool,
if (!vol->target.path) { if (!vol->target.path) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("volume target path empty for source path '%s'"), _("volume target path empty for source path '%1$s'"),
src_path); src_path);
return -1; return -1;
} }
@ -829,7 +829,7 @@ virStorageBackendDiskDeleteVol(virStoragePoolObj *pool,
} else { } else {
if (virFileResolveLink(vol->target.path, &devpath) < 0) { if (virFileResolveLink(vol->target.path, &devpath) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Couldn't read volume target path '%s'"), _("Couldn't read volume target path '%1$s'"),
vol->target.path); vol->target.path);
return -1; return -1;
} }
@ -840,8 +840,8 @@ virStorageBackendDiskDeleteVol(virStoragePoolObj *pool,
if (!STRPREFIX(dev_name, srcname)) { if (!STRPREFIX(dev_name, srcname)) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Volume path '%s' did not start with parent " _("Volume path '%1$s' did not start with parent pool source device name."),
"pool source device name."), dev_name); dev_name);
return -1; return -1;
} }
@ -854,8 +854,8 @@ virStorageBackendDiskDeleteVol(virStoragePoolObj *pool,
if (*part_num == 0) { if (*part_num == 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot parse partition number from target " _("cannot parse partition number from target '%1$s'"),
"'%s'"), dev_name); dev_name);
return -1; return -1;
} }
@ -986,7 +986,7 @@ virStorageBackendDiskVolWipe(virStoragePoolObj *pool,
/* Wiping an extended partition is not support */ /* Wiping an extended partition is not support */
virReportError(VIR_ERR_NO_SUPPORT, virReportError(VIR_ERR_NO_SUPPORT,
_("cannot wipe extended partition '%s'"), _("cannot wipe extended partition '%1$s'"),
vol->target.path); vol->target.path);
return -1; return -1;
} }

View File

@ -62,13 +62,13 @@ virStorageBackendFileSystemNetFindPoolSourcesFunc(char **const groups,
if (!(name = strrchr(path, '/'))) { if (!(name = strrchr(path, '/'))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("invalid netfs path (no /): %s"), path); _("invalid netfs path (no /): %1$s"), path);
return -1; return -1;
} }
name += 1; name += 1;
if (*name == '\0') { if (*name == '\0') {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("invalid netfs path (ends in /): %s"), path); _("invalid netfs path (ends in /): %1$s"), path);
return -1; return -1;
} }
@ -168,7 +168,7 @@ virStorageBackendFileSystemNetFindPoolSources(const char *srcSpec,
/* If both fail, then we won't return an empty list - return an error */ /* If both fail, then we won't return an empty list - return an error */
if (retNFS < 0 && retGluster == 0) { if (retNFS < 0 && retGluster == 0) {
virReportError(VIR_ERR_OPERATION_FAILED, virReportError(VIR_ERR_OPERATION_FAILED,
_("no storage pools were found on host '%s'"), _("no storage pools were found on host '%1$s'"),
state.host); state.host);
goto cleanup; goto cleanup;
} }
@ -247,7 +247,7 @@ virStorageBackendFileSystemIsMounted(virStoragePoolObj *pool)
if ((mtab = fopen(_PATH_MOUNTED, "r")) == NULL) { if ((mtab = fopen(_PATH_MOUNTED, "r")) == NULL) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot read mount list '%s'"), _("cannot read mount list '%1$s'"),
_PATH_MOUNTED); _PATH_MOUNTED);
goto cleanup; goto cleanup;
} }
@ -409,8 +409,7 @@ virStorageBackendExecuteMKFS(const char *device,
if (!mkfs) { if (!mkfs) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("mkfs is not available on this platform: " _("mkfs is not available on this platform: Failed to make filesystem of type '%1$s' on device '%2$s'"),
"Failed to make filesystem of type '%s' on device '%s'"),
format, device); format, device);
return -1; return -1;
} }
@ -448,7 +447,7 @@ virStorageBackendMakeFileSystem(virStoragePoolObj *pool,
if (def->source.devices == NULL) { if (def->source.devices == NULL) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("No source device specified when formatting pool '%s'"), _("No source device specified when formatting pool '%1$s'"),
def->name); def->name);
return -1; return -1;
} }
@ -460,7 +459,7 @@ virStorageBackendMakeFileSystem(virStoragePoolObj *pool,
virObjectUnlock(pool); virObjectUnlock(pool);
if (!virFileExists(device)) { if (!virFileExists(device)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("Source device does not exist when formatting pool '%s'"), _("Source device does not exist when formatting pool '%1$s'"),
def->name); def->name);
goto error; goto error;
} }

View File

@ -82,14 +82,14 @@ virStorageBackendGlusterOpen(virStoragePoolObj *pool)
* subdirectory within the volume name. */ * subdirectory within the volume name. */
if (strchr(name, '/')) { if (strchr(name, '/')) {
virReportError(VIR_ERR_XML_ERROR, virReportError(VIR_ERR_XML_ERROR,
_("gluster pool name '%s' must not contain /"), _("gluster pool name '%1$s' must not contain /"),
name); name);
return NULL; return NULL;
} }
if (dir) { if (dir) {
if (*dir != '/') { if (*dir != '/') {
virReportError(VIR_ERR_XML_ERROR, virReportError(VIR_ERR_XML_ERROR,
_("gluster pool path '%s' must start with /"), _("gluster pool path '%1$s' must start with /"),
dir); dir);
return NULL; return NULL;
} }
@ -113,7 +113,7 @@ virStorageBackendGlusterOpen(virStoragePoolObj *pool)
/* Actually connect to glfs */ /* Actually connect to glfs */
if (!(ret->vol = glfs_new(ret->volname))) { if (!(ret->vol = glfs_new(ret->volname))) {
virReportError(VIR_ERR_OPERATION_FAILED, virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to create glfs object for '%s'"), ret->volname); _("failed to create glfs object for '%1$s'"), ret->volname);
goto error; goto error;
} }
@ -122,13 +122,13 @@ virStorageBackendGlusterOpen(virStoragePoolObj *pool)
glfs_init(ret->vol) < 0) { glfs_init(ret->vol) < 0) {
g_autofree char *uri = NULL; g_autofree char *uri = NULL;
uri = virURIFormat(ret->uri); uri = virURIFormat(ret->uri);
virReportSystemError(errno, _("failed to connect to %s"), NULLSTR(uri)); virReportSystemError(errno, _("failed to connect to %1$s"), NULLSTR(uri));
goto error; goto error;
} }
if (glfs_chdir(ret->vol, ret->dir) < 0) { if (glfs_chdir(ret->vol, ret->dir) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("failed to change to directory '%s' in '%s'"), _("failed to change to directory '%1$s' in '%2$s'"),
ret->dir, ret->volname); ret->dir, ret->volname);
goto error; goto error;
} }
@ -159,7 +159,7 @@ virStorageBackendGlusterRead(glfs_fd_t *fd,
continue; continue;
if (r < 0) { if (r < 0) {
VIR_FREE(*buf); VIR_FREE(*buf);
virReportSystemError(errno, _("unable to read '%s'"), name); virReportSystemError(errno, _("unable to read '%1$s'"), name);
return r; return r;
} }
if (r == 0) if (r == 0)
@ -234,7 +234,7 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlusterState *state,
VIR_WARN("ignoring dangling symlink '%s'", name); VIR_WARN("ignoring dangling symlink '%s'", name);
ret = 0; ret = 0;
} else { } else {
virReportSystemError(errno, _("cannot stat '%s'"), name); virReportSystemError(errno, _("cannot stat '%1$s'"), name);
} }
return ret; return ret;
} }
@ -259,7 +259,7 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlusterState *state,
* of fifos, so there's nothing it would protect us from. */ * of fifos, so there's nothing it would protect us from. */
if (!(fd = glfs_open(state->vol, name, O_RDONLY | O_NOCTTY))) { if (!(fd = glfs_open(state->vol, name, O_RDONLY | O_NOCTTY))) {
/* A dangling symlink now implies a TOCTTOU race; report it. */ /* A dangling symlink now implies a TOCTTOU race; report it. */
virReportSystemError(errno, _("cannot open volume '%s'"), name); virReportSystemError(errno, _("cannot open volume '%1$s'"), name);
goto cleanup; goto cleanup;
} }
@ -334,7 +334,7 @@ virStorageBackendGlusterRefreshPool(virStoragePoolObj *pool)
*/ */
if (!(dir = glfs_opendir(state->vol, state->dir))) { if (!(dir = glfs_opendir(state->vol, state->dir))) {
virReportSystemError(errno, _("cannot open path '%s' in '%s'"), virReportSystemError(errno, _("cannot open path '%1$s' in '%2$s'"),
state->dir, state->volname); state->dir, state->volname);
goto cleanup; goto cleanup;
} }
@ -350,13 +350,13 @@ virStorageBackendGlusterRefreshPool(virStoragePoolObj *pool)
goto cleanup; goto cleanup;
} }
if (errno) { if (errno) {
virReportSystemError(errno, _("failed to read directory '%s' in '%s'"), virReportSystemError(errno, _("failed to read directory '%1$s' in '%2$s'"),
state->dir, state->volname); state->dir, state->volname);
goto cleanup; goto cleanup;
} }
if (glfs_statvfs(state->vol, state->dir, &sb) < 0) { if (glfs_statvfs(state->vol, state->dir, &sb) < 0) {
virReportSystemError(errno, _("cannot statvfs path '%s' in '%s'"), virReportSystemError(errno, _("cannot statvfs path '%1$s' in '%2$s'"),
state->dir, state->volname); state->dir, state->volname);
goto cleanup; goto cleanup;
} }
@ -393,8 +393,7 @@ virStorageBackendGlusterVolDelete(virStoragePoolObj *pool,
case VIR_STORAGE_VOL_PLOOP: case VIR_STORAGE_VOL_PLOOP:
case VIR_STORAGE_VOL_LAST: case VIR_STORAGE_VOL_LAST:
virReportError(VIR_ERR_NO_SUPPORT, virReportError(VIR_ERR_NO_SUPPORT,
_("removing of '%s' volumes is not supported " _("removing of '%1$s' volumes is not supported by the gluster backend: %2$s"),
"by the gluster backend: %s"),
virStorageVolTypeToString(vol->type), virStorageVolTypeToString(vol->type),
vol->target.path); vol->target.path);
goto cleanup; goto cleanup;
@ -407,7 +406,7 @@ virStorageBackendGlusterVolDelete(virStoragePoolObj *pool,
if (glfs_unlink(state->vol, vol->name) < 0) { if (glfs_unlink(state->vol, vol->name) < 0) {
if (errno != ENOENT) { if (errno != ENOENT) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot remove gluster volume file '%s'"), _("cannot remove gluster volume file '%1$s'"),
vol->target.path); vol->target.path);
goto cleanup; goto cleanup;
} }
@ -421,7 +420,7 @@ virStorageBackendGlusterVolDelete(virStoragePoolObj *pool,
if (glfs_rmdir(state->vol, vol->target.path) < 0) { if (glfs_rmdir(state->vol, vol->target.path) < 0) {
if (errno != ENOENT) { if (errno != ENOENT) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot remove gluster volume dir '%s'"), _("cannot remove gluster volume dir '%1$s'"),
vol->target.path); vol->target.path);
goto cleanup; goto cleanup;
} }
@ -475,7 +474,7 @@ virStorageBackendGlusterFindPoolSources(const char *srcSpec,
if (rc == 0) { if (rc == 0) {
virReportError(VIR_ERR_OPERATION_FAILED, virReportError(VIR_ERR_OPERATION_FAILED,
_("no storage pools were found on host '%s'"), _("no storage pools were found on host '%1$s'"),
source->hosts[0].name); source->hosts[0].name);
goto cleanup; goto cleanup;
} }

View File

@ -105,7 +105,7 @@ virStorageBackendISCSIGetHostNumber(const char *sysfs_path,
return 0; return 0;
} else { } else {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to parse target '%s'"), dirent->d_name); _("Failed to parse target '%1$s'"), dirent->d_name);
return -1; return -1;
} }
} }
@ -113,8 +113,8 @@ virStorageBackendISCSIGetHostNumber(const char *sysfs_path,
if (direrr == 0) { if (direrr == 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to get host number for iSCSI session " _("Failed to get host number for iSCSI session with path '%1$s'"),
"with path '%s'"), sysfs_path); sysfs_path);
return -1; return -1;
} }

View File

@ -52,7 +52,7 @@ virISCSIDirectCreateContext(const char* initiator_iqn)
iscsi = iscsi_create_context(initiator_iqn); iscsi = iscsi_create_context(initiator_iqn);
if (!iscsi) if (!iscsi)
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to create iscsi context for %s"), _("Failed to create iscsi context for %1$s"),
initiator_iqn); initiator_iqn);
return iscsi; return iscsi;
} }
@ -124,7 +124,7 @@ virStorageBackendISCSIDirectSetAuth(struct iscsi_context *iscsi,
authdef->username, secret_str) < 0) { authdef->username, secret_str) < 0) {
virSecureErase(secret_str, secret_size); virSecureErase(secret_str, secret_size);
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to set credential: %s"), _("Failed to set credential: %1$s"),
iscsi_get_error(iscsi)); iscsi_get_error(iscsi));
return -1; return -1;
} }
@ -140,21 +140,21 @@ virISCSIDirectSetContext(struct iscsi_context *iscsi,
{ {
if (iscsi_init_transport(iscsi, TCP_TRANSPORT) < 0) { if (iscsi_init_transport(iscsi, TCP_TRANSPORT) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to init transport: %s"), _("Failed to init transport: %1$s"),
iscsi_get_error(iscsi)); iscsi_get_error(iscsi));
return -1; return -1;
} }
if (session == ISCSI_SESSION_NORMAL) { if (session == ISCSI_SESSION_NORMAL) {
if (iscsi_set_targetname(iscsi, target_name) < 0) { if (iscsi_set_targetname(iscsi, target_name) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to set target name: %s"), _("Failed to set target name: %1$s"),
iscsi_get_error(iscsi)); iscsi_get_error(iscsi));
return -1; return -1;
} }
} }
if (iscsi_set_session_type(iscsi, session) < 0) { if (iscsi_set_session_type(iscsi, session) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to set session type: %s"), _("Failed to set session type: %1$s"),
iscsi_get_error(iscsi)); iscsi_get_error(iscsi));
return -1; return -1;
} }
@ -167,13 +167,13 @@ virISCSIDirectConnect(struct iscsi_context *iscsi,
{ {
if (iscsi_connect_sync(iscsi, portal) < 0) { if (iscsi_connect_sync(iscsi, portal) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to connect: %s"), _("Failed to connect: %1$s"),
iscsi_get_error(iscsi)); iscsi_get_error(iscsi));
return -1; return -1;
} }
if (iscsi_login_sync(iscsi) < 0) { if (iscsi_login_sync(iscsi) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to login: %s"), _("Failed to login: %1$s"),
iscsi_get_error(iscsi)); iscsi_get_error(iscsi));
return -1; return -1;
} }
@ -195,7 +195,7 @@ virISCSIDirectTestUnitReady(struct iscsi_context *iscsi,
do { do {
if (!(task = iscsi_testunitready_sync(iscsi, lun))) { if (!(task = iscsi_testunitready_sync(iscsi, lun))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed testunitready: %s"), _("Failed testunitready: %1$s"),
iscsi_get_error(iscsi)); iscsi_get_error(iscsi));
goto cleanup; goto cleanup;
} }
@ -210,7 +210,7 @@ virISCSIDirectTestUnitReady(struct iscsi_context *iscsi,
if (task->status != SCSI_STATUS_GOOD) { if (task->status != SCSI_STATUS_GOOD) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed testunitready: %s"), _("Failed testunitready: %1$s"),
iscsi_get_error(iscsi)); iscsi_get_error(iscsi));
goto cleanup; goto cleanup;
} }
@ -250,14 +250,14 @@ virISCSIDirectGetVolumeCapacity(struct iscsi_context *iscsi,
if (!(task = iscsi_inquiry_sync(iscsi, lun, 0, 0, 64)) || if (!(task = iscsi_inquiry_sync(iscsi, lun, 0, 0, 64)) ||
task->status != SCSI_STATUS_GOOD) { task->status != SCSI_STATUS_GOOD) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to send inquiry command: %s"), _("Failed to send inquiry command: %1$s"),
iscsi_get_error(iscsi)); iscsi_get_error(iscsi));
goto cleanup; goto cleanup;
} }
if (!(inq = scsi_datain_unmarshall(task))) { if (!(inq = scsi_datain_unmarshall(task))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to unmarshall reply: %s"), _("Failed to unmarshall reply: %1$s"),
iscsi_get_error(iscsi)); iscsi_get_error(iscsi));
goto cleanup; goto cleanup;
} }
@ -270,14 +270,14 @@ virISCSIDirectGetVolumeCapacity(struct iscsi_context *iscsi,
if (!(task = iscsi_readcapacity16_sync(iscsi, lun)) || if (!(task = iscsi_readcapacity16_sync(iscsi, lun)) ||
task->status != SCSI_STATUS_GOOD) { task->status != SCSI_STATUS_GOOD) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to get capacity of lun: %s"), _("Failed to get capacity of lun: %1$s"),
iscsi_get_error(iscsi)); iscsi_get_error(iscsi));
goto cleanup; goto cleanup;
} }
if (!(rc16 = scsi_datain_unmarshall(task))) { if (!(rc16 = scsi_datain_unmarshall(task))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to unmarshall reply: %s"), _("Failed to unmarshall reply: %1$s"),
iscsi_get_error(iscsi)); iscsi_get_error(iscsi));
goto cleanup; goto cleanup;
} }
@ -343,7 +343,7 @@ virISCSIDirectReportLuns(virStoragePoolObj *pool,
if (!(task = iscsi_reportluns_sync(iscsi, 0, 16))) { if (!(task = iscsi_reportluns_sync(iscsi, 0, 16))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to reportluns: %s"), _("Failed to reportluns: %1$s"),
iscsi_get_error(iscsi)); iscsi_get_error(iscsi));
goto cleanup; goto cleanup;
} }
@ -354,7 +354,7 @@ virISCSIDirectReportLuns(virStoragePoolObj *pool,
scsi_free_scsi_task(task); scsi_free_scsi_task(task);
if (!(task = iscsi_reportluns_sync(iscsi, 0, full_size))) { if (!(task = iscsi_reportluns_sync(iscsi, 0, full_size))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to reportluns: %s"), _("Failed to reportluns: %1$s"),
iscsi_get_error(iscsi)); iscsi_get_error(iscsi));
goto cleanup; goto cleanup;
} }
@ -362,7 +362,7 @@ virISCSIDirectReportLuns(virStoragePoolObj *pool,
if (!(list = scsi_datain_unmarshall(task))) { if (!(list = scsi_datain_unmarshall(task))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to unmarshall reportluns: %s"), _("Failed to unmarshall reportluns: %1$s"),
iscsi_get_error(iscsi)); iscsi_get_error(iscsi));
goto cleanup; goto cleanup;
} }
@ -390,13 +390,13 @@ virISCSIDirectDisconnect(struct iscsi_context *iscsi)
if (iscsi_logout_sync(iscsi) < 0) { if (iscsi_logout_sync(iscsi) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to logout: %s"), _("Failed to logout: %1$s"),
iscsi_get_error(iscsi)); iscsi_get_error(iscsi));
goto cleanup; goto cleanup;
} }
if (iscsi_disconnect(iscsi) < 0) { if (iscsi_disconnect(iscsi) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to disconnect: %s"), _("Failed to disconnect: %1$s"),
iscsi_get_error(iscsi)); iscsi_get_error(iscsi));
goto cleanup; goto cleanup;
} }
@ -420,7 +420,7 @@ virISCSIDirectUpdateTargets(struct iscsi_context *iscsi,
if (!(addr = iscsi_discovery_sync(iscsi))) { if (!(addr = iscsi_discovery_sync(iscsi))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to discover session: %s"), _("Failed to discover session: %1$s"),
iscsi_get_error(iscsi)); iscsi_get_error(iscsi));
return -1; return -1;
} }
@ -588,7 +588,7 @@ virStorageBackendISCSIDirectGetLun(virStorageVolDef *vol,
if (!(name = STRSKIP(vol->name, VOL_NAME_PREFIX)) || if (!(name = STRSKIP(vol->name, VOL_NAME_PREFIX)) ||
virStrToLong_i(name, NULL, 10, lun) < 0) { virStrToLong_i(name, NULL, 10, lun) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid volume name %s"), vol->name); _("Invalid volume name %1$s"), vol->name);
return -1; return -1;
} }
@ -625,7 +625,7 @@ virStorageBackendISCSIDirectVolWipeZero(virStorageVolDef *vol,
if (!task || if (!task ||
task->status != SCSI_STATUS_GOOD) { task->status != SCSI_STATUS_GOOD) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to write to LUN %d: %s"), _("failed to write to LUN %1$d: %2$s"),
lun, iscsi_get_error(iscsi)); lun, iscsi_get_error(iscsi));
scsi_free_scsi_task(task); scsi_free_scsi_task(task);
return -1; return -1;
@ -671,7 +671,7 @@ virStorageBackenISCSIDirectWipeVol(virStoragePoolObj *pool,
case VIR_STORAGE_VOL_WIPE_ALG_PFITZNER33: case VIR_STORAGE_VOL_WIPE_ALG_PFITZNER33:
case VIR_STORAGE_VOL_WIPE_ALG_RANDOM: case VIR_STORAGE_VOL_WIPE_ALG_RANDOM:
case VIR_STORAGE_VOL_WIPE_ALG_LAST: case VIR_STORAGE_VOL_WIPE_ALG_LAST:
virReportError(VIR_ERR_INVALID_ARG, _("unsupported algorithm %d"), virReportError(VIR_ERR_INVALID_ARG, _("unsupported algorithm %1$d"),
algorithm); algorithm);
goto cleanup; goto cleanup;
} }

View File

@ -171,7 +171,7 @@ virStorageBackendLogicalParseVolExtents(virStorageVolDef *vol,
re = g_regex_new(regex, 0, 0, &err); re = g_regex_new(regex, 0, 0, &err);
if (!re) { if (!re) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to compile regex %s"), err->message); _("Failed to compile regex %1$s"), err->message);
return -1; return -1;
} }
@ -570,7 +570,7 @@ virStorageBackendLogicalMatchPoolSource(virStoragePoolObj *pool)
if (i == sourceList.nsources) { if (i == sourceList.nsources) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("cannot find logical volume group name '%s'"), _("cannot find logical volume group name '%1$s'"),
def->source.name); def->source.name);
goto cleanup; goto cleanup;
} }
@ -600,8 +600,8 @@ virStorageBackendLogicalMatchPoolSource(virStoragePoolObj *pool)
*/ */
if (matchcount == 0) { if (matchcount == 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("cannot find any matching source devices for logical " _("cannot find any matching source devices for logical volume group '%1$s'"),
"volume group '%s'"), def->source.name); def->source.name);
goto cleanup; goto cleanup;
} }
@ -894,7 +894,7 @@ virStorageBackendLogicalCreateVol(virStoragePoolObj *pool,
if (geteuid() == 0) { if (geteuid() == 0) {
if (fchown(fd, vol->target.perms->uid, vol->target.perms->gid) < 0) { if (fchown(fd, vol->target.perms->uid, vol->target.perms->gid) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot set file owner '%s'"), _("cannot set file owner '%1$s'"),
vol->target.path); vol->target.path);
goto error; goto error;
} }
@ -903,14 +903,14 @@ virStorageBackendLogicalCreateVol(virStoragePoolObj *pool,
VIR_STORAGE_DEFAULT_VOL_PERM_MODE : VIR_STORAGE_DEFAULT_VOL_PERM_MODE :
vol->target.perms->mode)) < 0) { vol->target.perms->mode)) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot set file mode '%s'"), _("cannot set file mode '%1$s'"),
vol->target.path); vol->target.path);
goto error; goto error;
} }
if (VIR_CLOSE(fd) < 0) { if (VIR_CLOSE(fd) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot close file '%s'"), _("cannot close file '%1$s'"),
vol->target.path); vol->target.path);
goto error; goto error;
} }
@ -918,7 +918,7 @@ virStorageBackendLogicalCreateVol(virStoragePoolObj *pool,
/* Fill in data about this new vol */ /* Fill in data about this new vol */
if (virStorageBackendLogicalFindLVs(pool, vol) < 0) { if (virStorageBackendLogicalFindLVs(pool, vol) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot find newly created volume '%s'"), _("cannot find newly created volume '%1$s'"),
vol->target.path); vol->target.path);
goto error; goto error;
} }
@ -969,8 +969,7 @@ virStorageBackendLogicalVolWipe(virStoragePoolObj *pool,
* unsupported. * unsupported.
*/ */
virReportError(VIR_ERR_NO_SUPPORT, virReportError(VIR_ERR_NO_SUPPORT,
_("logical volume '%s' is sparse, volume wipe " _("logical volume '%1$s' is sparse, volume wipe not supported"),
"not supported"),
vol->target.path); vol->target.path);
return -1; return -1;
} }

View File

@ -165,7 +165,7 @@ virStorageBackendCreateVols(virStoragePoolObj *pool,
if (virStorageBackendGetMinorNumber(names->name, &minor) < 0) { if (virStorageBackendGetMinorNumber(names->name, &minor) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to get %s minor number"), _("Failed to get %1$s minor number"),
names->name); names->name);
return -1; return -1;
} }

View File

@ -113,13 +113,13 @@ virStoragePoolDefRBDNamespaceParse(xmlXPathContextPtr ctxt,
if (!(cmdopts->values[cmdopts->noptions] = if (!(cmdopts->values[cmdopts->noptions] =
virXMLPropString(nodes[i], "value"))) { virXMLPropString(nodes[i], "value"))) {
virReportError(VIR_ERR_XML_ERROR, virReportError(VIR_ERR_XML_ERROR,
_("no rbd option value specified for name '%s'"), _("no rbd option value specified for name '%1$s'"),
cmdopts->names[cmdopts->noptions]); cmdopts->names[cmdopts->noptions]);
goto cleanup; goto cleanup;
} }
if (*cmdopts->values[cmdopts->noptions] == '\0') { if (*cmdopts->values[cmdopts->noptions] == '\0') {
virReportError(VIR_ERR_XML_ERROR, virReportError(VIR_ERR_XML_ERROR,
_("empty rbd option value specified for name '%s'"), _("empty rbd option value specified for name '%1$s'"),
cmdopts->names[cmdopts->noptions]); cmdopts->names[cmdopts->noptions]);
goto cleanup; goto cleanup;
} }
@ -167,7 +167,7 @@ virStorageBackendRBDRADOSConfSetQuiet(rados_t cluster,
{ {
if (rados_conf_set(cluster, option, value) < 0) { if (rados_conf_set(cluster, option, value) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to set RADOS option: %s"), _("failed to set RADOS option: %1$s"),
option); option);
return -1; return -1;
} }
@ -337,7 +337,7 @@ virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDState *ptr,
ptr->starttime = time(0); ptr->starttime = time(0);
if (rados_connect(ptr->cluster) < 0) { if (rados_connect(ptr->cluster) < 0) {
virReportSystemError(errno, _("failed to connect to the RADOS monitor on: %s"), virReportSystemError(errno, _("failed to connect to the RADOS monitor on: %1$s"),
mon_buff); mon_buff);
goto cleanup; goto cleanup;
} }
@ -356,7 +356,7 @@ virStorageBackendRBDOpenIoCTX(virStorageBackendRBDState *ptr,
virStoragePoolDef *def = virStoragePoolObjGetDef(pool); virStoragePoolDef *def = virStoragePoolObjGetDef(pool);
int rc = rados_ioctx_create(ptr->cluster, def->source.name, &ptr->ioctx); int rc = rados_ioctx_create(ptr->cluster, def->source.name, &ptr->ioctx);
if (rc < 0) { if (rc < 0) {
virReportSystemError(errno, _("failed to create the RBD IoCTX. Does the pool '%s' exist?"), virReportSystemError(errno, _("failed to create the RBD IoCTX. Does the pool '%1$s' exist?"),
def->source.name); def->source.name);
} }
return rc; return rc;
@ -422,8 +422,9 @@ volStorageBackendRBDGetFeatures(rbd_image_t image,
int rc; int rc;
if ((rc = rbd_get_features(image, features)) < 0) { if ((rc = rbd_get_features(image, features)) < 0) {
virReportSystemError(errno, _("failed to get the features of RBD image " virReportSystemError(errno,
"%s"), volname); _("failed to get the features of RBD image %1$s"),
volname);
return rc; return rc;
} }
@ -440,7 +441,7 @@ volStorageBackendRBDGetFlags(rbd_image_t image,
if ((rc = rbd_get_flags(image, flags)) < 0) { if ((rc = rbd_get_flags(image, flags)) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("failed to get the flags of RBD image %s"), _("failed to get the flags of RBD image %1$s"),
volname); volname);
return rc; return rc;
} }
@ -479,7 +480,7 @@ virStorageBackendRBDSetAllocation(virStorageVolDef *vol,
if ((rc = rbd_diff_iterate2(image, NULL, 0, info->size, 0, 1, if ((rc = rbd_diff_iterate2(image, NULL, 0, info->size, 0, 1,
&virStorageBackendRBDRefreshVolInfoCb, &virStorageBackendRBDRefreshVolInfoCb,
&allocation)) < 0) { &allocation)) < 0) {
virReportSystemError(errno, _("failed to iterate RBD image '%s'"), virReportSystemError(errno, _("failed to iterate RBD image '%1$s'"),
vol->name); vol->name);
return rc; return rc;
} }
@ -531,13 +532,13 @@ volStorageBackendRBDRefreshVolInfo(virStorageVolDef *vol,
uint64_t flags; uint64_t flags;
if ((ret = rbd_open_read_only(ptr->ioctx, vol->name, &image, NULL)) < 0) { if ((ret = rbd_open_read_only(ptr->ioctx, vol->name, &image, NULL)) < 0) {
virReportSystemError(errno, _("failed to open the RBD image '%s'"), virReportSystemError(errno, _("failed to open the RBD image '%1$s'"),
vol->name); vol->name);
goto cleanup; goto cleanup;
} }
if ((ret = rbd_stat(image, &info, sizeof(info))) < 0) { if ((ret = rbd_stat(image, &info, sizeof(info))) < 0) {
virReportSystemError(errno, _("failed to stat the RBD image '%s'"), virReportSystemError(errno, _("failed to stat the RBD image '%1$s'"),
vol->name); vol->name);
goto cleanup; goto cleanup;
} }
@ -680,7 +681,7 @@ virStorageBackendRBDRefreshPool(virStoragePoolObj *pool)
} }
if (rados_ioctx_pool_stat(ptr->ioctx, &poolstat) < 0) { if (rados_ioctx_pool_stat(ptr->ioctx, &poolstat) < 0) {
virReportSystemError(errno, _("failed to stat the RADOS pool '%s'"), virReportSystemError(errno, _("failed to stat the RADOS pool '%1$s'"),
def->source.name); def->source.name);
goto cleanup; goto cleanup;
} }
@ -750,7 +751,7 @@ virStorageBackendRBDCleanupSnapshots(rados_ioctx_t ioctx,
g_autofree rbd_snap_info_t *snaps = NULL; g_autofree rbd_snap_info_t *snaps = NULL;
if (rbd_open(ioctx, vol->name, &image, NULL) < 0) { if (rbd_open(ioctx, vol->name, &image, NULL) < 0) {
virReportSystemError(errno, _("failed to open the RBD image '%s'"), virReportSystemError(errno, _("failed to open the RBD image '%1$s'"),
vol->name); vol->name);
goto cleanup; goto cleanup;
} }
@ -769,7 +770,7 @@ virStorageBackendRBDCleanupSnapshots(rados_ioctx_t ioctx,
for (i = 0; i < snap_count; i++) { for (i = 0; i < snap_count; i++) {
if (rbd_snap_is_protected(image, snaps[i].name, &protected) < 0) { if (rbd_snap_is_protected(image, snaps[i].name, &protected) < 0) {
virReportSystemError(errno, _("failed to verify if snapshot '%s/%s@%s' is protected"), virReportSystemError(errno, _("failed to verify if snapshot '%1$s/%2$s@%3$s' is protected"),
source->name, vol->name, source->name, vol->name,
snaps[i].name); snaps[i].name);
goto cleanup; goto cleanup;
@ -781,7 +782,7 @@ virStorageBackendRBDCleanupSnapshots(rados_ioctx_t ioctx,
snaps[i].name); snaps[i].name);
if (rbd_snap_unprotect(image, snaps[i].name) < 0) { if (rbd_snap_unprotect(image, snaps[i].name) < 0) {
virReportSystemError(errno, _("failed to unprotect snapshot '%s/%s@%s'"), virReportSystemError(errno, _("failed to unprotect snapshot '%1$s/%2$s@%3$s'"),
source->name, vol->name, source->name, vol->name,
snaps[i].name); snaps[i].name);
goto cleanup; goto cleanup;
@ -792,7 +793,7 @@ virStorageBackendRBDCleanupSnapshots(rados_ioctx_t ioctx,
vol->name, snaps[i].name); vol->name, snaps[i].name);
if (rbd_snap_remove(image, snaps[i].name) < 0) { if (rbd_snap_remove(image, snaps[i].name) < 0) {
virReportSystemError(errno, _("failed to remove snapshot '%s/%s@%s'"), virReportSystemError(errno, _("failed to remove snapshot '%1$s/%2$s@%3$s'"),
source->name, vol->name, source->name, vol->name,
snaps[i].name); snaps[i].name);
goto cleanup; goto cleanup;
@ -841,7 +842,7 @@ virStorageBackendRBDDeleteVol(virStoragePoolObj *pool,
rc = rbd_remove(ptr->ioctx, vol->name); rc = rbd_remove(ptr->ioctx, vol->name);
if (rc < 0 && (-rc) != ENOENT) { if (rc < 0 && (-rc) != ENOENT) {
virReportSystemError(errno, _("failed to remove volume '%s/%s'"), virReportSystemError(errno, _("failed to remove volume '%1$s/%2$s'"),
def->source.name, vol->name); def->source.name, vol->name);
goto cleanup; goto cleanup;
} }
@ -921,7 +922,7 @@ virStorageBackendRBDBuildVol(virStoragePoolObj *pool,
if (virStorageBackendRBDCreateImage(ptr->ioctx, vol->name, if (virStorageBackendRBDCreateImage(ptr->ioctx, vol->name,
vol->target.capacity) < 0) { vol->target.capacity) < 0) {
virReportSystemError(errno, _("failed to create volume '%s/%s'"), virReportSystemError(errno, _("failed to create volume '%1$s/%2$s'"),
def->source.name, vol->name); def->source.name, vol->name);
goto cleanup; goto cleanup;
} }
@ -943,15 +944,14 @@ virStorageBackendRBDImageInfo(rbd_image_t image,
uint8_t oldformat; uint8_t oldformat;
if (rbd_get_old_format(image, &oldformat) < 0) { if (rbd_get_old_format(image, &oldformat) < 0) {
virReportSystemError(errno, _("failed to get the format of RBD image %s"), virReportSystemError(errno, _("failed to get the format of RBD image %1$s"),
volname); volname);
return -1; return -1;
} }
if (oldformat != 0) { if (oldformat != 0) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("RBD image %s is old format. Does not support " _("RBD image %1$s is old format. Does not support extended features and striping"),
"extended features and striping"),
volname); volname);
return -1; return -1;
} }
@ -960,13 +960,13 @@ virStorageBackendRBDImageInfo(rbd_image_t image,
return -1; return -1;
if (rbd_get_stripe_unit(image, stripe_unit) < 0) { if (rbd_get_stripe_unit(image, stripe_unit) < 0) {
virReportSystemError(errno, _("failed to get the stripe unit of RBD image %s"), virReportSystemError(errno, _("failed to get the stripe unit of RBD image %1$s"),
volname); volname);
return -1; return -1;
} }
if (rbd_get_stripe_count(image, stripe_count) < 0) { if (rbd_get_stripe_count(image, stripe_count) < 0) {
virReportSystemError(errno, _("failed to get the stripe count of RBD image %s"), virReportSystemError(errno, _("failed to get the stripe count of RBD image %1$s"),
volname); volname);
return -1; return -1;
} }
@ -1007,7 +1007,7 @@ virStorageBackendRBDSnapshotFindNoDiff(rbd_image_t image,
g_autofree rbd_snap_info_t *snaps = NULL; g_autofree rbd_snap_info_t *snaps = NULL;
if (rbd_stat(image, &info, sizeof(info)) < 0) { if (rbd_stat(image, &info, sizeof(info)) < 0) {
virReportSystemError(errno, _("failed to stat the RBD image %s"), virReportSystemError(errno, _("failed to stat the RBD image %1$s"),
imgname); imgname);
goto cleanup; goto cleanup;
} }
@ -1050,7 +1050,7 @@ virStorageBackendRBDSnapshotFindNoDiff(rbd_image_t image,
if (rbd_diff_iterate(image, snaps[i].name, 0, info.size, if (rbd_diff_iterate(image, snaps[i].name, 0, info.size,
virStorageBackendRBDIterateCb, (void *)&diff) < 0) { virStorageBackendRBDIterateCb, (void *)&diff) < 0) {
#endif #endif
virReportSystemError(errno, _("failed to iterate RBD snapshot %s@%s"), virReportSystemError(errno, _("failed to iterate RBD snapshot %1$s@%2$s"),
imgname, snaps[i].name); imgname, snaps[i].name);
goto cleanup; goto cleanup;
} }
@ -1085,7 +1085,7 @@ virStorageBackendRBDSnapshotCreate(rbd_image_t image,
VIR_DEBUG("Creating RBD snapshot %s@%s", imgname, snapname); VIR_DEBUG("Creating RBD snapshot %s@%s", imgname, snapname);
if (rbd_snap_create(image, snapname) < 0) { if (rbd_snap_create(image, snapname) < 0) {
virReportSystemError(errno, _("failed to create RBD snapshot %s@%s"), virReportSystemError(errno, _("failed to create RBD snapshot %1$s@%2$s"),
imgname, snapname); imgname, snapname);
return -1; return -1;
} }
@ -1103,8 +1103,9 @@ virStorageBackendRBDSnapshotProtect(rbd_image_t image,
VIR_DEBUG("Querying if RBD snapshot %s@%s is protected", imgname, snapname); VIR_DEBUG("Querying if RBD snapshot %s@%s is protected", imgname, snapname);
if (rbd_snap_is_protected(image, snapname, &protected) < 0) { if (rbd_snap_is_protected(image, snapname, &protected) < 0) {
virReportSystemError(errno, _("failed to verify if RBD snapshot %s@%s " virReportSystemError(errno,
"is protected"), imgname, snapname); _("failed to verify if RBD snapshot %1$s@%2$s is protected"),
imgname, snapname);
return -1; return -1;
} }
@ -1113,7 +1114,7 @@ virStorageBackendRBDSnapshotProtect(rbd_image_t image,
imgname, snapname); imgname, snapname);
if (rbd_snap_protect(image, snapname) < 0) { if (rbd_snap_protect(image, snapname) < 0) {
virReportSystemError(errno, _("failed to protect RBD snapshot %s@%s"), virReportSystemError(errno, _("failed to protect RBD snapshot %1$s@%2$s"),
imgname, snapname); imgname, snapname);
return -1; return -1;
} }
@ -1139,7 +1140,7 @@ virStorageBackendRBDCloneImage(rados_ioctx_t io,
g_autofree char *snapname_buff = NULL; g_autofree char *snapname_buff = NULL;
if (rbd_open(io, origvol, &image, NULL) < 0) { if (rbd_open(io, origvol, &image, NULL) < 0) {
virReportSystemError(errno, _("failed to open the RBD image %s"), virReportSystemError(errno, _("failed to open the RBD image %1$s"),
origvol); origvol);
goto cleanup; goto cleanup;
} }
@ -1193,7 +1194,7 @@ virStorageBackendRBDCloneImage(rados_ioctx_t io,
if (rbd_clone2(io, origvol, snapname_buff, io, newvol, features, if (rbd_clone2(io, origvol, snapname_buff, io, newvol, features,
&order, stripe_unit, stripe_count) < 0) { &order, stripe_unit, stripe_count) < 0) {
virReportSystemError(errno, _("failed to clone RBD volume %s to %s"), virReportSystemError(errno, _("failed to clone RBD volume %1$s to %2$s"),
origvol, newvol); origvol, newvol);
goto cleanup; goto cleanup;
} }
@ -1274,13 +1275,13 @@ virStorageBackendRBDResizeVol(virStoragePoolObj *pool,
goto cleanup; goto cleanup;
if (rbd_open(ptr->ioctx, vol->name, &image, NULL) < 0) { if (rbd_open(ptr->ioctx, vol->name, &image, NULL) < 0) {
virReportSystemError(errno, _("failed to open the RBD image '%s'"), virReportSystemError(errno, _("failed to open the RBD image '%1$s'"),
vol->name); vol->name);
goto cleanup; goto cleanup;
} }
if (rbd_resize(image, capacity) < 0) { if (rbd_resize(image, capacity) < 0) {
virReportSystemError(errno, _("failed to resize the RBD image '%s'"), virReportSystemError(errno, _("failed to resize the RBD image '%1$s'"),
vol->name); vol->name);
goto cleanup; goto cleanup;
} }
@ -1310,8 +1311,7 @@ virStorageBackendRBDVolWipeZero(rbd_image_t image,
length = MIN((info->size - offset), (info->obj_size * stripe_count)); length = MIN((info->size - offset), (info->obj_size * stripe_count));
if (rbd_write(image, offset, length, writebuf) < 0) { if (rbd_write(image, offset, length, writebuf) < 0) {
virReportSystemError(errno, _("writing %llu bytes failed on " virReportSystemError(errno, _("writing %1$llu bytes failed on RBD image %2$s at offset %3$llu"),
"RBD image %s at offset %llu"),
length, imgname, offset); length, imgname, offset);
return -1; return -1;
} }
@ -1340,8 +1340,7 @@ virStorageBackendRBDVolWipeDiscard(rbd_image_t image,
length = MIN((info->size - offset), (info->obj_size * stripe_count)); length = MIN((info->size - offset), (info->obj_size * stripe_count));
if (rbd_discard(image, offset, length) < 0) { if (rbd_discard(image, offset, length) < 0) {
virReportSystemError(errno, _("discarding %llu bytes failed on " virReportSystemError(errno, _("discarding %1$llu bytes failed on RBD image %2$s at offset %3$llu"),
"RBD image %s at offset %llu"),
length, imgname, offset); length, imgname, offset);
return -1; return -1;
} }
@ -1381,19 +1380,19 @@ virStorageBackendRBDVolWipe(virStoragePoolObj *pool,
goto cleanup; goto cleanup;
if (rbd_open(ptr->ioctx, vol->name, &image, NULL) < 0) { if (rbd_open(ptr->ioctx, vol->name, &image, NULL) < 0) {
virReportSystemError(errno, _("failed to open the RBD image %s"), virReportSystemError(errno, _("failed to open the RBD image %1$s"),
vol->name); vol->name);
goto cleanup; goto cleanup;
} }
if (rbd_stat(image, &info, sizeof(info)) < 0) { if (rbd_stat(image, &info, sizeof(info)) < 0) {
virReportSystemError(errno, _("failed to stat the RBD image %s"), virReportSystemError(errno, _("failed to stat the RBD image %1$s"),
vol->name); vol->name);
goto cleanup; goto cleanup;
} }
if (rbd_get_stripe_count(image, &stripe_count) < 0) { if (rbd_get_stripe_count(image, &stripe_count) < 0) {
virReportSystemError(errno, _("failed to get stripe count of RBD image %s"), virReportSystemError(errno, _("failed to get stripe count of RBD image %1$s"),
vol->name); vol->name);
goto cleanup; goto cleanup;
} }
@ -1419,13 +1418,13 @@ virStorageBackendRBDVolWipe(virStoragePoolObj *pool,
case VIR_STORAGE_VOL_WIPE_ALG_PFITZNER33: case VIR_STORAGE_VOL_WIPE_ALG_PFITZNER33:
case VIR_STORAGE_VOL_WIPE_ALG_RANDOM: case VIR_STORAGE_VOL_WIPE_ALG_RANDOM:
case VIR_STORAGE_VOL_WIPE_ALG_LAST: case VIR_STORAGE_VOL_WIPE_ALG_LAST:
virReportError(VIR_ERR_INVALID_ARG, _("unsupported algorithm %d"), virReportError(VIR_ERR_INVALID_ARG, _("unsupported algorithm %1$d"),
algorithm); algorithm);
goto cleanup; goto cleanup;
} }
if (rc < 0) { if (rc < 0) {
virReportSystemError(errno, _("failed to wipe RBD image %s"), virReportSystemError(errno, _("failed to wipe RBD image %1$s"),
vol->name); vol->name);
goto cleanup; goto cleanup;
} }

View File

@ -63,7 +63,7 @@ virStorageBackendSCSITriggerRescan(uint32_t host)
if (fd < 0) { if (fd < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Could not open '%s' to trigger host scan"), _("Could not open '%1$s' to trigger host scan"),
path); path);
return -1; return -1;
} }
@ -72,7 +72,7 @@ virStorageBackendSCSITriggerRescan(uint32_t host)
LINUX_SYSFS_SCSI_HOST_SCAN_STRING, LINUX_SYSFS_SCSI_HOST_SCAN_STRING,
sizeof(LINUX_SYSFS_SCSI_HOST_SCAN_STRING)) < 0) { sizeof(LINUX_SYSFS_SCSI_HOST_SCAN_STRING)) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Write to '%s' to trigger host scan failed"), _("Write to '%1$s' to trigger host scan failed"),
path); path);
return -1; return -1;
} }
@ -184,8 +184,8 @@ getAdapterName(virStorageAdapter *adapter)
if (!(name = virVHBAGetHostByWWN(NULL, fchost->wwnn, fchost->wwpn))) { if (!(name = virVHBAGetHostByWWN(NULL, fchost->wwnn, fchost->wwpn))) {
virReportError(VIR_ERR_XML_ERROR, virReportError(VIR_ERR_XML_ERROR,
_("Failed to find SCSI host with wwnn='%s', " _("Failed to find SCSI host with wwnn='%1$s', wwpn='%2$s'"),
"wwpn='%s'"), fchost->wwnn, fchost->wwpn); fchost->wwnn, fchost->wwpn);
} }
} }
@ -215,7 +215,7 @@ checkName(const char *name)
return true; return true;
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("the wwnn/wwpn for '%s' are assigned to an HBA"), name); _("the wwnn/wwpn for '%1$s' are assigned to an HBA"), name);
return false; return false;
} }
@ -242,14 +242,14 @@ checkParent(const char *name,
if (virSCSIHostGetNumber(parent_name, &host_num) < 0) { if (virSCSIHostGetNumber(parent_name, &host_num) < 0) {
virReportError(VIR_ERR_XML_ERROR, virReportError(VIR_ERR_XML_ERROR,
_("parent '%s' is not properly formatted"), _("parent '%1$s' is not properly formatted"),
parent_name); parent_name);
goto cleanup; goto cleanup;
} }
if (!virVHBAPathExists(NULL, host_num)) { if (!virVHBAPathExists(NULL, host_num)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("parent '%s' is not an fc_host for the wwnn/wwpn"), _("parent '%1$s' is not an fc_host for the wwnn/wwpn"),
parent_name); parent_name);
goto cleanup; goto cleanup;
} }
@ -261,8 +261,7 @@ checkParent(const char *name,
if (STRNEQ(parent_name, vhba_parent)) { if (STRNEQ(parent_name, vhba_parent)) {
virReportError(VIR_ERR_XML_ERROR, virReportError(VIR_ERR_XML_ERROR,
_("Parent attribute '%s' does not match parent '%s' " _("Parent attribute '%1$s' does not match parent '%2$s' determined for the '%3$s' wwnn/wwpn lookup."),
"determined for the '%s' wwnn/wwpn lookup."),
parent_name, vhba_parent, name); parent_name, vhba_parent, name);
goto cleanup; goto cleanup;
} }

View File

@ -94,7 +94,7 @@ virStorageBackendVzIsMounted(virStoragePoolObj *pool)
if ((mtab = fopen(_PATH_MOUNTED, "r")) == NULL) { if ((mtab = fopen(_PATH_MOUNTED, "r")) == NULL) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot read mount list '%s'"), _("cannot read mount list '%1$s'"),
_PATH_MOUNTED); _PATH_MOUNTED);
goto cleanup; goto cleanup;
} }

View File

@ -126,7 +126,7 @@ storagePoolUpdateStateCallback(virStoragePoolObj *obj,
if ((backend = virStorageBackendForType(def->type)) == NULL) { if ((backend = virStorageBackendForType(def->type)) == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Missing backend %d"), def->type); _("Missing backend %1$d"), def->type);
return; return;
} }
@ -138,7 +138,7 @@ storagePoolUpdateStateCallback(virStoragePoolObj *obj,
if (backend->checkPool && if (backend->checkPool &&
backend->checkPool(obj, &active) < 0) { backend->checkPool(obj, &active) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to initialize storage pool '%s': %s"), _("Failed to initialize storage pool '%1$s': %2$s"),
def->name, virGetLastErrorMessage()); def->name, virGetLastErrorMessage());
unlink(stateFile); unlink(stateFile);
active = false; active = false;
@ -153,7 +153,7 @@ storagePoolUpdateStateCallback(virStoragePoolObj *obj,
if (active && if (active &&
storagePoolRefreshImpl(backend, obj, stateFile) < 0) { storagePoolRefreshImpl(backend, obj, stateFile) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to restart storage pool '%s': %s"), _("Failed to restart storage pool '%1$s': %2$s"),
def->name, virGetLastErrorMessage()); def->name, virGetLastErrorMessage());
active = false; active = false;
} }
@ -200,7 +200,7 @@ storageDriverAutostartCallback(virStoragePoolObj *obj,
if (backend->startPool && if (backend->startPool &&
backend->startPool(obj) < 0) { backend->startPool(obj) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to autostart storage pool '%s': %s"), _("Failed to autostart storage pool '%1$s': %2$s"),
def->name, virGetLastErrorMessage()); def->name, virGetLastErrorMessage());
goto cleanup; goto cleanup;
} }
@ -211,7 +211,7 @@ storageDriverAutostartCallback(virStoragePoolObj *obj,
virStoragePoolSaveState(stateFile, def) < 0 || virStoragePoolSaveState(stateFile, def) < 0 ||
storagePoolRefreshImpl(backend, obj, stateFile) < 0) { storagePoolRefreshImpl(backend, obj, stateFile) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to autostart storage pool '%s': %s"), _("Failed to autostart storage pool '%1$s': %2$s"),
def->name, virGetLastErrorMessage()); def->name, virGetLastErrorMessage());
} else { } else {
virStoragePoolObjSetActive(obj, true); virStoragePoolObjSetActive(obj, true);
@ -283,7 +283,7 @@ storageStateInitialize(bool privileged,
if (g_mkdir_with_parents(driver->stateDir, 0777) < 0) { if (g_mkdir_with_parents(driver->stateDir, 0777) < 0) {
virReportError(errno, virReportError(errno,
_("cannot create directory %s"), _("cannot create directory %1$s"),
driver->stateDir); driver->stateDir);
goto error; goto error;
} }
@ -440,11 +440,11 @@ storagePoolObjFindByUUID(const unsigned char *uuid,
virUUIDFormat(uuid, uuidstr); virUUIDFormat(uuid, uuidstr);
if (name) if (name)
virReportError(VIR_ERR_NO_STORAGE_POOL, virReportError(VIR_ERR_NO_STORAGE_POOL,
_("no storage pool with matching uuid '%s' (%s)"), _("no storage pool with matching uuid '%1$s' (%2$s)"),
uuidstr, name); uuidstr, name);
else else
virReportError(VIR_ERR_NO_STORAGE_POOL, virReportError(VIR_ERR_NO_STORAGE_POOL,
_("no storage pool with matching uuid '%s'"), _("no storage pool with matching uuid '%1$s'"),
uuidstr); uuidstr);
} }
@ -466,7 +466,7 @@ storagePoolObjFindByName(const char *name)
if (!(obj = virStoragePoolObjFindByName(driver->pools, name))) if (!(obj = virStoragePoolObjFindByName(driver->pools, name)))
virReportError(VIR_ERR_NO_STORAGE_POOL, virReportError(VIR_ERR_NO_STORAGE_POOL,
_("no storage pool with matching name '%s'"), name); _("no storage pool with matching name '%1$s'"), name);
return obj; return obj;
} }
@ -614,7 +614,7 @@ storageConnectFindStoragePoolSources(virConnectPtr conn,
backend_type = virStoragePoolTypeFromString(type); backend_type = virStoragePoolTypeFromString(type);
if (backend_type < 0) { if (backend_type < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown storage pool type %s"), type); _("unknown storage pool type %1$s"), type);
return NULL; return NULL;
} }
@ -624,8 +624,8 @@ storageConnectFindStoragePoolSources(virConnectPtr conn,
if (!backend->findPoolSources) { if (!backend->findPoolSources) {
virReportError(VIR_ERR_NO_SUPPORT, virReportError(VIR_ERR_NO_SUPPORT,
_("pool type '%s' does not support source " _("pool type '%1$s' does not support source discovery"),
"discovery"), type); type);
return NULL; return NULL;
} }
@ -855,21 +855,21 @@ storagePoolUndefine(virStoragePoolPtr pool)
if (virStoragePoolObjIsActive(obj)) { if (virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is still active"), _("storage pool '%1$s' is still active"),
def->name); def->name);
goto cleanup; goto cleanup;
} }
if (virStoragePoolObjIsStarting(obj)) { if (virStoragePoolObjIsStarting(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is starting up"), _("storage pool '%1$s' is starting up"),
def->name); def->name);
goto cleanup; goto cleanup;
} }
if (virStoragePoolObjGetAsyncjobs(obj) > 0) { if (virStoragePoolObjGetAsyncjobs(obj) > 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("pool '%s' has asynchronous jobs running."), _("pool '%1$s' has asynchronous jobs running."),
def->name); def->name);
goto cleanup; goto cleanup;
} }
@ -880,7 +880,7 @@ storagePoolUndefine(virStoragePoolPtr pool)
if (autostartLink && unlink(autostartLink) < 0 && if (autostartLink && unlink(autostartLink) < 0 &&
errno != ENOENT && errno != ENOTDIR) { errno != ENOENT && errno != ENOTDIR) {
VIR_ERROR(_("Failed to delete autostart link '%s': %s"), VIR_ERROR(_("Failed to delete autostart link '%1$s': %2$s"),
autostartLink, g_strerror(errno)); autostartLink, g_strerror(errno));
} }
@ -931,14 +931,14 @@ storagePoolCreate(virStoragePoolPtr pool,
if (virStoragePoolObjIsActive(obj)) { if (virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is already active"), _("storage pool '%1$s' is already active"),
def->name); def->name);
goto cleanup; goto cleanup;
} }
if (virStoragePoolObjIsStarting(obj)) { if (virStoragePoolObjIsStarting(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is starting up"), _("storage pool '%1$s' is starting up"),
def->name); def->name);
goto cleanup; goto cleanup;
} }
@ -1015,14 +1015,14 @@ storagePoolBuild(virStoragePoolPtr pool,
if (virStoragePoolObjIsActive(obj)) { if (virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is already active"), _("storage pool '%1$s' is already active"),
def->name); def->name);
goto cleanup; goto cleanup;
} }
if (virStoragePoolObjIsStarting(obj)) { if (virStoragePoolObjIsStarting(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is starting up"), _("storage pool '%1$s' is starting up"),
def->name); def->name);
goto cleanup; goto cleanup;
} }
@ -1077,20 +1077,20 @@ storagePoolDestroy(virStoragePoolPtr pool)
if (!virStoragePoolObjIsActive(obj)) { if (!virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is not active"), def->name); _("storage pool '%1$s' is not active"), def->name);
goto cleanup; goto cleanup;
} }
if (virStoragePoolObjIsStarting(obj)) { if (virStoragePoolObjIsStarting(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is starting up"), _("storage pool '%1$s' is starting up"),
def->name); def->name);
goto cleanup; goto cleanup;
} }
if (virStoragePoolObjGetAsyncjobs(obj) > 0) { if (virStoragePoolObjGetAsyncjobs(obj) > 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("pool '%s' has asynchronous jobs running."), _("pool '%1$s' has asynchronous jobs running."),
def->name); def->name);
goto cleanup; goto cleanup;
} }
@ -1148,21 +1148,21 @@ storagePoolDelete(virStoragePoolPtr pool,
if (virStoragePoolObjIsActive(obj)) { if (virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is still active"), _("storage pool '%1$s' is still active"),
def->name); def->name);
goto cleanup; goto cleanup;
} }
if (virStoragePoolObjIsStarting(obj)) { if (virStoragePoolObjIsStarting(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is starting up"), _("storage pool '%1$s' is starting up"),
def->name); def->name);
goto cleanup; goto cleanup;
} }
if (virStoragePoolObjGetAsyncjobs(obj) > 0) { if (virStoragePoolObjGetAsyncjobs(obj) > 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("pool '%s' has asynchronous jobs running."), _("pool '%1$s' has asynchronous jobs running."),
def->name); def->name);
goto cleanup; goto cleanup;
} }
@ -1219,20 +1219,20 @@ storagePoolRefresh(virStoragePoolPtr pool,
if (!virStoragePoolObjIsActive(obj)) { if (!virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is not active"), def->name); _("storage pool '%1$s' is not active"), def->name);
goto cleanup; goto cleanup;
} }
if (virStoragePoolObjIsStarting(obj)) { if (virStoragePoolObjIsStarting(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is starting up"), _("storage pool '%1$s' is starting up"),
def->name); def->name);
goto cleanup; goto cleanup;
} }
if (virStoragePoolObjGetAsyncjobs(obj) > 0) { if (virStoragePoolObjGetAsyncjobs(obj) > 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("pool '%s' has asynchronous jobs running."), _("pool '%1$s' has asynchronous jobs running."),
def->name); def->name);
goto cleanup; goto cleanup;
} }
@ -1381,14 +1381,14 @@ storagePoolSetAutostart(virStoragePoolPtr pool,
if (new_autostart) { if (new_autostart) {
if (g_mkdir_with_parents(driver->autostartDir, 0777) < 0) { if (g_mkdir_with_parents(driver->autostartDir, 0777) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot create autostart directory %s"), _("cannot create autostart directory %1$s"),
driver->autostartDir); driver->autostartDir);
goto cleanup; goto cleanup;
} }
if (symlink(configFile, autostartLink) < 0) { if (symlink(configFile, autostartLink) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to create symlink '%s' to '%s'"), _("Failed to create symlink '%1$s' to '%2$s'"),
autostartLink, configFile); autostartLink, configFile);
goto cleanup; goto cleanup;
} }
@ -1396,7 +1396,7 @@ storagePoolSetAutostart(virStoragePoolPtr pool,
if (autostartLink && unlink(autostartLink) < 0 && if (autostartLink && unlink(autostartLink) < 0 &&
errno != ENOENT && errno != ENOTDIR) { errno != ENOENT && errno != ENOTDIR) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to delete symlink '%s'"), _("Failed to delete symlink '%1$s'"),
autostartLink); autostartLink);
goto cleanup; goto cleanup;
} }
@ -1428,7 +1428,7 @@ storagePoolNumOfVolumes(virStoragePoolPtr pool)
if (!virStoragePoolObjIsActive(obj)) { if (!virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is not active"), def->name); _("storage pool '%1$s' is not active"), def->name);
goto cleanup; goto cleanup;
} }
@ -1459,7 +1459,7 @@ storagePoolListVolumes(virStoragePoolPtr pool,
if (!virStoragePoolObjIsActive(obj)) { if (!virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is not active"), def->name); _("storage pool '%1$s' is not active"), def->name);
goto cleanup; goto cleanup;
} }
@ -1492,7 +1492,7 @@ storagePoolListAllVolumes(virStoragePoolPtr pool,
if (!virStoragePoolObjIsActive(obj)) { if (!virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is not active"), def->name); _("storage pool '%1$s' is not active"), def->name);
goto cleanup; goto cleanup;
} }
@ -1521,7 +1521,7 @@ storageVolLookupByName(virStoragePoolPtr pool,
if (!virStoragePoolObjIsActive(obj)) { if (!virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is not active"), def->name); _("storage pool '%1$s' is not active"), def->name);
goto cleanup; goto cleanup;
} }
@ -1529,7 +1529,7 @@ storageVolLookupByName(virStoragePoolPtr pool,
if (!voldef) { if (!voldef) {
virReportError(VIR_ERR_NO_STORAGE_VOL, virReportError(VIR_ERR_NO_STORAGE_VOL,
_("no storage vol with matching name '%s'"), _("no storage vol with matching name '%1$s'"),
name); name);
goto cleanup; goto cleanup;
} }
@ -1590,7 +1590,7 @@ storageVolLookupByKey(virConnectPtr conn,
if (!vol) if (!vol)
virReportError(VIR_ERR_NO_STORAGE_VOL, virReportError(VIR_ERR_NO_STORAGE_VOL,
_("no storage vol with matching key %s"), key); _("no storage vol with matching key %1$s"), key);
return vol; return vol;
} }
@ -1675,10 +1675,10 @@ storageVolLookupByPath(virConnectPtr conn,
if (!vol) { if (!vol) {
if (STREQ(path, data.cleanpath)) { if (STREQ(path, data.cleanpath)) {
virReportError(VIR_ERR_NO_STORAGE_VOL, virReportError(VIR_ERR_NO_STORAGE_VOL,
_("no storage vol with matching path '%s'"), path); _("no storage vol with matching path '%1$s'"), path);
} else { } else {
virReportError(VIR_ERR_NO_STORAGE_VOL, virReportError(VIR_ERR_NO_STORAGE_VOL,
_("no storage vol with matching path '%s' (%s)"), _("no storage vol with matching path '%1$s' (%2$s)"),
path, data.cleanpath); path, data.cleanpath);
} }
} }
@ -1732,11 +1732,11 @@ storagePoolLookupByTargetPath(virConnectPtr conn,
if (!pool) { if (!pool) {
if (STREQ(path, cleanpath)) { if (STREQ(path, cleanpath)) {
virReportError(VIR_ERR_NO_STORAGE_POOL, virReportError(VIR_ERR_NO_STORAGE_POOL,
_("no storage pool with matching target path '%s'"), _("no storage pool with matching target path '%1$s'"),
path); path);
} else { } else {
virReportError(VIR_ERR_NO_STORAGE_POOL, virReportError(VIR_ERR_NO_STORAGE_POOL,
_("no storage pool with matching target path '%s' (%s)"), _("no storage pool with matching target path '%1$s' (%2$s)"),
path, cleanpath); path, cleanpath);
} }
} }
@ -1799,14 +1799,14 @@ virStorageVolDefFromVol(virStorageVolPtr vol,
if (!virStoragePoolObjIsActive(*obj)) { if (!virStoragePoolObjIsActive(*obj)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is not active"), _("storage pool '%1$s' is not active"),
def->name); def->name);
goto error; goto error;
} }
if (!(voldef = virStorageVolDefFindByName(*obj, vol->name))) { if (!(voldef = virStorageVolDefFindByName(*obj, vol->name))) {
virReportError(VIR_ERR_NO_STORAGE_VOL, virReportError(VIR_ERR_NO_STORAGE_VOL,
_("no storage vol with matching name '%s'"), _("no storage vol with matching name '%1$s'"),
vol->name); vol->name);
goto error; goto error;
} }
@ -1843,14 +1843,14 @@ storageVolDelete(virStorageVolPtr vol,
if (voldef->in_use) { if (voldef->in_use) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("volume '%s' is still in use."), _("volume '%1$s' is still in use."),
voldef->name); voldef->name);
goto cleanup; goto cleanup;
} }
if (voldef->building) { if (voldef->building) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("volume '%s' is still being allocated."), _("volume '%1$s' is still being allocated."),
voldef->name); voldef->name);
goto cleanup; goto cleanup;
} }
@ -1890,7 +1890,7 @@ storageVolCreateXML(virStoragePoolPtr pool,
if (!virStoragePoolObjIsActive(obj)) { if (!virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is not active"), def->name); _("storage pool '%1$s' is not active"), def->name);
goto cleanup; goto cleanup;
} }
@ -1913,7 +1913,7 @@ storageVolCreateXML(virStoragePoolPtr pool,
if (virStorageVolDefFindByName(obj, voldef->name)) { if (virStorageVolDefFindByName(obj, voldef->name)) {
virReportError(VIR_ERR_STORAGE_VOL_EXIST, virReportError(VIR_ERR_STORAGE_VOL_EXIST,
_("'%s'"), voldef->name); _("'%1$s'"), voldef->name);
goto cleanup; goto cleanup;
} }
@ -2036,7 +2036,7 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool,
char uuidstr[VIR_UUID_STRING_BUFLEN]; char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(pool->uuid, uuidstr); virUUIDFormat(pool->uuid, uuidstr);
virReportError(VIR_ERR_NO_STORAGE_POOL, virReportError(VIR_ERR_NO_STORAGE_POOL,
_("no storage pool with matching uuid '%s' (%s)"), _("no storage pool with matching uuid '%1$s' (%2$s)"),
uuidstr, pool->name); uuidstr, pool->name);
goto cleanup; goto cleanup;
} }
@ -2044,21 +2044,21 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool,
if (STRNEQ(pool->name, volsrc->pool) && !objsrc) { if (STRNEQ(pool->name, volsrc->pool) && !objsrc) {
virReportError(VIR_ERR_NO_STORAGE_POOL, virReportError(VIR_ERR_NO_STORAGE_POOL,
_("no storage pool with matching name '%s'"), _("no storage pool with matching name '%1$s'"),
volsrc->pool); volsrc->pool);
goto cleanup; goto cleanup;
} }
if (!virStoragePoolObjIsActive(obj)) { if (!virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is not active"), def->name); _("storage pool '%1$s' is not active"), def->name);
goto cleanup; goto cleanup;
} }
if (objsrc && !virStoragePoolObjIsActive(objsrc)) { if (objsrc && !virStoragePoolObjIsActive(objsrc)) {
virStoragePoolDef *objsrcdef = virStoragePoolObjGetDef(objsrc); virStoragePoolDef *objsrcdef = virStoragePoolObjGetDef(objsrc);
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("storage pool '%s' is not active"), _("storage pool '%1$s' is not active"),
objsrcdef->name); objsrcdef->name);
goto cleanup; goto cleanup;
} }
@ -2070,7 +2070,7 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool,
objsrc : obj, volsrc->name); objsrc : obj, volsrc->name);
if (!voldefsrc) { if (!voldefsrc) {
virReportError(VIR_ERR_NO_STORAGE_VOL, virReportError(VIR_ERR_NO_STORAGE_VOL,
_("no storage vol with matching name '%s'"), _("no storage vol with matching name '%1$s'"),
volsrc->name); volsrc->name);
goto cleanup; goto cleanup;
} }
@ -2084,7 +2084,7 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool,
if (virStorageVolDefFindByName(obj, voldef->name)) { if (virStorageVolDefFindByName(obj, voldef->name)) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("storage volume name '%s' already in use."), _("storage volume name '%1$s' already in use."),
voldef->name); voldef->name);
goto cleanup; goto cleanup;
} }
@ -2110,7 +2110,7 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool,
if (voldefsrc->building) { if (voldefsrc->building) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("volume '%s' is still being allocated."), _("volume '%1$s' is still being allocated."),
voldefsrc->name); voldefsrc->name);
goto cleanup; goto cleanup;
} }
@ -2221,7 +2221,7 @@ storageVolDownload(virStorageVolPtr vol,
if (voldef->building) { if (voldef->building) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("volume '%s' is still being allocated."), _("volume '%1$s' is still being allocated."),
voldef->name); voldef->name);
goto cleanup; goto cleanup;
} }
@ -2390,14 +2390,14 @@ storageVolUpload(virStorageVolPtr vol,
if (voldef->in_use) { if (voldef->in_use) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("volume '%s' is still in use."), _("volume '%1$s' is still in use."),
voldef->name); voldef->name);
goto cleanup; goto cleanup;
} }
if (voldef->building) { if (voldef->building) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("volume '%s' is still being allocated."), _("volume '%1$s' is still being allocated."),
voldef->name); voldef->name);
goto cleanup; goto cleanup;
} }
@ -2473,14 +2473,14 @@ storageVolResize(virStorageVolPtr vol,
if (voldef->in_use) { if (voldef->in_use) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("volume '%s' is still in use."), _("volume '%1$s' is still in use."),
voldef->name); voldef->name);
goto cleanup; goto cleanup;
} }
if (voldef->building) { if (voldef->building) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("volume '%s' is still being allocated."), _("volume '%1$s' is still being allocated."),
voldef->name); voldef->name);
goto cleanup; goto cleanup;
} }
@ -2564,7 +2564,7 @@ storageVolWipePattern(virStorageVolPtr vol,
if (algorithm >= VIR_STORAGE_VOL_WIPE_ALG_LAST) { if (algorithm >= VIR_STORAGE_VOL_WIPE_ALG_LAST) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("wiping algorithm %d not supported"), _("wiping algorithm %1$d not supported"),
algorithm); algorithm);
return -1; return -1;
} }
@ -2579,14 +2579,14 @@ storageVolWipePattern(virStorageVolPtr vol,
if (voldef->in_use) { if (voldef->in_use) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("volume '%s' is still in use."), _("volume '%1$s' is still in use."),
voldef->name); voldef->name);
goto cleanup; goto cleanup;
} }
if (voldef->building) { if (voldef->building) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("volume '%s' is still being allocated."), _("volume '%1$s' is still being allocated."),
voldef->name); voldef->name);
goto cleanup; goto cleanup;
} }

View File

@ -132,7 +132,7 @@ virStorageBackendCopyToFD(virStorageVolDef *vol,
if ((inputfd = open(inputvol->target.path, O_RDONLY)) < 0) { if ((inputfd = open(inputvol->target.path, O_RDONLY)) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("could not open input path '%s'"), _("could not open input path '%1$s'"),
inputvol->target.path); inputvol->target.path);
return -1; return -1;
} }
@ -153,7 +153,7 @@ virStorageBackendCopyToFD(virStorageVolDef *vol,
if (reflink_copy) { if (reflink_copy) {
if (reflinkCloneFile(fd, inputfd) < 0) { if (reflinkCloneFile(fd, inputfd) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("failed to clone files from '%s'"), _("failed to clone files from '%1$s'"),
inputvol->target.path); inputvol->target.path);
return -1; return -1;
} else { } else {
@ -170,7 +170,7 @@ virStorageBackendCopyToFD(virStorageVolDef *vol,
if ((amtread = saferead(inputfd, buf, rbytes)) < 0) { if ((amtread = saferead(inputfd, buf, rbytes)) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("failed reading from file '%s'"), _("failed reading from file '%1$s'"),
inputvol->target.path); inputvol->target.path);
return -1; return -1;
} }
@ -186,13 +186,13 @@ virStorageBackendCopyToFD(virStorageVolDef *vol,
if (want_sparse && memcmp(buf+offset, zerobuf, interval) == 0) { if (want_sparse && memcmp(buf+offset, zerobuf, interval) == 0) {
if (lseek(fd, interval, SEEK_CUR) < 0) { if (lseek(fd, interval, SEEK_CUR) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot extend file '%s'"), _("cannot extend file '%1$s'"),
vol->target.path); vol->target.path);
return -1; return -1;
} }
} else if (safewrite(fd, buf+offset, interval) < 0) { } else if (safewrite(fd, buf+offset, interval) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("failed writing to file '%s'"), _("failed writing to file '%1$s'"),
vol->target.path); vol->target.path);
return -1; return -1;
@ -201,14 +201,14 @@ virStorageBackendCopyToFD(virStorageVolDef *vol,
} }
if (virFileDataSync(fd) < 0) { if (virFileDataSync(fd) < 0) {
virReportSystemError(errno, _("cannot sync data to file '%s'"), virReportSystemError(errno, _("cannot sync data to file '%1$s'"),
vol->target.path); vol->target.path);
return -1; return -1;
} }
if (VIR_CLOSE(inputfd) < 0) { if (VIR_CLOSE(inputfd) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot close file '%s'"), _("cannot close file '%1$s'"),
inputvol->target.path); inputvol->target.path);
return -1; return -1;
} }
@ -246,7 +246,7 @@ storageBackendCreateBlockFrom(virStoragePoolObj *pool G_GNUC_UNUSED,
if ((fd = open(vol->target.path, O_RDWR)) < 0) { if ((fd = open(vol->target.path, O_RDWR)) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot create path '%s'"), _("cannot create path '%1$s'"),
vol->target.path); vol->target.path);
return -1; return -1;
} }
@ -260,7 +260,7 @@ storageBackendCreateBlockFrom(virStoragePoolObj *pool G_GNUC_UNUSED,
} }
if (fstat(fd, &st) == -1) { if (fstat(fd, &st) == -1) {
virReportSystemError(errno, _("stat of '%s' failed"), virReportSystemError(errno, _("stat of '%1$s' failed"),
vol->target.path); vol->target.path);
return -1; return -1;
} }
@ -271,7 +271,7 @@ storageBackendCreateBlockFrom(virStoragePoolObj *pool G_GNUC_UNUSED,
if (((uid != (uid_t)-1) || (gid != (gid_t)-1)) if (((uid != (uid_t)-1) || (gid != (gid_t)-1))
&& (fchown(fd, uid, gid) < 0)) { && (fchown(fd, uid, gid) < 0)) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot chown '%s' to (%u, %u)"), _("cannot chown '%1$s' to (%2$u, %3$u)"),
vol->target.path, (unsigned int)uid, vol->target.path, (unsigned int)uid,
(unsigned int)gid); (unsigned int)gid);
return -1; return -1;
@ -281,13 +281,13 @@ storageBackendCreateBlockFrom(virStoragePoolObj *pool G_GNUC_UNUSED,
VIR_STORAGE_DEFAULT_VOL_PERM_MODE : vol->target.perms->mode); VIR_STORAGE_DEFAULT_VOL_PERM_MODE : vol->target.perms->mode);
if (fchmod(fd, mode) < 0) { if (fchmod(fd, mode) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot set mode of '%s' to %04o"), _("cannot set mode of '%1$s' to %2$04o"),
vol->target.path, mode); vol->target.path, mode);
return -1; return -1;
} }
if (VIR_CLOSE(fd) < 0) { if (VIR_CLOSE(fd) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot close file '%s'"), _("cannot close file '%1$s'"),
vol->target.path); vol->target.path);
return -1; return -1;
} }
@ -313,7 +313,7 @@ createRawFile(int fd, virStorageVolDef *vol,
* for progress reporting */ * for progress reporting */
if (ftruncate(fd, vol->target.capacity) < 0) { if (ftruncate(fd, vol->target.capacity) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot extend file '%s'"), _("cannot extend file '%1$s'"),
vol->target.path); vol->target.path);
return -1; return -1;
} }
@ -332,7 +332,7 @@ createRawFile(int fd, virStorageVolDef *vol,
need_alloc = false; need_alloc = false;
} else if (errno != ENOSYS && errno != EOPNOTSUPP) { } else if (errno != ENOSYS && errno != EOPNOTSUPP) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot allocate %llu bytes in file '%s'"), _("cannot allocate %1$llu bytes in file '%2$s'"),
vol->target.allocation, vol->target.path); vol->target.allocation, vol->target.path);
return -1; return -1;
} }
@ -356,14 +356,14 @@ createRawFile(int fd, virStorageVolDef *vol,
if (need_alloc && (vol->target.allocation - pos > 0)) { if (need_alloc && (vol->target.allocation - pos > 0)) {
if (safezero(fd, pos, vol->target.allocation - pos) < 0) { if (safezero(fd, pos, vol->target.allocation - pos) < 0) {
virReportSystemError(errno, _("cannot fill file '%s'"), virReportSystemError(errno, _("cannot fill file '%1$s'"),
vol->target.path); vol->target.path);
return -1; return -1;
} }
} }
if (g_fsync(fd) < 0) { if (g_fsync(fd) < 0) {
virReportSystemError(errno, _("cannot sync data to file '%s'"), virReportSystemError(errno, _("cannot sync data to file '%1$s'"),
vol->target.path); vol->target.path);
return -1; return -1;
} }
@ -424,7 +424,7 @@ storageBackendCreateRaw(virStoragePoolObj *pool,
vol->target.perms->gid, vol->target.perms->gid,
operation_flags)) < 0) { operation_flags)) < 0) {
virReportSystemError(-fd, virReportSystemError(-fd,
_("Failed to create file '%s'"), _("Failed to create file '%1$s'"),
vol->target.path); vol->target.path);
return -1; return -1;
} }
@ -512,7 +512,7 @@ virStorageBackendCreateExecCommand(virStoragePoolObj *pool,
goto cleanup; goto cleanup;
if (stat(vol->target.path, &st) < 0) { if (stat(vol->target.path, &st) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("failed to create %s"), vol->target.path); _("failed to create %1$s"), vol->target.path);
goto cleanup; goto cleanup;
} }
filecreated = true; filecreated = true;
@ -525,7 +525,7 @@ virStorageBackendCreateExecCommand(virStoragePoolObj *pool,
if (((uid != (uid_t)-1) || (gid != (gid_t)-1)) if (((uid != (uid_t)-1) || (gid != (gid_t)-1))
&& (chown(vol->target.path, uid, gid) < 0)) { && (chown(vol->target.path, uid, gid) < 0)) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot chown %s to (%u, %u)"), _("cannot chown %1$s to (%2$u, %3$u)"),
vol->target.path, (unsigned int)uid, vol->target.path, (unsigned int)uid,
(unsigned int)gid); (unsigned int)gid);
goto cleanup; goto cleanup;
@ -534,7 +534,7 @@ virStorageBackendCreateExecCommand(virStoragePoolObj *pool,
if (mode != (st.st_mode & S_IRWXUGO) && if (mode != (st.st_mode & S_IRWXUGO) &&
chmod(vol->target.path, mode) < 0) { chmod(vol->target.path, mode) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot set mode of '%s' to %04o"), _("cannot set mode of '%1$s' to %2$04o"),
vol->target.path, mode); vol->target.path, mode);
goto cleanup; goto cleanup;
} }
@ -564,7 +564,7 @@ storageBackendCreatePloop(virStoragePoolObj *pool G_GNUC_UNUSED,
if (inputvol && inputvol->target.format != VIR_STORAGE_FILE_PLOOP) { if (inputvol && inputvol->target.format != VIR_STORAGE_FILE_PLOOP) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unsupported input storage vol type %d"), _("unsupported input storage vol type %1$d"),
inputvol->target.format); inputvol->target.format);
return -1; return -1;
} }
@ -778,8 +778,7 @@ storageBackendCreateQemuImgOpts(virStorageEncryptionInfoDef *encinfo,
VIR_STORAGE_FILE_FEATURE_LAZY_REFCOUNTS)) { VIR_STORAGE_FILE_FEATURE_LAZY_REFCOUNTS)) {
if (STREQ_NULLABLE(info->compat, "0.10")) { if (STREQ_NULLABLE(info->compat, "0.10")) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("lazy_refcounts not supported with compat" _("lazy_refcounts not supported with compat level %1$s"),
" level %s"),
info->compat); info->compat);
return -1; return -1;
} }
@ -790,7 +789,7 @@ storageBackendCreateQemuImgOpts(virStorageEncryptionInfoDef *encinfo,
VIR_STORAGE_FILE_FEATURE_EXTENDED_L2)) { VIR_STORAGE_FILE_FEATURE_EXTENDED_L2)) {
if (STREQ_NULLABLE(info->compat, "0.10")) { if (STREQ_NULLABLE(info->compat, "0.10")) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("'extended_l2' not supported with compat level %s"), _("'extended_l2' not supported with compat level %1$s"),
info->compat); info->compat);
return -1; return -1;
} }
@ -825,7 +824,7 @@ storageBackendCreateQemuImgCheckEncryption(int format,
format == VIR_STORAGE_FILE_QCOW2) { format == VIR_STORAGE_FILE_QCOW2) {
if (enc->format != VIR_STORAGE_ENCRYPTION_FORMAT_LUKS) { if (enc->format != VIR_STORAGE_ENCRYPTION_FORMAT_LUKS) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unsupported volume encryption format %d"), _("unsupported volume encryption format %1$d"),
vol->target.encryption->format); vol->target.encryption->format);
return -1; return -1;
} }
@ -841,7 +840,7 @@ storageBackendCreateQemuImgCheckEncryption(int format,
} }
} else { } else {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("volume encryption unsupported with format %s"), type); _("volume encryption unsupported with format %1$s"), type);
return -1; return -1;
} }
@ -870,7 +869,7 @@ storageBackendCreateQemuImgSetInput(virStorageVolDef *inputvol,
if (!(info->inputFormatStr = if (!(info->inputFormatStr =
virStorageFileFormatTypeToString(info->inputFormat))) { virStorageFileFormatTypeToString(info->inputFormat))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown storage vol type %d"), _("unknown storage vol type %1$d"),
info->inputFormat); info->inputFormat);
return -1; return -1;
} }
@ -919,7 +918,7 @@ storageBackendCreateQemuImgSetBacking(virStoragePoolObj *pool,
if (!virStorageFileFormatTypeToString(info->backingFormat)) { if (!virStorageFileFormatTypeToString(info->backingFormat)) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown storage vol backing store type %d"), _("unknown storage vol backing store type %1$d"),
info->backingFormat); info->backingFormat);
return -1; return -1;
} }
@ -933,7 +932,7 @@ storageBackendCreateQemuImgSetBacking(virStoragePoolObj *pool,
info->backingPath, R_OK); info->backingPath, R_OK);
if (accessRetCode != 0) { if (accessRetCode != 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("inaccessible backing store volume %s"), _("inaccessible backing store volume %1$s"),
info->backingPath); info->backingPath);
return -1; return -1;
} }
@ -1036,7 +1035,7 @@ virStorageBackendCreateQemuImgSetInfo(virStoragePoolObj *pool,
if (!(info->type = virStorageFileFormatTypeToString(info->format))) { if (!(info->type = virStorageFileFormatTypeToString(info->format))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown storage vol type %d"), _("unknown storage vol type %1$d"),
info->format); info->format);
return -1; return -1;
} }
@ -1045,7 +1044,7 @@ virStorageBackendCreateQemuImgSetInfo(virStoragePoolObj *pool,
!(info->inputType = !(info->inputType =
virStorageFileFormatTypeToString(inputvol->target.format))) { virStorageFileFormatTypeToString(inputvol->target.format))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown inputvol storage vol type %d"), _("unknown inputvol storage vol type %1$d"),
inputvol->target.format); inputvol->target.format);
return -1; return -1;
} }
@ -1542,7 +1541,7 @@ virStorageBackendDetectBlockVolFormatFD(virStorageSource *target,
start = lseek(fd, 0, SEEK_SET); start = lseek(fd, 0, SEEK_SET);
if (start < 0) { if (start < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot seek to beginning of file '%s'"), _("cannot seek to beginning of file '%1$s'"),
target->path); target->path);
return -1; return -1;
} }
@ -1554,7 +1553,7 @@ virStorageBackendDetectBlockVolFormatFD(virStorageSource *target,
return -2; return -2;
} else { } else {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot read beginning of file '%s'"), _("cannot read beginning of file '%1$s'"),
target->path); target->path);
return -1; return -1;
} }
@ -1600,12 +1599,12 @@ virStorageBackendVolOpen(const char *path, struct stat *sb,
return -2; return -2;
} }
virReportError(VIR_ERR_NO_STORAGE_VOL, virReportError(VIR_ERR_NO_STORAGE_VOL,
_("no storage vol with matching path '%s'"), _("no storage vol with matching path '%1$s'"),
path); path);
return -1; return -1;
} }
virReportSystemError(errno, virReportSystemError(errno,
_("cannot stat file '%s'"), _("cannot stat file '%1$s'"),
path); path);
return -1; return -1;
} }
@ -1616,7 +1615,7 @@ virStorageBackendVolOpen(const char *path, struct stat *sb,
return -2; return -2;
} }
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Volume path '%s' is a FIFO"), path); _("Volume path '%1$s' is a FIFO"), path);
return -1; return -1;
} else if (S_ISSOCK(sb->st_mode)) { } else if (S_ISSOCK(sb->st_mode)) {
if (noerror) { if (noerror) {
@ -1624,7 +1623,7 @@ virStorageBackendVolOpen(const char *path, struct stat *sb,
return -2; return -2;
} }
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Volume path '%s' is a socket"), path); _("Volume path '%1$s' is a socket"), path);
return -1; return -1;
} }
@ -1662,12 +1661,12 @@ virStorageBackendVolOpen(const char *path, struct stat *sb,
return -2; return -2;
} }
virReportSystemError(errno, _("cannot open volume '%s'"), path); virReportSystemError(errno, _("cannot open volume '%1$s'"), path);
return -1; return -1;
} }
if (fstat(fd, sb) < 0) { if (fstat(fd, sb) < 0) {
virReportSystemError(errno, _("cannot stat file '%s'"), path); virReportSystemError(errno, _("cannot stat file '%1$s'"), path);
VIR_FORCE_CLOSE(fd); VIR_FORCE_CLOSE(fd);
return -1; return -1;
} }
@ -1689,7 +1688,7 @@ virStorageBackendVolOpen(const char *path, struct stat *sb,
return -2; return -2;
} }
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot use volume path '%s'"), path); _("Cannot use volume path '%1$s'"), path);
return -1; return -1;
} }
} else { } else {
@ -1699,13 +1698,13 @@ virStorageBackendVolOpen(const char *path, struct stat *sb,
return -2; return -2;
} }
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected type for file '%s'"), path); _("unexpected type for file '%1$s'"), path);
return -1; return -1;
} }
if (virSetBlocking(fd, true) < 0) { if (virSetBlocking(fd, true) < 0) {
VIR_FORCE_CLOSE(fd); VIR_FORCE_CLOSE(fd);
virReportSystemError(errno, _("unable to set blocking mode for '%s'"), virReportSystemError(errno, _("unable to set blocking mode for '%1$s'"),
path); path);
return -1; return -1;
} }
@ -1718,7 +1717,7 @@ virStorageBackendVolOpen(const char *path, struct stat *sb,
} }
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected storage mode for '%s'"), path); _("unexpected storage mode for '%1$s'"), path);
return -1; return -1;
} }
@ -1810,7 +1809,7 @@ storageBackendUpdateVolTargetInfo(virStorageVolType voltype,
} }
if (lseek(fd, 0, SEEK_SET) == (off_t)-1) { if (lseek(fd, 0, SEEK_SET) == (off_t)-1) {
virReportSystemError(errno, _("cannot seek to start of '%s'"), target->path); virReportSystemError(errno, _("cannot seek to start of '%1$s'"), target->path);
return -1; return -1;
} }
@ -1821,7 +1820,7 @@ storageBackendUpdateVolTargetInfo(virStorageVolType voltype,
return -2; return -2;
} else { } else {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot read header '%s'"), _("cannot read header '%1$s'"),
target->path); target->path);
return -1; return -1;
} }
@ -1929,7 +1928,7 @@ virStorageBackendUpdateVolTargetInfoFD(virStorageSource *target,
if (fgetfilecon_raw(fd, &filecon) == -1) { if (fgetfilecon_raw(fd, &filecon) == -1) {
if (errno != ENODATA && errno != ENOTSUP) { if (errno != ENODATA && errno != ENOTSUP) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot get file context of '%s'"), _("cannot get file context of '%1$s'"),
target->path); target->path);
return -1; return -1;
} }
@ -2001,7 +2000,7 @@ virStorageBackendStablePath(virStoragePoolObj *pool,
goto reopen; goto reopen;
} }
virReportSystemError(errno, virReportSystemError(errno,
_("cannot read dir '%s'"), _("cannot read dir '%1$s'"),
def->target.path); def->target.path);
return NULL; return NULL;
} }
@ -2108,7 +2107,7 @@ virStorageBackendVolCreateLocal(virStoragePoolObj *pool,
* allow escape to ../ or a subdir */ * allow escape to ../ or a subdir */
if (strchr(vol->name, '/')) { if (strchr(vol->name, '/')) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("volume name '%s' cannot contain '/'"), vol->name); _("volume name '%1$s' cannot contain '/'"), vol->name);
return -1; return -1;
} }
@ -2117,7 +2116,7 @@ virStorageBackendVolCreateLocal(virStoragePoolObj *pool,
if (virFileExists(vol->target.path)) { if (virFileExists(vol->target.path)) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("volume target path '%s' already exists"), _("volume target path '%1$s' already exists"),
vol->target.path); vol->target.path);
return -1; return -1;
} }
@ -2203,11 +2202,11 @@ virStorageBackendVolDeleteLocal(virStoragePoolObj *pool G_GNUC_UNUSED,
if (errno != ENOENT) { if (errno != ENOENT) {
if (vol->type == VIR_STORAGE_VOL_FILE) if (vol->type == VIR_STORAGE_VOL_FILE)
virReportSystemError(errno, virReportSystemError(errno,
_("cannot unlink file '%s'"), _("cannot unlink file '%1$s'"),
vol->target.path); vol->target.path);
else else
virReportSystemError(errno, virReportSystemError(errno,
_("cannot remove directory '%s'"), _("cannot remove directory '%1$s'"),
vol->target.path); vol->target.path);
return -1; return -1;
} }
@ -2222,7 +2221,7 @@ virStorageBackendVolDeleteLocal(virStoragePoolObj *pool G_GNUC_UNUSED,
case VIR_STORAGE_VOL_NETDIR: case VIR_STORAGE_VOL_NETDIR:
case VIR_STORAGE_VOL_LAST: case VIR_STORAGE_VOL_LAST:
virReportError(VIR_ERR_NO_SUPPORT, virReportError(VIR_ERR_NO_SUPPORT,
_("removing block or network volumes is not supported: %s"), _("removing block or network volumes is not supported: %1$s"),
vol->target.path); vol->target.path);
return -1; return -1;
} }
@ -2547,16 +2546,14 @@ storageBackendVolZeroSparseFileLocal(const char *path,
{ {
if (ftruncate(fd, 0) < 0) { if (ftruncate(fd, 0) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to truncate volume with " _("Failed to truncate volume with path '%1$s' to 0 bytes"),
"path '%s' to 0 bytes"),
path); path);
return -1; return -1;
} }
if (ftruncate(fd, size) < 0) { if (ftruncate(fd, size) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to truncate volume with " _("Failed to truncate volume with path '%1$s' to %2$ju bytes"),
"path '%s' to %ju bytes"),
path, (uintmax_t)size); path, (uintmax_t)size);
return -1; return -1;
} }
@ -2581,16 +2578,14 @@ storageBackendWipeLocal(const char *path,
if (!zero_end) { if (!zero_end) {
if ((size = lseek(fd, 0, SEEK_SET)) < 0) { if ((size = lseek(fd, 0, SEEK_SET)) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to seek to the start in volume " _("Failed to seek to the start in volume with path '%1$s'"),
"with path '%s'"),
path); path);
return -1; return -1;
} }
} else { } else {
if ((size = lseek(fd, -wipe_len, SEEK_END)) < 0) { if ((size = lseek(fd, -wipe_len, SEEK_END)) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to seek to %llu bytes to the end " _("Failed to seek to %1$llu bytes to the end in volume with path '%2$s'"),
"in volume with path '%s'"),
wipe_len, path); wipe_len, path);
return -1; return -1;
} }
@ -2605,8 +2600,7 @@ storageBackendWipeLocal(const char *path,
if (written < 0) { if (written < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to write %zu bytes to " _("Failed to write %1$zu bytes to storage volume with path '%2$s'"),
"storage volume with path '%s'"),
write_size, path); write_size, path);
return -1; return -1;
@ -2617,7 +2611,7 @@ storageBackendWipeLocal(const char *path,
if (virFileDataSync(fd) < 0) { if (virFileDataSync(fd) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot sync data to volume with path '%s'"), _("cannot sync data to volume with path '%1$s'"),
path); path);
return -1; return -1;
} }
@ -2642,14 +2636,14 @@ storageBackendVolWipeLocalFile(const char *path,
fd = open(path, O_RDWR); fd = open(path, O_RDWR);
if (fd == -1) { if (fd == -1) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to open storage volume with path '%s'"), _("Failed to open storage volume with path '%1$s'"),
path); path);
return -1; return -1;
} }
if (fstat(fd, &st) == -1) { if (fstat(fd, &st) == -1) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to stat storage volume with path '%s'"), _("Failed to stat storage volume with path '%1$s'"),
path); path);
return -1; return -1;
} }
@ -2688,7 +2682,7 @@ storageBackendVolWipeLocalFile(const char *path,
return -1; return -1;
case VIR_STORAGE_VOL_WIPE_ALG_LAST: case VIR_STORAGE_VOL_WIPE_ALG_LAST:
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("unsupported algorithm %d"), _("unsupported algorithm %1$d"),
algorithm); algorithm);
return -1; return -1;
} }
@ -2735,12 +2729,12 @@ storageBackendVolWipePloop(virStorageVolDef *vol,
return -1; return -1;
if (virFileRemove(disk_desc, 0, 0) < 0) { if (virFileRemove(disk_desc, 0, 0) < 0) {
virReportError(errno, _("Failed to delete DiskDescriptor.xml of volume '%s'"), virReportError(errno, _("Failed to delete DiskDescriptor.xml of volume '%1$s'"),
vol->target.path); vol->target.path);
return -1; return -1;
} }
if (virFileRemove(target_path, 0, 0) < 0) { if (virFileRemove(target_path, 0, 0) < 0) {
virReportError(errno, _("failed to delete root.hds of volume '%s'"), virReportError(errno, _("failed to delete root.hds of volume '%1$s'"),
vol->target.path); vol->target.path);
return -1; return -1;
} }
@ -2801,7 +2795,7 @@ virStorageBackendBuildLocal(virStoragePoolObj *pool)
parent = g_strdup(def->target.path); parent = g_strdup(def->target.path);
if (!(p = strrchr(parent, '/'))) { if (!(p = strrchr(parent, '/'))) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("path '%s' is not absolute"), _("path '%1$s' is not absolute"),
def->target.path); def->target.path);
return -1; return -1;
} }
@ -2811,7 +2805,7 @@ virStorageBackendBuildLocal(virStoragePoolObj *pool)
* exist, with default uid/gid/mode. */ * exist, with default uid/gid/mode. */
*p = '\0'; *p = '\0';
if (g_mkdir_with_parents(parent, 0777) < 0) { if (g_mkdir_with_parents(parent, 0777) < 0) {
virReportSystemError(errno, _("cannot create path '%s'"), virReportSystemError(errno, _("cannot create path '%1$s'"),
parent); parent);
return -1; return -1;
} }
@ -2866,7 +2860,7 @@ virStorageBackendDeleteLocal(virStoragePoolObj *pool,
if (rmdir(def->target.path) < 0) { if (rmdir(def->target.path) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("failed to remove pool '%s'"), _("failed to remove pool '%1$s'"),
def->target.path); def->target.path);
return -1; return -1;
} }
@ -3109,7 +3103,7 @@ virStorageBackendBLKIDFindEmpty(const char *device,
if (!(probe = blkid_new_probe_from_filename(device))) { if (!(probe = blkid_new_probe_from_filename(device))) {
virReportError(VIR_ERR_STORAGE_PROBE_FAILED, virReportError(VIR_ERR_STORAGE_PROBE_FAILED,
_("Failed to create filesystem probe for device %s"), _("Failed to create filesystem probe for device %1$s"),
device); device);
return -1; return -1;
} }
@ -3131,13 +3125,13 @@ virStorageBackendBLKIDFindEmpty(const char *device,
ret = 0; ret = 0;
else else
virReportError(VIR_ERR_STORAGE_PROBE_FAILED, virReportError(VIR_ERR_STORAGE_PROBE_FAILED,
_("Device '%s' is unrecognized, requires build"), _("Device '%1$s' is unrecognized, requires build"),
device); device);
break; break;
case VIR_STORAGE_BLKID_PROBE_ERROR: case VIR_STORAGE_BLKID_PROBE_ERROR:
virReportError(VIR_ERR_STORAGE_PROBE_FAILED, virReportError(VIR_ERR_STORAGE_PROBE_FAILED,
_("Failed to probe for format type '%s'"), format); _("Failed to probe for format type '%1$s'"), format);
break; break;
case VIR_STORAGE_BLKID_PROBE_UNKNOWN: case VIR_STORAGE_BLKID_PROBE_UNKNOWN:
@ -3147,7 +3141,7 @@ virStorageBackendBLKIDFindEmpty(const char *device,
case VIR_STORAGE_BLKID_PROBE_MATCH: case VIR_STORAGE_BLKID_PROBE_MATCH:
if (writelabel) if (writelabel)
virReportError(VIR_ERR_STORAGE_POOL_BUILT, virReportError(VIR_ERR_STORAGE_POOL_BUILT,
_("Device '%s' already formatted using '%s'"), _("Device '%1$s' already formatted using '%2$s'"),
device, format); device, format);
else else
ret = 0; ret = 0;
@ -3156,14 +3150,11 @@ virStorageBackendBLKIDFindEmpty(const char *device,
case VIR_STORAGE_BLKID_PROBE_DIFFERENT: case VIR_STORAGE_BLKID_PROBE_DIFFERENT:
if (writelabel) if (writelabel)
virReportError(VIR_ERR_STORAGE_POOL_BUILT, virReportError(VIR_ERR_STORAGE_POOL_BUILT,
_("Format of device '%s' does not match the " _("Format of device '%1$s' does not match the expected format '%2$s', forced overwrite is necessary"),
"expected format '%s', forced overwrite is "
"necessary"),
device, format); device, format);
else else
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("Format of device '%s' does not match the " _("Format of device '%1$s' does not match the expected format '%2$s'"),
"expected format '%s'"),
device, format); device, format);
break; break;
} }
@ -3303,7 +3294,7 @@ virStorageBackendPARTEDValidLabel(const char *device,
case VIR_STORAGE_PARTED_MATCH: case VIR_STORAGE_PARTED_MATCH:
if (writelabel) if (writelabel)
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("Disk label already formatted using '%s'"), _("Disk label already formatted using '%1$s'"),
format); format);
else else
ret = 0; ret = 0;
@ -3381,8 +3372,7 @@ virStorageBackendDeviceIsEmpty(const char *devpath,
if (ret == -2) { if (ret == -2) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("Unable to probe '%s' for existing data, " _("Unable to probe '%1$s' for existing data, forced overwrite is necessary"),
"forced overwrite is necessary"),
devpath); devpath);
} }
@ -3450,7 +3440,7 @@ storageBackendProbeTarget(virStorageSource *target,
* even maintenance. */ * even maintenance. */
target->backingStore->format = VIR_STORAGE_FILE_RAW; target->backingStore->format = VIR_STORAGE_FILE_RAW;
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot probe backing volume format: %s"), _("cannot probe backing volume format: %1$s"),
target->backingStore->path); target->backingStore->path);
} else { } else {
target->backingStore->format = rc; target->backingStore->format = rc;
@ -3603,14 +3593,14 @@ virStorageBackendRefreshLocal(virStoragePoolObj *pool)
if ((fd = open(def->target.path, O_RDONLY)) < 0) { if ((fd = open(def->target.path, O_RDONLY)) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot open path '%s'"), _("cannot open path '%1$s'"),
def->target.path); def->target.path);
return -1; return -1;
} }
if (fstat(fd, &statbuf) < 0) { if (fstat(fd, &statbuf) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot stat path '%s'"), _("cannot stat path '%1$s'"),
def->target.path); def->target.path);
return -1; return -1;
} }
@ -3621,7 +3611,7 @@ virStorageBackendRefreshLocal(virStoragePoolObj *pool)
/* VolTargetInfoFD doesn't update capacity correctly for the pool case */ /* VolTargetInfoFD doesn't update capacity correctly for the pool case */
if (statvfs(def->target.path, &sb) < 0) { if (statvfs(def->target.path, &sb) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot statvfs path '%s'"), _("cannot statvfs path '%1$s'"),
def->target.path); def->target.path);
return -1; return -1;
} }
@ -3698,7 +3688,7 @@ virStorageBackendSCSINewLun(virStoragePoolObj *pool,
!(STREQ(def->target.path, "/dev") || !(STREQ(def->target.path, "/dev") ||
STREQ(def->target.path, "/dev/"))) { STREQ(def->target.path, "/dev/"))) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("unable to use target path '%s' for dev '%s'"), _("unable to use target path '%1$s' for dev '%2$s'"),
NULLSTR(def->target.path), dev); NULLSTR(def->target.path), dev);
return -1; return -1;
} }
@ -3804,7 +3794,7 @@ getOldStyleBlockDevice(const char *lun_path G_GNUC_UNUSED,
if (!(blockp = strrchr(block_name, ':'))) { if (!(blockp = strrchr(block_name, ':'))) {
/* Hm, wasn't what we were expecting; have to give up */ /* Hm, wasn't what we were expecting; have to give up */
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to parse block name %s"), _("Failed to parse block name %1$s"),
block_name); block_name);
return -1; return -1;
} else { } else {
@ -3895,7 +3885,7 @@ getDeviceType(uint32_t host,
typefile = fopen(type_path, "r"); typefile = fopen(type_path, "r");
if (typefile == NULL) { if (typefile == NULL) {
virReportSystemError(errno, virReportSystemError(errno,
_("Could not find typefile '%s'"), _("Could not find typefile '%1$s'"),
type_path); type_path);
/* there was no type file; that doesn't seem right */ /* there was no type file; that doesn't seem right */
return -1; return -1;
@ -3906,7 +3896,7 @@ getDeviceType(uint32_t host,
if (gottype == NULL) { if (gottype == NULL) {
virReportSystemError(errno, virReportSystemError(errno,
_("Could not read typefile '%s'"), _("Could not read typefile '%1$s'"),
type_path); type_path);
/* we couldn't read the type file; have to give up */ /* we couldn't read the type file; have to give up */
return -1; return -1;
@ -3917,7 +3907,7 @@ getDeviceType(uint32_t host,
*/ */
if (virStrToLong_i(typestr, &p, 10, type) < 0) { if (virStrToLong_i(typestr, &p, 10, type) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Device type '%s' is not an integer"), _("Device type '%1$s' is not an integer"),
typestr); typestr);
/* Hm, type wasn't an integer; seems strange */ /* Hm, type wasn't an integer; seems strange */
return -1; return -1;
@ -3954,7 +3944,7 @@ processLU(virStoragePoolObj *pool,
if (getDeviceType(host, bus, target, lun, &device_type) < 0) { if (getDeviceType(host, bus, target, lun, &device_type) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to determine if %u:%u:%u:%u is a Direct-Access LUN"), _("Failed to determine if %1$u:%2$u:%3$u:%4$u is a Direct-Access LUN"),
host, bus, target, lun); host, bus, target, lun);
return -1; return -1;
} }