remote: 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:
Jiri Denemark 2023-03-09 13:20:48 +01:00
parent 71b19c4f08
commit 732ff069ad
7 changed files with 105 additions and 107 deletions

View File

@ -250,17 +250,17 @@ daemonSetupNetworking(virNetServer *srv,
} }
if (virStrToLong_i(config->unix_sock_ro_perms, NULL, 8, &unix_sock_ro_mask) != 0) { if (virStrToLong_i(config->unix_sock_ro_perms, NULL, 8, &unix_sock_ro_mask) != 0) {
VIR_ERROR(_("Failed to parse mode '%s'"), config->unix_sock_ro_perms); VIR_ERROR(_("Failed to parse mode '%1$s'"), config->unix_sock_ro_perms);
return -1; return -1;
} }
if (virStrToLong_i(config->unix_sock_admin_perms, NULL, 8, &unix_sock_adm_mask) != 0) { if (virStrToLong_i(config->unix_sock_admin_perms, NULL, 8, &unix_sock_adm_mask) != 0) {
VIR_ERROR(_("Failed to parse mode '%s'"), config->unix_sock_admin_perms); VIR_ERROR(_("Failed to parse mode '%1$s'"), config->unix_sock_admin_perms);
return -1; return -1;
} }
if (virStrToLong_i(config->unix_sock_rw_perms, NULL, 8, &unix_sock_rw_mask) != 0) { if (virStrToLong_i(config->unix_sock_rw_perms, NULL, 8, &unix_sock_rw_mask) != 0) {
VIR_ERROR(_("Failed to parse mode '%s'"), config->unix_sock_rw_perms); VIR_ERROR(_("Failed to parse mode '%1$s'"), config->unix_sock_rw_perms);
return -1; return -1;
} }
@ -682,18 +682,18 @@ daemonSetupHostUUID(const struct daemonConfig *config)
return 0; return 0;
} else if (STREQ(config->host_uuid_source, "machine-id")) { } else if (STREQ(config->host_uuid_source, "machine-id")) {
if (virFileReadBufQuiet(machine_id, buf, sizeof(buf)) < 0) { if (virFileReadBufQuiet(machine_id, buf, sizeof(buf)) < 0) {
VIR_ERROR(_("Can't read %s"), machine_id); VIR_ERROR(_("Can't read %1$s"), machine_id);
return -1; return -1;
} }
uuid = buf; uuid = buf;
} else { } else {
VIR_ERROR(_("invalid UUID source: %s"), config->host_uuid_source); VIR_ERROR(_("invalid UUID source: %1$s"), config->host_uuid_source);
return -1; return -1;
} }
if (virSetHostUUIDStr(uuid)) { if (virSetHostUUIDStr(uuid)) {
VIR_ERROR(_("invalid host UUID: %s"), uuid); VIR_ERROR(_("invalid host UUID: %1$s"), uuid);
return -1; return -1;
} }
@ -915,7 +915,7 @@ int main(int argc, char **argv) {
/* Read the config file if it exists */ /* Read the config file if it exists */
if (remote_config_file && if (remote_config_file &&
daemonConfigLoadFile(config, remote_config_file, implicit_conf) < 0) { daemonConfigLoadFile(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); virGetLastErrorMessage(), remote_config_file);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@ -977,13 +977,13 @@ int main(int argc, char **argv) {
if (godaemon) { if (godaemon) {
if (chdir("/") < 0) { if (chdir("/") < 0) {
VIR_ERROR(_("cannot change to root directory: %s"), VIR_ERROR(_("cannot change to root directory: %1$s"),
g_strerror(errno)); g_strerror(errno));
goto cleanup; goto cleanup;
} }
if ((statuswrite = virDaemonForkIntoBackground(argv[0])) < 0) { 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)); g_strerror(errno));
goto cleanup; goto cleanup;
} }
@ -1007,7 +1007,7 @@ int main(int argc, char **argv) {
old_umask = umask(077); old_umask = umask(077);
VIR_DEBUG("Ensuring run dir '%s' exists", run_dir); VIR_DEBUG("Ensuring run dir '%s' exists", run_dir);
if (g_mkdir_with_parents(run_dir, 0777) < 0) { 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)); g_strerror(errno));
ret = VIR_DAEMON_ERR_RUNDIR; ret = VIR_DAEMON_ERR_RUNDIR;
goto cleanup; goto cleanup;

View File

@ -62,7 +62,7 @@ remoteConfigGetAuth(virConf *conf,
*auth = VIR_NET_SERVER_SERVICE_AUTH_POLKIT; *auth = VIR_NET_SERVER_SERVICE_AUTH_POLKIT;
} else { } else {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("%s: %s: unsupported auth %s"), _("%1$s: %2$s: unsupported auth %3$s"),
filename, key, authstr); filename, key, authstr);
VIR_FREE(authstr); VIR_FREE(authstr);
return -1; return -1;
@ -306,7 +306,7 @@ daemonConfigLoadOptions(struct daemonConfig *data,
return -1; return -1;
} else if (rc > 0 && data->tcp_min_ssf < SSF_WARNING_LEVEL) { } else if (rc > 0 && data->tcp_min_ssf < SSF_WARNING_LEVEL) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("minimum SSF levels lower than %d are not supported"), _("minimum SSF levels lower than %1$d are not supported"),
SSF_WARNING_LEVEL); SSF_WARNING_LEVEL);
return -1; return -1;
} }

View File

@ -55,7 +55,7 @@ VIR_LOG_INIT("daemon.remote");
do { \ do { \
if ((_from) != (_type)(_from)) { \ if ((_from) != (_type)(_from)) { \
virReportError(VIR_ERR_OVERFLOW, \ virReportError(VIR_ERR_OVERFLOW, \
_("conversion from hyper to %s overflowed"), \ _("conversion from hyper to %1$s overflowed"), \
#_type); \ #_type); \
goto cleanup; \ goto cleanup; \
} \ } \
@ -2150,7 +2150,7 @@ remoteDispatchConnectOpen(virNetServer *server G_GNUC_UNUSED,
priv->secretURI = "secret:///session"; priv->secretURI = "secret:///session";
} else { } else {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unexpected driver type '%s' opened"), type); _("Unexpected driver type '%1$s' opened"), type);
goto cleanup; goto cleanup;
} }
#else /* !MODULE_NAME */ #else /* !MODULE_NAME */
@ -2937,7 +2937,7 @@ remoteDispatchDomainGetIOThreadInfo(virNetServer *server G_GNUC_UNUSED,
if (ninfo > REMOTE_IOTHREAD_INFO_MAX) { if (ninfo > REMOTE_IOTHREAD_INFO_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("Too many IOThreads in info: %d for limit %d"), _("Too many IOThreads in info: %1$d for limit %2$d"),
ninfo, REMOTE_IOTHREAD_INFO_MAX); ninfo, REMOTE_IOTHREAD_INFO_MAX);
goto cleanup; goto cleanup;
} }
@ -3704,7 +3704,7 @@ remoteSASLFinish(virNetServer *server,
VIR_DEBUG("negotiated an SSF of %d", ssf); VIR_DEBUG("negotiated an SSF of %d", ssf);
if (ssf < 56) { /* 56 is good for Kerberos */ if (ssf < 56) { /* 56 is good for Kerberos */
VIR_ERROR(_("negotiated SSF %d was not strong enough"), ssf); VIR_ERROR(_("negotiated SSF %1$d was not strong enough"), ssf);
return -2; return -2;
} }
} }
@ -3773,7 +3773,7 @@ remoteDispatchAuthSaslStart(virNetServer *server,
goto authfail; goto authfail;
if (serveroutlen > REMOTE_AUTH_SASL_DATA_MAX) { if (serveroutlen > REMOTE_AUTH_SASL_DATA_MAX) {
VIR_ERROR(_("sasl start reply data too long %d"), (int)serveroutlen); VIR_ERROR(_("sasl start reply data too long %1$d"), (int)serveroutlen);
goto authfail; goto authfail;
} }
@ -3863,7 +3863,7 @@ remoteDispatchAuthSaslStep(virNetServer *server,
goto authfail; goto authfail;
if (serveroutlen > REMOTE_AUTH_SASL_DATA_MAX) { if (serveroutlen > REMOTE_AUTH_SASL_DATA_MAX) {
VIR_ERROR(_("sasl step reply data too long %d"), VIR_ERROR(_("sasl step reply data too long %1$d"),
(int)serveroutlen); (int)serveroutlen);
goto authfail; goto authfail;
} }
@ -4221,7 +4221,7 @@ remoteDispatchConnectDomainEventDeregister(virNetServer *server G_GNUC_UNUSED,
if (callbackID < 0) { if (callbackID < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("domain event %d not registered"), _("domain event %1$d not registered"),
VIR_DOMAIN_EVENT_ID_LIFECYCLE); VIR_DOMAIN_EVENT_ID_LIFECYCLE);
goto cleanup; goto cleanup;
} }
@ -4371,7 +4371,7 @@ remoteDispatchConnectDomainEventRegisterAny(virNetServer *server G_GNUC_UNUSED,
* modern callback style of RPC. */ * modern callback style of RPC. */
if (args->eventID > VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED || if (args->eventID > VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED ||
args->eventID < 0) { args->eventID < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, _("unsupported event ID %d"), virReportError(VIR_ERR_INTERNAL_ERROR, _("unsupported event ID %1$d"),
args->eventID); args->eventID);
goto cleanup; goto cleanup;
} }
@ -4443,7 +4443,7 @@ remoteDispatchConnectDomainEventCallbackRegisterAny(virNetServer *server G_GNUC_
goto cleanup; goto cleanup;
if (args->eventID >= VIR_DOMAIN_EVENT_ID_LAST || args->eventID < 0) { if (args->eventID >= VIR_DOMAIN_EVENT_ID_LAST || args->eventID < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, _("unsupported event ID %d"), virReportError(VIR_ERR_INTERNAL_ERROR, _("unsupported event ID %1$d"),
args->eventID); args->eventID);
goto cleanup; goto cleanup;
} }
@ -4512,7 +4512,7 @@ remoteDispatchConnectDomainEventDeregisterAny(virNetServer *server G_GNUC_UNUSED
* modern callback style of RPC. */ * modern callback style of RPC. */
if (args->eventID > VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED || if (args->eventID > VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED ||
args->eventID < 0) { args->eventID < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, _("unsupported event ID %d"), virReportError(VIR_ERR_INTERNAL_ERROR, _("unsupported event ID %1$d"),
args->eventID); args->eventID);
goto cleanup; goto cleanup;
} }
@ -4525,7 +4525,7 @@ remoteDispatchConnectDomainEventDeregisterAny(virNetServer *server G_GNUC_UNUSED
} }
if (callbackID < 0) { if (callbackID < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("domain event %d not registered"), args->eventID); _("domain event %1$d not registered"), args->eventID);
goto cleanup; goto cleanup;
} }
@ -4565,7 +4565,7 @@ remoteDispatchConnectDomainEventCallbackDeregisterAny(virNetServer *server G_GNU
} }
if (i == priv->ndomainEventCallbacks) { if (i == priv->ndomainEventCallbacks) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("domain event callback %d not registered"), _("domain event callback %1$d not registered"),
args->callbackID); args->callbackID);
goto cleanup; goto cleanup;
} }
@ -5488,7 +5488,7 @@ remoteDispatchDomainMigrateBegin3Params(virNetServer *server G_GNUC_UNUSED,
if (args->params.params_len > REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX) { if (args->params.params_len > REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("Too many migration parameters '%d' for limit '%d'"), _("Too many migration parameters '%1$d' for limit '%2$d'"),
args->params.params_len, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX); args->params.params_len, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX);
goto cleanup; goto cleanup;
} }
@ -5541,7 +5541,7 @@ remoteDispatchDomainMigratePrepare3Params(virNetServer *server G_GNUC_UNUSED,
if (args->params.params_len > REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX) { if (args->params.params_len > REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("Too many migration parameters '%d' for limit '%d'"), _("Too many migration parameters '%1$d' for limit '%2$d'"),
args->params.params_len, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX); args->params.params_len, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX);
goto cleanup; goto cleanup;
} }
@ -5597,7 +5597,7 @@ remoteDispatchDomainMigratePrepareTunnel3Params(virNetServer *server G_GNUC_UNUS
if (args->params.params_len > REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX) { if (args->params.params_len > REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("Too many migration parameters '%d' for limit '%d'"), _("Too many migration parameters '%1$d' for limit '%2$d'"),
args->params.params_len, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX); args->params.params_len, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX);
goto cleanup; goto cleanup;
} }
@ -5664,7 +5664,7 @@ remoteDispatchDomainMigratePerform3Params(virNetServer *server G_GNUC_UNUSED,
if (args->params.params_len > REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX) { if (args->params.params_len > REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("Too many migration parameters '%d' for limit '%d'"), _("Too many migration parameters '%1$d' for limit '%2$d'"),
args->params.params_len, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX); args->params.params_len, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX);
goto cleanup; goto cleanup;
} }
@ -5721,7 +5721,7 @@ remoteDispatchDomainMigrateFinish3Params(virNetServer *server G_GNUC_UNUSED,
if (args->params.params_len > REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX) { if (args->params.params_len > REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("Too many migration parameters '%d' for limit '%d'"), _("Too many migration parameters '%1$d' for limit '%2$d'"),
args->params.params_len, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX); args->params.params_len, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX);
goto cleanup; goto cleanup;
} }
@ -5775,7 +5775,7 @@ remoteDispatchDomainMigrateConfirm3Params(virNetServer *server G_GNUC_UNUSED,
if (args->params.params_len > REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX) { if (args->params.params_len > REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("Too many migration parameters '%d' for limit '%d'"), _("Too many migration parameters '%1$d' for limit '%2$d'"),
args->params.params_len, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX); args->params.params_len, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX);
goto cleanup; goto cleanup;
} }
@ -5828,7 +5828,7 @@ remoteDispatchConnectGetCPUModelNames(virNetServer *server G_GNUC_UNUSED,
if (len > REMOTE_CONNECT_CPU_MODELS_MAX) { if (len > REMOTE_CONNECT_CPU_MODELS_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("Too many CPU models '%d' for limit '%d'"), _("Too many CPU models '%1$d' for limit '%2$d'"),
len, REMOTE_CONNECT_CPU_MODELS_MAX); len, REMOTE_CONNECT_CPU_MODELS_MAX);
goto cleanup; goto cleanup;
} }
@ -5971,7 +5971,7 @@ remoteDispatchConnectNetworkEventRegisterAny(virNetServer *server G_GNUC_UNUSED,
if (args->eventID >= VIR_NETWORK_EVENT_ID_LAST || args->eventID < 0) { if (args->eventID >= VIR_NETWORK_EVENT_ID_LAST || args->eventID < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unsupported network event ID %d"), args->eventID); _("unsupported network event ID %1$d"), args->eventID);
goto cleanup; goto cleanup;
} }
@ -6039,7 +6039,7 @@ remoteDispatchConnectNetworkEventDeregisterAny(virNetServer *server G_GNUC_UNUSE
} }
if (i == priv->nnetworkEventCallbacks) { if (i == priv->nnetworkEventCallbacks) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("network event callback %d not registered"), _("network event callback %1$d not registered"),
args->callbackID); args->callbackID);
goto cleanup; goto cleanup;
} }
@ -6084,7 +6084,7 @@ remoteDispatchConnectStoragePoolEventRegisterAny(virNetServer *server G_GNUC_UNU
if (args->eventID >= VIR_STORAGE_POOL_EVENT_ID_LAST || args->eventID < 0) { if (args->eventID >= VIR_STORAGE_POOL_EVENT_ID_LAST || args->eventID < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unsupported storage pool event ID %d"), args->eventID); _("unsupported storage pool event ID %1$d"), args->eventID);
goto cleanup; goto cleanup;
} }
@ -6152,7 +6152,7 @@ remoteDispatchConnectStoragePoolEventDeregisterAny(virNetServer *server G_GNUC_U
} }
if (i == priv->nstorageEventCallbacks) { if (i == priv->nstorageEventCallbacks) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("storage pool event callback %d not registered"), _("storage pool event callback %1$d not registered"),
args->callbackID); args->callbackID);
goto cleanup; goto cleanup;
} }
@ -6197,7 +6197,7 @@ remoteDispatchConnectNodeDeviceEventRegisterAny(virNetServer *server G_GNUC_UNUS
if (args->eventID >= VIR_NODE_DEVICE_EVENT_ID_LAST || args->eventID < 0) { if (args->eventID >= VIR_NODE_DEVICE_EVENT_ID_LAST || args->eventID < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unsupported node device event ID %d"), args->eventID); _("unsupported node device event ID %1$d"), args->eventID);
goto cleanup; goto cleanup;
} }
@ -6264,7 +6264,7 @@ remoteDispatchConnectNodeDeviceEventDeregisterAny(virNetServer *server G_GNUC_UN
} }
if (i == priv->nnodeDeviceEventCallbacks) { if (i == priv->nnodeDeviceEventCallbacks) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("node device event callback %d not registered"), _("node device event callback %1$d not registered"),
args->callbackID); args->callbackID);
goto cleanup; goto cleanup;
} }
@ -6309,7 +6309,7 @@ remoteDispatchConnectSecretEventRegisterAny(virNetServer *server G_GNUC_UNUSED,
if (args->eventID >= VIR_SECRET_EVENT_ID_LAST || args->eventID < 0) { if (args->eventID >= VIR_SECRET_EVENT_ID_LAST || args->eventID < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unsupported secret event ID %d"), args->eventID); _("unsupported secret event ID %1$d"), args->eventID);
goto cleanup; goto cleanup;
} }
@ -6376,7 +6376,7 @@ remoteDispatchConnectSecretEventDeregisterAny(virNetServer *server G_GNUC_UNUSED
} }
if (i == priv->nsecretEventCallbacks) { if (i == priv->nsecretEventCallbacks) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("node device event callback %d not registered"), _("node device event callback %1$d not registered"),
args->callbackID); args->callbackID);
goto cleanup; goto cleanup;
} }
@ -6485,7 +6485,7 @@ qemuDispatchConnectDomainMonitorEventDeregister(virNetServer *server G_GNUC_UNUS
} }
if (i == priv->nqemuEventCallbacks) { if (i == priv->nqemuEventCallbacks) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("qemu monitor event callback %d not registered"), _("qemu monitor event callback %1$d not registered"),
args->callbackID); args->callbackID);
goto cleanup; goto cleanup;
} }
@ -6645,7 +6645,7 @@ remoteDispatchNetworkGetDHCPLeases(virNetServer *server G_GNUC_UNUSED,
if (nleases > REMOTE_NETWORK_DHCP_LEASES_MAX) { if (nleases > REMOTE_NETWORK_DHCP_LEASES_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Number of leases is %d, which exceeds max limit: %d"), _("Number of leases is %1$d, which exceeds max limit: %2$d"),
nleases, REMOTE_NETWORK_DHCP_LEASES_MAX); nleases, REMOTE_NETWORK_DHCP_LEASES_MAX);
goto cleanup; goto cleanup;
} }
@ -6722,8 +6722,7 @@ remoteDispatchConnectGetAllDomainStats(virNetServer *server G_GNUC_UNUSED,
if (nrecords) { if (nrecords) {
if (nrecords > REMOTE_DOMAIN_LIST_MAX) { if (nrecords > REMOTE_DOMAIN_LIST_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Number of domain stats records is %d, " _("Number of domain stats records is %1$d, which exceeds max limit: %2$d"),
"which exceeds max limit: %d"),
nrecords, REMOTE_DOMAIN_LIST_MAX); nrecords, REMOTE_DOMAIN_LIST_MAX);
goto cleanup; goto cleanup;
} }
@ -6827,7 +6826,7 @@ remoteDispatchDomainGetFSInfo(virNetServer *server G_GNUC_UNUSED,
if (ninfo > REMOTE_DOMAIN_FSINFO_MAX) { if (ninfo > REMOTE_DOMAIN_FSINFO_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("Too many mountpoints in fsinfo: %d for limit %d"), _("Too many mountpoints in fsinfo: %1$d for limit %2$d"),
ninfo, REMOTE_DOMAIN_FSINFO_MAX); ninfo, REMOTE_DOMAIN_FSINFO_MAX);
goto cleanup; goto cleanup;
} }
@ -6847,7 +6846,7 @@ remoteDispatchDomainGetFSInfo(virNetServer *server G_GNUC_UNUSED,
ndisk = info[i]->ndevAlias; ndisk = info[i]->ndevAlias;
if (ndisk > REMOTE_DOMAIN_FSINFO_DISKS_MAX) { if (ndisk > REMOTE_DOMAIN_FSINFO_DISKS_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("Too many disks in fsinfo: %zd for limit %d"), _("Too many disks in fsinfo: %1$zd for limit %2$d"),
ndisk, REMOTE_DOMAIN_FSINFO_DISKS_MAX); ndisk, REMOTE_DOMAIN_FSINFO_DISKS_MAX);
goto cleanup; goto cleanup;
} }
@ -6910,7 +6909,7 @@ remoteSerializeDomainInterface(virDomainInterfacePtr *ifaces,
if (ifaces_count > REMOTE_DOMAIN_INTERFACE_MAX) { if (ifaces_count > REMOTE_DOMAIN_INTERFACE_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Number of interfaces, %d exceeds the max limit: %d"), _("Number of interfaces, %1$d exceeds the max limit: %2$d"),
ifaces_count, REMOTE_DOMAIN_INTERFACE_MAX); ifaces_count, REMOTE_DOMAIN_INTERFACE_MAX);
return -1; return -1;
} }
@ -6931,7 +6930,7 @@ remoteSerializeDomainInterface(virDomainInterfacePtr *ifaces,
if (iface->naddrs > REMOTE_DOMAIN_IP_ADDR_MAX) { if (iface->naddrs > REMOTE_DOMAIN_IP_ADDR_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Number of interfaces, %d exceeds the max limit: %d"), _("Number of interfaces, %1$d exceeds the max limit: %2$d"),
iface->naddrs, REMOTE_DOMAIN_IP_ADDR_MAX); iface->naddrs, REMOTE_DOMAIN_IP_ADDR_MAX);
goto cleanup; goto cleanup;
} }
@ -7332,7 +7331,7 @@ remoteDispatchDomainAuthorizedSshKeysGet(virNetServer *server G_GNUC_UNUSED,
if (nkeys > REMOTE_DOMAIN_AUTHORIZED_SSH_KEYS_MAX) { if (nkeys > REMOTE_DOMAIN_AUTHORIZED_SSH_KEYS_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Number of keys %d, which exceeds max limit: %d"), _("Number of keys %1$d, which exceeds max limit: %2$d"),
nkeys, REMOTE_DOMAIN_AUTHORIZED_SSH_KEYS_MAX); nkeys, REMOTE_DOMAIN_AUTHORIZED_SSH_KEYS_MAX);
goto cleanup; goto cleanup;
} }
@ -7369,7 +7368,7 @@ remoteDispatchDomainAuthorizedSshKeysSet(virNetServer *server G_GNUC_UNUSED,
if (args->keys.keys_len > REMOTE_DOMAIN_AUTHORIZED_SSH_KEYS_MAX) { if (args->keys.keys_len > REMOTE_DOMAIN_AUTHORIZED_SSH_KEYS_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Number of keys %d, which exceeds max limit: %d"), _("Number of keys %1$d, which exceeds max limit: %2$d"),
args->keys.keys_len, REMOTE_DOMAIN_AUTHORIZED_SSH_KEYS_MAX); args->keys.keys_len, REMOTE_DOMAIN_AUTHORIZED_SSH_KEYS_MAX);
goto cleanup; goto cleanup;
} }
@ -7411,7 +7410,7 @@ remoteDispatchDomainGetMessages(virNetServer *server G_GNUC_UNUSED,
if (nmsgs > REMOTE_DOMAIN_MESSAGES_MAX) { if (nmsgs > REMOTE_DOMAIN_MESSAGES_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Number of msgs %d, which exceeds max limit: %d"), _("Number of msgs %1$d, which exceeds max limit: %2$d"),
nmsgs, REMOTE_DOMAIN_MESSAGES_MAX); nmsgs, REMOTE_DOMAIN_MESSAGES_MAX);
goto cleanup; goto cleanup;
} }

View File

@ -657,7 +657,7 @@ daemonStreamHandleAbort(virNetServerClient *client,
raise_error = (ret < 0); raise_error = (ret < 0);
} else { } else {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("stream aborted with unexpected status %d"), _("stream aborted with unexpected status %1$d"),
msg->header.status); msg->header.status);
raise_error = true; raise_error = true;
} }
@ -768,7 +768,7 @@ daemonStreamHandleWrite(virNetServerClient *client,
} }
} else { } else {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("Unexpected message type: %d"), _("Unexpected message type: %1$d"),
msg->header.type); msg->header.type);
ret = -1; ret = -1;
} }

View File

@ -59,7 +59,7 @@ VIR_LOG_INIT("remote.remote_driver");
do { \ do { \
if ((_from) != (_type)(_from)) { \ if ((_from) != (_type)(_from)) { \
virReportError(VIR_ERR_INTERNAL_ERROR, \ virReportError(VIR_ERR_INTERNAL_ERROR, \
_("conversion from hyper to %s overflowed"), #_type); \ _("conversion from hyper to %1$s overflowed"), #_type); \
goto done; \ goto done; \
} \ } \
(_to) = (_from); \ (_to) = (_from); \
@ -738,7 +738,7 @@ remoteConnectFormatURI(virURI *uri,
int tmp; \ int tmp; \
if (virStrToLong_i(var->value, NULL, 10, &tmp) < 0) { \ if (virStrToLong_i(var->value, NULL, 10, &tmp) < 0) { \
virReportError(VIR_ERR_INVALID_ARG, \ virReportError(VIR_ERR_INVALID_ARG, \
_("Failed to parse value of URI component %s"), \ _("Failed to parse value of URI component %1$s"), \
var->name); \ var->name); \
goto error; \ goto error; \
} \ } \
@ -884,7 +884,7 @@ doRemoteOpen(virConnectPtr conn,
if (mode_str) { if (mode_str) {
if ((mode = remoteDriverModeTypeFromString(mode_str)) < 0) { if ((mode = remoteDriverModeTypeFromString(mode_str)) < 0) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("Unknown remote mode '%s'"), mode_str); _("Unknown remote mode '%1$s'"), mode_str);
goto error; goto error;
} }
} else { } else {
@ -902,7 +902,7 @@ doRemoteOpen(virConnectPtr conn,
if (proxy_str) { if (proxy_str) {
if ((proxy = virNetClientProxyTypeFromString(proxy_str)) < 0) { if ((proxy = virNetClientProxyTypeFromString(proxy_str)) < 0) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("Unnkown proxy type '%s'"), proxy_str); _("Unnkown proxy type '%1$s'"), proxy_str);
goto error; goto error;
} }
} else { } else {
@ -1498,7 +1498,7 @@ remoteNodeGetCPUStats(virConnectPtr conn,
for (i = 0; i < *nparams; ++i) { for (i = 0; i < *nparams; ++i) {
if (virStrcpyStatic(params[i].field, ret.params.params_val[i].field) < 0) { if (virStrcpyStatic(params[i].field, ret.params.params_val[i].field) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Stats %s too big for destination"), _("Stats %1$s too big for destination"),
ret.params.params_val[i].field); ret.params.params_val[i].field);
goto cleanup; goto cleanup;
} }
@ -1558,7 +1558,7 @@ remoteNodeGetMemoryStats(virConnectPtr conn,
for (i = 0; i < *nparams; ++i) { for (i = 0; i < *nparams; ++i) {
if (virStrcpyStatic(params[i].field, ret.params.params_val[i].field) < 0) { if (virStrcpyStatic(params[i].field, ret.params.params_val[i].field) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Stats %s too big for destination"), _("Stats %1$s too big for destination"),
ret.params.params_val[i].field); ret.params.params_val[i].field);
goto cleanup; goto cleanup;
} }
@ -1586,7 +1586,7 @@ remoteNodeGetCellsFreeMemory(virConnectPtr conn,
if (maxCells > REMOTE_NODE_MAX_CELLS) { if (maxCells > REMOTE_NODE_MAX_CELLS) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("too many NUMA cells: %d > %d"), _("too many NUMA cells: %1$d > %2$d"),
maxCells, REMOTE_NODE_MAX_CELLS); maxCells, REMOTE_NODE_MAX_CELLS);
return -1; return -1;
} }
@ -1619,7 +1619,7 @@ remoteConnectListDomains(virConnectPtr conn, int *ids, int maxids)
if (maxids > REMOTE_DOMAIN_LIST_MAX) { if (maxids > REMOTE_DOMAIN_LIST_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("Too many domains '%d' for limit '%d'"), _("Too many domains '%1$d' for limit '%2$d'"),
maxids, REMOTE_DOMAIN_LIST_MAX); maxids, REMOTE_DOMAIN_LIST_MAX);
return -1; return -1;
} }
@ -1632,7 +1632,7 @@ remoteConnectListDomains(virConnectPtr conn, int *ids, int maxids)
if (ret.ids.ids_len > maxids) { if (ret.ids.ids_len > maxids) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("Too many domains '%d' for limit '%d'"), _("Too many domains '%1$d' for limit '%2$d'"),
ret.ids.ids_len, maxids); ret.ids.ids_len, maxids);
goto cleanup; goto cleanup;
} }
@ -1954,7 +1954,7 @@ remoteDomainGetVcpuPinInfo(virDomainPtr domain,
if (ncpumaps > REMOTE_VCPUINFO_MAX) { if (ncpumaps > REMOTE_VCPUINFO_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("vCPU count exceeds maximum: %d > %d"), _("vCPU count exceeds maximum: %1$d > %2$d"),
ncpumaps, REMOTE_VCPUINFO_MAX); ncpumaps, REMOTE_VCPUINFO_MAX);
return -1; return -1;
} }
@ -1962,7 +1962,7 @@ remoteDomainGetVcpuPinInfo(virDomainPtr domain,
if (VIR_INT_MULTIPLY_OVERFLOW(ncpumaps, maplen) || if (VIR_INT_MULTIPLY_OVERFLOW(ncpumaps, maplen) ||
ncpumaps * maplen > REMOTE_CPUMAPS_MAX) { ncpumaps * maplen > REMOTE_CPUMAPS_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("vCPU map buffer length exceeds maximum: %d > %d"), _("vCPU map buffer length exceeds maximum: %1$d > %2$d"),
ncpumaps * maplen, REMOTE_CPUMAPS_MAX); ncpumaps * maplen, REMOTE_CPUMAPS_MAX);
return -1; return -1;
} }
@ -1981,14 +1981,14 @@ remoteDomainGetVcpuPinInfo(virDomainPtr domain,
if (ret.num > ncpumaps) { if (ret.num > ncpumaps) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("host reports too many vCPUs: %d > %d"), _("host reports too many vCPUs: %1$d > %2$d"),
ret.num, ncpumaps); ret.num, ncpumaps);
goto cleanup; goto cleanup;
} }
if (ret.cpumaps.cpumaps_len > ncpumaps * maplen) { if (ret.cpumaps.cpumaps_len > ncpumaps * maplen) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("host reports map buffer length exceeds maximum: %d > %d"), _("host reports map buffer length exceeds maximum: %1$d > %2$d"),
ret.cpumaps.cpumaps_len, ncpumaps * maplen); ret.cpumaps.cpumaps_len, ncpumaps * maplen);
goto cleanup; goto cleanup;
} }
@ -2017,7 +2017,7 @@ remoteDomainPinEmulator(virDomainPtr dom,
if (cpumaplen > REMOTE_CPUMAP_MAX) { if (cpumaplen > REMOTE_CPUMAP_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("%s length greater than maximum: %d > %d"), _("%1$s length greater than maximum: %2$d > %3$d"),
"cpumap", cpumaplen, REMOTE_CPUMAP_MAX); "cpumap", cpumaplen, REMOTE_CPUMAP_MAX);
return -1; return -1;
} }
@ -2053,7 +2053,7 @@ remoteDomainGetEmulatorPinInfo(virDomainPtr domain,
/* There is only one cpumap for all emulator threads */ /* There is only one cpumap for all emulator threads */
if (maplen > REMOTE_CPUMAPS_MAX) { if (maplen > REMOTE_CPUMAPS_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("vCPU map buffer length exceeds maximum: %d > %d"), _("vCPU map buffer length exceeds maximum: %1$d > %2$d"),
maplen, REMOTE_CPUMAPS_MAX); maplen, REMOTE_CPUMAPS_MAX);
return -1; return -1;
} }
@ -2071,7 +2071,7 @@ remoteDomainGetEmulatorPinInfo(virDomainPtr domain,
if (ret.cpumaps.cpumaps_len > maplen) { if (ret.cpumaps.cpumaps_len > maplen) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("host reports map buffer length exceeds maximum: %d > %d"), _("host reports map buffer length exceeds maximum: %1$d > %2$d"),
ret.cpumaps.cpumaps_len, maplen); ret.cpumaps.cpumaps_len, maplen);
goto cleanup; goto cleanup;
} }
@ -2105,14 +2105,14 @@ remoteDomainGetVcpus(virDomainPtr domain,
if (maxinfo > REMOTE_VCPUINFO_MAX) { if (maxinfo > REMOTE_VCPUINFO_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("vCPU count exceeds maximum: %d > %d"), _("vCPU count exceeds maximum: %1$d > %2$d"),
maxinfo, REMOTE_VCPUINFO_MAX); maxinfo, REMOTE_VCPUINFO_MAX);
return -1; return -1;
} }
if (VIR_INT_MULTIPLY_OVERFLOW(maxinfo, maplen) || if (VIR_INT_MULTIPLY_OVERFLOW(maxinfo, maplen) ||
maxinfo * maplen > REMOTE_CPUMAPS_MAX) { maxinfo * maplen > REMOTE_CPUMAPS_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("vCPU map buffer length exceeds maximum: %d > %d"), _("vCPU map buffer length exceeds maximum: %1$d > %2$d"),
maxinfo * maplen, REMOTE_CPUMAPS_MAX); maxinfo * maplen, REMOTE_CPUMAPS_MAX);
return -1; return -1;
} }
@ -2128,13 +2128,13 @@ remoteDomainGetVcpus(virDomainPtr domain,
if (ret.info.info_len > maxinfo) { if (ret.info.info_len > maxinfo) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("host reports too many vCPUs: %d > %d"), _("host reports too many vCPUs: %1$d > %2$d"),
ret.info.info_len, maxinfo); ret.info.info_len, maxinfo);
goto cleanup; goto cleanup;
} }
if (ret.cpumaps.cpumaps_len > maxinfo * maplen) { if (ret.cpumaps.cpumaps_len > maxinfo * maplen) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("host reports map buffer length exceeds maximum: %d > %d"), _("host reports map buffer length exceeds maximum: %1$d > %2$d"),
ret.cpumaps.cpumaps_len, maxinfo * maplen); ret.cpumaps.cpumaps_len, maxinfo * maplen);
goto cleanup; goto cleanup;
} }
@ -2185,7 +2185,7 @@ remoteDomainGetIOThreadInfo(virDomainPtr dom,
if (ret.info.info_len > REMOTE_IOTHREAD_INFO_MAX) { if (ret.info.info_len > REMOTE_IOTHREAD_INFO_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Too many IOThreads in info: %d for limit %d"), _("Too many IOThreads in info: %1$d for limit %2$d"),
ret.info.info_len, REMOTE_IOTHREAD_INFO_MAX); ret.info.info_len, REMOTE_IOTHREAD_INFO_MAX);
goto cleanup; goto cleanup;
} }
@ -2242,7 +2242,7 @@ remoteDomainGetSecurityLabel(virDomainPtr domain, virSecurityLabelPtr seclabel)
if (ret.label.label_val != NULL) { if (ret.label.label_val != NULL) {
if (virStrcpyStatic(seclabel->label, ret.label.label_val) < 0) { if (virStrcpyStatic(seclabel->label, ret.label.label_val) < 0) {
virReportError(VIR_ERR_RPC, _("security label exceeds maximum: %zu"), virReportError(VIR_ERR_RPC, _("security label exceeds maximum: %1$zu"),
sizeof(seclabel->label) - 1); sizeof(seclabel->label) - 1);
goto cleanup; goto cleanup;
} }
@ -2279,7 +2279,7 @@ remoteDomainGetSecurityLabelList(virDomainPtr domain, virSecurityLabelPtr* secla
remote_domain_get_security_label_ret *cur = &ret.labels.labels_val[i]; remote_domain_get_security_label_ret *cur = &ret.labels.labels_val[i];
if (cur->label.label_val != NULL) { if (cur->label.label_val != NULL) {
if (virStrcpyStatic((*seclabels)[i].label, cur->label.label_val) < 0) { if (virStrcpyStatic((*seclabels)[i].label, cur->label.label_val) < 0) {
virReportError(VIR_ERR_RPC, _("security label exceeds maximum: %zd"), virReportError(VIR_ERR_RPC, _("security label exceeds maximum: %1$zd"),
sizeof((*seclabels)->label) - 1); sizeof((*seclabels)->label) - 1);
VIR_FREE(*seclabels); VIR_FREE(*seclabels);
goto cleanup; goto cleanup;
@ -2337,7 +2337,7 @@ remoteNodeGetSecurityModel(virConnectPtr conn, virSecurityModelPtr secmodel)
if (ret.model.model_val != NULL) { if (ret.model.model_val != NULL) {
if (virStrcpyStatic(secmodel->model, ret.model.model_val) < 0) { if (virStrcpyStatic(secmodel->model, ret.model.model_val) < 0) {
virReportError(VIR_ERR_RPC, _("security model exceeds maximum: %zu"), virReportError(VIR_ERR_RPC, _("security model exceeds maximum: %1$zu"),
sizeof(secmodel->model) - 1); sizeof(secmodel->model) - 1);
goto cleanup; goto cleanup;
} }
@ -2345,7 +2345,7 @@ remoteNodeGetSecurityModel(virConnectPtr conn, virSecurityModelPtr secmodel)
if (ret.doi.doi_val != NULL) { if (ret.doi.doi_val != NULL) {
if (virStrcpyStatic(secmodel->doi, ret.doi.doi_val) < 0) { if (virStrcpyStatic(secmodel->doi, ret.doi.doi_val) < 0) {
virReportError(VIR_ERR_RPC, _("security doi exceeds maximum: %zu"), virReportError(VIR_ERR_RPC, _("security doi exceeds maximum: %1$zu"),
sizeof(secmodel->doi) - 1); sizeof(secmodel->doi) - 1);
goto cleanup; goto cleanup;
} }
@ -2516,7 +2516,7 @@ remoteDomainMemoryStats(virDomainPtr domain,
make_nonnull_domain(&args.dom, domain); make_nonnull_domain(&args.dom, domain);
if (nr_stats > REMOTE_DOMAIN_MEMORY_STATS_MAX) { if (nr_stats > REMOTE_DOMAIN_MEMORY_STATS_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("too many memory stats requested: %d > %d"), nr_stats, _("too many memory stats requested: %1$d > %2$d"), nr_stats,
REMOTE_DOMAIN_MEMORY_STATS_MAX); REMOTE_DOMAIN_MEMORY_STATS_MAX);
return -1; return -1;
} }
@ -2556,7 +2556,7 @@ remoteDomainBlockPeek(virDomainPtr domain,
if (size > REMOTE_DOMAIN_BLOCK_PEEK_BUFFER_MAX) { if (size > REMOTE_DOMAIN_BLOCK_PEEK_BUFFER_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("block peek request too large for remote protocol, %zi > %d"), _("block peek request too large for remote protocol, %1$zi > %2$d"),
size, REMOTE_DOMAIN_BLOCK_PEEK_BUFFER_MAX); size, REMOTE_DOMAIN_BLOCK_PEEK_BUFFER_MAX);
return -1; return -1;
} }
@ -2603,7 +2603,7 @@ remoteDomainMemoryPeek(virDomainPtr domain,
if (size > REMOTE_DOMAIN_MEMORY_PEEK_BUFFER_MAX) { if (size > REMOTE_DOMAIN_MEMORY_PEEK_BUFFER_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("memory peek request too large for remote protocol, %zi > %d"), _("memory peek request too large for remote protocol, %1$zi > %2$d"),
size, REMOTE_DOMAIN_MEMORY_PEEK_BUFFER_MAX); size, REMOTE_DOMAIN_MEMORY_PEEK_BUFFER_MAX);
return -1; return -1;
} }
@ -2732,13 +2732,13 @@ static int remoteDomainGetCPUStats(virDomainPtr domain,
if (nparams > REMOTE_NODE_CPU_STATS_MAX) { if (nparams > REMOTE_NODE_CPU_STATS_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("nparams count exceeds maximum: %u > %u"), _("nparams count exceeds maximum: %1$u > %2$u"),
nparams, REMOTE_NODE_CPU_STATS_MAX); nparams, REMOTE_NODE_CPU_STATS_MAX);
return -1; return -1;
} }
if (ncpus > REMOTE_DOMAIN_GET_CPU_STATS_NCPUS_MAX) { if (ncpus > REMOTE_DOMAIN_GET_CPU_STATS_NCPUS_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("ncpus count exceeds maximum: %u > %u"), _("ncpus count exceeds maximum: %1$u > %2$u"),
ncpus, REMOTE_DOMAIN_GET_CPU_STATS_NCPUS_MAX); ncpus, REMOTE_DOMAIN_GET_CPU_STATS_NCPUS_MAX);
return -1; return -1;
} }
@ -3361,7 +3361,7 @@ remoteAuthenticate(virConnectPtr conn, struct private_data *priv,
want = REMOTE_AUTH_POLKIT; want = REMOTE_AUTH_POLKIT;
} else { } else {
virReportError(VIR_ERR_AUTH_FAILED, virReportError(VIR_ERR_AUTH_FAILED,
_("unknown authentication type %s"), authtype); _("unknown authentication type %1$s"), authtype);
return -1; return -1;
} }
for (i = 0; i < ret.types.types_len; i++) { for (i = 0; i < ret.types.types_len; i++) {
@ -3370,7 +3370,7 @@ remoteAuthenticate(virConnectPtr conn, struct private_data *priv,
} }
if (type == REMOTE_AUTH_NONE) { if (type == REMOTE_AUTH_NONE) {
virReportError(VIR_ERR_AUTH_FAILED, virReportError(VIR_ERR_AUTH_FAILED,
_("requested authentication type %s rejected"), _("requested authentication type %1$s rejected"),
authtype); authtype);
return -1; return -1;
} }
@ -3407,7 +3407,7 @@ remoteAuthenticate(virConnectPtr conn, struct private_data *priv,
default: default:
virReportError(VIR_ERR_AUTH_FAILED, virReportError(VIR_ERR_AUTH_FAILED,
_("unsupported authentication type %d"), _("unsupported authentication type %1$d"),
ret.types.types_val[0]); ret.types.types_val[0]);
VIR_FREE(ret.types.types_val); VIR_FREE(ret.types.types_val);
return -1; return -1;
@ -3800,7 +3800,7 @@ remoteAuthSASL(virConnectPtr conn, struct private_data *priv,
if (wantmech) { if (wantmech) {
if (strstr(mechlist, wantmech) == NULL) { if (strstr(mechlist, wantmech) == NULL) {
virReportError(VIR_ERR_AUTH_FAILED, virReportError(VIR_ERR_AUTH_FAILED,
_("SASL mechanism %s not supported by server"), _("SASL mechanism %1$s not supported by server"),
wantmech); wantmech);
VIR_FREE(iret.mechlist); VIR_FREE(iret.mechlist);
goto cleanup; goto cleanup;
@ -3830,7 +3830,7 @@ remoteAuthSASL(virConnectPtr conn, struct private_data *priv,
if (clientoutlen > REMOTE_AUTH_SASL_DATA_MAX) { if (clientoutlen > REMOTE_AUTH_SASL_DATA_MAX) {
virReportError(VIR_ERR_AUTH_FAILED, virReportError(VIR_ERR_AUTH_FAILED,
_("SASL negotiation data too long: %zu bytes"), _("SASL negotiation data too long: %1$zu bytes"),
clientoutlen); clientoutlen);
goto cleanup; goto cleanup;
} }
@ -3929,7 +3929,7 @@ remoteAuthSASL(virConnectPtr conn, struct private_data *priv,
VIR_DEBUG("SASL SSF value %d", ssf); VIR_DEBUG("SASL SSF value %d", ssf);
if (ssf < 56) { /* 56 == DES level, good for Kerberos */ if (ssf < 56) { /* 56 == DES level, good for Kerberos */
virReportError(VIR_ERR_AUTH_FAILED, virReportError(VIR_ERR_AUTH_FAILED,
_("negotiation SSF %d was not strong enough"), ssf); _("negotiation SSF %1$d was not strong enough"), ssf);
goto cleanup; goto cleanup;
} }
if (ssf < SSF_WARNING_LEVEL) { if (ssf < SSF_WARNING_LEVEL) {
@ -6018,7 +6018,7 @@ remoteConnectGetCPUModelNames(virConnectPtr conn,
/* Check the length of the returned list carefully. */ /* Check the length of the returned list carefully. */
if (ret.models.models_len > REMOTE_CONNECT_CPU_MODELS_MAX) { if (ret.models.models_len > REMOTE_CONNECT_CPU_MODELS_MAX) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("Too many model names '%d' for limit '%d'"), _("Too many model names '%1$d' for limit '%2$d'"),
ret.models.models_len, ret.models.models_len,
REMOTE_CONNECT_CPU_MODELS_MAX); REMOTE_CONNECT_CPU_MODELS_MAX);
goto cleanup; goto cleanup;
@ -6961,7 +6961,7 @@ remoteNodeGetFreePages(virConnectPtr conn,
if (npages * cellCount > REMOTE_NODE_MAX_CELLS) { if (npages * cellCount > REMOTE_NODE_MAX_CELLS) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("too many NUMA cells: %d > %d"), _("too many NUMA cells: %1$d > %2$d"),
npages * cellCount, REMOTE_NODE_MAX_CELLS); npages * cellCount, REMOTE_NODE_MAX_CELLS);
return -1; return -1;
} }
@ -7051,7 +7051,7 @@ remoteNetworkGetDHCPLeases(virNetworkPtr net,
if (ret.leases.leases_len > REMOTE_NETWORK_DHCP_LEASES_MAX) { if (ret.leases.leases_len > REMOTE_NETWORK_DHCP_LEASES_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Number of leases is %d, which exceeds max limit: %d"), _("Number of leases is %1$d, which exceeds max limit: %2$d"),
ret.leases.leases_len, REMOTE_NETWORK_DHCP_LEASES_MAX); ret.leases.leases_len, REMOTE_NETWORK_DHCP_LEASES_MAX);
goto cleanup; goto cleanup;
} }
@ -7121,7 +7121,7 @@ remoteConnectGetAllDomainStats(virConnectPtr conn,
if (ret.retStats.retStats_len > REMOTE_DOMAIN_LIST_MAX) { if (ret.retStats.retStats_len > REMOTE_DOMAIN_LIST_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Number of stats entries is %d, which exceeds max limit: %d"), _("Number of stats entries is %1$d, which exceeds max limit: %2$d"),
ret.retStats.retStats_len, REMOTE_DOMAIN_LIST_MAX); ret.retStats.retStats_len, REMOTE_DOMAIN_LIST_MAX);
goto cleanup; goto cleanup;
} }
@ -7181,7 +7181,7 @@ remoteNodeAllocPages(virConnectPtr conn,
if (npages > REMOTE_NODE_MAX_CELLS) { if (npages > REMOTE_NODE_MAX_CELLS) {
virReportError(VIR_ERR_RPC, virReportError(VIR_ERR_RPC,
_("too many NUMA cells: %d > %d"), _("too many NUMA cells: %1$d > %2$d"),
npages, REMOTE_NODE_MAX_CELLS); npages, REMOTE_NODE_MAX_CELLS);
return -1; return -1;
} }
@ -7227,7 +7227,7 @@ remoteDomainGetFSInfo(virDomainPtr dom,
if (ret.info.info_len > REMOTE_DOMAIN_FSINFO_MAX) { if (ret.info.info_len > REMOTE_DOMAIN_FSINFO_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Too many mountpoints in fsinfo: %d for limit %d"), _("Too many mountpoints in fsinfo: %1$d for limit %2$d"),
ret.info.info_len, REMOTE_DOMAIN_FSINFO_MAX); ret.info.info_len, REMOTE_DOMAIN_FSINFO_MAX);
goto cleanup; goto cleanup;
} }
@ -7303,7 +7303,7 @@ remoteDomainInterfaceAddresses(virDomainPtr dom,
if (ret.ifaces.ifaces_len > REMOTE_DOMAIN_INTERFACE_MAX) { if (ret.ifaces.ifaces_len > REMOTE_DOMAIN_INTERFACE_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Number of interfaces, %d exceeds the max limit: %d"), _("Number of interfaces, %1$d exceeds the max limit: %2$d"),
ret.ifaces.ifaces_len, REMOTE_DOMAIN_INTERFACE_MAX); ret.ifaces.ifaces_len, REMOTE_DOMAIN_INTERFACE_MAX);
goto cleanup; goto cleanup;
} }
@ -7326,7 +7326,7 @@ remoteDomainInterfaceAddresses(virDomainPtr dom,
if (iface_ret->addrs.addrs_len > REMOTE_DOMAIN_IP_ADDR_MAX) { if (iface_ret->addrs.addrs_len > REMOTE_DOMAIN_IP_ADDR_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Number of interfaces, %d exceeds the max limit: %d"), _("Number of interfaces, %1$d exceeds the max limit: %2$d"),
iface_ret->addrs.addrs_len, REMOTE_DOMAIN_IP_ADDR_MAX); iface_ret->addrs.addrs_len, REMOTE_DOMAIN_IP_ADDR_MAX);
goto cleanup; goto cleanup;
} }

View File

@ -104,8 +104,7 @@ remoteSplitURIScheme(virURI *uri,
if (val == REMOTE_DRIVER_TRANSPORT_UNIX && if (val == REMOTE_DRIVER_TRANSPORT_UNIX &&
uri->server) { uri->server) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("using unix socket and remote " _("using unix socket and remote server '%1$s' is not supported."),
"server '%s' is not supported."),
uri->server); uri->server);
return -1; return -1;
} }
@ -393,7 +392,7 @@ remoteGetUNIXSocket(remoteDriverTransport transport,
case REMOTE_DRIVER_MODE_DIRECT: case REMOTE_DRIVER_MODE_DIRECT:
if (transport != REMOTE_DRIVER_TRANSPORT_UNIX) { if (transport != REMOTE_DRIVER_TRANSPORT_UNIX) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("Cannot use direct socket mode for %s transport"), _("Cannot use direct socket mode for %1$s transport"),
remoteDriverTransportTypeToString(transport)); remoteDriverTransportTypeToString(transport));
return NULL; return NULL;
} }

View File

@ -377,7 +377,7 @@ int main(int argc, char **argv)
"clients. Not intended to be called directly by the user."); "clients. Not intended to be called directly by the user.");
g_option_context_add_main_entries(context, entries, PACKAGE); g_option_context_add_main_entries(context, entries, PACKAGE);
if (!g_option_context_parse(context, &argc, &argv, &error)) { if (!g_option_context_parse(context, &argc, &argv, &error)) {
g_printerr(_("option parsing failed: %s\n"), error->message); g_printerr(_("option parsing failed: %1$s\n"), error->message);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@ -397,7 +397,7 @@ int main(int argc, char **argv)
if (virGettextInitialize() < 0 || if (virGettextInitialize() < 0 ||
virErrorInitialize() < 0) { virErrorInitialize() < 0) {
g_printerr(_("%s: initialization failed\n"), argv[0]); g_printerr(_("%1$s: initialization failed\n"), argv[0]);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@ -417,13 +417,13 @@ int main(int argc, char **argv)
} }
if (remoteSplitURIScheme(uri, &driver, &transport) < 0) { if (remoteSplitURIScheme(uri, &driver, &transport) < 0) {
g_printerr(_("%s: cannot parse URI transport '%s': %s\n"), g_printerr(_("%1$s: cannot parse URI transport '%2$s': %3$s\n"),
argv[0], uri_str, virGetLastErrorMessage()); argv[0], uri_str, virGetLastErrorMessage());
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (transport != REMOTE_DRIVER_TRANSPORT_UNIX) { if (transport != REMOTE_DRIVER_TRANSPORT_UNIX) {
g_printerr(_("%s: unexpected URI transport '%s'\n"), g_printerr(_("%1$s: unexpected URI transport '%2$s'\n"),
argv[0], uri_str); argv[0], uri_str);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@ -446,25 +446,25 @@ int main(int argc, char **argv)
if (mode_str && if (mode_str &&
(mode = remoteDriverModeTypeFromString(mode_str)) < 0) { (mode = remoteDriverModeTypeFromString(mode_str)) < 0) {
g_printerr(_("%s: unknown remote mode '%s'"), argv[0], mode_str); g_printerr(_("%1$s: unknown remote mode '%2$s'"), argv[0], mode_str);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (!sock_path && if (!sock_path &&
!(sock_path = remoteGetUNIXSocket(transport, mode, !(sock_path = remoteGetUNIXSocket(transport, mode,
driver, flags, &daemon_path))) { driver, flags, &daemon_path))) {
g_printerr(_("%s: failed to generate UNIX socket path"), argv[0]); g_printerr(_("%1$s: failed to generate UNIX socket path"), argv[0]);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (virNetSocketNewConnectUNIX(sock_path, daemon_path, &sock) < 0) { if (virNetSocketNewConnectUNIX(sock_path, daemon_path, &sock) < 0) {
g_printerr(_("%s: cannot connect to '%s': %s\n"), g_printerr(_("%1$s: cannot connect to '%2$s': %3$s\n"),
argv[0], sock_path, virGetLastErrorMessage()); argv[0], sock_path, virGetLastErrorMessage());
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (virRemoteSSHHelperRun(sock) < 0) { if (virRemoteSSHHelperRun(sock) < 0) {
g_printerr(_("%s: could not proxy traffic: %s\n"), g_printerr(_("%1$s: could not proxy traffic: %2$s\n"),
argv[0], virGetLastErrorMessage()); argv[0], virGetLastErrorMessage());
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }