[libvirt] [PATCH 4/9] remote: implement remoteDomainGetStateParams

Bjoern Walk bwalk at linux.ibm.com
Wed Jul 11 10:49:17 UTC 2018


Implement the API function virDomainGetStateParams for the remote driver
and wire up the remote protocol.

Reviewed-by: Stefan Zimmermann <stzi at linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy at linux.ibm.com>
Signed-off-by: Bjoern Walk <bwalk at linux.ibm.com>
---
 src/remote/remote_daemon_dispatch.c |  1 -
 src/remote/remote_driver.c          |  1 +
 src/remote/remote_protocol.x        | 20 +++++++++++++++++++-
 src/remote_protocol-structs         | 11 +++++++++++
 4 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c
index 4a93f09a..57623b6d 100644
--- a/src/remote/remote_daemon_dispatch.c
+++ b/src/remote/remote_daemon_dispatch.c
@@ -4159,7 +4159,6 @@ remoteDispatchDomainGetState(virNetServerPtr server ATTRIBUTE_UNUSED,
     return rv;
 }
 
-
 /* Due to back-compat reasons, two RPC calls map to the same libvirt
  * API of virConnectDomainEventRegisterAny.  A client should only use
  * the new call if they have probed
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 1d94c2e4..e2a79c48 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -8347,6 +8347,7 @@ static virHypervisorDriver hypervisor_driver = {
     .domainSetPerfEvents = remoteDomainSetPerfEvents, /* 1.3.3 */
     .domainGetInfo = remoteDomainGetInfo, /* 0.3.0 */
     .domainGetState = remoteDomainGetState, /* 0.9.2 */
+    .domainGetStateParams = remoteDomainGetStateParams, /* 4.6.0 */
     .domainGetControlInfo = remoteDomainGetControlInfo, /* 0.9.3 */
     .domainSave = remoteDomainSave, /* 0.3.0 */
     .domainSaveFlags = remoteDomainSaveFlags, /* 0.9.4 */
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 28c8feba..43d5db89 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -262,6 +262,9 @@ const REMOTE_NODE_SEV_INFO_MAX = 64;
 /* Upper limit on number of launch security information entries */
 const REMOTE_DOMAIN_LAUNCH_SECURITY_INFO_PARAMS_MAX = 64;
 
+/* Upper limit on number of state parameter entries */
+const REMOTE_DOMAIN_STATE_PARAMETERS_MAX = 16;
+
 /* UUID.  VIR_UUID_BUFLEN definition comes from libvirt.h */
 typedef opaque remote_uuid[VIR_UUID_BUFLEN];
 
@@ -2781,6 +2784,15 @@ struct remote_domain_get_state_ret {
     int reason;
 };
 
+struct remote_domain_get_state_params_args {
+    remote_nonnull_domain dom;
+    unsigned int flags;
+};
+
+struct remote_domain_get_state_params_ret {
+    remote_typed_param params<REMOTE_DOMAIN_STATE_PARAMETERS_MAX>; /* alloc at 1@int at 2 */
+};
+
 struct remote_domain_migrate_begin3_args {
     remote_nonnull_domain dom;
     remote_string xmlin;
@@ -6312,5 +6324,11 @@ 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:read
+     */
+    REMOTE_PROC_DOMAIN_GET_STATE_PARAMS = 402
 };
diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
index 6343e146..a19b9730 100644
--- a/src/remote_protocol-structs
+++ b/src/remote_protocol-structs
@@ -2153,6 +2153,16 @@ struct remote_domain_get_state_ret {
         int                        state;
         int                        reason;
 };
+struct remote_domain_get_state_params_args {
+        remote_nonnull_domain      dom;
+        u_int                      flags;
+};
+struct remote_domain_get_state_params_ret {
+        struct {
+                u_int              params_len;
+                remote_typed_param * params_val;
+        } params;
+};
 struct remote_domain_migrate_begin3_args {
         remote_nonnull_domain      dom;
         remote_string              xmlin;
@@ -3368,4 +3378,5 @@ 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_GET_STATE_PARAMS = 402,
 };
-- 
2.17.0




More information about the libvir-list mailing list