Function includes setting and getting the status of
resource monitoring group.
---
src/remote/remote_daemon_dispatch.c | 45 +++++++++++++++++++++++++++++++++++++
src/remote/remote_driver.c | 4 +++-
src/remote/remote_protocol.x | 31 ++++++++++++++++++++++++-
src/remote_protocol-structs | 16 +++++++++++++
4 files changed, 94 insertions(+), 2 deletions(-)
diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c
index 4a93f09..fbec052 100644
--- a/src/remote/remote_daemon_dispatch.c
+++ b/src/remote/remote_daemon_dispatch.c
@@ -7213,3 +7213,48 @@ remoteSerializeDomainDiskErrors(virDomainDiskErrorPtr errors,
}
return -1;
}
+
+static int remoteDispatchDomainGetCPUResmonSts(
+ virNetServerPtr server ATTRIBUTE_UNUSED,
+ virNetServerClientPtr client,
+ virNetMessagePtr msg ATTRIBUTE_UNUSED,
+ virNetMessageErrorPtr rerr,
+ remote_domain_get_cpu_resmon_sts_args *args,
+ remote_domain_get_cpu_resmon_sts_ret *ret)
+{
+ int rv = -1;
+ virDomainPtr dom = NULL;
+ char *sts = NULL;
+ char **sts_p = NULL;
+ struct daemonClientPrivate *priv =
+ virNetServerClientGetPrivateData(client);
+
+ if (!priv->conn) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not
open"));
+ goto cleanup;
+ }
+
+ if (!(dom = get_nonnull_domain(priv->conn, args->dom)))
+ goto cleanup;
+
+ if ((rv = virDomainGetCPUResmonSts(dom, args->monid, &sts)) < 0)
+ goto cleanup;
+
+ if (VIR_ALLOC(sts_p) < 0)
+ goto cleanup;
+
+ if (VIR_STRDUP(*sts_p, sts) < 0)
+ goto cleanup;
+
+ ret->sts = sts_p;
+ rv = 0;
+
+ cleanup:
+ if (rv < 0) {
+ virNetMessageSaveError(rerr);
+ VIR_FREE(sts_p);
+ }
+ virObjectUnref(dom);
+ VIR_FREE(sts);
+ return rv;
+}
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 1d94c2e..3a83df6 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -8536,7 +8536,9 @@ static virHypervisorDriver hypervisor_driver = {
.connectCompareHypervisorCPU = remoteConnectCompareHypervisorCPU, /* 4.4.0 */
.connectBaselineHypervisorCPU = remoteConnectBaselineHypervisorCPU, /* 4.4.0 */
.nodeGetSEVInfo = remoteNodeGetSEVInfo, /* 4.5.0 */
- .domainGetLaunchSecurityInfo = remoteDomainGetLaunchSecurityInfo /* 4.5.0 */
+ .domainGetLaunchSecurityInfo = remoteDomainGetLaunchSecurityInfo, /* 4.5.0 */
+ .domainSetCPUResmon = remoteDomainSetCPUResmon, /* 4.5.0 */
+ .domainGetCPUResmonSts = remoteDomainGetCPUResmonSts, /* 4.6.0 */
};
static virNetworkDriver network_driver = {
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 28c8feb..fbf88a0 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -3557,6 +3557,23 @@ struct remote_connect_list_all_nwfilter_bindings_ret { /* insert@1
*/
unsigned int ret;
};
+struct remote_domain_set_cpu_resmon_args {
+ remote_nonnull_domain dom;
+ remote_string vcpustr;
+ remote_string monid;
+ int action;
+ unsigned int flags;
+};
+
+struct remote_domain_get_cpu_resmon_sts_args {
+ remote_nonnull_domain dom;
+ remote_nonnull_string monid;
+};
+
+struct remote_domain_get_cpu_resmon_sts_ret { /* insert@1 */
+ remote_string sts;
+};
+
/*----- Protocol. -----*/
/* Define the program number, protocol version and procedure numbers here. */
@@ -6312,5 +6329,17 @@ enum remote_procedure {
* @acl: connect:search_nwfilter_bindings
* @aclfilter: nwfilter_binding:getattr
*/
- REMOTE_PROC_CONNECT_LIST_ALL_NWFILTER_BINDINGS = 401
+ REMOTE_PROC_CONNECT_LIST_ALL_NWFILTER_BINDINGS = 401,
+
+ /**
+ * @generate: both
+ * @acl: domain:write
+ */
+ REMOTE_PROC_DOMAIN_SET_CPU_RESMON = 402,
+
+ /**
+ * @generate: client
+ * @acl: domain:read
+ */
+ REMOTE_PROC_DOMAIN_GET_CPU_RESMON_STS = 403
};
diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
index 6343e14..ddbab04 100644
--- a/src/remote_protocol-structs
+++ b/src/remote_protocol-structs
@@ -2966,6 +2966,20 @@ struct remote_connect_list_all_nwfilter_bindings_ret {
} bindings;
u_int ret;
};
+struct remote_domain_set_cpu_resmon_args {
+ remote_nonnull_domain dom;
+ remote_string vcpustr;
+ remote_string monid;
+ int action;
+ unsigned int flags;
+};
+struct remote_domain_get_cpu_resmon_sts_args {
+ remote_nonnull_domain dom;
+ remote_nonnull_string monid;
+};
+struct remote_domain_get_cpu_resmon_sts_ret {
+ remote_string sts;
+};
enum remote_procedure {
REMOTE_PROC_CONNECT_OPEN = 1,
REMOTE_PROC_CONNECT_CLOSE = 2,
@@ -3368,4 +3382,6 @@ enum remote_procedure {
REMOTE_PROC_NWFILTER_BINDING_CREATE_XML = 399,
REMOTE_PROC_NWFILTER_BINDING_DELETE = 400,
REMOTE_PROC_CONNECT_LIST_ALL_NWFILTER_BINDINGS = 401,
+ REMOTE_PROC_DOMAIN_SET_CPU_RESMON = 402,
+ REMOTE_PROC_DOMAIN_GET_CPU_RESMON_STS = 403,
};
--
2.7.4