Re: [libvirt RFC v3 06/19] remote: Add RPC support for the virDomainRestoreParametersFlags API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/26/22 10:47, Claudio Fontana wrote:
Signed-off-by: Claudio Fontana <cfontana@xxxxxxx>
---
  src/remote/remote_driver.c   |  1 +
  src/remote/remote_protocol.x | 14 +++++++++++++-
  src/remote_protocol-structs  |  8 ++++++++
  3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 1fc5d41971..c5b644ce49 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -8449,6 +8449,7 @@ static virHypervisorDriver hypervisor_driver = {
      .domainSaveParametersFlags = remoteDomainSaveParametersFlags, /* 8.3.0 */
      .domainRestore = remoteDomainRestore, /* 0.3.0 */
      .domainRestoreFlags = remoteDomainRestoreFlags, /* 0.9.4 */
+    .domainRestoreParametersFlags = remoteDomainRestoreParametersFlags, /* 8.3.0 */
      .domainSaveImageGetXMLDesc = remoteDomainSaveImageGetXMLDesc, /* 0.9.4 */
      .domainSaveImageDefineXML = remoteDomainSaveImageDefineXML, /* 0.9.4 */
      .domainCoreDump = remoteDomainCoreDump, /* 0.3.0 */
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index c2ae5c5748..7b919ef375 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -3236,6 +3236,11 @@ struct remote_domain_save_parameters_flags_args {
      unsigned int flags;
  };
+struct remote_domain_restore_parameters_flags_args {
+    remote_typed_param params<REMOTE_DOMAIN_SAVE_PARAMS_MAX>;
+    unsigned int flags;
+};
+
  /* The device removed event is the last event where we have to support
   * dual forms for back-compat to older clients; all future events can
   * use just the modern form with callbackID.  */
@@ -6935,5 +6940,12 @@ enum remote_procedure {
       * @generate: both
       * @acl: domain:hibernate
       */
-    REMOTE_PROC_DOMAIN_SAVE_PARAMETERS_FLAGS = 440
+    REMOTE_PROC_DOMAIN_SAVE_PARAMETERS_FLAGS = 440,
+
+    /**
+     * @generate: both
+     * @acl: domain:start
+     * @acl: domain:write
+     */
+    REMOTE_PROC_DOMAIN_RESTORE_PARAMETERS_FLAGS = 441

I've stared at this for quite a while but can't figure out why the dispatch stub does not pass virConnectPtr to virDomainRestoreParametersFlags. I'm hitting the following build failure

In file included from ../src/remote/remote_daemon_dispatch.c:133:

src/remote/remote_daemon_dispatch_stubs.h: In function ‘remoteDispatchDomainRestoreParametersFlags’:

src/remote/remote_daemon_dispatch_stubs.h:10080:41: error: passing argument 1 of ‘virDomainRestoreParametersFlags’ from incompatible pointer type [-Werror=incompatible-pointer-types]

10080 |     if (virDomainRestoreParametersFlags(params, nparams, args->flags) < 0)

      |                                         ^~~~~~

      |                                         |

| virTypedParameterPtr {aka struct _virTypedParameter *}

In file included from ../include/libvirt/libvirt.h:36,

                 from ../src/internal.h:65,

                 from ../src/util/virerror.h:24,

                 from ../src/remote/remote_daemon_dispatch.c:23:

../include/libvirt/libvirt-domain.h:1576:72: note: expected ‘virConnectPtr’ {aka ‘struct _virConnect *’} but argument is of type ‘virTypedParameterPtr’ {aka ‘struct _virTypedParameter *’}

1576 | int virDomainRestoreParametersFlags (virConnectPtr conn,


Perhaps a bug in gendispatch.pl. I'm not familiar with the script or debugging it, but others here can likely provide help.

Jim

  };
diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
index 89eadeb644..72e92184ca 100644
--- a/src/remote_protocol-structs
+++ b/src/remote_protocol-structs
@@ -579,6 +579,13 @@ struct remote_domain_restore_flags_args {
          remote_string              dxml;
          u_int                      flags;
  };
+struct remote_domain_restore_parameters_flags_args {
+        struct {
+                u_int              params_len;
+                remote_typed_param * params_val;
+        } params;
+        u_int                      flags;
+};
  struct remote_domain_save_image_get_xml_desc_args {
          remote_nonnull_string      file;
          u_int                      flags;
@@ -3698,4 +3705,5 @@ enum remote_procedure {
          REMOTE_PROC_DOMAIN_EVENT_MEMORY_DEVICE_SIZE_CHANGE = 438,
          REMOTE_PROC_DOMAIN_SET_LAUNCH_SECURITY_STATE = 439,
          REMOTE_PROC_DOMAIN_SAVE_PARAMETERS_FLAGS = 440,
+        REMOTE_PROC_DOMAIN_RESTORE_PARAMETERS_FLAGS = 441,
  };





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux