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(a)redhat.com>
---
src/remote/remote_daemon_dispatch.c | 15 +++
src/remote/remote_driver.c | 31 ++++-
src/remote/remote_protocol.x | 237 +++++++++++++++++++++++++++++++++++-
src/remote_protocol-structs | 129 ++++++++++++++++++++
src/rpc/gendispatch.pl | 32 ++---
5 files changed, 426 insertions(+), 18 deletions(-)
diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c
index f1a5ba2590..b8247c34d9 100644
--- a/src/remote/remote_daemon_dispatch.c
+++ b/src/remote/remote_daemon_dispatch.c
@@ -90,6 +90,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 virSecretPtr get_nonnull_secret(virConnectPtr conn, remote_nonnull_secret
secret);
static virNWFilterPtr get_nonnull_nwfilter(virConnectPtr conn, remote_nonnull_nwfilter
nwfilter);
+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);
@@ -100,6 +101,7 @@ static void make_nonnull_storage_vol(remote_nonnull_storage_vol
*vol_dst, virSto
static void make_nonnull_node_device(remote_nonnull_node_device *dev_dst,
virNodeDevicePtr dev_src);
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_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
@@ -7087,6 +7089,12 @@ get_nonnull_nwfilter(virConnectPtr conn, remote_nonnull_nwfilter
nwfilter)
return virGetNWFilter(conn, nwfilter.name, BAD_CAST nwfilter.uuid);
}
+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)
{
@@ -7159,6 +7167,13 @@ make_nonnull_nwfilter(remote_nonnull_nwfilter *nwfilter_dst,
virNWFilterPtr nwfi
memcpy(nwfilter_dst->uuid, nwfilter_src->uuid, VIR_UUID_BUFLEN);
}
+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 1328f910b0..9a4ea68410 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -146,6 +146,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);
@@ -156,6 +157,7 @@ static void
make_nonnull_node_device(remote_nonnull_node_device *dev_dst, virNodeDevicePtr dev_src);
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_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);
/*----------------------------------------------------------------------*/
@@ -8206,6 +8208,12 @@ get_nonnull_nwfilter(virConnectPtr conn, remote_nonnull_nwfilter
nwfilter)
return virGetNWFilter(conn, nwfilter.name, BAD_CAST nwfilter.uuid);
}
+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)
{
@@ -8273,6 +8281,13 @@ make_nonnull_nwfilter(remote_nonnull_nwfilter *nwfilter_dst,
virNWFilterPtr nwfi
memcpy(nwfilter_dst->uuid, nwfilter_src->uuid, VIR_UUID_BUFLEN);
}
+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)
{
@@ -8521,7 +8536,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.5.0 */
+ .domainCheckpointGetXMLDesc = remoteDomainCheckpointGetXMLDesc, /* 4.5.0 */
+ .domainListCheckpoints = remoteDomainListCheckpoints, /* 4.5.0 */
+ .domainCheckpointListChildren = remoteDomainCheckpointListChildren, /* 4.5.0 */
+ .domainCheckpointLookupByName = remoteDomainCheckpointLookupByName, /* 4.5.0 */
+ .domainHasCurrentCheckpoint = remoteDomainHasCurrentCheckpoint, /* 4.5.0 */
+ .domainCheckpointGetParent = remoteDomainCheckpointGetParent, /* 4.5.0 */
+ .domainCheckpointCurrent = remoteDomainCheckpointCurrent, /* 4.5.0 */
+ .domainCheckpointIsCurrent = remoteDomainCheckpointIsCurrent, /* 4.5.0 */
+ .domainCheckpointHasMetadata = remoteDomainCheckpointHasMetadata, /* 4.5.0 */
+ .domainCheckpointDelete = remoteDomainCheckpointDelete, /* 4.5.0 */
+ .domainBackupBegin = remoteDomainBackupBegin, /* 4.5.0 */
+ .domainBackupGetXMLDesc = remoteDomainBackupGetXMLDesc, /* 4.5.0 */
+ .domainBackupEnd = remoteDomainBackupEnd, /* 4.5.0 */
};
static virNetworkDriver network_driver = {
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 162cf5e61b..a306a46435 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
@@ -136,6 +136,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;
@@ -312,6 +315,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;
@@ -3505,6 +3514,138 @@ struct remote_domain_get_launch_security_info_ret {
remote_typed_param params<REMOTE_DOMAIN_LAUNCH_SECURITY_INFO_PARAMS_MAX>;
};
+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. -----*/
/* Define the program number, protocol version and procedure numbers here. */
@@ -6224,5 +6365,97 @@ enum remote_procedure {
* @generate: none
* @acl: domain:read
*/
- REMOTE_PROC_DOMAIN_GET_LAUNCH_SECURITY_INFO = 396
+ REMOTE_PROC_DOMAIN_GET_LAUNCH_SECURITY_INFO = 396,
+
+ /**
+ * @generate: both
+ * @acl: domain:checkpoint
+ */
+ REMOTE_PROC_DOMAIN_CHECKPOINT_CREATE_XML = 397,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: domain:read
+ * @acl: domain:read_secure:VIR_DOMAIN_XML_SECURE
+ */
+ REMOTE_PROC_DOMAIN_CHECKPOINT_GET_XML_DESC = 398,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: domain:read
+ */
+ REMOTE_PROC_DOMAIN_LIST_CHECKPOINTS = 399,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: domain:read
+ */
+ REMOTE_PROC_DOMAIN_CHECKPOINT_LIST_CHILDREN = 400,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: domain:read
+ */
+ REMOTE_PROC_DOMAIN_CHECKPOINT_LOOKUP_BY_NAME = 401,
+
+ /**
+ * @generate: both
+ * @acl: domain:read
+ */
+ REMOTE_PROC_DOMAIN_HAS_CURRENT_CHECKPOINT = 402,
+
+ /**
+ * @generate: both
+ * @acl: domain:read
+ */
+ REMOTE_PROC_DOMAIN_CHECKPOINT_CURRENT = 403,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: domain:read
+ */
+ REMOTE_PROC_DOMAIN_CHECKPOINT_GET_PARENT = 404,
+
+ /**
+ * @generate: both
+ * @acl: domain:read
+ */
+ REMOTE_PROC_DOMAIN_CHECKPOINT_IS_CURRENT = 405,
+
+ /**
+ * @generate: both
+ * @acl: domain:read
+ */
+ REMOTE_PROC_DOMAIN_CHECKPOINT_HAS_METADATA = 406,
+
+ /**
+ * @generate: both
+ * @acl: domain:checkpoint
+ */
+ REMOTE_PROC_DOMAIN_CHECKPOINT_DELETE = 407,
+
+ /**
+ * @generate: both
+ * @acl: domain:checkpoint
+ * @acl: domain:block_read
+ */
+ REMOTE_PROC_DOMAIN_BACKUP_BEGIN = 408,
+
+ /**
+ * @generate: both
+ * @acl: domain:read
+ * @acl: domain:read_secure:VIR_DOMAIN_XML_SECURE
+ */
+ REMOTE_PROC_DOMAIN_BACKUP_GET_XML_DESC = 409,
+
+ /**
+ * @generate: both
+ * @acl: domain:checkpoint
+ */
+ REMOTE_PROC_DOMAIN_BACKUP_END = 410
};
diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
index 0c75ad2305..9c7b116151 100644
--- a/src/remote_protocol-structs
+++ b/src/remote_protocol-structs
@@ -42,6 +42,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;
@@ -2928,6 +2932,117 @@ struct remote_domain_get_launch_security_info_ret {
remote_typed_param * params_val;
} params;
};
+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,
@@ -3325,4 +3440,18 @@ enum remote_procedure {
REMOTE_PROC_CONNECT_BASELINE_HYPERVISOR_CPU = 394,
REMOTE_PROC_NODE_GET_SEV_INFO = 395,
REMOTE_PROC_DOMAIN_GET_LAUNCH_SECURITY_INFO = 396,
+ REMOTE_PROC_DOMAIN_CHECKPOINT_CREATE_XML = 397,
+ REMOTE_PROC_DOMAIN_CHECKPOINT_GET_XML_DESC = 398,
+ REMOTE_PROC_DOMAIN_LIST_CHECKPOINTS = 399,
+ REMOTE_PROC_DOMAIN_CHECKPOINT_LIST_CHILDREN = 400,
+ REMOTE_PROC_DOMAIN_CHECKPOINT_LOOKUP_BY_NAME = 401,
+ REMOTE_PROC_DOMAIN_HAS_CURRENT_CHECKPOINT = 402,
+ REMOTE_PROC_DOMAIN_CHECKPOINT_CURRENT = 403,
+ REMOTE_PROC_DOMAIN_CHECKPOINT_GET_PARENT = 404,
+ REMOTE_PROC_DOMAIN_CHECKPOINT_IS_CURRENT = 405,
+ REMOTE_PROC_DOMAIN_CHECKPOINT_HAS_METADATA = 406,
+ REMOTE_PROC_DOMAIN_CHECKPOINT_DELETE = 407,
+ REMOTE_PROC_DOMAIN_BACKUP_BEGIN = 408,
+ REMOTE_PROC_DOMAIN_BACKUP_GET_XML_DESC = 409,
+ REMOTE_PROC_DOMAIN_BACKUP_END = 410,
};
diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
index b8b83b6b40..b40efd91d0 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|node_device|interface|network|storage_vol|storage_pool|domain_snapshot|domain|server|client)
(\S+)<(\S+)>;/) {
+ } elsif ($ret_member =~
m/(?:admin|remote)_nonnull_(secret|nwfilter|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|domain_snapshot)
(\S+);/) {
+ } elsif ($ret_member =~
m/^remote_nonnull_(domain|network|storage_pool|storage_vol|interface|node_device|secret|nwfilter|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|domain_snapshot)
(\S+);/) {
+ } elsif ($args_member =~
m/^remote_nonnull_(domain|network|storage_pool|storage_vol|interface|secret|nwfilter|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|node_device|interface|network|storage_vol|storage_pool|domain_snapshot|domain|server|client)
(\S+)<(\S+)>;/) {
+ } elsif ($ret_member =~
m/(?:admin|remote)_nonnull_(secret|nwfilter|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|domain_snapshot)
(\S+);/) {
+ } elsif ($ret_member =~
m/^remote_nonnull_(domain|network|storage_pool|storage_vol|node_device|interface|secret|nwfilter|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.14.4