lxc: 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 12:22:28 +01:00
parent 0121243d67
commit 322dd93901
9 changed files with 190 additions and 190 deletions

View File

@ -382,7 +382,7 @@ virCgroup *virLXCCgroupCreate(virDomainDef *def,
if (!g_path_is_absolute(def->resource->partition)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Resource partition '%s' must start with '/'"),
_("Resource partition '%1$s' must start with '/'"),
def->resource->partition);
return NULL;
}

View File

@ -126,7 +126,7 @@ int lxcContainerHasReboot(void)
if (virStrToLong_i(buf, NULL, 10, &v) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Malformed ctrl-alt-del setting '%s'"), buf);
_("Malformed ctrl-alt-del setting '%1$s'"), buf);
return -1;
}
cmd = v ? LINUX_REBOOT_CMD_CAD_ON : LINUX_REBOOT_CMD_CAD_OFF;
@ -178,7 +178,7 @@ static virCommand *lxcContainerBuildInitCmd(virDomainDef *vmDef,
for (i = 1; i < nttyPaths; i++) {
if (!STRPREFIX(ttyPaths[i], "/dev/")) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Expected a /dev path for '%s'"),
_("Expected a /dev path for '%1$s'"),
ttyPaths[i]);
return NULL;
}
@ -292,7 +292,7 @@ static int lxcContainerSetupFDs(int *ttyfd,
if (newfd < 0) {
virReportSystemError(errno,
_("Cannot move fd %d out of the way"),
_("Cannot move fd %1$d out of the way"),
passFDs[j]);
goto cleanup;
}
@ -310,7 +310,7 @@ static int lxcContainerSetupFDs(int *ttyfd,
/* Finally we can move into our desired FD number */
if (dup2(passFDs[i], wantfd) < 0) {
virReportSystemError(errno,
_("Cannot duplicate fd %d onto fd %d"),
_("Cannot duplicate fd %1$d onto fd %2$d"),
passFDs[i], wantfd);
goto cleanup;
}
@ -532,7 +532,7 @@ static int lxcContainerUnmountSubtree(const char *prefix,
/* This detaches the subtree */
if (umount2(mounts[nmounts-1], MNT_DETACH) < 0) {
virReportSystemError(saveErrno,
_("Failed to unmount '%s' and could not detach subtree '%s'"),
_("Failed to unmount '%1$s' and could not detach subtree '%2$s'"),
failedUmount, mounts[nmounts-1]);
return -1;
}
@ -540,7 +540,7 @@ static int lxcContainerUnmountSubtree(const char *prefix,
if (isOldRootFS &&
umount(mounts[nmounts-1]) < 0) {
virReportSystemError(saveErrno,
_("Failed to unmount '%s' and could not unmount old root '%s'"),
_("Failed to unmount '%1$s' and could not unmount old root '%2$s'"),
failedUmount, mounts[nmounts-1]);
return -1;
}
@ -563,7 +563,7 @@ static int lxcContainerResolveSymlinks(virDomainFSDef *fs, bool gentle)
return 0;
} else {
virReportSystemError(errno,
_("Failed to access '%s'"), fs->src->path);
_("Failed to access '%1$s'"), fs->src->path);
return -1;
}
}
@ -575,7 +575,7 @@ static int lxcContainerResolveSymlinks(virDomainFSDef *fs, bool gentle)
return 0;
} else {
virReportSystemError(errno,
_("Failed to resolve symlink at %s"),
_("Failed to resolve symlink at %1$s"),
fs->src->path);
}
return -1;
@ -612,7 +612,7 @@ static int lxcContainerPrepareRoot(virDomainDef *def,
if (root->type != VIR_DOMAIN_FS_TYPE_BLOCK) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported root filesystem type %s"),
_("Unsupported root filesystem type %1$s"),
virDomainFSTypeToString(root->type));
return -1;
}
@ -656,7 +656,7 @@ static int lxcContainerPivotRoot(virDomainFSDef *root)
if (g_mkdir_with_parents(oldroot, 0777) < 0) {
virReportSystemError(errno,
_("Failed to create %s"),
_("Failed to create %1$s"),
oldroot);
return -1;
}
@ -665,7 +665,7 @@ static int lxcContainerPivotRoot(virDomainFSDef *root)
* on separate filesystems */
if (mount("tmprootfs", oldroot, "tmpfs", 0, NULL) < 0) {
virReportSystemError(errno,
_("Failed to mount empty tmpfs at %s"),
_("Failed to mount empty tmpfs at %1$s"),
oldroot);
return -1;
}
@ -675,7 +675,7 @@ static int lxcContainerPivotRoot(virDomainFSDef *root)
if (g_mkdir_with_parents(newroot, 0777) < 0) {
virReportSystemError(errno,
_("Failed to create %s"),
_("Failed to create %1$s"),
newroot);
return -1;
}
@ -683,7 +683,7 @@ static int lxcContainerPivotRoot(virDomainFSDef *root)
/* ... and mount our root onto it */
if (mount(root->src->path, newroot, "none", MS_BIND|MS_REC, NULL) < 0) {
virReportSystemError(errno,
_("Failed to bind %s to new root %s"),
_("Failed to bind %1$s to new root %2$s"),
root->src->path, newroot);
return -1;
}
@ -691,7 +691,7 @@ static int lxcContainerPivotRoot(virDomainFSDef *root)
if (root->readonly) {
if (mount(root->src->path, newroot, "none", MS_BIND|MS_REC|MS_RDONLY|MS_REMOUNT, NULL) < 0) {
virReportSystemError(errno,
_("Failed to make new root %s readonly"),
_("Failed to make new root %1$s readonly"),
root->src->path);
return -1;
}
@ -701,7 +701,7 @@ static int lxcContainerPivotRoot(virDomainFSDef *root)
* root->src bind-mounted onto '/new' */
if (chdir(newroot) < 0) {
virReportSystemError(errno,
_("Failed to chdir into %s"), newroot);
_("Failed to chdir into %1$s"), newroot);
return -1;
}
@ -800,7 +800,7 @@ static int lxcContainerSetReadOnly(void)
VIR_DEBUG("Bind readonly %s", mounts[i]);
if (mount(mounts[i], mounts[i], "none", MS_BIND|MS_REC|MS_RDONLY|MS_REMOUNT, NULL) < 0) {
virReportSystemError(errno,
_("Failed to make mount %s readonly"),
_("Failed to make mount %1$s readonly"),
mounts[i]);
return -1;
}
@ -874,7 +874,7 @@ static int lxcContainerMountBasicFS(bool userns_enabled,
if (g_mkdir_with_parents(mnt->dst, 0777) < 0) {
virReportSystemError(errno,
_("Failed to mkdir %s"),
_("Failed to mkdir %1$s"),
mnt->dst);
return -1;
}
@ -892,7 +892,7 @@ static int lxcContainerMountBasicFS(bool userns_enabled,
mnt_src, mnt->dst, mnt->type, mnt_mflags & ~MS_RDONLY);
if (mount(mnt_src, mnt->dst, mnt->type, mnt_mflags & ~MS_RDONLY, NULL) < 0) {
virReportSystemError(errno,
_("Failed to mount %s on %s type %s flags=0x%x"),
_("Failed to mount %1$s on %2$s type %3$s flags=0x%4$x"),
mnt_src, mnt->dst, NULLSTR(mnt->type),
mnt_mflags & ~MS_RDONLY);
return -1;
@ -902,7 +902,7 @@ static int lxcContainerMountBasicFS(bool userns_enabled,
mount(mnt_src, mnt->dst, "none",
MS_BIND|MS_REMOUNT|mnt_mflags|MS_RDONLY, NULL) < 0) {
virReportSystemError(errno,
_("Failed to re-mount %s on %s flags=0x%x"),
_("Failed to re-mount %1$s on %2$s flags=0x%3$x"),
mnt_src, mnt->dst,
MS_BIND|MS_REMOUNT|MS_RDONLY);
return -1;
@ -927,7 +927,7 @@ static int lxcContainerMountProcFuse(virDomainDef *def,
if (mount(meminfo_path, "/proc/meminfo",
NULL, MS_BIND, NULL) < 0) {
virReportSystemError(errno,
_("Failed to mount %s on /proc/meminfo"),
_("Failed to mount %1$s on /proc/meminfo"),
meminfo_path);
return -1;
}
@ -963,7 +963,7 @@ static int lxcContainerMountFSDev(virDomainDef *def,
if (mount(path, "/dev", "none", flags, NULL) < 0) {
virReportSystemError(errno,
_("Failed to mount %s on /dev"),
_("Failed to mount %1$s on /dev"),
path);
return -1;
}
@ -992,7 +992,7 @@ static int lxcContainerMountFSDevPTS(virDomainDef *def,
if (mount(path, "/dev/pts", "none", flags, NULL) < 0) {
virReportSystemError(errno,
_("Failed to mount %s on /dev/pts"),
_("Failed to mount %1$s on /dev/pts"),
path);
return -1;
}
@ -1016,7 +1016,7 @@ static int lxcContainerSetupDevices(char **ttyPaths, size_t nttyPaths)
for (i = 0; i < G_N_ELEMENTS(links); i++) {
if (symlink(links[i].src, links[i].dst) < 0) {
virReportSystemError(errno,
_("Failed to symlink device %s to %s"),
_("Failed to symlink device %1$s to %2$s"),
links[i].dst, links[i].src);
return -1;
}
@ -1052,20 +1052,20 @@ static int lxcContainerMountFSBind(virDomainFSDef *fs,
if (stat(fs->dst, &st) < 0) {
if (errno != ENOENT) {
virReportSystemError(errno, _("Unable to stat bind target %s"),
virReportSystemError(errno, _("Unable to stat bind target %1$s"),
fs->dst);
return -1;
}
/* ENOENT => create the target dir or file */
if (stat(src, &st) < 0) {
virReportSystemError(errno, _("Unable to stat bind source %s"),
virReportSystemError(errno, _("Unable to stat bind source %1$s"),
src);
return -1;
}
if (S_ISDIR(st.st_mode)) {
if (g_mkdir_with_parents(fs->dst, 0777) < 0) {
virReportSystemError(errno,
_("Failed to create %s"),
_("Failed to create %1$s"),
fs->dst);
return -1;
}
@ -1075,14 +1075,14 @@ static int lxcContainerMountFSBind(virDomainFSDef *fs,
if (fd < 0) {
if (errno != EEXIST) {
virReportSystemError(errno,
_("Failed to create bind target %s"),
_("Failed to create bind target %1$s"),
fs->dst);
return -1;
}
}
if (VIR_CLOSE(fd) < 0) {
virReportSystemError(errno,
_("Failed to close bind target %s"),
_("Failed to close bind target %1$s"),
fs->dst);
return -1;
}
@ -1091,7 +1091,7 @@ static int lxcContainerMountFSBind(virDomainFSDef *fs,
if (mount(src, fs->dst, "none", MS_BIND, NULL) < 0) {
virReportSystemError(errno,
_("Failed to bind mount directory %s to %s"),
_("Failed to bind mount directory %1$s to %2$s"),
src, fs->dst);
return -1;
}
@ -1100,7 +1100,7 @@ static int lxcContainerMountFSBind(virDomainFSDef *fs,
VIR_DEBUG("Binding %s readonly", fs->dst);
if (mount(src, fs->dst, "none", MS_BIND|MS_REMOUNT|MS_RDONLY, NULL) < 0) {
virReportSystemError(errno,
_("Failed to make directory %s readonly"),
_("Failed to make directory %1$s readonly"),
fs->dst);
}
}
@ -1123,7 +1123,7 @@ lxcContainerMountDetectFilesystem(const char *src, char **type)
if ((fd = open(src, O_RDONLY)) < 0) {
virReportSystemError(errno,
_("Unable to open filesystem %s"), src);
_("Unable to open filesystem %1$s"), src);
return -1;
}
@ -1134,7 +1134,7 @@ lxcContainerMountDetectFilesystem(const char *src, char **type)
}
if (blkid_probe_set_device(blkid, fd, 0, 0) < 0) {
virReportSystemError(EINVAL,
_("Unable to associate device %s with blkid library"),
_("Unable to associate device %1$s with blkid library"),
src);
goto cleanup;
}
@ -1150,11 +1150,11 @@ lxcContainerMountDetectFilesystem(const char *src, char **type)
if (rc == -2) {
virReportSystemError(EINVAL,
_("Too many filesystems detected for %s"),
_("Too many filesystems detected for %1$s"),
src);
} else {
virReportSystemError(errno,
_("Unable to detect filesystem for %s"),
_("Unable to detect filesystem for %1$s"),
src);
}
goto cleanup;
@ -1162,7 +1162,7 @@ lxcContainerMountDetectFilesystem(const char *src, char **type)
if (blkid_probe_lookup_value(blkid, "TYPE", &data, NULL) < 0) {
virReportSystemError(ENOENT,
_("Unable to find filesystem type for %s"),
_("Unable to find filesystem type for %1$s"),
src);
goto cleanup;
}
@ -1229,7 +1229,7 @@ static int lxcContainerMountFSBlockAuto(virDomainFSDef *fs,
}
virReportSystemError(errno,
_("Unable to read %s"),
_("Unable to read %1$s"),
fslist);
goto cleanup;
}
@ -1259,7 +1259,7 @@ static int lxcContainerMountFSBlockAuto(virDomainFSDef *fs,
*/
if (gotStar && !tryProc) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("%s has unexpected '*' before last line"),
_("%1$s has unexpected '*' before last line"),
fslist);
goto cleanup;
}
@ -1283,7 +1283,7 @@ static int lxcContainerMountFSBlockAuto(virDomainFSDef *fs,
continue;
virReportSystemError(errno,
_("Failed to mount device %s to %s"),
_("Failed to mount device %1$s to %2$s"),
src, fs->dst);
goto cleanup;
}
@ -1305,7 +1305,7 @@ static int lxcContainerMountFSBlockAuto(virDomainFSDef *fs,
if (ret != 0) {
virReportSystemError(ENODEV,
_("Failed to mount device %s to %s, unable to detect filesystem"),
_("Failed to mount device %1$s to %2$s, unable to detect filesystem"),
src, fs->dst);
}
@ -1334,7 +1334,7 @@ static int lxcContainerMountFSBlockHelper(virDomainFSDef *fs,
if (g_mkdir_with_parents(fs->dst, 0777) < 0) {
virReportSystemError(errno,
_("Failed to create %s"),
_("Failed to create %1$s"),
fs->dst);
return -1;
}
@ -1347,7 +1347,7 @@ static int lxcContainerMountFSBlockHelper(virDomainFSDef *fs,
src, fs->dst, format, sec_mount_options);
if (mount(src, fs->dst, format, fsflags, sec_mount_options) < 0) {
virReportSystemError(errno,
_("Failed to mount device %s to %s as %s"),
_("Failed to mount device %1$s to %2$s as %3$s"),
src, fs->dst, format);
return -1;
}
@ -1388,14 +1388,14 @@ static int lxcContainerMountFSTmpfs(virDomainFSDef *fs,
if (g_mkdir_with_parents(fs->dst, 0777) < 0) {
virReportSystemError(errno,
_("Failed to create %s"),
_("Failed to create %1$s"),
fs->dst);
return -1;
}
if (mount("tmpfs", fs->dst, "tmpfs", MS_NOSUID|MS_NODEV, data) < 0) {
virReportSystemError(errno,
_("Failed to mount directory %s as tmpfs"),
_("Failed to mount directory %1$s as tmpfs"),
fs->dst);
return -1;
}
@ -1404,7 +1404,7 @@ static int lxcContainerMountFSTmpfs(virDomainFSDef *fs,
VIR_DEBUG("Binding %s readonly", fs->dst);
if (mount(fs->dst, fs->dst, "none", MS_BIND|MS_REMOUNT|MS_RDONLY, NULL) < 0) {
virReportSystemError(errno,
_("Failed to make directory %s readonly"),
_("Failed to make directory %1$s readonly"),
fs->dst);
return -1;
}
@ -1439,7 +1439,7 @@ static int lxcContainerMountFS(virDomainFSDef *fs,
* should have associated the file with a loopback
* device and changed this to TYPE_BLOCK for us */
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unexpected filesystem type %s"),
_("Unexpected filesystem type %1$s"),
virDomainFSTypeToString(fs->type));
return -1;
case VIR_DOMAIN_FS_TYPE_TEMPLATE:
@ -1447,7 +1447,7 @@ static int lxcContainerMountFS(virDomainFSDef *fs,
case VIR_DOMAIN_FS_TYPE_LAST:
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Cannot mount filesystem type %s"),
_("Cannot mount filesystem type %1$s"),
virDomainFSTypeToString(fs->type));
return -1;
}
@ -1496,7 +1496,7 @@ int lxcContainerSetupHostdevCapsMakePath(const char *dev)
*tmp = '\0';
if (g_mkdir_with_parents(dir, 0777) < 0) {
virReportSystemError(errno,
_("Failed to create directory for '%s' dev '%s'"),
_("Failed to create directory for '%1$s' dev '%2$s'"),
dir, dev);
return -1;
}
@ -1747,7 +1747,7 @@ static int lxcContainerDropCapabilities(virDomainDef *def,
CAPNG_INHERITABLE | CAPNG_BOUNDING_SET,
capsMapping[i])) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to add capability %s: %d"),
_("Failed to add capability %1$s: %2$d"),
virDomainProcessCapsFeatureTypeToString(i), ret);
return -1;
}
@ -1779,7 +1779,7 @@ static int lxcContainerDropCapabilities(virDomainDef *def,
CAPNG_INHERITABLE | CAPNG_BOUNDING_SET,
capsMapping[i])) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to remove capability %s: %d"),
_("Failed to remove capability %1$s: %2$d"),
virDomainProcessCapsFeatureTypeToString(i), ret);
return -1;
}
@ -1794,7 +1794,7 @@ static int lxcContainerDropCapabilities(virDomainDef *def,
if ((ret = capng_apply(CAPNG_SELECT_BOTH)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to apply capabilities: %d"), ret);
_("Failed to apply capabilities: %1$d"), ret);
return -1;
}
@ -1850,7 +1850,7 @@ static int lxcContainerSetUserGroup(virCommand *cmd,
if (vmDef->os.inituser) {
if (virGetUserID(vmDef->os.inituser, &uid) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, _("User %s doesn't exist"),
virReportError(VIR_ERR_INTERNAL_ERROR, _("User %1$s doesn't exist"),
vmDef->os.inituser);
return -1;
}
@ -1860,7 +1860,7 @@ static int lxcContainerSetUserGroup(virCommand *cmd,
* shells to have job control. */
if (chown(ttyPath, uid, -1) < 0) {
virReportSystemError(errno,
_("Failed to change ownership of tty %s"),
_("Failed to change ownership of tty %1$s"),
ttyPath);
return -1;
}
@ -1868,7 +1868,7 @@ static int lxcContainerSetUserGroup(virCommand *cmd,
if (vmDef->os.initgroup) {
if (virGetGroupID(vmDef->os.initgroup, &gid) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, _("Group %s doesn't exist"),
virReportError(VIR_ERR_INTERNAL_ERROR, _("Group %1$s doesn't exist"),
vmDef->os.initgroup);
return -1;
}
@ -1982,7 +1982,7 @@ static int lxcContainerChild(void *data)
ttyfd = open(ttyPath, O_RDWR);
if (ttyfd < 0) {
virReportSystemError(errno,
_("Failed to open tty %s"),
_("Failed to open tty %1$s"),
ttyPath);
goto cleanup;
}
@ -1998,7 +1998,7 @@ static int lxcContainerChild(void *data)
if (!virFileExists(vmDef->os.init)) {
virReportSystemError(errno,
_("cannot find init path '%s' relative to container root"),
_("cannot find init path '%1$s' relative to container root"),
vmDef->os.init);
goto cleanup;
}
@ -2069,7 +2069,7 @@ static int lxcContainerChild(void *data)
if (ret != 0) {
VIR_DEBUG("Tearing down container");
fprintf(stderr,
_("Failure in libvirt_lxc startup: %s\n"),
_("Failure in libvirt_lxc startup: %1$s\n"),
virGetLastErrorMessage());
}
@ -2218,7 +2218,7 @@ int lxcContainerChown(virDomainDef *def, const char *path)
if (chown(path, uid, gid) < 0) {
virReportSystemError(errno,
_("Failed to change owner of %s to %u:%u"),
_("Failed to change owner of %1$s to %2$u:%3$u"),
path, uid, gid);
return -1;
}

View File

@ -367,7 +367,7 @@ static int virLXCControllerValidateNICs(virLXCController *ctrl)
{
if (ctrl->def->nnets != ctrl->nveths) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("expecting %zu veths, but got %zu"),
_("expecting %1$zu veths, but got %2$zu"),
ctrl->def->nnets, ctrl->nveths);
return -1;
}
@ -425,7 +425,7 @@ static int virLXCControllerGetNICIndexes(virLXCController *ctrl)
case VIR_DOMAIN_NET_TYPE_NULL:
case VIR_DOMAIN_NET_TYPE_VDS:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported net type %s"),
_("Unsupported net type %1$s"),
virDomainNetTypeToString(actualType));
return -1;
case VIR_DOMAIN_NET_TYPE_LAST:
@ -443,7 +443,7 @@ static int virLXCControllerValidateConsoles(virLXCController *ctrl)
{
if (ctrl->def->nconsoles != ctrl->nconsoles) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("expecting %zu consoles, but got %zu tty file handlers"),
_("expecting %1$zu consoles, but got %2$zu tty file handlers"),
ctrl->def->nconsoles, ctrl->nconsoles);
return -1;
}
@ -581,7 +581,7 @@ static int virLXCControllerAppendNBDPids(virLXCController *ctrl,
loops++;
} else {
virReportSystemError(errno,
_("Cannot check NBD device %s pid"),
_("Cannot check NBD device %1$s pid"),
dev + 5);
return -1;
}
@ -625,7 +625,7 @@ static int virLXCControllerSetupLoopDevices(virLXCController *ctrl)
if (fs->format != VIR_STORAGE_FILE_RAW &&
fs->format != VIR_STORAGE_FILE_NONE) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("fs format %s is not supported"),
_("fs format %1$s is not supported"),
virStorageFileFormatTypeToString(fs->format));
return -1;
}
@ -648,7 +648,7 @@ static int virLXCControllerSetupLoopDevices(virLXCController *ctrl)
return -1;
} else {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("fs driver %s is not supported"),
_("fs driver %1$s is not supported"),
virDomainFSDriverTypeToString(fs->fsdriver));
return -1;
}
@ -676,7 +676,7 @@ static int virLXCControllerSetupLoopDevices(virLXCController *ctrl)
if (format != VIR_STORAGE_FILE_RAW &&
format != VIR_STORAGE_FILE_NONE) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("disk format %s is not supported"),
_("disk format %1$s is not supported"),
virStorageFileFormatTypeToString(format));
return -1;
}
@ -696,7 +696,7 @@ static int virLXCControllerSetupLoopDevices(virLXCController *ctrl)
if (disk->cachemode != VIR_DOMAIN_DISK_CACHE_DEFAULT &&
disk->cachemode != VIR_DOMAIN_DISK_CACHE_DISABLE) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Disk cache mode %s is not supported"),
_("Disk cache mode %1$s is not supported"),
virDomainDiskCacheTypeToString(disk->cachemode));
return -1;
}
@ -710,7 +710,7 @@ static int virLXCControllerSetupLoopDevices(virLXCController *ctrl)
return -1;
} else {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("disk driver %s is not supported"),
_("disk driver %1$s is not supported"),
driver);
return -1;
}
@ -981,7 +981,7 @@ static int lxcControllerClearCapabilities(void)
if ((ret = capng_apply(CAPNG_SELECT_BOTH)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to apply capabilities: %d"), ret);
_("failed to apply capabilities: %1$d"), ret);
return -1;
}
#else
@ -1366,7 +1366,7 @@ virLXCControllerSetupUsernsMap(virDomainIdMapEntry *map,
VIR_DEBUG("Set '%s' to '%s'", path, virBufferCurrentContent(&map_value));
if (virFileWriteStr(path, virBufferCurrentContent(&map_value), 0) < 0) {
virReportSystemError(errno, _("unable write to %s"), path);
virReportSystemError(errno, _("unable write to %1$s"), path);
return -1;
}
@ -1470,7 +1470,7 @@ static int virLXCControllerPopulateDevices(virLXCController *ctrl)
if (mknod(path, S_IFCHR, dev) < 0 ||
chmod(path, devs[i].mode)) {
virReportSystemError(errno,
_("Failed to make device %s"),
_("Failed to make device %1$s"),
path);
return -1;
}
@ -1513,7 +1513,7 @@ virLXCControllerSetupTimers(virLXCController *ctrl)
case VIR_DOMAIN_TIMER_NAME_ARMVTIMER:
case VIR_DOMAIN_TIMER_NAME_LAST:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unsupported timer type (name) '%s'"),
_("unsupported timer type (name) '%1$s'"),
virDomainTimerNameTypeToString(timer->name));
return -1;
case VIR_DOMAIN_TIMER_NAME_RTC:
@ -1532,7 +1532,7 @@ virLXCControllerSetupTimers(virLXCController *ctrl)
continue;
if (stat(timer_dev, &sb) < 0) {
virReportSystemError(errno, _("Unable to access %s"),
virReportSystemError(errno, _("Unable to access %1$s"),
timer_dev);
return -1;
}
@ -1541,7 +1541,7 @@ virLXCControllerSetupTimers(virLXCController *ctrl)
if (mknod(path, S_IFCHR, dev) < 0 ||
chmod(path, sb.st_mode)) {
virReportSystemError(errno,
_("Failed to make device %s"),
_("Failed to make device %1$s"),
path);
return -1;
}
@ -1577,13 +1577,13 @@ virLXCControllerSetupHostdevSubsysUSB(virDomainDef *vmDef,
if (stat(src, &sb) < 0) {
virReportSystemError(errno,
_("Unable to access %s"), src);
_("Unable to access %1$s"), src);
return -1;
}
if (!S_ISCHR(sb.st_mode)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("USB source %s was not a character device"),
_("USB source %1$s was not a character device"),
src);
return -1;
}
@ -1592,7 +1592,7 @@ virLXCControllerSetupHostdevSubsysUSB(virDomainDef *vmDef,
if (g_mkdir_with_parents(dstdir, 0777) < 0) {
virReportSystemError(errno,
_("Unable to create %s"), dstdir);
_("Unable to create %1$s"), dstdir);
return -1;
}
@ -1600,7 +1600,7 @@ virLXCControllerSetupHostdevSubsysUSB(virDomainDef *vmDef,
dstfile, major(sb.st_rdev), minor(sb.st_rdev));
if (mknod(dstfile, mode, sb.st_rdev) < 0) {
virReportSystemError(errno,
_("Unable to create device %s"),
_("Unable to create device %1$s"),
dstfile);
return -1;
}
@ -1645,21 +1645,21 @@ virLXCControllerSetupHostdevCapsStorage(virDomainDef *vmDef,
if (stat(dev, &sb) < 0) {
virReportSystemError(errno,
_("Unable to access %s"),
_("Unable to access %1$s"),
dev);
goto cleanup;
}
if (!S_ISBLK(sb.st_mode)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Storage source %s must be a block device"),
_("Storage source %1$s must be a block device"),
dev);
goto cleanup;
}
if (lxcContainerSetupHostdevCapsMakePath(dst) < 0) {
virReportError(errno,
_("Failed to create directory for device %s"),
_("Failed to create directory for device %1$s"),
dev);
goto cleanup;
}
@ -1670,7 +1670,7 @@ virLXCControllerSetupHostdevCapsStorage(virDomainDef *vmDef,
major(sb.st_rdev), minor(sb.st_rdev));
if (mknod(dst, mode, sb.st_rdev) < 0) {
virReportSystemError(errno,
_("Unable to create device %s"),
_("Unable to create device %1$s"),
dst);
goto cleanup;
}
@ -1719,21 +1719,21 @@ virLXCControllerSetupHostdevCapsMisc(virDomainDef *vmDef,
if (stat(dev, &sb) < 0) {
virReportSystemError(errno,
_("Unable to access %s"),
_("Unable to access %1$s"),
dev);
goto cleanup;
}
if (!S_ISCHR(sb.st_mode)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Storage source %s must be a character device"),
_("Storage source %1$s must be a character device"),
dev);
goto cleanup;
}
if (lxcContainerSetupHostdevCapsMakePath(dst) < 0) {
virReportError(errno,
_("Failed to create directory for device %s"),
_("Failed to create directory for device %1$s"),
dst);
goto cleanup;
}
@ -1744,7 +1744,7 @@ virLXCControllerSetupHostdevCapsMisc(virDomainDef *vmDef,
major(sb.st_rdev), minor(sb.st_rdev));
if (mknod(dst, mode, sb.st_rdev) < 0) {
virReportSystemError(errno,
_("Unable to create device %s"),
_("Unable to create device %1$s"),
dev);
goto cleanup;
}
@ -1776,7 +1776,7 @@ virLXCControllerSetupHostdevSubsys(virDomainDef *vmDef,
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported host device mode %s"),
_("Unsupported host device mode %1$s"),
virDomainHostdevSubsysTypeToString(def->source.subsys.type));
return -1;
}
@ -1804,7 +1804,7 @@ virLXCControllerSetupHostdevCaps(virDomainDef *vmDef,
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported host device mode %s"),
_("Unsupported host device mode %1$s"),
virDomainHostdevCapsTypeToString(def->source.subsys.type));
return -1;
}
@ -1836,7 +1836,7 @@ virLXCControllerSetupAllHostdevs(virLXCController *ctrl)
break;
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported host device mode %s"),
_("Unsupported host device mode %1$s"),
virDomainHostdevModeTypeToString(def->mode));
return -1;
}
@ -1873,13 +1873,13 @@ static int virLXCControllerSetupDisk(virLXCController *ctrl,
if (stat(def->src->path, &sb) < 0) {
virReportSystemError(errno,
_("Unable to access %s"), tmpsrc);
_("Unable to access %1$s"), tmpsrc);
goto cleanup;
}
if (!S_ISCHR(sb.st_mode) && !S_ISBLK(sb.st_mode)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Disk source %s must be a character/block device"),
_("Disk source %1$s must be a character/block device"),
tmpsrc);
goto cleanup;
}
@ -1901,7 +1901,7 @@ static int virLXCControllerSetupDisk(virLXCController *ctrl,
dst, major(sb.st_rdev), minor(sb.st_rdev), tmpsrc);
if (mknod(dst, mode, sb.st_rdev) < 0) {
virReportSystemError(errno,
_("Unable to create device %s"),
_("Unable to create device %1$s"),
dst);
goto cleanup;
}
@ -2013,7 +2013,7 @@ static int lxcSetPersonality(virDomainDef *def)
VIR_DEBUG("Setting personality to %s",
virArchToString(altArch));
if (personality(PER_LINUX32) < 0) {
virReportSystemError(errno, _("Unable to request personality for %s on %s"),
virReportSystemError(errno, _("Unable to request personality for %1$s on %2$s"),
virArchToString(altArch),
virArchToString(virArchFromHost()));
return -1;
@ -2111,7 +2111,7 @@ virLXCControllerSetupDevPTS(virLXCController *ctrl)
if (g_mkdir_with_parents(devpts, 0777) < 0) {
virReportSystemError(errno,
_("Failed to make path %s"),
_("Failed to make path %1$s"),
devpts);
return -1;
}
@ -2130,7 +2130,7 @@ virLXCControllerSetupDevPTS(virLXCController *ctrl)
devpts, MS_NOSUID, opts);
if (mount("devpts", devpts, "devpts", MS_NOSUID, opts) < 0) {
virReportSystemError(errno,
_("Failed to mount devpts on %s"),
_("Failed to mount devpts on %1$s"),
devpts);
return -1;
}
@ -2488,7 +2488,7 @@ int main(int argc, char *argv[])
if (virGettextInitialize() < 0 ||
virErrorInitialize() < 0) {
fprintf(stderr, _("%s: initialization failed\n"), argv[0]);
fprintf(stderr, _("%1$s: initialization failed\n"), argv[0]);
exit(EXIT_FAILURE);
}
@ -2673,7 +2673,7 @@ int main(int argc, char *argv[])
if (pid > 0) {
if ((rc = virPidFileWrite(LXC_STATE_DIR, name, pid)) < 0) {
virReportSystemError(-rc,
_("Unable to write pid file '%s/%s.pid'"),
_("Unable to write pid file '%1$s/%2$s.pid'"),
LXC_STATE_DIR, name);
_exit(1);
}
@ -2703,7 +2703,7 @@ int main(int argc, char *argv[])
cleanup:
if (rc < 0) {
fprintf(stderr,
_("Failure in libvirt_lxc startup: %s\n"),
_("Failure in libvirt_lxc startup: %1$s\n"),
virGetLastErrorMessage());
}

View File

@ -112,7 +112,7 @@ lxcDomainDefNamespaceParse(xmlXPathContextPtr ctxt,
if ((feature = virLXCDomainNamespaceTypeFromString(
(const char *)nodes[i]->name)) < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unsupported Namespace feature: %s"),
_("unsupported Namespace feature: %1$s"),
nodes[i]->name);
goto cleanup;
}
@ -127,7 +127,7 @@ lxcDomainDefNamespaceParse(xmlXPathContextPtr ctxt,
if ((lxcDef->ns_source[feature] =
virLXCDomainNamespaceSourceTypeFromString(tmp)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown LXC namespace source '%s'"),
_("Unknown LXC namespace source '%1$s'"),
tmp);
goto cleanup;
}
@ -313,7 +313,7 @@ lxcDomainInitctlCallback(pid_t pid G_GNUC_UNUSED,
if (errno == ENOENT)
continue;
virReportSystemError(errno, _("Unable to stat %s"), fifo);
virReportSystemError(errno, _("Unable to stat %1$s"), fifo);
return -1;
}
@ -361,7 +361,7 @@ virLXCDomainSetRunlevel(virDomainObj *vm,
if (errno == ENOENT)
continue;
virReportSystemError(errno, _("Unable to stat %s"), fifo);
virReportSystemError(errno, _("Unable to stat %1$s"), fifo);
goto cleanup;
}

View File

@ -104,7 +104,7 @@ lxcDomObjFromDomain(virDomainPtr domain)
if (!vm) {
virUUIDFormat(domain->uuid, uuidstr);
virReportError(VIR_ERR_NO_DOMAIN,
_("no domain with matching uuid '%s' (%s)"),
_("no domain with matching uuid '%1$s' (%2$s)"),
uuidstr, domain->name);
return NULL;
}
@ -137,7 +137,7 @@ static virDrvOpenStatus lxcConnectOpen(virConnectPtr conn,
STRNEQ(conn->uri->path, "/") &&
STRNEQ(conn->uri->path, "/system")) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unexpected LXC URI path '%s', try lxc:///system"),
_("Unexpected LXC URI path '%1$s', try lxc:///system"),
conn->uri->path);
return VIR_DRV_OPEN_ERROR;
}
@ -216,7 +216,7 @@ static virDomainPtr lxcDomainLookupByID(virConnectPtr conn,
if (!vm) {
virReportError(VIR_ERR_NO_DOMAIN,
_("No domain with matching id %d"), id);
_("No domain with matching id %1$d"), id);
goto cleanup;
}
@ -243,7 +243,7 @@ static virDomainPtr lxcDomainLookupByUUID(virConnectPtr conn,
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(uuid, uuidstr);
virReportError(VIR_ERR_NO_DOMAIN,
_("No domain with matching uuid '%s'"), uuidstr);
_("No domain with matching uuid '%1$s'"), uuidstr);
goto cleanup;
}
@ -267,7 +267,7 @@ static virDomainPtr lxcDomainLookupByName(virConnectPtr conn,
vm = virDomainObjListFindByName(driver->domains, name);
if (!vm) {
virReportError(VIR_ERR_NO_DOMAIN,
_("No domain with matching name '%s'"), name);
_("No domain with matching name '%1$s'"), name);
goto cleanup;
}
@ -932,7 +932,7 @@ static char *lxcConnectDomainXMLFromNative(virConnectPtr conn,
if (STRNEQ(nativeFormat, LXC_CONFIG_FORMAT)) {
virReportError(VIR_ERR_INVALID_ARG,
_("unsupported config type %s"), nativeFormat);
_("unsupported config type %1$s"), nativeFormat);
return NULL;
}
@ -1223,7 +1223,7 @@ static int lxcNodeGetSecurityModel(virConnectPtr conn,
if (virStrcpy(secmodel->model, caps->host.secModels[0].model,
VIR_SECURITY_MODEL_BUFLEN) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("security model string exceeds max %d bytes"),
_("security model string exceeds max %1$d bytes"),
VIR_SECURITY_MODEL_BUFLEN - 1);
return -1;
}
@ -1231,7 +1231,7 @@ static int lxcNodeGetSecurityModel(virConnectPtr conn,
if (virStrcpy(secmodel->doi, caps->host.secModels[0].doi,
VIR_SECURITY_DOI_BUFLEN) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("security DOI string exceeds max %d bytes"),
_("security DOI string exceeds max %1$d bytes"),
VIR_SECURITY_DOI_BUFLEN-1);
return -1;
}
@ -1499,7 +1499,7 @@ static int lxcStateInitialize(bool privileged,
if (g_mkdir_with_parents(cfg->stateDir, 0777) < 0) {
virReportSystemError(errno,
_("Failed to mkdir %s"),
_("Failed to mkdir %1$s"),
cfg->stateDir);
goto cleanup;
}
@ -1621,7 +1621,7 @@ lxcConnectSupportsFeature(virConnectPtr conn, int feature)
case VIR_DRV_FEATURE_NETWORK_UPDATE_HAS_CORRECT_ORDER:
case VIR_DRV_FEATURE_FD_PASSING:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Global feature %d should have already been handled"),
_("Global feature %1$d should have already been handled"),
feature);
return -1;
case VIR_DRV_FEATURE_MIGRATE_CHANGE_PROTECTION:
@ -1649,7 +1649,7 @@ static int lxcConnectGetVersion(virConnectPtr conn, unsigned long *version)
return -1;
if (virStringParseVersion(version, ver.release, true) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown release: %s"), ver.release);
virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown release: %1$s"), ver.release);
return -1;
}
@ -1688,7 +1688,7 @@ lxcDomainInterfaceAddresses(virDomainPtr dom,
default:
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
_("Unknown IP address data source %d"),
_("Unknown IP address data source %1$d"),
source);
break;
}
@ -2051,13 +2051,13 @@ lxcDomainBlockStats(virDomainPtr dom,
if (!(disk = virDomainDiskByName(vm->def, path, false))) {
virReportError(VIR_ERR_INVALID_ARG,
_("invalid path: %s"), path);
_("invalid path: %1$s"), path);
goto endjob;
}
if (!disk->info.alias) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("missing disk device alias name for %s"), disk->dst);
_("missing disk device alias name for %1$s"), disk->dst);
goto endjob;
}
@ -2135,13 +2135,13 @@ lxcDomainBlockStatsFlags(virDomainPtr dom,
} else {
if (!(disk = virDomainDiskByName(vm->def, path, false))) {
virReportError(VIR_ERR_INVALID_ARG,
_("invalid path: %s"), path);
_("invalid path: %1$s"), path);
goto endjob;
}
if (!disk->info.alias) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("missing disk device alias name for %s"), disk->dst);
_("missing disk device alias name for %1$s"), disk->dst);
goto endjob;
}
@ -2474,21 +2474,21 @@ static int lxcDomainSetAutostart(virDomainPtr dom,
if (autostart) {
if (g_mkdir_with_parents(cfg->autostartDir, 0777) < 0) {
virReportSystemError(errno,
_("Cannot create autostart directory %s"),
_("Cannot create autostart directory %1$s"),
cfg->autostartDir);
goto endjob;
}
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 endjob;
}
} else {
if (unlink(autostartLink) < 0 && errno != ENOENT && errno != ENOTDIR) {
virReportSystemError(errno,
_("Failed to delete symlink '%s'"),
_("Failed to delete symlink '%1$s'"),
autostartLink);
goto endjob;
}
@ -2724,14 +2724,14 @@ lxcDomainOpenConsole(virDomainPtr dom,
if (!chr) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find console device '%s'"),
_("cannot find console device '%1$s'"),
dev_name ? dev_name : _("default"));
goto cleanup;
}
if (chr->source->type != VIR_DOMAIN_CHR_TYPE_PTY) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("character device %s is not using a PTY"),
_("character device %1$s is not using a PTY"),
dev_name ? dev_name : NULLSTR(chr->info.alias));
goto cleanup;
}
@ -2762,7 +2762,7 @@ lxcDomainSendProcessSignal(virDomainPtr dom,
if (signum >= VIR_DOMAIN_PROCESS_SIGNAL_LAST) {
virReportError(VIR_ERR_INVALID_ARG,
_("signum value %d is out of range"),
_("signum value %1$d is out of range"),
signum);
return -1;
}
@ -2806,7 +2806,7 @@ lxcDomainSendProcessSignal(virDomainPtr dom,
*/
if (kill(victim, signum) < 0) {
virReportSystemError(errno,
_("Unable to send %d signal to process %d"),
_("Unable to send %1$d signal to process %2$d"),
signum, victim);
goto endjob;
}
@ -2891,7 +2891,7 @@ lxcDomainShutdownFlags(virDomainPtr dom,
if (kill(priv->initpid, SIGTERM) < 0 &&
errno != ESRCH) {
virReportSystemError(errno,
_("Unable to send SIGTERM to init pid %llu"),
_("Unable to send SIGTERM to init pid %1$llu"),
(long long)priv->initpid);
goto endjob;
}
@ -2966,7 +2966,7 @@ lxcDomainReboot(virDomainPtr dom,
if (kill(priv->initpid, SIGHUP) < 0 &&
errno != ESRCH) {
virReportSystemError(errno,
_("Unable to send SIGTERM to init pid %llu"),
_("Unable to send SIGTERM to init pid %1$llu"),
(long long)priv->initpid);
goto endjob;
}
@ -2997,7 +2997,7 @@ lxcDomainAttachDeviceConfig(virDomainDef *vmdef,
disk = dev->data.disk;
if (virDomainDiskIndexByName(vmdef, disk->dst, true) >= 0) {
virReportError(VIR_ERR_INVALID_ARG,
_("target %s already exists."), disk->dst);
_("target %1$s already exists."), disk->dst);
return -1;
}
virDomainDiskInsert(vmdef, disk);
@ -3144,7 +3144,7 @@ lxcDomainDetachDeviceConfig(virDomainDef *vmdef,
disk = dev->data.disk;
if (!(det_disk = virDomainDiskRemoveByName(vmdef, disk->dst))) {
virReportError(VIR_ERR_INVALID_ARG,
_("no target device %s"), disk->dst);
_("no target device %1$s"), disk->dst);
return -1;
}
virDomainDiskDefFree(det_disk);
@ -3228,7 +3228,7 @@ lxcDomainAttachDeviceMknodHelper(pid_t pid G_GNUC_UNUSED,
if (virFileMakeParentPath(data->file) < 0) {
virReportSystemError(errno,
_("Unable to create %s"), data->file);
_("Unable to create %1$s"), data->file);
goto cleanup;
}
@ -3243,7 +3243,7 @@ lxcDomainAttachDeviceMknodHelper(pid_t pid G_GNUC_UNUSED,
data->file, major(data->dev), minor(data->dev));
if (mknod(data->file, data->mode, data->dev) < 0) {
virReportSystemError(errno,
_("Unable to create device %s"),
_("Unable to create device %1$s"),
data->file);
goto cleanup;
}
@ -3301,7 +3301,7 @@ lxcDomainAttachDeviceMknodHelper(pid_t pid G_GNUC_UNUSED,
case VIR_DOMAIN_DEVICE_AUDIO:
case VIR_DOMAIN_DEVICE_CRYPTO:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unexpected device type %d"),
_("Unexpected device type %1$d"),
data->def->type);
goto cleanup;
}
@ -3359,7 +3359,7 @@ lxcDomainAttachDeviceUnlinkHelper(pid_t pid G_GNUC_UNUSED,
VIR_DEBUG("Unlinking %s", path);
if (unlink(path) < 0 && errno != ENOENT) {
virReportSystemError(errno,
_("Unable to remove device %s"), path);
_("Unable to remove device %1$s"), path);
return -1;
}
@ -3423,19 +3423,19 @@ lxcDomainAttachDeviceDiskLive(virLXCDriver *driver,
if (virDomainDiskIndexByName(vm->def, def->dst, true) >= 0) {
virReportError(VIR_ERR_OPERATION_FAILED,
_("target %s already exists"), def->dst);
_("target %1$s already exists"), def->dst);
goto cleanup;
}
if (stat(src, &sb) < 0) {
virReportSystemError(errno,
_("Unable to access %s"), src);
_("Unable to access %1$s"), src);
goto cleanup;
}
if (!S_ISBLK(sb.st_mode)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Disk source %s must be a block device"),
_("Disk source %1$s must be a block device"),
src);
goto cleanup;
}
@ -3648,13 +3648,13 @@ lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriver *driver,
if (stat(src, &sb) < 0) {
virReportSystemError(errno,
_("Unable to access %s"), src);
_("Unable to access %1$s"), src);
goto cleanup;
}
if (!S_ISCHR(sb.st_mode)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("USB source %s was not a character device"),
_("USB source %1$s was not a character device"),
src);
goto cleanup;
}
@ -3717,14 +3717,14 @@ lxcDomainAttachDeviceHostdevStorageLive(virLXCDriver *driver,
if (stat(def->source.caps.u.storage.block, &sb) < 0) {
virReportSystemError(errno,
_("Unable to access %s"),
_("Unable to access %1$s"),
def->source.caps.u.storage.block);
goto cleanup;
}
if (!S_ISBLK(sb.st_mode)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Hostdev source %s must be a block device"),
_("Hostdev source %1$s must be a block device"),
def->source.caps.u.storage.block);
goto cleanup;
}
@ -3790,14 +3790,14 @@ lxcDomainAttachDeviceHostdevMiscLive(virLXCDriver *driver,
if (stat(def->source.caps.u.misc.chardev, &sb) < 0) {
virReportSystemError(errno,
_("Unable to access %s"),
_("Unable to access %1$s"),
def->source.caps.u.misc.chardev);
goto cleanup;
}
if (!S_ISCHR(sb.st_mode)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Hostdev source %s must be a block device"),
_("Hostdev source %1$s must be a block device"),
def->source.caps.u.misc.chardev);
goto cleanup;
}
@ -3850,7 +3850,7 @@ lxcDomainAttachDeviceHostdevSubsysLive(virLXCDriver *driver,
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported host device type %s"),
_("Unsupported host device type %1$s"),
virDomainHostdevSubsysTypeToString(dev->data.hostdev->source.subsys.type));
return -1;
}
@ -3871,7 +3871,7 @@ lxcDomainAttachDeviceHostdevCapsLive(virLXCDriver *driver,
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported host device type %s"),
_("Unsupported host device type %1$s"),
virDomainHostdevCapsTypeToString(dev->data.hostdev->source.caps.type));
return -1;
}
@ -3906,7 +3906,7 @@ lxcDomainAttachDeviceHostdevLive(virLXCDriver *driver,
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported host device mode %s"),
_("Unsupported host device mode %1$s"),
virDomainHostdevModeTypeToString(dev->data.hostdev->mode));
return -1;
}
@ -3966,7 +3966,7 @@ lxcDomainAttachDeviceLive(virLXCDriver *driver,
case VIR_DOMAIN_DEVICE_AUDIO:
case VIR_DOMAIN_DEVICE_CRYPTO:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("device type '%s' cannot be attached"),
_("device type '%1$s' cannot be attached"),
virDomainDeviceTypeToString(dev->type));
break;
}
@ -3995,7 +3995,7 @@ lxcDomainDetachDeviceDiskLive(virDomainObj *vm,
dev->data.disk->dst,
false)) < 0) {
virReportError(VIR_ERR_OPERATION_FAILED,
_("disk %s not found"), dev->data.disk->dst);
_("disk %1$s not found"), dev->data.disk->dst);
return -1;
}
@ -4193,7 +4193,7 @@ lxcDomainDetachDeviceHostdevStorageLive(virDomainObj *vm,
dev->data.hostdev,
&def)) < 0) {
virReportError(VIR_ERR_OPERATION_FAILED,
_("hostdev %s not found"),
_("hostdev %1$s not found"),
dev->data.hostdev->source.caps.u.storage.block);
return -1;
}
@ -4240,7 +4240,7 @@ lxcDomainDetachDeviceHostdevMiscLive(virDomainObj *vm,
dev->data.hostdev,
&def)) < 0) {
virReportError(VIR_ERR_OPERATION_FAILED,
_("hostdev %s not found"),
_("hostdev %1$s not found"),
dev->data.hostdev->source.caps.u.misc.chardev);
return -1;
}
@ -4280,7 +4280,7 @@ lxcDomainDetachDeviceHostdevSubsysLive(virLXCDriver *driver,
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported host device type %s"),
_("Unsupported host device type %1$s"),
virDomainHostdevSubsysTypeToString(dev->data.hostdev->source.subsys.type));
return -1;
}
@ -4300,7 +4300,7 @@ lxcDomainDetachDeviceHostdevCapsLive(virDomainObj *vm,
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported host device type %s"),
_("Unsupported host device type %1$s"),
virDomainHostdevCapsTypeToString(dev->data.hostdev->source.caps.type));
return -1;
}
@ -4329,7 +4329,7 @@ lxcDomainDetachDeviceHostdevLive(virLXCDriver *driver,
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported host device mode %s"),
_("Unsupported host device mode %1$s"),
virDomainHostdevModeTypeToString(dev->data.hostdev->mode));
return -1;
}
@ -4382,7 +4382,7 @@ lxcDomainDetachDeviceLive(virLXCDriver *driver,
case VIR_DOMAIN_DEVICE_AUDIO:
case VIR_DOMAIN_DEVICE_CRYPTO:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("device type '%s' cannot be detached"),
_("device type '%1$s' cannot be detached"),
virDomainDeviceTypeToString(dev->type));
break;
}
@ -5064,7 +5064,7 @@ lxcDomainGetHostname(virDomainPtr dom,
if (!hostname) {
virReportError(VIR_ERR_NO_HOSTNAME,
_("no hostname found for domain %s"),
_("no hostname found for domain %1$s"),
vm->def->name);
goto endjob;
}

View File

@ -208,7 +208,7 @@ lxcProcReadMeminfo(char *hostpath,
fp = fopen(hostpath, "r");
if (fp == NULL) {
virReportSystemError(errno, _("Cannot open %s"), hostpath);
virReportSystemError(errno, _("Cannot open %1$s"), hostpath);
return -errno;
}
@ -373,7 +373,7 @@ lxcSetupFuse(struct virLXCFuse **f,
fuse->mountpoint = g_strdup_printf("%s/%s.fuse/", LXC_STATE_DIR, def->name);
if (g_mkdir_with_parents(fuse->mountpoint, 0777) < 0) {
virReportSystemError(errno, _("Cannot create %s"),
virReportSystemError(errno, _("Cannot create %1$s"),
fuse->mountpoint);
goto error;
}

View File

@ -78,7 +78,7 @@ int virLXCPrepareHostDevices(virLXCDriver *driver,
break;
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported hostdev type %s"),
_("Unsupported hostdev type %1$s"),
virDomainHostdevSubsysTypeToString(dev->source.subsys.type));
return -1;
}
@ -92,7 +92,7 @@ int virLXCPrepareHostDevices(virLXCDriver *driver,
break;
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported hostdev type %s"),
_("Unsupported hostdev type %1$s"),
virDomainHostdevSubsysTypeToString(dev->source.subsys.type));
return -1;
}
@ -101,7 +101,7 @@ int virLXCPrepareHostDevices(virLXCDriver *driver,
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported hostdev mode %s"),
_("Unsupported hostdev mode %1$s"),
virDomainHostdevModeTypeToString(dev->mode));
return -1;
}

View File

@ -221,7 +221,7 @@ lxcConvertSize(const char *size, unsigned long long *value)
if (STREQ(unit, "%")) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("can't convert relative size: '%s'"),
_("can't convert relative size: '%1$s'"),
size);
return -1;
} else {
@ -233,7 +233,7 @@ lxcConvertSize(const char *size, unsigned long long *value)
error:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to convert size: '%s'"),
_("failed to convert size: '%1$s'"),
size);
return -1;
}
@ -543,7 +543,7 @@ lxcNetworkParseDataIPs(const char *name,
virStrToLong_ui(ipparts[1], NULL, 10, &ip->prefix) < 0) {
virReportError(VIR_ERR_INVALID_ARG,
_("Invalid CIDR address: '%s'"), value->str);
_("Invalid CIDR address: '%1$s'"), value->str);
return -1;
}
@ -772,7 +772,7 @@ lxcCreateConsoles(virDomainDef *def, virConf *properties)
}
if (virStrToLong_i(value, NULL, 10, &nbttys) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, _("failed to parse int: '%s'"),
virReportError(VIR_ERR_INTERNAL_ERROR, _("failed to parse int: '%1$s'"),
value);
return -1;
}
@ -815,7 +815,7 @@ lxcIdmapWalkCallback(const char *name, virConfValue *value, void *data)
if (sscanf(value->str, "%c %lu %lu %lu", &type,
&target, &start, &count) != 4) {
virReportError(VIR_ERR_INTERNAL_ERROR, _("invalid %s: '%s'"),
virReportError(VIR_ERR_INTERNAL_ERROR, _("invalid %1$s: '%2$s'"),
name, value->str);
return -1;
}
@ -903,7 +903,7 @@ lxcSetCpuTune(virDomainDef *def, virConf *properties)
error:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to parse integer: '%s'"), value);
_("failed to parse integer: '%1$s'"), value);
return -1;
}
@ -955,7 +955,7 @@ lxcBlkioDeviceWalkCallback(const char *name, virConfValue *value, void *data)
if (!parts[0] || !parts[1]) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("invalid %s value: '%s'"),
_("invalid %1$s value: '%2$s'"),
name, value->str);
return -1;
}
@ -978,34 +978,34 @@ lxcBlkioDeviceWalkCallback(const char *name, virConfValue *value, void *data)
if (STREQ(name, "lxc.cgroup.blkio.device_weight")) {
if (virStrToLong_ui(parts[1], NULL, 10, &device->weight) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to parse device weight: '%s'"), parts[1]);
_("failed to parse device weight: '%1$s'"), parts[1]);
return -1;
}
} else if (STREQ(name, "lxc.cgroup.blkio.throttle.read_bps_device")) {
if (virStrToLong_ull(parts[1], NULL, 10, &device->rbps) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to parse read_bps_device: '%s'"),
_("failed to parse read_bps_device: '%1$s'"),
parts[1]);
return -1;
}
} else if (STREQ(name, "lxc.cgroup.blkio.throttle.write_bps_device")) {
if (virStrToLong_ull(parts[1], NULL, 10, &device->wbps) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to parse write_bps_device: '%s'"),
_("failed to parse write_bps_device: '%1$s'"),
parts[1]);
return -1;
}
} else if (STREQ(name, "lxc.cgroup.blkio.throttle.read_iops_device")) {
if (virStrToLong_ui(parts[1], NULL, 10, &device->riops) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to parse read_iops_device: '%s'"),
_("failed to parse read_iops_device: '%1$s'"),
parts[1]);
return -1;
}
} else if (STREQ(name, "lxc.cgroup.blkio.throttle.write_iops_device")) {
if (virStrToLong_ui(parts[1], NULL, 10, &device->wiops) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to parse write_iops_device: '%s'"),
_("failed to parse write_iops_device: '%1$s'"),
parts[1]);
return -1;
}
@ -1025,7 +1025,7 @@ lxcSetBlkioTune(virDomainDef *def, virConf *properties)
&value) > 0) {
if (virStrToLong_ui(value, NULL, 10, &def->blkio.weight) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to parse integer: '%s'"), value);
_("failed to parse integer: '%1$s'"), value);
return -1;
}
}

View File

@ -404,7 +404,7 @@ static int virLXCProcessSetupNamespaceName(virLXCDriver *driver,
vm = virDomainObjListFindByName(driver->domains, name);
if (!vm) {
virReportError(VIR_ERR_NO_DOMAIN,
_("No domain with matching name '%s'"), name);
_("No domain with matching name '%1$s'"), name);
return -1;
}
@ -420,7 +420,7 @@ static int virLXCProcessSetupNamespaceName(virLXCDriver *driver,
if ((fd = open(path, O_RDONLY)) < 0) {
virReportSystemError(errno,
_("failed to open ns %s"),
_("failed to open ns %1$s"),
virLXCDomainNamespaceTypeToString(ns_type));
goto cleanup;
}
@ -438,7 +438,7 @@ static int virLXCProcessSetupNamespacePID(int ns_type, const char *name)
int fd = open(path, O_RDONLY);
if (fd < 0) {
virReportSystemError(errno,
_("failed to open ns %s"),
_("failed to open ns %1$s"),
virLXCDomainNamespaceTypeToString(ns_type));
return -1;
}
@ -461,7 +461,7 @@ static int virLXCProcessSetupNamespaceNet(int ns_type, const char *name)
fd = open(path, O_RDONLY);
if (fd < 0) {
virReportSystemError(errno,
_("failed to open netns %s"), name);
_("failed to open netns %1$s"), name);
return -1;
}
return fd;
@ -600,7 +600,7 @@ virLXCProcessSetupInterfaces(virLXCDriver *driver,
case VIR_DOMAIN_NET_TYPE_VDS:
case VIR_DOMAIN_NET_TYPE_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unsupported network type %s"),
_("Unsupported network type %1$s"),
virDomainNetTypeToString(type));
goto cleanup;
@ -752,7 +752,7 @@ virLXCProcessGetNsInode(pid_t pid,
if (stat(path, &sb) < 0) {
virReportSystemError(errno,
_("Unable to stat %s"), path);
_("Unable to stat %1$s"), path);
return -1;
}
@ -883,7 +883,7 @@ int virLXCProcessStop(virLXCDriver *driver,
* libvirt_lxc process */
if (virProcessKillPainfully(vm->pid, true) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Processes %d refused to die"), (int)vm->pid);
_("Processes %1$d refused to die"), (int)vm->pid);
return -1;
}
}
@ -1049,7 +1049,7 @@ virLXCProcessReadLogOutputData(virDomainObj *vm,
if (got == buflen-1) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Out of space while reading log output: %s"),
_("Out of space while reading log output: %1$s"),
buf);
return -1;
}
@ -1062,7 +1062,7 @@ virLXCProcessReadLogOutputData(virDomainObj *vm,
}
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Timed out while reading log output: %s"),
_("Timed out while reading log output: %1$s"),
buf);
return -1;
@ -1080,14 +1080,14 @@ virLXCProcessReadLogOutput(virDomainObj *vm,
if ((fd = open(logfile, O_RDONLY)) < 0) {
virReportSystemError(errno,
_("Unable to open log file %s"),
_("Unable to open log file %1$s"),
logfile);
return -1;
}
if (lseek(fd, pos, SEEK_SET) < 0) {
virReportSystemError(errno,
_("Unable to seek log file %s to %llu"),
_("Unable to seek log file %1$s to %2$llu"),
logfile, (unsigned long long)pos);
return -1;
}
@ -1127,7 +1127,7 @@ virLXCProcessReportStartupLogError(virDomainObj *vm,
return 0;
virReportError(VIR_ERR_INTERNAL_ERROR,
_("guest failed to start: %s"), errbuf);
_("guest failed to start: %1$s"), errbuf);
return -1;
}
@ -1238,7 +1238,7 @@ int virLXCProcessStart(virLXCDriver * driver,
if (g_mkdir_with_parents(cfg->logDir, 0777) < 0) {
virReportSystemError(errno,
_("Cannot create log directory '%s'"),
_("Cannot create log directory '%1$s'"),
cfg->logDir);
return -1;
}
@ -1349,7 +1349,7 @@ int virLXCProcessStart(virLXCDriver * driver,
if ((logfd = open(logfile, O_WRONLY | O_APPEND | O_CREAT,
S_IRUSR|S_IWUSR)) < 0) {
virReportSystemError(errno,
_("Failed to open '%s'"),
_("Failed to open '%1$s'"),
logfile);
goto cleanup;
}
@ -1410,7 +1410,7 @@ int virLXCProcessStart(virLXCDriver * driver,
/* In case there isn't an error in the logs report one based on the exit status */
if (WIFEXITED(status)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("guest failed to start: unexpected exit status %d"),
_("guest failed to start: unexpected exit status %1$d"),
WEXITSTATUS(status));
} else {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@ -1425,7 +1425,7 @@ int virLXCProcessStart(virLXCDriver * driver,
goto cleanup;
/* In case there isn't an error in the logs report that we failed to read the pidfile */
virReportSystemError(-r, _("Failed to read pid file %s"), pidfile);
virReportSystemError(-r, _("Failed to read pid file %1$s"), pidfile);
goto cleanup;
}
@ -1477,7 +1477,7 @@ int virLXCProcessStart(virLXCDriver * driver,
if (!priv->cgroup) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("No valid cgroup for machine %s"),
_("No valid cgroup for machine %1$s"),
vm->def->name);
goto cleanup;
}
@ -1568,7 +1568,7 @@ virLXCProcessAutostartDomain(virDomainObj *vm,
virDomainAuditStart(vm, "booted", rc >= 0);
if (rc < 0) {
VIR_ERROR(_("Failed to autostart VM '%s': %s"),
VIR_ERROR(_("Failed to autostart VM '%1$s': %2$s"),
vm->def->name,
virGetLastErrorMessage());
return -1;
@ -1668,7 +1668,7 @@ virLXCProcessReconnectDomain(virDomainObj *vm,
if (!priv->cgroup) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("No valid cgroup for machine %s"),
_("No valid cgroup for machine %1$s"),
vm->def->name);
goto error;
}