mirror of https://gitee.com/openkylin/libvirt.git
locking: Update format strings in translated messages
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
8875aee4eb
commit
3d61757c3b
|
@ -187,7 +187,7 @@ virLockDaemonNewServerPostExecRestart(virNetDaemon *dmn G_GNUC_UNUSED,
|
|||
dmn);
|
||||
} else {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unexpected server name '%s' during restart"),
|
||||
_("Unexpected server name '%1$s' during restart"),
|
||||
name);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -461,14 +461,14 @@ virLockDaemonClientNew(virNetServerClient *client,
|
|||
|
||||
if (!privileged) {
|
||||
if (geteuid() != clientuid) {
|
||||
virReportRestrictedError(_("Disallowing client %llu with uid %llu"),
|
||||
virReportRestrictedError(_("Disallowing client %1$llu with uid %2$llu"),
|
||||
(unsigned long long)priv->clientPid,
|
||||
(unsigned long long)clientuid);
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
if (clientuid != 0) {
|
||||
virReportRestrictedError(_("Disallowing client %llu with uid %llu"),
|
||||
virReportRestrictedError(_("Disallowing client %1$llu with uid %2$llu"),
|
||||
(unsigned long long)priv->clientPid,
|
||||
(unsigned long long)clientuid);
|
||||
goto error;
|
||||
|
@ -716,7 +716,7 @@ virLockDaemonPreExecRestart(const char *state_file,
|
|||
|
||||
if (virFileWriteStr(state_file, state, 0700) < 0) {
|
||||
virReportSystemError(errno,
|
||||
_("Unable to save state file %s"), state_file);
|
||||
_("Unable to save state file %1$s"), state_file);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -738,7 +738,7 @@ virLockDaemonUsage(const char *argv0, bool privileged)
|
|||
fprintf(stderr,
|
||||
_("\n"
|
||||
"Usage:\n"
|
||||
" %s [options]\n"
|
||||
" %1$s [options]\n"
|
||||
"\n"
|
||||
"Options:\n"
|
||||
" -h | --help Display program help:\n"
|
||||
|
@ -757,13 +757,13 @@ virLockDaemonUsage(const char *argv0, bool privileged)
|
|||
" Default paths:\n"
|
||||
"\n"
|
||||
" Configuration file (unless overridden by -f):\n"
|
||||
" %s/libvirt/virtlockd.conf\n"
|
||||
" %1$s/libvirt/virtlockd.conf\n"
|
||||
"\n"
|
||||
" Sockets:\n"
|
||||
" %s/libvirt/virtlockd-sock\n"
|
||||
" %2$s/libvirt/virtlockd-sock\n"
|
||||
"\n"
|
||||
" PID file (unless overridden by -p):\n"
|
||||
" %s/virtlockd.pid\n"
|
||||
" %3$s/virtlockd.pid\n"
|
||||
"\n"),
|
||||
SYSCONFDIR,
|
||||
RUNSTATEDIR,
|
||||
|
@ -823,7 +823,7 @@ int main(int argc, char **argv) {
|
|||
|
||||
if (virGettextInitialize() < 0 ||
|
||||
virErrorInitialize() < 0) {
|
||||
fprintf(stderr, _("%s: initialization failed\n"), argv[0]);
|
||||
fprintf(stderr, _("%1$s: initialization failed\n"), argv[0]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
@ -903,7 +903,7 @@ int main(int argc, char **argv) {
|
|||
/* Read the config file if it exists */
|
||||
if (remote_config_file &&
|
||||
virLockDaemonConfigLoadFile(config, remote_config_file, implicit_conf) < 0) {
|
||||
VIR_ERROR(_("Can't load config file: %s: %s"),
|
||||
VIR_ERROR(_("Can't load config file: %1$s: %2$s"),
|
||||
virGetLastErrorMessage(), remote_config_file);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
@ -963,7 +963,7 @@ int main(int argc, char **argv) {
|
|||
old_umask = umask(077);
|
||||
VIR_DEBUG("Ensuring run dir '%s' exists", run_dir);
|
||||
if (g_mkdir_with_parents(run_dir, 0777) < 0) {
|
||||
VIR_ERROR(_("unable to create rundir %s: %s"), run_dir,
|
||||
VIR_ERROR(_("unable to create rundir %1$s: %2$s"), run_dir,
|
||||
g_strerror(errno));
|
||||
ret = VIR_DAEMON_ERR_RUNDIR;
|
||||
umask(old_umask);
|
||||
|
@ -987,13 +987,13 @@ int main(int argc, char **argv) {
|
|||
|
||||
if (godaemon) {
|
||||
if (chdir("/") < 0) {
|
||||
VIR_ERROR(_("cannot change to root directory: %s"),
|
||||
VIR_ERROR(_("cannot change to root directory: %1$s"),
|
||||
g_strerror(errno));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if ((statuswrite = virDaemonForkIntoBackground(argv[0])) < 0) {
|
||||
VIR_ERROR(_("Failed to fork as daemon: %s"),
|
||||
VIR_ERROR(_("Failed to fork as daemon: %1$s"),
|
||||
g_strerror(errno));
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ virLockSpaceProtocolDispatchAcquireResource(virNetServer *server G_GNUC_UNUSED,
|
|||
|
||||
if (!(lockspace = virLockDaemonFindLockSpace(lockDaemon, args->path))) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Lockspace for path %s does not exist"),
|
||||
_("Lockspace for path %1$s does not exist"),
|
||||
args->path);
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ virLockSpaceProtocolDispatchCreateResource(virNetServer *server G_GNUC_UNUSED,
|
|||
|
||||
if (!(lockspace = virLockDaemonFindLockSpace(lockDaemon, args->path))) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Lockspace for path %s does not exist"),
|
||||
_("Lockspace for path %1$s does not exist"),
|
||||
args->path);
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ virLockSpaceProtocolDispatchDeleteResource(virNetServer *server G_GNUC_UNUSED,
|
|||
|
||||
if (!(lockspace = virLockDaemonFindLockSpace(lockDaemon, args->path))) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Lockspace for path %s does not exist"),
|
||||
_("Lockspace for path %1$s does not exist"),
|
||||
args->path);
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -229,7 +229,7 @@ virLockSpaceProtocolDispatchNew(virNetServer *server G_GNUC_UNUSED,
|
|||
|
||||
if (virLockDaemonFindLockSpace(lockDaemon, args->path) != NULL) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Lockspace for path %s already exists"),
|
||||
_("Lockspace for path %1$s already exists"),
|
||||
args->path);
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -324,7 +324,7 @@ virLockSpaceProtocolDispatchReleaseResource(virNetServer *server G_GNUC_UNUSED,
|
|||
|
||||
if (!(lockspace = virLockDaemonFindLockSpace(lockDaemon, args->path))) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Lockspace for path %s does not exist"),
|
||||
_("Lockspace for path %1$s does not exist"),
|
||||
args->path);
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ static int virLockManagerLockDaemonLoadConfig(const char *configFile)
|
|||
if (access(configFile, R_OK) == -1) {
|
||||
if (errno != ENOENT) {
|
||||
virReportSystemError(errno,
|
||||
_("Unable to access config file %s"),
|
||||
_("Unable to access config file %1$s"),
|
||||
configFile);
|
||||
return -1;
|
||||
}
|
||||
|
@ -400,7 +400,7 @@ static int virLockManagerLockDaemonNew(virLockManager *lock,
|
|||
/* ignored */
|
||||
} else {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unexpected parameter %s for object"),
|
||||
_("Unexpected parameter %1$s for object"),
|
||||
params[i].key);
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -426,7 +426,7 @@ static int virLockManagerLockDaemonNew(virLockManager *lock,
|
|||
|
||||
default:
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unknown lock manager object type %d"),
|
||||
_("Unknown lock manager object type %1$d"),
|
||||
type);
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -498,7 +498,7 @@ static int
|
|||
virLockManagerGetLVMKey(const char *path,
|
||||
char **key G_GNUC_UNUSED)
|
||||
{
|
||||
virReportSystemError(ENOSYS, _("Unable to get LVM key for %s"), path);
|
||||
virReportSystemError(ENOSYS, _("Unable to get LVM key for %1$s"), path);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
@ -601,7 +601,7 @@ static int virLockManagerLockDaemonAddResource(virLockManager *lock,
|
|||
path = params[i].value.str;
|
||||
} else {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unexpected parameter %s for lease resource"),
|
||||
_("Unexpected parameter %1$s for lease resource"),
|
||||
params[i].key);
|
||||
return -1;
|
||||
}
|
||||
|
@ -617,7 +617,7 @@ static int virLockManagerLockDaemonAddResource(virLockManager *lock,
|
|||
} break;
|
||||
default:
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unknown lock manager object type %d"),
|
||||
_("Unknown lock manager object type %1$d"),
|
||||
type);
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ virLockManagerSanlockError(int err,
|
|||
#if WITH_SANLOCK_STRERROR
|
||||
*message = g_strdup(sanlock_strerror(err));
|
||||
#else
|
||||
*message = g_strdup_printf(_("sanlock error %d"), err);
|
||||
*message = g_strdup_printf(_("sanlock error %1$d"), err);
|
||||
#endif
|
||||
return true;
|
||||
} else {
|
||||
|
@ -124,7 +124,7 @@ virLockManagerSanlockLoadConfig(virLockManagerSanlockDriver *driver,
|
|||
if (access(configFile, R_OK) == -1) {
|
||||
if (errno != ENOENT) {
|
||||
virReportSystemError(errno,
|
||||
_("Unable to access config file %s"),
|
||||
_("Unable to access config file %1$s"),
|
||||
configFile);
|
||||
return -1;
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ virLockManagerSanlockSetupLockspace(virLockManagerSanlockDriver *driver)
|
|||
if (virStrcpyStatic(ls.name,
|
||||
VIR_LOCK_MANAGER_SANLOCK_AUTO_DISK_LOCKSPACE) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Lockspace path '%s' exceeded %d characters"),
|
||||
_("Lockspace path '%1$s' exceeded %2$d characters"),
|
||||
VIR_LOCK_MANAGER_SANLOCK_AUTO_DISK_LOCKSPACE,
|
||||
SANLK_PATH_LEN);
|
||||
goto error;
|
||||
|
@ -205,7 +205,7 @@ virLockManagerSanlockSetupLockspace(virLockManagerSanlockDriver *driver)
|
|||
ls.flags = 0;
|
||||
if (virStrcpy(ls.host_id_disk.path, path, SANLK_PATH_LEN) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Lockspace path '%s' exceeded %d characters"),
|
||||
_("Lockspace path '%1$s' exceeded %2$d characters"),
|
||||
path, SANLK_PATH_LEN);
|
||||
goto error;
|
||||
}
|
||||
|
@ -221,8 +221,7 @@ virLockManagerSanlockSetupLockspace(virLockManagerSanlockDriver *driver)
|
|||
dir = g_path_get_dirname(path);
|
||||
if (stat(dir, &st) < 0 || !S_ISDIR(st.st_mode)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unable to create lockspace %s: parent directory"
|
||||
" does not exist or is not a directory"),
|
||||
_("Unable to create lockspace %1$s: parent directory does not exist or is not a directory"),
|
||||
path);
|
||||
goto error;
|
||||
}
|
||||
|
@ -233,7 +232,7 @@ virLockManagerSanlockSetupLockspace(virLockManagerSanlockDriver *driver)
|
|||
if ((fd = open(path, O_WRONLY|O_CREAT|O_EXCL, perms)) < 0) {
|
||||
if (errno != EEXIST) {
|
||||
virReportSystemError(errno,
|
||||
_("Unable to create lockspace %s"),
|
||||
_("Unable to create lockspace %1$s"),
|
||||
path);
|
||||
goto error;
|
||||
}
|
||||
|
@ -243,7 +242,7 @@ virLockManagerSanlockSetupLockspace(virLockManagerSanlockDriver *driver)
|
|||
if ((driver->user != (uid_t) -1 || driver->group != (gid_t) -1) &&
|
||||
(fchown(fd, driver->user, driver->group) < 0)) {
|
||||
virReportSystemError(errno,
|
||||
_("cannot chown '%s' to (%u, %u)"),
|
||||
_("cannot chown '%1$s' to (%2$u, %3$u)"),
|
||||
path,
|
||||
(unsigned int) driver->user,
|
||||
(unsigned int) driver->group);
|
||||
|
@ -254,12 +253,12 @@ virLockManagerSanlockSetupLockspace(virLockManagerSanlockDriver *driver)
|
|||
char *err = NULL;
|
||||
if (virLockManagerSanlockError(rv, &err)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unable to query sector size %s: %s"),
|
||||
_("Unable to query sector size %1$s: %2$s"),
|
||||
path, NULLSTR(err));
|
||||
VIR_FREE(err);
|
||||
} else {
|
||||
virReportSystemError(-rv,
|
||||
_("Unable to query sector size %s"),
|
||||
_("Unable to query sector size %1$s"),
|
||||
path);
|
||||
}
|
||||
goto error_unlink;
|
||||
|
@ -270,14 +269,14 @@ virLockManagerSanlockSetupLockspace(virLockManagerSanlockDriver *driver)
|
|||
*/
|
||||
if (safezero(fd, 0, rv) < 0) {
|
||||
virReportSystemError(errno,
|
||||
_("Unable to allocate lockspace %s"),
|
||||
_("Unable to allocate lockspace %1$s"),
|
||||
path);
|
||||
goto error_unlink;
|
||||
}
|
||||
|
||||
if (VIR_CLOSE(fd) < 0) {
|
||||
virReportSystemError(errno,
|
||||
_("Unable to save lockspace %s"),
|
||||
_("Unable to save lockspace %1$s"),
|
||||
path);
|
||||
goto error_unlink;
|
||||
}
|
||||
|
@ -286,12 +285,12 @@ virLockManagerSanlockSetupLockspace(virLockManagerSanlockDriver *driver)
|
|||
char *err = NULL;
|
||||
if (virLockManagerSanlockError(rv, &err)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unable to initialize lockspace %s: %s"),
|
||||
_("Unable to initialize lockspace %1$s: %2$s"),
|
||||
path, NULLSTR(err));
|
||||
VIR_FREE(err);
|
||||
} else {
|
||||
virReportSystemError(-rv,
|
||||
_("Unable to initialize lockspace %s"),
|
||||
_("Unable to initialize lockspace %1$s"),
|
||||
path);
|
||||
}
|
||||
goto error_unlink;
|
||||
|
@ -304,7 +303,7 @@ virLockManagerSanlockSetupLockspace(virLockManagerSanlockDriver *driver)
|
|||
(driver->group != (gid_t) -1 && driver->group != st.st_gid)) &&
|
||||
(chown(path, driver->user, driver->group) < 0)) {
|
||||
virReportSystemError(errno,
|
||||
_("cannot chown '%s' to (%u, %u)"),
|
||||
_("cannot chown '%1$s' to (%2$u, %3$u)"),
|
||||
path,
|
||||
(unsigned int) driver->user,
|
||||
(unsigned int) driver->group);
|
||||
|
@ -314,7 +313,7 @@ virLockManagerSanlockSetupLockspace(virLockManagerSanlockDriver *driver)
|
|||
if ((driver->group != (gid_t) -1 && (st.st_mode & 0060) != 0060) &&
|
||||
chmod(path, 0660) < 0) {
|
||||
virReportSystemError(errno,
|
||||
_("cannot chmod '%s' to 0660"),
|
||||
_("cannot chmod '%1$s' to 0660"),
|
||||
path);
|
||||
goto error;
|
||||
}
|
||||
|
@ -344,12 +343,12 @@ virLockManagerSanlockSetupLockspace(virLockManagerSanlockDriver *driver)
|
|||
char *err = NULL;
|
||||
if (virLockManagerSanlockError(rv, &err)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unable to add lockspace %s: %s"),
|
||||
_("Unable to add lockspace %1$s: %2$s"),
|
||||
path, NULLSTR(err));
|
||||
VIR_FREE(err);
|
||||
} else {
|
||||
virReportSystemError(-rv,
|
||||
_("Unable to add lockspace %s"),
|
||||
_("Unable to add lockspace %1$s"),
|
||||
path);
|
||||
}
|
||||
goto error;
|
||||
|
@ -454,7 +453,7 @@ static int virLockManagerSanlockNew(virLockManager *lock,
|
|||
|
||||
if (type != VIR_LOCK_MANAGER_OBJECT_TYPE_DOMAIN) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unsupported object type %d"), type);
|
||||
_("Unsupported object type %1$d"), type);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -528,7 +527,7 @@ static int virLockManagerSanlockAddLease(virLockManager *lock,
|
|||
res->num_disks = 1;
|
||||
if (virStrcpy(res->name, name, SANLK_NAME_LEN) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Resource name '%s' exceeds %d characters"),
|
||||
_("Resource name '%1$s' exceeds %2$d characters"),
|
||||
name, SANLK_NAME_LEN);
|
||||
return -1;
|
||||
}
|
||||
|
@ -537,7 +536,7 @@ static int virLockManagerSanlockAddLease(virLockManager *lock,
|
|||
if (STREQ(params[i].key, "path")) {
|
||||
if (virStrcpy(res->disks[0].path, params[i].value.str, SANLK_PATH_LEN) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Lease path '%s' exceeds %d characters"),
|
||||
_("Lease path '%1$s' exceeds %2$d characters"),
|
||||
params[i].value.str, SANLK_PATH_LEN);
|
||||
return -1;
|
||||
}
|
||||
|
@ -546,7 +545,7 @@ static int virLockManagerSanlockAddLease(virLockManager *lock,
|
|||
} else if (STREQ(params[i].key, "lockspace")) {
|
||||
if (virStrcpy(res->lockspace_name, params[i].value.str, SANLK_NAME_LEN) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Resource lockspace '%s' exceeds %d characters"),
|
||||
_("Resource lockspace '%1$s' exceeds %2$d characters"),
|
||||
params[i].value.str, SANLK_NAME_LEN);
|
||||
return -1;
|
||||
}
|
||||
|
@ -589,7 +588,7 @@ virLockManagerSanlockAddDisk(virLockManagerSanlockDriver *driver,
|
|||
return -1;
|
||||
if (virStrcpy(res->name, hash, SANLK_NAME_LEN) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("MD5 hash '%s' unexpectedly larger than %d characters"),
|
||||
_("MD5 hash '%1$s' unexpectedly larger than %2$d characters"),
|
||||
hash, (SANLK_NAME_LEN - 1));
|
||||
return -1;
|
||||
}
|
||||
|
@ -597,7 +596,7 @@ virLockManagerSanlockAddDisk(virLockManagerSanlockDriver *driver,
|
|||
path = g_strdup_printf("%s/%s", driver->autoDiskLeasePath, res->name);
|
||||
if (virStrcpy(res->disks[0].path, path, SANLK_PATH_LEN) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Lease path '%s' exceeds %d characters"),
|
||||
_("Lease path '%1$s' exceeds %2$d characters"),
|
||||
path, SANLK_PATH_LEN);
|
||||
return -1;
|
||||
}
|
||||
|
@ -606,7 +605,7 @@ virLockManagerSanlockAddDisk(virLockManagerSanlockDriver *driver,
|
|||
VIR_LOCK_MANAGER_SANLOCK_AUTO_DISK_LOCKSPACE,
|
||||
SANLK_NAME_LEN) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Resource lockspace '%s' exceeds %d characters"),
|
||||
_("Resource lockspace '%1$s' exceeds %2$d characters"),
|
||||
VIR_LOCK_MANAGER_SANLOCK_AUTO_DISK_LOCKSPACE, SANLK_NAME_LEN);
|
||||
return -1;
|
||||
}
|
||||
|
@ -631,7 +630,7 @@ virLockManagerSanlockCreateLease(virLockManagerSanlockDriver *driver,
|
|||
if ((fd = open(res->disks[0].path, O_WRONLY|O_CREAT|O_EXCL, 0600)) < 0) {
|
||||
if (errno != EEXIST) {
|
||||
virReportSystemError(errno,
|
||||
_("Unable to create lockspace %s"),
|
||||
_("Unable to create lockspace %1$s"),
|
||||
res->disks[0].path);
|
||||
return -1;
|
||||
}
|
||||
|
@ -641,7 +640,7 @@ virLockManagerSanlockCreateLease(virLockManagerSanlockDriver *driver,
|
|||
if ((driver->user != (uid_t) -1 || driver->group != (gid_t) -1) &&
|
||||
(fchown(fd, driver->user, driver->group) < 0)) {
|
||||
virReportSystemError(errno,
|
||||
_("cannot chown '%s' to (%u, %u)"),
|
||||
_("cannot chown '%1$s' to (%2$u, %3$u)"),
|
||||
res->disks[0].path,
|
||||
(unsigned int) driver->user,
|
||||
(unsigned int) driver->group);
|
||||
|
@ -652,12 +651,12 @@ virLockManagerSanlockCreateLease(virLockManagerSanlockDriver *driver,
|
|||
char *err = NULL;
|
||||
if (virLockManagerSanlockError(rv, &err)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unable to query sector size %s: %s"),
|
||||
_("Unable to query sector size %1$s: %2$s"),
|
||||
res->disks[0].path, NULLSTR(err));
|
||||
VIR_FREE(err);
|
||||
} else {
|
||||
virReportSystemError(-rv,
|
||||
_("Unable to query sector size %s"),
|
||||
_("Unable to query sector size %1$s"),
|
||||
res->disks[0].path);
|
||||
}
|
||||
goto error_unlink;
|
||||
|
@ -668,14 +667,14 @@ virLockManagerSanlockCreateLease(virLockManagerSanlockDriver *driver,
|
|||
*/
|
||||
if (safezero(fd, 0, rv) < 0) {
|
||||
virReportSystemError(errno,
|
||||
_("Unable to allocate lease %s"),
|
||||
_("Unable to allocate lease %1$s"),
|
||||
res->disks[0].path);
|
||||
goto error_unlink;
|
||||
}
|
||||
|
||||
if (VIR_CLOSE(fd) < 0) {
|
||||
virReportSystemError(errno,
|
||||
_("Unable to save lease %s"),
|
||||
_("Unable to save lease %1$s"),
|
||||
res->disks[0].path);
|
||||
goto error_unlink;
|
||||
}
|
||||
|
@ -684,12 +683,12 @@ virLockManagerSanlockCreateLease(virLockManagerSanlockDriver *driver,
|
|||
char *err = NULL;
|
||||
if (virLockManagerSanlockError(rv, &err)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unable to initialize lease %s: %s"),
|
||||
_("Unable to initialize lease %1$s: %2$s"),
|
||||
res->disks[0].path, NULLSTR(err));
|
||||
VIR_FREE(err);
|
||||
} else {
|
||||
virReportSystemError(-rv,
|
||||
_("Unable to initialize lease %s"),
|
||||
_("Unable to initialize lease %1$s"),
|
||||
res->disks[0].path);
|
||||
}
|
||||
goto error_unlink;
|
||||
|
@ -722,7 +721,7 @@ static int virLockManagerSanlockAddResource(virLockManager *lock,
|
|||
|
||||
if (priv->res_count == SANLK_MAX_RESOURCES) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Too many resources %d for object"),
|
||||
_("Too many resources %1$d for object"),
|
||||
SANLK_MAX_RESOURCES);
|
||||
return -1;
|
||||
}
|
||||
|
@ -757,7 +756,7 @@ static int virLockManagerSanlockAddResource(virLockManager *lock,
|
|||
|
||||
default:
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unknown lock manager object type %d for domain lock object"),
|
||||
_("Unknown lock manager object type %1$d for domain lock object"),
|
||||
type);
|
||||
return -1;
|
||||
}
|
||||
|
@ -788,7 +787,7 @@ virLockManagerSanlockRegisterKillscript(int sock,
|
|||
case VIR_DOMAIN_LOCK_FAILURE_IGNORE:
|
||||
case VIR_DOMAIN_LOCK_FAILURE_LAST:
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("Failure action %s is not supported by sanlock"),
|
||||
_("Failure action %1$s is not supported by sanlock"),
|
||||
virDomainLockFailureTypeToString(action));
|
||||
return -1;
|
||||
}
|
||||
|
@ -812,14 +811,13 @@ virLockManagerSanlockRegisterKillscript(int sock,
|
|||
/* sanlock_killpath() would just crop the strings */
|
||||
if (strlen(path) >= SANLK_HELPER_PATH_LEN) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Sanlock helper path is longer than %d: '%s'"),
|
||||
_("Sanlock helper path is longer than %1$d: '%2$s'"),
|
||||
SANLK_HELPER_PATH_LEN - 1, path);
|
||||
return -1;
|
||||
}
|
||||
if (strlen(args) >= SANLK_HELPER_ARGS_LEN) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Sanlock helper arguments are longer than %d:"
|
||||
" '%s'"),
|
||||
_("Sanlock helper arguments are longer than %1$d: '%2$s'"),
|
||||
SANLK_HELPER_ARGS_LEN - 1, args);
|
||||
return -1;
|
||||
}
|
||||
|
@ -828,7 +826,7 @@ virLockManagerSanlockRegisterKillscript(int sock,
|
|||
char *err = NULL;
|
||||
if (virLockManagerSanlockError(rv, &err)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Failed to register lock failure action: %s"),
|
||||
_("Failed to register lock failure action: %1$s"),
|
||||
NULLSTR(err));
|
||||
VIR_FREE(err);
|
||||
} else {
|
||||
|
@ -881,7 +879,7 @@ static int virLockManagerSanlockAcquire(virLockManager *lock,
|
|||
char *err = NULL;
|
||||
if (virLockManagerSanlockError(sock, &err)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Failed to open socket to sanlock daemon: %s"),
|
||||
_("Failed to open socket to sanlock daemon: %1$s"),
|
||||
NULLSTR(err));
|
||||
VIR_FREE(err);
|
||||
} else {
|
||||
|
@ -919,12 +917,12 @@ static int virLockManagerSanlockAcquire(virLockManager *lock,
|
|||
char *err = NULL;
|
||||
if (virLockManagerSanlockError(rv, &err)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unable to parse lock state %s: %s"),
|
||||
_("Unable to parse lock state %1$s: %2$s"),
|
||||
state, NULLSTR(err));
|
||||
VIR_FREE(err);
|
||||
} else {
|
||||
virReportSystemError(-rv,
|
||||
_("Unable to parse lock state %s"),
|
||||
_("Unable to parse lock state %1$s"),
|
||||
state);
|
||||
}
|
||||
goto error;
|
||||
|
@ -943,7 +941,7 @@ static int virLockManagerSanlockAcquire(virLockManager *lock,
|
|||
char *err = NULL;
|
||||
if (virLockManagerSanlockError(rv, &err)) {
|
||||
virReportError(VIR_ERR_RESOURCE_BUSY,
|
||||
_("Failed to acquire lock: %s"),
|
||||
_("Failed to acquire lock: %1$s"),
|
||||
NULLSTR(err));
|
||||
VIR_FREE(err);
|
||||
} else {
|
||||
|
@ -971,7 +969,7 @@ static int virLockManagerSanlockAcquire(virLockManager *lock,
|
|||
char *err = NULL;
|
||||
if (virLockManagerSanlockError(rv, &err)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Failed to restrict process: %s"),
|
||||
_("Failed to restrict process: %1$s"),
|
||||
NULLSTR(err));
|
||||
VIR_FREE(err);
|
||||
} else {
|
||||
|
@ -1027,7 +1025,7 @@ static int virLockManagerSanlockRelease(virLockManager *lock,
|
|||
char *err = NULL;
|
||||
if (virLockManagerSanlockError(rv, &err)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Failed to inquire lock: %s"),
|
||||
_("Failed to inquire lock: %1$s"),
|
||||
NULLSTR(err));
|
||||
VIR_FREE(err);
|
||||
} else {
|
||||
|
@ -1046,7 +1044,7 @@ static int virLockManagerSanlockRelease(virLockManager *lock,
|
|||
char *err = NULL;
|
||||
if (virLockManagerSanlockError(rv, &err)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Failed to release lock: %s"),
|
||||
_("Failed to release lock: %1$s"),
|
||||
NULLSTR(err));
|
||||
VIR_FREE(err);
|
||||
} else {
|
||||
|
@ -1085,7 +1083,7 @@ static int virLockManagerSanlockInquire(virLockManager *lock,
|
|||
char *err;
|
||||
if (virLockManagerSanlockError(rv, &err)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Failed to inquire lock: %s"),
|
||||
_("Failed to inquire lock: %1$s"),
|
||||
NULLSTR(err));
|
||||
VIR_FREE(err);
|
||||
} else {
|
||||
|
|
|
@ -43,7 +43,7 @@ VIR_LOG_INIT("locking.lock_manager");
|
|||
#define CHECK_DRIVER(field, errret) \
|
||||
if (!driver->field) { \
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, \
|
||||
_("Missing '%s' field in lock manager driver"), \
|
||||
_("Missing '%1$s' field in lock manager driver"), \
|
||||
#field); \
|
||||
return errret; \
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ VIR_LOG_INIT("locking.lock_manager");
|
|||
#define CHECK_MANAGER(field, errret) \
|
||||
if (!lock->driver->field) { \
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, \
|
||||
_("Missing '%s' field in lock manager driver"), \
|
||||
_("Missing '%1$s' field in lock manager driver"), \
|
||||
#field); \
|
||||
return errret; \
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ virLockManagerPlugin *virLockManagerPluginNew(const char *name,
|
|||
|
||||
if (access(modfile, R_OK) < 0) {
|
||||
virReportSystemError(errno,
|
||||
_("Plugin %s not accessible"),
|
||||
_("Plugin %1$s not accessible"),
|
||||
modfile);
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ virLockManagerPlugin *virLockManagerPluginNew(const char *name,
|
|||
handle = dlopen(modfile, RTLD_NOW | RTLD_LOCAL);
|
||||
if (!handle) {
|
||||
virReportError(VIR_ERR_SYSTEM_ERROR,
|
||||
_("Failed to load plugin %s: %s"),
|
||||
_("Failed to load plugin %1$s: %2$s"),
|
||||
modfile, dlerror());
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ getArgs(int argc,
|
|||
int act;
|
||||
|
||||
if (argc != 4) {
|
||||
fprintf(stderr, _("%s uri uuid action\n"), argv[0]);
|
||||
fprintf(stderr, _("%1$s uri uuid action\n"), argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ getArgs(int argc,
|
|||
|
||||
act = virDomainLockFailureTypeFromString(argv[3]);
|
||||
if (act < 0) {
|
||||
fprintf(stderr, _("invalid failure action: '%s'\n"), argv[3]);
|
||||
fprintf(stderr, _("invalid failure action: '%1$s'\n"), argv[3]);
|
||||
return -1;
|
||||
}
|
||||
*action = act;
|
||||
|
@ -90,7 +90,7 @@ main(int argc, char **argv)
|
|||
case VIR_DOMAIN_LOCK_FAILURE_RESTART:
|
||||
case VIR_DOMAIN_LOCK_FAILURE_IGNORE:
|
||||
case VIR_DOMAIN_LOCK_FAILURE_LAST:
|
||||
fprintf(stderr, _("unsupported failure action: '%s'\n"),
|
||||
fprintf(stderr, _("unsupported failure action: '%1$s'\n"),
|
||||
virDomainLockFailureTypeToString(action));
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue