[PATCH v2 9/9] backup: Implement backup APIs for remote driver

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

 



The remote code generator had to be taught about the new
virDomainCheckpointPtr type, at which point the remote driver
code for backups can be generated.

Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
---
 src/remote/remote_daemon_dispatch.c |  15 ++
 src/remote/remote_driver.c          |  33 +++-
 src/remote/remote_protocol.x        | 240 +++++++++++++++++++++++++++-
 src/remote_protocol-structs         | 129 +++++++++++++++
 src/rpc/gendispatch.pl              |  32 ++--
 5 files changed, 430 insertions(+), 19 deletions(-)

diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c
index e62ebfb596..09fda113a8 100644
--- a/src/remote/remote_daemon_dispatch.c
+++ b/src/remote/remote_daemon_dispatch.c
@@ -91,6 +91,7 @@ static virStorageVolPtr get_nonnull_storage_vol(virConnectPtr conn, remote_nonnu
 static virSecretPtr get_nonnull_secret(virConnectPtr conn, remote_nonnull_secret secret);
 static virNWFilterPtr get_nonnull_nwfilter(virConnectPtr conn, remote_nonnull_nwfilter nwfilter);
 static virNWFilterBindingPtr get_nonnull_nwfilter_binding(virConnectPtr conn, remote_nonnull_nwfilter_binding binding);
+static virDomainCheckpointPtr get_nonnull_domain_checkpoint(virDomainPtr dom, remote_nonnull_domain_checkpoint checkpoint);
 static virDomainSnapshotPtr get_nonnull_domain_snapshot(virDomainPtr dom, remote_nonnull_domain_snapshot snapshot);
 static virNodeDevicePtr get_nonnull_node_device(virConnectPtr conn, remote_nonnull_node_device dev);
 static void make_nonnull_domain(remote_nonnull_domain *dom_dst, virDomainPtr dom_src);
@@ -102,6 +103,7 @@ static void make_nonnull_node_device(remote_nonnull_node_device *dev_dst, virNod
 static void make_nonnull_secret(remote_nonnull_secret *secret_dst, virSecretPtr secret_src);
 static void make_nonnull_nwfilter(remote_nonnull_nwfilter *net_dst, virNWFilterPtr nwfilter_src);
 static void make_nonnull_nwfilter_binding(remote_nonnull_nwfilter_binding *binding_dst, virNWFilterBindingPtr binding_src);
+static void make_nonnull_domain_checkpoint(remote_nonnull_domain_checkpoint *checkpoint_dst, virDomainCheckpointPtr checkpoint_src);
 static void make_nonnull_domain_snapshot(remote_nonnull_domain_snapshot *snapshot_dst, virDomainSnapshotPtr snapshot_src);

 static int
@@ -7093,6 +7095,12 @@ get_nonnull_nwfilter_binding(virConnectPtr conn, remote_nonnull_nwfilter_binding
     return virGetNWFilterBinding(conn, binding.portdev, binding.filtername);
 }

+static virDomainCheckpointPtr
+get_nonnull_domain_checkpoint(virDomainPtr dom, remote_nonnull_domain_checkpoint checkpoint)
+{
+    return virGetDomainCheckpoint(dom, checkpoint.name);
+}
+
 static virDomainSnapshotPtr
 get_nonnull_domain_snapshot(virDomainPtr dom, remote_nonnull_domain_snapshot snapshot)
 {
@@ -7172,6 +7180,13 @@ make_nonnull_nwfilter_binding(remote_nonnull_nwfilter_binding *binding_dst, virN
     ignore_value(VIR_STRDUP_QUIET(binding_dst->filtername, binding_src->filtername));
 }

+static void
+make_nonnull_domain_checkpoint(remote_nonnull_domain_checkpoint *checkpoint_dst, virDomainCheckpointPtr checkpoint_src)
+{
+    ignore_value(VIR_STRDUP_QUIET(checkpoint_dst->name, checkpoint_src->name));
+    make_nonnull_domain(&checkpoint_dst->dom, checkpoint_src->domain);
+}
+
 static void
 make_nonnull_domain_snapshot(remote_nonnull_domain_snapshot *snapshot_dst, virDomainSnapshotPtr snapshot_src)
 {
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 3b43e219e5..9c3501cba3 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -2,7 +2,7 @@
  * remote_driver.c: driver to provide access to libvirtd running
  *   on a remote machine
  *
- * Copyright (C) 2007-2015 Red Hat, Inc.
+ * Copyright (C) 2007-2018 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -147,6 +147,7 @@ static virStoragePoolPtr get_nonnull_storage_pool(virConnectPtr conn, remote_non
 static virStorageVolPtr get_nonnull_storage_vol(virConnectPtr conn, remote_nonnull_storage_vol vol);
 static virNodeDevicePtr get_nonnull_node_device(virConnectPtr conn, remote_nonnull_node_device dev);
 static virSecretPtr get_nonnull_secret(virConnectPtr conn, remote_nonnull_secret secret);
+static virDomainCheckpointPtr get_nonnull_domain_checkpoint(virDomainPtr domain, remote_nonnull_domain_checkpoint checkpoint);
 static virDomainSnapshotPtr get_nonnull_domain_snapshot(virDomainPtr domain, remote_nonnull_domain_snapshot snapshot);
 static void make_nonnull_domain(remote_nonnull_domain *dom_dst, virDomainPtr dom_src);
 static void make_nonnull_network(remote_nonnull_network *net_dst, virNetworkPtr net_src);
@@ -158,6 +159,7 @@ make_nonnull_node_device(remote_nonnull_node_device *dev_dst, virNodeDevicePtr d
 static void make_nonnull_secret(remote_nonnull_secret *secret_dst, virSecretPtr secret_src);
 static void make_nonnull_nwfilter(remote_nonnull_nwfilter *nwfilter_dst, virNWFilterPtr nwfilter_src);
 static void make_nonnull_nwfilter_binding(remote_nonnull_nwfilter_binding *binding_dst, virNWFilterBindingPtr binding_src);
+static void make_nonnull_domain_checkpoint(remote_nonnull_domain_checkpoint *checkpoint_dst, virDomainCheckpointPtr checkpoint_src);
 static void make_nonnull_domain_snapshot(remote_nonnull_domain_snapshot *snapshot_dst, virDomainSnapshotPtr snapshot_src);

 /*----------------------------------------------------------------------*/
@@ -8214,6 +8216,12 @@ get_nonnull_nwfilter_binding(virConnectPtr conn, remote_nonnull_nwfilter_binding
     return virGetNWFilterBinding(conn, binding.portdev, binding.filtername);
 }

+static virDomainCheckpointPtr
+get_nonnull_domain_checkpoint(virDomainPtr domain, remote_nonnull_domain_checkpoint checkpoint)
+{
+    return virGetDomainCheckpoint(domain, checkpoint.name);
+}
+
 static virDomainSnapshotPtr
 get_nonnull_domain_snapshot(virDomainPtr domain, remote_nonnull_domain_snapshot snapshot)
 {
@@ -8288,6 +8296,13 @@ make_nonnull_nwfilter_binding(remote_nonnull_nwfilter_binding *binding_dst, virN
     binding_dst->filtername = binding_src->filtername;
 }

+static void
+make_nonnull_domain_checkpoint(remote_nonnull_domain_checkpoint *checkpoint_dst, virDomainCheckpointPtr checkpoint_src)
+{
+    checkpoint_dst->name = checkpoint_src->name;
+    make_nonnull_domain(&checkpoint_dst->dom, checkpoint_src->domain);
+}
+
 static void
 make_nonnull_domain_snapshot(remote_nonnull_domain_snapshot *snapshot_dst, virDomainSnapshotPtr snapshot_src)
 {
@@ -8536,7 +8551,21 @@ 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 */
+    .domainCheckpointCreateXML = remoteDomainCheckpointCreateXML, /* 4.9.0 */
+    .domainCheckpointGetXMLDesc = remoteDomainCheckpointGetXMLDesc, /* 4.9.0 */
+    .domainListCheckpoints = remoteDomainListCheckpoints, /* 4.9.0 */
+    .domainCheckpointListChildren = remoteDomainCheckpointListChildren, /* 4.9.0 */
+    .domainCheckpointLookupByName = remoteDomainCheckpointLookupByName, /* 4.9.0 */
+    .domainHasCurrentCheckpoint = remoteDomainHasCurrentCheckpoint, /* 4.9.0 */
+    .domainCheckpointGetParent = remoteDomainCheckpointGetParent, /* 4.9.0 */
+    .domainCheckpointCurrent = remoteDomainCheckpointCurrent, /* 4.9.0 */
+    .domainCheckpointIsCurrent = remoteDomainCheckpointIsCurrent, /* 4.9.0 */
+    .domainCheckpointHasMetadata = remoteDomainCheckpointHasMetadata, /* 4.9.0 */
+    .domainCheckpointDelete = remoteDomainCheckpointDelete, /* 4.9.0 */
+    .domainBackupBegin = remoteDomainBackupBegin, /* 4.9.0 */
+    .domainBackupGetXMLDesc = remoteDomainBackupGetXMLDesc, /* 4.9.0 */
+    .domainBackupEnd = remoteDomainBackupEnd, /* 4.9.0 */
 };

 static virNetworkDriver network_driver = {
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 28c8febabd..1e9632743a 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -3,7 +3,7 @@
  *   remote_internal driver and libvirtd.  This protocol is
  *   internal and may change at any time.
  *
- * Copyright (C) 2006-2015 Red Hat, Inc.
+ * Copyright (C) 2006-2018 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -139,6 +139,9 @@ const REMOTE_AUTH_TYPE_LIST_MAX = 20;
 /* Upper limit on list of memory stats */
 const REMOTE_DOMAIN_MEMORY_STATS_MAX = 1024;

+/* Upper limit on lists of domain checkpoints. */
+const REMOTE_DOMAIN_CHECKPOINT_LIST_MAX = 16384;
+
 /* Upper limit on lists of domain snapshots. */
 const REMOTE_DOMAIN_SNAPSHOT_LIST_MAX = 16384;

@@ -321,6 +324,12 @@ struct remote_nonnull_secret {
     remote_nonnull_string usageID;
 };

+/* A checkpoint which may not be NULL. */
+struct remote_nonnull_domain_checkpoint {
+    remote_nonnull_string name;
+    remote_nonnull_domain dom;
+};
+
 /* A snapshot which may not be NULL. */
 struct remote_nonnull_domain_snapshot {
     remote_nonnull_string name;
@@ -3556,6 +3565,137 @@ struct remote_connect_list_all_nwfilter_bindings_ret { /* insert@1 */
     remote_nonnull_nwfilter_binding bindings<REMOTE_NWFILTER_BINDING_LIST_MAX>;
     unsigned int ret;
 };
+struct remote_domain_checkpoint_create_xml_args {
+    remote_nonnull_domain dom;
+    remote_nonnull_string xml_desc;
+    unsigned int flags;
+};
+
+struct remote_domain_checkpoint_create_xml_ret {
+    remote_nonnull_domain_checkpoint checkpoint;
+};
+
+struct remote_domain_checkpoint_get_xml_desc_args {
+    remote_nonnull_domain_checkpoint checkpoint;
+    unsigned int flags;
+};
+
+struct remote_domain_checkpoint_get_xml_desc_ret {
+    remote_nonnull_string xml;
+};
+
+struct remote_domain_list_checkpoints_args {
+    remote_nonnull_domain dom;
+    int need_results;
+    unsigned int flags;
+};
+
+struct remote_domain_list_checkpoints_ret { /* insert@1 */
+    remote_nonnull_domain_checkpoint checkpoints<REMOTE_DOMAIN_CHECKPOINT_LIST_MAX>;
+    int ret;
+};
+
+struct remote_domain_checkpoint_list_children_args {
+    remote_nonnull_domain_checkpoint checkpoint;
+    int need_results;
+    unsigned int flags;
+};
+
+struct remote_domain_checkpoint_list_children_ret { /* insert@1 */
+    remote_nonnull_domain_checkpoint checkpoints<REMOTE_DOMAIN_CHECKPOINT_LIST_MAX>;
+    int ret;
+};
+
+struct remote_domain_checkpoint_lookup_by_name_args {
+    remote_nonnull_domain dom;
+    remote_nonnull_string name;
+    unsigned int flags;
+};
+
+struct remote_domain_checkpoint_lookup_by_name_ret {
+    remote_nonnull_domain_checkpoint checkpoint;
+};
+
+struct remote_domain_has_current_checkpoint_args {
+    remote_nonnull_domain dom;
+    unsigned int flags;
+};
+
+struct remote_domain_has_current_checkpoint_ret {
+    int result;
+};
+
+struct remote_domain_checkpoint_get_parent_args {
+    remote_nonnull_domain_checkpoint checkpoint;
+    unsigned int flags;
+};
+
+struct remote_domain_checkpoint_get_parent_ret {
+    remote_nonnull_domain_checkpoint parent;
+};
+
+struct remote_domain_checkpoint_current_args {
+    remote_nonnull_domain dom;
+    unsigned int flags;
+};
+
+struct remote_domain_checkpoint_current_ret {
+    remote_nonnull_domain_checkpoint checkpoint;
+};
+
+struct remote_domain_checkpoint_is_current_args {
+    remote_nonnull_domain_checkpoint checkpoint;
+    unsigned int flags;
+};
+
+struct remote_domain_checkpoint_is_current_ret {
+    int current;
+};
+
+struct remote_domain_checkpoint_has_metadata_args {
+    remote_nonnull_domain_checkpoint checkpoint;
+    unsigned int flags;
+};
+
+struct remote_domain_checkpoint_has_metadata_ret {
+    int metadata;
+};
+
+struct remote_domain_checkpoint_delete_args {
+    remote_nonnull_domain_checkpoint checkpoint;
+    unsigned int flags;
+};
+
+struct remote_domain_backup_begin_args {
+    remote_nonnull_domain dom;
+    remote_string disk_xml;
+    remote_string checkpoint_xml;
+    unsigned int flags;
+};
+
+struct remote_domain_backup_begin_ret {
+    int result;
+};
+
+struct remote_domain_backup_get_xml_desc_args {
+    remote_nonnull_domain dom;
+    int id;
+    unsigned int flags;
+};
+
+struct remote_domain_backup_get_xml_desc_ret {
+    remote_nonnull_string xml;
+};
+
+struct remote_domain_backup_end_args {
+    remote_nonnull_domain dom;
+    int id;
+    unsigned int flags;
+};
+
+struct remote_domain_backup_end_ret {
+    int retcode;
+};

 /*----- Protocol. -----*/

@@ -6312,5 +6452,101 @@ 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:checkpoint
+     */
+    REMOTE_PROC_DOMAIN_CHECKPOINT_CREATE_XML = 402,
+
+    /**
+     * @generate: both
+     * @acl: domain:read
+     * @acl: domain:read_secure:VIR_DOMAIN_CHECKPOINT_XML_SECURE
+     */
+    REMOTE_PROC_DOMAIN_CHECKPOINT_GET_XML_DESC = 403,
+
+    /**
+     * @generate: both
+     * @priority: high
+     * @acl: domain:read
+     */
+    REMOTE_PROC_DOMAIN_LIST_CHECKPOINTS = 404,
+
+    /**
+     * @generate: both
+     * @priority: high
+     * @acl: domain:read
+     */
+    REMOTE_PROC_DOMAIN_CHECKPOINT_LIST_CHILDREN = 405,
+
+    /**
+     * @generate: both
+     * @priority: high
+     * @acl: domain:read
+     */
+    REMOTE_PROC_DOMAIN_CHECKPOINT_LOOKUP_BY_NAME = 406,
+
+    /**
+     * @generate: both
+     * @priority: high
+     * @acl: domain:read
+     */
+    REMOTE_PROC_DOMAIN_HAS_CURRENT_CHECKPOINT = 407,
+
+    /**
+     * @generate: both
+     * @priority: high
+     * @acl: domain:read
+     */
+    REMOTE_PROC_DOMAIN_CHECKPOINT_CURRENT = 408,
+
+    /**
+     * @generate: both
+     * @priority: high
+     * @acl: domain:read
+     */
+    REMOTE_PROC_DOMAIN_CHECKPOINT_GET_PARENT = 409,
+
+    /**
+     * @generate: both
+     * @priority: high
+     * @acl: domain:read
+     */
+    REMOTE_PROC_DOMAIN_CHECKPOINT_IS_CURRENT = 410,
+
+    /**
+     * @generate: both
+     * @priority: high
+     * @acl: domain:read
+     */
+    REMOTE_PROC_DOMAIN_CHECKPOINT_HAS_METADATA = 411,
+
+    /**
+     * @generate: both
+     * @acl: domain:checkpoint
+     */
+    REMOTE_PROC_DOMAIN_CHECKPOINT_DELETE = 412,
+
+    /**
+     * @generate: both
+     * @acl: domain:checkpoint
+     * @acl: domain:block_read
+     */
+    REMOTE_PROC_DOMAIN_BACKUP_BEGIN = 413,
+
+    /**
+     * @generate: both
+     * @priority: high
+     * @acl: domain:read
+     * @acl: domain:read_secure:VIR_DOMAIN_XML_SECURE
+     */
+    REMOTE_PROC_DOMAIN_BACKUP_GET_XML_DESC = 414,
+
+    /**
+     * @generate: both
+     * @acl: domain:checkpoint
+     */
+    REMOTE_PROC_DOMAIN_BACKUP_END = 415
 };
diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
index 6343e14638..86c7c34cf5 100644
--- a/src/remote_protocol-structs
+++ b/src/remote_protocol-structs
@@ -46,6 +46,10 @@ struct remote_nonnull_secret {
         int                        usageType;
         remote_nonnull_string      usageID;
 };
+struct remote_nonnull_domain_checkpoint {
+        remote_nonnull_string      name;
+        remote_nonnull_domain      dom;
+};
 struct remote_nonnull_domain_snapshot {
         remote_nonnull_string      name;
         remote_nonnull_domain      dom;
@@ -2966,6 +2970,117 @@ struct remote_connect_list_all_nwfilter_bindings_ret {
         } bindings;
         u_int                      ret;
 };
+struct remote_domain_checkpoint_create_xml_args {
+        remote_nonnull_domain      dom;
+        remote_nonnull_string      xml_desc;
+        u_int                      flags;
+};
+struct remote_domain_checkpoint_create_xml_ret {
+        remote_nonnull_domain_checkpoint checkpoint;
+};
+struct remote_domain_checkpoint_get_xml_desc_args {
+        remote_nonnull_domain_checkpoint checkpoint;
+        u_int                      flags;
+};
+struct remote_domain_checkpoint_get_xml_desc_ret {
+        remote_nonnull_string      xml;
+};
+struct remote_domain_list_checkpoints_args {
+        remote_nonnull_domain      dom;
+        int                        need_results;
+        u_int                      flags;
+};
+struct remote_domain_list_checkpoints_ret {
+        struct {
+                u_int              checkpoints_len;
+                remote_nonnull_domain_checkpoint * checkpoints_val;
+        } checkpoints;
+        int                        ret;
+};
+struct remote_domain_checkpoint_list_children_args {
+        remote_nonnull_domain_checkpoint checkpoint;
+        int                        need_results;
+        u_int                      flags;
+};
+struct remote_domain_checkpoint_list_children_ret {
+        struct {
+                u_int              checkpoints_len;
+                remote_nonnull_domain_checkpoint * checkpoints_val;
+        } checkpoints;
+        int                        ret;
+};
+struct remote_domain_checkpoint_lookup_by_name_args {
+        remote_nonnull_domain      dom;
+        remote_nonnull_string      name;
+        u_int                      flags;
+};
+struct remote_domain_checkpoint_lookup_by_name_ret {
+        remote_nonnull_domain_checkpoint checkpoint;
+};
+struct remote_domain_has_current_checkpoint_args {
+        remote_nonnull_domain      dom;
+        u_int                      flags;
+};
+struct remote_domain_has_current_checkpoint_ret {
+        int                        result;
+};
+struct remote_domain_checkpoint_get_parent_args {
+        remote_nonnull_domain_checkpoint checkpoint;
+        u_int                      flags;
+};
+struct remote_domain_checkpoint_get_parent_ret {
+        remote_nonnull_domain_checkpoint parent;
+};
+struct remote_domain_checkpoint_current_args {
+        remote_nonnull_domain      dom;
+        u_int                      flags;
+};
+struct remote_domain_checkpoint_current_ret {
+        remote_nonnull_domain_checkpoint checkpoint;
+};
+struct remote_domain_checkpoint_is_current_args {
+        remote_nonnull_domain_checkpoint checkpoint;
+        u_int                      flags;
+};
+struct remote_domain_checkpoint_is_current_ret {
+        int                        current;
+};
+struct remote_domain_checkpoint_has_metadata_args {
+        remote_nonnull_domain_checkpoint checkpoint;
+        u_int                      flags;
+};
+struct remote_domain_checkpoint_has_metadata_ret {
+        int                        metadata;
+};
+struct remote_domain_checkpoint_delete_args {
+        remote_nonnull_domain_checkpoint checkpoint;
+        u_int                      flags;
+};
+struct remote_domain_backup_begin_args {
+        remote_nonnull_domain      dom;
+        remote_string              disk_xml;
+        remote_string              checkpoint_xml;
+        u_int                      flags;
+};
+struct remote_domain_backup_begin_ret {
+        int                        result;
+};
+struct remote_domain_backup_get_xml_desc_args {
+        remote_nonnull_domain      dom;
+        int                        id;
+        u_int                      flags;
+};
+struct remote_domain_backup_get_xml_desc_ret {
+        remote_nonnull_string      xml;
+};
+struct remote_domain_backup_end_args {
+        remote_nonnull_domain      dom;
+        int                        id;
+        u_int                      flags;
+};
+struct remote_domain_backup_end_ret {
+        int                        retcode;
+};
 enum remote_procedure {
         REMOTE_PROC_CONNECT_OPEN = 1,
         REMOTE_PROC_CONNECT_CLOSE = 2,
@@ -3368,4 +3483,18 @@ 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_CHECKPOINT_CREATE_XML = 402,
+        REMOTE_PROC_DOMAIN_CHECKPOINT_GET_XML_DESC = 403,
+        REMOTE_PROC_DOMAIN_LIST_CHECKPOINTS = 404,
+        REMOTE_PROC_DOMAIN_CHECKPOINT_LIST_CHILDREN = 405,
+        REMOTE_PROC_DOMAIN_CHECKPOINT_LOOKUP_BY_NAME = 406,
+        REMOTE_PROC_DOMAIN_HAS_CURRENT_CHECKPOINT = 407,
+        REMOTE_PROC_DOMAIN_CHECKPOINT_CURRENT = 408,
+        REMOTE_PROC_DOMAIN_CHECKPOINT_GET_PARENT = 409,
+        REMOTE_PROC_DOMAIN_CHECKPOINT_IS_CURRENT = 410,
+        REMOTE_PROC_DOMAIN_CHECKPOINT_HAS_METADATA = 411,
+        REMOTE_PROC_DOMAIN_CHECKPOINT_DELETE = 412,
+        REMOTE_PROC_DOMAIN_BACKUP_BEGIN = 413,
+        REMOTE_PROC_DOMAIN_BACKUP_GET_XML_DESC = 414,
+        REMOTE_PROC_DOMAIN_BACKUP_END = 415,
 };
diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
index 0c4648c0fb..348039af3d 100755
--- a/src/rpc/gendispatch.pl
+++ b/src/rpc/gendispatch.pl
@@ -1,6 +1,6 @@
 #!/usr/bin/env perl
 #
-# Copyright (C) 2010-2015 Red Hat, Inc.
+# Copyright (C) 2010-2018 Red Hat, Inc.
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -567,18 +567,20 @@ elsif ($mode eq "server") {
                     push(@args_list, "$2");
                     push(@free_list,
                          "    virObjectUnref($2);");
-                } elsif ($args_member =~ m/^remote_nonnull_domain_snapshot (\S+);$/) {
+                } elsif ($args_member =~ m/^remote_nonnull_domain_(checkpoint|snapshot) (\S+);$/) {
+                    my $type_name = name_to_TypeName($1);
+
                     push(@vars_list, "virDomainPtr dom = NULL");
-                    push(@vars_list, "virDomainSnapshotPtr snapshot = NULL");
+                    push(@vars_list, "virDomain${type_name}Ptr ${1} = NULL");
                     push(@getters_list,
-                         "    if (!(dom = get_nonnull_domain($conn, args->${1}.dom)))\n" .
+                         "    if (!(dom = get_nonnull_domain($conn, args->${2}.dom)))\n" .
                          "        goto cleanup;\n" .
                          "\n" .
-                         "    if (!(snapshot = get_nonnull_domain_snapshot(dom, args->${1})))\n" .
+                         "    if (!($1 = get_nonnull_domain_${1}(dom, args->$2)))\n" .
                          "        goto cleanup;\n");
-                    push(@args_list, "snapshot");
+                    push(@args_list, "$1");
                     push(@free_list,
-                         "    virObjectUnref(snapshot);\n" .
+                         "    virObjectUnref($1);\n" .
                          "    virObjectUnref(dom);");
                 } elsif ($args_member =~ m/^(?:(?:admin|remote)_string|remote_uuid) (\S+)<\S+>;/) {
                     push(@args_list, $conn) if !@args_list;
@@ -722,7 +724,7 @@ elsif ($mode eq "server") {
                         if (!$modern_ret_as_list) {
                             push(@ret_list, "ret->$3 = tmp.$3;");
                         }
-                    } elsif ($ret_member =~ m/(?:admin|remote)_nonnull_(secret|nwfilter|nwfilter_binding|node_device|interface|network|storage_vol|storage_pool|domain_snapshot|domain|server|client) (\S+)<(\S+)>;/) {
+                    } elsif ($ret_member =~ m/(?:admin|remote)_nonnull_(secret|nwfilter|nwfilter_binding|node_device|interface|network|storage_vol|storage_pool|domain_checkpoint|domain_snapshot|domain|server|client) (\S+)<(\S+)>;/) {
                         $modern_ret_struct_name = $1;
                         $single_ret_list_error_msg_type = $1;
                         $single_ret_list_name = $2;
@@ -780,7 +782,7 @@ elsif ($mode eq "server") {
                     $single_ret_var = $1;
                     $single_ret_by_ref = 0;
                     $single_ret_check = " == NULL";
-                } elsif ($ret_member =~ m/^remote_nonnull_(domain|network|storage_pool|storage_vol|interface|node_device|secret|nwfilter|nwfilter_binding|domain_snapshot) (\S+);/) {
+                } elsif ($ret_member =~ m/^remote_nonnull_(domain|network|storage_pool|storage_vol|interface|node_device|secret|nwfilter|nwfilter_binding|domain_checkpoint|domain_snapshot) (\S+);/) {
                     my $type_name = name_to_TypeName($1);

                     if ($call->{ProcName} eq "DomainCreateWithFlags") {
@@ -1325,13 +1327,13 @@ elsif ($mode eq "client") {
                     $priv_src = "dev->conn";
                     push(@args_list, "virNodeDevicePtr dev");
                     push(@setters_list, "args.name = dev->name;");
-                } elsif ($args_member =~ m/^remote_nonnull_(domain|network|storage_pool|storage_vol|interface|secret|nwfilter|nwfilter_binding|domain_snapshot) (\S+);/) {
+                } elsif ($args_member =~ m/^remote_nonnull_(domain|network|storage_pool|storage_vol|interface|secret|nwfilter|nwfilter_binding|domain_checkpoint|domain_snapshot) (\S+);/) {
                     my $name = $1;
                     my $arg_name = $2;
                     my $type_name = name_to_TypeName($name);

                     if ($is_first_arg) {
-                        if ($name eq "domain_snapshot") {
+                        if ($name =~ m/^domain_.*/) {
                             $priv_src = "$arg_name->domain->conn";
                         } else {
                             $priv_src = "$arg_name->conn";
@@ -1518,7 +1520,7 @@ elsif ($mode eq "client") {
                         }

                         push(@ret_list, "memcpy(result->$3, ret.$3, sizeof(result->$3));");
-                    } elsif ($ret_member =~ m/(?:admin|remote)_nonnull_(secret|nwfilter|nwfilter_binding|node_device|interface|network|storage_vol|storage_pool|domain_snapshot|domain|server|client) (\S+)<(\S+)>;/) {
+                    } elsif ($ret_member =~ m/(?:admin|remote)_nonnull_(secret|nwfilter|nwfilter_binding|node_device|interface|network|storage_vol|storage_pool|domain_checkpoint|domain_snapshot|domain|server|client) (\S+)<(\S+)>;/) {
                         my $proc_name = name_to_TypeName($1);

                         if ($structprefix eq "admin") {
@@ -1571,7 +1573,7 @@ elsif ($mode eq "client") {
                     push(@ret_list, "VIR_FREE(ret.$1);");
                     $single_ret_var = "char *rv = NULL";
                     $single_ret_type = "char *";
-                } elsif ($ret_member =~ m/^remote_nonnull_(domain|network|storage_pool|storage_vol|node_device|interface|secret|nwfilter|nwfilter_binding|domain_snapshot) (\S+);/) {
+                } elsif ($ret_member =~ m/^remote_nonnull_(domain|network|storage_pool|storage_vol|node_device|interface|secret|nwfilter|nwfilter_binding|domain_checkpoint|domain_snapshot) (\S+);/) {
                     my $name = $1;
                     my $arg_name = $2;
                     my $type_name = name_to_TypeName($name);
@@ -1585,7 +1587,7 @@ elsif ($mode eq "client") {
                         $single_ret_var = "int rv = -1";
                         $single_ret_type = "int";
                     } else {
-                        if ($name eq "domain_snapshot") {
+                        if ($name =~ m/^domain_.*/) {
                             my $dom = "$priv_src";
                             $dom =~ s/->conn//;
                             push(@ret_list, "rv = get_nonnull_$name($dom, ret.$arg_name);");
@@ -1928,7 +1930,7 @@ elsif ($mode eq "client") {
             print "    }\n";
             print "\n";
         } elsif ($modern_ret_as_list) {
-            if ($modern_ret_struct_name =~ m/domain_snapshot|client/) {
+            if ($modern_ret_struct_name =~ m/domain_checkpoint|domain_snapshot|client/) {
                 $priv_src =~ s/->conn//;
             }
             print "    if (result) {\n";
-- 
2.17.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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