usage(int status)
{
if (status) {
- fprintf(stderr, _("%s: try --help for more details"), program_name);
+ fprintf(stderr, _("%1$s: try --help for more details"), program_name);
} else {
- printf(_("Usage: %s FILENAME FD"), program_name);
+ printf(_("Usage: %1$s FILENAME FD"), program_name);
}
exit(status);
}
if (virGettextInitialize() < 0 ||
virErrorInitialize() < 0) {
- fprintf(stderr, _("%s: initialization failed"), program_name);
+ fprintf(stderr, _("%1$s: initialization failed"), program_name);
exit(EXIT_FAILURE);
}
usage(EXIT_SUCCESS);
if (argc == 3) { /* FILENAME FD */
if (virStrToLong_i(argv[2], NULL, 10, &fd) < 0) {
- fprintf(stderr, _("%s: malformed fd %s"),
+ fprintf(stderr, _("%1$s: malformed fd %2$s"),
program_name, argv[3]);
exit(EXIT_FAILURE);
}
return 0;
error:
- fprintf(stderr, _("%s: failure with %s: %s"),
+ fprintf(stderr, _("%1$s: failure with %2$s: %3$s"),
program_name, path, virGetLastErrorMessage());
exit(EXIT_FAILURE);
}
at = *countptr;
} else if (at > *countptr) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("out of bounds index - count %zu at %zu"),
+ _("out of bounds index - count %1$zu at %2$zu"),
*countptr, at);
return -1;
}
memset(&cred, 0, sizeof(virConnectCredential));
if (defaultUsername != NULL) {
- prompt = g_strdup_printf(_("Enter username for %s [%s]"), hostname,
+ prompt = g_strdup_printf(_("Enter username for %1$s [%2$s]"), hostname,
defaultUsername);
} else {
- prompt = g_strdup_printf(_("Enter username for %s"), hostname);
+ prompt = g_strdup_printf(_("Enter username for %1$s"), hostname);
}
for (ncred = 0; ncred < auth->ncredtype; ncred++) {
return NULL;
}
- prompt = g_strdup_printf(_("Enter %s's password for %s"), username, hostname);
+ prompt = g_strdup_printf(_("Enter %1$s's password for %2$s"), username, hostname);
if (!(cred = virAuthAskCredential(auth, prompt, false)))
return NULL;
if (!(authcred = g_key_file_get_string(auth->keyfile, authgroup, "credentials", NULL))) {
virReportError(VIR_ERR_CONF_SYNTAX,
- _("Missing item 'credentials' in group '%s' in '%s'"),
+ _("Missing item 'credentials' in group '%1$s' in '%2$s'"),
authgroup, auth->path);
return -1;
}
if (!g_key_file_has_group(auth->keyfile, credgroup)) {
virReportError(VIR_ERR_CONF_SYNTAX,
- _("Missing group 'credentials-%s' referenced from group '%s' in '%s'"),
+ _("Missing group 'credentials-%1$s' referenced from group '%2$s' in '%3$s'"),
authcred, authgroup, auth->path);
return -1;
}
error:
virReportError(VIR_ERR_INVALID_ARG,
- _("Failed to parse bitmap '%s'"), str);
+ _("Failed to parse bitmap '%1$s'"), str);
return -1;
}
if (strspn(string, "0123456789abcdefABCDEF") != len) {
virReportError(VIR_ERR_INVALID_ARG,
- _("Invalid hexadecimal string '%s'"), string);
+ _("Invalid hexadecimal string '%1$s'"), string);
return NULL;
}
&ccw->ssid,
&ccw->devno) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to parse CCW address '%s'"),
+ _("Failed to parse CCW address '%1$s'"),
address);
return NULL;
}
mapping = fopen(procfile, "r");
if (mapping == NULL) {
virReportSystemError(errno,
- _("Unable to open '%s'"),
+ _("Unable to open '%1$s'"),
procfile);
goto cleanup;
}
if (stat(path, &sb) < 0) {
virReportSystemError(errno,
- _("Path '%s' is not accessible"),
+ _("Path '%1$s' is not accessible"),
path);
return NULL;
}
if (!S_ISBLK(sb.st_mode)) {
virReportSystemError(EINVAL,
- _("Path '%s' must be a block device"),
+ _("Path '%1$s' must be a block device"),
path);
return NULL;
}
if (errno == EINVAL &&
(tmp = strrchr(path, '/'))) {
virReportSystemError(errno,
- _("Invalid value '%s' for '%s'"),
+ _("Invalid value '%1$s' for '%2$s'"),
value, tmp + 1);
return -1;
}
virReportSystemError(errno,
- _("Unable to write to '%s'"), path);
+ _("Unable to write to '%1$s'"), path);
return -1;
}
if ((rc = virFileReadAll(path, 1024*1024, value)) < 0) {
virReportSystemError(errno,
- _("Unable to read from '%s'"), path);
+ _("Unable to read from '%1$s'"), path);
return -1;
}
if (virStrToLong_ll(strval, NULL, 10, value) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to parse '%s' as an integer"),
+ _("Unable to parse '%1$s' as an integer"),
strval);
return -1;
}
if (virStrToLong_ull(strval, NULL, 10, value) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to parse '%s' as an integer"),
+ _("Unable to parse '%1$s' as an integer"),
strval);
return -1;
}
if (!g_path_is_absolute(path)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Partition path '%s' must start with '/'"),
+ _("Partition path '%1$s' must start with '/'"),
path);
return -1;
}
break;
case VIR_CGROUP_THREAD_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unexpected name value %d"), nameval);
+ _("unexpected name value %1$d"), nameval);
return -1;
}
{
if (controller >= VIR_CGROUP_CONTROLLER_LAST) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Invalid controller id '%d'"), controller);
+ _("Invalid controller id '%1$d'"), controller);
return -1;
}
return 1;
virReportSystemError(errno,
- _("Path '%s' is not accessible"),
+ _("Path '%1$s' is not accessible"),
path);
return -1;
}
return 1;
virReportSystemError(errno,
- _("Path '%s' is not accessible"),
+ _("Path '%1$s' is not accessible"),
path);
return -1;
}
if (start_cpu >= total_cpus) {
virReportError(VIR_ERR_INVALID_ARG,
- _("start_cpu %d larger than maximum of %d"),
+ _("start_cpu %1$d larger than maximum of %2$d"),
start_cpu, total_cpus - 1);
return -1;
}
if (errno == ENOENT)
return 0;
rc = -errno;
- VIR_ERROR(_("Unable to open %s (%d)"), grppath, errno);
+ VIR_ERROR(_("Unable to open %1$s (%2$d)"), grppath, errno);
return rc;
}
}
if (direrr < 0) {
rc = -errno;
- VIR_ERROR(_("Failed to readdir for %s (%d)"), grppath, errno);
+ VIR_ERROR(_("Failed to readdir for %1$s (%2$d)"), grppath, errno);
}
VIR_DEBUG("Removing cgroup %s", grppath);
if (rmdir(grppath) != 0 && errno != ENOENT) {
rc = -errno;
- VIR_ERROR(_("Unable to remove %s (%d)"), grppath, errno);
+ VIR_ERROR(_("Unable to remove %1$s (%2$d)"), grppath, errno);
}
return rc;
}
virReportSystemError(errno,
- _("Failed to read %s"),
+ _("Failed to read %1$s"),
keypath);
goto cleanup;
} else {
if (feof(fp))
break;
virReportSystemError(errno,
- _("Failed to read %s"),
+ _("Failed to read %1$s"),
keypath);
goto cleanup;
}
if (kill((pid_t)*pid_value, signum) < 0) {
if (errno != ESRCH) {
virReportSystemError(errno,
- _("Failed to kill process %lld"),
+ _("Failed to kill process %1$lld"),
*pid_value);
goto cleanup;
}
return -1;
if (stat(path, &st) < 0) {
- virReportSystemError(errno, _("failed to get stat for '%s'"), path);
+ virReportSystemError(errno, _("failed to get stat for '%1$s'"), path);
return -1;
}
{
if (virCgroupBackends[backend->type]) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cgroup backend '%s' already registered."),
+ _("Cgroup backend '%1$s' already registered."),
virCgroupBackendTypeToString(backend->type));
return;
}
virCgroupBackend *backend = virCgroupBackendForController(group, controller); \
if (!backend) { \
virReportError(VIR_ERR_INTERNAL_ERROR, \
- _("failed to get cgroup backend for '%s' controller '%u'"), \
+ _("failed to get cgroup backend for '%1$s' controller '%2$u'"), \
#func, controller); \
return ret; \
} \
if (!backend->func) { \
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, \
- _("operation '%s' not supported for backend '%s'"), \
+ _("operation '%1$s' not supported for backend '%2$s'"), \
#func, virCgroupBackendTypeToString(backend->type)); \
return ret; \
} \
dirName = strrchr(tmp, '/');
if (!dirName) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Missing '/' separator in cgroup mount '%s'"), tmp);
+ _("Missing '/' separator in cgroup mount '%1$s'"), tmp);
return -1;
}
VIR_WARN("Controller %s co-mounted at %s is missing symlink at %s",
typeStr, tmp, linkSrc);
} else {
- virReportSystemError(errno, _("Cannot stat %s"), linkSrc);
+ virReportSystemError(errno, _("Cannot stat %1$s"), linkSrc);
return -1;
}
} else {
if (!group->legacy[i].placement) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not find placement for v1 controller %s"),
+ _("Could not find placement for v1 controller %1$s"),
virCgroupV1ControllerTypeToString(i));
return -1;
}
if (STREQ_NULLABLE(group->legacy[i].mountPoint,
group->legacy[j].mountPoint)) {
virReportSystemError(EINVAL,
- _("V1 controller '%s' is not wanted, but '%s' is co-mounted"),
+ _("V1 controller '%1$s' is not wanted, but '%2$s' is co-mounted"),
virCgroupV1ControllerTypeToString(i),
virCgroupV1ControllerTypeToString(j));
return -1;
{
if (group->legacy[controller].mountPoint == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("v1 controller '%s' is not mounted"),
+ _("v1 controller '%1$s' is not mounted"),
virCgroupV1ControllerTypeToString(controller));
return -1;
}
if (group->legacy[controller].placement == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("v1 controller '%s' is not enabled for group"),
+ _("v1 controller '%1$s' is not enabled for group"),
virCgroupV1ControllerTypeToString(controller));
return -1;
}
continue;
} else {
virReportSystemError(errno,
- _("Failed to create v1 controller %s for group"),
+ _("Failed to create v1 controller %1$s for group"),
virCgroupV1ControllerTypeToString(i));
return -1;
}
continue;
if (!(tmp = strrchr(group->legacy[i].mountPoint, '/'))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not find directory separator in %s"),
+ _("Could not find directory separator in %1$s"),
group->legacy[i].mountPoint);
return NULL;
}
if (g_mkdir_with_parents(root, 0777) < 0) {
virReportSystemError(errno,
- _("Unable to create directory %s"),
+ _("Unable to create directory %1$s"),
root);
return -1;
}
if (mount("tmpfs", root, "tmpfs", MS_NOSUID|MS_NODEV|MS_NOEXEC, opts) < 0) {
virReportSystemError(errno,
- _("Failed to mount %s on %s type %s"),
+ _("Failed to mount %1$s on %2$s type %3$s"),
"tmpfs", root, "tmpfs");
return -1;
}
group->legacy[i].mountPoint);
if (g_mkdir_with_parents(group->legacy[i].mountPoint, 0777) < 0) {
virReportSystemError(errno,
- _("Unable to create directory %s"),
+ _("Unable to create directory %1$s"),
group->legacy[i].mountPoint);
return -1;
}
if (mount(src, group->legacy[i].mountPoint, "none", MS_BIND,
NULL) < 0) {
virReportSystemError(errno,
- _("Failed to bind cgroup '%s' on '%s'"),
+ _("Failed to bind cgroup '%1$s' on '%2$s'"),
src, group->legacy[i].mountPoint);
return -1;
}
if (symlink(group->legacy[i].mountPoint,
group->legacy[i].linkPoint) < 0) {
virReportSystemError(errno,
- _("Unable to symlink directory %s to %s"),
+ _("Unable to symlink directory %1$s to %2$s"),
group->legacy[i].mountPoint,
group->legacy[i].linkPoint);
return -1;
if (chown(entry, uid, gid) < 0) {
virReportSystemError(errno,
- _("cannot chown '%s' to (%u, %u)"),
+ _("cannot chown '%1$s' to (%2$u, %3$u)"),
entry, uid, gid);
return -1;
}
if (chown(base, uid, gid) < 0) {
virReportSystemError(errno,
- _("cannot chown '%s' to (%u, %u)"),
+ _("cannot chown '%1$s' to (%2$u, %3$u)"),
base, uid, gid);
return -1;
}
if (virStrToLong_ui(value, NULL, 10, weight) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to parse '%s' as an integer"),
+ _("Unable to parse '%1$s' as an integer"),
value);
return -1;
}
p1 += strlen(value_names[i]);
if (virStrToLong_ll(p1, &p1, 10, &stats_val) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cannot parse byte %sstat '%s'"),
+ _("Cannot parse byte %1$sstat '%2$s'"),
value_names[i],
p1);
return -1;
(stats_val > 0 && *bytes_ptrs[i] > (LLONG_MAX - stats_val)))
{
virReportError(VIR_ERR_OVERFLOW,
- _("Sum of byte %sstat overflows"),
+ _("Sum of byte %1$sstat overflows"),
value_names[i]);
return -1;
}
p2 += strlen(value_names[i]);
if (virStrToLong_ll(p2, &p2, 10, &stats_val) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cannot parse %srequest stat '%s'"),
+ _("Cannot parse %1$srequest stat '%2$s'"),
value_names[i],
p2);
return -1;
(stats_val > 0 && *requests_ptrs[i] > (LLONG_MAX - stats_val)))
{
virReportError(VIR_ERR_OVERFLOW,
- _("Sum of %srequest stat overflows"),
+ _("Sum of %1$srequest stat overflows"),
value_names[i]);
return -1;
}
if (!(p1 = strstr(str1, str3))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cannot find byte stats for block device '%s'"),
+ _("Cannot find byte stats for block device '%1$s'"),
str3);
return -1;
}
if (!(p2 = strstr(str2, str3))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cannot find request stats for block device '%s'"),
+ _("Cannot find request stats for block device '%1$s'"),
str3);
return -1;
}
for (i = 0; i < G_N_ELEMENTS(value_names); i++) {
if (!(p1 = strstr(p1, value_names[i]))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cannot find byte %sstats for block device '%s'"),
+ _("Cannot find byte %1$sstats for block device '%2$s'"),
value_names[i], str3);
return -1;
}
if (virStrToLong_ll(p1 + strlen(value_names[i]), &p1, 10, bytes_ptrs[i]) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cannot parse %sstat '%s'"),
+ _("Cannot parse %1$sstat '%2$s'"),
value_names[i], p1 + strlen(value_names[i]));
return -1;
}
if (!(p2 = strstr(p2, value_names[i]))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cannot find request %sstats for block device '%s'"),
+ _("Cannot find request %1$sstats for block device '%2$s'"),
value_names[i], str3);
return -1;
}
if (virStrToLong_ll(p2 + strlen(value_names[i]), &p2, 10, requests_ptrs[i]) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cannot parse %sstat '%s'"),
+ _("Cannot parse %1$sstat '%2$s'"),
value_names[i], p2 + strlen(value_names[i]));
return -1;
}
*weight = 0;
} else if (virStrToLong_ui(str, NULL, 10, weight) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to parse '%s' as an integer"),
+ _("Unable to parse '%1$s' as an integer"),
str);
return -1;
}
*riops = 0;
} else if (virStrToLong_ui(str, NULL, 10, riops) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to parse '%s' as an integer"),
+ _("Unable to parse '%1$s' as an integer"),
str);
return -1;
}
*wiops = 0;
} else if (virStrToLong_ui(str, NULL, 10, wiops) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to parse '%s' as an integer"),
+ _("Unable to parse '%1$s' as an integer"),
str);
return -1;
}
*rbps = 0;
} else if (virStrToLong_ull(str, NULL, 10, rbps) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to parse '%s' as an integer"),
+ _("Unable to parse '%1$s' as an integer"),
str);
return -1;
}
*wbps = 0;
} else if (virStrToLong_ull(str, NULL, 10, wbps) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to parse '%s' as an integer"),
+ _("Unable to parse '%1$s' as an integer"),
str);
return -1;
}
if (kb > maxkb) {
virReportError(VIR_ERR_INVALID_ARG,
- _("Memory '%llu' must be less than %llu"),
+ _("Memory '%1$llu' must be less than %2$llu"),
kb, maxkb);
return -1;
}
if (kb > maxkb) {
virReportError(VIR_ERR_INVALID_ARG,
- _("Memory '%llu' must be less than %llu"),
+ _("Memory '%1$llu' must be less than %2$llu"),
kb, maxkb);
return -1;
}
if (kb > maxkb) {
virReportError(VIR_ERR_INVALID_ARG,
- _("Memory '%llu' must be less than %llu"),
+ _("Memory '%1$llu' must be less than %2$llu"),
kb, maxkb);
return -1;
}
if (shares < VIR_CGROUP_CPU_SHARES_MIN ||
shares > VIR_CGROUP_CPU_SHARES_MAX) {
virReportError(VIR_ERR_INVALID_ARG,
- _("shares '%llu' must be in range [%llu, %llu]"),
+ _("shares '%1$llu' must be in range [%2$llu, %3$llu]"),
shares,
VIR_CGROUP_CPU_SHARES_MIN,
VIR_CGROUP_CPU_SHARES_MAX);
if (cfs_period < VIR_CGROUP_CPU_PERIOD_MIN ||
cfs_period > VIR_CGROUP_CPU_PERIOD_MAX) {
virReportError(VIR_ERR_INVALID_ARG,
- _("cfs_period '%llu' must be in range (%llu, %llu)"),
+ _("cfs_period '%1$llu' must be in range (%2$llu, %3$llu)"),
cfs_period,
VIR_CGROUP_CPU_PERIOD_MIN,
VIR_CGROUP_CPU_PERIOD_MAX);
(cfs_quota < VIR_CGROUP_CPU_QUOTA_MIN ||
cfs_quota > VIR_CGROUP_CPU_QUOTA_MAX)) {
virReportError(VIR_ERR_INVALID_ARG,
- _("cfs_quota '%lld' must be in range (%llu, %llu)"),
+ _("cfs_quota '%1$lld' must be in range (%2$llu, %3$llu)"),
cfs_quota,
VIR_CGROUP_CPU_QUOTA_MIN,
VIR_CGROUP_CPU_QUOTA_MAX);
if (!(p = STRSKIP(str, "user ")) ||
virStrToLong_ull(p, &p, 10, user) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cannot parse user stat '%s'"),
+ _("Cannot parse user stat '%1$s'"),
p);
return -1;
}
if (!(p = STRSKIP(p, "\nsystem ")) ||
virStrToLong_ull(p, NULL, 10, sys) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cannot parse sys stat '%s'"),
+ _("Cannot parse sys stat '%1$s'"),
p);
return -1;
}
rc = virFileReadAll(contFile, 1024 * 1024, &contStr);
if (rc < 0) {
- virReportSystemError(errno, _("Unable to read from '%s'"), contFile);
+ virReportSystemError(errno, _("Unable to read from '%1$s'"), contFile);
return -1;
}
{
if (!virCgroupV2HasController(group, controller)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("v2 controller '%s' is not available"),
+ _("v2 controller '%1$s' is not available"),
virCgroupV2ControllerTypeToString(controller));
return -1;
}
if (virFileWriteStr(path, val, 0) < 0) {
if (report) {
virReportSystemError(errno,
- _("Failed to enable controller '%s' for '%s'"),
+ _("Failed to enable controller '%1$s' for '%2$s'"),
val, path);
}
return -2;
if (!virFileExists(path) &&
(!create || (mkdir(path, 0755) < 0 && errno != EEXIST))) {
- virReportSystemError(errno, _("Failed to create v2 cgroup '%s'"),
+ virReportSystemError(errno, _("Failed to create v2 cgroup '%1$s'"),
path);
return -1;
}
VIR_DEBUG("Mounting cgroups at '%s'", group->unified.mountPoint);
if (g_mkdir_with_parents(group->unified.mountPoint, 0777) < 0) {
- virReportSystemError(errno, _("Unable to create directory %s"),
+ virReportSystemError(errno, _("Unable to create directory %1$s"),
group->unified.mountPoint);
return -1;
}
src = g_strdup_printf("%s%s", oldroot, group->unified.mountPoint);
if (mount(src, group->unified.mountPoint, "none", MS_BIND, NULL) < 0) {
- virReportSystemError(errno, _("Failed to bind cgroup '%s' on '%s'"),
+ virReportSystemError(errno, _("Failed to bind cgroup '%1$s' on '%2$s'"),
src, group->unified.mountPoint);
return -1;
}
return -1;
if (chown(base, uid, gid) < 0) {
- virReportSystemError(errno, _("cannot chown '%s' to (%u, %u)"),
+ virReportSystemError(errno, _("cannot chown '%1$s' to (%2$u, %3$u)"),
base, uid, gid);
return -1;
}
if (virStrToLong_ui(tmp, &tmp, 10, weight) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to parse '%s' as an integer"),
+ _("Unable to parse '%1$s' as an integer"),
tmp);
return -1;
}
p1 += strlen(value_names[i]);
if (virStrToLong_ll(p1, &p1, 10, &stats_val) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cannot parse byte '%s' stat '%s'"),
+ _("Cannot parse byte '%1$s' stat '%2$s'"),
value_names[i], p1);
return -1;
}
if (stats_val < 0 ||
(stats_val > 0 && *value_ptrs[i] > (LLONG_MAX - stats_val))) {
virReportError(VIR_ERR_OVERFLOW,
- _("Sum of byte '%s' stat overflows"),
+ _("Sum of byte '%1$s' stat overflows"),
value_names[i]);
return -1;
}
if (!(p1 = strstr(str1, str2))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cannot find byte stats for block device '%s'"),
+ _("Cannot find byte stats for block device '%1$s'"),
str2);
return -1;
}
for (i = 0; i < G_N_ELEMENTS(value_names); i++) {
if (!(p1 = strstr(p1, value_names[i]))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cannot find byte '%s' stats for block device '%s'"),
+ _("Cannot find byte '%1$s' stats for block device '%2$s'"),
value_names[i], str2);
return -1;
}
p1 += strlen(value_names[i]);
if (virStrToLong_ll(p1, &p1, 10, value_ptrs[i]) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cannot parse '%s' stat '%s'"),
+ _("Cannot parse '%1$s' stat '%2$s'"),
value_names[i], p1);
return -1;
}
*weight = 0;
} else if (virStrToLong_ui(str, &tmp, 10, weight) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to parse '%s' as an integer"),
+ _("Unable to parse '%1$s' as an integer"),
str);
return -1;
}
} else {
if (!(tmp = strstr(str, name))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to find '%s' limit for block device '%s'"),
+ _("Unable to find '%1$s' limit for block device '%2$s'"),
name, path);
return -1;
}
*riops = 0;
} else if (virStrToLong_ui(tmp, &tmp, 10, riops) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to parse '%s' as an integer"),
+ _("Unable to parse '%1$s' as an integer"),
str);
return -1;
}
} else {
if (!(tmp = strstr(str, name))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to find '%s' limit for block device '%s'"),
+ _("Unable to find '%1$s' limit for block device '%2$s'"),
name, path);
return -1;
}
*wiops = 0;
} else if (virStrToLong_ui(tmp, &tmp, 10, wiops) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to parse '%s' as an integer"),
+ _("Unable to parse '%1$s' as an integer"),
str);
return -1;
}
} else {
if (!(tmp = strstr(str, name))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to find '%s' limit for block device '%s'"),
+ _("Unable to find '%1$s' limit for block device '%2$s'"),
name, path);
return -1;
}
*rbps = 0;
} else if (virStrToLong_ull(tmp, &tmp, 10, rbps) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to parse '%s' as an integer"),
+ _("Unable to parse '%1$s' as an integer"),
str);
return -1;
}
} else {
if (!(tmp = strstr(str, name))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to find '%s' limit for block device '%s'"),
+ _("Unable to find '%1$s' limit for block device '%2$s'"),
name, path);
return -1;
}
*wbps = 0;
} else if (virStrToLong_ull(tmp, &tmp, 10, wbps) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to parse '%s' as an integer"),
+ _("Unable to parse '%1$s' as an integer"),
str);
return -1;
}
if (kb > maxkb) {
virReportError(VIR_ERR_INVALID_ARG,
- _("Memory '%llu' must be less than %llu"),
+ _("Memory '%1$llu' must be less than %2$llu"),
kb, maxkb);
return -1;
}
if (virStrToLong_ull(valueStr + 1, NULL, 10, &value) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to parse '%s' as an integer"),
+ _("Unable to parse '%1$s' as an integer"),
valueStr + 1);
return -1;
}
if (virStrToLong_ull(value, NULL, 10, &max) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to parse value '%s' as number."),
+ _("Failed to parse value '%1$s' as number."),
value);
return -1;
}
if (kb > maxkb) {
virReportError(VIR_ERR_INVALID_ARG,
- _("Memory '%llu' must be less than %llu"),
+ _("Memory '%1$llu' must be less than %2$llu"),
kb, maxkb);
return -1;
}
if (virStrToLong_ull(value, NULL, 10, &high) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to parse value '%s' as number."),
+ _("Failed to parse value '%1$s' as number."),
value);
return -1;
}
if (kb > maxkb) {
virReportError(VIR_ERR_INVALID_ARG,
- _("Memory '%llu' must be less than %llu"),
+ _("Memory '%1$llu' must be less than %2$llu"),
kb, maxkb);
return -1;
}
if (virStrToLong_ull(value, NULL, 10, &max) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to parse value '%s' as number."),
+ _("Failed to parse value '%1$s' as number."),
value);
return -1;
}
if (shares < VIR_CGROUPV2_WEIGHT_MIN ||
shares > VIR_CGROUPV2_WEIGHT_MAX) {
virReportError(VIR_ERR_INVALID_ARG,
- _("shares '%llu' must be in range [%llu, %llu]"),
+ _("shares '%1$llu' must be in range [%2$llu, %3$llu]"),
shares,
VIR_CGROUPV2_WEIGHT_MIN,
VIR_CGROUPV2_WEIGHT_MAX);
if (cfs_period < VIR_CGROUP_CPU_PERIOD_MIN ||
cfs_period > VIR_CGROUP_CPU_PERIOD_MAX) {
virReportError(VIR_ERR_INVALID_ARG,
- _("cfs_period '%llu' must be in range (%llu, %llu)"),
+ _("cfs_period '%1$llu' must be in range (%2$llu, %3$llu)"),
VIR_CGROUP_CPU_PERIOD_MIN,
VIR_CGROUP_CPU_PERIOD_MAX,
cfs_period);
if (virStrToLong_ull(tmp, &tmp, 10, cfs_period) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to parse value '%s' from cpu.max."), str);
+ _("Failed to parse value '%1$s' from cpu.max."), str);
return -1;
}
(cfs_quota < VIR_CGROUP_CPU_QUOTA_MIN ||
cfs_quota > VIR_CGROUP_CPU_QUOTA_MAX)) {
virReportError(VIR_ERR_INVALID_ARG,
- _("cfs_quota '%lld' must be in range (%llu, %llu)"),
+ _("cfs_quota '%1$lld' must be in range (%2$llu, %3$llu)"),
cfs_quota,
VIR_CGROUP_CPU_QUOTA_MIN,
VIR_CGROUP_CPU_QUOTA_MAX);
if (virStrToLong_ll(str, &tmp, 10, cfs_quota) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to parse value '%s' from cpu.max."), str);
+ _("Failed to parse value '%1$s' from cpu.max."), str);
return -1;
}
if (!(tmp = strstr(str, "usage_usec "))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot parse cpu usage stat '%s'"), str);
+ _("cannot parse cpu usage stat '%1$s'"), str);
return -1;
}
tmp += strlen("usage_usec ");
if (virStrToLong_ull(tmp, &tmp, 10, usage) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to parse value '%s' as number."), tmp);
+ _("Failed to parse value '%1$s' as number."), tmp);
return -1;
}
if (!(tmp = strstr(str, "user_usec "))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot parse cpu user stat '%s'"), str);
+ _("cannot parse cpu user stat '%1$s'"), str);
return -1;
}
tmp += strlen("user_usec ");
if (virStrToLong_ull(tmp, &tmp, 10, &userVal) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to parse value '%s' as number."), tmp);
+ _("Failed to parse value '%1$s' as number."), tmp);
return -1;
}
if (!(tmp = strstr(str, "system_usec "))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot parse cpu sys stat '%s'"), str);
+ _("cannot parse cpu sys stat '%1$s'"), str);
return -1;
}
tmp += strlen("system_usec ");
if (virStrToLong_ull(tmp, &tmp, 10, &sysVal) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to parse value '%s' as number."), tmp);
+ _("Failed to parse value '%1$s' as number."), tmp);
return -1;
}
cgroupfd = open(path, O_RDONLY);
if (cgroupfd < 0) {
- virReportSystemError(errno, _("unable to open '%s'"), path);
+ virReportSystemError(errno, _("unable to open '%1$s'"), path);
goto cleanup;
}
cgroupfd = open(path, O_RDONLY);
if (cgroupfd < 0) {
- virReportSystemError(errno, _("unable to open '%s'"), path);
+ virReportSystemError(errno, _("unable to open '%1$s'"), path);
return -1;
}
{
if (*null == -1 && (*null = open("/dev/null", O_RDWR|O_CLOEXEC)) < 0) {
virReportSystemError(errno,
- _("cannot open %s"),
+ _("cannot open %1$s"),
"/dev/null");
return -1;
}
}
if (c != '1') {
virReportSystemError(EINVAL,
- _("Unexpected confirm code '%c' from parent"),
+ _("Unexpected confirm code '%1$c' from parent"),
c);
return -1;
}
if (cmd->schedCore > 0 &&
virProcessSchedCoreShareFrom(cmd->schedCore) < 0) {
virReportSystemError(errno,
- _("Unable to run among %llu"),
+ _("Unable to run among %1$llu"),
(unsigned long long) cmd->schedCore);
return -1;
}
VIR_DEBUG("Running child in %s", cmd->pwd);
if (chdir(cmd->pwd) < 0) {
virReportSystemError(errno,
- _("Unable to change to %s"), cmd->pwd);
+ _("Unable to change to %1$s"), cmd->pwd);
return -1;
}
}
if (virStrToLong_i(entry->d_name, NULL, 10, &fd) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unable to parse FD: %s"),
+ _("unable to parse FD: %1$s"),
entry->d_name);
return -1;
}
int tmpfd = fd;
VIR_MASS_CLOSE(tmpfd);
} else if (virSetInherit(fd, true) < 0) {
- virReportSystemError(errno, _("failed to preserve fd %d"), fd);
+ virReportSystemError(errno, _("failed to preserve fd %1$d"), fd);
return -1;
}
}
int tmpfd = fd;
VIR_MASS_CLOSE(tmpfd);
} else if (virSetInherit(fd, true) < 0) {
- virReportSystemError(errno, _("failed to preserve fd %d"), fd);
+ virReportSystemError(errno, _("failed to preserve fd %1$d"), fd);
return -1;
}
}
VIR_DEBUG("Setting child security label to %s", cmd->seLinuxLabel);
if (setexeccon_raw(cmd->seLinuxLabel) == -1) {
virReportSystemError(errno,
- _("unable to set SELinux security context "
- "'%s' for '%s'"),
+ _("unable to set SELinux security context '%1$s' for '%2$s'"),
cmd->seLinuxLabel, cmd->args[0]);
if (security_getenforce() == 1)
goto fork_error;
VIR_DEBUG("Setting child AppArmor profile to %s", cmd->appArmorProfile);
if (aa_change_profile(cmd->appArmorProfile) < 0) {
virReportSystemError(errno,
- _("unable to set AppArmor profile '%s' "
- "for '%s'"),
+ _("unable to set AppArmor profile '%1$s' for '%2$s'"),
cmd->appArmorProfile, cmd->args[0]);
goto fork_error;
}
ret = errno == ENOENT ? EXIT_ENOENT : EXIT_CANNOT_INVOKE;
virReportSystemError(errno,
- _("cannot execute binary %s"),
+ _("cannot execute binary %1$s"),
cmd->args[0]);
fork_error:
if (!(cmd->binaryPath = virFindFileInPath(cmd->args[0]))) {
virReportSystemError(ENOENT,
- _("Cannot find '%s' in path"),
+ _("Cannot find '%1$s' in path"),
cmd->args[0]);
return NULL;
}
execve(cmd->args[0], cmd->args, cmd->env);
virReportSystemError(errno,
- _("cannot execute binary %s"),
+ _("cannot execute binary %1$s"),
cmd->args[0]);
return -1;
}
if (cmd->pid != -1) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("command is already running as pid %lld"),
+ _("command is already running as pid %1$lld"),
(long long) cmd->pid);
goto cleanup;
}
}
if (cmd->pwd && (cmd->flags & VIR_EXEC_DAEMON)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("daemonized command cannot set working directory %s"),
+ _("daemonized command cannot set working directory %1$s"),
cmd->pwd);
goto cleanup;
}
bool haveErrMsg = cmd->errbuf && *cmd->errbuf && (*cmd->errbuf)[0];
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Child process (%s) unexpected %s%s%s"),
+ _("Child process (%1$s) unexpected %2$s%3$s%4$s"),
str ? str : cmd->args[0], NULLSTR(st),
haveErrMsg ? ": " : "",
haveErrMsg ? *cmd->errbuf : "");
reg[i] = g_regex_new(regex[i], G_REGEX_OPTIMIZE, 0, &err);
if (!reg[i]) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to compile regex %s"), err->message);
+ _("Failed to compile regex %1$s"), err->message);
for (j = 0; j < i; j++)
g_regex_unref(reg[j]);
VIR_FREE(reg);
int *exitstatus G_GNUC_UNUSED)
{
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s not implemented on Win32"), __FUNCTION__);
+ _("%1$s not implemented on Win32"), __FUNCTION__);
return -1;
}
void *data G_GNUC_UNUSED)
{
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s not implemented on Win32"), __FUNCTION__);
+ _("%1$s not implemented on Win32"), __FUNCTION__);
return -1;
}
#endif /* WIN32 */
/* Construct the string 'filename:line: info' if we have that. */
if (ctxt && ctxt->filename) {
virReportErrorHelper(VIR_FROM_CONF, error, file, func, line,
- _("%s:%d: %s"), ctxt->filename, ctxt->line, info);
+ _("%1$s:%2$d: %3$s"), ctxt->filename, ctxt->line, info);
} else {
virReportErrorHelper(VIR_FROM_CONF, error, file, func, line,
"%s", info);
if (cval->type != VIR_CONF_STRING) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s: expected a string for '%s' parameter"),
+ _("%1$s: expected a string for '%2$s' parameter"),
conf->filename, setting);
return -1;
}
for (len = 0, eval = cval->list; eval; len++, eval = eval->next) {
if (eval->type != VIR_CONF_STRING) {
virReportError(VIR_ERR_CONF_SYNTAX,
- _("%s: expected a string list for '%s' parameter"),
+ _("%1$s: expected a string list for '%2$s' parameter"),
conf->filename, setting);
return -1;
}
case VIR_CONF_NONE:
virReportError(VIR_ERR_INTERNAL_ERROR,
compatString ?
- _("%s: expected a string or string list for '%s' parameter") :
- _("%s: expected a string list for '%s' parameter"),
+ _("%1$s: expected a string or string list for '%2$s' parameter") :
+ _("%1$s: expected a string list for '%2$s' parameter"),
conf->filename, setting);
return -1;
if (cval->type != VIR_CONF_ULLONG) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s: expected a bool for '%s' parameter"),
+ _("%1$s: expected a bool for '%2$s' parameter"),
conf->filename, setting);
return -1;
}
if (((unsigned long long)cval->l) > 1) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s: value for '%s' parameter must be 0 or 1"),
+ _("%1$s: value for '%2$s' parameter must be 0 or 1"),
conf->filename, setting);
return -1;
}
if (cval->type != VIR_CONF_LLONG &&
cval->type != VIR_CONF_ULLONG) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s: expected a signed integer for '%s' parameter"),
+ _("%1$s: expected a signed integer for '%2$s' parameter"),
conf->filename, setting);
return -1;
}
if (cval->l > INT_MAX || cval->l < INT_MIN) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s: value for '%s' parameter must be in range %d:%d"),
+ _("%1$s: value for '%2$s' parameter must be in range %3$d:%4$d"),
conf->filename, setting, INT_MIN, INT_MAX);
return -1;
}
if (cval->type != VIR_CONF_ULLONG) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s: expected an unsigned integer for '%s' parameter"),
+ _("%1$s: expected an unsigned integer for '%2$s' parameter"),
conf->filename, setting);
return -1;
}
if (((unsigned long long)cval->l) > UINT_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s: value for '%s' parameter must be in range 0:%u"),
+ _("%1$s: value for '%2$s' parameter must be in range 0:%3$u"),
conf->filename, setting, UINT_MAX);
return -1;
}
if (cval->type != VIR_CONF_ULLONG) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s: expected an unsigned integer for '%s' parameter"),
+ _("%1$s: expected an unsigned integer for '%2$s' parameter"),
conf->filename, setting);
return -1;
}
#if ULLONG_MAX > SIZE_MAX
if (((unsigned long long)cval->l) > SIZE_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s: value for '%s' parameter must be in range 0:%zu"),
+ _("%1$s: value for '%2$s' parameter must be in range 0:%3$zu"),
conf->filename, setting, SIZE_MAX);
return -1;
}
if (cval->type == VIR_CONF_ULLONG) {
if (((unsigned long long)cval->l) > SSIZE_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s: value for '%s' parameter must be in range %zd:%zd"),
+ _("%1$s: value for '%2$s' parameter must be in range %3$zd:%4$zd"),
conf->filename, setting, (ssize_t)-SSIZE_MAX - 1, (ssize_t)SSIZE_MAX);
return -1;
}
#if SSIZE_MAX < LLONG_MAX
if (cval->l < (-SSIZE_MAX - 1) || cval->l > SSIZE_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s: value for '%s' parameter must be in range %zd:%zd"),
+ _("%1$s: value for '%2$s' parameter must be in range %3$zd:%4$zd"),
conf->filename, setting, (ssize_t)-SSIZE_MAX - 1, (ssize_t)SSIZE_MAX);
return -1;
}
#endif
} else {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s: expected a signed integer for '%s' parameter"),
+ _("%1$s: expected a signed integer for '%2$s' parameter"),
conf->filename, setting);
return -1;
}
if (cval->type == VIR_CONF_ULLONG) {
if (((unsigned long long)cval->l) > LLONG_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s: value for '%s' parameter must be in range %lld:%lld"),
+ _("%1$s: value for '%2$s' parameter must be in range %3$lld:%4$lld"),
conf->filename, setting, LLONG_MIN, LLONG_MAX);
return -1;
}
} else if (cval->type != VIR_CONF_LLONG) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s: expected a signed integer for '%s' parameter"),
+ _("%1$s: expected a signed integer for '%2$s' parameter"),
conf->filename, setting);
return -1;
}
if (cval->type != VIR_CONF_ULLONG) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s: expected an unsigned integer for '%s' parameter"),
+ _("%1$s: expected an unsigned integer for '%2$s' parameter"),
conf->filename, setting);
return -1;
}
if (*value && (*value)->type == VIR_CONF_STRING && !(*value)->str) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("expecting a value for value of type %s"),
+ _("expecting a value for value of type %1$s"),
virConfTypeToString(VIR_CONF_STRING));
g_clear_pointer(value, virConfFreeValue);
return -1;
int rc;
if (hash >= VIR_CRYPTO_HASH_LAST) {
virReportError(VIR_ERR_INVALID_ARG,
- _("Unknown crypto hash %d"), hash);
+ _("Unknown crypto hash %1$d"), hash);
return -1;
}
rc = gnutls_hash_fast(hashinfo[hash].algorithm, input, strlen(input), output);
if (rc < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to compute hash of data: %s"),
+ _("Unable to compute hash of data: %1$s"),
gnutls_strerror(rc));
return -1;
}
if ((rc = gnutls_cipher_init(&handle, gnutls_enc_alg,
&enc_key, &iv_buf)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to initialize cipher: '%s'"),
+ _("failed to initialize cipher: '%1$s'"),
gnutls_strerror(rc));
return -1;
}
if (rc < 0) {
virSecureErase(ciphertext, ciphertextlen);
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to encrypt the data: '%s'"),
+ _("failed to encrypt the data: '%1$s'"),
gnutls_strerror(rc));
return -1;
}
case VIR_CRYPTO_CIPHER_AES256CBC:
if (enckeylen != 32) {
virReportError(VIR_ERR_INVALID_ARG,
- _("AES256CBC encryption invalid keylen=%zu"),
+ _("AES256CBC encryption invalid keylen=%1$zu"),
enckeylen);
return -1;
}
if (ivlen != 16) {
virReportError(VIR_ERR_INVALID_ARG,
- _("AES256CBC initialization vector invalid len=%zu"),
+ _("AES256CBC initialization vector invalid len=%1$zu"),
ivlen);
return -1;
}
}
virReportError(VIR_ERR_INVALID_ARG,
- _("algorithm=%d is not supported"), algorithm);
+ _("algorithm=%1$d is not supported"), algorithm);
return -1;
}
if (ret != 1) {
fprintf(stderr,
- _("%s: error: unable to determine if daemon is "
- "running: %s\n"), argv0,
+ _("%1$s: error: unable to determine if daemon is running: %2$s\n"),
+ argv0,
g_strerror(errno));
exit(EXIT_FAILURE);
} else if (status != 0) {
fprintf(stderr,
- _("%s: error: %s. Check /var/log/messages or run without "
- "--daemon for more info.\n"), argv0,
+ _("%1$s: error: %2$s. Check /var/log/messages or run without --daemon for more info.\n"),
+ argv0,
virDaemonErrTypeToString(status));
exit(EXIT_FAILURE);
}
if (!lines[i]) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to find major for %s"),
+ _("Unable to find major for %1$s"),
DM_NAME);
return -1;
}
if (dm.version[0] != DM_VERSION_MAJOR) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
- _("Unsupported device-mapper version. Expected %d got %d"),
+ _("Unsupported device-mapper version. Expected %1$d got %2$d"),
DM_VERSION_MAJOR, dm.version[0]);
return -1;
}
/* It's a path. Check if the last component is DM name */
if (stat(path, &sb[0]) < 0) {
virReportError(errno,
- _("Unable to stat %p"),
+ _("Unable to stat %1$p"),
path);
return NULL;
}
return 0;
virReportSystemError(errno,
- _("Unable to query dependencies for %s"),
+ _("Unable to query dependencies for %1$s"),
path);
return -1;
}
addnhostsfile->nhosts);
if (err < 0) {
- virReportSystemError(-err, _("cannot write config file '%s'"),
+ virReportSystemError(-err, _("cannot write config file '%1$s'"),
addnhostsfile->path);
return -1;
}
return 0;
if (unlink(path) < 0) {
- virReportSystemError(errno, _("cannot remove config file '%s'"),
+ virReportSystemError(errno, _("cannot remove config file '%1$s'"),
path);
return -1;
}
hostsfile->nhosts);
if (err < 0) {
- virReportSystemError(-err, _("cannot write config file '%s'"),
+ virReportSystemError(-err, _("cannot write config file '%1$s'"),
hostsfile->path);
return -1;
}
int ret = 0;
if (g_mkdir_with_parents(ctx->config_dir, 0777) < 0) {
- virReportSystemError(errno, _("cannot create config directory '%s'"),
+ virReportSystemError(errno, _("cannot create config directory '%1$s'"),
ctx->config_dir);
return -1;
}
#ifndef WIN32
if (kill(pid, SIGHUP) != 0) {
virReportSystemError(errno,
- _("Failed to make dnsmasq (PID: %d)"
- " reload config files."),
+ _("Failed to make dnsmasq (PID: %1$d) reload config files."),
pid);
return -1;
}
if (version < DNSMASQ_MIN_MAJOR * 1000000 + DNSMASQ_MIN_MINOR * 1000) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("dnsmasq version >= %u.%u required but %lu.%lu found"),
+ _("dnsmasq version >= %1$u.%2$u required but %3$lu.%4$lu found"),
DNSMASQ_MIN_MAJOR, DNSMASQ_MIN_MINOR,
version / 1000000,
version % 1000000 / 1000);
else
len = p - buf;
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot parse %s version number in '%.*s'"),
+ _("cannot parse %1$s version number in '%3$.*2$s'"),
caps->binaryPath, len, buf);
return -1;
[VIR_ERR_OK] = { NULL, NULL },
[VIR_ERR_INTERNAL_ERROR] = {
N_("internal error"),
- N_("internal error: %s") },
+ N_("internal error: %1$s") },
[VIR_ERR_NO_MEMORY] = {
N_("out of memory"),
- N_("out of memory: %s") },
+ N_("out of memory: %1$s") },
[VIR_ERR_NO_SUPPORT] = {
N_("this function is not supported by the connection driver"),
- N_("this function is not supported by the connection driver: %s") },
+ N_("this function is not supported by the connection driver: %1$s") },
[VIR_ERR_UNKNOWN_HOST] = {
N_("unknown host"),
- N_("unknown host %s") },
+ N_("unknown host %1$s") },
[VIR_ERR_NO_CONNECT] = {
N_("no connection driver available"),
- N_("no connection driver available for %s") },
+ N_("no connection driver available for %1$s") },
[VIR_ERR_INVALID_CONN] = {
N_("invalid connection pointer in"),
- N_("invalid connection pointer in %s") },
+ N_("invalid connection pointer in %1$s") },
[VIR_ERR_INVALID_DOMAIN] = {
N_("invalid domain pointer in"),
- N_("invalid domain pointer in %s") },
+ N_("invalid domain pointer in %1$s") },
[VIR_ERR_INVALID_ARG] = {
N_("invalid argument"),
- N_("invalid argument: %s") },
+ N_("invalid argument: %1$s") },
[VIR_ERR_OPERATION_FAILED] = {
N_("operation failed"),
- N_("operation failed: %s") },
+ N_("operation failed: %1$s") },
[VIR_ERR_GET_FAILED] = {
N_("GET operation failed"),
- N_("GET operation failed: %s") },
+ N_("GET operation failed: %1$s") },
[VIR_ERR_POST_FAILED] = {
N_("POST operation failed"),
- N_("POST operation failed: %s") },
+ N_("POST operation failed: %1$s") },
[VIR_ERR_HTTP_ERROR] = {
N_("got unknown HTTP error code"),
- N_("got unknown HTTP error code %s") },
+ N_("got unknown HTTP error code %1$s") },
[VIR_ERR_SEXPR_SERIAL] = {
N_("failed to serialize S-Expr"),
- N_("failed to serialize S-Expr: %s") },
+ N_("failed to serialize S-Expr: %1$s") },
[VIR_ERR_NO_XEN] = {
N_("could not use Xen hypervisor entry"),
- N_("could not use Xen hypervisor entry %s") },
+ N_("could not use Xen hypervisor entry %1$s") },
[VIR_ERR_XEN_CALL] = {
N_("failed Xen syscall"),
- N_("failed Xen syscall %s") },
+ N_("failed Xen syscall %1$s") },
[VIR_ERR_OS_TYPE] = {
N_("unknown OS type"),
- N_("unknown OS type %s") },
+ N_("unknown OS type %1$s") },
[VIR_ERR_NO_KERNEL] = {
N_("missing kernel information"),
- N_("missing kernel information: %s") },
+ N_("missing kernel information: %1$s") },
[VIR_ERR_NO_ROOT] = {
N_("missing root device information"),
- N_("missing root device information in %s") },
+ N_("missing root device information in %1$s") },
[VIR_ERR_NO_SOURCE] = {
N_("missing source information for device"),
- N_("missing source information for device %s") },
+ N_("missing source information for device %1$s") },
[VIR_ERR_NO_TARGET] = {
N_("missing target information for device"),
- N_("missing target information for device %s") },
+ N_("missing target information for device %1$s") },
[VIR_ERR_NO_NAME] = {
N_("missing name information"),
- N_("missing name information in %s") },
+ N_("missing name information in %1$s") },
[VIR_ERR_NO_OS] = {
N_("missing operating system information"),
- N_("missing operating system information for %s") },
+ N_("missing operating system information for %1$s") },
[VIR_ERR_NO_DEVICE] = {
N_("missing devices information"),
- N_("missing devices information for %s") },
+ N_("missing devices information for %1$s") },
[VIR_ERR_NO_XENSTORE] = {
N_("could not connect to Xen Store"),
- N_("could not connect to Xen Store %s") },
+ N_("could not connect to Xen Store %1$s") },
[VIR_ERR_DRIVER_FULL] = {
N_("too many drivers registered"),
- N_("too many drivers registered in %s") },
+ N_("too many drivers registered in %1$s") },
[VIR_ERR_CALL_FAILED] = {
N_("library call failed"),
- N_("library call failed: %s") },
+ N_("library call failed: %1$s") },
[VIR_ERR_XML_ERROR] = {
N_("XML description is invalid or not well formed"),
- N_("XML error: %s") },
+ N_("XML error: %1$s") },
[VIR_ERR_DOM_EXIST] = {
N_("this domain exists already"),
- N_("domain %s exists already") },
+ N_("domain %1$s exists already") },
[VIR_ERR_OPERATION_DENIED] = {
N_("operation forbidden for read only access"),
- N_("operation forbidden: %s") },
+ N_("operation forbidden: %1$s") },
[VIR_ERR_OPEN_FAILED] = {
N_("failed to open configuration file"),
- N_("failed to open configuration file %s") },
+ N_("failed to open configuration file %1$s") },
[VIR_ERR_READ_FAILED] = {
N_("failed to read configuration file"),
- N_("failed to read configuration file %s") },
+ N_("failed to read configuration file %1$s") },
[VIR_ERR_PARSE_FAILED] = {
N_("failed to parse configuration file"),
- N_("failed to parse configuration file %s") },
+ N_("failed to parse configuration file %1$s") },
[VIR_ERR_CONF_SYNTAX] = {
N_("configuration file syntax error"),
- N_("configuration file syntax error: %s") },
+ N_("configuration file syntax error: %1$s") },
[VIR_ERR_WRITE_FAILED] = {
N_("failed to write configuration file"),
- N_("failed to write configuration file: %s") },
+ N_("failed to write configuration file: %1$s") },
[VIR_ERR_XML_DETAIL] = {
N_("parser error"),
"%s" },
[VIR_ERR_INVALID_NETWORK] = {
N_("invalid network pointer in"),
- N_("invalid network pointer in %s") },
+ N_("invalid network pointer in %1$s") },
[VIR_ERR_NETWORK_EXIST] = {
N_("this network exists already"),
- N_("network %s exists already") },
+ N_("network %1$s exists already") },
[VIR_ERR_SYSTEM_ERROR] = {
N_("system call error"),
"%s" },
"%s" },
[VIR_WAR_NO_NETWORK] = {
N_("Failed to find the network"),
- N_("Failed to find the network: %s") },
+ N_("Failed to find the network: %1$s") },
[VIR_ERR_NO_DOMAIN] = {
N_("Domain not found"),
- N_("Domain not found: %s") },
+ N_("Domain not found: %1$s") },
[VIR_ERR_NO_NETWORK] = {
N_("Network not found"),
- N_("Network not found: %s") },
+ N_("Network not found: %1$s") },
[VIR_ERR_INVALID_MAC] = {
N_("invalid MAC address"),
- N_("invalid MAC address: %s") },
+ N_("invalid MAC address: %1$s") },
[VIR_ERR_AUTH_FAILED] = {
N_("authentication failed"),
- N_("authentication failed: %s") },
+ N_("authentication failed: %1$s") },
[VIR_ERR_INVALID_STORAGE_POOL] = {
N_("invalid storage pool pointer in"),
- N_("invalid storage pool pointer in %s") },
+ N_("invalid storage pool pointer in %1$s") },
[VIR_ERR_INVALID_STORAGE_VOL] = {
N_("invalid storage volume pointer in"),
- N_("invalid storage volume pointer in %s") },
+ N_("invalid storage volume pointer in %1$s") },
[VIR_WAR_NO_STORAGE] = {
N_("Failed to find a storage driver"),
- N_("Failed to find a storage driver: %s") },
+ N_("Failed to find a storage driver: %1$s") },
[VIR_ERR_NO_STORAGE_POOL] = {
N_("Storage pool not found"),
- N_("Storage pool not found: %s") },
+ N_("Storage pool not found: %1$s") },
[VIR_ERR_NO_STORAGE_VOL] = {
N_("Storage volume not found"),
- N_("Storage volume not found: %s") },
+ N_("Storage volume not found: %1$s") },
[VIR_WAR_NO_NODE] = {
N_("Failed to find a node driver"),
- N_("Failed to find a node driver: %s") },
+ N_("Failed to find a node driver: %1$s") },
[VIR_ERR_INVALID_NODE_DEVICE] = {
N_("invalid node device pointer"),
- N_("invalid node device pointer in %s") },
+ N_("invalid node device pointer in %1$s") },
[VIR_ERR_NO_NODE_DEVICE] = {
N_("Node device not found"),
- N_("Node device not found: %s") },
+ N_("Node device not found: %1$s") },
[VIR_ERR_NO_SECURITY_MODEL] = {
N_("Security model not found"),
- N_("Security model not found: %s") },
+ N_("Security model not found: %1$s") },
[VIR_ERR_OPERATION_INVALID] = {
N_("Requested operation is not valid"),
- N_("Requested operation is not valid: %s") },
+ N_("Requested operation is not valid: %1$s") },
[VIR_WAR_NO_INTERFACE] = {
N_("Failed to find the interface"),
- N_("Failed to find the interface: %s") },
+ N_("Failed to find the interface: %1$s") },
[VIR_ERR_NO_INTERFACE] = {
N_("Interface not found"),
- N_("Interface not found: %s") },
+ N_("Interface not found: %1$s") },
[VIR_ERR_INVALID_INTERFACE] = {
N_("invalid interface pointer in"),
- N_("invalid interface pointer in %s") },
+ N_("invalid interface pointer in %1$s") },
[VIR_ERR_MULTIPLE_INTERFACES] = {
N_("multiple matching interfaces found"),
- N_("multiple matching interfaces found: %s") },
+ N_("multiple matching interfaces found: %1$s") },
[VIR_WAR_NO_NWFILTER] = {
N_("Failed to start the nwfilter driver"),
- N_("Failed to start the nwfilter driver: %s") },
+ N_("Failed to start the nwfilter driver: %1$s") },
[VIR_ERR_INVALID_NWFILTER] = {
N_("Invalid network filter"),
- N_("Invalid network filter: %s") },
+ N_("Invalid network filter: %1$s") },
[VIR_ERR_NO_NWFILTER] = {
N_("Network filter not found"),
- N_("Network filter not found: %s") },
+ N_("Network filter not found: %1$s") },
[VIR_ERR_BUILD_FIREWALL] = {
N_("Error while building firewall"),
- N_("Error while building firewall: %s") },
+ N_("Error while building firewall: %1$s") },
[VIR_WAR_NO_SECRET] = {
N_("Failed to find a secret storage driver"),
- N_("Failed to find a secret storage driver: %s") },
+ N_("Failed to find a secret storage driver: %1$s") },
[VIR_ERR_INVALID_SECRET] = {
N_("Invalid secret"),
- N_("Invalid secret: %s") },
+ N_("Invalid secret: %1$s") },
[VIR_ERR_NO_SECRET] = {
N_("Secret not found"),
- N_("Secret not found: %s") },
+ N_("Secret not found: %1$s") },
[VIR_ERR_CONFIG_UNSUPPORTED] = {
N_("unsupported configuration"),
- N_("unsupported configuration: %s") },
+ N_("unsupported configuration: %1$s") },
[VIR_ERR_OPERATION_TIMEOUT] = {
N_("Timed out during operation"),
- N_("Timed out during operation: %s") },
+ N_("Timed out during operation: %1$s") },
[VIR_ERR_MIGRATE_PERSIST_FAILED] = {
N_("Failed to make domain persistent after migration"),
- N_("Failed to make domain persistent after migration: %s") },
+ N_("Failed to make domain persistent after migration: %1$s") },
[VIR_ERR_HOOK_SCRIPT_FAILED] = {
N_("Hook script execution failed"),
- N_("Hook script execution failed: %s") },
+ N_("Hook script execution failed: %1$s") },
[VIR_ERR_INVALID_DOMAIN_SNAPSHOT] = {
N_("Invalid domain snapshot"),
- N_("Invalid domain snapshot: %s") },
+ N_("Invalid domain snapshot: %1$s") },
[VIR_ERR_NO_DOMAIN_SNAPSHOT] = {
N_("Domain snapshot not found"),
- N_("Domain snapshot not found: %s") },
+ N_("Domain snapshot not found: %1$s") },
[VIR_ERR_INVALID_STREAM] = {
N_("invalid stream pointer"),
- N_("invalid stream pointer in %s") },
+ N_("invalid stream pointer in %1$s") },
[VIR_ERR_ARGUMENT_UNSUPPORTED] = {
N_("argument unsupported"),
- N_("argument unsupported: %s") },
+ N_("argument unsupported: %1$s") },
[VIR_ERR_STORAGE_PROBE_FAILED] = {
N_("Storage pool probe failed"),
- N_("Storage pool probe failed: %s") },
+ N_("Storage pool probe failed: %1$s") },
[VIR_ERR_STORAGE_POOL_BUILT] = {
N_("Storage pool already built"),
- N_("Storage pool already built: %s") },
+ N_("Storage pool already built: %1$s") },
[VIR_ERR_SNAPSHOT_REVERT_RISKY] = {
N_("revert requires force"),
- N_("revert requires force: %s") },
+ N_("revert requires force: %1$s") },
[VIR_ERR_OPERATION_ABORTED] = {
N_("operation aborted"),
- N_("operation aborted: %s") },
+ N_("operation aborted: %1$s") },
[VIR_ERR_AUTH_CANCELLED] = {
N_("authentication cancelled"),
- N_("authentication cancelled: %s") },
+ N_("authentication cancelled: %1$s") },
[VIR_ERR_NO_DOMAIN_METADATA] = {
N_("metadata not found"),
- N_("metadata not found: %s") },
+ N_("metadata not found: %1$s") },
[VIR_ERR_MIGRATE_UNSAFE] = {
N_("Unsafe migration"),
- N_("Unsafe migration: %s") },
+ N_("Unsafe migration: %1$s") },
[VIR_ERR_OVERFLOW] = {
N_("numerical overflow"),
- N_("numerical overflow: %s") },
+ N_("numerical overflow: %1$s") },
[VIR_ERR_BLOCK_COPY_ACTIVE] = {
N_("block copy still active"),
- N_("block copy still active: %s") },
+ N_("block copy still active: %1$s") },
[VIR_ERR_OPERATION_UNSUPPORTED] = {
N_("Operation not supported"),
- N_("Operation not supported: %s") },
+ N_("Operation not supported: %1$s") },
[VIR_ERR_SSH] = {
N_("SSH transport error"),
- N_("SSH transport error: %s") },
+ N_("SSH transport error: %1$s") },
[VIR_ERR_AGENT_UNRESPONSIVE] = {
N_("Guest agent is not responding"),
- N_("Guest agent is not responding: %s") },
+ N_("Guest agent is not responding: %1$s") },
[VIR_ERR_RESOURCE_BUSY] = {
N_("resource busy"),
- N_("resource busy: %s") },
+ N_("resource busy: %1$s") },
[VIR_ERR_ACCESS_DENIED] = {
N_("access denied"),
- N_("access denied: %s") },
+ N_("access denied: %1$s") },
[VIR_ERR_DBUS_SERVICE] = {
N_("error from service"),
- N_("error from service: %s") },
+ N_("error from service: %1$s") },
[VIR_ERR_STORAGE_VOL_EXIST] = {
N_("this storage volume exists already"),
- N_("storage volume %s exists already") },
+ N_("storage volume %1$s exists already") },
[VIR_ERR_CPU_INCOMPATIBLE] = {
N_("the CPU is incompatible with host CPU"),
- N_("the CPU is incompatible with host CPU: %s") },
+ N_("the CPU is incompatible with host CPU: %1$s") },
[VIR_ERR_XML_INVALID_SCHEMA] = {
N_("XML document failed to validate against schema"),
- N_("XML document failed to validate against schema: %s") },
+ N_("XML document failed to validate against schema: %1$s") },
[VIR_ERR_MIGRATE_FINISH_OK] = {
N_("migration successfully aborted"),
- N_("migration successfully aborted: %s") },
+ N_("migration successfully aborted: %1$s") },
[VIR_ERR_AUTH_UNAVAILABLE] = {
N_("authentication unavailable"),
- N_("authentication unavailable: %s") },
+ N_("authentication unavailable: %1$s") },
[VIR_ERR_NO_SERVER] = {
N_("Server not found"),
- N_("Server not found: %s") },
+ N_("Server not found: %1$s") },
[VIR_ERR_NO_CLIENT] = {
N_("Client not found"),
- N_("Client not found: %s") },
+ N_("Client not found: %1$s") },
[VIR_ERR_AGENT_UNSYNCED] = {
N_("guest agent replied with wrong id to guest-sync command"),
- N_("guest agent replied with wrong id to guest-sync command: %s") },
+ N_("guest agent replied with wrong id to guest-sync command: %1$s") },
[VIR_ERR_LIBSSH] = {
N_("libssh transport error"),
- N_("libssh transport error: %s") },
+ N_("libssh transport error: %1$s") },
[VIR_ERR_DEVICE_MISSING] = {
N_("device not found"),
- N_("device not found: %s") },
+ N_("device not found: %1$s") },
[VIR_ERR_INVALID_NWFILTER_BINDING] = {
N_("Invalid network filter binding"),
- N_("Invalid network filter binding: %s") },
+ N_("Invalid network filter binding: %1$s") },
[VIR_ERR_NO_NWFILTER_BINDING] = {
N_("Network filter binding not found"),
- N_("Network filter binding not found: %s") },
+ N_("Network filter binding not found: %1$s") },
[VIR_ERR_INVALID_DOMAIN_CHECKPOINT] = {
N_("Invalid domain checkpoint"),
- N_("Invalid domain checkpoint: %s") },
+ N_("Invalid domain checkpoint: %1$s") },
[VIR_ERR_NO_DOMAIN_CHECKPOINT] = {
N_("Domain checkpoint not found"),
- N_("Domain checkpoint not found: %s") },
+ N_("Domain checkpoint not found: %1$s") },
[VIR_ERR_NO_DOMAIN_BACKUP] = {
N_("Domain backup job id not found"),
- N_("Domain backup job id not found: %s") },
+ N_("Domain backup job id not found: %1$s") },
[VIR_ERR_INVALID_NETWORK_PORT] = {
N_("Invalid network port pointer"),
- N_("Invalid network port pointer: %s") },
+ N_("Invalid network port pointer: %1$s") },
[VIR_ERR_NETWORK_PORT_EXIST] = {
N_("this network port exists already"),
- N_("network port %s exists already") },
+ N_("network port %1$s exists already") },
[VIR_ERR_NO_NETWORK_PORT] = {
N_("network port not found"),
- N_("network port not found: %s") },
+ N_("network port not found: %1$s") },
[VIR_ERR_NO_HOSTNAME] = {
N_("no hostname found"),
- N_("no hostname found: %s") },
+ N_("no hostname found: %1$s") },
[VIR_ERR_CHECKPOINT_INCONSISTENT] = {
N_("checkpoint inconsistent"),
- N_("checkpoint inconsistent: %s") },
+ N_("checkpoint inconsistent: %1$s") },
[VIR_ERR_MULTIPLE_DOMAINS] = {
N_("multiple matching domains found"),
- N_("multiple matching domains found: %s") },
+ N_("multiple matching domains found: %1$s") },
};
G_STATIC_ASSERT(G_N_ELEMENTS(virErrorMsgStrings) == VIR_ERR_NUMBER_LAST);
#argname, \
NULL, \
0, 0, \
- _("%s in %s must be NULL"), \
+ _("%1$s in %2$s must be NULL"), \
#argname, __FUNCTION__)
#define virReportInvalidNonNullArg(argname) \
virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \
#argname, \
NULL, \
0, 0, \
- _("%s in %s must not be NULL"), \
+ _("%1$s in %2$s must not be NULL"), \
#argname, __FUNCTION__)
#define virReportInvalidEmptyStringArg(argname) \
virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \
#argname, \
NULL, \
0, 0, \
- _("string %s in %s must not be empty"), \
+ _("string %1$s in %2$s must not be empty"), \
#argname, __FUNCTION__)
#define virReportInvalidPositiveArg(argname) \
virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \
#argname, \
NULL, \
0, 0, \
- _("%s in %s must be greater than zero"), \
+ _("%1$s in %2$s must be greater than zero"), \
#argname, __FUNCTION__)
#define virReportInvalidNonZeroArg(argname) \
virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \
#argname, \
NULL, \
0, 0, \
- _("%s in %s must not be zero"), \
+ _("%1$s in %2$s must not be zero"), \
#argname, __FUNCTION__)
#define virReportInvalidZeroArg(argname) \
virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \
#argname, \
NULL, \
0, 0, \
- _("%s in %s must be zero"), \
+ _("%1$s in %2$s must be zero"), \
#argname, __FUNCTION__)
#define virReportInvalidNonNegativeArg(argname) \
virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \
#argname, \
NULL, \
0, 0, \
- _("%s in %s must be zero or greater"), \
+ _("%1$s in %2$s must be zero or greater"), \
#argname, __FUNCTION__)
#define virReportInvalidArg(argname, fmt, ...) \
virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \
if (!evt->thread) {
virEventThreadDataFree(data);
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to start event thread: %s"),
+ _("Unable to start event thread: %1$s"),
gerr->message);
return -1;
}
char *next;
int ret = 0;
+ if (STREQ(msg, "%s"))
+ return 0;
+
for (next = (char *)msg; (next = strchr(next, '%')); next++) {
- if (next[1] != 's') {
+ if (!STRPREFIX(next + 1, "1$s")) {
VIR_TEST_VERBOSE("\nerror message '%s' contains disallowed printf modifiers", msg);
ret = -1;
} else {
}
if (!found) {
- VIR_TEST_VERBOSE("\nerror message '%s' does not contain any %%s modifiers", msg);
+ VIR_TEST_VERBOSE("\nerror message '%s' does not contain correct %%s modifiers", msg);
ret = -1;
}