---
daemon/remote.c | 63 ++++++++++++++++++++++++++++++++++++++++++
src/remote/remote_driver.c | 50 +++++++++++++++++++++++++++++++++
src/remote/remote_protocol.x | 25 ++++++++++++++++-
src/remote_protocol-structs | 16 ++++++++++
4 files changed, 153 insertions(+), 1 deletions(-)
diff --git a/daemon/remote.c b/daemon/remote.c
index bd0c3e3..de6bbc8 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -1591,6 +1591,69 @@ cleanup:
}
static int
+remoteDispatchDomainGetNumaParameters(virNetServerPtr server ATTRIBUTE_UNUSED,
+ virNetServerClientPtr client ATTRIBUTE_UNUSED,
+ virNetMessagePtr msg ATTRIBUTE_UNUSED,
+ virNetMessageErrorPtr rerr,
+ remote_domain_get_numa_parameters_args *args,
+ remote_domain_get_numa_parameters_ret *ret)
+{
+ virDomainPtr dom = NULL;
+ virTypedParameterPtr params = NULL;
+ int nparams = args->nparams;
+ unsigned int flags;
+ int rv = -1;
+ struct daemonClientPrivate *priv =
+ virNetServerClientGetPrivateData(client);
+
+ if (!priv->conn) {
+ virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not
open"));
+ goto cleanup;
+ }
+
+ flags = args->flags;
+
+ if (nparams > REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX) {
+ virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams too
large"));
+ goto cleanup;
+ }
+ if (VIR_ALLOC_N(params, nparams) < 0) {
+ virReportOOMError();
+ goto cleanup;
+ }
+
+ if (!(dom = get_nonnull_domain(priv->conn, args->dom)))
+ goto cleanup;
+
+ if (virDomainGetNumaParameters(dom, params, &nparams, flags) < 0)
+ goto cleanup;
+
+ /* In this case, we need to send back the number of parameters
+ * supported
+ */
+ if (args->nparams == 0) {
+ ret->nparams = nparams;
+ goto success;
+ }
+
+ if (remoteSerializeTypedParameters(params, nparams,
+ &ret->params.params_val,
+ &ret->params.params_len) < 0)
+ goto cleanup;
+
+success:
+ rv = 0;
+
+cleanup:
+ if (rv < 0)
+ virNetMessageSaveError(rerr);
+ if (dom)
+ virDomainFree(dom);
+ VIR_FREE(params);
+ return rv;
+}
+
+static int
remoteDispatchDomainGetBlkioParameters(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client ATTRIBUTE_UNUSED,
virNetMessagePtr msg ATTRIBUTE_UNUSED,
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index ea7fb24..29a1d49 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -1490,6 +1490,54 @@ done:
}
static int
+remoteDomainGetNumaParameters (virDomainPtr domain,
+ virTypedParameterPtr params, int *nparams,
+ unsigned int flags)
+{
+ int rv = -1;
+ remote_domain_get_numa_parameters_args args;
+ remote_domain_get_numa_parameters_ret ret;
+ 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_NUMA_PARAMETERS,
+ (xdrproc_t) xdr_remote_domain_get_numa_parameters_args, (char *)
&args,
+ (xdrproc_t) xdr_remote_domain_get_numa_parameters_ret, (char *) &ret)
== -1)
+ goto done;
+
+ /* 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;
+ }
+
+ if (remoteDeserializeTypedParameters(ret.params.params_val,
+ ret.params.params_len,
+ REMOTE_DOMAIN_NUMA_PARAMETERS_MAX,
+ params,
+ nparams) < 0)
+ goto cleanup;
+
+ rv = 0;
+
+cleanup:
+ xdr_free ((xdrproc_t) xdr_remote_domain_get_numa_parameters_ret,
+ (char *) &ret);
+done:
+ remoteDriverUnlock(priv);
+ return rv;
+}
+
+static int
remoteDomainGetBlkioParameters (virDomainPtr domain,
virTypedParameterPtr params, int *nparams,
unsigned int flags)
@@ -4526,6 +4574,8 @@ static virDriver remote_driver = {
.domainGetBlockJobInfo = remoteDomainGetBlockJobInfo, /* 0.9.4 */
.domainBlockJobSetSpeed = remoteDomainBlockJobSetSpeed, /* 0.9.4 */
.domainBlockPull = remoteDomainBlockPull, /* 0.9.4 */
+ .domainSetNumaParameters = remoteDomainSetNumaParameters, /* 0.9.8 */
+ .domainGetNumaParameters = remoteDomainGetNumaParameters, /* 0.9.8 */
};
static virNetworkDriver network_driver = {
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index a174af8..3cdbc40 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -125,6 +125,9 @@ const REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX = 16;
/* Upper limit on list of memory parameters. */
const REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX = 16;
+/* Upper limit on list of numa parameters. */
+const REMOTE_DOMAIN_NUMA_PARAMETERS_MAX = 16;
+
/* Upper limit on list of node cpu stats. */
const REMOTE_NODE_CPU_STATS_MAX = 16;
@@ -535,6 +538,23 @@ struct remote_domain_get_memory_parameters_ret {
int nparams;
};
+struct remote_domain_set_numa_parameters_args {
+ remote_nonnull_domain dom;
+ remote_typed_param params<REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX>;
+ unsigned int flags;
+};
+
+struct remote_domain_get_numa_parameters_args {
+ remote_nonnull_domain dom;
+ int nparams;
+ unsigned int flags;
+};
+
+struct remote_domain_get_numa_parameters_ret {
+ remote_typed_param params<REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX>;
+ int nparams;
+};
+
struct remote_domain_block_stats_args {
remote_nonnull_domain dom;
remote_nonnull_string path;
@@ -2562,7 +2582,10 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_SNAPSHOT_NUM_CHILDREN = 246, /* autogen autogen priority:high */
REMOTE_PROC_DOMAIN_SNAPSHOT_LIST_CHILDREN_NAMES = 247, /* autogen autogen
priority:high */
REMOTE_PROC_DOMAIN_EVENT_DISK_CHANGE = 248, /* skipgen skipgen */
- REMOTE_PROC_DOMAIN_OPEN_GRAPHICS = 249 /* skipgen skipgen */
+ REMOTE_PROC_DOMAIN_OPEN_GRAPHICS = 249, /* skipgen skipgen */
+ REMOTE_PROC_DOMAIN_SET_NUMA_PARAMETERS = 250, /* autogen autogen */
+
+ REMOTE_PROC_DOMAIN_GET_NUMA_PARAMETERS = 251 /* skipgen skipgen */
/*
* Notice how the entries are grouped in sets of 10 ?
diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
index 12cedef..65d4c70 100644
--- a/src/remote_protocol-structs
+++ b/src/remote_protocol-structs
@@ -166,6 +166,22 @@ struct remote_node_get_memory_stats_ret {
} params;
int nparams;
};
+struct remote_domain_set_numa_parameters_args {
+ remote_nonnull_domain dom;
+ remote_typed_param params<REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX>;
+ unsigned int flags;
+};
+
+struct remote_domain_get_numa_parameters_args {
+ remote_nonnull_domain dom;
+ int nparams;
+ unsigned int flags;
+};
+
+struct remote_domain_get_numa_parameters_ret {
+ remote_typed_param params<REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX>;
+ int nparams;
+};
struct remote_node_get_cells_free_memory_args {
int startCell;
int maxcells;
--
1.7.3.1