remote-protocol: implement new BlkioParameters API

Remote protocol implementation of virDomainSetBlkioParameters and virDomainGetBlkioParameters.

Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
This commit is contained in:
Gui Jianfeng 2011-02-22 13:34:28 +08:00 committed by Eric Blake
parent 17e7556dcf
commit 5f4a48cbdf
10 changed files with 634 additions and 3 deletions

View File

@ -2619,6 +2619,216 @@ remoteDispatchDomainGetMemoryParameters(struct qemud_server *server
return -1;
}
static int
remoteDispatchDomainSetBlkioParameters(struct qemud_server *server
ATTRIBUTE_UNUSED,
struct qemud_client *client
ATTRIBUTE_UNUSED,
virConnectPtr conn,
remote_message_header *
hdr ATTRIBUTE_UNUSED,
remote_error * rerr,
remote_domain_set_blkio_parameters_args
* args, void *ret ATTRIBUTE_UNUSED)
{
virDomainPtr dom;
int i, r, nparams;
virBlkioParameterPtr params;
unsigned int flags;
nparams = args->params.params_len;
flags = args->flags;
if (nparams > REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX) {
remoteDispatchFormatError(rerr, "%s", _("nparams too large"));
return -1;
}
if (VIR_ALLOC_N(params, nparams) < 0) {
remoteDispatchOOMError(rerr);
return -1;
}
/* Deserialise parameters. */
for (i = 0; i < nparams; ++i) {
if (virStrcpyStatic
(params[i].field, args->params.params_val[i].field) == NULL) {
remoteDispatchFormatError(rerr,
_
("Field %s too big for destination"),
args->params.params_val[i].field);
return -1;
}
params[i].type = args->params.params_val[i].value.type;
switch (params[i].type) {
case VIR_DOMAIN_BLKIO_PARAM_INT:
params[i].value.i =
args->params.params_val[i].value.
remote_blkio_param_value_u.i;
break;
case VIR_DOMAIN_BLKIO_PARAM_UINT:
params[i].value.ui =
args->params.params_val[i].value.
remote_blkio_param_value_u.ui;
break;
case VIR_DOMAIN_BLKIO_PARAM_LLONG:
params[i].value.l =
args->params.params_val[i].value.
remote_blkio_param_value_u.l;
break;
case VIR_DOMAIN_BLKIO_PARAM_ULLONG:
params[i].value.ul =
args->params.params_val[i].value.
remote_blkio_param_value_u.ul;
break;
case VIR_DOMAIN_BLKIO_PARAM_DOUBLE:
params[i].value.d =
args->params.params_val[i].value.
remote_blkio_param_value_u.d;
break;
case VIR_DOMAIN_BLKIO_PARAM_BOOLEAN:
params[i].value.b =
args->params.params_val[i].value.
remote_blkio_param_value_u.b;
break;
}
}
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
VIR_FREE(params);
remoteDispatchConnError(rerr, conn);
return -1;
}
r = virDomainSetBlkioParameters(dom, params, nparams, flags);
virDomainFree(dom);
VIR_FREE(params);
if (r == -1) {
remoteDispatchConnError(rerr, conn);
return -1;
}
return 0;
}
static int
remoteDispatchDomainGetBlkioParameters(struct qemud_server *server
ATTRIBUTE_UNUSED,
struct qemud_client *client
ATTRIBUTE_UNUSED,
virConnectPtr conn,
remote_message_header *
hdr ATTRIBUTE_UNUSED,
remote_error * rerr,
remote_domain_get_blkio_parameters_args
* args,
remote_domain_get_blkio_parameters_ret
* ret)
{
virDomainPtr dom;
virBlkioParameterPtr params;
int i, r, nparams;
unsigned int flags;
nparams = args->nparams;
flags = args->flags;
if (nparams > REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX) {
remoteDispatchFormatError(rerr, "%s", _("nparams too large"));
return -1;
}
if (VIR_ALLOC_N(params, nparams) < 0) {
remoteDispatchOOMError(rerr);
return -1;
}
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
VIR_FREE(params);
remoteDispatchConnError(rerr, conn);
return -1;
}
r = virDomainGetBlkioParameters(dom, params, &nparams, flags);
if (r == -1) {
virDomainFree(dom);
VIR_FREE(params);
remoteDispatchConnError(rerr, conn);
return -1;
}
/* In this case, we need to send back the number of parameters
* supported
*/
if (args->nparams == 0) {
ret->nparams = nparams;
goto success;
}
/* Serialise the blkio parameters. */
ret->params.params_len = nparams;
if (VIR_ALLOC_N(ret->params.params_val, nparams) < 0)
goto oom;
for (i = 0; i < nparams; ++i) {
// remoteDispatchClientRequest will free this:
ret->params.params_val[i].field = strdup(params[i].field);
if (ret->params.params_val[i].field == NULL)
goto oom;
ret->params.params_val[i].value.type = params[i].type;
switch (params[i].type) {
case VIR_DOMAIN_BLKIO_PARAM_INT:
ret->params.params_val[i].
value.remote_blkio_param_value_u.i =
params[i].value.i;
break;
case VIR_DOMAIN_BLKIO_PARAM_UINT:
ret->params.params_val[i].
value.remote_blkio_param_value_u.ui =
params[i].value.ui;
break;
case VIR_DOMAIN_BLKIO_PARAM_LLONG:
ret->params.params_val[i].
value.remote_blkio_param_value_u.l =
params[i].value.l;
break;
case VIR_DOMAIN_BLKIO_PARAM_ULLONG:
ret->params.params_val[i].
value.remote_blkio_param_value_u.ul =
params[i].value.ul;
break;
case VIR_DOMAIN_BLKIO_PARAM_DOUBLE:
ret->params.params_val[i].
value.remote_blkio_param_value_u.d =
params[i].value.d;
break;
case VIR_DOMAIN_BLKIO_PARAM_BOOLEAN:
ret->params.params_val[i].
value.remote_blkio_param_value_u.b =
params[i].value.b;
break;
default:
remoteDispatchFormatError(rerr, "%s", _("unknown type"));
goto cleanup;
}
}
success:
virDomainFree(dom);
VIR_FREE(params);
return 0;
oom:
remoteDispatchOOMError(rerr);
cleanup:
virDomainFree(dom);
for (i = 0; i < nparams; i++)
VIR_FREE(ret->params.params_val[i].field);
VIR_FREE(params);
return -1;
}
static int
remoteDispatchDomainSetVcpus (struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,

View File

@ -173,3 +173,5 @@
remote_domain_is_updated_args val_remote_domain_is_updated_args;
remote_get_sysinfo_args val_remote_get_sysinfo_args;
remote_domain_set_memory_flags_args val_remote_domain_set_memory_flags_args;
remote_domain_set_blkio_parameters_args val_remote_domain_set_blkio_parameters_args;
remote_domain_get_blkio_parameters_args val_remote_domain_get_blkio_parameters_args;

View File

@ -218,6 +218,14 @@ static int remoteDispatchDomainGetAutostart(
remote_error *err,
remote_domain_get_autostart_args *args,
remote_domain_get_autostart_ret *ret);
static int remoteDispatchDomainGetBlkioParameters(
struct qemud_server *server,
struct qemud_client *client,
virConnectPtr conn,
remote_message_header *hdr,
remote_error *err,
remote_domain_get_blkio_parameters_args *args,
remote_domain_get_blkio_parameters_ret *ret);
static int remoteDispatchDomainGetBlockInfo(
struct qemud_server *server,
struct qemud_client *client,
@ -538,6 +546,14 @@ static int remoteDispatchDomainSetAutostart(
remote_error *err,
remote_domain_set_autostart_args *args,
void *ret);
static int remoteDispatchDomainSetBlkioParameters(
struct qemud_server *server,
struct qemud_client *client,
virConnectPtr conn,
remote_message_header *hdr,
remote_error *err,
remote_domain_set_blkio_parameters_args *args,
void *ret);
static int remoteDispatchDomainSetMaxMemory(
struct qemud_server *server,
struct qemud_client *client,

View File

@ -139,3 +139,4 @@
remote_domain_get_vcpus_flags_ret val_remote_domain_get_vcpus_flags_ret;
remote_domain_is_updated_ret val_remote_domain_is_updated_ret;
remote_get_sysinfo_ret val_remote_get_sysinfo_ret;
remote_domain_get_blkio_parameters_ret val_remote_domain_get_blkio_parameters_ret;

View File

@ -1027,3 +1027,13 @@
.args_filter = (xdrproc_t) xdr_remote_domain_set_memory_flags_args,
.ret_filter = (xdrproc_t) xdr_void,
},
{ /* DomainSetBlkioParameters => 205 */
.fn = (dispatch_fn) remoteDispatchDomainSetBlkioParameters,
.args_filter = (xdrproc_t) xdr_remote_domain_set_blkio_parameters_args,
.ret_filter = (xdrproc_t) xdr_void,
},
{ /* DomainGetBlkioParameters => 206 */
.fn = (dispatch_fn) remoteDispatchDomainGetBlkioParameters,
.args_filter = (xdrproc_t) xdr_remote_domain_get_blkio_parameters_args,
.ret_filter = (xdrproc_t) xdr_remote_domain_get_blkio_parameters_ret,
},

View File

@ -2646,6 +2646,175 @@ done:
return rv;
}
static int
remoteDomainSetBlkioParameters (virDomainPtr domain,
virBlkioParameterPtr params,
int nparams,
unsigned int flags)
{
int rv = -1;
remote_domain_set_blkio_parameters_args args;
int i, do_error;
struct private_data *priv = domain->conn->privateData;
remoteDriverLock(priv);
make_nonnull_domain (&args.dom, domain);
/* Serialise the blkio parameters. */
args.params.params_len = nparams;
args.flags = flags;
if (VIR_ALLOC_N(args.params.params_val, nparams) < 0) {
virReportOOMError();
goto done;
}
do_error = 0;
for (i = 0; i < nparams; ++i) {
// call() will free this:
args.params.params_val[i].field = strdup (params[i].field);
if (args.params.params_val[i].field == NULL) {
virReportOOMError();
do_error = 1;
}
args.params.params_val[i].value.type = params[i].type;
switch (params[i].type) {
case VIR_DOMAIN_BLKIO_PARAM_INT:
args.params.params_val[i].value.remote_blkio_param_value_u.i =
params[i].value.i; break;
case VIR_DOMAIN_BLKIO_PARAM_UINT:
args.params.params_val[i].value.remote_blkio_param_value_u.ui =
params[i].value.ui; break;
case VIR_DOMAIN_BLKIO_PARAM_LLONG:
args.params.params_val[i].value.remote_blkio_param_value_u.l =
params[i].value.l; break;
case VIR_DOMAIN_BLKIO_PARAM_ULLONG:
args.params.params_val[i].value.remote_blkio_param_value_u.ul =
params[i].value.ul; break;
case VIR_DOMAIN_BLKIO_PARAM_DOUBLE:
args.params.params_val[i].value.remote_blkio_param_value_u.d =
params[i].value.d; break;
case VIR_DOMAIN_BLKIO_PARAM_BOOLEAN:
args.params.params_val[i].value.remote_blkio_param_value_u.b =
params[i].value.b; break;
default:
remoteError(VIR_ERR_RPC, "%s", _("unknown parameter type"));
do_error = 1;
}
}
if (do_error) {
xdr_free ((xdrproc_t) xdr_remote_domain_set_blkio_parameters_args,
(char *) &args);
goto done;
}
if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_SET_BLKIO_PARAMETERS,
(xdrproc_t) xdr_remote_domain_set_blkio_parameters_args,
(char *) &args, (xdrproc_t) xdr_void, (char *) NULL) == -1)
goto done;
rv = 0;
done:
remoteDriverUnlock(priv);
return rv;
}
static int
remoteDomainGetBlkioParameters (virDomainPtr domain,
virBlkioParameterPtr params, int *nparams,
unsigned int flags)
{
int rv = -1;
remote_domain_get_blkio_parameters_args args;
remote_domain_get_blkio_parameters_ret ret;
int i = -1;
struct private_data *priv = domain->conn->privateData;
remoteDriverLock(priv);
make_nonnull_domain (&args.dom, domain);
args.nparams = *nparams;
args.flags = flags;
memset (&ret, 0, sizeof ret);
if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_BLKIO_PARAMETERS,
(xdrproc_t) xdr_remote_domain_get_blkio_parameters_args, (char *) &args,
(xdrproc_t) xdr_remote_domain_get_blkio_parameters_ret, (char *) &ret) == -1)
goto done;
/* Check the length of the returned list carefully. */
if (ret.params.params_len > REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX ||
ret.params.params_len > *nparams) {
remoteError(VIR_ERR_RPC, "%s",
_("remoteDomainGetBlkioParameters: "
"returned number of parameters exceeds limit"));
goto cleanup;
}
/* Handle the case when the caller does not know the number of parameters
* and is asking for the number of parameters supported
*/
if (*nparams == 0) {
*nparams = ret.nparams;
rv = 0;
goto cleanup;
}
*nparams = ret.params.params_len;
/* 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,
_("Parameter %s too big for destination"),
ret.params.params_val[i].field);
goto cleanup;
}
params[i].type = ret.params.params_val[i].value.type;
switch (params[i].type) {
case VIR_DOMAIN_BLKIO_PARAM_INT:
params[i].value.i =
ret.params.params_val[i].value.remote_blkio_param_value_u.i;
break;
case VIR_DOMAIN_BLKIO_PARAM_UINT:
params[i].value.ui =
ret.params.params_val[i].value.remote_blkio_param_value_u.ui;
break;
case VIR_DOMAIN_BLKIO_PARAM_LLONG:
params[i].value.l =
ret.params.params_val[i].value.remote_blkio_param_value_u.l;
break;
case VIR_DOMAIN_BLKIO_PARAM_ULLONG:
params[i].value.ul =
ret.params.params_val[i].value.remote_blkio_param_value_u.ul;
break;
case VIR_DOMAIN_BLKIO_PARAM_DOUBLE:
params[i].value.d =
ret.params.params_val[i].value.remote_blkio_param_value_u.d;
break;
case VIR_DOMAIN_BLKIO_PARAM_BOOLEAN:
params[i].value.b =
ret.params.params_val[i].value.remote_blkio_param_value_u.b;
break;
default:
remoteError(VIR_ERR_RPC, "%s",
_("remoteDomainGetBlkioParameters: "
"unknown parameter type"));
goto cleanup;
}
}
rv = 0;
cleanup:
xdr_free ((xdrproc_t) xdr_remote_domain_get_blkio_parameters_ret,
(char *) &ret);
done:
remoteDriverUnlock(priv);
return rv;
}
static int
remoteDomainGetInfo (virDomainPtr domain, virDomainInfoPtr info)
{
@ -10906,8 +11075,8 @@ static virDriver remote_driver = {
remoteDomainSetMemoryFlags, /* domainSetMemoryFlags */
remoteDomainSetMemoryParameters, /* domainSetMemoryParameters */
remoteDomainGetMemoryParameters, /* domainGetMemoryParameters */
NULL, /* domainSetBlkioParameters */
NULL, /* domainGetBlkioParameters */
remoteDomainSetBlkioParameters, /* domainSetBlkioParameters */
remoteDomainGetBlkioParameters, /* domainGetBlkioParameters */
remoteDomainGetInfo, /* domainGetInfo */
remoteDomainSave, /* domainSave */
remoteDomainRestore, /* domainRestore */

View File

@ -307,6 +307,53 @@ xdr_remote_sched_param (XDR *xdrs, remote_sched_param *objp)
return TRUE;
}
bool_t
xdr_remote_blkio_param_value (XDR *xdrs, remote_blkio_param_value *objp)
{
if (!xdr_int (xdrs, &objp->type))
return FALSE;
switch (objp->type) {
case VIR_DOMAIN_BLKIO_PARAM_INT:
return FALSE;
break;
case VIR_DOMAIN_BLKIO_PARAM_UINT:
if (!xdr_u_int (xdrs, &objp->remote_blkio_param_value_u.ui))
return FALSE;
break;
case VIR_DOMAIN_BLKIO_PARAM_LLONG:
if (!xdr_int64_t (xdrs, &objp->remote_blkio_param_value_u.l))
return FALSE;
break;
case VIR_DOMAIN_BLKIO_PARAM_ULLONG:
if (!xdr_uint64_t (xdrs, &objp->remote_blkio_param_value_u.ul))
return FALSE;
break;
case VIR_DOMAIN_BLKIO_PARAM_DOUBLE:
if (!xdr_double (xdrs, &objp->remote_blkio_param_value_u.d))
return FALSE;
break;
case VIR_DOMAIN_BLKIO_PARAM_BOOLEAN:
if (!xdr_int (xdrs, &objp->remote_blkio_param_value_u.b))
return FALSE;
break;
default:
return FALSE;
}
return TRUE;
}
bool_t
xdr_remote_blkio_param (XDR *xdrs, remote_blkio_param *objp)
{
if (!xdr_remote_nonnull_string (xdrs, &objp->field))
return FALSE;
if (!xdr_remote_blkio_param_value (xdrs, &objp->value))
return FALSE;
return TRUE;
}
bool_t
xdr_remote_memory_param_value (XDR *xdrs, remote_memory_param_value *objp)
{
@ -645,6 +692,47 @@ xdr_remote_domain_set_scheduler_parameters_args (XDR *xdrs, remote_domain_set_sc
return TRUE;
}
bool_t
xdr_remote_domain_set_blkio_parameters_args (XDR *xdrs, remote_domain_set_blkio_parameters_args *objp)
{
char **objp_cpp0 = (char **) (void *) &objp->params.params_val;
if (!xdr_remote_nonnull_domain (xdrs, &objp->dom))
return FALSE;
if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->params.params_len, REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX,
sizeof (remote_blkio_param), (xdrproc_t) xdr_remote_blkio_param))
return FALSE;
if (!xdr_u_int (xdrs, &objp->flags))
return FALSE;
return TRUE;
}
bool_t
xdr_remote_domain_get_blkio_parameters_args (XDR *xdrs, remote_domain_get_blkio_parameters_args *objp)
{
if (!xdr_remote_nonnull_domain (xdrs, &objp->dom))
return FALSE;
if (!xdr_int (xdrs, &objp->nparams))
return FALSE;
if (!xdr_u_int (xdrs, &objp->flags))
return FALSE;
return TRUE;
}
bool_t
xdr_remote_domain_get_blkio_parameters_ret (XDR *xdrs, remote_domain_get_blkio_parameters_ret *objp)
{
char **objp_cpp0 = (char **) (void *) &objp->params.params_val;
if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->params.params_len, REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX,
sizeof (remote_blkio_param), (xdrproc_t) xdr_remote_blkio_param))
return FALSE;
if (!xdr_int (xdrs, &objp->nparams))
return FALSE;
return TRUE;
}
bool_t
xdr_remote_domain_set_memory_parameters_args (XDR *xdrs, remote_domain_set_memory_parameters_args *objp)
{

View File

@ -53,6 +53,7 @@ typedef remote_nonnull_string *remote_string;
#define REMOTE_NODE_DEVICE_CAPS_LIST_MAX 16384
#define REMOTE_NWFILTER_NAME_LIST_MAX 1024
#define REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX 16
#define REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX 16
#define REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX 16
#define REMOTE_NODE_MAX_CELLS 1024
#define REMOTE_AUTH_SASL_DATA_MAX 65536
@ -187,6 +188,25 @@ struct remote_sched_param {
};
typedef struct remote_sched_param remote_sched_param;
struct remote_blkio_param_value {
int type;
union {
int i;
u_int ui;
int64_t l;
uint64_t ul;
double d;
int b;
} remote_blkio_param_value_u;
};
typedef struct remote_blkio_param_value remote_blkio_param_value;
struct remote_blkio_param {
remote_nonnull_string field;
remote_blkio_param_value value;
};
typedef struct remote_blkio_param remote_blkio_param;
struct remote_memory_param_value {
int type;
union {
@ -337,6 +357,32 @@ struct remote_domain_set_scheduler_parameters_args {
};
typedef struct remote_domain_set_scheduler_parameters_args remote_domain_set_scheduler_parameters_args;
struct remote_domain_set_blkio_parameters_args {
remote_nonnull_domain dom;
struct {
u_int params_len;
remote_blkio_param *params_val;
} params;
u_int flags;
};
typedef struct remote_domain_set_blkio_parameters_args remote_domain_set_blkio_parameters_args;
struct remote_domain_get_blkio_parameters_args {
remote_nonnull_domain dom;
int nparams;
u_int flags;
};
typedef struct remote_domain_get_blkio_parameters_args remote_domain_get_blkio_parameters_args;
struct remote_domain_get_blkio_parameters_ret {
struct {
u_int params_len;
remote_blkio_param *params_val;
} params;
int nparams;
};
typedef struct remote_domain_get_blkio_parameters_ret remote_domain_get_blkio_parameters_ret;
struct remote_domain_set_memory_parameters_args {
remote_nonnull_domain dom;
struct {
@ -2339,6 +2385,8 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_IS_UPDATED = 202,
REMOTE_PROC_GET_SYSINFO = 203,
REMOTE_PROC_DOMAIN_SET_MEMORY_FLAGS = 204,
REMOTE_PROC_DOMAIN_SET_BLKIO_PARAMETERS = 205,
REMOTE_PROC_DOMAIN_GET_BLKIO_PARAMETERS = 206,
};
typedef enum remote_procedure remote_procedure;
@ -2394,6 +2442,8 @@ extern bool_t xdr_remote_auth_type (XDR *, remote_auth_type*);
extern bool_t xdr_remote_vcpu_info (XDR *, remote_vcpu_info*);
extern bool_t xdr_remote_sched_param_value (XDR *, remote_sched_param_value*);
extern bool_t xdr_remote_sched_param (XDR *, remote_sched_param*);
extern bool_t xdr_remote_blkio_param_value (XDR *, remote_blkio_param_value*);
extern bool_t xdr_remote_blkio_param (XDR *, remote_blkio_param*);
extern bool_t xdr_remote_memory_param_value (XDR *, remote_memory_param_value*);
extern bool_t xdr_remote_memory_param (XDR *, remote_memory_param*);
extern bool_t xdr_remote_open_args (XDR *, remote_open_args*);
@ -2418,6 +2468,9 @@ extern bool_t xdr_remote_domain_get_scheduler_type_ret (XDR *, remote_domain_ge
extern bool_t xdr_remote_domain_get_scheduler_parameters_args (XDR *, remote_domain_get_scheduler_parameters_args*);
extern bool_t xdr_remote_domain_get_scheduler_parameters_ret (XDR *, remote_domain_get_scheduler_parameters_ret*);
extern bool_t xdr_remote_domain_set_scheduler_parameters_args (XDR *, remote_domain_set_scheduler_parameters_args*);
extern bool_t xdr_remote_domain_set_blkio_parameters_args (XDR *, remote_domain_set_blkio_parameters_args*);
extern bool_t xdr_remote_domain_get_blkio_parameters_args (XDR *, remote_domain_get_blkio_parameters_args*);
extern bool_t xdr_remote_domain_get_blkio_parameters_ret (XDR *, remote_domain_get_blkio_parameters_ret*);
extern bool_t xdr_remote_domain_set_memory_parameters_args (XDR *, remote_domain_set_memory_parameters_args*);
extern bool_t xdr_remote_domain_get_memory_parameters_args (XDR *, remote_domain_get_memory_parameters_args*);
extern bool_t xdr_remote_domain_get_memory_parameters_ret (XDR *, remote_domain_get_memory_parameters_ret*);
@ -2743,6 +2796,8 @@ extern bool_t xdr_remote_auth_type ();
extern bool_t xdr_remote_vcpu_info ();
extern bool_t xdr_remote_sched_param_value ();
extern bool_t xdr_remote_sched_param ();
extern bool_t xdr_remote_blkio_param_value ();
extern bool_t xdr_remote_blkio_param ();
extern bool_t xdr_remote_memory_param_value ();
extern bool_t xdr_remote_memory_param ();
extern bool_t xdr_remote_open_args ();
@ -2767,6 +2822,9 @@ extern bool_t xdr_remote_domain_get_scheduler_type_ret ();
extern bool_t xdr_remote_domain_get_scheduler_parameters_args ();
extern bool_t xdr_remote_domain_get_scheduler_parameters_ret ();
extern bool_t xdr_remote_domain_set_scheduler_parameters_args ();
extern bool_t xdr_remote_domain_set_blkio_parameters_args ();
extern bool_t xdr_remote_domain_get_blkio_parameters_args ();
extern bool_t xdr_remote_domain_get_blkio_parameters_ret ();
extern bool_t xdr_remote_domain_set_memory_parameters_args ();
extern bool_t xdr_remote_domain_get_memory_parameters_args ();
extern bool_t xdr_remote_domain_get_memory_parameters_ret ();

View File

@ -128,6 +128,9 @@ const REMOTE_NWFILTER_NAME_LIST_MAX = 1024;
/* Upper limit on list of scheduler parameters. */
const REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX = 16;
/* Upper limit on list of blkio parameters. */
const REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX = 16;
/* Upper limit on list of memory parameters. */
const REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX = 16;
@ -316,6 +319,26 @@ struct remote_sched_param {
remote_sched_param_value value;
};
union remote_blkio_param_value switch (int type) {
case VIR_DOMAIN_BLKIO_PARAM_INT:
int i;
case VIR_DOMAIN_BLKIO_PARAM_UINT:
unsigned int ui;
case VIR_DOMAIN_BLKIO_PARAM_LLONG:
hyper l;
case VIR_DOMAIN_BLKIO_PARAM_ULLONG:
unsigned hyper ul;
case VIR_DOMAIN_BLKIO_PARAM_DOUBLE:
double d;
case VIR_DOMAIN_BLKIO_PARAM_BOOLEAN:
int b;
};
struct remote_blkio_param {
remote_nonnull_string field;
remote_blkio_param_value value;
};
union remote_memory_param_value switch (int type) {
case VIR_DOMAIN_MEMORY_PARAM_INT:
int i;
@ -453,6 +476,23 @@ struct remote_domain_set_scheduler_parameters_args {
remote_sched_param params<REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX>;
};
struct remote_domain_set_blkio_parameters_args {
remote_nonnull_domain dom;
remote_blkio_param params<REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX>;
unsigned int flags;
};
struct remote_domain_get_blkio_parameters_args {
remote_nonnull_domain dom;
int nparams;
unsigned int flags;
};
struct remote_domain_get_blkio_parameters_ret {
remote_blkio_param params<REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX>;
int nparams;
};
struct remote_domain_set_memory_parameters_args {
remote_nonnull_domain dom;
remote_memory_param params<REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX>;
@ -2110,7 +2150,9 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_OPEN_CONSOLE = 201,
REMOTE_PROC_DOMAIN_IS_UPDATED = 202,
REMOTE_PROC_GET_SYSINFO = 203,
REMOTE_PROC_DOMAIN_SET_MEMORY_FLAGS = 204
REMOTE_PROC_DOMAIN_SET_MEMORY_FLAGS = 204,
REMOTE_PROC_DOMAIN_SET_BLKIO_PARAMETERS = 205,
REMOTE_PROC_DOMAIN_GET_BLKIO_PARAMETERS = 206
/*
* Notice how the entries are grouped in sets of 10 ?

View File

@ -70,6 +70,21 @@ struct remote_sched_param {
remote_nonnull_string field;
remote_sched_param_value value;
};
struct remote_blkio_param_value {
int type;
union {
int i;
u_int ui;
int64_t l;
uint64_t ul;
double d;
int b;
} remote_blkio_param_value_u;
};
struct remote_blkio_param {
remote_nonnull_string field;
remote_blkio_param_value value;
};
struct remote_memory_param_value {
int type;
union {
@ -172,6 +187,26 @@ struct remote_domain_set_scheduler_parameters_args {
remote_sched_param * params_val;
} params;
};
struct remote_domain_set_blkio_parameters_args {
remote_nonnull_domain dom;
struct {
u_int params_len;
remote_blkio_param * params_val;
} params;
u_int flags;
};
struct remote_domain_get_blkio_parameters_args {
remote_nonnull_domain dom;
int nparams;
u_int flags;
};
struct remote_domain_get_blkio_parameters_ret {
struct {
u_int params_len;
remote_blkio_param * params_val;
} params;
int nparams;
};
struct remote_domain_set_memory_parameters_args {
remote_nonnull_domain dom;
struct {