diff --git a/src/util/virfdstream.c b/src/util/virfdstream.c index 3de0d59a8b..0e39889ac9 100644 --- a/src/util/virfdstream.c +++ b/src/util/virfdstream.c @@ -152,7 +152,7 @@ virFDStreamMsgQueuePush(virFDStreamData *fdst, if (safewrite(fd, &c, sizeof(c)) != sizeof(c)) { virReportSystemError(errno, - _("Unable to write to %s"), + _("Unable to write to %1$s"), fdname); return -1; } @@ -177,7 +177,7 @@ virFDStreamMsgQueuePop(virFDStreamData *fdst, if (saferead(fd, &c, sizeof(c)) != sizeof(c)) { virReportSystemError(errno, - _("Unable to read from %s"), + _("Unable to read from %1$s"), fdname); return NULL; } @@ -473,7 +473,7 @@ virFDStreamThreadDoRead(virFDStreamData *fdst, if (sectionLen && lseek(fdin, sectionLen, SEEK_CUR) == (off_t) -1) { virReportSystemError(errno, - _("unable to seek in %s"), + _("unable to seek in %1$s"), fdinname); return -1; } @@ -486,7 +486,7 @@ virFDStreamThreadDoRead(virFDStreamData *fdst, if ((got = saferead(fdin, buf, buflen)) < 0) { virReportSystemError(errno, - _("Unable to read %s"), + _("Unable to read %1$s"), fdinname); return -1; } @@ -524,7 +524,7 @@ virFDStreamThreadDoWrite(virFDStreamData *fdst, msg->stream.data.len - msg->stream.data.offset); if (got < 0) { virReportSystemError(errno, - _("Unable to write %s"), + _("Unable to write %1$s"), fdoutname); return -1; } @@ -560,7 +560,7 @@ virFDStreamThreadDoWrite(virFDStreamData *fdst, if ((r = safewrite(fdout, buf, count)) < 0) { virReportSystemError(errno, - _("Unable to write %s"), + _("Unable to write %1$s"), fdoutname); return -1; } @@ -573,14 +573,14 @@ virFDStreamThreadDoWrite(virFDStreamData *fdst, off = lseek(fdout, got, SEEK_CUR); if (off == (off_t) -1) { virReportSystemError(errno, - _("unable to seek in %s"), + _("unable to seek in %1$s"), fdoutname); return -1; } if (ftruncate(fdout, off) < 0) { virReportSystemError(errno, - _("unable to truncate %s"), + _("unable to truncate %1$s"), fdoutname); return -1; } @@ -1265,7 +1265,7 @@ virFDStreamOpenFileInternal(virStreamPtr st, fd = open(path, oflags); if (fd < 0) { virReportSystemError(errno, - _("Unable to open stream for '%s'"), + _("Unable to open stream for '%1$s'"), path); return -1; } @@ -1273,7 +1273,7 @@ virFDStreamOpenFileInternal(virStreamPtr st, if (fstat(fd, &sb) < 0) { virReportSystemError(errno, - _("Unable to access stream for '%s'"), + _("Unable to access stream for '%1$s'"), path); goto error; } @@ -1281,7 +1281,7 @@ virFDStreamOpenFileInternal(virStreamPtr st, if (offset && lseek(fd, offset, SEEK_SET) < 0) { virReportSystemError(errno, - _("Unable to seek %s to %llu"), + _("Unable to seek %1$s to %2$llu"), path, offset); goto error; } @@ -1297,7 +1297,7 @@ virFDStreamOpenFileInternal(virStreamPtr st, if ((oflags & O_ACCMODE) == O_RDWR) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("%s: Cannot request read and write flags together"), + _("%1$s: Cannot request read and write flags together"), path); goto error; } @@ -1352,7 +1352,7 @@ int virFDStreamOpenFile(virStreamPtr st, { if (oflags & O_CREAT) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Attempt to create %s without specifying mode"), + _("Attempt to create %1$s without specifying mode"), path); return -1; } @@ -1393,7 +1393,7 @@ int virFDStreamOpenPTY(virStreamPtr st, if (tcgetattr(fdst->fd, &rawattr) < 0) { virReportSystemError(errno, - _("unable to get tty attributes: %s"), + _("unable to get tty attributes: %1$s"), path); goto cleanup; } @@ -1402,7 +1402,7 @@ int virFDStreamOpenPTY(virStreamPtr st, if (tcsetattr(fdst->fd, TCSANOW, &rawattr) < 0) { virReportSystemError(errno, - _("unable to set tty attributes: %s"), + _("unable to set tty attributes: %1$s"), path); goto cleanup; } diff --git a/src/util/virfile.c b/src/util/virfile.c index feb0d7f8ba..657e74e026 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -312,13 +312,13 @@ virFileWrapperFdNew(int *fd, const char *name, unsigned int flags) mode = fcntl(*fd, F_GETFL); if (mode < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, _("invalid fd %d for %s"), + virReportError(VIR_ERR_INTERNAL_ERROR, _("invalid fd %1$d for %2$s"), *fd, name); goto error; } else if ((mode & O_ACCMODE) == O_WRONLY) { output = true; } else if ((mode & O_ACCMODE) != O_RDONLY) { - virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected mode 0x%x for %s"), + virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected mode 0x%1$x for %2$s"), mode & O_ACCMODE, name); goto error; } @@ -575,7 +575,7 @@ virFileRewrite(const char *path, uid, gid, VIR_FILE_OPEN_FORCE_OWNER | VIR_FILE_OPEN_FORCE_MODE)) < 0) { virReportSystemError(-fd, - _("Failed to create file '%s'"), + _("Failed to create file '%1$s'"), newfile); goto cleanup; } @@ -585,19 +585,19 @@ virFileRewrite(const char *path, } if (g_fsync(fd) < 0) { - virReportSystemError(errno, _("cannot sync file '%s'"), + virReportSystemError(errno, _("cannot sync file '%1$s'"), newfile); goto cleanup; } if (VIR_CLOSE(fd) < 0) { - virReportSystemError(errno, _("cannot save file '%s'"), + virReportSystemError(errno, _("cannot save file '%1$s'"), newfile); goto cleanup; } if (rename(newfile, path) < 0) { - virReportSystemError(errno, _("cannot rename file '%s' as '%s'"), + virReportSystemError(errno, _("cannot rename file '%1$s' as '%2$s'"), newfile, path); goto cleanup; } @@ -620,7 +620,7 @@ virFileRewriteStrHelper(int fd, if (safewrite(fd, data, strlen(data)) < 0) { virReportSystemError(errno, - _("cannot write data to file '%s'"), + _("cannot write data to file '%1$s'"), path); return -1; } @@ -653,7 +653,7 @@ virFileResize(const char *path, VIR_AUTOCLOSE fd = -1; if ((fd = open(path, O_RDWR)) < 0) { - virReportSystemError(errno, _("Unable to open '%s'"), path); + virReportSystemError(errno, _("Unable to open '%1$s'"), path); return -1; } @@ -664,8 +664,8 @@ virFileResize(const char *path, _("preallocate is not supported on this platform")); } else { virReportSystemError(errno, - _("Failed to pre-allocate space for " - "file '%s'"), path); + _("Failed to pre-allocate space for file '%1$s'"), + path); } return -1; } @@ -673,12 +673,12 @@ virFileResize(const char *path, if (ftruncate(fd, capacity) < 0) { virReportSystemError(errno, - _("Failed to truncate file '%s'"), path); + _("Failed to truncate file '%1$s'"), path); return -1; } if (VIR_CLOSE(fd) < 0) { - virReportSystemError(errno, _("Unable to save '%s'"), path); + virReportSystemError(errno, _("Unable to save '%1$s'"), path); return -1; } @@ -691,13 +691,13 @@ int virFileTouch(const char *path, mode_t mode) int fd = -1; if ((fd = open(path, O_WRONLY | O_CREAT, mode)) < 0) { - virReportSystemError(errno, _("cannot create file '%s'"), + virReportSystemError(errno, _("cannot create file '%1$s'"), path); return -1; } if (VIR_CLOSE(fd) < 0) { - virReportSystemError(errno, _("cannot save file '%s'"), + virReportSystemError(errno, _("cannot save file '%1$s'"), path); VIR_FORCE_CLOSE(fd); return -1; @@ -722,7 +722,7 @@ int virFileUpdatePerm(const char *path, } if (stat(path, &sb) < 0) { - virReportSystemError(errno, _("cannot stat '%s'"), path); + virReportSystemError(errno, _("cannot stat '%1$s'"), path); return -1; } @@ -735,7 +735,7 @@ int virFileUpdatePerm(const char *path, mode |= mode_add; if (chmod(path, mode) < 0) { - virReportSystemError(errno, _("cannot change permission of '%s'"), + virReportSystemError(errno, _("cannot change permission of '%1$s'"), path); return -1; } @@ -781,7 +781,7 @@ static int virFileLoopDeviceOpenLoopCtl(char **dev_name, int *fd) if ((*fd = open(looppath, O_RDWR)) < 0) { virReportSystemError(errno, - _("Unable to open %s"), looppath); + _("Unable to open %1$s"), looppath); VIR_FREE(looppath); return -1; } @@ -817,7 +817,7 @@ static int virFileLoopDeviceOpenSearch(char **dev_name) VIR_DEBUG("Checking up on device %s", looppath); if ((fd = open(looppath, O_RDWR)) < 0) { virReportSystemError(errno, - _("Unable to open %s"), looppath); + _("Unable to open %1$s"), looppath); goto cleanup; } @@ -828,7 +828,7 @@ static int virFileLoopDeviceOpenSearch(char **dev_name) VIR_FORCE_CLOSE(fd); virReportSystemError(errno, - _("Unable to get loop status on %s"), + _("Unable to get loop status on %1$s"), looppath); goto cleanup; } @@ -889,19 +889,19 @@ int virFileLoopDeviceAssociate(const char *file, /* Set backing file name for LOOP_GET_STATUS64 queries */ if (virStrcpy((char *) lo.lo_file_name, file, LO_NAME_SIZE) < 0) { virReportSystemError(errno, - _("Unable to set backing file %s"), file); + _("Unable to set backing file %1$s"), file); goto cleanup; } if ((fsfd = open(file, O_RDWR)) < 0) { virReportSystemError(errno, - _("Unable to open %s"), file); + _("Unable to open %1$s"), file); goto cleanup; } if (ioctl(lofd, LOOP_SET_FD, fsfd) < 0) { virReportSystemError(errno, - _("Unable to attach %s to loop device"), + _("Unable to attach %1$s to loop device"), file); goto cleanup; } @@ -944,7 +944,7 @@ virFileNBDDeviceIsBusy(const char *dev_name) return 0; else virReportSystemError(errno, - _("Cannot check NBD device %s pid"), + _("Cannot check NBD device %1$s pid"), dev_name); return -1; } @@ -1055,7 +1055,7 @@ int virFileLoopDeviceAssociate(const char *file, char **dev G_GNUC_UNUSED) { virReportSystemError(ENOSYS, - _("Unable to associate file %s with loop device"), + _("Unable to associate file %1$s with loop device"), file); *dev = NULL; return -1; @@ -1067,7 +1067,7 @@ int virFileNBDDeviceAssociate(const char *file, char **dev G_GNUC_UNUSED) { virReportSystemError(ENOSYS, - _("Unable to associate file %s with NBD device"), + _("Unable to associate file %1$s with NBD device"), file); return -1; } @@ -1107,7 +1107,7 @@ int virFileDeleteTree(const char *dir) filepath = g_build_filename(dir, de->d_name, NULL); if (g_lstat(filepath, &sb) < 0) { - virReportSystemError(errno, _("Cannot access '%s'"), + virReportSystemError(errno, _("Cannot access '%1$s'"), filepath); return -1; } @@ -1118,7 +1118,7 @@ int virFileDeleteTree(const char *dir) } else { if (unlink(filepath) < 0 && errno != ENOENT) { virReportSystemError(errno, - _("Cannot delete file '%s'"), + _("Cannot delete file '%1$s'"), filepath); return -1; } @@ -1129,7 +1129,7 @@ int virFileDeleteTree(const char *dir) if (rmdir(dir) < 0 && errno != ENOENT) { virReportSystemError(errno, - _("Cannot delete directory '%s'"), + _("Cannot delete directory '%1$s'"), dir); return -1; } @@ -1520,14 +1520,14 @@ virFileReadAll(const char *path, int maxlen, char **buf) fd = open(path, O_RDONLY); if (fd < 0) { - virReportSystemError(errno, _("Failed to open file '%s'"), path); + virReportSystemError(errno, _("Failed to open file '%1$s'"), path); return -1; } len = virFileReadLimFD(fd, maxlen, buf); VIR_FORCE_CLOSE(fd); if (len < 0) { - virReportSystemError(errno, _("Failed to read file '%s'"), path); + virReportSystemError(errno, _("Failed to read file '%1$s'"), path); return -1; } @@ -1640,7 +1640,7 @@ virFileRelLinkPointsTo(const char *directory, return virFileLinkPointsTo(checkLink, checkDest); if (!directory) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot resolve '%s' without starting directory"), + _("cannot resolve '%1$s' without starting directory"), checkLink); return -1; } @@ -1970,14 +1970,14 @@ int virFileIsMountPoint(const char *file) return 0; else virReportSystemError(errno, - _("Cannot stat '%s'"), + _("Cannot stat '%1$s'"), file); return -1; } if (stat(parent, &sb2) < 0) { virReportSystemError(errno, - _("Cannot stat '%s'"), + _("Cannot stat '%1$s'"), parent); return -1; } @@ -2059,7 +2059,7 @@ virFileGetMountSubtreeImpl(const char *mtabpath, if (!(procmnt = setmntent(mtabpath, "r"))) { virReportSystemError(errno, - _("Failed to read %s"), mtabpath); + _("Failed to read %1$s"), mtabpath); return -1; } @@ -2219,7 +2219,7 @@ virFileOpenForceOwnerMode(const char *path, int fd, mode_t mode, if (fstat(fd, &st) == -1) { ret = -errno; - virReportSystemError(errno, _("stat of '%s' failed"), path); + virReportSystemError(errno, _("stat of '%1$s' failed"), path); return ret; } /* NB: uid:gid are never "-1" (default) at this point - the caller @@ -2230,7 +2230,7 @@ virFileOpenForceOwnerMode(const char *path, int fd, mode_t mode, (fchown(fd, uid, gid) < 0)) { ret = -errno; virReportSystemError(errno, - _("cannot chown '%s' to (%u, %u)"), + _("cannot chown '%1$s' to (%2$u, %3$u)"), path, (unsigned int) uid, (unsigned int) gid); return ret; @@ -2241,7 +2241,7 @@ virFileOpenForceOwnerMode(const char *path, int fd, mode_t mode, (fchmod(fd, mode) < 0)) { ret = -errno; virReportSystemError(errno, - _("cannot set mode of '%s' to %04o"), + _("cannot set mode of '%1$s' to %2$04o"), path, mode); return ret; } @@ -2283,7 +2283,7 @@ virFileOpenForked(const char *path, int openflags, mode_t mode, if (socketpair(AF_UNIX, SOCK_STREAM, 0, pair) < 0) { ret = -errno; virReportSystemError(errno, - _("failed to create socket needed for '%s'"), + _("failed to create socket needed for '%1$s'"), path); return ret; } @@ -2306,7 +2306,7 @@ virFileOpenForked(const char *path, int openflags, mode_t mode, if ((fd = open(path, openflags, mode)) < 0) { ret = -errno; virReportSystemError(errno, - _("child process failed to create file '%s'"), + _("child process failed to create file '%1$s'"), path); goto childerror; } @@ -2318,7 +2318,7 @@ virFileOpenForked(const char *path, int openflags, mode_t mode, if (ret < 0) { ret = -errno; virReportSystemError(errno, - _("child process failed to force owner mode file '%s'"), + _("child process failed to force owner mode file '%1$s'"), path); goto childerror; } @@ -2384,7 +2384,7 @@ virFileOpenForked(const char *path, int openflags, mode_t mode, /* if waitpid succeeded, but recvfd failed, report recvfd_errno */ if (recvfd_errno != 0) { virReportSystemError(recvfd_errno, - _("failed recvfd for child creating '%s'"), + _("failed recvfd for child creating '%1$s'"), path); return -recvfd_errno; } @@ -2656,7 +2656,7 @@ virDirCreateNoFork(const char *path, if (!((flags & VIR_DIR_CREATE_ALLOW_EXIST) && virFileExists(path))) { if (mkdir(path, mode) < 0) { ret = -errno; - virReportSystemError(errno, _("failed to create directory '%s'"), + virReportSystemError(errno, _("failed to create directory '%1$s'"), path); goto error; } @@ -2665,7 +2665,7 @@ virDirCreateNoFork(const char *path, if (stat(path, &st) == -1) { ret = -errno; - virReportSystemError(errno, _("stat of '%s' failed"), path); + virReportSystemError(errno, _("stat of '%1$s' failed"), path); goto error; } @@ -2673,7 +2673,7 @@ virDirCreateNoFork(const char *path, (gid != (gid_t) -1 && st.st_gid != gid)) && (chown(path, uid, gid) < 0)) { ret = -errno; - virReportSystemError(errno, _("cannot chown '%s' to (%u, %u)"), + virReportSystemError(errno, _("cannot chown '%1$s' to (%2$u, %3$u)"), path, (unsigned int) uid, (unsigned int) gid); goto error; } @@ -2681,7 +2681,7 @@ virDirCreateNoFork(const char *path, if (mode != (mode_t) -1 && chmod(path, mode) < 0) { ret = -errno; virReportSystemError(errno, - _("cannot set mode of '%s' to %04o"), + _("cannot set mode of '%1$s' to %2$04o"), path, mode); goto error; } @@ -2799,7 +2799,7 @@ virDirCreate(const char *path, ret = errno; if (ret != EACCES) { /* in case of EACCES, the parent will retry */ - virReportSystemError(errno, _("child failed to create directory '%s'"), + virReportSystemError(errno, _("child failed to create directory '%1$s'"), path); } goto childerror; @@ -2811,21 +2811,21 @@ virDirCreate(const char *path, if (stat(path, &st) == -1) { ret = errno; virReportSystemError(errno, - _("stat of '%s' failed"), path); + _("stat of '%1$s' failed"), path); goto childerror; } if ((st.st_gid != gid) && (chown(path, (uid_t) -1, gid) < 0)) { ret = errno; virReportSystemError(errno, - _("cannot chown '%s' to group %u"), + _("cannot chown '%1$s' to group %2$u"), path, (unsigned int) gid); goto childerror; } if (mode != (mode_t) -1 && chmod(path, mode) < 0) { virReportSystemError(errno, - _("cannot set mode of '%s' to %04o"), + _("cannot set mode of '%1$s' to %2$04o"), path, mode); goto childerror; } @@ -2888,7 +2888,7 @@ virFileRemove(const char *path, gid_t gid G_GNUC_UNUSED) { if (unlink(path) < 0) { - virReportSystemError(errno, _("Unable to unlink path '%s'"), + virReportSystemError(errno, _("Unable to unlink path '%1$s'"), path); return -1; } @@ -2907,7 +2907,7 @@ virDirOpenInternal(DIR **dirp, const char *name, bool ignoreENOENT, bool quiet) if (ignoreENOENT && errno == ENOENT) return 0; - virReportSystemError(errno, _("cannot open directory '%s'"), name); + virReportSystemError(errno, _("cannot open directory '%1$s'"), name); return -1; } return 1; @@ -2985,7 +2985,7 @@ int virDirRead(DIR *dirp, struct dirent **ent, const char *name) *ent = readdir(dirp); /* exempt from syntax-check */ if (!*ent && errno) { if (name) - virReportSystemError(errno, _("Unable to read directory '%s'"), + virReportSystemError(errno, _("Unable to read directory '%1$s'"), name); return -1; } @@ -3035,7 +3035,7 @@ int virFileChownFiles(const char *name, if (chown(path, uid, gid) < 0) { virReportSystemError(errno, - _("cannot chown '%s' to (%u, %u)"), + _("cannot chown '%1$s' to (%2$u, %3$u)"), ent->d_name, (unsigned int) uid, (unsigned int) gid); return -1; @@ -3055,7 +3055,7 @@ int virFileChownFiles(const char *name, gid_t gid) { virReportSystemError(ENOSYS, - _("cannot chown '%s' to (%u, %u)"), + _("cannot chown '%1$s' to (%2$u, %3$u)"), name, (unsigned int) uid, (unsigned int) gid); return -1; @@ -3336,14 +3336,14 @@ virFileIsSharedFsFUSE(const char *path, bool isShared = false; if (!(canonPath = virFileCanonicalizePath(path))) { - virReportSystemError(errno, _("unable to canonicalize %s"), path); + virReportSystemError(errno, _("unable to canonicalize %1$s"), path); return -1; } VIR_DEBUG("Path canonicalization: %s->%s", path, canonPath); if (!(f = setmntent(PROC_MOUNTS, "r"))) { - virReportSystemError(errno, _("Unable to open %s"), PROC_MOUNTS); + virReportSystemError(errno, _("Unable to open %1$s"), PROC_MOUNTS); return -1; } @@ -3425,7 +3425,7 @@ virFileIsSharedFSType(const char *path, if ((p = strrchr(dirpath, '/')) == NULL) { virReportSystemError(EINVAL, - _("Invalid relative path '%s'"), path); + _("Invalid relative path '%1$s'"), path); return -1; } @@ -3439,7 +3439,7 @@ virFileIsSharedFSType(const char *path, if (statfs_ret < 0) { virReportSystemError(errno, - _("cannot determine filesystem for '%s'"), + _("cannot determine filesystem for '%1$s'"), path); return -1; } @@ -3471,14 +3471,14 @@ virFileGetHugepageSize(const char *path, if (statfs(path, &fs) < 0) { virReportSystemError(errno, - _("cannot determine filesystem for '%s'"), + _("cannot determine filesystem for '%1$s'"), path); return -1; } if (fs.f_type != HUGETLBFS_MAGIC) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("not a hugetlbfs mount: '%s'"), + _("not a hugetlbfs mount: '%1$s'"), path); return -1; } @@ -3504,7 +3504,7 @@ virFileGetDefaultHugepageSize(unsigned long long *size) if (!(c = strstr(meminfo, HUGEPAGESIZE_STR))) { virReportError(VIR_ERR_NO_SUPPORT, - _("%s not found in %s"), + _("%1$s not found in %2$s"), HUGEPAGESIZE_STR, PROC_MEMINFO); return -1; @@ -3518,7 +3518,7 @@ virFileGetDefaultHugepageSize(unsigned long long *size) if (virStrToLong_ull(c, &unit, 10, size) < 0 || STRNEQ(unit, " kB")) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to parse %s %s"), + _("Unable to parse %1$s %2$s"), HUGEPAGESIZE_STR, c); return -1; } @@ -3540,7 +3540,7 @@ virFileFindHugeTLBFS(virHugeTLBFS **ret_fs, if (!(f = setmntent(PROC_MOUNTS, "r"))) { virReportSystemError(errno, - _("Unable to open %s"), + _("Unable to open %1$s"), PROC_MOUNTS); goto cleanup; } @@ -3674,7 +3674,7 @@ virFileSetupDev(const char *path, if (g_mkdir_with_parents(path, 0777) < 0) { virReportSystemError(errno, - _("Failed to make path %s"), path); + _("Failed to make path %1$s"), path); return -1; } @@ -3682,7 +3682,7 @@ virFileSetupDev(const char *path, path, mount_flags, mount_options); if (mount("devfs", path, mount_fs, mount_flags, mount_options) < 0) { virReportSystemError(errno, - _("Failed to mount devfs on %s type %s (%s)"), + _("Failed to mount devfs on %1$s type %2$s (%3$s)"), path, mount_fs, mount_options); return -1; } @@ -3698,7 +3698,7 @@ virFileBindMountDevice(const char *src, if (!virFileExists(dst)) { if (virFileIsDir(src)) { if (g_mkdir_with_parents(dst, 0777) < 0) { - virReportSystemError(errno, _("Unable to make dir %s"), dst); + virReportSystemError(errno, _("Unable to make dir %1$s"), dst); return -1; } } else { @@ -3708,7 +3708,7 @@ virFileBindMountDevice(const char *src, } if (mount(src, dst, "none", MS_BIND, NULL) < 0) { - virReportSystemError(errno, _("Failed to bind %s on to %s"), src, + virReportSystemError(errno, _("Failed to bind %1$s on to %2$s"), src, dst); return -1; } @@ -3725,7 +3725,7 @@ virFileMoveMount(const char *src, if (mount(src, dst, "none", mount_flags, NULL) < 0) { virReportSystemError(errno, - _("Unable to move %s mount to %s"), + _("Unable to move %1$s mount to %2$s"), src, dst); return -1; } @@ -4045,7 +4045,7 @@ virFileReadValueInt(int *value, const char *format, ...) if (virStrToLong_i(str, NULL, 10, value) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid integer value '%s' in file '%s'"), + _("Invalid integer value '%1$s' in file '%2$s'"), str, path); return -1; } @@ -4085,7 +4085,7 @@ virFileReadValueUint(unsigned int *value, const char *format, ...) if (virStrToLong_uip(str, NULL, 10, value) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid unsigned integer value '%s' in file '%s'"), + _("Invalid unsigned integer value '%1$s' in file '%2$s'"), str, path); return -1; } @@ -4125,7 +4125,7 @@ virFileReadValueUllong(unsigned long long *value, const char *format, ...) if (virStrToLong_ullp(str, NULL, 10, value) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid unsigned long long value '%s' in file '%s'"), + _("Invalid unsigned long long value '%1$s' in file '%2$s'"), str, path); return -1; } @@ -4190,7 +4190,7 @@ virFileReadValueScaledInt(unsigned long long *value, const char *format, ...) if (virStrToLong_ullp(str, &endp, 10, value) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid unsigned scaled integer value '%s' in file '%s'"), + _("Invalid unsigned scaled integer value '%1$s' in file '%2$s'"), str, path); return -1; } @@ -4367,7 +4367,7 @@ virFileSetXAttr(const char *path, { if (setxattr(path, name, value, strlen(value), 0) < 0) { virReportSystemError(errno, - _("Unable to set XATTR %s on %s"), + _("Unable to set XATTR %1$s on %2$s"), name, path); return -1; } @@ -4391,7 +4391,7 @@ virFileRemoveXAttr(const char *path, { if (removexattr(path, name) < 0) { virReportSystemError(errno, - _("Unable to remove XATTR %s on %s"), + _("Unable to remove XATTR %1$s on %2$s"), name, path); return -1; } @@ -4417,7 +4417,7 @@ virFileSetXAttr(const char *path, { errno = ENOSYS; virReportSystemError(errno, - _("Unable to set XATTR %s on %s"), + _("Unable to set XATTR %1$s on %2$s"), name, path); return -1; } @@ -4428,7 +4428,7 @@ virFileRemoveXAttr(const char *path, { errno = ENOSYS; virReportSystemError(errno, - _("Unable to remove XATTR %s on %s"), + _("Unable to remove XATTR %1$s on %2$s"), name, path); return -1; } @@ -4456,7 +4456,7 @@ virFileGetXAttr(const char *path, if ((ret = virFileGetXAttrQuiet(path, name, value)) < 0) { virReportSystemError(errno, - _("Unable to get XATTR %s on %s"), + _("Unable to get XATTR %1$s on %2$s"), name, path); } @@ -4506,13 +4506,13 @@ virFileSetCOW(const char *path, fd = open(path, O_RDONLY|O_NONBLOCK|O_LARGEFILE); if (fd < 0) { - virReportSystemError(errno, _("unable to open '%s'"), + virReportSystemError(errno, _("unable to open '%1$s'"), path); return -1; } if (fstatfs(fd, &buf) < 0) { - virReportSystemError(errno, _("unable query filesystem type on '%s'"), + virReportSystemError(errno, _("unable query filesystem type on '%1$s'"), path); return -1; } @@ -4520,7 +4520,7 @@ virFileSetCOW(const char *path, if (buf.f_type != BTRFS_SUPER_MAGIC) { if (state != VIR_TRISTATE_BOOL_ABSENT) { virReportSystemError(ENOSYS, - _("unable to control COW flag on '%s', not btrfs"), + _("unable to control COW flag on '%1$s', not btrfs"), path); return -1; } @@ -4528,7 +4528,7 @@ virFileSetCOW(const char *path, } if (ioctl(fd, FS_IOC_GETFLAGS, &val) < 0) { - virReportSystemError(errno, _("unable get directory flags on '%s'"), + virReportSystemError(errno, _("unable get directory flags on '%1$s'"), path); return -1; } @@ -4546,7 +4546,7 @@ virFileSetCOW(const char *path, VIR_DEBUG("Failed to set flags on '%s': %s", path, g_strerror(saved_err)); if (state != VIR_TRISTATE_BOOL_ABSENT) { virReportSystemError(saved_err, - _("unable control COW flag on '%s'"), + _("unable control COW flag on '%1$s'"), path); return -1; } else { @@ -4558,7 +4558,7 @@ virFileSetCOW(const char *path, #else /* ! __linux__ */ if (state != VIR_TRISTATE_BOOL_ABSENT) { virReportSystemError(ENOSYS, - _("Unable to set copy-on-write state on '%s' to '%s'"), + _("Unable to set copy-on-write state on '%1$s' to '%2$s'"), path, virTristateBoolTypeToString(state)); return -1; } @@ -4623,7 +4623,7 @@ runIOCopy(const struct runIOParams p) } if (got < 0) { - virReportSystemError(errno, _("Unable to read %s"), p.fdinname); + virReportSystemError(errno, _("Unable to read %1$s"), p.fdinname); return -2; } if (got == 0) @@ -4638,12 +4638,12 @@ runIOCopy(const struct runIOParams p) memset(buf + got, 0, aligned_got - got); if (safewrite(p.fdout, buf, aligned_got) < 0) { - virReportSystemError(errno, _("Unable to write %s"), p.fdoutname); + virReportSystemError(errno, _("Unable to write %1$s"), p.fdoutname); return -3; } if (!p.isBlockDev && ftruncate(p.fdout, total) < 0) { - virReportSystemError(errno, _("Unable to truncate %s"), p.fdoutname); + virReportSystemError(errno, _("Unable to truncate %1$s"), p.fdoutname); return -4; } @@ -4651,7 +4651,7 @@ runIOCopy(const struct runIOParams p) } if (safewrite(p.fdout, buf, got) < 0) { - virReportSystemError(errno, _("Unable to write %s"), p.fdoutname); + virReportSystemError(errno, _("Unable to write %1$s"), p.fdoutname); return -3; } } @@ -4690,13 +4690,13 @@ virFileDiskCopy(int disk_fd, const char *disk_path, int remote_fd, const char *r if (oflags < 0) { virReportSystemError(errno, - _("unable to determine access mode of %s"), + _("unable to determine access mode of %1$s"), disk_path); goto cleanup; } if (fstat(disk_fd, &sb) < 0) { virReportSystemError(errno, - _("unable to stat file descriptor %d path %s"), + _("unable to stat file descriptor %1$d path %2$s"), disk_fd, disk_path); goto cleanup; } @@ -4720,7 +4720,7 @@ virFileDiskCopy(int disk_fd, const char *disk_path, int remote_fd, const char *r break; case O_RDWR: default: - virReportSystemError(EINVAL, _("Unable to process file with flags %d"), + virReportSystemError(EINVAL, _("Unable to process file with flags %1$d"), (oflags & O_ACCMODE)); goto cleanup; } @@ -4752,7 +4752,7 @@ virFileDiskCopy(int disk_fd, const char *disk_path, int remote_fd, const char *r if (virFileDataSync(p.fdout) < 0) { if (errno != EINVAL && errno != EROFS) { /* fdatasync() may fail on some special FDs, e.g. pipes */ - virReportSystemError(errno, _("unable to fsync %s"), p.fdoutname); + virReportSystemError(errno, _("unable to fsync %1$s"), p.fdoutname); goto cleanup; } } @@ -4761,7 +4761,7 @@ virFileDiskCopy(int disk_fd, const char *disk_path, int remote_fd, const char *r cleanup: if (VIR_CLOSE(disk_fd) < 0 && ret == 0) { - virReportSystemError(errno, _("Unable to close %s"), disk_path); + virReportSystemError(errno, _("Unable to close %1$s"), disk_path); ret = -1; } return ret; diff --git a/src/util/virfilecache.c b/src/util/virfilecache.c index b9e06545c0..c730de066e 100644 --- a/src/util/virfilecache.c +++ b/src/util/virfilecache.c @@ -106,7 +106,7 @@ virFileCacheGetFileName(virFileCache *cache, if (g_mkdir_with_parents(cache->dir, 0777) < 0) { virReportSystemError(errno, - _("Unable to create directory '%s'"), + _("Unable to create directory '%1$s'"), cache->dir); return NULL; } @@ -142,7 +142,7 @@ virFileCacheLoad(virFileCache *cache, goto cleanup; } virReportSystemError(errno, - _("Unable to access cache '%s' for '%s'"), + _("Unable to access cache '%1$s' for '%2$s'"), file, name); goto cleanup; } diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c index fbb0e438b3..30e73f603e 100644 --- a/src/util/virfirewall.c +++ b/src/util/virfirewall.c @@ -492,7 +492,7 @@ virFirewallApplyRuleDirect(virFirewallRule *rule, if (!bin) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unknown firewall layer %d"), + _("Unknown firewall layer %1$d"), rule->layer); return -1; } @@ -516,7 +516,7 @@ virFirewallApplyRuleDirect(virFirewallRule *rule, VIR_DEBUG("Ignoring error running command"); } else { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to apply firewall rules %s: %s"), + _("Failed to apply firewall rules %1$s: %2$s"), NULLSTR(cmdStr), NULLSTR(error)); VIR_FREE(*output); return -1; diff --git a/src/util/virfirewalld.c b/src/util/virfirewalld.c index d11e974cc2..7733ef2410 100644 --- a/src/util/virfirewalld.c +++ b/src/util/virfirewalld.c @@ -109,7 +109,7 @@ virFirewallDGetVersion(unsigned long *version) if (virStringParseVersion(version, versionStr, false) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to parse firewalld version '%s'"), + _("Failed to parse firewalld version '%1$s'"), versionStr); return -1; } @@ -173,7 +173,7 @@ virFirewallDGetBackend(void) if ((backend = virFirewallDBackendTypeFromString(backendStr)) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unrecognized firewalld backend type: %s"), + _("Unrecognized firewalld backend type: %1$s"), backendStr); return -1; } @@ -364,7 +364,7 @@ virFirewallDApplyRule(virFirewallLayer layer, if (!ipv) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unknown firewall layer %d"), + _("Unknown firewall layer %1$d"), layer); return -1; } diff --git a/src/util/virfirmware.c b/src/util/virfirmware.c index 9b333cf04b..33d2789ca7 100644 --- a/src/util/virfirmware.c +++ b/src/util/virfirmware.c @@ -72,7 +72,7 @@ virFirmwareParse(const char *str, virFirmware *firmware) if (!token[0] || !token[1] || token[2] || STREQ(token[0], "") || STREQ(token[1], "")) { virReportError(VIR_ERR_CONF_SYNTAX, - _("Invalid nvram format: '%s'"), + _("Invalid nvram format: '%1$s'"), str); return -1; } @@ -99,7 +99,7 @@ virFirmwareParseList(const char *list, if (!token[i] || !token[i + 1] || STREQ(token[i], "") || STREQ(token[i + 1], "")) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid --with-loader-nvram list: %s"), + _("Invalid --with-loader-nvram list: %1$s"), list); return -1; } diff --git a/src/util/virgdbus.c b/src/util/virgdbus.c index 87b48256af..71ca3cd43b 100644 --- a/src/util/virgdbus.c +++ b/src/util/virgdbus.c @@ -97,7 +97,7 @@ virGDBusGetSystemBus(void) if (!bus) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to get system bus connection: %s"), + _("Unable to get system bus connection: %1$s"), systemError->message); return NULL; } @@ -124,7 +124,7 @@ virGDBusGetSessionBus(void) if (!sessionBus) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to get session bus connection: %s"), + _("Unable to get session bus connection: %1$s"), sessionError->message); return NULL; } diff --git a/src/util/virhash.c b/src/util/virhash.c index c72c248186..8365f51eb3 100644 --- a/src/util/virhash.c +++ b/src/util/virhash.c @@ -139,7 +139,7 @@ virHashAddEntry(GHashTable *table, const char *name, void *userdata) if (g_hash_table_contains(table, name)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Duplicate hash table key '%s'"), name); + _("Duplicate hash table key '%1$s'"), name); return -1; } diff --git a/src/util/virhook.c b/src/util/virhook.c index 871bfcc670..50e178723f 100644 --- a/src/util/virhook.c +++ b/src/util/virhook.c @@ -149,7 +149,7 @@ virHookCheck(int no, const char *driver) if (driver == NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid hook name for #%d"), no); + _("Invalid hook name for #%1$d"), no); return -1; } @@ -388,7 +388,7 @@ virHookCall(int driver, } if (opstr == NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Hook for %s, failed to find operation #%d"), + _("Hook for %1$s, failed to find operation #%2$d"), drvstr, op); return 1; } diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c index c1e8dc8078..19195a1470 100644 --- a/src/util/virhostcpu.c +++ b/src/util/virhostcpu.c @@ -107,7 +107,7 @@ virHostCPUGetStatsFreeBSD(int cpuNum, if ((*nparams) != BSD_CPU_STATS_ALL) { virReportInvalidArg(*nparams, - _("nparams in %s must be equal to %d"), + _("nparams in %1$s must be equal to %2$d"), __FUNCTION__, BSD_CPU_STATS_ALL); return -1; } @@ -115,7 +115,7 @@ virHostCPUGetStatsFreeBSD(int cpuNum, clkinfo_size = sizeof(clkinfo); if (sysctlbyname("kern.clockrate", &clkinfo, &clkinfo_size, NULL, 0) < 0) { virReportSystemError(errno, - _("sysctl failed for '%s'"), + _("sysctl failed for '%1$s'"), "kern.clockrate"); return -1; } @@ -133,7 +133,7 @@ virHostCPUGetStatsFreeBSD(int cpuNum, if (cpuNum >= cpu_times_num) { virReportInvalidArg(cpuNum, - _("Invalid cpuNum in %s"), + _("Invalid cpuNum in %1$s"), __FUNCTION__); return -1; } @@ -147,7 +147,7 @@ virHostCPUGetStatsFreeBSD(int cpuNum, if (sysctlbyname(sysctl_name, cpu_times, &cpu_times_size, NULL, 0) < 0) { virReportSystemError(errno, - _("sysctl failed for '%s'"), + _("sysctl failed for '%1$s'"), sysctl_name); return -1; } @@ -157,7 +157,7 @@ virHostCPUGetStatsFreeBSD(int cpuNum, if (virStrcpyStatic(param->field, cpu_map[i].field) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Field '%s' too long for destination"), + _("Field '%1$s' too long for destination"), cpu_map[i].field); return -1; } @@ -529,7 +529,7 @@ virHostCPUParseFrequencyString(const char *str, error: virReportError(VIR_ERR_INTERNAL_ERROR, - _("Missing or invalid CPU frequency in %s"), + _("Missing or invalid CPU frequency in %1$s"), CPUINFO_PATH); return -1; } @@ -596,7 +596,7 @@ virHostCPUParsePhysAddrSize(FILE *cpuinfo, unsigned int *addrsz) error: virReportError(VIR_ERR_INTERNAL_ERROR, - _("Missing or invalid CPU address size in %s"), + _("Missing or invalid CPU address size in %1$s"), CPUINFO_PATH); return -1; } @@ -801,7 +801,7 @@ virHostCPUGetStatsLinux(FILE *procstat, if ((*nparams) != LINUX_NB_CPU_STATS) { virReportInvalidArg(*nparams, - _("nparams in %s must be equal to %d"), + _("nparams in %1$s must be equal to %2$d"), __FUNCTION__, LINUX_NB_CPU_STATS); return -1; } @@ -845,7 +845,7 @@ virHostCPUGetStatsLinux(FILE *procstat, } virReportInvalidArg(cpuNum, - _("Invalid cpuNum in %s"), + _("Invalid cpuNum in %1$s"), __FUNCTION__); return -1; @@ -916,7 +916,7 @@ virHostCPUGetInfo(virArch hostarch G_GNUC_UNUSED, if (!cpuinfo) { virReportSystemError(errno, - _("cannot open %s"), CPUINFO_PATH); + _("cannot open %1$s"), CPUINFO_PATH); return -1; } @@ -995,7 +995,7 @@ virHostCPUGetStats(int cpuNum G_GNUC_UNUSED, FILE *procstat = fopen(PROCSTAT_PATH, "r"); if (!procstat) { virReportSystemError(errno, - _("cannot open %s"), PROCSTAT_PATH); + _("cannot open %1$s"), PROCSTAT_PATH); return -1; } ret = virHostCPUGetStatsLinux(procstat, cpuNum, params, nparams); @@ -1160,7 +1160,7 @@ virHostCPUGetThreadsPerSubcore(virArch arch) * is better than silently falling back and reporting * different nodeinfo depending on the user */ virReportSystemError(errno, - _("Failed to open '%s'"), + _("Failed to open '%1$s'"), KVM_DEVICE); return -1; } @@ -1198,7 +1198,7 @@ virHostCPUGetKVMMaxVCPUs(void) int ret; if ((fd = open(KVM_DEVICE, O_RDONLY)) < 0) { - virReportSystemError(errno, _("Unable to open %s"), KVM_DEVICE); + virReportSystemError(errno, _("Unable to open %1$s"), KVM_DEVICE); return -1; } @@ -1293,7 +1293,7 @@ virHostCPUGetMSRFromKVM(unsigned long index, msr->entries[0].index = index; if ((fd = open(KVM_DEVICE, O_RDONLY)) < 0) { - virReportSystemError(errno, _("Unable to open %s"), KVM_DEVICE); + virReportSystemError(errno, _("Unable to open %1$s"), KVM_DEVICE); return -1; } @@ -1419,7 +1419,7 @@ virHostCPUGetCPUID(void) VIR_AUTOCLOSE fd = open(KVM_DEVICE, O_RDONLY); if (fd < 0) { - virReportSystemError(errno, _("Unable to open %s"), KVM_DEVICE); + virReportSystemError(errno, _("Unable to open %1$s"), KVM_DEVICE); return NULL; } @@ -1473,7 +1473,7 @@ virHostCPUGetTscInfo(void) int rc; if ((kvmFd = open(KVM_DEVICE, O_RDONLY)) < 0) { - virReportSystemError(errno, _("Unable to open %s"), KVM_DEVICE); + virReportSystemError(errno, _("Unable to open %1$s"), KVM_DEVICE); return NULL; } @@ -1637,7 +1637,7 @@ virHostCPUGetSignature(char **signature) *signature = NULL; if (!(cpuinfo = fopen(CPUINFO_PATH, "r"))) { - virReportSystemError(errno, _("Failed to open cpuinfo file '%s'"), + virReportSystemError(errno, _("Failed to open cpuinfo file '%1$s'"), CPUINFO_PATH); return -1; } @@ -1651,7 +1651,7 @@ virHostCPUGetPhysAddrSize(unsigned int *size) g_autoptr(FILE) cpuinfo = NULL; if (!(cpuinfo = fopen(CPUINFO_PATH, "r"))) { - virReportSystemError(errno, _("Failed to open cpuinfo file '%s'"), + virReportSystemError(errno, _("Failed to open cpuinfo file '%1$s'"), CPUINFO_PATH); return -1; } diff --git a/src/util/virhostmem.c b/src/util/virhostmem.c index 052f7cd935..83c10206cd 100644 --- a/src/util/virhostmem.c +++ b/src/util/virhostmem.c @@ -80,7 +80,7 @@ virHostMemGetStatsFreeBSD(virNodeMemoryStatsPtr params, if ((*nparams) != BSD_MEMORY_STATS_ALL) { virReportInvalidArg(nparams, - _("nparams in %s must be %d"), + _("nparams in %1$s must be %2$d"), __FUNCTION__, BSD_MEMORY_STATS_ALL); return -1; } @@ -93,7 +93,7 @@ virHostMemGetStatsFreeBSD(virNodeMemoryStatsPtr params, if (sysctlbyname(sysctl_map[i].sysctl_name, &value, &value_size, NULL, 0) < 0) { virReportSystemError(errno, - _("sysctl failed for '%s'"), + _("sysctl failed for '%1$s'"), sysctl_map[i].sysctl_name); return -1; } @@ -101,7 +101,7 @@ virHostMemGetStatsFreeBSD(virNodeMemoryStatsPtr params, param = ¶ms[j++]; if (virStrcpyStatic(param->field, sysctl_map[i].field) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Field '%s' too long for destination"), + _("Field '%1$s' too long for destination"), sysctl_map[i].field); return -1; } @@ -113,13 +113,13 @@ virHostMemGetStatsFreeBSD(virNodeMemoryStatsPtr params, if (sysctlbyname("vfs.bufspace", &bufpages, &bufpages_size, NULL, 0) < 0) { virReportSystemError(errno, - _("sysctl failed for '%s'"), + _("sysctl failed for '%1$s'"), "vfs.bufspace"); return -1; } if (virStrcpyStatic(param->field, VIR_NODE_MEMORY_STATS_BUFFERS) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Field '%s' too long for destination"), + _("Field '%1$s' too long for destination"), VIR_NODE_MEMORY_STATS_BUFFERS); return -1; } @@ -176,7 +176,7 @@ virHostMemGetStatsLinux(FILE *meminfo, if ((*nparams) != nr_param) { virReportInvalidArg(nparams, - _("nparams in %s must be %d"), + _("nparams in %1$s must be %2$d"), __FUNCTION__, nr_param); return -1; } @@ -275,7 +275,7 @@ virHostMemGetStats(int cellNum G_GNUC_UNUSED, if (cellNum > max_node) { virReportInvalidArg(cellNum, - _("cellNum in %s must be less than or equal to %d"), + _("cellNum in %1$s must be less than or equal to %2$d"), __FUNCTION__, max_node); return -1; } @@ -287,7 +287,7 @@ virHostMemGetStats(int cellNum G_GNUC_UNUSED, if (!meminfo) { virReportSystemError(errno, - _("cannot open %s"), meminfo_path); + _("cannot open %1$s"), meminfo_path); return -1; } ret = virHostMemGetStatsLinux(meminfo, cellNum, params, nparams); @@ -320,7 +320,7 @@ virHostMemSetParameterValue(virTypedParameterPtr param) strval = g_strdup_printf("%u", param->value.ui); if ((rc = virFileWriteStr(path, strval, 0)) < 0) { - virReportSystemError(-rc, _("failed to set %s"), param->field); + virReportSystemError(-rc, _("failed to set %1$s"), param->field); return -1; } @@ -343,8 +343,8 @@ virHostMemParametersAreAllSupported(virTypedParameterPtr params, if (!virFileExists(path)) { virReportError(VIR_ERR_OPERATION_INVALID, - _("Parameter '%s' is not supported by " - "this kernel"), param->field); + _("Parameter '%1$s' is not supported by this kernel"), + param->field); return false; } } @@ -432,7 +432,7 @@ virHostMemGetParameterValue(const char *field, if (rc < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("failed to parse %s"), field); + _("failed to parse %1$s"), field); return -1; } @@ -740,7 +740,7 @@ virHostMemGetCellsFreeFake(unsigned long long *freeMems, { if (startCell != 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("start cell %d out of range (0-%d)"), + _("start cell %1$d out of range (0-%2$d)"), startCell, 0); return -1; } @@ -785,7 +785,7 @@ virHostMemGetCellsFree(unsigned long long *freeMems, if (startCell > maxCell) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("start cell %d out of range (0-%d)"), + _("start cell %1$d out of range (0-%2$d)"), startCell, maxCell); return -1; } @@ -860,7 +860,7 @@ virHostMemGetFreePages(unsigned int npages, if (startCell > lastCell) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("start cell %d out of range (0-%d)"), + _("start cell %1$d out of range (0-%2$d)"), startCell, lastCell); return -1; } @@ -910,7 +910,7 @@ virHostMemAllocPages(unsigned int npages, if (startCell > lastCell) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("start cell %d out of range (0-%d)"), + _("start cell %1$d out of range (0-%2$d)"), startCell, lastCell); return -1; } diff --git a/src/util/virhostuptime.c b/src/util/virhostuptime.c index 3d41fa081d..2467ea51b0 100644 --- a/src/util/virhostuptime.c +++ b/src/util/virhostuptime.c @@ -63,7 +63,7 @@ virHostGetBootTimeProcfs(unsigned long long *btime) * We're interested only in the first one */ if (!(tmp = strchr(buf, ' '))) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("uptime file has unexpected format '%s'"), + _("uptime file has unexpected format '%1$s'"), buf); return -EINVAL; } @@ -72,7 +72,7 @@ virHostGetBootTimeProcfs(unsigned long long *btime) if (virStrToDouble(buf, NULL, &up) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to parse uptime value '%s'"), + _("Unable to parse uptime value '%1$s'"), buf); return -EINVAL; } diff --git a/src/util/viridentity.c b/src/util/viridentity.c index 4e9a783cee..b7b88056ac 100644 --- a/src/util/viridentity.c +++ b/src/util/viridentity.c @@ -220,7 +220,7 @@ virIdentityConstructSystemTokenPath(void) if (g_mkdir_with_parents(commondir, 0700) < 0) { virReportSystemError(errno, - _("Cannot create daemon common directory '%s'"), + _("Cannot create daemon common directory '%1$s'"), commondir); return NULL; } @@ -243,28 +243,28 @@ virIdentityEnsureSystemToken(void) fd = open(tokenfile, O_RDWR|O_APPEND|O_CREAT, 0600); if (fd < 0) { virReportSystemError(errno, - _("Unable to open system token %s"), + _("Unable to open system token %1$s"), tokenfile); return NULL; } if (virSetCloseExec(fd) < 0) { virReportSystemError(errno, - _("Failed to set close-on-exec flag '%s'"), + _("Failed to set close-on-exec flag '%1$s'"), tokenfile); return NULL; } if (virFileLock(fd, false, 0, 1, true) < 0) { virReportSystemError(errno, - _("Failed to lock system token '%s'"), + _("Failed to lock system token '%1$s'"), tokenfile); return NULL; } if (fstat(fd, &st) < 0) { virReportSystemError(errno, - _("Failed to check system token '%s'"), + _("Failed to check system token '%1$s'"), tokenfile); return NULL; } @@ -276,20 +276,20 @@ virIdentityEnsureSystemToken(void) } if (safewrite(fd, token, TOKEN_STRLEN) != TOKEN_STRLEN) { virReportSystemError(errno, - _("Failed to write system token '%s'"), + _("Failed to write system token '%1$s'"), tokenfile); return NULL; } } else { if (virFileReadLimFD(fd, TOKEN_STRLEN, &token) < 0) { virReportSystemError(errno, - _("Failed to read system token '%s'"), + _("Failed to read system token '%1$s'"), tokenfile); return NULL; } if (strlen(token) != TOKEN_STRLEN) { virReportSystemError(errno, - _("System token in %s was corrupt"), + _("System token in %1$s was corrupt"), tokenfile); return NULL; } diff --git a/src/util/virinitctl.c b/src/util/virinitctl.c index 1b9f2ad022..430f23a235 100644 --- a/src/util/virinitctl.c +++ b/src/util/virinitctl.c @@ -141,7 +141,7 @@ virInitctlSetRunLevel(const char *fifo, if (fifo) { if ((fd = open(fifo, open_flags)) < 0) { virReportSystemError(errno, - _("Cannot open init control %s"), + _("Cannot open init control %1$s"), fifo); goto cleanup; } @@ -154,7 +154,7 @@ virInitctlSetRunLevel(const char *fifo, if (errno != ENOENT) { virReportSystemError(errno, - _("Cannot open init control %s"), + _("Cannot open init control %1$s"), fifo); goto cleanup; } @@ -169,7 +169,7 @@ virInitctlSetRunLevel(const char *fifo, if (safewrite(fd, &req, sizeof(req)) != sizeof(req)) { virReportSystemError(errno, - _("Failed to send request to init control %s"), + _("Failed to send request to init control %1$s"), fifo); goto cleanup; } diff --git a/src/util/viriptables.c b/src/util/viriptables.c index 6275760de4..018021bc1b 100644 --- a/src/util/viriptables.c +++ b/src/util/viriptables.c @@ -837,7 +837,7 @@ iptablesForwardMasquerade(virFirewall *fw, portRangeStr = g_strdup_printf(":%u-%u", port->start, port->end); } else { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid port range '%u-%u'."), + _("Invalid port range '%1$u-%2$u'."), port->start, port->end); return -1; } diff --git a/src/util/viriscsi.c b/src/util/viriscsi.c index fbf84c9305..4790bd4b55 100644 --- a/src/util/viriscsi.c +++ b/src/util/viriscsi.c @@ -102,7 +102,7 @@ virISCSIGetSession(const char *devpath, if (cbdata.session == NULL && !probe) virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find iscsiadm session: %s"), + _("cannot find iscsiadm session: %1$s"), NULLSTR(error)); return cbdata.session; @@ -193,7 +193,7 @@ virStorageBackendIQNFound(const char *initiatoriqn, error: virReportError(VIR_ERR_INTERNAL_ERROR, - _("malformed output of %s: %s"), + _("malformed output of %1$s: %2$s"), ISCSIADM, line); goto cleanup; } @@ -226,7 +226,7 @@ virStorageBackendCreateIfaceIQN(const char *initiatoriqn, * properly. */ if (virCommandRun(newcmd, &exitstatus) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to run command '%s' to create new iscsi interface"), + _("Failed to run command '%1$s' to create new iscsi interface"), ISCSIADM); return -1; } @@ -244,7 +244,7 @@ virStorageBackendCreateIfaceIQN(const char *initiatoriqn, * rely on whether iface file got updated properly. */ if (virCommandRun(updatecmd, &exitstatus) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to run command '%s' to update iscsi interface with IQN '%s'"), + _("Failed to run command '%1$s' to update iscsi interface with IQN '%2$s'"), ISCSIADM, initiatoriqn); return -1; } @@ -477,7 +477,7 @@ virISCSIScanTargets(const char *portal, case IQN_MISSING: virReportError(VIR_ERR_OPERATION_FAILED, - _("no iSCSI interface defined for IQN %s"), + _("no iSCSI interface defined for IQN %1$s"), initiatoriqn); G_GNUC_FALLTHROUGH; case IQN_ERROR: @@ -523,14 +523,14 @@ virISCSINodeNew(const char *portal, if (virCommandRun(cmd, &status) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed new node mode for target '%s'"), + _("Failed new node mode for target '%1$s'"), target); return -1; } if (status != 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("%s failed new mode for target '%s' with status '%d'"), + _("%1$s failed new mode for target '%2$s' with status '%3$d'"), ISCSIADM, target, status); return -1; } @@ -560,7 +560,7 @@ virISCSINodeUpdate(const char *portal, /* Ignore non-zero status. */ if (virCommandRun(cmd, &status) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to update '%s' of node mode for target '%s'"), + _("Failed to update '%1$s' of node mode for target '%2$s'"), name, target); return -1; } diff --git a/src/util/virjson.c b/src/util/virjson.c index 4e822063bc..7e20443f93 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -168,7 +168,7 @@ virJSONValueObjectAddVArgs(virJSONValue **objptr, if (strlen(key) < 3 || key[1] != ':') { virReportError(VIR_ERR_INTERNAL_ERROR, - _("argument key '%s' is too short or malformed"), + _("argument key '%1$s' is too short or malformed"), key); return -1; } @@ -186,7 +186,7 @@ virJSONValueObjectAddVArgs(virJSONValue **objptr, continue; virReportError(VIR_ERR_INTERNAL_ERROR, - _("argument key '%s' must not have null value"), + _("argument key '%1$s' must not have null value"), key); return -1; } @@ -202,7 +202,7 @@ virJSONValueObjectAddVArgs(virJSONValue **objptr, if (val < 0 && (type == 'j' || type == 'y')) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("argument key '%s' must not be negative"), + _("argument key '%1$s' must not be negative"), key); return -1; } @@ -235,7 +235,7 @@ virJSONValueObjectAddVArgs(virJSONValue **objptr, if (val < 0 && (type == 'J' || type == 'Y')) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("argument key '%s' must not be negative"), + _("argument key '%1$s' must not be negative"), key); return -1; } @@ -303,7 +303,7 @@ virJSONValueObjectAddVArgs(virJSONValue **objptr, continue; virReportError(VIR_ERR_INTERNAL_ERROR, - _("argument key '%s' must not have null value"), + _("argument key '%1$s' must not have null value"), key); return -1; } @@ -322,7 +322,7 @@ virJSONValueObjectAddVArgs(virJSONValue **objptr, continue; virReportError(VIR_ERR_INTERNAL_ERROR, - _("argument key '%s' must not have null value"), + _("argument key '%1$s' must not have null value"), key); return -1; } @@ -340,7 +340,7 @@ virJSONValueObjectAddVArgs(virJSONValue **objptr, default: virReportError(VIR_ERR_INTERNAL_ERROR, - _("unsupported data type '%c' for arg '%s'"), type, key - 2); + _("unsupported data type '%1$c' for arg '%2$s'"), type, key - 2); return -1; } @@ -556,7 +556,7 @@ virJSONValueObjectInsert(virJSONValue *object, } if (virJSONValueObjectHasKey(object, key)) { - virReportError(VIR_ERR_INTERNAL_ERROR, _("duplicate key '%s'"), key); + virReportError(VIR_ERR_INTERNAL_ERROR, _("duplicate key '%1$s'"), key); return -1; } @@ -1681,7 +1681,7 @@ virJSONValueFromString(const char *jsonstring) strlen(jsonstring)); virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse json %s: %s"), + _("cannot parse json %1$s: %2$s"), jsonstring, (const char*) errstr); yajl_free_error(hand, errstr); virJSONValueFree(parser.head); @@ -1690,7 +1690,7 @@ virJSONValueFromString(const char *jsonstring) if (parser.nstate != 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse json %s: unterminated string/map/array"), + _("cannot parse json %1$s: unterminated string/map/array"), jsonstring); virJSONValueFree(parser.head); } else { @@ -1909,7 +1909,7 @@ virJSONValueObjectDeflattenWorker(const char *key, if (virJSONValueObjectHasKey(retobj, key)) { virReportError(VIR_ERR_INVALID_ARG, - _("can't deflatten colliding key '%s'"), key); + _("can't deflatten colliding key '%1$s'"), key); return -1; } @@ -1924,7 +1924,7 @@ virJSONValueObjectDeflattenWorker(const char *key, if (!tokens[0] || !tokens[1]) { virReportError(VIR_ERR_INVALID_ARG, - _("invalid nested value key '%s'"), key); + _("invalid nested value key '%1$s'"), key); return -1; } diff --git a/src/util/virlease.c b/src/util/virlease.c index 357bacd83d..6fd7b88d88 100644 --- a/src/util/virlease.c +++ b/src/util/virlease.c @@ -64,7 +64,7 @@ virLeaseReadCustomLeaseFile(virJSONValue *leases_array_new, if (!(leases_array = virJSONValueFromString(lease_entries))) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("invalid json in file: %s, rewriting it"), + _("invalid json in file: %1$s, rewriting it"), custom_lease_file); return 0; } @@ -228,7 +228,7 @@ virLeaseNew(virJSONValue **lease_ret, if (virStrToLong_ll(exptime, NULL, 10, &expirytime) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to convert lease expiry time to long long: %s"), + _("Unable to convert lease expiry time to long long: %1$s"), NULLSTR(exptime)); return -1; } diff --git a/src/util/virlockspace.c b/src/util/virlockspace.c index d54162b3d7..19aacf61bc 100644 --- a/src/util/virlockspace.c +++ b/src/util/virlockspace.c @@ -131,21 +131,21 @@ virLockSpaceResourceNew(virLockSpace *lockspace, struct stat a, b; if ((res->fd = open(res->path, O_RDWR|O_CREAT, 0600)) < 0) { virReportSystemError(errno, - _("Unable to open/create resource %s"), + _("Unable to open/create resource %1$s"), res->path); goto error; } if (virSetCloseExec(res->fd) < 0) { virReportSystemError(errno, - _("Failed to set close-on-exec flag '%s'"), + _("Failed to set close-on-exec flag '%1$s'"), res->path); goto error; } if (fstat(res->fd, &b) < 0) { virReportSystemError(errno, - _("Unable to check status of pid file '%s'"), + _("Unable to check status of pid file '%1$s'"), res->path); goto error; } @@ -153,11 +153,11 @@ virLockSpaceResourceNew(virLockSpace *lockspace, if (virFileLock(res->fd, shared, 0, 1, false) < 0) { if (errno == EACCES || errno == EAGAIN) { virReportError(VIR_ERR_RESOURCE_BUSY, - _("Lockspace resource '%s' is locked"), + _("Lockspace resource '%1$s' is locked"), resname); } else { virReportSystemError(errno, - _("Unable to acquire lock on '%s'"), + _("Unable to acquire lock on '%1$s'"), res->path); } goto error; @@ -184,14 +184,14 @@ virLockSpaceResourceNew(virLockSpace *lockspace, } else { if ((res->fd = open(res->path, O_RDWR)) < 0) { virReportSystemError(errno, - _("Unable to open resource %s"), + _("Unable to open resource %1$s"), res->path); goto error; } if (virSetCloseExec(res->fd) < 0) { virReportSystemError(errno, - _("Failed to set close-on-exec flag '%s'"), + _("Failed to set close-on-exec flag '%1$s'"), res->path); goto error; } @@ -199,11 +199,11 @@ virLockSpaceResourceNew(virLockSpace *lockspace, if (virFileLock(res->fd, shared, 0, 1, false) < 0) { if (errno == EACCES || errno == EAGAIN) { virReportError(VIR_ERR_RESOURCE_BUSY, - _("Lockspace resource '%s' is locked"), + _("Lockspace resource '%1$s' is locked"), resname); } else { virReportSystemError(errno, - _("Unable to acquire lock on '%s'"), + _("Unable to acquire lock on '%1$s'"), res->path); } goto error; @@ -252,14 +252,14 @@ virLockSpace *virLockSpaceNew(const char *directory) if (virFileExists(directory)) { if (!virFileIsDir(directory)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Lockspace location %s exists, but is not a directory"), + _("Lockspace location %1$s exists, but is not a directory"), directory); goto error; } } else { if (g_mkdir_with_parents(directory, 0700) < 0) { virReportSystemError(errno, - _("Unable to create lockspace %s"), + _("Unable to create lockspace %1$s"), directory); goto error; } @@ -493,7 +493,7 @@ int virLockSpaceCreateResource(virLockSpace *lockspace, if (virHashLookup(lockspace->resources, resname) != NULL) { virReportError(VIR_ERR_RESOURCE_BUSY, - _("Lockspace resource '%s' is locked"), + _("Lockspace resource '%1$s' is locked"), resname); return -1; } @@ -518,7 +518,7 @@ int virLockSpaceDeleteResource(virLockSpace *lockspace, if (virHashLookup(lockspace->resources, resname) != NULL) { virReportError(VIR_ERR_RESOURCE_BUSY, - _("Lockspace resource '%s' is locked"), + _("Lockspace resource '%1$s' is locked"), resname); return -1; } @@ -529,7 +529,7 @@ int virLockSpaceDeleteResource(virLockSpace *lockspace, if (unlink(respath) < 0 && errno != ENOENT) { virReportSystemError(errno, - _("Unable to delete lockspace resource %s"), + _("Unable to delete lockspace resource %1$s"), respath); return -1; } @@ -562,7 +562,7 @@ int virLockSpaceAcquireResource(virLockSpace *lockspace, return 0; } virReportError(VIR_ERR_RESOURCE_BUSY, - _("Lockspace resource '%s' is locked"), + _("Lockspace resource '%1$s' is locked"), resname); return -1; } @@ -592,7 +592,7 @@ int virLockSpaceReleaseResource(virLockSpace *lockspace, if (!(res = virHashLookup(lockspace->resources, resname))) { virReportError(VIR_ERR_RESOURCE_BUSY, - _("Lockspace resource '%s' is not locked"), + _("Lockspace resource '%1$s' is not locked"), resname); return -1; } @@ -604,7 +604,7 @@ int virLockSpaceReleaseResource(virLockSpace *lockspace, if (i == res->nOwners) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("owner %lld does not hold the resource lock"), + _("owner %1$lld does not hold the resource lock"), (unsigned long long)owner); return -1; } diff --git a/src/util/virlog.c b/src/util/virlog.c index 443e948917..6bbd69fe43 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -306,8 +306,8 @@ virLogSetDefaultPriority(virLogPriority priority) { if ((priority < VIR_LOG_DEBUG) || (priority > VIR_LOG_ERROR)) { virReportError(VIR_ERR_INVALID_ARG, - _("Failed to set logging priority, argument '%u' is " - "invalid"), priority); + _("Failed to set logging priority, argument '%1$u' is invalid"), + priority); return -1; } if (virLogInitialize() < 0) @@ -689,7 +689,7 @@ virLogNewOutputToFile(virLogPriority priority, fd = open(file, O_CREAT | O_APPEND | O_WRONLY, S_IRUSR | S_IWUSR); if (fd < 0) { - virReportSystemError(errno, _("failed to open %s"), file); + virReportSystemError(errno, _("failed to open %1$s"), file); return NULL; } @@ -1195,8 +1195,8 @@ virLogParseDefaultPriority(const char *priority) return VIR_LOG_ERROR; virReportError(VIR_ERR_INVALID_ARG, - _("Failed to set logging priority, argument '%s' is " - "invalid"), priority); + _("Failed to set logging priority, argument '%1$s' is invalid"), + priority); return -1; } @@ -1326,7 +1326,7 @@ virLogFilterNew(const char *match, size_t mlen = strlen(match); if (priority < VIR_LOG_DEBUG || priority > VIR_LOG_ERROR) { - virReportError(VIR_ERR_INVALID_ARG, _("Invalid log priority %d"), + virReportError(VIR_ERR_INVALID_ARG, _("Invalid log priority %1$d"), priority); return NULL; } @@ -1493,21 +1493,21 @@ virLogParseOutput(const char *src) if (!(tokens = g_strsplit(src, ":", 0)) || (count = g_strv_length(tokens)) < 2) { virReportError(VIR_ERR_INVALID_ARG, - _("Malformed format for log output '%s'"), src); + _("Malformed format for log output '%1$s'"), src); return NULL; } if (virStrToLong_uip(tokens[0], NULL, 10, &prio) < 0 || (prio < VIR_LOG_DEBUG) || (prio > VIR_LOG_ERROR)) { virReportError(VIR_ERR_INVALID_ARG, - _("Invalid log priority '%s' for log output '%s'"), + _("Invalid log priority '%1$s' for log output '%2$s'"), tokens[0], src); return NULL; } if ((dest = virLogDestinationTypeFromString(tokens[1])) < 0) { virReportError(VIR_ERR_INVALID_ARG, - _("Invalid log destination '%s' for log output '%s'"), + _("Invalid log destination '%1$s' for log output '%2$s'"), tokens[1], src); return NULL; } @@ -1517,8 +1517,8 @@ virLogParseOutput(const char *src) ((dest == VIR_LOG_TO_FILE || dest == VIR_LOG_TO_SYSLOG) && count != 3)) { virReportError(VIR_ERR_INVALID_ARG, - _("Log output '%s' does not meet the format requirements " - "for destination type '%s'"), src, tokens[1]); + _("Log output '%1$s' does not meet the format requirements for destination type '%2$s'"), + src, tokens[1]); return NULL; } @@ -1587,14 +1587,14 @@ virLogParseFilter(const char *src) if (!(tokens = g_strsplit(src, ":", 0)) || !tokens[0] || !tokens[1]) { virReportError(VIR_ERR_INVALID_ARG, - _("Malformed format for filter '%s'"), src); + _("Malformed format for filter '%1$s'"), src); return NULL; } if (virStrToLong_uip(tokens[0], NULL, 10, &prio) < 0 || (prio < VIR_LOG_DEBUG) || (prio > VIR_LOG_ERROR)) { virReportError(VIR_ERR_INVALID_ARG, - _("Invalid priority '%s' for filter '%s'"), + _("Invalid priority '%1$s' for filter '%2$s'"), tokens[0], src); return NULL; } @@ -1610,7 +1610,7 @@ virLogParseFilter(const char *src) /* match string cannot comprise just from a single '+' */ if (!*match) { virReportError(VIR_ERR_INVALID_ARG, - _("Invalid match string '%s'"), tokens[1]); + _("Invalid match string '%1$s'"), tokens[1]); return NULL; } diff --git a/src/util/virmacmap.c b/src/util/virmacmap.c index 98be64fb31..41baf736ab 100644 --- a/src/util/virmacmap.c +++ b/src/util/virmacmap.c @@ -149,14 +149,14 @@ virMacMapLoadFile(virMacMap *mgr, if (!(map = virJSONValueFromString(map_str))) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("invalid json in file: %s"), + _("invalid json in file: %1$s"), file); return -1; } if (!virJSONValueIsArray(map)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Malformed file structure: %s"), + _("Malformed file structure: %1$s"), file); return -1; } @@ -182,7 +182,7 @@ virMacMapLoadFile(virMacMap *mgr, if (g_hash_table_contains(mgr->macs, domain)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("duplicate domain '%s'"), domain); + _("duplicate domain '%1$s'"), domain); return -1; } diff --git a/src/util/virmdev.c b/src/util/virmdev.c index 41d4cef8b9..d0f35ca347 100644 --- a/src/util/virmdev.c +++ b/src/util/virmdev.c @@ -85,7 +85,7 @@ virMediatedDeviceGetSysfsDeviceAPI(virMediatedDevice *dev, * kinds of devices */ if (!virFileExists(file)) { - virReportSystemError(errno, _("failed to read '%s'"), file); + virReportSystemError(errno, _("failed to read '%1$s'"), file); return -1; } @@ -116,15 +116,14 @@ virMediatedDeviceCheckModel(virMediatedDevice *dev, */ if ((actual_model = virMediatedDeviceModelTypeFromString(dev_api)) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("device API '%s' not supported yet"), + _("device API '%1$s' not supported yet"), dev_api); return -1; } if (actual_model != model) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("invalid device API '%s' for device %s: " - "device only supports '%s'"), + _("invalid device API '%1$s' for device %2$s: device only supports '%3$s'"), virMediatedDeviceModelTypeToString(model), dev->path, dev_api); return -1; @@ -143,7 +142,7 @@ virMediatedDeviceNew(const char *uuidstr, virMediatedDeviceModelType model) sysfspath = virMediatedDeviceGetSysfsPath(uuidstr); if (!virFileExists(sysfspath)) { virReportError(VIR_ERR_DEVICE_MISSING, - _("mediated device '%s' not found"), uuidstr); + _("mediated device '%1$s' not found"), uuidstr); return NULL; } @@ -222,12 +221,12 @@ virMediatedDeviceGetIOMMUGroupNum(const char *uuidstr) iommu_path = g_strdup_printf("%s/iommu_group", dev_path); if (!virFileExists(iommu_path)) { - virReportSystemError(errno, _("failed to access '%s'"), iommu_path); + virReportSystemError(errno, _("failed to access '%1$s'"), iommu_path); return -1; } if (virFileResolveLink(iommu_path, &result_path) < 0) { - virReportSystemError(errno, _("failed to resolve '%s'"), iommu_path); + virReportSystemError(errno, _("failed to resolve '%1$s'"), iommu_path); return -1; } @@ -299,7 +298,7 @@ virMediatedDeviceListAdd(virMediatedDeviceList *list, { if (virMediatedDeviceListFind(list, (*dev)->path)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("device %s is already in use"), (*dev)->path); + _("device %1$s is already in use"), (*dev)->path); return -1; } VIR_APPEND_ELEMENT(list->devs, list->count, *dev); @@ -402,8 +401,7 @@ virMediatedDeviceIsUsed(virMediatedDevice *dev, if ((tmp = virMediatedDeviceListFind(list, dev->path))) { virMediatedDeviceGetUsedBy(tmp, &drvname, &domname); virReportError(VIR_ERR_OPERATION_INVALID, - _("mediated device %s is in use by " - "driver %s, domain %s"), + _("mediated device %1$s is in use by driver %2$s, domain %3$s"), tmp->path, drvname, domname); } diff --git a/src/util/virmodule.c b/src/util/virmodule.c index 36cf77ac46..2b78068814 100644 --- a/src/util/virmodule.c +++ b/src/util/virmodule.c @@ -51,7 +51,7 @@ virModuleLoadFile(const char *file) if (!(handle = dlopen(file, flags))) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to load module '%s': %s"), file, dlerror()); + _("Failed to load module '%1$s': %2$s"), file, dlerror()); return NULL; } @@ -70,7 +70,7 @@ virModuleLoadFunc(void *handle, if (!(regsym = dlsym(handle, funcname))) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to find symbol '%s' in module '%s': %s"), + _("Failed to find symbol '%1$s' in module '%2$s': %3$s"), funcname, file, dlerror()); return NULL; } @@ -107,7 +107,7 @@ virModuleLoad(const char *path, if (!virFileExists(path)) { if (required) { virReportSystemError(errno, - _("Failed to find module '%s'"), path); + _("Failed to find module '%1$s'"), path); return -1; } else { VIR_INFO("Module '%s' does not exist", path); @@ -126,7 +126,7 @@ virModuleLoad(const char *path, * just make sure */ if (virGetLastErrorCode() == VIR_ERR_OK) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to execute symbol '%s' in module '%s'"), + _("Failed to execute symbol '%1$s' in module '%2$s'"), regfunc, path); } goto cleanup; @@ -150,7 +150,7 @@ virModuleLoad(const char *path, VIR_DEBUG("dlopen not available on this platform"); if (required) { virReportSystemError(ENOSYS, - _("Failed to find module '%s'"), path); + _("Failed to find module '%1$s'"), path); return -1; } else { /* Since we have no dlopen(), but definition we have no diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 62d8162e03..38a4f480eb 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -147,7 +147,7 @@ static int virNetDevSetupControlFull(const char *ifname, if (virStrcpyStatic(ifr->ifr_name, ifname) < 0) { virReportSystemError(ERANGE, - _("Network interface name '%s' is too long"), + _("Network interface name '%1$s' is too long"), ifname); return -1; } @@ -210,7 +210,7 @@ int virNetDevExists(const char *ifname) if (errno == ENODEV || errno == ENXIO) return 0; - virReportSystemError(errno, _("Unable to check interface flags for %s"), + virReportSystemError(errno, _("Unable to check interface flags for %1$s"), ifname); return -1; } @@ -221,7 +221,7 @@ int virNetDevExists(const char *ifname) int virNetDevExists(const char *ifname) { virReportSystemError(ENOSYS, - _("Unable to check interface %s"), ifname); + _("Unable to check interface %1$s"), ifname); return -1; } #endif @@ -255,7 +255,7 @@ virNetDevSetMACInternal(const char *ifname, /* To fill ifr.ifr_hdaddr.sa_family field */ if (ioctl(fd, SIOCGIFHWADDR, &ifr) < 0) { - virReportSystemError(errno, _("Cannot get interface MAC on '%s'"), + virReportSystemError(errno, _("Cannot get interface MAC on '%1$s'"), ifname); VIR_DEBUG("SIOCSIFHWADDR %s get MAC - Fail", ifname); @@ -274,7 +274,7 @@ virNetDevSetMACInternal(const char *ifname, } virReportSystemError(errno, - _("Cannot set interface MAC to %s on '%s'"), + _("Cannot set interface MAC to %1$s on '%2$s'"), virMacAddrFormat(macaddr, macstr), ifname); return -1; } @@ -318,7 +318,7 @@ virNetDevSetMACInternal(const char *ifname, } virReportSystemError(errno, - _("Cannot set interface MAC to %s on '%s'"), + _("Cannot set interface MAC to %1$s on '%2$s'"), mac + 1, ifname); return -1; } @@ -337,7 +337,7 @@ virNetDevSetMACInternal(const char *ifname, bool quiet G_GNUC_UNUSED) { virReportSystemError(ENOSYS, - _("Cannot set interface MAC on '%s'"), + _("Cannot set interface MAC on '%1$s'"), ifname); return -1; } @@ -375,7 +375,7 @@ int virNetDevGetMAC(const char *ifname, if (ioctl(fd, SIOCGIFHWADDR, &ifr) < 0) { virReportSystemError(errno, - _("Cannot get interface MAC on '%s'"), + _("Cannot get interface MAC on '%1$s'"), ifname); return -1; } @@ -389,7 +389,7 @@ int virNetDevGetMAC(const char *ifname, virMacAddr *macaddr G_GNUC_UNUSED) { virReportSystemError(ENOSYS, - _("Cannot get interface MAC on '%s'"), + _("Cannot get interface MAC on '%1$s'"), ifname); return -1; } @@ -415,7 +415,7 @@ int virNetDevGetMTU(const char *ifname) if (ioctl(fd, SIOCGIFMTU, &ifr) < 0) { virReportSystemError(errno, - _("Cannot get interface MTU on '%s'"), + _("Cannot get interface MTU on '%1$s'"), ifname); return -1; } @@ -426,7 +426,7 @@ int virNetDevGetMTU(const char *ifname) int virNetDevGetMTU(const char *ifname) { virReportSystemError(ENOSYS, - _("Cannot get interface MTU on '%s'"), + _("Cannot get interface MTU on '%1$s'"), ifname); return -1; } @@ -456,7 +456,7 @@ int virNetDevSetMTU(const char *ifname, int mtu) if (ioctl(fd, SIOCSIFMTU, &ifr) < 0) { virReportSystemError(errno, - _("Cannot set interface MTU on '%s'"), + _("Cannot set interface MTU on '%1$s'"), ifname); return -1; } @@ -467,7 +467,7 @@ int virNetDevSetMTU(const char *ifname, int mtu) int virNetDevSetMTU(const char *ifname, int mtu G_GNUC_UNUSED) { virReportSystemError(ENOSYS, - _("Cannot set interface MTU on '%s'"), + _("Cannot set interface MTU on '%1$s'"), ifname); return -1; } @@ -559,7 +559,7 @@ int virNetDevSetName(const char* ifname, const char *newifname) # ifdef WITH_STRUCT_IFREQ_IFR_NEWNAME if (virStrcpyStatic(ifr.ifr_newname, newifname) < 0) { virReportSystemError(ERANGE, - _("Network interface name '%s' is too long"), + _("Network interface name '%1$s' is too long"), newifname); return -1; } @@ -569,7 +569,7 @@ int virNetDevSetName(const char* ifname, const char *newifname) if (ioctl(fd, SIOCSIFNAME, &ifr)) { virReportSystemError(errno, - _("Unable to rename '%s' to '%s'"), + _("Unable to rename '%1$s' to '%2$s'"), ifname, newifname); return -1; } @@ -580,7 +580,7 @@ int virNetDevSetName(const char* ifname, const char *newifname) int virNetDevSetName(const char* ifname, const char *newifname) { virReportSystemError(ENOSYS, - _("Cannot rename interface '%s' to '%s' on this platform"), + _("Cannot rename interface '%1$s' to '%2$s' on this platform"), ifname, newifname); return -1; } @@ -600,7 +600,7 @@ virNetDevSetIFFlag(const char *ifname, int flag, bool val) if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0) { virReportSystemError(errno, - _("Cannot get interface flags on '%s'"), + _("Cannot get interface flags on '%1$s'"), ifname); return -1; } @@ -614,7 +614,7 @@ virNetDevSetIFFlag(const char *ifname, int flag, bool val) ifr.ifr_flags = ifflags; if (ioctl(fd, SIOCSIFFLAGS, &ifr) < 0) { virReportSystemError(errno, - _("Cannot set interface flags on '%s'"), + _("Cannot set interface flags on '%1$s'"), ifname); return -1; } @@ -629,7 +629,7 @@ virNetDevSetIFFlag(const char *ifname, bool val G_GNUC_UNUSED) { virReportSystemError(ENOSYS, - _("Cannot set interface flags on '%s'"), + _("Cannot set interface flags on '%1$s'"), ifname); return -1; } @@ -720,7 +720,7 @@ virNetDevGetIFFlag(const char *ifname, int flag, bool *val) if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0) { virReportSystemError(errno, - _("Cannot get interface flags on '%s'"), + _("Cannot get interface flags on '%1$s'"), ifname); return -1; } @@ -735,7 +735,7 @@ virNetDevGetIFFlag(const char *ifname, bool *val G_GNUC_UNUSED) { virReportSystemError(ENOSYS, - _("Cannot get interface flags on '%s'"), + _("Cannot get interface flags on '%1$s'"), ifname); return -1; } @@ -818,7 +818,7 @@ char *virNetDevGetName(int ifindex) if (!if_indextoname(ifindex, name)) { virReportSystemError(errno, - _("Failed to convert interface index %d to a name"), + _("Failed to convert interface index %1$d to a name"), ifindex); return NULL; } @@ -829,7 +829,7 @@ char *virNetDevGetName(int ifindex) char *virNetDevGetName(int ifindex) { virReportSystemError(ENOSYS, - _("Cannot get interface name for index '%i'"), + _("Cannot get interface name for index '%1$i'"), ifindex); return NULL; } @@ -860,14 +860,14 @@ int virNetDevGetIndex(const char *ifname, int *ifindex) if (virStrcpyStatic(ifreq.ifr_name, ifname) < 0) { virReportSystemError(ERANGE, - _("invalid interface name %s"), + _("invalid interface name %1$s"), ifname); return -1; } if (ioctl(fd, SIOCGIFINDEX, &ifreq) < 0) { virReportSystemError(errno, - _("Unable to get index for interface %s"), ifname); + _("Unable to get index for interface %1$s"), ifname); return -1; } @@ -973,14 +973,14 @@ int virNetDevGetVLanID(const char *ifname, int *vlanid) if (virStrcpyStatic(vlanargs.device1, ifname) < 0) { virReportSystemError(ERANGE, - _("invalid interface name %s"), + _("invalid interface name %1$s"), ifname); return -1; } if (ioctl(fd, SIOCGIFVLAN, &vlanargs) != 0) { virReportSystemError(errno, - _("Unable to get VLAN for interface %s"), ifname); + _("Unable to get VLAN for interface %1$s"), ifname); return -1; } @@ -1033,7 +1033,7 @@ int virNetDevValidateConfig(const char *ifname, return 0; virReportSystemError(errno, - _("could not get MAC address of interface %s"), + _("could not get MAC address of interface %1$s"), ifname); return -1; } @@ -1110,7 +1110,7 @@ virNetDevIsPCIDevice(const char *devpath) if (virFileResolveLink(subsys_link, &abs_path) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to resolve device subsystem symlink %s"), + _("Unable to resolve device subsystem symlink %1$s"), subsys_link); return false; } @@ -1371,7 +1371,7 @@ virNetDevGetVirtualFunctionInfo(const char *vfname, char **pfname, * VFINFO does. */ virReportError(VIR_ERR_INTERNAL_ERROR, - _("The PF device for VF %s has no network device name, cannot get virtual function info"), + _("The PF device for VF %1$s has no network device name, cannot get virtual function info"), vfname); return -1; } @@ -1596,7 +1596,7 @@ virNetDevSetVfVlan(const char *ifname, if (vlanid) { /* VLAN ids 0 and 4095 are reserved per 802.1Q but are valid values. */ if ((*vlanid < 0 || *vlanid > 4095)) { - virReportError(ERANGE, _("vlanid out of range: %d"), *vlanid); + virReportError(ERANGE, _("vlanid out of range: %1$d"), *vlanid); return -ERANGE; } ifla_vf_vlan.vlan = *vlanid; @@ -1615,7 +1615,7 @@ virNetDevSetVfVlan(const char *ifname, ret = 0; } else if (ret < 0) { virReportSystemError(-ret, - _("Cannot set interface vlanid to %d for ifname %s vf %d"), + _("Cannot set interface vlanid to %1$d for ifname %2$s vf %3$d"), ifla_vf_vlan.vlan, ifname ? ifname : "(unspecified)", vf); } @@ -1638,7 +1638,7 @@ virNetDevSetVfMac(const char *ifname, int vf, if (macaddr == NULL || allowRetry == NULL) { virReportError(EINVAL, - _("Invalid parameters macaddr=%p allowRetry=%p"), + _("Invalid parameters macaddr=%1$p allowRetry=%2$p"), macaddr, allowRetry); return -EINVAL; } @@ -1654,7 +1654,7 @@ virNetDevSetVfMac(const char *ifname, int vf, } else if (ret < 0) { /* other errors are permanent */ virReportSystemError(-ret, - _("Cannot set interface MAC to %s for ifname %s vf %d"), + _("Cannot set interface MAC to %1$s for ifname %2$s vf %3$d"), macaddr ? virMacAddrFormat(macaddr, macstr) : "(unchanged)", ifname ? ifname : "(unspecified)", vf); @@ -1761,8 +1761,8 @@ virNetDevParseVfInfo(struct nlattr **tb, int32_t vf, virMacAddr *mac, } if (rc < 0) virReportError(VIR_ERR_INTERNAL_ERROR, - _("couldn't find IFLA_VF_INFO for VF %d " - "in netlink response"), vf); + _("couldn't find IFLA_VF_INFO for VF %1$d in netlink response"), + vf); return rc; } @@ -1803,7 +1803,7 @@ virNetDevVFInterfaceStats(virPCIDeviceAddress *vfAddr, return -1; if (!virPCIIsVirtualFunction(vfSysfsPath)) { - virReportError(VIR_ERR_INTERNAL_ERROR, _("'%s' is not a VF device"), vfSysfsPath); + virReportError(VIR_ERR_INTERNAL_ERROR, _("'%1$s' is not a VF device"), vfSysfsPath); return -1; } @@ -1921,10 +1921,7 @@ virNetDevSaveNetConfig(const char *linkdev, int vf, if (!pfIsOnline) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to configure VF %d of PF '%s' " - "because the PF is not online. Please " - "change host network config to put the " - "PF online."), + _("Unable to configure VF %1$d of PF '%2$s' because the PF is not online. Please change host network config to put the PF online."), vf, pfDevName); return -1; } @@ -1973,8 +1970,9 @@ virNetDevSaveNetConfig(const char *linkdev, int vf, return -1; if (virFileWriteStr(filePath, fileStr, 0600) < 0) { - virReportSystemError(errno, _("Unable to preserve mac/vlan tag " - "for device = %s, vf = %d"), linkdev, vf); + virReportSystemError(errno, + _("Unable to preserve mac/vlan tag for device = %1$s, vf = %2$d"), + linkdev, vf); return -1; } @@ -2097,7 +2095,7 @@ virNetDevReadNetConfig(const char *linkdev, int vf, if ((virStrToLong_i(vlanStr, &endptr, 10, &vlanTag) < 0) || (endptr && *endptr != '\n' && *endptr != 0)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse vlan tag '%s' from file '%s'"), + _("cannot parse vlan tag '%1$s' from file '%2$s'"), vlanStr, filePath); goto cleanup; } @@ -2112,8 +2110,7 @@ virNetDevReadNetConfig(const char *linkdev, int vf, */ if (!(configJSON = virJSONValueFromString(fileStr))) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("invalid json in net device saved " - "config file '%s': '%.60s'"), + _("invalid json in net device saved config file '%1$s': '%2$.60s'"), filePath, fileStr); goto cleanup; } @@ -2128,9 +2125,7 @@ virNetDevReadNetConfig(const char *linkdev, int vf, if (!(MACStr || adminMACStr)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("network device saved config file '%s' " - "has unexpected contents, missing both " - "'MAC' and 'adminMAC': '%.60s'"), + _("network device saved config file '%1$s' has unexpected contents, missing both 'MAC' and 'adminMAC': '%2$.60s'"), filePath, fileStr); goto cleanup; } @@ -2141,7 +2136,7 @@ virNetDevReadNetConfig(const char *linkdev, int vf, if (virMacAddrParse(MACStr, *MAC) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse MAC address '%s' from file '%s'"), + _("cannot parse MAC address '%1$s' from file '%2$s'"), MACStr, filePath); goto cleanup; } @@ -2152,7 +2147,7 @@ virNetDevReadNetConfig(const char *linkdev, int vf, if (virMacAddrParse(adminMACStr, *adminMAC) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse MAC address '%s' from file '%s'"), + _("cannot parse MAC address '%1$s' from file '%2$s'"), adminMACStr, filePath); goto cleanup; } @@ -2241,15 +2236,15 @@ virNetDevSetNetConfig(const char *linkdev, int vf, */ if (adminMAC) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("admin MAC can only be set for SR-IOV VFs, but " - "%s is not a VF"), linkdev); + _("admin MAC can only be set for SR-IOV VFs, but %1$s is not a VF"), + linkdev); return -1; } if (vlan) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("vlan can only be set for SR-IOV VFs, but " - "%s is not a VF"), linkdev); + _("vlan can only be set for SR-IOV VFs, but %1$s is not a VF"), + linkdev); return -1; } @@ -2264,8 +2259,7 @@ virNetDevSetNetConfig(const char *linkdev, int vf, if (!setVlan) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("vlan tag set for interface %s but " - "caller requested it not be set")); + _("vlan tag set for interface %1$s but caller requested it not be set")); return -1; } @@ -2288,8 +2282,7 @@ virNetDevSetNetConfig(const char *linkdev, int vf, if (!linkdev) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("VF %d of PF '%s' is not bound to a net driver, " - "so its MAC address cannot be set to %s"), + _("VF %1$d of PF '%2$s' is not bound to a net driver, so its MAC address cannot be set to %3$s"), vf, pfDevName, virMacAddrFormat(MAC, MACStr)); return -1; } @@ -2545,14 +2538,14 @@ virNetDevGetLinkInfo(const char *ifname, if (virFileReadAll(path, 1024, &buf) < 0) { virReportSystemError(errno, - _("unable to read: %s"), + _("unable to read: %1$s"), path); return -1; } if (!(tmp = strchr(buf, '\n'))) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to parse: %s"), + _("Unable to parse: %1$s"), buf); return -1; } @@ -2563,7 +2556,7 @@ virNetDevGetLinkInfo(const char *ifname, * virInterfaceState enum starts from 1. */ if ((tmp_state = virNetDevIfStateTypeFromString(buf)) <= 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to parse: %s"), + _("Unable to parse: %1$s"), buf); return -1; } @@ -2590,7 +2583,7 @@ virNetDevGetLinkInfo(const char *ifname, if (errno == EINVAL) return 0; virReportSystemError(errno, - _("unable to read: %s"), + _("unable to read: %1$s"), path); return -1; } @@ -2598,7 +2591,7 @@ virNetDevGetLinkInfo(const char *ifname, if (virStrToLong_ui(buf, &tmp, 10, &tmp_speed) < 0 || *tmp != '\n') { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to parse: %s"), + _("Unable to parse: %1$s"), buf); return -1; } @@ -2650,7 +2643,7 @@ int virNetDevAddMulti(const char *ifname, if (ioctl(fd, SIOCADDMULTI, &ifr) < 0) { char macstr[VIR_MAC_STRING_BUFLEN]; virReportSystemError(errno, - _("Cannot add multicast MAC %s on '%s' interface"), + _("Cannot add multicast MAC %1$s on '%2$s' interface"), virMacAddrFormat(macaddr, macstr), ifname); return -1; } @@ -2695,7 +2688,7 @@ int virNetDevDelMulti(const char *ifname, if (ioctl(fd, SIOCDELMULTI, &ifr) < 0) { char macstr[VIR_MAC_STRING_BUFLEN]; virReportSystemError(errno, - _("Cannot add multicast MAC %s on '%s' interface"), + _("Cannot add multicast MAC %1$s on '%2$s' interface"), virMacAddrFormat(macaddr, macstr), ifname); return -1; } @@ -2728,7 +2721,7 @@ static int virNetDevParseMcast(char *buf, virNetDevMcastEntry *mcast) if (token == NULL) { virReportSystemError(EINVAL, - _("failed to parse multicast address from '%s'"), + _("failed to parse multicast address from '%1$s'"), buf); return -1; } @@ -2737,7 +2730,7 @@ static int virNetDevParseMcast(char *buf, virNetDevMcastEntry *mcast) case VIR_MCAST_TYPE_INDEX_TOKEN: if (virStrToLong_i(token, &endptr, 10, &num) < 0) { virReportSystemError(EINVAL, - _("Failed to parse interface index from '%s'"), + _("Failed to parse interface index from '%1$s'"), buf); return -1; @@ -2747,7 +2740,7 @@ static int virNetDevParseMcast(char *buf, virNetDevMcastEntry *mcast) case VIR_MCAST_TYPE_NAME_TOKEN: if (virStrcpy(mcast->name, token, VIR_MCAST_NAME_LEN) < 0) { virReportSystemError(EINVAL, - _("Failed to parse network device name from '%s'"), + _("Failed to parse network device name from '%1$s'"), buf); return -1; } @@ -2755,7 +2748,7 @@ static int virNetDevParseMcast(char *buf, virNetDevMcastEntry *mcast) case VIR_MCAST_TYPE_USERS_TOKEN: if (virStrToLong_i(token, &endptr, 10, &num) < 0) { virReportSystemError(EINVAL, - _("Failed to parse users from '%s'"), + _("Failed to parse users from '%1$s'"), buf); return -1; @@ -2765,7 +2758,7 @@ static int virNetDevParseMcast(char *buf, virNetDevMcastEntry *mcast) case VIR_MCAST_TYPE_GLOBAL_TOKEN: if (virStrToLong_i(token, &endptr, 10, &num) < 0) { virReportSystemError(EINVAL, - _("Failed to parse users from '%s'"), + _("Failed to parse users from '%1$s'"), buf); return -1; @@ -2776,7 +2769,7 @@ static int virNetDevParseMcast(char *buf, virNetDevMcastEntry *mcast) if (virMacAddrParseHex((const char*)token, &mcast->macaddr) < 0) { virReportSystemError(EINVAL, - _("Failed to parse MAC address from '%s'"), + _("Failed to parse MAC address from '%1$s'"), buf); } break; @@ -3031,7 +3024,7 @@ virNetDevSendEthtoolIoctl(const char *ifname, int fd, struct ifreq *ifr) VIR_DEBUG("ethtool ioctl: request not supported on %s", ifname); break; default: - virReportSystemError(errno, _("ethtool ioctl error on %s"), ifname); + virReportSystemError(errno, _("ethtool ioctl error on %1$s"), ifname); break; } } @@ -3361,7 +3354,7 @@ int virNetDevSetCoalesce(const char *ifname, if (virNetDevSendEthtoolIoctl(ifname, fd, &ifr) < 0) { virReportSystemError(errno, - _("Cannot set coalesce info on '%s'"), + _("Cannot set coalesce info on '%1$s'"), ifname); return -1; } @@ -3454,7 +3447,7 @@ int virNetDevSetCoalesce(const char *ifname, return 0; virReportSystemError(ENOSYS, - _("Cannot set coalesce info on interface '%s'"), + _("Cannot set coalesce info on interface '%1$s'"), ifname); return -1; } @@ -3595,7 +3588,7 @@ virNetDevGenerateName(char **ifname, virNetDevGenNameType type) } while (++attempts < 10000); virReportError(VIR_ERR_INTERNAL_ERROR, - _("no unused %s names available"), + _("no unused %1$s names available"), prefix); return -1; }