1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

Remote protocol implementation of virDomainSet/GetMemoryParameters

This commit is contained in:
Nikunj A. Dadhania 2010-10-12 19:23:04 +02:00 committed by Daniel Veillard
parent e3e2ca77ee
commit f928f43b7b
9 changed files with 598 additions and 3 deletions

View File

@ -2331,6 +2331,216 @@ remoteDispatchDomainSetMemory (struct qemud_server *server ATTRIBUTE_UNUSED,
return 0;
}
static int
remoteDispatchDomainSetMemoryParameters(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_memory_parameters_args
* args, void *ret ATTRIBUTE_UNUSED)
{
virDomainPtr dom;
int i, r, nparams;
virMemoryParameterPtr params;
unsigned int flags;
nparams = args->params.params_len;
flags = args->flags;
if (nparams > REMOTE_DOMAIN_MEMORY_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_MEMORY_PARAM_INT:
params[i].value.i =
args->params.params_val[i].value.
remote_memory_param_value_u.i;
break;
case VIR_DOMAIN_MEMORY_PARAM_UINT:
params[i].value.ui =
args->params.params_val[i].value.
remote_memory_param_value_u.ui;
break;
case VIR_DOMAIN_MEMORY_PARAM_LLONG:
params[i].value.l =
args->params.params_val[i].value.
remote_memory_param_value_u.l;
break;
case VIR_DOMAIN_MEMORY_PARAM_ULLONG:
params[i].value.ul =
args->params.params_val[i].value.
remote_memory_param_value_u.ul;
break;
case VIR_DOMAIN_MEMORY_PARAM_DOUBLE:
params[i].value.d =
args->params.params_val[i].value.
remote_memory_param_value_u.d;
break;
case VIR_DOMAIN_MEMORY_PARAM_BOOLEAN:
params[i].value.b =
args->params.params_val[i].value.
remote_memory_param_value_u.b;
break;
}
}
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
VIR_FREE(params);
remoteDispatchConnError(rerr, conn);
return -1;
}
r = virDomainSetMemoryParameters(dom, params, nparams, flags);
virDomainFree(dom);
VIR_FREE(params);
if (r == -1) {
remoteDispatchConnError(rerr, conn);
return -1;
}
return 0;
}
static int
remoteDispatchDomainGetMemoryParameters(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_memory_parameters_args
* args,
remote_domain_get_memory_parameters_ret
* ret)
{
virDomainPtr dom;
virMemoryParameterPtr params;
int i, r, nparams;
unsigned int flags;
nparams = args->nparams;
flags = args->flags;
if (nparams > REMOTE_DOMAIN_MEMORY_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 = virDomainGetMemoryParameters(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 memory 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_MEMORY_PARAM_INT:
ret->params.params_val[i].
value.remote_memory_param_value_u.i =
params[i].value.i;
break;
case VIR_DOMAIN_MEMORY_PARAM_UINT:
ret->params.params_val[i].
value.remote_memory_param_value_u.ui =
params[i].value.ui;
break;
case VIR_DOMAIN_MEMORY_PARAM_LLONG:
ret->params.params_val[i].
value.remote_memory_param_value_u.l =
params[i].value.l;
break;
case VIR_DOMAIN_MEMORY_PARAM_ULLONG:
ret->params.params_val[i].
value.remote_memory_param_value_u.ul =
params[i].value.ul;
break;
case VIR_DOMAIN_MEMORY_PARAM_DOUBLE:
ret->params.params_val[i].
value.remote_memory_param_value_u.d =
params[i].value.d;
break;
case VIR_DOMAIN_MEMORY_PARAM_BOOLEAN:
ret->params.params_val[i].
value.remote_memory_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

@ -165,3 +165,5 @@
remote_domain_snapshot_delete_args val_remote_domain_snapshot_delete_args;
remote_domain_get_block_info_args val_remote_domain_get_block_info_args;
remote_domain_create_with_flags_args val_remote_domain_create_with_flags_args;
remote_domain_set_memory_parameters_args val_remote_domain_set_memory_parameters_args;
remote_domain_get_memory_parameters_args val_remote_domain_get_memory_parameters_args;

View File

@ -258,6 +258,14 @@ static int remoteDispatchDomainGetMaxVcpus(
remote_error *err,
remote_domain_get_max_vcpus_args *args,
remote_domain_get_max_vcpus_ret *ret);
static int remoteDispatchDomainGetMemoryParameters(
struct qemud_server *server,
struct qemud_client *client,
virConnectPtr conn,
remote_message_header *hdr,
remote_error *err,
remote_domain_get_memory_parameters_args *args,
remote_domain_get_memory_parameters_ret *ret);
static int remoteDispatchDomainGetOsType(
struct qemud_server *server,
struct qemud_client *client,
@ -522,6 +530,14 @@ static int remoteDispatchDomainSetMemory(
remote_error *err,
remote_domain_set_memory_args *args,
void *ret);
static int remoteDispatchDomainSetMemoryParameters(
struct qemud_server *server,
struct qemud_client *client,
virConnectPtr conn,
remote_message_header *hdr,
remote_error *err,
remote_domain_set_memory_parameters_args *args,
void *ret);
static int remoteDispatchDomainSetSchedulerParameters(
struct qemud_server *server,
struct qemud_client *client,

View File

@ -135,3 +135,4 @@
remote_domain_snapshot_current_ret val_remote_domain_snapshot_current_ret;
remote_domain_get_block_info_ret val_remote_domain_get_block_info_ret;
remote_domain_create_with_flags_ret val_remote_domain_create_with_flags_ret;
remote_domain_get_memory_parameters_ret val_remote_domain_get_memory_parameters_ret;

View File

@ -987,3 +987,13 @@
.args_filter = (xdrproc_t) xdr_remote_domain_create_with_flags_args,
.ret_filter = (xdrproc_t) xdr_remote_domain_create_with_flags_ret,
},
{ /* DomainSetMemoryParameters => 197 */
.fn = (dispatch_fn) remoteDispatchDomainSetMemoryParameters,
.args_filter = (xdrproc_t) xdr_remote_domain_set_memory_parameters_args,
.ret_filter = (xdrproc_t) xdr_void,
},
{ /* DomainGetMemoryParameters => 198 */
.fn = (dispatch_fn) remoteDispatchDomainGetMemoryParameters,
.args_filter = (xdrproc_t) xdr_remote_domain_get_memory_parameters_args,
.ret_filter = (xdrproc_t) xdr_remote_domain_get_memory_parameters_ret,
},

View File

@ -2283,6 +2283,175 @@ done:
return rv;
}
static int
remoteDomainSetMemoryParameters (virDomainPtr domain,
virMemoryParameterPtr params,
int nparams,
unsigned int flags)
{
int rv = -1;
remote_domain_set_memory_parameters_args args;
int i, do_error;
struct private_data *priv = domain->conn->privateData;
remoteDriverLock(priv);
make_nonnull_domain (&args.dom, domain);
/* Serialise the memory 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_MEMORY_PARAM_INT:
args.params.params_val[i].value.remote_memory_param_value_u.i =
params[i].value.i; break;
case VIR_DOMAIN_MEMORY_PARAM_UINT:
args.params.params_val[i].value.remote_memory_param_value_u.ui =
params[i].value.ui; break;
case VIR_DOMAIN_MEMORY_PARAM_LLONG:
args.params.params_val[i].value.remote_memory_param_value_u.l =
params[i].value.l; break;
case VIR_DOMAIN_MEMORY_PARAM_ULLONG:
args.params.params_val[i].value.remote_memory_param_value_u.ul =
params[i].value.ul; break;
case VIR_DOMAIN_MEMORY_PARAM_DOUBLE:
args.params.params_val[i].value.remote_memory_param_value_u.d =
params[i].value.d; break;
case VIR_DOMAIN_MEMORY_PARAM_BOOLEAN:
args.params.params_val[i].value.remote_memory_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_memory_parameters_args,
(char *) &args);
goto done;
}
if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_SET_MEMORY_PARAMETERS,
(xdrproc_t) xdr_remote_domain_set_memory_parameters_args,
(char *) &args, (xdrproc_t) xdr_void, (char *) NULL) == -1)
goto done;
rv = 0;
done:
remoteDriverUnlock(priv);
return rv;
}
static int
remoteDomainGetMemoryParameters (virDomainPtr domain,
virMemoryParameterPtr params, int *nparams,
unsigned int flags)
{
int rv = -1;
remote_domain_get_memory_parameters_args args;
remote_domain_get_memory_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_MEMORY_PARAMETERS,
(xdrproc_t) xdr_remote_domain_get_memory_parameters_args, (char *) &args,
(xdrproc_t) xdr_remote_domain_get_memory_parameters_ret, (char *) &ret) == -1)
goto done;
/* Check the length of the returned list carefully. */
if (ret.params.params_len > REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX ||
ret.params.params_len > *nparams) {
remoteError(VIR_ERR_RPC, "%s",
_("remoteDomainGetMemoryParameters: "
"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_MEMORY_PARAM_INT:
params[i].value.i =
ret.params.params_val[i].value.remote_memory_param_value_u.i;
break;
case VIR_DOMAIN_MEMORY_PARAM_UINT:
params[i].value.ui =
ret.params.params_val[i].value.remote_memory_param_value_u.ui;
break;
case VIR_DOMAIN_MEMORY_PARAM_LLONG:
params[i].value.l =
ret.params.params_val[i].value.remote_memory_param_value_u.l;
break;
case VIR_DOMAIN_MEMORY_PARAM_ULLONG:
params[i].value.ul =
ret.params.params_val[i].value.remote_memory_param_value_u.ul;
break;
case VIR_DOMAIN_MEMORY_PARAM_DOUBLE:
params[i].value.d =
ret.params.params_val[i].value.remote_memory_param_value_u.d;
break;
case VIR_DOMAIN_MEMORY_PARAM_BOOLEAN:
params[i].value.b =
ret.params.params_val[i].value.remote_memory_param_value_u.b;
break;
default:
remoteError(VIR_ERR_RPC, "%s",
_("remoteDomainGetMemoryParameters: "
"unknown parameter type"));
goto cleanup;
}
}
rv = 0;
cleanup:
xdr_free ((xdrproc_t) xdr_remote_domain_get_memory_parameters_ret,
(char *) &ret);
done:
remoteDriverUnlock(priv);
return rv;
}
static int
remoteDomainGetInfo (virDomainPtr domain, virDomainInfoPtr info)
{
@ -10366,8 +10535,8 @@ static virDriver remote_driver = {
remoteDomainRevertToSnapshot, /* domainRevertToSnapshot */
remoteDomainSnapshotDelete, /* domainSnapshotDelete */
remoteQemuDomainMonitorCommand, /* qemuDomainMonitorCommand */
NULL, /* domainSetMemoryParameters */
NULL, /* domainGetMemoryParameters */
remoteDomainSetMemoryParameters, /* domainSetMemoryParameters */
remoteDomainGetMemoryParameters, /* domainGetMemoryParameters */
};
static virNetworkDriver network_driver = {

View File

@ -307,6 +307,52 @@ xdr_remote_sched_param (XDR *xdrs, remote_sched_param *objp)
return TRUE;
}
bool_t
xdr_remote_memory_param_value(XDR * xdrs, remote_memory_param_value * objp)
{
if (!xdr_int(xdrs, &objp->type))
return FALSE;
switch (objp->type) {
case VIR_DOMAIN_MEMORY_PARAM_INT:
return FALSE;
case VIR_DOMAIN_MEMORY_PARAM_UINT:
if (!xdr_u_int(xdrs, &objp->remote_memory_param_value_u.ui))
return FALSE;
break;
case VIR_DOMAIN_MEMORY_PARAM_LLONG:
if (!xdr_int64_t(xdrs, &objp->remote_memory_param_value_u.l))
return FALSE;
break;
case VIR_DOMAIN_MEMORY_PARAM_ULLONG:
if (!xdr_uint64_t(xdrs, &objp->remote_memory_param_value_u.ul))
return FALSE;
break;
case VIR_DOMAIN_MEMORY_PARAM_DOUBLE:
if (!xdr_double(xdrs, &objp->remote_memory_param_value_u.d))
return FALSE;
break;
case VIR_DOMAIN_MEMORY_PARAM_BOOLEAN:
if (!xdr_int(xdrs, &objp->remote_memory_param_value_u.b))
return FALSE;
break;
default:
return FALSE;
}
return TRUE;
}
bool_t
xdr_remote_memory_param (XDR *xdrs, remote_memory_param *objp)
{
if (!xdr_remote_nonnull_string (xdrs, &objp->field))
return FALSE;
if (!xdr_remote_memory_param_value (xdrs, &objp->value))
return FALSE;
return TRUE;
}
bool_t
xdr_remote_open_args (XDR *xdrs, remote_open_args *objp)
{
@ -580,6 +626,47 @@ xdr_remote_domain_set_scheduler_parameters_args (XDR *xdrs, remote_domain_set_sc
return TRUE;
}
bool_t
xdr_remote_domain_set_memory_parameters_args (XDR *xdrs, remote_domain_set_memory_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_MEMORY_PARAMETERS_MAX,
sizeof (remote_memory_param), (xdrproc_t) xdr_remote_memory_param))
return FALSE;
if (!xdr_u_int (xdrs, &objp->flags))
return FALSE;
return TRUE;
}
bool_t
xdr_remote_domain_get_memory_parameters_args (XDR *xdrs, remote_domain_get_memory_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_memory_parameters_ret (XDR *xdrs, remote_domain_get_memory_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_MEMORY_PARAMETERS_MAX,
sizeof (remote_memory_param), (xdrproc_t) xdr_remote_memory_param))
return FALSE;
if (!xdr_int (xdrs, &objp->nparams))
return FALSE;
return TRUE;
}
bool_t
xdr_remote_domain_block_stats_args (XDR *xdrs, remote_domain_block_stats_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_MEMORY_PARAMETERS_MAX 16
#define REMOTE_NODE_MAX_CELLS 1024
#define REMOTE_AUTH_SASL_DATA_MAX 65536
#define REMOTE_AUTH_TYPE_LIST_MAX 20
@ -186,6 +187,25 @@ struct remote_sched_param {
};
typedef struct remote_sched_param remote_sched_param;
struct remote_memory_param_value {
int type;
union {
int i;
u_int ui;
int64_t l;
uint64_t ul;
double d;
int b;
} remote_memory_param_value_u;
};
typedef struct remote_memory_param_value remote_memory_param_value;
struct remote_memory_param {
remote_nonnull_string field;
remote_memory_param_value value;
};
typedef struct remote_memory_param remote_memory_param;
struct remote_open_args {
remote_string name;
int flags;
@ -307,6 +327,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_memory_parameters_args {
remote_nonnull_domain dom;
struct {
u_int params_len;
remote_memory_param *params_val;
} params;
u_int flags;
};
typedef struct remote_domain_set_memory_parameters_args remote_domain_set_memory_parameters_args;
struct remote_domain_get_memory_parameters_args {
remote_nonnull_domain dom;
int nparams;
u_int flags;
};
typedef struct remote_domain_get_memory_parameters_args remote_domain_get_memory_parameters_args;
struct remote_domain_get_memory_parameters_ret {
struct {
u_int params_len;
remote_memory_param *params_val;
} params;
int nparams;
};
typedef struct remote_domain_get_memory_parameters_ret remote_domain_get_memory_parameters_ret;
struct remote_domain_block_stats_args {
remote_nonnull_domain dom;
remote_nonnull_string path;
@ -2233,6 +2279,8 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_GET_BLOCK_INFO = 194,
REMOTE_PROC_DOMAIN_EVENT_IO_ERROR_REASON = 195,
REMOTE_PROC_DOMAIN_CREATE_WITH_FLAGS = 196,
REMOTE_PROC_DOMAIN_SET_MEMORY_PARAMETERS = 197,
REMOTE_PROC_DOMAIN_GET_MEMORY_PARAMETERS = 198,
};
typedef enum remote_procedure remote_procedure;
@ -2288,6 +2336,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_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*);
extern bool_t xdr_remote_supports_feature_args (XDR *, remote_supports_feature_args*);
extern bool_t xdr_remote_supports_feature_ret (XDR *, remote_supports_feature_ret*);
@ -2308,6 +2358,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_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*);
extern bool_t xdr_remote_domain_block_stats_args (XDR *, remote_domain_block_stats_args*);
extern bool_t xdr_remote_domain_block_stats_ret (XDR *, remote_domain_block_stats_ret*);
extern bool_t xdr_remote_domain_interface_stats_args (XDR *, remote_domain_interface_stats_args*);
@ -2623,6 +2676,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_memory_param_value ();
extern bool_t xdr_remote_memory_param ();
extern bool_t xdr_remote_open_args ();
extern bool_t xdr_remote_supports_feature_args ();
extern bool_t xdr_remote_supports_feature_ret ();
@ -2643,6 +2698,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_memory_parameters_args ();
extern bool_t xdr_remote_domain_get_memory_parameters_args ();
extern bool_t xdr_remote_domain_get_memory_parameters_ret ();
extern bool_t xdr_remote_domain_block_stats_args ();
extern bool_t xdr_remote_domain_block_stats_ret ();
extern bool_t xdr_remote_domain_interface_stats_args ();

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 memory parameters. */
const REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX = 16;
/* Upper limit on number of NUMA cells */
const REMOTE_NODE_MAX_CELLS = 1024;
@ -313,6 +316,26 @@ struct remote_sched_param {
remote_sched_param_value value;
};
union remote_memory_param_value switch (int type) {
case VIR_DOMAIN_MEMORY_FIELD_INT:
int i;
case VIR_DOMAIN_MEMORY_FIELD_UINT:
unsigned int ui;
case VIR_DOMAIN_MEMORY_FIELD_LLONG:
hyper l;
case VIR_DOMAIN_MEMORY_FIELD_ULLONG:
unsigned hyper ul;
case VIR_DOMAIN_MEMORY_FIELD_DOUBLE:
double d;
case VIR_DOMAIN_MEMORY_FIELD_BOOLEAN:
int b;
};
struct remote_memory_param {
remote_nonnull_string field;
remote_memory_param_value value;
};
/*----- Calls. -----*/
/* For each call we may have a 'remote_CALL_args' and 'remote_CALL_ret'
@ -422,6 +445,23 @@ struct remote_domain_set_scheduler_parameters_args {
remote_sched_param params<REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX>;
};
struct remote_domain_set_memory_parameters_args {
remote_nonnull_domain dom;
remote_memory_param params<REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX>;
unsigned int flags;
};
struct remote_domain_get_memory_parameters_args {
remote_nonnull_domain dom;
int nparams;
unsigned int flags;
};
struct remote_domain_get_memory_parameters_ret {
remote_memory_param params<REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX>;
int nparams;
};
struct remote_domain_block_stats_args {
remote_nonnull_domain dom;
remote_nonnull_string path;
@ -2020,7 +2060,9 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_SNAPSHOT_DELETE = 193,
REMOTE_PROC_DOMAIN_GET_BLOCK_INFO = 194,
REMOTE_PROC_DOMAIN_EVENT_IO_ERROR_REASON = 195,
REMOTE_PROC_DOMAIN_CREATE_WITH_FLAGS = 196
REMOTE_PROC_DOMAIN_CREATE_WITH_FLAGS = 196,
REMOTE_PROC_DOMAIN_SET_MEMORY_PARAMETERS = 197,
REMOTE_PROC_DOMAIN_GET_MEMORY_PARAMETERS = 198
/*
* Notice how the entries are grouped in sets of 10 ?