if (safewrite(fd, &c, sizeof(c)) != sizeof(c)) {
virReportSystemError(errno,
- _("Unable to write to %s"),
+ _("Unable to write to %1$s"),
fdname);
return -1;
}
if (saferead(fd, &c, sizeof(c)) != sizeof(c)) {
virReportSystemError(errno,
- _("Unable to read from %s"),
+ _("Unable to read from %1$s"),
fdname);
return NULL;
}
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;
}
if ((got = saferead(fdin, buf, buflen)) < 0) {
virReportSystemError(errno,
- _("Unable to read %s"),
+ _("Unable to read %1$s"),
fdinname);
return -1;
}
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;
}
if ((r = safewrite(fdout, buf, count)) < 0) {
virReportSystemError(errno,
- _("Unable to write %s"),
+ _("Unable to write %1$s"),
fdoutname);
return -1;
}
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;
}
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;
}
if (fstat(fd, &sb) < 0) {
virReportSystemError(errno,
- _("Unable to access stream for '%s'"),
+ _("Unable to access stream for '%1$s'"),
path);
goto error;
}
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;
}
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;
}
{
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;
}
if (tcgetattr(fdst->fd, &rawattr) < 0) {
virReportSystemError(errno,
- _("unable to get tty attributes: %s"),
+ _("unable to get tty attributes: %1$s"),
path);
goto cleanup;
}
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;
}
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;
}
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;
}
}
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;
}
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;
}
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;
}
_("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;
}
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;
}
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;
}
if (stat(path, &sb) < 0) {
- virReportSystemError(errno, _("cannot stat '%s'"), path);
+ virReportSystemError(errno, _("cannot stat '%1$s'"), path);
return -1;
}
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;
}
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;
}
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;
}
VIR_FORCE_CLOSE(fd);
virReportSystemError(errno,
- _("Unable to get loop status on %s"),
+ _("Unable to get loop status on %1$s"),
looppath);
goto cleanup;
}
/* 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;
}
return 0;
else
virReportSystemError(errno,
- _("Cannot check NBD device %s pid"),
+ _("Cannot check NBD device %1$s pid"),
dev_name);
return -1;
}
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;
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;
}
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;
}
} else {
if (unlink(filepath) < 0 && errno != ENOENT) {
virReportSystemError(errno,
- _("Cannot delete file '%s'"),
+ _("Cannot delete file '%1$s'"),
filepath);
return -1;
}
if (rmdir(dir) < 0 && errno != ENOENT) {
virReportSystemError(errno,
- _("Cannot delete directory '%s'"),
+ _("Cannot delete directory '%1$s'"),
dir);
return -1;
}
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;
}
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;
}
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;
}
if (!(procmnt = setmntent(mtabpath, "r"))) {
virReportSystemError(errno,
- _("Failed to read %s"), mtabpath);
+ _("Failed to read %1$s"), mtabpath);
return -1;
}
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
(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;
(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;
}
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;
}
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;
}
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;
}
/* 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;
}
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;
}
if (stat(path, &st) == -1) {
ret = -errno;
- virReportSystemError(errno, _("stat of '%s' failed"), path);
+ virReportSystemError(errno, _("stat of '%1$s' failed"), path);
goto error;
}
(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;
}
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;
}
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;
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;
}
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;
}
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;
*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;
}
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;
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;
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;
}
if ((p = strrchr(dirpath, '/')) == NULL) {
virReportSystemError(EINVAL,
- _("Invalid relative path '%s'"), path);
+ _("Invalid relative path '%1$s'"), path);
return -1;
}
if (statfs_ret < 0) {
virReportSystemError(errno,
- _("cannot determine filesystem for '%s'"),
+ _("cannot determine filesystem for '%1$s'"),
path);
return -1;
}
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;
}
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;
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;
}
if (!(f = setmntent(PROC_MOUNTS, "r"))) {
virReportSystemError(errno,
- _("Unable to open %s"),
+ _("Unable to open %1$s"),
PROC_MOUNTS);
goto cleanup;
}
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;
}
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;
}
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 {
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
{
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;
}
{
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;
}
{
errno = ENOSYS;
virReportSystemError(errno,
- _("Unable to set XATTR %s on %s"),
+ _("Unable to set XATTR %1$s on %2$s"),
name, path);
return -1;
}
{
errno = ENOSYS;
virReportSystemError(errno,
- _("Unable to remove XATTR %s on %s"),
+ _("Unable to remove XATTR %1$s on %2$s"),
name, path);
return -1;
}
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);
}
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;
}
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;
}
}
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;
}
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 {
#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;
}
}
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)
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;
}
}
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;
}
}
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;
}
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;
}
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;
}
}
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;
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;
}
goto cleanup;
}
virReportSystemError(errno,
- _("Unable to access cache '%s' for '%s'"),
+ _("Unable to access cache '%1$s' for '%2$s'"),
file, name);
goto cleanup;
}
if (!bin) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unknown firewall layer %d"),
+ _("Unknown firewall layer %1$d"),
rule->layer);
return -1;
}
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;
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;
}
if ((backend = virFirewallDBackendTypeFromString(backendStr)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unrecognized firewalld backend type: %s"),
+ _("Unrecognized firewalld backend type: %1$s"),
backendStr);
return -1;
}
if (!ipv) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unknown firewall layer %d"),
+ _("Unknown firewall layer %1$d"),
layer);
return -1;
}
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;
}
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;
}
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;
}
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;
}
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;
}
if (driver == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Invalid hook name for #%d"), no);
+ _("Invalid hook name for #%1$d"), no);
return -1;
}
}
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;
}
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;
}
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;
}
if (cpuNum >= cpu_times_num) {
virReportInvalidArg(cpuNum,
- _("Invalid cpuNum in %s"),
+ _("Invalid cpuNum in %1$s"),
__FUNCTION__);
return -1;
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
virReportInvalidArg(cpuNum,
- _("Invalid cpuNum in %s"),
+ _("Invalid cpuNum in %1$s"),
__FUNCTION__);
return -1;
if (!cpuinfo) {
virReportSystemError(errno,
- _("cannot open %s"), CPUINFO_PATH);
+ _("cannot open %1$s"), CPUINFO_PATH);
return -1;
}
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);
* 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;
}
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;
}
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;
}
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;
}
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;
}
*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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
if (!meminfo) {
virReportSystemError(errno,
- _("cannot open %s"), meminfo_path);
+ _("cannot open %1$s"), meminfo_path);
return -1;
}
ret = virHostMemGetStatsLinux(meminfo, cellNum, params, nparams);
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;
}
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;
}
}
if (rc < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to parse %s"), field);
+ _("failed to parse %1$s"), field);
return -1;
}
{
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;
}
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;
}
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;
}
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;
}
* 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;
}
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;
}
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;
}
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;
}
}
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;
}
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;
}
if (errno != ENOENT) {
virReportSystemError(errno,
- _("Cannot open init control %s"),
+ _("Cannot open init control %1$s"),
fifo);
goto cleanup;
}
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;
}
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;
}
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;
error:
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("malformed output of %s: %s"),
+ _("malformed output of %1$s: %2$s"),
ISCSIADM, line);
goto cleanup;
}
* 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;
}
* 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;
}
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:
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;
}
/* 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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
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;
}
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);
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 {
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;
}
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;
}
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;
}
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;
}
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;
}
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;
} 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;
}
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;
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;
}
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;
}
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;
}
if (unlink(respath) < 0 &&
errno != ENOENT) {
virReportSystemError(errno,
- _("Unable to delete lockspace resource %s"),
+ _("Unable to delete lockspace resource %1$s"),
respath);
return -1;
}
return 0;
}
virReportError(VIR_ERR_RESOURCE_BUSY,
- _("Lockspace resource '%s' is locked"),
+ _("Lockspace resource '%1$s' is locked"),
resname);
return -1;
}
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;
}
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;
}
{
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)
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;
}
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;
}
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;
}
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;
}
((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;
}
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;
}
/* 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;
}
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;
}
if (g_hash_table_contains(mgr->macs, domain)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("duplicate domain '%s'"), domain);
+ _("duplicate domain '%1$s'"), domain);
return -1;
}
* kinds of devices
*/
if (!virFileExists(file)) {
- virReportSystemError(errno, _("failed to read '%s'"), file);
+ virReportSystemError(errno, _("failed to read '%1$s'"), file);
return -1;
}
*/
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;
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;
}
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;
}
{
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);
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);
}
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;
}
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;
}
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);
* 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;
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
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;
}
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;
}
int virNetDevExists(const char *ifname)
{
virReportSystemError(ENOSYS,
- _("Unable to check interface %s"), ifname);
+ _("Unable to check interface %1$s"), ifname);
return -1;
}
#endif
/* 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);
}
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;
}
}
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;
}
bool quiet G_GNUC_UNUSED)
{
virReportSystemError(ENOSYS,
- _("Cannot set interface MAC on '%s'"),
+ _("Cannot set interface MAC on '%1$s'"),
ifname);
return -1;
}
if (ioctl(fd, SIOCGIFHWADDR, &ifr) < 0) {
virReportSystemError(errno,
- _("Cannot get interface MAC on '%s'"),
+ _("Cannot get interface MAC on '%1$s'"),
ifname);
return -1;
}
virMacAddr *macaddr G_GNUC_UNUSED)
{
virReportSystemError(ENOSYS,
- _("Cannot get interface MAC on '%s'"),
+ _("Cannot get interface MAC on '%1$s'"),
ifname);
return -1;
}
if (ioctl(fd, SIOCGIFMTU, &ifr) < 0) {
virReportSystemError(errno,
- _("Cannot get interface MTU on '%s'"),
+ _("Cannot get interface MTU on '%1$s'"),
ifname);
return -1;
}
int virNetDevGetMTU(const char *ifname)
{
virReportSystemError(ENOSYS,
- _("Cannot get interface MTU on '%s'"),
+ _("Cannot get interface MTU on '%1$s'"),
ifname);
return -1;
}
if (ioctl(fd, SIOCSIFMTU, &ifr) < 0) {
virReportSystemError(errno,
- _("Cannot set interface MTU on '%s'"),
+ _("Cannot set interface MTU on '%1$s'"),
ifname);
return -1;
}
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;
}
# 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;
}
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;
}
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;
}
if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0) {
virReportSystemError(errno,
- _("Cannot get interface flags on '%s'"),
+ _("Cannot get interface flags on '%1$s'"),
ifname);
return -1;
}
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;
}
bool val G_GNUC_UNUSED)
{
virReportSystemError(ENOSYS,
- _("Cannot set interface flags on '%s'"),
+ _("Cannot set interface flags on '%1$s'"),
ifname);
return -1;
}
if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0) {
virReportSystemError(errno,
- _("Cannot get interface flags on '%s'"),
+ _("Cannot get interface flags on '%1$s'"),
ifname);
return -1;
}
bool *val G_GNUC_UNUSED)
{
virReportSystemError(ENOSYS,
- _("Cannot get interface flags on '%s'"),
+ _("Cannot get interface flags on '%1$s'"),
ifname);
return -1;
}
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;
}
char *virNetDevGetName(int ifindex)
{
virReportSystemError(ENOSYS,
- _("Cannot get interface name for index '%i'"),
+ _("Cannot get interface name for index '%1$i'"),
ifindex);
return NULL;
}
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;
}
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;
}
return 0;
virReportSystemError(errno,
- _("could not get MAC address of interface %s"),
+ _("could not get MAC address of interface %1$s"),
ifname);
return -1;
}
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;
}
* 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;
}
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;
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);
}
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;
}
} 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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
*/
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;
}
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;
}
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;
}
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;
}
*/
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;
}
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;
}
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;
}
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;
}
* 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;
}
if (errno == EINVAL)
return 0;
virReportSystemError(errno,
- _("unable to read: %s"),
+ _("unable to read: %1$s"),
path);
return -1;
}
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;
}
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;
}
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;
}
if (token == NULL) {
virReportSystemError(EINVAL,
- _("failed to parse multicast address from '%s'"),
+ _("failed to parse multicast address from '%1$s'"),
buf);
return -1;
}
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;
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;
}
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;
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;
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;
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;
}
}
if (virNetDevSendEthtoolIoctl(ifname, fd, &ifr) < 0) {
virReportSystemError(errno,
- _("Cannot set coalesce info on '%s'"),
+ _("Cannot set coalesce info on '%1$s'"),
ifname);
return -1;
}
return 0;
virReportSystemError(ENOSYS,
- _("Cannot set coalesce info on interface '%s'"),
+ _("Cannot set coalesce info on interface '%1$s'"),
ifname);
return -1;
}
} while (++attempts < 10000);
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("no unused %s names available"),
+ _("no unused %1$s names available"),
prefix);
return -1;
}