mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Replace use of remoteError with virReportError
Update the remote driver to use virReportError instead of the remoteError custom macro Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
1
cfg.mk
1
cfg.mk
@@ -516,7 +516,6 @@ msg_gen_function += lxcError
|
||||
msg_gen_function += libxlError
|
||||
msg_gen_function += nodeReportError
|
||||
msg_gen_function += regerror
|
||||
msg_gen_function += remoteError
|
||||
msg_gen_function += statsError
|
||||
msg_gen_function += streamsReportError
|
||||
msg_gen_function += vah_error
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
# define HYPER_TO_TYPE(_type, _to, _from) \
|
||||
do { \
|
||||
if ((_from) != (_type)(_from)) { \
|
||||
remoteError(VIR_ERR_INTERNAL_ERROR, \
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, \
|
||||
_("conversion from hyper to %s overflowed"), #_type); \
|
||||
goto done; \
|
||||
} \
|
||||
@@ -125,10 +125,6 @@ static int remoteAuthPolkit (virConnectPtr conn, struct private_data *priv,
|
||||
virConnectAuthPtr auth);
|
||||
#endif /* HAVE_POLKIT */
|
||||
|
||||
#define remoteError(code, ...) \
|
||||
virReportErrorHelper(VIR_FROM_REMOTE, code, __FILE__, \
|
||||
__FUNCTION__, __LINE__, __VA_ARGS__)
|
||||
|
||||
static virDomainPtr get_nonnull_domain (virConnectPtr conn, remote_nonnull_domain domain);
|
||||
static virNetworkPtr get_nonnull_network (virConnectPtr conn, remote_nonnull_network network);
|
||||
static virNWFilterPtr get_nonnull_nwfilter (virConnectPtr conn, remote_nonnull_nwfilter nwfilter);
|
||||
@@ -384,7 +380,7 @@ doRemoteOpen (virConnectPtr conn,
|
||||
transport = trans_tls;
|
||||
else if (STRCASEEQ (transport_str, "unix")) {
|
||||
if (conn->uri->server) {
|
||||
remoteError(VIR_ERR_INVALID_ARG,
|
||||
virReportError(VIR_ERR_INVALID_ARG,
|
||||
_("using unix socket and remote "
|
||||
"server '%s' is not supported."),
|
||||
conn->uri->server);
|
||||
@@ -399,7 +395,7 @@ doRemoteOpen (virConnectPtr conn,
|
||||
else if (STRCASEEQ (transport_str, "tcp"))
|
||||
transport = trans_tcp;
|
||||
else {
|
||||
remoteError(VIR_ERR_INVALID_ARG, "%s",
|
||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||
_("remote_open: transport in URL not recognised "
|
||||
"(should be tls|unix|ssh|ext|tcp)"));
|
||||
return VIR_DRV_OPEN_ERROR;
|
||||
@@ -551,7 +547,7 @@ doRemoteOpen (virConnectPtr conn,
|
||||
|
||||
/* For ext transport, command is required. */
|
||||
if (transport == trans_ext && !command) {
|
||||
remoteError(VIR_ERR_INVALID_ARG, "%s",
|
||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||
_("remote_open: for 'ext' transport, command is required"));
|
||||
goto failed;
|
||||
}
|
||||
@@ -608,7 +604,7 @@ doRemoteOpen (virConnectPtr conn,
|
||||
}
|
||||
|
||||
if (!(daemonPath = remoteFindDaemonPath())) {
|
||||
remoteError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("Unable to locate libvirtd daemon in $PATH"));
|
||||
goto failed;
|
||||
}
|
||||
@@ -663,7 +659,7 @@ doRemoteOpen (virConnectPtr conn,
|
||||
case trans_unix:
|
||||
case trans_ssh:
|
||||
case trans_ext:
|
||||
remoteError(VIR_ERR_INVALID_ARG, "%s",
|
||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||
_("transport methods unix, ssh and ext are not supported "
|
||||
"under Windows"));
|
||||
goto failed;
|
||||
@@ -785,7 +781,7 @@ remoteAllocPrivateData(void)
|
||||
}
|
||||
|
||||
if (virMutexInit(&priv->lock) < 0) {
|
||||
remoteError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("cannot initialize mutex"));
|
||||
VIR_FREE(priv);
|
||||
return NULL;
|
||||
@@ -1085,7 +1081,7 @@ remoteNodeGetCPUStats (virConnectPtr conn,
|
||||
/* Check the length of the returned list carefully. */
|
||||
if (ret.params.params_len > REMOTE_NODE_CPU_STATS_MAX ||
|
||||
ret.params.params_len > *nparams) {
|
||||
remoteError(VIR_ERR_RPC, "%s",
|
||||
virReportError(VIR_ERR_RPC, "%s",
|
||||
_("remoteNodeGetCPUStats: "
|
||||
"returned number of stats exceeds limit"));
|
||||
goto cleanup;
|
||||
@@ -1104,7 +1100,7 @@ remoteNodeGetCPUStats (virConnectPtr conn,
|
||||
/* Deserialise the result. */
|
||||
for (i = 0; i < *nparams; ++i) {
|
||||
if (virStrcpyStatic(params[i].field, ret.params.params_val[i].field) == NULL) {
|
||||
remoteError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Stats %s too big for destination"),
|
||||
ret.params.params_val[i].field);
|
||||
goto cleanup;
|
||||
@@ -1149,7 +1145,7 @@ remoteNodeGetMemoryStats (virConnectPtr conn,
|
||||
/* Check the length of the returned list carefully. */
|
||||
if (ret.params.params_len > REMOTE_NODE_MEMORY_STATS_MAX ||
|
||||
ret.params.params_len > *nparams) {
|
||||
remoteError(VIR_ERR_RPC, "%s",
|
||||
virReportError(VIR_ERR_RPC, "%s",
|
||||
_("remoteNodeGetMemoryStats: "
|
||||
"returned number of stats exceeds limit"));
|
||||
goto cleanup;
|
||||
@@ -1168,7 +1164,7 @@ remoteNodeGetMemoryStats (virConnectPtr conn,
|
||||
/* Deserialise the result. */
|
||||
for (i = 0; i < *nparams; ++i) {
|
||||
if (virStrcpyStatic(params[i].field, ret.params.params_val[i].field) == NULL) {
|
||||
remoteError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Stats %s too big for destination"),
|
||||
ret.params.params_val[i].field);
|
||||
goto cleanup;
|
||||
@@ -1201,7 +1197,7 @@ remoteNodeGetCellsFreeMemory(virConnectPtr conn,
|
||||
remoteDriverLock(priv);
|
||||
|
||||
if (maxCells > REMOTE_NODE_MAX_CELLS) {
|
||||
remoteError(VIR_ERR_RPC,
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("too many NUMA cells: %d > %d"),
|
||||
maxCells, REMOTE_NODE_MAX_CELLS);
|
||||
goto done;
|
||||
@@ -1240,7 +1236,7 @@ remoteListDomains (virConnectPtr conn, int *ids, int maxids)
|
||||
remoteDriverLock(priv);
|
||||
|
||||
if (maxids > REMOTE_DOMAIN_ID_LIST_MAX) {
|
||||
remoteError(VIR_ERR_RPC,
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("too many remote domain IDs: %d > %d"),
|
||||
maxids, REMOTE_DOMAIN_ID_LIST_MAX);
|
||||
goto done;
|
||||
@@ -1254,7 +1250,7 @@ remoteListDomains (virConnectPtr conn, int *ids, int maxids)
|
||||
goto done;
|
||||
|
||||
if (ret.ids.ids_len > maxids) {
|
||||
remoteError(VIR_ERR_RPC,
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("too many remote domain IDs: %d > %d"),
|
||||
ret.ids.ids_len, maxids);
|
||||
goto cleanup;
|
||||
@@ -1407,7 +1403,7 @@ remoteSerializeTypedParameters(virTypedParameterPtr params,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
remoteError(VIR_ERR_RPC, _("unknown parameter type: %d"),
|
||||
virReportError(VIR_ERR_RPC, _("unknown parameter type: %d"),
|
||||
params[i].type);
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -1435,7 +1431,7 @@ remoteDeserializeTypedParameters(remote_typed_param *ret_params_val,
|
||||
|
||||
/* Check the length of the returned list carefully. */
|
||||
if (ret_params_len > limit || ret_params_len > *nparams) {
|
||||
remoteError(VIR_ERR_RPC, "%s",
|
||||
virReportError(VIR_ERR_RPC, "%s",
|
||||
_("returned number of parameters exceeds limit"));
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -1446,7 +1442,7 @@ remoteDeserializeTypedParameters(remote_typed_param *ret_params_val,
|
||||
for (i = 0; i < ret_params_len; ++i) {
|
||||
if (virStrcpyStatic(params[i].field,
|
||||
ret_params_val[i].field) == NULL) {
|
||||
remoteError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Parameter %s too big for destination"),
|
||||
ret_params_val[i].field);
|
||||
goto cleanup;
|
||||
@@ -1486,7 +1482,7 @@ remoteDeserializeTypedParameters(remote_typed_param *ret_params_val,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
remoteError(VIR_ERR_RPC, _("unknown parameter type: %d"),
|
||||
virReportError(VIR_ERR_RPC, _("unknown parameter type: %d"),
|
||||
params[i].type);
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -1511,7 +1507,7 @@ remoteDeserializeDomainDiskErrors(remote_domain_disk_error *ret_errors_val,
|
||||
int j;
|
||||
|
||||
if (ret_errors_len > limit || ret_errors_len > maxerrors) {
|
||||
remoteError(VIR_ERR_RPC, "%s",
|
||||
virReportError(VIR_ERR_RPC, "%s",
|
||||
_("returned number of disk errors exceeds limit"));
|
||||
goto error;
|
||||
}
|
||||
@@ -1561,7 +1557,7 @@ remoteDomainBlockStatsFlags(virDomainPtr domain,
|
||||
/* Check the length of the returned list carefully. */
|
||||
if (ret.params.params_len > REMOTE_DOMAIN_BLOCK_STATS_PARAMETERS_MAX ||
|
||||
ret.params.params_len > *nparams) {
|
||||
remoteError(VIR_ERR_RPC, "%s",
|
||||
virReportError(VIR_ERR_RPC, "%s",
|
||||
_("remoteDomainBlockStatsFlags: "
|
||||
"returned number of stats exceeds limit"));
|
||||
goto cleanup;
|
||||
@@ -1756,7 +1752,7 @@ remoteDomainGetVcpuPinInfo (virDomainPtr domain,
|
||||
remoteDriverLock(priv);
|
||||
|
||||
if (ncpumaps > REMOTE_VCPUINFO_MAX) {
|
||||
remoteError(VIR_ERR_RPC,
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("vCPU count exceeds maximum: %d > %d"),
|
||||
ncpumaps, REMOTE_VCPUINFO_MAX);
|
||||
goto done;
|
||||
@@ -1764,7 +1760,7 @@ remoteDomainGetVcpuPinInfo (virDomainPtr domain,
|
||||
|
||||
if (INT_MULTIPLY_OVERFLOW(ncpumaps, maplen) ||
|
||||
ncpumaps * maplen > REMOTE_CPUMAPS_MAX) {
|
||||
remoteError(VIR_ERR_RPC,
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("vCPU map buffer length exceeds maximum: %d > %d"),
|
||||
ncpumaps * maplen, REMOTE_CPUMAPS_MAX);
|
||||
goto done;
|
||||
@@ -1785,14 +1781,14 @@ remoteDomainGetVcpuPinInfo (virDomainPtr domain,
|
||||
goto done;
|
||||
|
||||
if (ret.num > ncpumaps) {
|
||||
remoteError(VIR_ERR_RPC,
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("host reports too many vCPUs: %d > %d"),
|
||||
ret.num, ncpumaps);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (ret.cpumaps.cpumaps_len > ncpumaps * maplen) {
|
||||
remoteError(VIR_ERR_RPC,
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("host reports map buffer length exceeds maximum: %d > %d"),
|
||||
ret.cpumaps.cpumaps_len, ncpumaps * maplen);
|
||||
goto cleanup;
|
||||
@@ -1829,14 +1825,14 @@ remoteDomainGetVcpus (virDomainPtr domain,
|
||||
remoteDriverLock(priv);
|
||||
|
||||
if (maxinfo > REMOTE_VCPUINFO_MAX) {
|
||||
remoteError(VIR_ERR_RPC,
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("vCPU count exceeds maximum: %d > %d"),
|
||||
maxinfo, REMOTE_VCPUINFO_MAX);
|
||||
goto done;
|
||||
}
|
||||
if (INT_MULTIPLY_OVERFLOW(maxinfo, maplen) ||
|
||||
maxinfo * maplen > REMOTE_CPUMAPS_MAX) {
|
||||
remoteError(VIR_ERR_RPC,
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("vCPU map buffer length exceeds maximum: %d > %d"),
|
||||
maxinfo * maplen, REMOTE_CPUMAPS_MAX);
|
||||
goto done;
|
||||
@@ -1853,13 +1849,13 @@ remoteDomainGetVcpus (virDomainPtr domain,
|
||||
goto done;
|
||||
|
||||
if (ret.info.info_len > maxinfo) {
|
||||
remoteError(VIR_ERR_RPC,
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("host reports too many vCPUs: %d > %d"),
|
||||
ret.info.info_len, maxinfo);
|
||||
goto cleanup;
|
||||
}
|
||||
if (ret.cpumaps.cpumaps_len > maxinfo * maplen) {
|
||||
remoteError(VIR_ERR_RPC,
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("host reports map buffer length exceeds maximum: %d > %d"),
|
||||
ret.cpumaps.cpumaps_len, maxinfo * maplen);
|
||||
goto cleanup;
|
||||
@@ -1910,7 +1906,7 @@ remoteDomainGetSecurityLabel (virDomainPtr domain, virSecurityLabelPtr seclabel)
|
||||
|
||||
if (ret.label.label_val != NULL) {
|
||||
if (strlen (ret.label.label_val) >= sizeof(seclabel->label)) {
|
||||
remoteError(VIR_ERR_RPC, _("security label exceeds maximum: %zu"),
|
||||
virReportError(VIR_ERR_RPC, _("security label exceeds maximum: %zu"),
|
||||
sizeof(seclabel->label) - 1);
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -1981,7 +1977,7 @@ remoteNodeGetSecurityModel (virConnectPtr conn, virSecurityModelPtr secmodel)
|
||||
|
||||
if (ret.model.model_val != NULL) {
|
||||
if (strlen (ret.model.model_val) >= sizeof(secmodel->model)) {
|
||||
remoteError(VIR_ERR_RPC, _("security model exceeds maximum: %zu"),
|
||||
virReportError(VIR_ERR_RPC, _("security model exceeds maximum: %zu"),
|
||||
sizeof(secmodel->model) - 1);
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -1990,7 +1986,7 @@ remoteNodeGetSecurityModel (virConnectPtr conn, virSecurityModelPtr secmodel)
|
||||
|
||||
if (ret.doi.doi_val != NULL) {
|
||||
if (strlen (ret.doi.doi_val) >= sizeof(secmodel->doi)) {
|
||||
remoteError(VIR_ERR_RPC, _("security doi exceeds maximum: %zu"),
|
||||
virReportError(VIR_ERR_RPC, _("security doi exceeds maximum: %zu"),
|
||||
sizeof(secmodel->doi) - 1);
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -2076,7 +2072,7 @@ remoteDomainMigratePrepare2 (virConnectPtr dconn,
|
||||
|
||||
if (ret.cookie.cookie_len > 0) {
|
||||
if (!cookie || !cookielen) {
|
||||
remoteError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("caller ignores cookie or cookielen"));
|
||||
goto error;
|
||||
}
|
||||
@@ -2085,7 +2081,7 @@ remoteDomainMigratePrepare2 (virConnectPtr dconn,
|
||||
}
|
||||
if (ret.uri_out) {
|
||||
if (!uri_out) {
|
||||
remoteError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("caller ignores uri_out"));
|
||||
goto error;
|
||||
}
|
||||
@@ -2189,7 +2185,7 @@ remoteDomainMemoryStats (virDomainPtr domain,
|
||||
|
||||
make_nonnull_domain (&args.dom, domain);
|
||||
if (nr_stats > REMOTE_DOMAIN_MEMORY_STATS_MAX) {
|
||||
remoteError(VIR_ERR_RPC,
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("too many memory stats requested: %d > %d"), nr_stats,
|
||||
REMOTE_DOMAIN_MEMORY_STATS_MAX);
|
||||
goto done;
|
||||
@@ -2233,7 +2229,7 @@ remoteDomainBlockPeek (virDomainPtr domain,
|
||||
remoteDriverLock(priv);
|
||||
|
||||
if (size > REMOTE_DOMAIN_BLOCK_PEEK_BUFFER_MAX) {
|
||||
remoteError(VIR_ERR_RPC,
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("block peek request too large for remote protocol, %zi > %d"),
|
||||
size, REMOTE_DOMAIN_BLOCK_PEEK_BUFFER_MAX);
|
||||
goto done;
|
||||
@@ -2254,7 +2250,7 @@ remoteDomainBlockPeek (virDomainPtr domain,
|
||||
goto done;
|
||||
|
||||
if (ret.buffer.buffer_len != size) {
|
||||
remoteError(VIR_ERR_RPC, "%s",
|
||||
virReportError(VIR_ERR_RPC, "%s",
|
||||
_("returned buffer is not same size as requested"));
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -2285,7 +2281,7 @@ remoteDomainMemoryPeek (virDomainPtr domain,
|
||||
remoteDriverLock(priv);
|
||||
|
||||
if (size > REMOTE_DOMAIN_MEMORY_PEEK_BUFFER_MAX) {
|
||||
remoteError(VIR_ERR_RPC,
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("memory peek request too large for remote protocol, %zi > %d"),
|
||||
size, REMOTE_DOMAIN_MEMORY_PEEK_BUFFER_MAX);
|
||||
goto done;
|
||||
@@ -2305,7 +2301,7 @@ remoteDomainMemoryPeek (virDomainPtr domain,
|
||||
goto done;
|
||||
|
||||
if (ret.buffer.buffer_len != size) {
|
||||
remoteError(VIR_ERR_RPC, "%s",
|
||||
virReportError(VIR_ERR_RPC, "%s",
|
||||
_("returned buffer is not same size as requested"));
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -2430,13 +2426,13 @@ static int remoteDomainGetCPUStats(virDomainPtr domain,
|
||||
remoteDriverLock(priv);
|
||||
|
||||
if (nparams > REMOTE_NODE_CPU_STATS_MAX) {
|
||||
remoteError(VIR_ERR_RPC,
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("nparams count exceeds maximum: %u > %u"),
|
||||
nparams, REMOTE_NODE_CPU_STATS_MAX);
|
||||
goto done;
|
||||
}
|
||||
if (ncpus > REMOTE_DOMAIN_GET_CPU_STATS_NCPUS_MAX) {
|
||||
remoteError(VIR_ERR_RPC,
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("ncpus count exceeds maximum: %u > %u"),
|
||||
ncpus, REMOTE_DOMAIN_GET_CPU_STATS_NCPUS_MAX);
|
||||
goto done;
|
||||
@@ -2461,7 +2457,7 @@ static int remoteDomainGetCPUStats(virDomainPtr domain,
|
||||
if (ret.params.params_len > nparams * ncpus ||
|
||||
(ret.params.params_len &&
|
||||
((ret.params.params_len % ret.nparams) || ret.nparams > nparams))) {
|
||||
remoteError(VIR_ERR_RPC, "%s",
|
||||
virReportError(VIR_ERR_RPC, "%s",
|
||||
_("remoteDomainGetCPUStats: "
|
||||
"returned number of stats exceeds limit"));
|
||||
memset(params, 0, sizeof(*params) * nparams * ncpus);
|
||||
@@ -2797,7 +2793,7 @@ remoteAuthenticate (virConnectPtr conn, struct private_data *priv,
|
||||
} else if (STRCASEEQ(authtype, "polkit")) {
|
||||
want = REMOTE_AUTH_POLKIT;
|
||||
} else {
|
||||
remoteError(VIR_ERR_AUTH_FAILED,
|
||||
virReportError(VIR_ERR_AUTH_FAILED,
|
||||
_("unknown authentication type %s"), authtype);
|
||||
return -1;
|
||||
}
|
||||
@@ -2806,7 +2802,7 @@ remoteAuthenticate (virConnectPtr conn, struct private_data *priv,
|
||||
type = want;
|
||||
}
|
||||
if (type == REMOTE_AUTH_NONE) {
|
||||
remoteError(VIR_ERR_AUTH_FAILED,
|
||||
virReportError(VIR_ERR_AUTH_FAILED,
|
||||
_("requested authentication type %s rejected"),
|
||||
authtype);
|
||||
return -1;
|
||||
@@ -2845,7 +2841,7 @@ remoteAuthenticate (virConnectPtr conn, struct private_data *priv,
|
||||
break;
|
||||
|
||||
default:
|
||||
remoteError(VIR_ERR_AUTH_FAILED,
|
||||
virReportError(VIR_ERR_AUTH_FAILED,
|
||||
_("unsupported authentication type %d"),
|
||||
ret.types.types_val[0]);
|
||||
VIR_FREE(ret.types.types_val);
|
||||
@@ -3129,20 +3125,20 @@ static int remoteAuthInteract(virConnectPtr conn,
|
||||
goto cleanup;
|
||||
|
||||
if (remoteAuthMakeCredentials(state->interact, &state->cred, &state->ncred) < 0) {
|
||||
remoteError(VIR_ERR_AUTH_FAILED, "%s",
|
||||
virReportError(VIR_ERR_AUTH_FAILED, "%s",
|
||||
_("Failed to make auth credentials"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Run the authentication callback */
|
||||
if (!auth || !auth->cb) {
|
||||
remoteError(VIR_ERR_AUTH_FAILED, "%s",
|
||||
virReportError(VIR_ERR_AUTH_FAILED, "%s",
|
||||
_("No authentication callback available"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if ((*(auth->cb))(state->cred, state->ncred, auth->cbdata) < 0) {
|
||||
remoteError(VIR_ERR_AUTH_FAILED, "%s",
|
||||
virReportError(VIR_ERR_AUTH_FAILED, "%s",
|
||||
_("Failed to collect auth credentials"));
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -3241,7 +3237,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv,
|
||||
mechlist = iret.mechlist;
|
||||
if (wantmech) {
|
||||
if (strstr(mechlist, wantmech) == NULL) {
|
||||
remoteError(VIR_ERR_AUTH_FAILED,
|
||||
virReportError(VIR_ERR_AUTH_FAILED,
|
||||
_("SASL mechanism %s not supported by server"),
|
||||
wantmech);
|
||||
VIR_FREE(iret.mechlist);
|
||||
@@ -3271,7 +3267,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv,
|
||||
VIR_FREE(iret.mechlist);
|
||||
|
||||
if (clientoutlen > REMOTE_AUTH_SASL_DATA_MAX) {
|
||||
remoteError(VIR_ERR_AUTH_FAILED,
|
||||
virReportError(VIR_ERR_AUTH_FAILED,
|
||||
_("SASL negotiation data too long: %zu bytes"),
|
||||
clientoutlen);
|
||||
goto cleanup;
|
||||
@@ -3366,7 +3362,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv,
|
||||
|
||||
VIR_DEBUG("SASL SSF value %d", ssf);
|
||||
if (ssf < 56) { /* 56 == DES level, good for Kerberos */
|
||||
remoteError(VIR_ERR_AUTH_FAILED,
|
||||
virReportError(VIR_ERR_AUTH_FAILED,
|
||||
_("negotiation SSF %d was not strong enough"), ssf);
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -3447,7 +3443,7 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv,
|
||||
VIR_DEBUG("Client run callback for PolicyKit authentication");
|
||||
/* Run the authentication callback */
|
||||
if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0) {
|
||||
remoteError(VIR_ERR_AUTH_FAILED, "%s",
|
||||
virReportError(VIR_ERR_AUTH_FAILED, "%s",
|
||||
_("Failed to collect auth credentials"));
|
||||
return -1;
|
||||
}
|
||||
@@ -3488,7 +3484,7 @@ static int remoteDomainEventRegister(virConnectPtr conn,
|
||||
|
||||
if ((count = virDomainEventStateRegister(conn, priv->domainEventState,
|
||||
callback, opaque, freecb)) < 0) {
|
||||
remoteError(VIR_ERR_RPC, "%s", _("adding cb to list"));
|
||||
virReportError(VIR_ERR_RPC, "%s", _("adding cb to list"));
|
||||
goto done;
|
||||
}
|
||||
|
||||
@@ -3946,7 +3942,7 @@ remoteSecretGetValue (virSecretPtr secret, size_t *value_size,
|
||||
|
||||
/* internalFlags intentionally do not go over the wire */
|
||||
if (internalFlags) {
|
||||
remoteError(VIR_ERR_INTERNAL_ERROR, "%s", _("no internalFlags support"));
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("no internalFlags support"));
|
||||
goto done;
|
||||
}
|
||||
|
||||
@@ -4231,7 +4227,7 @@ static int remoteDomainEventRegisterAny(virConnectPtr conn,
|
||||
dom, eventID,
|
||||
callback, opaque, freecb,
|
||||
&callbackID)) < 0) {
|
||||
remoteError(VIR_ERR_RPC, "%s", _("adding cb to list"));
|
||||
virReportError(VIR_ERR_RPC, "%s", _("adding cb to list"));
|
||||
goto done;
|
||||
}
|
||||
|
||||
@@ -4272,14 +4268,14 @@ static int remoteDomainEventDeregisterAny(virConnectPtr conn,
|
||||
if ((eventID = virDomainEventStateEventID(conn,
|
||||
priv->domainEventState,
|
||||
callbackID)) < 0) {
|
||||
remoteError(VIR_ERR_RPC, _("unable to find callback ID %d"), callbackID);
|
||||
virReportError(VIR_ERR_RPC, _("unable to find callback ID %d"), callbackID);
|
||||
goto done;
|
||||
}
|
||||
|
||||
if ((count = virDomainEventStateDeregisterID(conn,
|
||||
priv->domainEventState,
|
||||
callbackID)) < 0) {
|
||||
remoteError(VIR_ERR_RPC, _("unable to find callback ID %d"), callbackID);
|
||||
virReportError(VIR_ERR_RPC, _("unable to find callback ID %d"), callbackID);
|
||||
goto done;
|
||||
}
|
||||
|
||||
@@ -4374,7 +4370,7 @@ remoteDomainMigrateBegin3(virDomainPtr domain,
|
||||
|
||||
if (ret.cookie_out.cookie_out_len > 0) {
|
||||
if (!cookieout || !cookieoutlen) {
|
||||
remoteError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("caller ignores cookieout or cookieoutlen"));
|
||||
goto error;
|
||||
}
|
||||
@@ -4433,7 +4429,7 @@ remoteDomainMigratePrepare3(virConnectPtr dconn,
|
||||
|
||||
if (ret.cookie_out.cookie_out_len > 0) {
|
||||
if (!cookieout || !cookieoutlen) {
|
||||
remoteError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("caller ignores cookieout or cookieoutlen"));
|
||||
goto error;
|
||||
}
|
||||
@@ -4442,7 +4438,7 @@ remoteDomainMigratePrepare3(virConnectPtr dconn,
|
||||
}
|
||||
if (ret.uri_out) {
|
||||
if (!uri_out) {
|
||||
remoteError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("caller ignores uri_out"));
|
||||
goto error;
|
||||
}
|
||||
@@ -4516,7 +4512,7 @@ remoteDomainMigratePrepareTunnel3(virConnectPtr dconn,
|
||||
|
||||
if (ret.cookie_out.cookie_out_len > 0) {
|
||||
if (!cookieout || !cookieoutlen) {
|
||||
remoteError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("caller ignores cookieout or cookieoutlen"));
|
||||
goto error;
|
||||
}
|
||||
@@ -4577,7 +4573,7 @@ remoteDomainMigratePerform3(virDomainPtr dom,
|
||||
|
||||
if (ret.cookie_out.cookie_out_len > 0) {
|
||||
if (!cookieout || !cookieoutlen) {
|
||||
remoteError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("caller ignores cookieout or cookieoutlen"));
|
||||
goto error;
|
||||
}
|
||||
@@ -4636,7 +4632,7 @@ remoteDomainMigrateFinish3(virConnectPtr dconn,
|
||||
|
||||
if (ret.cookie_out.cookie_out_len > 0) {
|
||||
if (!cookieout || !cookieoutlen) {
|
||||
remoteError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("caller ignores cookieout or cookieoutlen"));
|
||||
goto error;
|
||||
}
|
||||
@@ -4730,7 +4726,7 @@ remoteSetKeepAlive(virConnectPtr conn, int interval, unsigned int count)
|
||||
|
||||
remoteDriverLock(priv);
|
||||
if (!virNetClientKeepAliveIsSupported(priv->client)) {
|
||||
remoteError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("the caller doesn't support keepalive protocol;"
|
||||
" perhaps it's missing event loop implementation"));
|
||||
goto cleanup;
|
||||
|
||||
@@ -1424,7 +1424,7 @@ elsif ($opt_k) {
|
||||
foreach my $args_check (@args_check_list) {
|
||||
print "\n";
|
||||
print " if ($args_check->{arg} > $args_check->{limit}) {\n";
|
||||
print " remoteError(VIR_ERR_RPC,\n";
|
||||
print " virReportError(VIR_ERR_RPC,\n";
|
||||
print " _(\"%s length greater than maximum: %d > %d\"),\n";
|
||||
print " $args_check->{name}, (int)$args_check->{arg}, $args_check->{limit});\n";
|
||||
print " goto done;\n";
|
||||
@@ -1434,7 +1434,7 @@ elsif ($opt_k) {
|
||||
if ($single_ret_as_list) {
|
||||
print "\n";
|
||||
print " if ($single_ret_list_max_var > $single_ret_list_max_define) {\n";
|
||||
print " remoteError(VIR_ERR_RPC,\n";
|
||||
print " virReportError(VIR_ERR_RPC,\n";
|
||||
print " _(\"too many remote ${single_ret_list_error_msg_type}s: %d > %d\"),\n";
|
||||
print " $single_ret_list_max_var, $single_ret_list_max_define);\n";
|
||||
print " goto done;\n";
|
||||
@@ -1491,7 +1491,7 @@ elsif ($opt_k) {
|
||||
|
||||
if ($single_ret_as_list) {
|
||||
print " if (ret.$single_ret_list_name.${single_ret_list_name}_len > $single_ret_list_max_var) {\n";
|
||||
print " remoteError(VIR_ERR_RPC,\n";
|
||||
print " virReportError(VIR_ERR_RPC,\n";
|
||||
print " _(\"too many remote ${single_ret_list_error_msg_type}s: %d > %d\"),\n";
|
||||
print " ret.$single_ret_list_name.${single_ret_list_name}_len, $single_ret_list_max_var);\n";
|
||||
print " goto cleanup;\n";
|
||||
|
||||
Reference in New Issue
Block a user