util: Update format strings in translated messages (part 1)

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Jiri Denemark 2023-03-09 15:11:50 +01:00
parent b3a5d1f1dc
commit e349cdc54b
22 changed files with 298 additions and 298 deletions

View File

@ -44,9 +44,9 @@ G_GNUC_NORETURN static void
usage(int status) usage(int status)
{ {
if (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 { } else {
printf(_("Usage: %s FILENAME FD"), program_name); printf(_("Usage: %1$s FILENAME FD"), program_name);
} }
exit(status); exit(status);
} }
@ -61,7 +61,7 @@ main(int argc, char **argv)
if (virGettextInitialize() < 0 || if (virGettextInitialize() < 0 ||
virErrorInitialize() < 0) { virErrorInitialize() < 0) {
fprintf(stderr, _("%s: initialization failed"), program_name); fprintf(stderr, _("%1$s: initialization failed"), program_name);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@ -71,7 +71,7 @@ main(int argc, char **argv)
usage(EXIT_SUCCESS); usage(EXIT_SUCCESS);
if (argc == 3) { /* FILENAME FD */ if (argc == 3) { /* FILENAME FD */
if (virStrToLong_i(argv[2], NULL, 10, &fd) < 0) { 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]); program_name, argv[3]);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@ -85,7 +85,7 @@ main(int argc, char **argv)
return 0; return 0;
error: error:
fprintf(stderr, _("%s: failure with %s: %s"), fprintf(stderr, _("%1$s: failure with %2$s: %3$s"),
program_name, path, virGetLastErrorMessage()); program_name, path, virGetLastErrorMessage());
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }

View File

@ -248,7 +248,7 @@ virInsertElementsN(void *ptrptr,
at = *countptr; at = *countptr;
} else if (at > *countptr) { } else if (at > *countptr) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); *countptr, at);
return -1; return -1;
} }

View File

@ -153,10 +153,10 @@ virAuthGetUsernamePath(const char *path,
memset(&cred, 0, sizeof(virConnectCredential)); memset(&cred, 0, sizeof(virConnectCredential));
if (defaultUsername != NULL) { 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); defaultUsername);
} else { } 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++) { for (ncred = 0; ncred < auth->ncredtype; ncred++) {
@ -230,7 +230,7 @@ virAuthGetPasswordPath(const char *path,
return NULL; 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))) if (!(cred = virAuthAskCredential(auth, prompt, false)))
return NULL; return NULL;

View File

@ -109,7 +109,7 @@ virAuthConfigLookup(virAuthConfig *auth,
if (!(authcred = g_key_file_get_string(auth->keyfile, authgroup, "credentials", NULL))) { if (!(authcred = g_key_file_get_string(auth->keyfile, authgroup, "credentials", NULL))) {
virReportError(VIR_ERR_CONF_SYNTAX, 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); authgroup, auth->path);
return -1; return -1;
} }
@ -118,7 +118,7 @@ virAuthConfigLookup(virAuthConfig *auth,
if (!g_key_file_has_group(auth->keyfile, credgroup)) { if (!g_key_file_has_group(auth->keyfile, credgroup)) {
virReportError(VIR_ERR_CONF_SYNTAX, 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); authcred, authgroup, auth->path);
return -1; return -1;
} }

View File

@ -478,7 +478,7 @@ virBitmapParseInternal(const char *str,
error: error:
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("Failed to parse bitmap '%s'"), str); _("Failed to parse bitmap '%1$s'"), str);
return -1; return -1;
} }
@ -996,7 +996,7 @@ virBitmapNewString(const char *string)
if (strspn(string, "0123456789abcdefABCDEF") != len) { if (strspn(string, "0123456789abcdefABCDEF") != len) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("Invalid hexadecimal string '%s'"), string); _("Invalid hexadecimal string '%1$s'"), string);
return NULL; return NULL;
} }

View File

@ -64,7 +64,7 @@ virCCWDeviceAddressFromString(const char *address)
&ccw->ssid, &ccw->ssid,
&ccw->devno) < 0) { &ccw->devno) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to parse CCW address '%s'"), _("Failed to parse CCW address '%1$s'"),
address); address);
return NULL; return NULL;
} }

View File

@ -353,7 +353,7 @@ virCgroupDetectPlacement(virCgroup *group,
mapping = fopen(procfile, "r"); mapping = fopen(procfile, "r");
if (mapping == NULL) { if (mapping == NULL) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to open '%s'"), _("Unable to open '%1$s'"),
procfile); procfile);
goto cleanup; goto cleanup;
} }
@ -464,14 +464,14 @@ virCgroupGetBlockDevString(const char *path)
if (stat(path, &sb) < 0) { if (stat(path, &sb) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Path '%s' is not accessible"), _("Path '%1$s' is not accessible"),
path); path);
return NULL; return NULL;
} }
if (!S_ISBLK(sb.st_mode)) { if (!S_ISBLK(sb.st_mode)) {
virReportSystemError(EINVAL, virReportSystemError(EINVAL,
_("Path '%s' must be a block device"), _("Path '%1$s' must be a block device"),
path); path);
return NULL; return NULL;
} }
@ -524,12 +524,12 @@ virCgroupSetValueRaw(const char *path,
if (errno == EINVAL && if (errno == EINVAL &&
(tmp = strrchr(path, '/'))) { (tmp = strrchr(path, '/'))) {
virReportSystemError(errno, virReportSystemError(errno,
_("Invalid value '%s' for '%s'"), _("Invalid value '%1$s' for '%2$s'"),
value, tmp + 1); value, tmp + 1);
return -1; return -1;
} }
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to write to '%s'"), path); _("Unable to write to '%1$s'"), path);
return -1; return -1;
} }
@ -549,7 +549,7 @@ virCgroupGetValueRaw(const char *path,
if ((rc = virFileReadAll(path, 1024*1024, value)) < 0) { if ((rc = virFileReadAll(path, 1024*1024, value)) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to read from '%s'"), path); _("Unable to read from '%1$s'"), path);
return -1; return -1;
} }
@ -656,7 +656,7 @@ virCgroupGetValueI64(virCgroup *group,
if (virStrToLong_ll(strval, NULL, 10, value) < 0) { if (virStrToLong_ll(strval, NULL, 10, value) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse '%s' as an integer"), _("Unable to parse '%1$s' as an integer"),
strval); strval);
return -1; return -1;
} }
@ -678,7 +678,7 @@ virCgroupGetValueU64(virCgroup *group,
if (virStrToLong_ull(strval, NULL, 10, value) < 0) { if (virStrToLong_ull(strval, NULL, 10, value) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse '%s' as an integer"), _("Unable to parse '%1$s' as an integer"),
strval); strval);
return -1; return -1;
} }
@ -947,7 +947,7 @@ virCgroupNewPartition(const char *path,
if (!g_path_is_absolute(path)) { if (!g_path_is_absolute(path)) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Partition path '%s' must start with '/'"), _("Partition path '%1$s' must start with '/'"),
path); path);
return -1; return -1;
} }
@ -1125,7 +1125,7 @@ virCgroupNewThread(virCgroup *domain,
break; break;
case VIR_CGROUP_THREAD_LAST: case VIR_CGROUP_THREAD_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected name value %d"), nameval); _("unexpected name value %1$d"), nameval);
return -1; return -1;
} }
@ -1508,7 +1508,7 @@ virCgroupPathOfController(virCgroup *group,
{ {
if (controller >= VIR_CGROUP_CONTROLLER_LAST) { if (controller >= VIR_CGROUP_CONTROLLER_LAST) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid controller id '%d'"), controller); _("Invalid controller id '%1$d'"), controller);
return -1; return -1;
} }
@ -2187,7 +2187,7 @@ virCgroupAllowDevicePath(virCgroup *group,
return 1; return 1;
virReportSystemError(errno, virReportSystemError(errno,
_("Path '%s' is not accessible"), _("Path '%1$s' is not accessible"),
path); path);
return -1; return -1;
} }
@ -2254,7 +2254,7 @@ virCgroupDenyDevicePath(virCgroup *group,
return 1; return 1;
virReportSystemError(errno, virReportSystemError(errno,
_("Path '%s' is not accessible"), _("Path '%1$s' is not accessible"),
path); path);
return -1; return -1;
} }
@ -2383,7 +2383,7 @@ virCgroupGetPercpuStats(virCgroup *group,
if (start_cpu >= total_cpus) { if (start_cpu >= total_cpus) {
virReportError(VIR_ERR_INVALID_ARG, 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); start_cpu, total_cpus - 1);
return -1; return -1;
} }
@ -2582,7 +2582,7 @@ virCgroupRemoveRecursively(char *grppath)
if (errno == ENOENT) if (errno == ENOENT)
return 0; return 0;
rc = -errno; rc = -errno;
VIR_ERROR(_("Unable to open %s (%d)"), grppath, errno); VIR_ERROR(_("Unable to open %1$s (%2$d)"), grppath, errno);
return rc; return rc;
} }
@ -2601,13 +2601,13 @@ virCgroupRemoveRecursively(char *grppath)
} }
if (direrr < 0) { if (direrr < 0) {
rc = -errno; 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); VIR_DEBUG("Removing cgroup %s", grppath);
if (rmdir(grppath) != 0 && errno != ENOENT) { if (rmdir(grppath) != 0 && errno != ENOENT) {
rc = -errno; rc = -errno;
VIR_ERROR(_("Unable to remove %s (%d)"), grppath, errno); VIR_ERROR(_("Unable to remove %1$s (%2$d)"), grppath, errno);
} }
return rc; return rc;
@ -2677,7 +2677,7 @@ virCgroupKillInternal(virCgroup *group,
} }
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to read %s"), _("Failed to read %1$s"),
keypath); keypath);
goto cleanup; goto cleanup;
} else { } else {
@ -2688,7 +2688,7 @@ virCgroupKillInternal(virCgroup *group,
if (feof(fp)) if (feof(fp))
break; break;
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to read %s"), _("Failed to read %1$s"),
keypath); keypath);
goto cleanup; goto cleanup;
} }
@ -2701,7 +2701,7 @@ virCgroupKillInternal(virCgroup *group,
if (kill((pid_t)*pid_value, signum) < 0) { if (kill((pid_t)*pid_value, signum) < 0) {
if (errno != ESRCH) { if (errno != ESRCH) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to kill process %lld"), _("Failed to kill process %1$lld"),
*pid_value); *pid_value);
goto cleanup; goto cleanup;
} }
@ -3025,7 +3025,7 @@ virCgroupGetInode(virCgroup *cgroup)
return -1; return -1;
if (stat(path, &st) < 0) { 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; return -1;
} }

View File

@ -43,7 +43,7 @@ virCgroupBackendRegister(virCgroupBackend *backend)
{ {
if (virCgroupBackends[backend->type]) { if (virCgroupBackends[backend->type]) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cgroup backend '%s' already registered."), _("Cgroup backend '%1$s' already registered."),
virCgroupBackendTypeToString(backend->type)); virCgroupBackendTypeToString(backend->type));
return; return;
} }

View File

@ -466,13 +466,13 @@ virCgroupBackendForController(virCgroup *group,
virCgroupBackend *backend = virCgroupBackendForController(group, controller); \ virCgroupBackend *backend = virCgroupBackendForController(group, controller); \
if (!backend) { \ if (!backend) { \
virReportError(VIR_ERR_INTERNAL_ERROR, \ 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); \ #func, controller); \
return ret; \ return ret; \
} \ } \
if (!backend->func) { \ if (!backend->func) { \
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, \ 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)); \ #func, virCgroupBackendTypeToString(backend->type)); \
return ret; \ return ret; \
} \ } \

View File

@ -230,7 +230,7 @@ virCgroupV1ResolveMountLink(const char *mntDir,
dirName = strrchr(tmp, '/'); dirName = strrchr(tmp, '/');
if (!dirName) { if (!dirName) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Missing '/' separator in cgroup mount '%s'"), tmp); _("Missing '/' separator in cgroup mount '%1$s'"), tmp);
return -1; return -1;
} }
@ -246,7 +246,7 @@ virCgroupV1ResolveMountLink(const char *mntDir,
VIR_WARN("Controller %s co-mounted at %s is missing symlink at %s", VIR_WARN("Controller %s co-mounted at %s is missing symlink at %s",
typeStr, tmp, linkSrc); typeStr, tmp, linkSrc);
} else { } else {
virReportSystemError(errno, _("Cannot stat %s"), linkSrc); virReportSystemError(errno, _("Cannot stat %1$s"), linkSrc);
return -1; return -1;
} }
} else { } else {
@ -409,7 +409,7 @@ virCgroupV1ValidatePlacement(virCgroup *group,
if (!group->legacy[i].placement) { if (!group->legacy[i].placement) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not find placement for v1 controller %s"), _("Could not find placement for v1 controller %1$s"),
virCgroupV1ControllerTypeToString(i)); virCgroupV1ControllerTypeToString(i));
return -1; return -1;
} }
@ -478,7 +478,7 @@ virCgroupV1DetectControllers(virCgroup *group,
if (STREQ_NULLABLE(group->legacy[i].mountPoint, if (STREQ_NULLABLE(group->legacy[i].mountPoint,
group->legacy[j].mountPoint)) { group->legacy[j].mountPoint)) {
virReportSystemError(EINVAL, 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(i),
virCgroupV1ControllerTypeToString(j)); virCgroupV1ControllerTypeToString(j));
return -1; return -1;
@ -547,14 +547,14 @@ virCgroupV1PathOfController(virCgroup *group,
{ {
if (group->legacy[controller].mountPoint == NULL) { if (group->legacy[controller].mountPoint == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("v1 controller '%s' is not mounted"), _("v1 controller '%1$s' is not mounted"),
virCgroupV1ControllerTypeToString(controller)); virCgroupV1ControllerTypeToString(controller));
return -1; return -1;
} }
if (group->legacy[controller].placement == NULL) { if (group->legacy[controller].placement == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("v1 controller '%s' is not enabled for group"), _("v1 controller '%1$s' is not enabled for group"),
virCgroupV1ControllerTypeToString(controller)); virCgroupV1ControllerTypeToString(controller));
return -1; return -1;
} }
@ -670,7 +670,7 @@ virCgroupV1MakeGroup(virCgroup *parent,
continue; continue;
} else { } else {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to create v1 controller %s for group"), _("Failed to create v1 controller %1$s for group"),
virCgroupV1ControllerTypeToString(i)); virCgroupV1ControllerTypeToString(i));
return -1; return -1;
} }
@ -828,7 +828,7 @@ virCgroupV1IdentifyRoot(virCgroup *group)
continue; continue;
if (!(tmp = strrchr(group->legacy[i].mountPoint, '/'))) { if (!(tmp = strrchr(group->legacy[i].mountPoint, '/'))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not find directory separator in %s"), _("Could not find directory separator in %1$s"),
group->legacy[i].mountPoint); group->legacy[i].mountPoint);
return NULL; return NULL;
} }
@ -860,7 +860,7 @@ virCgroupV1BindMount(virCgroup *group,
if (g_mkdir_with_parents(root, 0777) < 0) { if (g_mkdir_with_parents(root, 0777) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to create directory %s"), _("Unable to create directory %1$s"),
root); root);
return -1; return -1;
} }
@ -869,7 +869,7 @@ virCgroupV1BindMount(virCgroup *group,
if (mount("tmpfs", root, "tmpfs", MS_NOSUID|MS_NODEV|MS_NOEXEC, opts) < 0) { if (mount("tmpfs", root, "tmpfs", MS_NOSUID|MS_NODEV|MS_NOEXEC, opts) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to mount %s on %s type %s"), _("Failed to mount %1$s on %2$s type %3$s"),
"tmpfs", root, "tmpfs"); "tmpfs", root, "tmpfs");
return -1; return -1;
} }
@ -886,7 +886,7 @@ virCgroupV1BindMount(virCgroup *group,
group->legacy[i].mountPoint); group->legacy[i].mountPoint);
if (g_mkdir_with_parents(group->legacy[i].mountPoint, 0777) < 0) { if (g_mkdir_with_parents(group->legacy[i].mountPoint, 0777) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to create directory %s"), _("Unable to create directory %1$s"),
group->legacy[i].mountPoint); group->legacy[i].mountPoint);
return -1; return -1;
} }
@ -894,7 +894,7 @@ virCgroupV1BindMount(virCgroup *group,
if (mount(src, group->legacy[i].mountPoint, "none", MS_BIND, if (mount(src, group->legacy[i].mountPoint, "none", MS_BIND,
NULL) < 0) { NULL) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to bind cgroup '%s' on '%s'"), _("Failed to bind cgroup '%1$s' on '%2$s'"),
src, group->legacy[i].mountPoint); src, group->legacy[i].mountPoint);
return -1; return -1;
} }
@ -907,7 +907,7 @@ virCgroupV1BindMount(virCgroup *group,
if (symlink(group->legacy[i].mountPoint, if (symlink(group->legacy[i].mountPoint,
group->legacy[i].linkPoint) < 0) { group->legacy[i].linkPoint) < 0) {
virReportSystemError(errno, 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].mountPoint,
group->legacy[i].linkPoint); group->legacy[i].linkPoint);
return -1; return -1;
@ -952,7 +952,7 @@ virCgroupV1SetOwner(virCgroup *cgroup,
if (chown(entry, uid, gid) < 0) { if (chown(entry, uid, gid) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot chown '%s' to (%u, %u)"), _("cannot chown '%1$s' to (%2$u, %3$u)"),
entry, uid, gid); entry, uid, gid);
return -1; return -1;
} }
@ -962,7 +962,7 @@ virCgroupV1SetOwner(virCgroup *cgroup,
if (chown(base, uid, gid) < 0) { if (chown(base, uid, gid) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot chown '%s' to (%u, %u)"), _("cannot chown '%1$s' to (%2$u, %3$u)"),
base, uid, gid); base, uid, gid);
return -1; return -1;
} }
@ -1042,7 +1042,7 @@ virCgroupV1GetBlkioWeight(virCgroup *group,
if (virStrToLong_ui(value, NULL, 10, weight) < 0) { if (virStrToLong_ui(value, NULL, 10, weight) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse '%s' as an integer"), _("Unable to parse '%1$s' as an integer"),
value); value);
return -1; return -1;
} }
@ -1102,7 +1102,7 @@ virCgroupV1GetBlkioIoServiced(virCgroup *group,
p1 += strlen(value_names[i]); p1 += strlen(value_names[i]);
if (virStrToLong_ll(p1, &p1, 10, &stats_val) < 0) { if (virStrToLong_ll(p1, &p1, 10, &stats_val) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot parse byte %sstat '%s'"), _("Cannot parse byte %1$sstat '%2$s'"),
value_names[i], value_names[i],
p1); p1);
return -1; return -1;
@ -1112,7 +1112,7 @@ virCgroupV1GetBlkioIoServiced(virCgroup *group,
(stats_val > 0 && *bytes_ptrs[i] > (LLONG_MAX - stats_val))) (stats_val > 0 && *bytes_ptrs[i] > (LLONG_MAX - stats_val)))
{ {
virReportError(VIR_ERR_OVERFLOW, virReportError(VIR_ERR_OVERFLOW,
_("Sum of byte %sstat overflows"), _("Sum of byte %1$sstat overflows"),
value_names[i]); value_names[i]);
return -1; return -1;
} }
@ -1123,7 +1123,7 @@ virCgroupV1GetBlkioIoServiced(virCgroup *group,
p2 += strlen(value_names[i]); p2 += strlen(value_names[i]);
if (virStrToLong_ll(p2, &p2, 10, &stats_val) < 0) { if (virStrToLong_ll(p2, &p2, 10, &stats_val) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot parse %srequest stat '%s'"), _("Cannot parse %1$srequest stat '%2$s'"),
value_names[i], value_names[i],
p2); p2);
return -1; return -1;
@ -1133,7 +1133,7 @@ virCgroupV1GetBlkioIoServiced(virCgroup *group,
(stats_val > 0 && *requests_ptrs[i] > (LLONG_MAX - stats_val))) (stats_val > 0 && *requests_ptrs[i] > (LLONG_MAX - stats_val)))
{ {
virReportError(VIR_ERR_OVERFLOW, virReportError(VIR_ERR_OVERFLOW,
_("Sum of %srequest stat overflows"), _("Sum of %1$srequest stat overflows"),
value_names[i]); value_names[i]);
return -1; return -1;
} }
@ -1188,14 +1188,14 @@ virCgroupV1GetBlkioIoDeviceServiced(virCgroup *group,
if (!(p1 = strstr(str1, str3))) { if (!(p1 = strstr(str1, str3))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot find byte stats for block device '%s'"), _("Cannot find byte stats for block device '%1$s'"),
str3); str3);
return -1; return -1;
} }
if (!(p2 = strstr(str2, str3))) { if (!(p2 = strstr(str2, str3))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot find request stats for block device '%s'"), _("Cannot find request stats for block device '%1$s'"),
str3); str3);
return -1; return -1;
} }
@ -1203,28 +1203,28 @@ virCgroupV1GetBlkioIoDeviceServiced(virCgroup *group,
for (i = 0; i < G_N_ELEMENTS(value_names); i++) { for (i = 0; i < G_N_ELEMENTS(value_names); i++) {
if (!(p1 = strstr(p1, value_names[i]))) { if (!(p1 = strstr(p1, value_names[i]))) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); value_names[i], str3);
return -1; return -1;
} }
if (virStrToLong_ll(p1 + strlen(value_names[i]), &p1, 10, bytes_ptrs[i]) < 0) { if (virStrToLong_ll(p1 + strlen(value_names[i]), &p1, 10, bytes_ptrs[i]) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot parse %sstat '%s'"), _("Cannot parse %1$sstat '%2$s'"),
value_names[i], p1 + strlen(value_names[i])); value_names[i], p1 + strlen(value_names[i]));
return -1; return -1;
} }
if (!(p2 = strstr(p2, value_names[i]))) { if (!(p2 = strstr(p2, value_names[i]))) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); value_names[i], str3);
return -1; return -1;
} }
if (virStrToLong_ll(p2 + strlen(value_names[i]), &p2, 10, requests_ptrs[i]) < 0) { if (virStrToLong_ll(p2 + strlen(value_names[i]), &p2, 10, requests_ptrs[i]) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot parse %sstat '%s'"), _("Cannot parse %1$sstat '%2$s'"),
value_names[i], p2 + strlen(value_names[i])); value_names[i], p2 + strlen(value_names[i]));
return -1; return -1;
} }
@ -1302,7 +1302,7 @@ virCgroupV1GetBlkioDeviceWeight(virCgroup *group,
*weight = 0; *weight = 0;
} else if (virStrToLong_ui(str, NULL, 10, weight) < 0) { } else if (virStrToLong_ui(str, NULL, 10, weight) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse '%s' as an integer"), _("Unable to parse '%1$s' as an integer"),
str); str);
return -1; return -1;
} }
@ -1353,7 +1353,7 @@ virCgroupV1GetBlkioDeviceReadIops(virCgroup *group,
*riops = 0; *riops = 0;
} else if (virStrToLong_ui(str, NULL, 10, riops) < 0) { } else if (virStrToLong_ui(str, NULL, 10, riops) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse '%s' as an integer"), _("Unable to parse '%1$s' as an integer"),
str); str);
return -1; return -1;
} }
@ -1404,7 +1404,7 @@ virCgroupV1GetBlkioDeviceWriteIops(virCgroup *group,
*wiops = 0; *wiops = 0;
} else if (virStrToLong_ui(str, NULL, 10, wiops) < 0) { } else if (virStrToLong_ui(str, NULL, 10, wiops) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse '%s' as an integer"), _("Unable to parse '%1$s' as an integer"),
str); str);
return -1; return -1;
} }
@ -1455,7 +1455,7 @@ virCgroupV1GetBlkioDeviceReadBps(virCgroup *group,
*rbps = 0; *rbps = 0;
} else if (virStrToLong_ull(str, NULL, 10, rbps) < 0) { } else if (virStrToLong_ull(str, NULL, 10, rbps) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse '%s' as an integer"), _("Unable to parse '%1$s' as an integer"),
str); str);
return -1; return -1;
} }
@ -1506,7 +1506,7 @@ virCgroupV1GetBlkioDeviceWriteBps(virCgroup *group,
*wbps = 0; *wbps = 0;
} else if (virStrToLong_ull(str, NULL, 10, wbps) < 0) { } else if (virStrToLong_ull(str, NULL, 10, wbps) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse '%s' as an integer"), _("Unable to parse '%1$s' as an integer"),
str); str);
return -1; return -1;
} }
@ -1567,7 +1567,7 @@ virCgroupV1SetMemory(virCgroup *group,
if (kb > maxkb) { if (kb > maxkb) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("Memory '%llu' must be less than %llu"), _("Memory '%1$llu' must be less than %2$llu"),
kb, maxkb); kb, maxkb);
return -1; return -1;
} }
@ -1710,7 +1710,7 @@ virCgroupV1SetMemorySoftLimit(virCgroup *group,
if (kb > maxkb) { if (kb > maxkb) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("Memory '%llu' must be less than %llu"), _("Memory '%1$llu' must be less than %2$llu"),
kb, maxkb); kb, maxkb);
return -1; return -1;
} }
@ -1755,7 +1755,7 @@ virCgroupV1SetMemSwapHardLimit(virCgroup *group,
if (kb > maxkb) { if (kb > maxkb) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("Memory '%llu' must be less than %llu"), _("Memory '%1$llu' must be less than %2$llu"),
kb, maxkb); kb, maxkb);
return -1; return -1;
} }
@ -1906,7 +1906,7 @@ virCgroupV1SetCpuShares(virCgroup *group,
if (shares < VIR_CGROUP_CPU_SHARES_MIN || if (shares < VIR_CGROUP_CPU_SHARES_MIN ||
shares > VIR_CGROUP_CPU_SHARES_MAX) { shares > VIR_CGROUP_CPU_SHARES_MAX) {
virReportError(VIR_ERR_INVALID_ARG, 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, shares,
VIR_CGROUP_CPU_SHARES_MIN, VIR_CGROUP_CPU_SHARES_MIN,
VIR_CGROUP_CPU_SHARES_MAX); VIR_CGROUP_CPU_SHARES_MAX);
@ -1942,7 +1942,7 @@ virCgroupV1SetCpuCfsPeriod(virCgroup *group,
if (cfs_period < VIR_CGROUP_CPU_PERIOD_MIN || if (cfs_period < VIR_CGROUP_CPU_PERIOD_MIN ||
cfs_period > VIR_CGROUP_CPU_PERIOD_MAX) { cfs_period > VIR_CGROUP_CPU_PERIOD_MAX) {
virReportError(VIR_ERR_INVALID_ARG, 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, cfs_period,
VIR_CGROUP_CPU_PERIOD_MIN, VIR_CGROUP_CPU_PERIOD_MIN,
VIR_CGROUP_CPU_PERIOD_MAX); VIR_CGROUP_CPU_PERIOD_MAX);
@ -1973,7 +1973,7 @@ virCgroupV1SetCpuCfsQuota(virCgroup *group,
(cfs_quota < VIR_CGROUP_CPU_QUOTA_MIN || (cfs_quota < VIR_CGROUP_CPU_QUOTA_MIN ||
cfs_quota > VIR_CGROUP_CPU_QUOTA_MAX)) { cfs_quota > VIR_CGROUP_CPU_QUOTA_MAX)) {
virReportError(VIR_ERR_INVALID_ARG, 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, cfs_quota,
VIR_CGROUP_CPU_QUOTA_MIN, VIR_CGROUP_CPU_QUOTA_MIN,
VIR_CGROUP_CPU_QUOTA_MAX); VIR_CGROUP_CPU_QUOTA_MAX);
@ -2049,14 +2049,14 @@ virCgroupV1GetCpuacctStat(virCgroup *group,
if (!(p = STRSKIP(str, "user ")) || if (!(p = STRSKIP(str, "user ")) ||
virStrToLong_ull(p, &p, 10, user) < 0) { virStrToLong_ull(p, &p, 10, user) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot parse user stat '%s'"), _("Cannot parse user stat '%1$s'"),
p); p);
return -1; return -1;
} }
if (!(p = STRSKIP(p, "\nsystem ")) || if (!(p = STRSKIP(p, "\nsystem ")) ||
virStrToLong_ull(p, NULL, 10, sys) < 0) { virStrToLong_ull(p, NULL, 10, sys) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot parse sys stat '%s'"), _("Cannot parse sys stat '%1$s'"),
p); p);
return -1; return -1;
} }

View File

@ -279,7 +279,7 @@ virCgroupV2ParseControllersFile(virCgroup *group,
rc = virFileReadAll(contFile, 1024 * 1024, &contStr); rc = virFileReadAll(contFile, 1024 * 1024, &contStr);
if (rc < 0) { if (rc < 0) {
virReportSystemError(errno, _("Unable to read from '%s'"), contFile); virReportSystemError(errno, _("Unable to read from '%1$s'"), contFile);
return -1; return -1;
} }
@ -360,7 +360,7 @@ virCgroupV2PathOfController(virCgroup *group,
{ {
if (!virCgroupV2HasController(group, controller)) { if (!virCgroupV2HasController(group, controller)) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("v2 controller '%s' is not available"), _("v2 controller '%1$s' is not available"),
virCgroupV2ControllerTypeToString(controller)); virCgroupV2ControllerTypeToString(controller));
return -1; return -1;
} }
@ -398,7 +398,7 @@ virCgroupV2EnableController(virCgroup *group,
if (virFileWriteStr(path, val, 0) < 0) { if (virFileWriteStr(path, val, 0) < 0) {
if (report) { if (report) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to enable controller '%s' for '%s'"), _("Failed to enable controller '%1$s' for '%2$s'"),
val, path); val, path);
} }
return -2; return -2;
@ -439,7 +439,7 @@ virCgroupV2MakeGroup(virCgroup *parent,
if (!virFileExists(path) && if (!virFileExists(path) &&
(!create || (mkdir(path, 0755) < 0 && errno != EEXIST))) { (!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); path);
return -1; return -1;
} }
@ -590,7 +590,7 @@ virCgroupV2BindMount(virCgroup *group,
VIR_DEBUG("Mounting cgroups at '%s'", group->unified.mountPoint); VIR_DEBUG("Mounting cgroups at '%s'", group->unified.mountPoint);
if (g_mkdir_with_parents(group->unified.mountPoint, 0777) < 0) { 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); group->unified.mountPoint);
return -1; return -1;
} }
@ -598,7 +598,7 @@ virCgroupV2BindMount(virCgroup *group,
src = g_strdup_printf("%s%s", oldroot, group->unified.mountPoint); src = g_strdup_printf("%s%s", oldroot, group->unified.mountPoint);
if (mount(src, group->unified.mountPoint, "none", MS_BIND, NULL) < 0) { 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); src, group->unified.mountPoint);
return -1; return -1;
} }
@ -622,7 +622,7 @@ virCgroupV2SetOwner(virCgroup *cgroup,
return -1; return -1;
if (chown(base, uid, gid) < 0) { 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); base, uid, gid);
return -1; return -1;
} }
@ -710,7 +710,7 @@ virCgroupV2GetBlkioWeight(virCgroup *group,
if (virStrToLong_ui(tmp, &tmp, 10, weight) < 0) { if (virStrToLong_ui(tmp, &tmp, 10, weight) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse '%s' as an integer"), _("Unable to parse '%1$s' as an integer"),
tmp); tmp);
return -1; return -1;
} }
@ -763,7 +763,7 @@ virCgroupV2GetBlkioIoServiced(virCgroup *group,
p1 += strlen(value_names[i]); p1 += strlen(value_names[i]);
if (virStrToLong_ll(p1, &p1, 10, &stats_val) < 0) { if (virStrToLong_ll(p1, &p1, 10, &stats_val) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot parse byte '%s' stat '%s'"), _("Cannot parse byte '%1$s' stat '%2$s'"),
value_names[i], p1); value_names[i], p1);
return -1; return -1;
} }
@ -771,7 +771,7 @@ virCgroupV2GetBlkioIoServiced(virCgroup *group,
if (stats_val < 0 || if (stats_val < 0 ||
(stats_val > 0 && *value_ptrs[i] > (LLONG_MAX - stats_val))) { (stats_val > 0 && *value_ptrs[i] > (LLONG_MAX - stats_val))) {
virReportError(VIR_ERR_OVERFLOW, virReportError(VIR_ERR_OVERFLOW,
_("Sum of byte '%s' stat overflows"), _("Sum of byte '%1$s' stat overflows"),
value_names[i]); value_names[i]);
return -1; return -1;
} }
@ -820,7 +820,7 @@ virCgroupV2GetBlkioIoDeviceServiced(virCgroup *group,
if (!(p1 = strstr(str1, str2))) { if (!(p1 = strstr(str1, str2))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot find byte stats for block device '%s'"), _("Cannot find byte stats for block device '%1$s'"),
str2); str2);
return -1; return -1;
} }
@ -828,7 +828,7 @@ virCgroupV2GetBlkioIoDeviceServiced(virCgroup *group,
for (i = 0; i < G_N_ELEMENTS(value_names); i++) { for (i = 0; i < G_N_ELEMENTS(value_names); i++) {
if (!(p1 = strstr(p1, value_names[i]))) { if (!(p1 = strstr(p1, value_names[i]))) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); value_names[i], str2);
return -1; return -1;
} }
@ -836,7 +836,7 @@ virCgroupV2GetBlkioIoDeviceServiced(virCgroup *group,
p1 += strlen(value_names[i]); p1 += strlen(value_names[i]);
if (virStrToLong_ll(p1, &p1, 10, value_ptrs[i]) < 0) { if (virStrToLong_ll(p1, &p1, 10, value_ptrs[i]) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot parse '%s' stat '%s'"), _("Cannot parse '%1$s' stat '%2$s'"),
value_names[i], p1); value_names[i], p1);
return -1; return -1;
} }
@ -915,7 +915,7 @@ virCgroupV2GetBlkioDeviceWeight(virCgroup *group,
*weight = 0; *weight = 0;
} else if (virStrToLong_ui(str, &tmp, 10, weight) < 0) { } else if (virStrToLong_ui(str, &tmp, 10, weight) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse '%s' as an integer"), _("Unable to parse '%1$s' as an integer"),
str); str);
return -1; return -1;
} }
@ -973,7 +973,7 @@ virCgroupV2GetBlkioDeviceReadIops(virCgroup *group,
} else { } else {
if (!(tmp = strstr(str, name))) { if (!(tmp = strstr(str, name))) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); name, path);
return -1; return -1;
} }
@ -983,7 +983,7 @@ virCgroupV2GetBlkioDeviceReadIops(virCgroup *group,
*riops = 0; *riops = 0;
} else if (virStrToLong_ui(tmp, &tmp, 10, riops) < 0) { } else if (virStrToLong_ui(tmp, &tmp, 10, riops) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse '%s' as an integer"), _("Unable to parse '%1$s' as an integer"),
str); str);
return -1; return -1;
} }
@ -1042,7 +1042,7 @@ virCgroupV2GetBlkioDeviceWriteIops(virCgroup *group,
} else { } else {
if (!(tmp = strstr(str, name))) { if (!(tmp = strstr(str, name))) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); name, path);
return -1; return -1;
} }
@ -1052,7 +1052,7 @@ virCgroupV2GetBlkioDeviceWriteIops(virCgroup *group,
*wiops = 0; *wiops = 0;
} else if (virStrToLong_ui(tmp, &tmp, 10, wiops) < 0) { } else if (virStrToLong_ui(tmp, &tmp, 10, wiops) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse '%s' as an integer"), _("Unable to parse '%1$s' as an integer"),
str); str);
return -1; return -1;
} }
@ -1111,7 +1111,7 @@ virCgroupV2GetBlkioDeviceReadBps(virCgroup *group,
} else { } else {
if (!(tmp = strstr(str, name))) { if (!(tmp = strstr(str, name))) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); name, path);
return -1; return -1;
} }
@ -1121,7 +1121,7 @@ virCgroupV2GetBlkioDeviceReadBps(virCgroup *group,
*rbps = 0; *rbps = 0;
} else if (virStrToLong_ull(tmp, &tmp, 10, rbps) < 0) { } else if (virStrToLong_ull(tmp, &tmp, 10, rbps) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse '%s' as an integer"), _("Unable to parse '%1$s' as an integer"),
str); str);
return -1; return -1;
} }
@ -1180,7 +1180,7 @@ virCgroupV2GetBlkioDeviceWriteBps(virCgroup *group,
} else { } else {
if (!(tmp = strstr(str, name))) { if (!(tmp = strstr(str, name))) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); name, path);
return -1; return -1;
} }
@ -1190,7 +1190,7 @@ virCgroupV2GetBlkioDeviceWriteBps(virCgroup *group,
*wbps = 0; *wbps = 0;
} else if (virStrToLong_ull(tmp, &tmp, 10, wbps) < 0) { } else if (virStrToLong_ull(tmp, &tmp, 10, wbps) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse '%s' as an integer"), _("Unable to parse '%1$s' as an integer"),
str); str);
return -1; return -1;
} }
@ -1208,7 +1208,7 @@ virCgroupV2SetMemory(virCgroup *group,
if (kb > maxkb) { if (kb > maxkb) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("Memory '%llu' must be less than %llu"), _("Memory '%1$llu' must be less than %2$llu"),
kb, maxkb); kb, maxkb);
return -1; return -1;
} }
@ -1271,7 +1271,7 @@ virCgroupV2GetMemoryStat(virCgroup *group,
if (virStrToLong_ull(valueStr + 1, NULL, 10, &value) < 0) { if (virStrToLong_ull(valueStr + 1, NULL, 10, &value) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse '%s' as an integer"), _("Unable to parse '%1$s' as an integer"),
valueStr + 1); valueStr + 1);
return -1; return -1;
} }
@ -1348,7 +1348,7 @@ virCgroupV2GetMemoryHardLimit(virCgroup *group,
if (virStrToLong_ull(value, NULL, 10, &max) < 0) { if (virStrToLong_ull(value, NULL, 10, &max) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to parse value '%s' as number."), _("Failed to parse value '%1$s' as number."),
value); value);
return -1; return -1;
} }
@ -1369,7 +1369,7 @@ virCgroupV2SetMemorySoftLimit(virCgroup *group,
if (kb > maxkb) { if (kb > maxkb) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("Memory '%llu' must be less than %llu"), _("Memory '%1$llu' must be less than %2$llu"),
kb, maxkb); kb, maxkb);
return -1; return -1;
} }
@ -1407,7 +1407,7 @@ virCgroupV2GetMemorySoftLimit(virCgroup *group,
if (virStrToLong_ull(value, NULL, 10, &high) < 0) { if (virStrToLong_ull(value, NULL, 10, &high) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to parse value '%s' as number."), _("Failed to parse value '%1$s' as number."),
value); value);
return -1; return -1;
} }
@ -1428,7 +1428,7 @@ virCgroupV2SetMemSwapHardLimit(virCgroup *group,
if (kb > maxkb) { if (kb > maxkb) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("Memory '%llu' must be less than %llu"), _("Memory '%1$llu' must be less than %2$llu"),
kb, maxkb); kb, maxkb);
return -1; return -1;
} }
@ -1467,7 +1467,7 @@ virCgroupV2GetMemSwapHardLimit(virCgroup *group,
if (virStrToLong_ull(value, NULL, 10, &max) < 0) { if (virStrToLong_ull(value, NULL, 10, &max) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to parse value '%s' as number."), _("Failed to parse value '%1$s' as number."),
value); value);
return -1; return -1;
} }
@ -1502,7 +1502,7 @@ virCgroupV2SetCpuShares(virCgroup *group,
if (shares < VIR_CGROUPV2_WEIGHT_MIN || if (shares < VIR_CGROUPV2_WEIGHT_MIN ||
shares > VIR_CGROUPV2_WEIGHT_MAX) { shares > VIR_CGROUPV2_WEIGHT_MAX) {
virReportError(VIR_ERR_INVALID_ARG, 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, shares,
VIR_CGROUPV2_WEIGHT_MIN, VIR_CGROUPV2_WEIGHT_MIN,
VIR_CGROUPV2_WEIGHT_MAX); VIR_CGROUPV2_WEIGHT_MAX);
@ -1542,7 +1542,7 @@ virCgroupV2SetCpuCfsPeriod(virCgroup *group,
if (cfs_period < VIR_CGROUP_CPU_PERIOD_MIN || if (cfs_period < VIR_CGROUP_CPU_PERIOD_MIN ||
cfs_period > VIR_CGROUP_CPU_PERIOD_MAX) { cfs_period > VIR_CGROUP_CPU_PERIOD_MAX) {
virReportError(VIR_ERR_INVALID_ARG, 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_MIN,
VIR_CGROUP_CPU_PERIOD_MAX, VIR_CGROUP_CPU_PERIOD_MAX,
cfs_period); cfs_period);
@ -1588,7 +1588,7 @@ virCgroupV2GetCpuCfsPeriod(virCgroup *group,
if (virStrToLong_ull(tmp, &tmp, 10, cfs_period) < 0) { if (virStrToLong_ull(tmp, &tmp, 10, cfs_period) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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; return -1;
} }
@ -1604,7 +1604,7 @@ virCgroupV2SetCpuCfsQuota(virCgroup *group,
(cfs_quota < VIR_CGROUP_CPU_QUOTA_MIN || (cfs_quota < VIR_CGROUP_CPU_QUOTA_MIN ||
cfs_quota > VIR_CGROUP_CPU_QUOTA_MAX)) { cfs_quota > VIR_CGROUP_CPU_QUOTA_MAX)) {
virReportError(VIR_ERR_INVALID_ARG, 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, cfs_quota,
VIR_CGROUP_CPU_QUOTA_MIN, VIR_CGROUP_CPU_QUOTA_MIN,
VIR_CGROUP_CPU_QUOTA_MAX); VIR_CGROUP_CPU_QUOTA_MAX);
@ -1642,7 +1642,7 @@ virCgroupV2GetCpuCfsQuota(virCgroup *group,
if (virStrToLong_ll(str, &tmp, 10, cfs_quota) < 0) { if (virStrToLong_ll(str, &tmp, 10, cfs_quota) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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; return -1;
} }
@ -1679,14 +1679,14 @@ virCgroupV2GetCpuacctUsage(virCgroup *group,
if (!(tmp = strstr(str, "usage_usec "))) { if (!(tmp = strstr(str, "usage_usec "))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot parse cpu usage stat '%s'"), str); _("cannot parse cpu usage stat '%1$s'"), str);
return -1; return -1;
} }
tmp += strlen("usage_usec "); tmp += strlen("usage_usec ");
if (virStrToLong_ull(tmp, &tmp, 10, usage) < 0) { if (virStrToLong_ull(tmp, &tmp, 10, usage) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to parse value '%s' as number."), tmp); _("Failed to parse value '%1$s' as number."), tmp);
return -1; return -1;
} }
@ -1713,27 +1713,27 @@ virCgroupV2GetCpuacctStat(virCgroup *group,
if (!(tmp = strstr(str, "user_usec "))) { if (!(tmp = strstr(str, "user_usec "))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot parse cpu user stat '%s'"), str); _("cannot parse cpu user stat '%1$s'"), str);
return -1; return -1;
} }
tmp += strlen("user_usec "); tmp += strlen("user_usec ");
if (virStrToLong_ull(tmp, &tmp, 10, &userVal) < 0) { if (virStrToLong_ull(tmp, &tmp, 10, &userVal) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to parse value '%s' as number."), tmp); _("Failed to parse value '%1$s' as number."), tmp);
return -1; return -1;
} }
if (!(tmp = strstr(str, "system_usec "))) { if (!(tmp = strstr(str, "system_usec "))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot parse cpu sys stat '%s'"), str); _("cannot parse cpu sys stat '%1$s'"), str);
return -1; return -1;
} }
tmp += strlen("system_usec "); tmp += strlen("system_usec ");
if (virStrToLong_ull(tmp, &tmp, 10, &sysVal) < 0) { if (virStrToLong_ull(tmp, &tmp, 10, &sysVal) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to parse value '%s' as number."), tmp); _("Failed to parse value '%1$s' as number."), tmp);
return -1; return -1;
} }

View File

@ -297,7 +297,7 @@ virCgroupV2DevicesAttachProg(virCgroup *group,
cgroupfd = open(path, O_RDONLY); cgroupfd = open(path, O_RDONLY);
if (cgroupfd < 0) { if (cgroupfd < 0) {
virReportSystemError(errno, _("unable to open '%s'"), path); virReportSystemError(errno, _("unable to open '%1$s'"), path);
goto cleanup; goto cleanup;
} }
@ -375,7 +375,7 @@ virCgroupV2DevicesDetectProg(virCgroup *group)
cgroupfd = open(path, O_RDONLY); cgroupfd = open(path, O_RDONLY);
if (cgroupfd < 0) { if (cgroupfd < 0) {
virReportSystemError(errno, _("unable to open '%s'"), path); virReportSystemError(errno, _("unable to open '%1$s'"), path);
return -1; return -1;
} }

View File

@ -372,7 +372,7 @@ getDevNull(int *null)
{ {
if (*null == -1 && (*null = open("/dev/null", O_RDWR|O_CLOEXEC)) < 0) { if (*null == -1 && (*null = open("/dev/null", O_RDWR|O_CLOEXEC)) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("cannot open %s"), _("cannot open %1$s"),
"/dev/null"); "/dev/null");
return -1; return -1;
} }
@ -428,7 +428,7 @@ virCommandHandshakeChild(virCommand *cmd)
} }
if (c != '1') { if (c != '1') {
virReportSystemError(EINVAL, virReportSystemError(EINVAL,
_("Unexpected confirm code '%c' from parent"), _("Unexpected confirm code '%1$c' from parent"),
c); c);
return -1; return -1;
} }
@ -453,7 +453,7 @@ virExecCommon(virCommand *cmd, gid_t *groups, int ngroups)
if (cmd->schedCore > 0 && if (cmd->schedCore > 0 &&
virProcessSchedCoreShareFrom(cmd->schedCore) < 0) { virProcessSchedCoreShareFrom(cmd->schedCore) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to run among %llu"), _("Unable to run among %1$llu"),
(unsigned long long) cmd->schedCore); (unsigned long long) cmd->schedCore);
return -1; return -1;
} }
@ -472,7 +472,7 @@ virExecCommon(virCommand *cmd, gid_t *groups, int ngroups)
VIR_DEBUG("Running child in %s", cmd->pwd); VIR_DEBUG("Running child in %s", cmd->pwd);
if (chdir(cmd->pwd) < 0) { if (chdir(cmd->pwd) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to change to %s"), cmd->pwd); _("Unable to change to %1$s"), cmd->pwd);
return -1; return -1;
} }
} }
@ -501,7 +501,7 @@ virCommandMassCloseGetFDsLinux(virCommand *cmd G_GNUC_UNUSED,
if (virStrToLong_i(entry->d_name, NULL, 10, &fd) < 0) { if (virStrToLong_i(entry->d_name, NULL, 10, &fd) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to parse FD: %s"), _("unable to parse FD: %1$s"),
entry->d_name); entry->d_name);
return -1; return -1;
} }
@ -568,7 +568,7 @@ virCommandMassClose(virCommand *cmd,
int tmpfd = fd; int tmpfd = fd;
VIR_MASS_CLOSE(tmpfd); VIR_MASS_CLOSE(tmpfd);
} else if (virSetInherit(fd, true) < 0) { } 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; return -1;
} }
} }
@ -621,7 +621,7 @@ virCommandMassClose(virCommand *cmd,
int tmpfd = fd; int tmpfd = fd;
VIR_MASS_CLOSE(tmpfd); VIR_MASS_CLOSE(tmpfd);
} else if (virSetInherit(fd, true) < 0) { } 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; return -1;
} }
} }
@ -867,8 +867,7 @@ virExec(virCommand *cmd)
VIR_DEBUG("Setting child security label to %s", cmd->seLinuxLabel); VIR_DEBUG("Setting child security label to %s", cmd->seLinuxLabel);
if (setexeccon_raw(cmd->seLinuxLabel) == -1) { if (setexeccon_raw(cmd->seLinuxLabel) == -1) {
virReportSystemError(errno, virReportSystemError(errno,
_("unable to set SELinux security context " _("unable to set SELinux security context '%1$s' for '%2$s'"),
"'%s' for '%s'"),
cmd->seLinuxLabel, cmd->args[0]); cmd->seLinuxLabel, cmd->args[0]);
if (security_getenforce() == 1) if (security_getenforce() == 1)
goto fork_error; goto fork_error;
@ -880,8 +879,7 @@ virExec(virCommand *cmd)
VIR_DEBUG("Setting child AppArmor profile to %s", cmd->appArmorProfile); VIR_DEBUG("Setting child AppArmor profile to %s", cmd->appArmorProfile);
if (aa_change_profile(cmd->appArmorProfile) < 0) { if (aa_change_profile(cmd->appArmorProfile) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("unable to set AppArmor profile '%s' " _("unable to set AppArmor profile '%1$s' for '%2$s'"),
"for '%s'"),
cmd->appArmorProfile, cmd->args[0]); cmd->appArmorProfile, cmd->args[0]);
goto fork_error; goto fork_error;
} }
@ -904,7 +902,7 @@ virExec(virCommand *cmd)
ret = errno == ENOENT ? EXIT_ENOENT : EXIT_CANNOT_INVOKE; ret = errno == ENOENT ? EXIT_ENOENT : EXIT_CANNOT_INVOKE;
virReportSystemError(errno, virReportSystemError(errno,
_("cannot execute binary %s"), _("cannot execute binary %1$s"),
cmd->args[0]); cmd->args[0]);
fork_error: fork_error:
@ -2182,7 +2180,7 @@ virCommandGetBinaryPath(virCommand *cmd)
if (!(cmd->binaryPath = virFindFileInPath(cmd->args[0]))) { if (!(cmd->binaryPath = virFindFileInPath(cmd->args[0]))) {
virReportSystemError(ENOENT, virReportSystemError(ENOENT,
_("Cannot find '%s' in path"), _("Cannot find '%1$s' in path"),
cmd->args[0]); cmd->args[0]);
return NULL; return NULL;
} }
@ -2369,7 +2367,7 @@ int virCommandExec(virCommand *cmd, gid_t *groups, int ngroups)
execve(cmd->args[0], cmd->args, cmd->env); execve(cmd->args[0], cmd->args, cmd->env);
virReportSystemError(errno, virReportSystemError(errno,
_("cannot execute binary %s"), _("cannot execute binary %1$s"),
cmd->args[0]); cmd->args[0]);
return -1; return -1;
} }
@ -2584,7 +2582,7 @@ virCommandRunAsync(virCommand *cmd, pid_t *pid)
if (cmd->pid != -1) { if (cmd->pid != -1) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("command is already running as pid %lld"), _("command is already running as pid %1$lld"),
(long long) cmd->pid); (long long) cmd->pid);
goto cleanup; goto cleanup;
} }
@ -2596,7 +2594,7 @@ virCommandRunAsync(virCommand *cmd, pid_t *pid)
} }
if (cmd->pwd && (cmd->flags & VIR_EXEC_DAEMON)) { if (cmd->pwd && (cmd->flags & VIR_EXEC_DAEMON)) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("daemonized command cannot set working directory %s"), _("daemonized command cannot set working directory %1$s"),
cmd->pwd); cmd->pwd);
goto cleanup; goto cleanup;
} }
@ -2750,7 +2748,7 @@ virCommandWait(virCommand *cmd, int *exitstatus)
bool haveErrMsg = cmd->errbuf && *cmd->errbuf && (*cmd->errbuf)[0]; bool haveErrMsg = cmd->errbuf && *cmd->errbuf && (*cmd->errbuf)[0];
virReportError(VIR_ERR_INTERNAL_ERROR, 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), str ? str : cmd->args[0], NULLSTR(st),
haveErrMsg ? ": " : "", haveErrMsg ? ": " : "",
haveErrMsg ? *cmd->errbuf : ""); haveErrMsg ? *cmd->errbuf : "");
@ -3260,7 +3258,7 @@ virCommandRunRegex(virCommand *cmd,
reg[i] = g_regex_new(regex[i], G_REGEX_OPTIMIZE, 0, &err); reg[i] = g_regex_new(regex[i], G_REGEX_OPTIMIZE, 0, &err);
if (!reg[i]) { if (!reg[i]) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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++) for (j = 0; j < i; j++)
g_regex_unref(reg[j]); g_regex_unref(reg[j]);
VIR_FREE(reg); VIR_FREE(reg);
@ -3426,7 +3424,7 @@ virCommandRunRegex(virCommand *cmd G_GNUC_UNUSED,
int *exitstatus G_GNUC_UNUSED) int *exitstatus G_GNUC_UNUSED)
{ {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("%s not implemented on Win32"), __FUNCTION__); _("%1$s not implemented on Win32"), __FUNCTION__);
return -1; return -1;
} }
@ -3437,7 +3435,7 @@ virCommandRunNul(virCommand *cmd G_GNUC_UNUSED,
void *data G_GNUC_UNUSED) void *data G_GNUC_UNUSED)
{ {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("%s not implemented on Win32"), __FUNCTION__); _("%1$s not implemented on Win32"), __FUNCTION__);
return -1; return -1;
} }
#endif /* WIN32 */ #endif /* WIN32 */

View File

@ -106,7 +106,7 @@ virConfErrorHelper(const char *file, const char *func, size_t line,
/* Construct the string 'filename:line: info' if we have that. */ /* Construct the string 'filename:line: info' if we have that. */
if (ctxt && ctxt->filename) { if (ctxt && ctxt->filename) {
virReportErrorHelper(VIR_FROM_CONF, error, file, func, line, 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 { } else {
virReportErrorHelper(VIR_FROM_CONF, error, file, func, line, virReportErrorHelper(VIR_FROM_CONF, error, file, func, line,
"%s", info); "%s", info);
@ -870,7 +870,7 @@ int virConfGetValueString(virConf *conf,
if (cval->type != VIR_CONF_STRING) { if (cval->type != VIR_CONF_STRING) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("%s: expected a string for '%s' parameter"), _("%1$s: expected a string for '%2$s' parameter"),
conf->filename, setting); conf->filename, setting);
return -1; return -1;
} }
@ -924,7 +924,7 @@ int virConfGetValueStringList(virConf *conf,
for (len = 0, eval = cval->list; eval; len++, eval = eval->next) { for (len = 0, eval = cval->list; eval; len++, eval = eval->next) {
if (eval->type != VIR_CONF_STRING) { if (eval->type != VIR_CONF_STRING) {
virReportError(VIR_ERR_CONF_SYNTAX, 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); conf->filename, setting);
return -1; return -1;
} }
@ -950,8 +950,8 @@ int virConfGetValueStringList(virConf *conf,
case VIR_CONF_NONE: case VIR_CONF_NONE:
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
compatString ? compatString ?
_("%s: expected a string or string list for '%s' parameter") : _("%1$s: expected a string or string list for '%2$s' parameter") :
_("%s: expected a string list for '%s' parameter"), _("%1$s: expected a string list for '%2$s' parameter"),
conf->filename, setting); conf->filename, setting);
return -1; return -1;
@ -994,14 +994,14 @@ int virConfGetValueBool(virConf *conf,
if (cval->type != VIR_CONF_ULLONG) { if (cval->type != VIR_CONF_ULLONG) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("%s: expected a bool for '%s' parameter"), _("%1$s: expected a bool for '%2$s' parameter"),
conf->filename, setting); conf->filename, setting);
return -1; return -1;
} }
if (((unsigned long long)cval->l) > 1) { if (((unsigned long long)cval->l) > 1) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); conf->filename, setting);
return -1; return -1;
} }
@ -1043,14 +1043,14 @@ int virConfGetValueInt(virConf *conf,
if (cval->type != VIR_CONF_LLONG && if (cval->type != VIR_CONF_LLONG &&
cval->type != VIR_CONF_ULLONG) { cval->type != VIR_CONF_ULLONG) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); conf->filename, setting);
return -1; return -1;
} }
if (cval->l > INT_MAX || cval->l < INT_MIN) { if (cval->l > INT_MAX || cval->l < INT_MIN) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); conf->filename, setting, INT_MIN, INT_MAX);
return -1; return -1;
} }
@ -1091,14 +1091,14 @@ int virConfGetValueUInt(virConf *conf,
if (cval->type != VIR_CONF_ULLONG) { if (cval->type != VIR_CONF_ULLONG) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); conf->filename, setting);
return -1; return -1;
} }
if (((unsigned long long)cval->l) > UINT_MAX) { if (((unsigned long long)cval->l) > UINT_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); conf->filename, setting, UINT_MAX);
return -1; return -1;
} }
@ -1139,7 +1139,7 @@ int virConfGetValueSizeT(virConf *conf,
if (cval->type != VIR_CONF_ULLONG) { if (cval->type != VIR_CONF_ULLONG) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); conf->filename, setting);
return -1; return -1;
} }
@ -1147,7 +1147,7 @@ int virConfGetValueSizeT(virConf *conf,
#if ULLONG_MAX > SIZE_MAX #if ULLONG_MAX > SIZE_MAX
if (((unsigned long long)cval->l) > SIZE_MAX) { if (((unsigned long long)cval->l) > SIZE_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); conf->filename, setting, SIZE_MAX);
return -1; return -1;
} }
@ -1190,7 +1190,7 @@ int virConfGetValueSSizeT(virConf *conf,
if (cval->type == VIR_CONF_ULLONG) { if (cval->type == VIR_CONF_ULLONG) {
if (((unsigned long long)cval->l) > SSIZE_MAX) { if (((unsigned long long)cval->l) > SSIZE_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); conf->filename, setting, (ssize_t)-SSIZE_MAX - 1, (ssize_t)SSIZE_MAX);
return -1; return -1;
} }
@ -1198,14 +1198,14 @@ int virConfGetValueSSizeT(virConf *conf,
#if SSIZE_MAX < LLONG_MAX #if SSIZE_MAX < LLONG_MAX
if (cval->l < (-SSIZE_MAX - 1) || cval->l > SSIZE_MAX) { if (cval->l < (-SSIZE_MAX - 1) || cval->l > SSIZE_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); conf->filename, setting, (ssize_t)-SSIZE_MAX - 1, (ssize_t)SSIZE_MAX);
return -1; return -1;
} }
#endif #endif
} else { } else {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); conf->filename, setting);
return -1; return -1;
} }
@ -1247,13 +1247,13 @@ int virConfGetValueLLong(virConf *conf,
if (cval->type == VIR_CONF_ULLONG) { if (cval->type == VIR_CONF_ULLONG) {
if (((unsigned long long)cval->l) > LLONG_MAX) { if (((unsigned long long)cval->l) > LLONG_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); conf->filename, setting, LLONG_MIN, LLONG_MAX);
return -1; return -1;
} }
} else if (cval->type != VIR_CONF_LLONG) { } else if (cval->type != VIR_CONF_LLONG) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); conf->filename, setting);
return -1; return -1;
} }
@ -1293,7 +1293,7 @@ int virConfGetValueULLong(virConf *conf,
if (cval->type != VIR_CONF_ULLONG) { if (cval->type != VIR_CONF_ULLONG) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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); conf->filename, setting);
return -1; return -1;
} }
@ -1332,7 +1332,7 @@ virConfSetValue(virConf *conf,
if (*value && (*value)->type == VIR_CONF_STRING && !(*value)->str) { if (*value && (*value)->type == VIR_CONF_STRING && !(*value)->str) {
virReportError(VIR_ERR_INTERNAL_ERROR, 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)); virConfTypeToString(VIR_CONF_STRING));
g_clear_pointer(value, virConfFreeValue); g_clear_pointer(value, virConfFreeValue);
return -1; return -1;

View File

@ -56,14 +56,14 @@ virCryptoHashBuf(virCryptoHash hash,
int rc; int rc;
if (hash >= VIR_CRYPTO_HASH_LAST) { if (hash >= VIR_CRYPTO_HASH_LAST) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("Unknown crypto hash %d"), hash); _("Unknown crypto hash %1$d"), hash);
return -1; return -1;
} }
rc = gnutls_hash_fast(hashinfo[hash].algorithm, input, strlen(input), output); rc = gnutls_hash_fast(hashinfo[hash].algorithm, input, strlen(input), output);
if (rc < 0) { if (rc < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to compute hash of data: %s"), _("Unable to compute hash of data: %1$s"),
gnutls_strerror(rc)); gnutls_strerror(rc));
return -1; return -1;
} }
@ -133,7 +133,7 @@ virCryptoEncryptDataAESgnutls(gnutls_cipher_algorithm_t gnutls_enc_alg,
if ((rc = gnutls_cipher_init(&handle, gnutls_enc_alg, if ((rc = gnutls_cipher_init(&handle, gnutls_enc_alg,
&enc_key, &iv_buf)) < 0) { &enc_key, &iv_buf)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to initialize cipher: '%s'"), _("failed to initialize cipher: '%1$s'"),
gnutls_strerror(rc)); gnutls_strerror(rc));
return -1; return -1;
} }
@ -160,7 +160,7 @@ virCryptoEncryptDataAESgnutls(gnutls_cipher_algorithm_t gnutls_enc_alg,
if (rc < 0) { if (rc < 0) {
virSecureErase(ciphertext, ciphertextlen); virSecureErase(ciphertext, ciphertextlen);
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to encrypt the data: '%s'"), _("failed to encrypt the data: '%1$s'"),
gnutls_strerror(rc)); gnutls_strerror(rc));
return -1; return -1;
} }
@ -202,14 +202,14 @@ virCryptoEncryptData(virCryptoCipher algorithm,
case VIR_CRYPTO_CIPHER_AES256CBC: case VIR_CRYPTO_CIPHER_AES256CBC:
if (enckeylen != 32) { if (enckeylen != 32) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("AES256CBC encryption invalid keylen=%zu"), _("AES256CBC encryption invalid keylen=%1$zu"),
enckeylen); enckeylen);
return -1; return -1;
} }
if (ivlen != 16) { if (ivlen != 16) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("AES256CBC initialization vector invalid len=%zu"), _("AES256CBC initialization vector invalid len=%1$zu"),
ivlen); ivlen);
return -1; return -1;
} }
@ -230,6 +230,6 @@ virCryptoEncryptData(virCryptoCipher algorithm,
} }
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("algorithm=%d is not supported"), algorithm); _("algorithm=%1$d is not supported"), algorithm);
return -1; return -1;
} }

View File

@ -123,14 +123,14 @@ virDaemonForkIntoBackground(const char *argv0)
if (ret != 1) { if (ret != 1) {
fprintf(stderr, fprintf(stderr,
_("%s: error: unable to determine if daemon is " _("%1$s: error: unable to determine if daemon is running: %2$s\n"),
"running: %s\n"), argv0, argv0,
g_strerror(errno)); g_strerror(errno));
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} else if (status != 0) { } else if (status != 0) {
fprintf(stderr, fprintf(stderr,
_("%s: error: %s. Check /var/log/messages or run without " _("%1$s: error: %2$s. Check /var/log/messages or run without --daemon for more info.\n"),
"--daemon for more info.\n"), argv0, argv0,
virDaemonErrTypeToString(status)); virDaemonErrTypeToString(status));
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }

View File

@ -82,7 +82,7 @@ virDevMapperGetMajor(unsigned int *major)
if (!lines[i]) { if (!lines[i]) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to find major for %s"), _("Unable to find major for %1$s"),
DM_NAME); DM_NAME);
return -1; return -1;
} }
@ -154,7 +154,7 @@ virDMOpen(void)
if (dm.version[0] != DM_VERSION_MAJOR) { if (dm.version[0] != DM_VERSION_MAJOR) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, 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]); DM_VERSION_MAJOR, dm.version[0]);
return -1; return -1;
} }
@ -185,7 +185,7 @@ virDMSanitizepath(const char *path)
/* It's a path. Check if the last component is DM name */ /* It's a path. Check if the last component is DM name */
if (stat(path, &sb[0]) < 0) { if (stat(path, &sb[0]) < 0) {
virReportError(errno, virReportError(errno,
_("Unable to stat %p"), _("Unable to stat %1$p"),
path); path);
return NULL; return NULL;
} }
@ -252,7 +252,7 @@ virDevMapperGetTargetsImpl(int controlFD,
return 0; return 0;
virReportSystemError(errno, virReportSystemError(errno,
_("Unable to query dependencies for %s"), _("Unable to query dependencies for %1$s"),
path); path);
return -1; return -1;
} }

View File

@ -230,7 +230,7 @@ addnhostsSave(dnsmasqAddnHostsfile *addnhostsfile)
addnhostsfile->nhosts); addnhostsfile->nhosts);
if (err < 0) { if (err < 0) {
virReportSystemError(-err, _("cannot write config file '%s'"), virReportSystemError(-err, _("cannot write config file '%1$s'"),
addnhostsfile->path); addnhostsfile->path);
return -1; return -1;
} }
@ -245,7 +245,7 @@ genericFileDelete(char *path)
return 0; return 0;
if (unlink(path) < 0) { if (unlink(path) < 0) {
virReportSystemError(errno, _("cannot remove config file '%s'"), virReportSystemError(errno, _("cannot remove config file '%1$s'"),
path); path);
return -1; return -1;
} }
@ -400,7 +400,7 @@ hostsfileSave(dnsmasqHostsfile *hostsfile)
hostsfile->nhosts); hostsfile->nhosts);
if (err < 0) { if (err < 0) {
virReportSystemError(-err, _("cannot write config file '%s'"), virReportSystemError(-err, _("cannot write config file '%1$s'"),
hostsfile->path); hostsfile->path);
return -1; return -1;
} }
@ -509,7 +509,7 @@ dnsmasqSave(const dnsmasqContext *ctx)
int ret = 0; int ret = 0;
if (g_mkdir_with_parents(ctx->config_dir, 0777) < 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); ctx->config_dir);
return -1; return -1;
} }
@ -556,8 +556,7 @@ dnsmasqReload(pid_t pid G_GNUC_UNUSED)
#ifndef WIN32 #ifndef WIN32
if (kill(pid, SIGHUP) != 0) { if (kill(pid, SIGHUP) != 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to make dnsmasq (PID: %d)" _("Failed to make dnsmasq (PID: %1$d) reload config files."),
" reload config files."),
pid); pid);
return -1; return -1;
} }
@ -617,7 +616,7 @@ dnsmasqCapsSetFromBuffer(dnsmasqCaps *caps, const char *buf)
if (version < DNSMASQ_MIN_MAJOR * 1000000 + DNSMASQ_MIN_MINOR * 1000) { if (version < DNSMASQ_MIN_MAJOR * 1000000 + DNSMASQ_MIN_MINOR * 1000) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, 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, DNSMASQ_MIN_MAJOR, DNSMASQ_MIN_MINOR,
version / 1000000, version / 1000000,
version % 1000000 / 1000); version % 1000000 / 1000);
@ -636,7 +635,7 @@ dnsmasqCapsSetFromBuffer(dnsmasqCaps *caps, const char *buf)
else else
len = p - buf; len = p - buf;
virReportError(VIR_ERR_INTERNAL_ERROR, 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); caps->binaryPath, len, buf);
return -1; return -1;

View File

@ -957,115 +957,115 @@ static const virErrorMsgTuple virErrorMsgStrings[] = {
[VIR_ERR_OK] = { NULL, NULL }, [VIR_ERR_OK] = { NULL, NULL },
[VIR_ERR_INTERNAL_ERROR] = { [VIR_ERR_INTERNAL_ERROR] = {
N_("internal error"), N_("internal error"),
N_("internal error: %s") }, N_("internal error: %1$s") },
[VIR_ERR_NO_MEMORY] = { [VIR_ERR_NO_MEMORY] = {
N_("out of memory"), N_("out of memory"),
N_("out of memory: %s") }, N_("out of memory: %1$s") },
[VIR_ERR_NO_SUPPORT] = { [VIR_ERR_NO_SUPPORT] = {
N_("this function is not supported by the connection driver"), 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] = { [VIR_ERR_UNKNOWN_HOST] = {
N_("unknown host"), N_("unknown host"),
N_("unknown host %s") }, N_("unknown host %1$s") },
[VIR_ERR_NO_CONNECT] = { [VIR_ERR_NO_CONNECT] = {
N_("no connection driver available"), N_("no connection driver available"),
N_("no connection driver available for %s") }, N_("no connection driver available for %1$s") },
[VIR_ERR_INVALID_CONN] = { [VIR_ERR_INVALID_CONN] = {
N_("invalid connection pointer in"), N_("invalid connection pointer in"),
N_("invalid connection pointer in %s") }, N_("invalid connection pointer in %1$s") },
[VIR_ERR_INVALID_DOMAIN] = { [VIR_ERR_INVALID_DOMAIN] = {
N_("invalid domain pointer in"), N_("invalid domain pointer in"),
N_("invalid domain pointer in %s") }, N_("invalid domain pointer in %1$s") },
[VIR_ERR_INVALID_ARG] = { [VIR_ERR_INVALID_ARG] = {
N_("invalid argument"), N_("invalid argument"),
N_("invalid argument: %s") }, N_("invalid argument: %1$s") },
[VIR_ERR_OPERATION_FAILED] = { [VIR_ERR_OPERATION_FAILED] = {
N_("operation failed"), N_("operation failed"),
N_("operation failed: %s") }, N_("operation failed: %1$s") },
[VIR_ERR_GET_FAILED] = { [VIR_ERR_GET_FAILED] = {
N_("GET operation failed"), N_("GET operation failed"),
N_("GET operation failed: %s") }, N_("GET operation failed: %1$s") },
[VIR_ERR_POST_FAILED] = { [VIR_ERR_POST_FAILED] = {
N_("POST operation failed"), N_("POST operation failed"),
N_("POST operation failed: %s") }, N_("POST operation failed: %1$s") },
[VIR_ERR_HTTP_ERROR] = { [VIR_ERR_HTTP_ERROR] = {
N_("got unknown HTTP error code"), 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] = { [VIR_ERR_SEXPR_SERIAL] = {
N_("failed to serialize S-Expr"), 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] = { [VIR_ERR_NO_XEN] = {
N_("could not use Xen hypervisor entry"), 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] = { [VIR_ERR_XEN_CALL] = {
N_("failed Xen syscall"), N_("failed Xen syscall"),
N_("failed Xen syscall %s") }, N_("failed Xen syscall %1$s") },
[VIR_ERR_OS_TYPE] = { [VIR_ERR_OS_TYPE] = {
N_("unknown OS type"), N_("unknown OS type"),
N_("unknown OS type %s") }, N_("unknown OS type %1$s") },
[VIR_ERR_NO_KERNEL] = { [VIR_ERR_NO_KERNEL] = {
N_("missing kernel information"), N_("missing kernel information"),
N_("missing kernel information: %s") }, N_("missing kernel information: %1$s") },
[VIR_ERR_NO_ROOT] = { [VIR_ERR_NO_ROOT] = {
N_("missing root device information"), N_("missing root device information"),
N_("missing root device information in %s") }, N_("missing root device information in %1$s") },
[VIR_ERR_NO_SOURCE] = { [VIR_ERR_NO_SOURCE] = {
N_("missing source information for device"), 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] = { [VIR_ERR_NO_TARGET] = {
N_("missing target information for device"), 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] = { [VIR_ERR_NO_NAME] = {
N_("missing name information"), N_("missing name information"),
N_("missing name information in %s") }, N_("missing name information in %1$s") },
[VIR_ERR_NO_OS] = { [VIR_ERR_NO_OS] = {
N_("missing operating system information"), N_("missing operating system information"),
N_("missing operating system information for %s") }, N_("missing operating system information for %1$s") },
[VIR_ERR_NO_DEVICE] = { [VIR_ERR_NO_DEVICE] = {
N_("missing devices information"), N_("missing devices information"),
N_("missing devices information for %s") }, N_("missing devices information for %1$s") },
[VIR_ERR_NO_XENSTORE] = { [VIR_ERR_NO_XENSTORE] = {
N_("could not connect to Xen Store"), 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] = { [VIR_ERR_DRIVER_FULL] = {
N_("too many drivers registered"), N_("too many drivers registered"),
N_("too many drivers registered in %s") }, N_("too many drivers registered in %1$s") },
[VIR_ERR_CALL_FAILED] = { [VIR_ERR_CALL_FAILED] = {
N_("library call failed"), N_("library call failed"),
N_("library call failed: %s") }, N_("library call failed: %1$s") },
[VIR_ERR_XML_ERROR] = { [VIR_ERR_XML_ERROR] = {
N_("XML description is invalid or not well formed"), N_("XML description is invalid or not well formed"),
N_("XML error: %s") }, N_("XML error: %1$s") },
[VIR_ERR_DOM_EXIST] = { [VIR_ERR_DOM_EXIST] = {
N_("this domain exists already"), N_("this domain exists already"),
N_("domain %s exists already") }, N_("domain %1$s exists already") },
[VIR_ERR_OPERATION_DENIED] = { [VIR_ERR_OPERATION_DENIED] = {
N_("operation forbidden for read only access"), N_("operation forbidden for read only access"),
N_("operation forbidden: %s") }, N_("operation forbidden: %1$s") },
[VIR_ERR_OPEN_FAILED] = { [VIR_ERR_OPEN_FAILED] = {
N_("failed to open configuration file"), 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] = { [VIR_ERR_READ_FAILED] = {
N_("failed to read configuration file"), 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] = { [VIR_ERR_PARSE_FAILED] = {
N_("failed to parse configuration file"), 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] = { [VIR_ERR_CONF_SYNTAX] = {
N_("configuration file syntax error"), N_("configuration file syntax error"),
N_("configuration file syntax error: %s") }, N_("configuration file syntax error: %1$s") },
[VIR_ERR_WRITE_FAILED] = { [VIR_ERR_WRITE_FAILED] = {
N_("failed to write configuration file"), 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] = { [VIR_ERR_XML_DETAIL] = {
N_("parser error"), N_("parser error"),
"%s" }, "%s" },
[VIR_ERR_INVALID_NETWORK] = { [VIR_ERR_INVALID_NETWORK] = {
N_("invalid network pointer in"), N_("invalid network pointer in"),
N_("invalid network pointer in %s") }, N_("invalid network pointer in %1$s") },
[VIR_ERR_NETWORK_EXIST] = { [VIR_ERR_NETWORK_EXIST] = {
N_("this network exists already"), N_("this network exists already"),
N_("network %s exists already") }, N_("network %1$s exists already") },
[VIR_ERR_SYSTEM_ERROR] = { [VIR_ERR_SYSTEM_ERROR] = {
N_("system call error"), N_("system call error"),
"%s" }, "%s" },
@ -1077,214 +1077,214 @@ static const virErrorMsgTuple virErrorMsgStrings[] = {
"%s" }, "%s" },
[VIR_WAR_NO_NETWORK] = { [VIR_WAR_NO_NETWORK] = {
N_("Failed to find the 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] = { [VIR_ERR_NO_DOMAIN] = {
N_("Domain not found"), N_("Domain not found"),
N_("Domain not found: %s") }, N_("Domain not found: %1$s") },
[VIR_ERR_NO_NETWORK] = { [VIR_ERR_NO_NETWORK] = {
N_("Network not found"), N_("Network not found"),
N_("Network not found: %s") }, N_("Network not found: %1$s") },
[VIR_ERR_INVALID_MAC] = { [VIR_ERR_INVALID_MAC] = {
N_("invalid MAC address"), N_("invalid MAC address"),
N_("invalid MAC address: %s") }, N_("invalid MAC address: %1$s") },
[VIR_ERR_AUTH_FAILED] = { [VIR_ERR_AUTH_FAILED] = {
N_("authentication failed"), N_("authentication failed"),
N_("authentication failed: %s") }, N_("authentication failed: %1$s") },
[VIR_ERR_INVALID_STORAGE_POOL] = { [VIR_ERR_INVALID_STORAGE_POOL] = {
N_("invalid storage pool pointer in"), 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] = { [VIR_ERR_INVALID_STORAGE_VOL] = {
N_("invalid storage volume pointer in"), 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] = { [VIR_WAR_NO_STORAGE] = {
N_("Failed to find a storage driver"), 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] = { [VIR_ERR_NO_STORAGE_POOL] = {
N_("Storage pool not found"), N_("Storage pool not found"),
N_("Storage pool not found: %s") }, N_("Storage pool not found: %1$s") },
[VIR_ERR_NO_STORAGE_VOL] = { [VIR_ERR_NO_STORAGE_VOL] = {
N_("Storage volume not found"), N_("Storage volume not found"),
N_("Storage volume not found: %s") }, N_("Storage volume not found: %1$s") },
[VIR_WAR_NO_NODE] = { [VIR_WAR_NO_NODE] = {
N_("Failed to find a node driver"), 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] = { [VIR_ERR_INVALID_NODE_DEVICE] = {
N_("invalid node device pointer"), 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] = { [VIR_ERR_NO_NODE_DEVICE] = {
N_("Node device not found"), N_("Node device not found"),
N_("Node device not found: %s") }, N_("Node device not found: %1$s") },
[VIR_ERR_NO_SECURITY_MODEL] = { [VIR_ERR_NO_SECURITY_MODEL] = {
N_("Security model not found"), N_("Security model not found"),
N_("Security model not found: %s") }, N_("Security model not found: %1$s") },
[VIR_ERR_OPERATION_INVALID] = { [VIR_ERR_OPERATION_INVALID] = {
N_("Requested operation is not valid"), 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] = { [VIR_WAR_NO_INTERFACE] = {
N_("Failed to find the 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] = { [VIR_ERR_NO_INTERFACE] = {
N_("Interface not found"), N_("Interface not found"),
N_("Interface not found: %s") }, N_("Interface not found: %1$s") },
[VIR_ERR_INVALID_INTERFACE] = { [VIR_ERR_INVALID_INTERFACE] = {
N_("invalid interface pointer in"), N_("invalid interface pointer in"),
N_("invalid interface pointer in %s") }, N_("invalid interface pointer in %1$s") },
[VIR_ERR_MULTIPLE_INTERFACES] = { [VIR_ERR_MULTIPLE_INTERFACES] = {
N_("multiple matching interfaces found"), N_("multiple matching interfaces found"),
N_("multiple matching interfaces found: %s") }, N_("multiple matching interfaces found: %1$s") },
[VIR_WAR_NO_NWFILTER] = { [VIR_WAR_NO_NWFILTER] = {
N_("Failed to start the nwfilter driver"), 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] = { [VIR_ERR_INVALID_NWFILTER] = {
N_("Invalid network filter"), N_("Invalid network filter"),
N_("Invalid network filter: %s") }, N_("Invalid network filter: %1$s") },
[VIR_ERR_NO_NWFILTER] = { [VIR_ERR_NO_NWFILTER] = {
N_("Network filter not found"), N_("Network filter not found"),
N_("Network filter not found: %s") }, N_("Network filter not found: %1$s") },
[VIR_ERR_BUILD_FIREWALL] = { [VIR_ERR_BUILD_FIREWALL] = {
N_("Error while building firewall"), N_("Error while building firewall"),
N_("Error while building firewall: %s") }, N_("Error while building firewall: %1$s") },
[VIR_WAR_NO_SECRET] = { [VIR_WAR_NO_SECRET] = {
N_("Failed to find a secret storage driver"), 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] = { [VIR_ERR_INVALID_SECRET] = {
N_("Invalid secret"), N_("Invalid secret"),
N_("Invalid secret: %s") }, N_("Invalid secret: %1$s") },
[VIR_ERR_NO_SECRET] = { [VIR_ERR_NO_SECRET] = {
N_("Secret not found"), N_("Secret not found"),
N_("Secret not found: %s") }, N_("Secret not found: %1$s") },
[VIR_ERR_CONFIG_UNSUPPORTED] = { [VIR_ERR_CONFIG_UNSUPPORTED] = {
N_("unsupported configuration"), N_("unsupported configuration"),
N_("unsupported configuration: %s") }, N_("unsupported configuration: %1$s") },
[VIR_ERR_OPERATION_TIMEOUT] = { [VIR_ERR_OPERATION_TIMEOUT] = {
N_("Timed out during operation"), N_("Timed out during operation"),
N_("Timed out during operation: %s") }, N_("Timed out during operation: %1$s") },
[VIR_ERR_MIGRATE_PERSIST_FAILED] = { [VIR_ERR_MIGRATE_PERSIST_FAILED] = {
N_("Failed to make domain persistent after migration"), 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] = { [VIR_ERR_HOOK_SCRIPT_FAILED] = {
N_("Hook script execution failed"), N_("Hook script execution failed"),
N_("Hook script execution failed: %s") }, N_("Hook script execution failed: %1$s") },
[VIR_ERR_INVALID_DOMAIN_SNAPSHOT] = { [VIR_ERR_INVALID_DOMAIN_SNAPSHOT] = {
N_("Invalid domain snapshot"), N_("Invalid domain snapshot"),
N_("Invalid domain snapshot: %s") }, N_("Invalid domain snapshot: %1$s") },
[VIR_ERR_NO_DOMAIN_SNAPSHOT] = { [VIR_ERR_NO_DOMAIN_SNAPSHOT] = {
N_("Domain snapshot not found"), N_("Domain snapshot not found"),
N_("Domain snapshot not found: %s") }, N_("Domain snapshot not found: %1$s") },
[VIR_ERR_INVALID_STREAM] = { [VIR_ERR_INVALID_STREAM] = {
N_("invalid stream pointer"), N_("invalid stream pointer"),
N_("invalid stream pointer in %s") }, N_("invalid stream pointer in %1$s") },
[VIR_ERR_ARGUMENT_UNSUPPORTED] = { [VIR_ERR_ARGUMENT_UNSUPPORTED] = {
N_("argument unsupported"), N_("argument unsupported"),
N_("argument unsupported: %s") }, N_("argument unsupported: %1$s") },
[VIR_ERR_STORAGE_PROBE_FAILED] = { [VIR_ERR_STORAGE_PROBE_FAILED] = {
N_("Storage pool 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] = { [VIR_ERR_STORAGE_POOL_BUILT] = {
N_("Storage pool already built"), N_("Storage pool already built"),
N_("Storage pool already built: %s") }, N_("Storage pool already built: %1$s") },
[VIR_ERR_SNAPSHOT_REVERT_RISKY] = { [VIR_ERR_SNAPSHOT_REVERT_RISKY] = {
N_("revert requires force"), N_("revert requires force"),
N_("revert requires force: %s") }, N_("revert requires force: %1$s") },
[VIR_ERR_OPERATION_ABORTED] = { [VIR_ERR_OPERATION_ABORTED] = {
N_("operation aborted"), N_("operation aborted"),
N_("operation aborted: %s") }, N_("operation aborted: %1$s") },
[VIR_ERR_AUTH_CANCELLED] = { [VIR_ERR_AUTH_CANCELLED] = {
N_("authentication cancelled"), N_("authentication cancelled"),
N_("authentication cancelled: %s") }, N_("authentication cancelled: %1$s") },
[VIR_ERR_NO_DOMAIN_METADATA] = { [VIR_ERR_NO_DOMAIN_METADATA] = {
N_("metadata not found"), N_("metadata not found"),
N_("metadata not found: %s") }, N_("metadata not found: %1$s") },
[VIR_ERR_MIGRATE_UNSAFE] = { [VIR_ERR_MIGRATE_UNSAFE] = {
N_("Unsafe migration"), N_("Unsafe migration"),
N_("Unsafe migration: %s") }, N_("Unsafe migration: %1$s") },
[VIR_ERR_OVERFLOW] = { [VIR_ERR_OVERFLOW] = {
N_("numerical overflow"), N_("numerical overflow"),
N_("numerical overflow: %s") }, N_("numerical overflow: %1$s") },
[VIR_ERR_BLOCK_COPY_ACTIVE] = { [VIR_ERR_BLOCK_COPY_ACTIVE] = {
N_("block copy still active"), N_("block copy still active"),
N_("block copy still active: %s") }, N_("block copy still active: %1$s") },
[VIR_ERR_OPERATION_UNSUPPORTED] = { [VIR_ERR_OPERATION_UNSUPPORTED] = {
N_("Operation not supported"), N_("Operation not supported"),
N_("Operation not supported: %s") }, N_("Operation not supported: %1$s") },
[VIR_ERR_SSH] = { [VIR_ERR_SSH] = {
N_("SSH transport error"), N_("SSH transport error"),
N_("SSH transport error: %s") }, N_("SSH transport error: %1$s") },
[VIR_ERR_AGENT_UNRESPONSIVE] = { [VIR_ERR_AGENT_UNRESPONSIVE] = {
N_("Guest agent is not responding"), 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] = { [VIR_ERR_RESOURCE_BUSY] = {
N_("resource busy"), N_("resource busy"),
N_("resource busy: %s") }, N_("resource busy: %1$s") },
[VIR_ERR_ACCESS_DENIED] = { [VIR_ERR_ACCESS_DENIED] = {
N_("access denied"), N_("access denied"),
N_("access denied: %s") }, N_("access denied: %1$s") },
[VIR_ERR_DBUS_SERVICE] = { [VIR_ERR_DBUS_SERVICE] = {
N_("error from service"), N_("error from service"),
N_("error from service: %s") }, N_("error from service: %1$s") },
[VIR_ERR_STORAGE_VOL_EXIST] = { [VIR_ERR_STORAGE_VOL_EXIST] = {
N_("this storage volume exists already"), N_("this storage volume exists already"),
N_("storage volume %s exists already") }, N_("storage volume %1$s exists already") },
[VIR_ERR_CPU_INCOMPATIBLE] = { [VIR_ERR_CPU_INCOMPATIBLE] = {
N_("the CPU is incompatible with host CPU"), 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] = { [VIR_ERR_XML_INVALID_SCHEMA] = {
N_("XML document failed to validate against 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] = { [VIR_ERR_MIGRATE_FINISH_OK] = {
N_("migration successfully aborted"), N_("migration successfully aborted"),
N_("migration successfully aborted: %s") }, N_("migration successfully aborted: %1$s") },
[VIR_ERR_AUTH_UNAVAILABLE] = { [VIR_ERR_AUTH_UNAVAILABLE] = {
N_("authentication unavailable"), N_("authentication unavailable"),
N_("authentication unavailable: %s") }, N_("authentication unavailable: %1$s") },
[VIR_ERR_NO_SERVER] = { [VIR_ERR_NO_SERVER] = {
N_("Server not found"), N_("Server not found"),
N_("Server not found: %s") }, N_("Server not found: %1$s") },
[VIR_ERR_NO_CLIENT] = { [VIR_ERR_NO_CLIENT] = {
N_("Client not found"), N_("Client not found"),
N_("Client not found: %s") }, N_("Client not found: %1$s") },
[VIR_ERR_AGENT_UNSYNCED] = { [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"),
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] = { [VIR_ERR_LIBSSH] = {
N_("libssh transport error"), N_("libssh transport error"),
N_("libssh transport error: %s") }, N_("libssh transport error: %1$s") },
[VIR_ERR_DEVICE_MISSING] = { [VIR_ERR_DEVICE_MISSING] = {
N_("device not found"), N_("device not found"),
N_("device not found: %s") }, N_("device not found: %1$s") },
[VIR_ERR_INVALID_NWFILTER_BINDING] = { [VIR_ERR_INVALID_NWFILTER_BINDING] = {
N_("Invalid network filter binding"), N_("Invalid network filter binding"),
N_("Invalid network filter binding: %s") }, N_("Invalid network filter binding: %1$s") },
[VIR_ERR_NO_NWFILTER_BINDING] = { [VIR_ERR_NO_NWFILTER_BINDING] = {
N_("Network filter binding not found"), 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] = { [VIR_ERR_INVALID_DOMAIN_CHECKPOINT] = {
N_("Invalid domain checkpoint"), N_("Invalid domain checkpoint"),
N_("Invalid domain checkpoint: %s") }, N_("Invalid domain checkpoint: %1$s") },
[VIR_ERR_NO_DOMAIN_CHECKPOINT] = { [VIR_ERR_NO_DOMAIN_CHECKPOINT] = {
N_("Domain checkpoint not found"), N_("Domain checkpoint not found"),
N_("Domain checkpoint not found: %s") }, N_("Domain checkpoint not found: %1$s") },
[VIR_ERR_NO_DOMAIN_BACKUP] = { [VIR_ERR_NO_DOMAIN_BACKUP] = {
N_("Domain backup job id not found"), 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] = { [VIR_ERR_INVALID_NETWORK_PORT] = {
N_("Invalid network port pointer"), N_("Invalid network port pointer"),
N_("Invalid network port pointer: %s") }, N_("Invalid network port pointer: %1$s") },
[VIR_ERR_NETWORK_PORT_EXIST] = { [VIR_ERR_NETWORK_PORT_EXIST] = {
N_("this network port exists already"), N_("this network port exists already"),
N_("network port %s exists already") }, N_("network port %1$s exists already") },
[VIR_ERR_NO_NETWORK_PORT] = { [VIR_ERR_NO_NETWORK_PORT] = {
N_("network port not found"), N_("network port not found"),
N_("network port not found: %s") }, N_("network port not found: %1$s") },
[VIR_ERR_NO_HOSTNAME] = { [VIR_ERR_NO_HOSTNAME] = {
N_("no hostname found"), N_("no hostname found"),
N_("no hostname found: %s") }, N_("no hostname found: %1$s") },
[VIR_ERR_CHECKPOINT_INCONSISTENT] = { [VIR_ERR_CHECKPOINT_INCONSISTENT] = {
N_("checkpoint inconsistent"), N_("checkpoint inconsistent"),
N_("checkpoint inconsistent: %s") }, N_("checkpoint inconsistent: %1$s") },
[VIR_ERR_MULTIPLE_DOMAINS] = { [VIR_ERR_MULTIPLE_DOMAINS] = {
N_("multiple matching domains found"), 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); G_STATIC_ASSERT(G_N_ELEMENTS(virErrorMsgStrings) == VIR_ERR_NUMBER_LAST);

View File

@ -76,7 +76,7 @@ void virReportSystemErrorFull(int domcode,
#argname, \ #argname, \
NULL, \ NULL, \
0, 0, \ 0, 0, \
_("%s in %s must be NULL"), \ _("%1$s in %2$s must be NULL"), \
#argname, __FUNCTION__) #argname, __FUNCTION__)
#define virReportInvalidNonNullArg(argname) \ #define virReportInvalidNonNullArg(argname) \
virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \
@ -87,7 +87,7 @@ void virReportSystemErrorFull(int domcode,
#argname, \ #argname, \
NULL, \ NULL, \
0, 0, \ 0, 0, \
_("%s in %s must not be NULL"), \ _("%1$s in %2$s must not be NULL"), \
#argname, __FUNCTION__) #argname, __FUNCTION__)
#define virReportInvalidEmptyStringArg(argname) \ #define virReportInvalidEmptyStringArg(argname) \
virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \
@ -98,7 +98,7 @@ void virReportSystemErrorFull(int domcode,
#argname, \ #argname, \
NULL, \ NULL, \
0, 0, \ 0, 0, \
_("string %s in %s must not be empty"), \ _("string %1$s in %2$s must not be empty"), \
#argname, __FUNCTION__) #argname, __FUNCTION__)
#define virReportInvalidPositiveArg(argname) \ #define virReportInvalidPositiveArg(argname) \
virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \
@ -109,7 +109,7 @@ void virReportSystemErrorFull(int domcode,
#argname, \ #argname, \
NULL, \ NULL, \
0, 0, \ 0, 0, \
_("%s in %s must be greater than zero"), \ _("%1$s in %2$s must be greater than zero"), \
#argname, __FUNCTION__) #argname, __FUNCTION__)
#define virReportInvalidNonZeroArg(argname) \ #define virReportInvalidNonZeroArg(argname) \
virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \
@ -120,7 +120,7 @@ void virReportSystemErrorFull(int domcode,
#argname, \ #argname, \
NULL, \ NULL, \
0, 0, \ 0, 0, \
_("%s in %s must not be zero"), \ _("%1$s in %2$s must not be zero"), \
#argname, __FUNCTION__) #argname, __FUNCTION__)
#define virReportInvalidZeroArg(argname) \ #define virReportInvalidZeroArg(argname) \
virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \
@ -131,7 +131,7 @@ void virReportSystemErrorFull(int domcode,
#argname, \ #argname, \
NULL, \ NULL, \
0, 0, \ 0, 0, \
_("%s in %s must be zero"), \ _("%1$s in %2$s must be zero"), \
#argname, __FUNCTION__) #argname, __FUNCTION__)
#define virReportInvalidNonNegativeArg(argname) \ #define virReportInvalidNonNegativeArg(argname) \
virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \
@ -142,7 +142,7 @@ void virReportSystemErrorFull(int domcode,
#argname, \ #argname, \
NULL, \ NULL, \
0, 0, \ 0, 0, \
_("%s in %s must be zero or greater"), \ _("%1$s in %2$s must be zero or greater"), \
#argname, __FUNCTION__) #argname, __FUNCTION__)
#define virReportInvalidArg(argname, fmt, ...) \ #define virReportInvalidArg(argname, fmt, ...) \
virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \

View File

@ -162,7 +162,7 @@ virEventThreadStart(virEventThread *evt, const char *name)
if (!evt->thread) { if (!evt->thread) {
virEventThreadDataFree(data); virEventThreadDataFree(data);
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to start event thread: %s"), _("Unable to start event thread: %1$s"),
gerr->message); gerr->message);
return -1; return -1;
} }

View File

@ -29,8 +29,11 @@ virErrorTestMsgFormatInfoOne(const char *msg)
char *next; char *next;
int ret = 0; int ret = 0;
if (STREQ(msg, "%s"))
return 0;
for (next = (char *)msg; (next = strchr(next, '%')); next++) { 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); VIR_TEST_VERBOSE("\nerror message '%s' contains disallowed printf modifiers", msg);
ret = -1; ret = -1;
} else { } else {
@ -44,7 +47,7 @@ virErrorTestMsgFormatInfoOne(const char *msg)
} }
if (!found) { 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; ret = -1;
} }