提交 825f85ac 编写于 作者: M Matthias Bolte

Use common parameter order for remote(De)SerializeTypedParameters

We commonly use "value, length" order, let's stick to this.
上级 d6caacd1
...@@ -528,8 +528,8 @@ cleanup: ...@@ -528,8 +528,8 @@ cleanup:
static int static int
remoteSerializeTypedParameters(virTypedParameterPtr params, remoteSerializeTypedParameters(virTypedParameterPtr params,
int nparams, int nparams,
u_int *ret_params_len, remote_typed_param **ret_params_val,
remote_typed_param **ret_params_val) u_int *ret_params_len)
{ {
int i; int i;
int rv = -1; int rv = -1;
...@@ -590,8 +590,8 @@ cleanup: ...@@ -590,8 +590,8 @@ cleanup:
/* Helper to deserialize typed parameters. */ /* Helper to deserialize typed parameters. */
static virTypedParameterPtr static virTypedParameterPtr
remoteDeserializeTypedParameters(u_int args_params_len, remoteDeserializeTypedParameters(remote_typed_param *args_params_val,
remote_typed_param *args_params_val, u_int args_params_len,
int limit, int limit,
int *nparams) int *nparams)
{ {
...@@ -694,8 +694,8 @@ remoteDispatchDomainGetSchedulerParameters(struct qemud_server *server ATTRIBUTE ...@@ -694,8 +694,8 @@ remoteDispatchDomainGetSchedulerParameters(struct qemud_server *server ATTRIBUTE
goto cleanup; goto cleanup;
if (remoteSerializeTypedParameters(params, nparams, if (remoteSerializeTypedParameters(params, nparams,
&ret->params.params_len, &ret->params.params_val,
&ret->params.params_val) < 0) &ret->params.params_len) < 0)
goto cleanup; goto cleanup;
rv = 0; rv = 0;
...@@ -747,8 +747,8 @@ remoteDispatchDomainGetSchedulerParametersFlags(struct qemud_server *server ATTR ...@@ -747,8 +747,8 @@ remoteDispatchDomainGetSchedulerParametersFlags(struct qemud_server *server ATTR
goto cleanup; goto cleanup;
if (remoteSerializeTypedParameters(params, nparams, if (remoteSerializeTypedParameters(params, nparams,
&ret->params.params_len, &ret->params.params_val,
&ret->params.params_val) < 0) &ret->params.params_len) < 0)
goto cleanup; goto cleanup;
rv = 0; rv = 0;
...@@ -787,8 +787,8 @@ remoteDispatchDomainSetSchedulerParameters(struct qemud_server *server ATTRIBUTE ...@@ -787,8 +787,8 @@ remoteDispatchDomainSetSchedulerParameters(struct qemud_server *server ATTRIBUTE
nparams = args->params.params_len; nparams = args->params.params_len;
if ((params = remoteDeserializeTypedParameters(args->params.params_len, if ((params = remoteDeserializeTypedParameters(args->params.params_val,
args->params.params_val, args->params.params_len,
REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX, REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX,
&nparams)) == NULL) &nparams)) == NULL)
goto cleanup; goto cleanup;
...@@ -829,8 +829,8 @@ remoteDispatchDomainSetSchedulerParametersFlags(struct qemud_server *server ATTR ...@@ -829,8 +829,8 @@ remoteDispatchDomainSetSchedulerParametersFlags(struct qemud_server *server ATTR
goto cleanup; goto cleanup;
} }
if ((params = remoteDeserializeTypedParameters(args->params.params_len, if ((params = remoteDeserializeTypedParameters(args->params.params_val,
args->params.params_val, args->params.params_len,
REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX, REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX,
&nparams)) == NULL) &nparams)) == NULL)
goto cleanup; goto cleanup;
...@@ -1369,8 +1369,8 @@ remoteDispatchDomainSetMemoryParameters(struct qemud_server *server ...@@ -1369,8 +1369,8 @@ remoteDispatchDomainSetMemoryParameters(struct qemud_server *server
flags = args->flags; flags = args->flags;
if ((params = remoteDeserializeTypedParameters(args->params.params_len, if ((params = remoteDeserializeTypedParameters(args->params.params_val,
args->params.params_val, args->params.params_len,
REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX, REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX,
&nparams)) == NULL) &nparams)) == NULL)
goto cleanup; goto cleanup;
...@@ -1443,8 +1443,8 @@ remoteDispatchDomainGetMemoryParameters(struct qemud_server *server ...@@ -1443,8 +1443,8 @@ remoteDispatchDomainGetMemoryParameters(struct qemud_server *server
} }
if (remoteSerializeTypedParameters(params, nparams, if (remoteSerializeTypedParameters(params, nparams,
&ret->params.params_len, &ret->params.params_val,
&ret->params.params_val) < 0) &ret->params.params_len) < 0)
goto cleanup; goto cleanup;
success: success:
...@@ -1484,8 +1484,8 @@ remoteDispatchDomainSetBlkioParameters(struct qemud_server *server ...@@ -1484,8 +1484,8 @@ remoteDispatchDomainSetBlkioParameters(struct qemud_server *server
flags = args->flags; flags = args->flags;
if ((params = remoteDeserializeTypedParameters(args->params.params_len, if ((params = remoteDeserializeTypedParameters(args->params.params_val,
args->params.params_val, args->params.params_len,
REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX, REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX,
&nparams)) == NULL) &nparams)) == NULL)
goto cleanup; goto cleanup;
...@@ -1558,8 +1558,8 @@ remoteDispatchDomainGetBlkioParameters(struct qemud_server *server ...@@ -1558,8 +1558,8 @@ remoteDispatchDomainGetBlkioParameters(struct qemud_server *server
} }
if (remoteSerializeTypedParameters(params, nparams, if (remoteSerializeTypedParameters(params, nparams,
&ret->params.params_len, &ret->params.params_val,
&ret->params.params_val) < 0) &ret->params.params_len) < 0)
goto cleanup; goto cleanup;
success: success:
......
...@@ -1783,8 +1783,8 @@ done: ...@@ -1783,8 +1783,8 @@ done:
static int static int
remoteSerializeTypedParameters(virTypedParameterPtr params, remoteSerializeTypedParameters(virTypedParameterPtr params,
int nparams, int nparams,
u_int *args_params_len, remote_typed_param **args_params_val,
remote_typed_param **args_params_val) u_int *args_params_len)
{ {
int i; int i;
int rv = -1; int rv = -1;
...@@ -1845,8 +1845,8 @@ cleanup: ...@@ -1845,8 +1845,8 @@ cleanup:
/* Helper to deserialize typed parameters. */ /* Helper to deserialize typed parameters. */
static int static int
remoteDeserializeTypedParameters(u_int ret_params_len, remoteDeserializeTypedParameters(remote_typed_param *ret_params_val,
remote_typed_param *ret_params_val, u_int ret_params_len,
int limit, int limit,
virTypedParameterPtr params, virTypedParameterPtr params,
int *nparams) int *nparams)
...@@ -1928,8 +1928,8 @@ remoteDomainSetMemoryParameters (virDomainPtr domain, ...@@ -1928,8 +1928,8 @@ remoteDomainSetMemoryParameters (virDomainPtr domain,
args.flags = flags; args.flags = flags;
if (remoteSerializeTypedParameters(params, nparams, if (remoteSerializeTypedParameters(params, nparams,
&args.params.params_len, &args.params.params_val,
&args.params.params_val) < 0) { &args.params.params_len) < 0) {
xdr_free ((xdrproc_t) xdr_remote_domain_set_memory_parameters_args, xdr_free ((xdrproc_t) xdr_remote_domain_set_memory_parameters_args,
(char *) &args); (char *) &args);
goto done; goto done;
...@@ -1978,8 +1978,8 @@ remoteDomainGetMemoryParameters (virDomainPtr domain, ...@@ -1978,8 +1978,8 @@ remoteDomainGetMemoryParameters (virDomainPtr domain,
goto cleanup; goto cleanup;
} }
if (remoteDeserializeTypedParameters(ret.params.params_len, if (remoteDeserializeTypedParameters(ret.params.params_val,
ret.params.params_val, ret.params.params_len,
REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX, REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX,
params, params,
nparams) < 0) nparams) < 0)
...@@ -2012,8 +2012,8 @@ remoteDomainSetBlkioParameters (virDomainPtr domain, ...@@ -2012,8 +2012,8 @@ remoteDomainSetBlkioParameters (virDomainPtr domain,
args.flags = flags; args.flags = flags;
if (remoteSerializeTypedParameters(params, nparams, if (remoteSerializeTypedParameters(params, nparams,
&args.params.params_len, &args.params.params_val,
&args.params.params_val) < 0) { &args.params.params_len) < 0) {
xdr_free ((xdrproc_t) xdr_remote_domain_set_blkio_parameters_args, xdr_free ((xdrproc_t) xdr_remote_domain_set_blkio_parameters_args,
(char *) &args); (char *) &args);
goto done; goto done;
...@@ -2062,8 +2062,8 @@ remoteDomainGetBlkioParameters (virDomainPtr domain, ...@@ -2062,8 +2062,8 @@ remoteDomainGetBlkioParameters (virDomainPtr domain,
goto cleanup; goto cleanup;
} }
if (remoteDeserializeTypedParameters(ret.params.params_len, if (remoteDeserializeTypedParameters(ret.params.params_val,
ret.params.params_val, ret.params.params_len,
REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX, REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX,
params, params,
nparams) < 0) nparams) < 0)
...@@ -2450,8 +2450,8 @@ remoteDomainGetSchedulerParameters (virDomainPtr domain, ...@@ -2450,8 +2450,8 @@ remoteDomainGetSchedulerParameters (virDomainPtr domain,
(xdrproc_t) xdr_remote_domain_get_scheduler_parameters_ret, (char *) &ret) == -1) (xdrproc_t) xdr_remote_domain_get_scheduler_parameters_ret, (char *) &ret) == -1)
goto done; goto done;
if (remoteDeserializeTypedParameters(ret.params.params_len, if (remoteDeserializeTypedParameters(ret.params.params_val,
ret.params.params_val, ret.params.params_len,
REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX, REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX,
params, params,
nparams) < 0) nparams) < 0)
...@@ -2489,8 +2489,8 @@ remoteDomainGetSchedulerParametersFlags (virDomainPtr domain, ...@@ -2489,8 +2489,8 @@ remoteDomainGetSchedulerParametersFlags (virDomainPtr domain,
(xdrproc_t) xdr_remote_domain_get_scheduler_parameters_flags_ret, (char *) &ret) == -1) (xdrproc_t) xdr_remote_domain_get_scheduler_parameters_flags_ret, (char *) &ret) == -1)
goto done; goto done;
if (remoteDeserializeTypedParameters(ret.params.params_len, if (remoteDeserializeTypedParameters(ret.params.params_val,
ret.params.params_val, ret.params.params_len,
REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX, REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX,
params, params,
nparams) < 0) nparams) < 0)
...@@ -2518,8 +2518,8 @@ remoteDomainSetSchedulerParameters (virDomainPtr domain, ...@@ -2518,8 +2518,8 @@ remoteDomainSetSchedulerParameters (virDomainPtr domain,
make_nonnull_domain (&args.dom, domain); make_nonnull_domain (&args.dom, domain);
if (remoteSerializeTypedParameters(params, nparams, if (remoteSerializeTypedParameters(params, nparams,
&args.params.params_len, &args.params.params_val,
&args.params.params_val) < 0) { &args.params.params_len) < 0) {
xdr_free ((xdrproc_t) xdr_remote_domain_set_scheduler_parameters_args, xdr_free ((xdrproc_t) xdr_remote_domain_set_scheduler_parameters_args,
(char *) &args); (char *) &args);
goto done; goto done;
...@@ -2554,8 +2554,8 @@ remoteDomainSetSchedulerParametersFlags(virDomainPtr domain, ...@@ -2554,8 +2554,8 @@ remoteDomainSetSchedulerParametersFlags(virDomainPtr domain,
args.flags = flags; args.flags = flags;
if (remoteSerializeTypedParameters(params, nparams, if (remoteSerializeTypedParameters(params, nparams,
&args.params.params_len, &args.params.params_val,
&args.params.params_val) < 0) { &args.params.params_len) < 0) {
xdr_free ((xdrproc_t) xdr_remote_domain_set_scheduler_parameters_flags_args, xdr_free ((xdrproc_t) xdr_remote_domain_set_scheduler_parameters_flags_args,
(char *) &args); (char *) &args);
goto done; goto done;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册