} else if (argc == 3 && STREQ(argv[2], "-p")) {
devmap_partsep = true;
} 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;
}
}
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;
}
}
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;
}
if (virStorageBackendsCount >= VIR_STORAGE_BACKENDS_MAX) {
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));
return -1;
}
return virStorageBackends[i];
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)));
return NULL;
}
*/
if (STRNEQ(vol->name, partname)) {
virReportError(VIR_ERR_INVALID_ARG,
- _("invalid partition name '%s', expected '%s'"),
+ _("invalid partition name '%1$s', expected '%2$s'"),
vol->name, partname);
/* Let's see if by chance parthelper created a name that won't be
if (!virFileExists(def->source.devices[0].path)) {
virReportError(VIR_ERR_INVALID_ARG,
- _("device path '%s' doesn't exist"),
+ _("device path '%1$s' doesn't exist"),
def->source.devices[0].path);
return -1;
}
if (!virFileExists(path)) {
virReportError(VIR_ERR_INVALID_ARG,
- _("device path '%s' doesn't exist"), path);
+ _("device path '%1$s' doesn't exist"), path);
return -1;
}
if (!vol->target.path) {
virReportError(VIR_ERR_INVALID_ARG,
- _("volume target path empty for source path '%s'"),
+ _("volume target path empty for source path '%1$s'"),
src_path);
return -1;
}
} else {
if (virFileResolveLink(vol->target.path, &devpath) < 0) {
virReportSystemError(errno,
- _("Couldn't read volume target path '%s'"),
+ _("Couldn't read volume target path '%1$s'"),
vol->target.path);
return -1;
}
if (!STRPREFIX(dev_name, srcname)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Volume path '%s' did not start with parent "
- "pool source device name."), dev_name);
+ _("Volume path '%1$s' did not start with parent pool source device name."),
+ dev_name);
return -1;
}
if (*part_num == 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot parse partition number from target "
- "'%s'"), dev_name);
+ _("cannot parse partition number from target '%1$s'"),
+ dev_name);
return -1;
}
/* Wiping an extended partition is not support */
virReportError(VIR_ERR_NO_SUPPORT,
- _("cannot wipe extended partition '%s'"),
+ _("cannot wipe extended partition '%1$s'"),
vol->target.path);
return -1;
}
if (!(name = strrchr(path, '/'))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("invalid netfs path (no /): %s"), path);
+ _("invalid netfs path (no /): %1$s"), path);
return -1;
}
name += 1;
if (*name == '\0') {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("invalid netfs path (ends in /): %s"), path);
+ _("invalid netfs path (ends in /): %1$s"), path);
return -1;
}
/* If both fail, then we won't return an empty list - return an error */
if (retNFS < 0 && retGluster == 0) {
virReportError(VIR_ERR_OPERATION_FAILED,
- _("no storage pools were found on host '%s'"),
+ _("no storage pools were found on host '%1$s'"),
state.host);
goto cleanup;
}
if ((mtab = fopen(_PATH_MOUNTED, "r")) == NULL) {
virReportSystemError(errno,
- _("cannot read mount list '%s'"),
+ _("cannot read mount list '%1$s'"),
_PATH_MOUNTED);
goto cleanup;
}
if (!mkfs) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("mkfs is not available on this platform: "
- "Failed to make filesystem of type '%s' on device '%s'"),
+ _("mkfs is not available on this platform: Failed to make filesystem of type '%1$s' on device '%2$s'"),
format, device);
return -1;
}
if (def->source.devices == NULL) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("No source device specified when formatting pool '%s'"),
+ _("No source device specified when formatting pool '%1$s'"),
def->name);
return -1;
}
virObjectUnlock(pool);
if (!virFileExists(device)) {
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);
goto error;
}
* subdirectory within the volume name. */
if (strchr(name, '/')) {
virReportError(VIR_ERR_XML_ERROR,
- _("gluster pool name '%s' must not contain /"),
+ _("gluster pool name '%1$s' must not contain /"),
name);
return NULL;
}
if (dir) {
if (*dir != '/') {
virReportError(VIR_ERR_XML_ERROR,
- _("gluster pool path '%s' must start with /"),
+ _("gluster pool path '%1$s' must start with /"),
dir);
return NULL;
}
/* Actually connect to glfs */
if (!(ret->vol = glfs_new(ret->volname))) {
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;
}
glfs_init(ret->vol) < 0) {
g_autofree char *uri = NULL;
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;
}
if (glfs_chdir(ret->vol, ret->dir) < 0) {
virReportSystemError(errno,
- _("failed to change to directory '%s' in '%s'"),
+ _("failed to change to directory '%1$s' in '%2$s'"),
ret->dir, ret->volname);
goto error;
}
continue;
if (r < 0) {
VIR_FREE(*buf);
- virReportSystemError(errno, _("unable to read '%s'"), name);
+ virReportSystemError(errno, _("unable to read '%1$s'"), name);
return r;
}
if (r == 0)
VIR_WARN("ignoring dangling symlink '%s'", name);
ret = 0;
} else {
- virReportSystemError(errno, _("cannot stat '%s'"), name);
+ virReportSystemError(errno, _("cannot stat '%1$s'"), name);
}
return ret;
}
* of fifos, so there's nothing it would protect us from. */
if (!(fd = glfs_open(state->vol, name, O_RDONLY | O_NOCTTY))) {
/* 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;
}
*/
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);
goto cleanup;
}
goto cleanup;
}
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);
goto cleanup;
}
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);
goto cleanup;
}
case VIR_STORAGE_VOL_PLOOP:
case VIR_STORAGE_VOL_LAST:
virReportError(VIR_ERR_NO_SUPPORT,
- _("removing of '%s' volumes is not supported "
- "by the gluster backend: %s"),
+ _("removing of '%1$s' volumes is not supported by the gluster backend: %2$s"),
virStorageVolTypeToString(vol->type),
vol->target.path);
goto cleanup;
if (glfs_unlink(state->vol, vol->name) < 0) {
if (errno != ENOENT) {
virReportSystemError(errno,
- _("cannot remove gluster volume file '%s'"),
+ _("cannot remove gluster volume file '%1$s'"),
vol->target.path);
goto cleanup;
}
if (glfs_rmdir(state->vol, vol->target.path) < 0) {
if (errno != ENOENT) {
virReportSystemError(errno,
- _("cannot remove gluster volume dir '%s'"),
+ _("cannot remove gluster volume dir '%1$s'"),
vol->target.path);
goto cleanup;
}
if (rc == 0) {
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);
goto cleanup;
}
return 0;
} else {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to parse target '%s'"), dirent->d_name);
+ _("Failed to parse target '%1$s'"), dirent->d_name);
return -1;
}
}
if (direrr == 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to get host number for iSCSI session "
- "with path '%s'"), sysfs_path);
+ _("Failed to get host number for iSCSI session with path '%1$s'"),
+ sysfs_path);
return -1;
}
iscsi = iscsi_create_context(initiator_iqn);
if (!iscsi)
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to create iscsi context for %s"),
+ _("Failed to create iscsi context for %1$s"),
initiator_iqn);
return iscsi;
}
authdef->username, secret_str) < 0) {
virSecureErase(secret_str, secret_size);
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to set credential: %s"),
+ _("Failed to set credential: %1$s"),
iscsi_get_error(iscsi));
return -1;
}
{
if (iscsi_init_transport(iscsi, TCP_TRANSPORT) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to init transport: %s"),
+ _("Failed to init transport: %1$s"),
iscsi_get_error(iscsi));
return -1;
}
if (session == ISCSI_SESSION_NORMAL) {
if (iscsi_set_targetname(iscsi, target_name) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to set target name: %s"),
+ _("Failed to set target name: %1$s"),
iscsi_get_error(iscsi));
return -1;
}
}
if (iscsi_set_session_type(iscsi, session) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to set session type: %s"),
+ _("Failed to set session type: %1$s"),
iscsi_get_error(iscsi));
return -1;
}
{
if (iscsi_connect_sync(iscsi, portal) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to connect: %s"),
+ _("Failed to connect: %1$s"),
iscsi_get_error(iscsi));
return -1;
}
if (iscsi_login_sync(iscsi) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to login: %s"),
+ _("Failed to login: %1$s"),
iscsi_get_error(iscsi));
return -1;
}
do {
if (!(task = iscsi_testunitready_sync(iscsi, lun))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed testunitready: %s"),
+ _("Failed testunitready: %1$s"),
iscsi_get_error(iscsi));
goto cleanup;
}
if (task->status != SCSI_STATUS_GOOD) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed testunitready: %s"),
+ _("Failed testunitready: %1$s"),
iscsi_get_error(iscsi));
goto cleanup;
}
if (!(task = iscsi_inquiry_sync(iscsi, lun, 0, 0, 64)) ||
task->status != SCSI_STATUS_GOOD) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to send inquiry command: %s"),
+ _("Failed to send inquiry command: %1$s"),
iscsi_get_error(iscsi));
goto cleanup;
}
if (!(inq = scsi_datain_unmarshall(task))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to unmarshall reply: %s"),
+ _("Failed to unmarshall reply: %1$s"),
iscsi_get_error(iscsi));
goto cleanup;
}
if (!(task = iscsi_readcapacity16_sync(iscsi, lun)) ||
task->status != SCSI_STATUS_GOOD) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to get capacity of lun: %s"),
+ _("Failed to get capacity of lun: %1$s"),
iscsi_get_error(iscsi));
goto cleanup;
}
if (!(rc16 = scsi_datain_unmarshall(task))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to unmarshall reply: %s"),
+ _("Failed to unmarshall reply: %1$s"),
iscsi_get_error(iscsi));
goto cleanup;
}
if (!(task = iscsi_reportluns_sync(iscsi, 0, 16))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to reportluns: %s"),
+ _("Failed to reportluns: %1$s"),
iscsi_get_error(iscsi));
goto cleanup;
}
scsi_free_scsi_task(task);
if (!(task = iscsi_reportluns_sync(iscsi, 0, full_size))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to reportluns: %s"),
+ _("Failed to reportluns: %1$s"),
iscsi_get_error(iscsi));
goto cleanup;
}
if (!(list = scsi_datain_unmarshall(task))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to unmarshall reportluns: %s"),
+ _("Failed to unmarshall reportluns: %1$s"),
iscsi_get_error(iscsi));
goto cleanup;
}
if (iscsi_logout_sync(iscsi) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to logout: %s"),
+ _("Failed to logout: %1$s"),
iscsi_get_error(iscsi));
goto cleanup;
}
if (iscsi_disconnect(iscsi) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to disconnect: %s"),
+ _("Failed to disconnect: %1$s"),
iscsi_get_error(iscsi));
goto cleanup;
}
if (!(addr = iscsi_discovery_sync(iscsi))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to discover session: %s"),
+ _("Failed to discover session: %1$s"),
iscsi_get_error(iscsi));
return -1;
}
if (!(name = STRSKIP(vol->name, VOL_NAME_PREFIX)) ||
virStrToLong_i(name, NULL, 10, lun) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Invalid volume name %s"), vol->name);
+ _("Invalid volume name %1$s"), vol->name);
return -1;
}
if (!task ||
task->status != SCSI_STATUS_GOOD) {
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));
scsi_free_scsi_task(task);
return -1;
case VIR_STORAGE_VOL_WIPE_ALG_PFITZNER33:
case VIR_STORAGE_VOL_WIPE_ALG_RANDOM:
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);
goto cleanup;
}
re = g_regex_new(regex, 0, 0, &err);
if (!re) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to compile regex %s"), err->message);
+ _("Failed to compile regex %1$s"), err->message);
return -1;
}
if (i == sourceList.nsources) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("cannot find logical volume group name '%s'"),
+ _("cannot find logical volume group name '%1$s'"),
def->source.name);
goto cleanup;
}
*/
if (matchcount == 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("cannot find any matching source devices for logical "
- "volume group '%s'"), def->source.name);
+ _("cannot find any matching source devices for logical volume group '%1$s'"),
+ def->source.name);
goto cleanup;
}
if (geteuid() == 0) {
if (fchown(fd, vol->target.perms->uid, vol->target.perms->gid) < 0) {
virReportSystemError(errno,
- _("cannot set file owner '%s'"),
+ _("cannot set file owner '%1$s'"),
vol->target.path);
goto error;
}
VIR_STORAGE_DEFAULT_VOL_PERM_MODE :
vol->target.perms->mode)) < 0) {
virReportSystemError(errno,
- _("cannot set file mode '%s'"),
+ _("cannot set file mode '%1$s'"),
vol->target.path);
goto error;
}
if (VIR_CLOSE(fd) < 0) {
virReportSystemError(errno,
- _("cannot close file '%s'"),
+ _("cannot close file '%1$s'"),
vol->target.path);
goto error;
}
/* Fill in data about this new vol */
if (virStorageBackendLogicalFindLVs(pool, vol) < 0) {
virReportSystemError(errno,
- _("cannot find newly created volume '%s'"),
+ _("cannot find newly created volume '%1$s'"),
vol->target.path);
goto error;
}
* unsupported.
*/
virReportError(VIR_ERR_NO_SUPPORT,
- _("logical volume '%s' is sparse, volume wipe "
- "not supported"),
+ _("logical volume '%1$s' is sparse, volume wipe not supported"),
vol->target.path);
return -1;
}
if (virStorageBackendGetMinorNumber(names->name, &minor) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to get %s minor number"),
+ _("Failed to get %1$s minor number"),
names->name);
return -1;
}
if (!(cmdopts->values[cmdopts->noptions] =
virXMLPropString(nodes[i], "value"))) {
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]);
goto cleanup;
}
if (*cmdopts->values[cmdopts->noptions] == '\0') {
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]);
goto cleanup;
}
{
if (rados_conf_set(cluster, option, value) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to set RADOS option: %s"),
+ _("failed to set RADOS option: %1$s"),
option);
return -1;
}
ptr->starttime = time(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);
goto cleanup;
}
virStoragePoolDef *def = virStoragePoolObjGetDef(pool);
int rc = rados_ioctx_create(ptr->cluster, def->source.name, &ptr->ioctx);
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);
}
return rc;
int rc;
if ((rc = rbd_get_features(image, features)) < 0) {
- virReportSystemError(errno, _("failed to get the features of RBD image "
- "%s"), volname);
+ virReportSystemError(errno,
+ _("failed to get the features of RBD image %1$s"),
+ volname);
return rc;
}
if ((rc = rbd_get_flags(image, flags)) < 0) {
virReportSystemError(errno,
- _("failed to get the flags of RBD image %s"),
+ _("failed to get the flags of RBD image %1$s"),
volname);
return rc;
}
if ((rc = rbd_diff_iterate2(image, NULL, 0, info->size, 0, 1,
&virStorageBackendRBDRefreshVolInfoCb,
&allocation)) < 0) {
- virReportSystemError(errno, _("failed to iterate RBD image '%s'"),
+ virReportSystemError(errno, _("failed to iterate RBD image '%1$s'"),
vol->name);
return rc;
}
uint64_t flags;
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);
goto cleanup;
}
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);
goto cleanup;
}
}
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);
goto cleanup;
}
g_autofree rbd_snap_info_t *snaps = NULL;
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);
goto cleanup;
}
for (i = 0; i < snap_count; i++) {
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,
snaps[i].name);
goto cleanup;
snaps[i].name);
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,
snaps[i].name);
goto cleanup;
vol->name, snaps[i].name);
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,
snaps[i].name);
goto cleanup;
rc = rbd_remove(ptr->ioctx, vol->name);
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);
goto cleanup;
}
if (virStorageBackendRBDCreateImage(ptr->ioctx, vol->name,
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);
goto cleanup;
}
uint8_t oldformat;
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);
return -1;
}
if (oldformat != 0) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
- _("RBD image %s is old format. Does not support "
- "extended features and striping"),
+ _("RBD image %1$s is old format. Does not support extended features and striping"),
volname);
return -1;
}
return -1;
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);
return -1;
}
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);
return -1;
}
g_autofree rbd_snap_info_t *snaps = NULL;
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);
goto cleanup;
}
if (rbd_diff_iterate(image, snaps[i].name, 0, info.size,
virStorageBackendRBDIterateCb, (void *)&diff) < 0) {
#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);
goto cleanup;
}
VIR_DEBUG("Creating RBD snapshot %s@%s", imgname, snapname);
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);
return -1;
}
VIR_DEBUG("Querying if RBD snapshot %s@%s is protected", imgname, snapname);
if (rbd_snap_is_protected(image, snapname, &protected) < 0) {
- virReportSystemError(errno, _("failed to verify if RBD snapshot %s@%s "
- "is protected"), imgname, snapname);
+ virReportSystemError(errno,
+ _("failed to verify if RBD snapshot %1$s@%2$s is protected"),
+ imgname, snapname);
return -1;
}
imgname, snapname);
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);
return -1;
}
g_autofree char *snapname_buff = NULL;
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);
goto cleanup;
}
if (rbd_clone2(io, origvol, snapname_buff, io, newvol, features,
&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);
goto cleanup;
}
goto cleanup;
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);
goto cleanup;
}
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);
goto cleanup;
}
length = MIN((info->size - offset), (info->obj_size * stripe_count));
if (rbd_write(image, offset, length, writebuf) < 0) {
- virReportSystemError(errno, _("writing %llu bytes failed on "
- "RBD image %s at offset %llu"),
- length, imgname, offset);
+ virReportSystemError(errno, _("writing %1$llu bytes failed on RBD image %2$s at offset %3$llu"),
+ length, imgname, offset);
return -1;
}
length = MIN((info->size - offset), (info->obj_size * stripe_count));
if (rbd_discard(image, offset, length) < 0) {
- virReportSystemError(errno, _("discarding %llu bytes failed on "
- "RBD image %s at offset %llu"),
- length, imgname, offset);
+ virReportSystemError(errno, _("discarding %1$llu bytes failed on RBD image %2$s at offset %3$llu"),
+ length, imgname, offset);
return -1;
}
goto cleanup;
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);
goto cleanup;
}
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);
goto cleanup;
}
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);
goto cleanup;
}
case VIR_STORAGE_VOL_WIPE_ALG_PFITZNER33:
case VIR_STORAGE_VOL_WIPE_ALG_RANDOM:
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);
goto cleanup;
}
if (rc < 0) {
- virReportSystemError(errno, _("failed to wipe RBD image %s"),
+ virReportSystemError(errno, _("failed to wipe RBD image %1$s"),
vol->name);
goto cleanup;
}
if (fd < 0) {
virReportSystemError(errno,
- _("Could not open '%s' to trigger host scan"),
+ _("Could not open '%1$s' to trigger host scan"),
path);
return -1;
}
LINUX_SYSFS_SCSI_HOST_SCAN_STRING,
sizeof(LINUX_SYSFS_SCSI_HOST_SCAN_STRING)) < 0) {
virReportSystemError(errno,
- _("Write to '%s' to trigger host scan failed"),
+ _("Write to '%1$s' to trigger host scan failed"),
path);
return -1;
}
if (!(name = virVHBAGetHostByWWN(NULL, fchost->wwnn, fchost->wwpn))) {
virReportError(VIR_ERR_XML_ERROR,
- _("Failed to find SCSI host with wwnn='%s', "
- "wwpn='%s'"), fchost->wwnn, fchost->wwpn);
+ _("Failed to find SCSI host with wwnn='%1$s', wwpn='%2$s'"),
+ fchost->wwnn, fchost->wwpn);
}
}
return true;
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;
}
if (virSCSIHostGetNumber(parent_name, &host_num) < 0) {
virReportError(VIR_ERR_XML_ERROR,
- _("parent '%s' is not properly formatted"),
+ _("parent '%1$s' is not properly formatted"),
parent_name);
goto cleanup;
}
if (!virVHBAPathExists(NULL, host_num)) {
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);
goto cleanup;
}
if (STRNEQ(parent_name, vhba_parent)) {
virReportError(VIR_ERR_XML_ERROR,
- _("Parent attribute '%s' does not match parent '%s' "
- "determined for the '%s' wwnn/wwpn lookup."),
+ _("Parent attribute '%1$s' does not match parent '%2$s' determined for the '%3$s' wwnn/wwpn lookup."),
parent_name, vhba_parent, name);
goto cleanup;
}
if ((mtab = fopen(_PATH_MOUNTED, "r")) == NULL) {
virReportSystemError(errno,
- _("cannot read mount list '%s'"),
+ _("cannot read mount list '%1$s'"),
_PATH_MOUNTED);
goto cleanup;
}
if ((backend = virStorageBackendForType(def->type)) == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Missing backend %d"), def->type);
+ _("Missing backend %1$d"), def->type);
return;
}
if (backend->checkPool &&
backend->checkPool(obj, &active) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to initialize storage pool '%s': %s"),
+ _("Failed to initialize storage pool '%1$s': %2$s"),
def->name, virGetLastErrorMessage());
unlink(stateFile);
active = false;
if (active &&
storagePoolRefreshImpl(backend, obj, stateFile) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to restart storage pool '%s': %s"),
+ _("Failed to restart storage pool '%1$s': %2$s"),
def->name, virGetLastErrorMessage());
active = false;
}
if (backend->startPool &&
backend->startPool(obj) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to autostart storage pool '%s': %s"),
+ _("Failed to autostart storage pool '%1$s': %2$s"),
def->name, virGetLastErrorMessage());
goto cleanup;
}
virStoragePoolSaveState(stateFile, def) < 0 ||
storagePoolRefreshImpl(backend, obj, stateFile) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to autostart storage pool '%s': %s"),
+ _("Failed to autostart storage pool '%1$s': %2$s"),
def->name, virGetLastErrorMessage());
} else {
virStoragePoolObjSetActive(obj, true);
if (g_mkdir_with_parents(driver->stateDir, 0777) < 0) {
virReportError(errno,
- _("cannot create directory %s"),
+ _("cannot create directory %1$s"),
driver->stateDir);
goto error;
}
virUUIDFormat(uuid, uuidstr);
if (name)
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);
else
virReportError(VIR_ERR_NO_STORAGE_POOL,
- _("no storage pool with matching uuid '%s'"),
+ _("no storage pool with matching uuid '%1$s'"),
uuidstr);
}
if (!(obj = virStoragePoolObjFindByName(driver->pools, name)))
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;
}
backend_type = virStoragePoolTypeFromString(type);
if (backend_type < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown storage pool type %s"), type);
+ _("unknown storage pool type %1$s"), type);
return NULL;
}
if (!backend->findPoolSources) {
virReportError(VIR_ERR_NO_SUPPORT,
- _("pool type '%s' does not support source "
- "discovery"), type);
+ _("pool type '%1$s' does not support source discovery"),
+ type);
return NULL;
}
if (virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is still active"),
+ _("storage pool '%1$s' is still active"),
def->name);
goto cleanup;
}
if (virStoragePoolObjIsStarting(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is starting up"),
+ _("storage pool '%1$s' is starting up"),
def->name);
goto cleanup;
}
if (virStoragePoolObjGetAsyncjobs(obj) > 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("pool '%s' has asynchronous jobs running."),
+ _("pool '%1$s' has asynchronous jobs running."),
def->name);
goto cleanup;
}
if (autostartLink && unlink(autostartLink) < 0 &&
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));
}
if (virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is already active"),
+ _("storage pool '%1$s' is already active"),
def->name);
goto cleanup;
}
if (virStoragePoolObjIsStarting(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is starting up"),
+ _("storage pool '%1$s' is starting up"),
def->name);
goto cleanup;
}
if (virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is already active"),
+ _("storage pool '%1$s' is already active"),
def->name);
goto cleanup;
}
if (virStoragePoolObjIsStarting(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is starting up"),
+ _("storage pool '%1$s' is starting up"),
def->name);
goto cleanup;
}
if (!virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is not active"), def->name);
+ _("storage pool '%1$s' is not active"), def->name);
goto cleanup;
}
if (virStoragePoolObjIsStarting(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is starting up"),
+ _("storage pool '%1$s' is starting up"),
def->name);
goto cleanup;
}
if (virStoragePoolObjGetAsyncjobs(obj) > 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("pool '%s' has asynchronous jobs running."),
+ _("pool '%1$s' has asynchronous jobs running."),
def->name);
goto cleanup;
}
if (virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is still active"),
+ _("storage pool '%1$s' is still active"),
def->name);
goto cleanup;
}
if (virStoragePoolObjIsStarting(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is starting up"),
+ _("storage pool '%1$s' is starting up"),
def->name);
goto cleanup;
}
if (virStoragePoolObjGetAsyncjobs(obj) > 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("pool '%s' has asynchronous jobs running."),
+ _("pool '%1$s' has asynchronous jobs running."),
def->name);
goto cleanup;
}
if (!virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is not active"), def->name);
+ _("storage pool '%1$s' is not active"), def->name);
goto cleanup;
}
if (virStoragePoolObjIsStarting(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is starting up"),
+ _("storage pool '%1$s' is starting up"),
def->name);
goto cleanup;
}
if (virStoragePoolObjGetAsyncjobs(obj) > 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("pool '%s' has asynchronous jobs running."),
+ _("pool '%1$s' has asynchronous jobs running."),
def->name);
goto cleanup;
}
if (new_autostart) {
if (g_mkdir_with_parents(driver->autostartDir, 0777) < 0) {
virReportSystemError(errno,
- _("cannot create autostart directory %s"),
+ _("cannot create autostart directory %1$s"),
driver->autostartDir);
goto cleanup;
}
if (symlink(configFile, autostartLink) < 0) {
virReportSystemError(errno,
- _("Failed to create symlink '%s' to '%s'"),
+ _("Failed to create symlink '%1$s' to '%2$s'"),
autostartLink, configFile);
goto cleanup;
}
if (autostartLink && unlink(autostartLink) < 0 &&
errno != ENOENT && errno != ENOTDIR) {
virReportSystemError(errno,
- _("Failed to delete symlink '%s'"),
+ _("Failed to delete symlink '%1$s'"),
autostartLink);
goto cleanup;
}
if (!virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is not active"), def->name);
+ _("storage pool '%1$s' is not active"), def->name);
goto cleanup;
}
if (!virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is not active"), def->name);
+ _("storage pool '%1$s' is not active"), def->name);
goto cleanup;
}
if (!virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is not active"), def->name);
+ _("storage pool '%1$s' is not active"), def->name);
goto cleanup;
}
if (!virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is not active"), def->name);
+ _("storage pool '%1$s' is not active"), def->name);
goto cleanup;
}
if (!voldef) {
virReportError(VIR_ERR_NO_STORAGE_VOL,
- _("no storage vol with matching name '%s'"),
+ _("no storage vol with matching name '%1$s'"),
name);
goto cleanup;
}
if (!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;
}
if (!vol) {
if (STREQ(path, data.cleanpath)) {
virReportError(VIR_ERR_NO_STORAGE_VOL,
- _("no storage vol with matching path '%s'"), path);
+ _("no storage vol with matching path '%1$s'"), path);
} else {
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);
}
}
if (!pool) {
if (STREQ(path, cleanpath)) {
virReportError(VIR_ERR_NO_STORAGE_POOL,
- _("no storage pool with matching target path '%s'"),
+ _("no storage pool with matching target path '%1$s'"),
path);
} else {
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);
}
}
if (!virStoragePoolObjIsActive(*obj)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is not active"),
+ _("storage pool '%1$s' is not active"),
def->name);
goto error;
}
if (!(voldef = virStorageVolDefFindByName(*obj, vol->name))) {
virReportError(VIR_ERR_NO_STORAGE_VOL,
- _("no storage vol with matching name '%s'"),
+ _("no storage vol with matching name '%1$s'"),
vol->name);
goto error;
}
if (voldef->in_use) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("volume '%s' is still in use."),
+ _("volume '%1$s' is still in use."),
voldef->name);
goto cleanup;
}
if (voldef->building) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("volume '%s' is still being allocated."),
+ _("volume '%1$s' is still being allocated."),
voldef->name);
goto cleanup;
}
if (!virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is not active"), def->name);
+ _("storage pool '%1$s' is not active"), def->name);
goto cleanup;
}
if (virStorageVolDefFindByName(obj, voldef->name)) {
virReportError(VIR_ERR_STORAGE_VOL_EXIST,
- _("'%s'"), voldef->name);
+ _("'%1$s'"), voldef->name);
goto cleanup;
}
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(pool->uuid, uuidstr);
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);
goto cleanup;
}
if (STRNEQ(pool->name, volsrc->pool) && !objsrc) {
virReportError(VIR_ERR_NO_STORAGE_POOL,
- _("no storage pool with matching name '%s'"),
+ _("no storage pool with matching name '%1$s'"),
volsrc->pool);
goto cleanup;
}
if (!virStoragePoolObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is not active"), def->name);
+ _("storage pool '%1$s' is not active"), def->name);
goto cleanup;
}
if (objsrc && !virStoragePoolObjIsActive(objsrc)) {
virStoragePoolDef *objsrcdef = virStoragePoolObjGetDef(objsrc);
virReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool '%s' is not active"),
+ _("storage pool '%1$s' is not active"),
objsrcdef->name);
goto cleanup;
}
objsrc : obj, volsrc->name);
if (!voldefsrc) {
virReportError(VIR_ERR_NO_STORAGE_VOL,
- _("no storage vol with matching name '%s'"),
+ _("no storage vol with matching name '%1$s'"),
volsrc->name);
goto cleanup;
}
if (virStorageVolDefFindByName(obj, voldef->name)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("storage volume name '%s' already in use."),
+ _("storage volume name '%1$s' already in use."),
voldef->name);
goto cleanup;
}
if (voldefsrc->building) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("volume '%s' is still being allocated."),
+ _("volume '%1$s' is still being allocated."),
voldefsrc->name);
goto cleanup;
}
if (voldef->building) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("volume '%s' is still being allocated."),
+ _("volume '%1$s' is still being allocated."),
voldef->name);
goto cleanup;
}
if (voldef->in_use) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("volume '%s' is still in use."),
+ _("volume '%1$s' is still in use."),
voldef->name);
goto cleanup;
}
if (voldef->building) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("volume '%s' is still being allocated."),
+ _("volume '%1$s' is still being allocated."),
voldef->name);
goto cleanup;
}
if (voldef->in_use) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("volume '%s' is still in use."),
+ _("volume '%1$s' is still in use."),
voldef->name);
goto cleanup;
}
if (voldef->building) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("volume '%s' is still being allocated."),
+ _("volume '%1$s' is still being allocated."),
voldef->name);
goto cleanup;
}
if (algorithm >= VIR_STORAGE_VOL_WIPE_ALG_LAST) {
virReportError(VIR_ERR_INVALID_ARG,
- _("wiping algorithm %d not supported"),
+ _("wiping algorithm %1$d not supported"),
algorithm);
return -1;
}
if (voldef->in_use) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("volume '%s' is still in use."),
+ _("volume '%1$s' is still in use."),
voldef->name);
goto cleanup;
}
if (voldef->building) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("volume '%s' is still being allocated."),
+ _("volume '%1$s' is still being allocated."),
voldef->name);
goto cleanup;
}
if ((inputfd = open(inputvol->target.path, O_RDONLY)) < 0) {
virReportSystemError(errno,
- _("could not open input path '%s'"),
+ _("could not open input path '%1$s'"),
inputvol->target.path);
return -1;
}
if (reflink_copy) {
if (reflinkCloneFile(fd, inputfd) < 0) {
virReportSystemError(errno,
- _("failed to clone files from '%s'"),
+ _("failed to clone files from '%1$s'"),
inputvol->target.path);
return -1;
} else {
if ((amtread = saferead(inputfd, buf, rbytes)) < 0) {
virReportSystemError(errno,
- _("failed reading from file '%s'"),
+ _("failed reading from file '%1$s'"),
inputvol->target.path);
return -1;
}
if (want_sparse && memcmp(buf+offset, zerobuf, interval) == 0) {
if (lseek(fd, interval, SEEK_CUR) < 0) {
virReportSystemError(errno,
- _("cannot extend file '%s'"),
+ _("cannot extend file '%1$s'"),
vol->target.path);
return -1;
}
} else if (safewrite(fd, buf+offset, interval) < 0) {
virReportSystemError(errno,
- _("failed writing to file '%s'"),
+ _("failed writing to file '%1$s'"),
vol->target.path);
return -1;
}
if (virFileDataSync(fd) < 0) {
- virReportSystemError(errno, _("cannot sync data to file '%s'"),
+ virReportSystemError(errno, _("cannot sync data to file '%1$s'"),
vol->target.path);
return -1;
}
if (VIR_CLOSE(inputfd) < 0) {
virReportSystemError(errno,
- _("cannot close file '%s'"),
+ _("cannot close file '%1$s'"),
inputvol->target.path);
return -1;
}
if ((fd = open(vol->target.path, O_RDWR)) < 0) {
virReportSystemError(errno,
- _("cannot create path '%s'"),
+ _("cannot create path '%1$s'"),
vol->target.path);
return -1;
}
}
if (fstat(fd, &st) == -1) {
- virReportSystemError(errno, _("stat of '%s' failed"),
+ virReportSystemError(errno, _("stat of '%1$s' failed"),
vol->target.path);
return -1;
}
if (((uid != (uid_t)-1) || (gid != (gid_t)-1))
&& (fchown(fd, uid, gid) < 0)) {
virReportSystemError(errno,
- _("cannot chown '%s' to (%u, %u)"),
+ _("cannot chown '%1$s' to (%2$u, %3$u)"),
vol->target.path, (unsigned int)uid,
(unsigned int)gid);
return -1;
VIR_STORAGE_DEFAULT_VOL_PERM_MODE : vol->target.perms->mode);
if (fchmod(fd, mode) < 0) {
virReportSystemError(errno,
- _("cannot set mode of '%s' to %04o"),
+ _("cannot set mode of '%1$s' to %2$04o"),
vol->target.path, mode);
return -1;
}
if (VIR_CLOSE(fd) < 0) {
virReportSystemError(errno,
- _("cannot close file '%s'"),
+ _("cannot close file '%1$s'"),
vol->target.path);
return -1;
}
* for progress reporting */
if (ftruncate(fd, vol->target.capacity) < 0) {
virReportSystemError(errno,
- _("cannot extend file '%s'"),
+ _("cannot extend file '%1$s'"),
vol->target.path);
return -1;
}
need_alloc = false;
} else if (errno != ENOSYS && errno != EOPNOTSUPP) {
virReportSystemError(errno,
- _("cannot allocate %llu bytes in file '%s'"),
+ _("cannot allocate %1$llu bytes in file '%2$s'"),
vol->target.allocation, vol->target.path);
return -1;
}
if (need_alloc && (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);
return -1;
}
}
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);
return -1;
}
vol->target.perms->gid,
operation_flags)) < 0) {
virReportSystemError(-fd,
- _("Failed to create file '%s'"),
+ _("Failed to create file '%1$s'"),
vol->target.path);
return -1;
}
goto cleanup;
if (stat(vol->target.path, &st) < 0) {
virReportSystemError(errno,
- _("failed to create %s"), vol->target.path);
+ _("failed to create %1$s"), vol->target.path);
goto cleanup;
}
filecreated = true;
if (((uid != (uid_t)-1) || (gid != (gid_t)-1))
&& (chown(vol->target.path, uid, gid) < 0)) {
virReportSystemError(errno,
- _("cannot chown %s to (%u, %u)"),
+ _("cannot chown %1$s to (%2$u, %3$u)"),
vol->target.path, (unsigned int)uid,
(unsigned int)gid);
goto cleanup;
if (mode != (st.st_mode & S_IRWXUGO) &&
chmod(vol->target.path, mode) < 0) {
virReportSystemError(errno,
- _("cannot set mode of '%s' to %04o"),
+ _("cannot set mode of '%1$s' to %2$04o"),
vol->target.path, mode);
goto cleanup;
}
if (inputvol && inputvol->target.format != VIR_STORAGE_FILE_PLOOP) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unsupported input storage vol type %d"),
+ _("unsupported input storage vol type %1$d"),
inputvol->target.format);
return -1;
}
VIR_STORAGE_FILE_FEATURE_LAZY_REFCOUNTS)) {
if (STREQ_NULLABLE(info->compat, "0.10")) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("lazy_refcounts not supported with compat"
- " level %s"),
+ _("lazy_refcounts not supported with compat level %1$s"),
info->compat);
return -1;
}
VIR_STORAGE_FILE_FEATURE_EXTENDED_L2)) {
if (STREQ_NULLABLE(info->compat, "0.10")) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("'extended_l2' not supported with compat level %s"),
+ _("'extended_l2' not supported with compat level %1$s"),
info->compat);
return -1;
}
format == VIR_STORAGE_FILE_QCOW2) {
if (enc->format != VIR_STORAGE_ENCRYPTION_FORMAT_LUKS) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unsupported volume encryption format %d"),
+ _("unsupported volume encryption format %1$d"),
vol->target.encryption->format);
return -1;
}
}
} else {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("volume encryption unsupported with format %s"), type);
+ _("volume encryption unsupported with format %1$s"), type);
return -1;
}
if (!(info->inputFormatStr =
virStorageFileFormatTypeToString(info->inputFormat))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown storage vol type %d"),
+ _("unknown storage vol type %1$d"),
info->inputFormat);
return -1;
}
if (!virStorageFileFormatTypeToString(info->backingFormat)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown storage vol backing store type %d"),
+ _("unknown storage vol backing store type %1$d"),
info->backingFormat);
return -1;
}
info->backingPath, R_OK);
if (accessRetCode != 0) {
virReportSystemError(errno,
- _("inaccessible backing store volume %s"),
+ _("inaccessible backing store volume %1$s"),
info->backingPath);
return -1;
}
if (!(info->type = virStorageFileFormatTypeToString(info->format))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown storage vol type %d"),
+ _("unknown storage vol type %1$d"),
info->format);
return -1;
}
!(info->inputType =
virStorageFileFormatTypeToString(inputvol->target.format))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown inputvol storage vol type %d"),
+ _("unknown inputvol storage vol type %1$d"),
inputvol->target.format);
return -1;
}
start = lseek(fd, 0, SEEK_SET);
if (start < 0) {
virReportSystemError(errno,
- _("cannot seek to beginning of file '%s'"),
+ _("cannot seek to beginning of file '%1$s'"),
target->path);
return -1;
}
return -2;
} else {
virReportSystemError(errno,
- _("cannot read beginning of file '%s'"),
+ _("cannot read beginning of file '%1$s'"),
target->path);
return -1;
}
return -2;
}
virReportError(VIR_ERR_NO_STORAGE_VOL,
- _("no storage vol with matching path '%s'"),
+ _("no storage vol with matching path '%1$s'"),
path);
return -1;
}
virReportSystemError(errno,
- _("cannot stat file '%s'"),
+ _("cannot stat file '%1$s'"),
path);
return -1;
}
return -2;
}
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Volume path '%s' is a FIFO"), path);
+ _("Volume path '%1$s' is a FIFO"), path);
return -1;
} else if (S_ISSOCK(sb->st_mode)) {
if (noerror) {
return -2;
}
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Volume path '%s' is a socket"), path);
+ _("Volume path '%1$s' is a socket"), path);
return -1;
}
return -2;
}
- virReportSystemError(errno, _("cannot open volume '%s'"), path);
+ virReportSystemError(errno, _("cannot open volume '%1$s'"), path);
return -1;
}
if (fstat(fd, sb) < 0) {
- virReportSystemError(errno, _("cannot stat file '%s'"), path);
+ virReportSystemError(errno, _("cannot stat file '%1$s'"), path);
VIR_FORCE_CLOSE(fd);
return -1;
}
return -2;
}
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cannot use volume path '%s'"), path);
+ _("Cannot use volume path '%1$s'"), path);
return -1;
}
} else {
return -2;
}
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unexpected type for file '%s'"), path);
+ _("unexpected type for file '%1$s'"), path);
return -1;
}
if (virSetBlocking(fd, true) < 0) {
VIR_FORCE_CLOSE(fd);
- virReportSystemError(errno, _("unable to set blocking mode for '%s'"),
+ virReportSystemError(errno, _("unable to set blocking mode for '%1$s'"),
path);
return -1;
}
}
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unexpected storage mode for '%s'"), path);
+ _("unexpected storage mode for '%1$s'"), path);
return -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 -2;
} else {
virReportSystemError(errno,
- _("cannot read header '%s'"),
+ _("cannot read header '%1$s'"),
target->path);
return -1;
}
if (fgetfilecon_raw(fd, &filecon) == -1) {
if (errno != ENODATA && errno != ENOTSUP) {
virReportSystemError(errno,
- _("cannot get file context of '%s'"),
+ _("cannot get file context of '%1$s'"),
target->path);
return -1;
}
goto reopen;
}
virReportSystemError(errno,
- _("cannot read dir '%s'"),
+ _("cannot read dir '%1$s'"),
def->target.path);
return NULL;
}
* allow escape to ../ or a subdir */
if (strchr(vol->name, '/')) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("volume name '%s' cannot contain '/'"), vol->name);
+ _("volume name '%1$s' cannot contain '/'"), vol->name);
return -1;
}
if (virFileExists(vol->target.path)) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("volume target path '%s' already exists"),
+ _("volume target path '%1$s' already exists"),
vol->target.path);
return -1;
}
if (errno != ENOENT) {
if (vol->type == VIR_STORAGE_VOL_FILE)
virReportSystemError(errno,
- _("cannot unlink file '%s'"),
+ _("cannot unlink file '%1$s'"),
vol->target.path);
else
virReportSystemError(errno,
- _("cannot remove directory '%s'"),
+ _("cannot remove directory '%1$s'"),
vol->target.path);
return -1;
}
case VIR_STORAGE_VOL_NETDIR:
case VIR_STORAGE_VOL_LAST:
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);
return -1;
}
{
if (ftruncate(fd, 0) < 0) {
virReportSystemError(errno,
- _("Failed to truncate volume with "
- "path '%s' to 0 bytes"),
+ _("Failed to truncate volume with path '%1$s' to 0 bytes"),
path);
return -1;
}
if (ftruncate(fd, size) < 0) {
virReportSystemError(errno,
- _("Failed to truncate volume with "
- "path '%s' to %ju bytes"),
+ _("Failed to truncate volume with path '%1$s' to %2$ju bytes"),
path, (uintmax_t)size);
return -1;
}
if (!zero_end) {
if ((size = lseek(fd, 0, SEEK_SET)) < 0) {
virReportSystemError(errno,
- _("Failed to seek to the start in volume "
- "with path '%s'"),
+ _("Failed to seek to the start in volume with path '%1$s'"),
path);
return -1;
}
} else {
if ((size = lseek(fd, -wipe_len, SEEK_END)) < 0) {
virReportSystemError(errno,
- _("Failed to seek to %llu bytes to the end "
- "in volume with path '%s'"),
+ _("Failed to seek to %1$llu bytes to the end in volume with path '%2$s'"),
wipe_len, path);
return -1;
}
if (written < 0) {
virReportSystemError(errno,
- _("Failed to write %zu bytes to "
- "storage volume with path '%s'"),
+ _("Failed to write %1$zu bytes to storage volume with path '%2$s'"),
write_size, path);
return -1;
if (virFileDataSync(fd) < 0) {
virReportSystemError(errno,
- _("cannot sync data to volume with path '%s'"),
+ _("cannot sync data to volume with path '%1$s'"),
path);
return -1;
}
fd = open(path, O_RDWR);
if (fd == -1) {
virReportSystemError(errno,
- _("Failed to open storage volume with path '%s'"),
+ _("Failed to open storage volume with path '%1$s'"),
path);
return -1;
}
if (fstat(fd, &st) == -1) {
virReportSystemError(errno,
- _("Failed to stat storage volume with path '%s'"),
+ _("Failed to stat storage volume with path '%1$s'"),
path);
return -1;
}
return -1;
case VIR_STORAGE_VOL_WIPE_ALG_LAST:
virReportError(VIR_ERR_INVALID_ARG,
- _("unsupported algorithm %d"),
+ _("unsupported algorithm %1$d"),
algorithm);
return -1;
}
return -1;
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);
return -1;
}
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);
return -1;
}
parent = g_strdup(def->target.path);
if (!(p = strrchr(parent, '/'))) {
virReportError(VIR_ERR_INVALID_ARG,
- _("path '%s' is not absolute"),
+ _("path '%1$s' is not absolute"),
def->target.path);
return -1;
}
* exist, with default uid/gid/mode. */
*p = '\0';
if (g_mkdir_with_parents(parent, 0777) < 0) {
- virReportSystemError(errno, _("cannot create path '%s'"),
+ virReportSystemError(errno, _("cannot create path '%1$s'"),
parent);
return -1;
}
if (rmdir(def->target.path) < 0) {
virReportSystemError(errno,
- _("failed to remove pool '%s'"),
+ _("failed to remove pool '%1$s'"),
def->target.path);
return -1;
}
if (!(probe = blkid_new_probe_from_filename(device))) {
virReportError(VIR_ERR_STORAGE_PROBE_FAILED,
- _("Failed to create filesystem probe for device %s"),
+ _("Failed to create filesystem probe for device %1$s"),
device);
return -1;
}
ret = 0;
else
virReportError(VIR_ERR_STORAGE_PROBE_FAILED,
- _("Device '%s' is unrecognized, requires build"),
+ _("Device '%1$s' is unrecognized, requires build"),
device);
break;
case VIR_STORAGE_BLKID_PROBE_ERROR:
virReportError(VIR_ERR_STORAGE_PROBE_FAILED,
- _("Failed to probe for format type '%s'"), format);
+ _("Failed to probe for format type '%1$s'"), format);
break;
case VIR_STORAGE_BLKID_PROBE_UNKNOWN:
case VIR_STORAGE_BLKID_PROBE_MATCH:
if (writelabel)
virReportError(VIR_ERR_STORAGE_POOL_BUILT,
- _("Device '%s' already formatted using '%s'"),
+ _("Device '%1$s' already formatted using '%2$s'"),
device, format);
else
ret = 0;
case VIR_STORAGE_BLKID_PROBE_DIFFERENT:
if (writelabel)
virReportError(VIR_ERR_STORAGE_POOL_BUILT,
- _("Format of device '%s' does not match the "
- "expected format '%s', forced overwrite is "
- "necessary"),
+ _("Format of device '%1$s' does not match the expected format '%2$s', forced overwrite is necessary"),
device, format);
else
virReportError(VIR_ERR_OPERATION_INVALID,
- _("Format of device '%s' does not match the "
- "expected format '%s'"),
+ _("Format of device '%1$s' does not match the expected format '%2$s'"),
device, format);
break;
}
case VIR_STORAGE_PARTED_MATCH:
if (writelabel)
virReportError(VIR_ERR_OPERATION_INVALID,
- _("Disk label already formatted using '%s'"),
+ _("Disk label already formatted using '%1$s'"),
format);
else
ret = 0;
if (ret == -2) {
virReportError(VIR_ERR_OPERATION_INVALID,
- _("Unable to probe '%s' for existing data, "
- "forced overwrite is necessary"),
+ _("Unable to probe '%1$s' for existing data, forced overwrite is necessary"),
devpath);
}
* even maintenance. */
target->backingStore->format = VIR_STORAGE_FILE_RAW;
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot probe backing volume format: %s"),
+ _("cannot probe backing volume format: %1$s"),
target->backingStore->path);
} else {
target->backingStore->format = rc;
if ((fd = open(def->target.path, O_RDONLY)) < 0) {
virReportSystemError(errno,
- _("cannot open path '%s'"),
+ _("cannot open path '%1$s'"),
def->target.path);
return -1;
}
if (fstat(fd, &statbuf) < 0) {
virReportSystemError(errno,
- _("cannot stat path '%s'"),
+ _("cannot stat path '%1$s'"),
def->target.path);
return -1;
}
/* VolTargetInfoFD doesn't update capacity correctly for the pool case */
if (statvfs(def->target.path, &sb) < 0) {
virReportSystemError(errno,
- _("cannot statvfs path '%s'"),
+ _("cannot statvfs path '%1$s'"),
def->target.path);
return -1;
}
!(STREQ(def->target.path, "/dev") ||
STREQ(def->target.path, "/dev/"))) {
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);
return -1;
}
if (!(blockp = strrchr(block_name, ':'))) {
/* Hm, wasn't what we were expecting; have to give up */
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to parse block name %s"),
+ _("Failed to parse block name %1$s"),
block_name);
return -1;
} else {
typefile = fopen(type_path, "r");
if (typefile == NULL) {
virReportSystemError(errno,
- _("Could not find typefile '%s'"),
+ _("Could not find typefile '%1$s'"),
type_path);
/* there was no type file; that doesn't seem right */
return -1;
if (gottype == NULL) {
virReportSystemError(errno,
- _("Could not read typefile '%s'"),
+ _("Could not read typefile '%1$s'"),
type_path);
/* we couldn't read the type file; have to give up */
return -1;
*/
if (virStrToLong_i(typestr, &p, 10, type) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Device type '%s' is not an integer"),
+ _("Device type '%1$s' is not an integer"),
typestr);
/* Hm, type wasn't an integer; seems strange */
return -1;
if (getDeviceType(host, bus, target, lun, &device_type) < 0) {
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);
return -1;
}