snapshot: remote protocol for getparent

Mostly straight-forward, although this is the first API that
returns a new snapshot based on a snapshot rather than a domain.

* src/remote/remote_protocol.x
(REMOTE_PROC_DOMAIN_SNAPSHOT_GET_PARENT): New rpc.
(remote_domain_snapshot_get_parent_args)
(remote_domain_snapshot_get_parent_ret): New structs.
* src/rpc/gendispatch.pl: Adjust generator.
* src/remote/remote_driver.c (remote_driver): Use it.
* src/remote_protocol-structs: Update.
This commit is contained in:
Eric Blake 2011-09-24 13:19:35 -06:00
parent a2f706de93
commit 3ca4296f80
4 changed files with 23 additions and 2 deletions

View File

@ -4412,6 +4412,7 @@ static virDriver remote_driver = {
.domainSnapshotListNames = remoteDomainSnapshotListNames, /* 0.8.0 */
.domainSnapshotLookupByName = remoteDomainSnapshotLookupByName, /* 0.8.0 */
.domainHasCurrentSnapshot = remoteDomainHasCurrentSnapshot, /* 0.8.0 */
.domainSnapshotGetParent = remoteDomainSnapshotGetParent, /* 0.9.7 */
.domainSnapshotCurrent = remoteDomainSnapshotCurrent, /* 0.8.0 */
.domainRevertToSnapshot = remoteDomainRevertToSnapshot, /* 0.8.0 */
.domainSnapshotDelete = remoteDomainSnapshotDelete, /* 0.8.0 */

View File

@ -2081,6 +2081,15 @@ struct remote_domain_has_current_snapshot_ret {
int result;
};
struct remote_domain_snapshot_get_parent_args {
remote_nonnull_domain_snapshot snap;
unsigned int flags;
};
struct remote_domain_snapshot_get_parent_ret {
remote_nonnull_domain_snapshot snap;
};
struct remote_domain_snapshot_current_args {
remote_nonnull_domain dom;
unsigned int flags;
@ -2509,7 +2518,8 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_EVENT_BLOCK_JOB = 241, /* skipgen skipgen */
REMOTE_PROC_DOMAIN_MIGRATE_GET_MAX_SPEED = 242, /* autogen autogen */
REMOTE_PROC_DOMAIN_BLOCK_STATS_FLAGS = 243 /* skipgen skipgen */
REMOTE_PROC_DOMAIN_BLOCK_STATS_FLAGS = 243, /* skipgen skipgen */
REMOTE_PROC_DOMAIN_SNAPSHOT_GET_PARENT = 244 /* autogen autogen */
/*
* Notice how the entries are grouped in sets of 10 ?

View File

@ -1568,6 +1568,13 @@ struct remote_domain_has_current_snapshot_args {
struct remote_domain_has_current_snapshot_ret {
int result;
};
struct remote_domain_snapshot_get_parent_args {
remote_nonnull_domain_snapshot snap;
u_int flags;
};
struct remote_domain_snapshot_get_parent_ret {
remote_nonnull_domain_snapshot snap;
};
struct remote_domain_snapshot_current_args {
remote_nonnull_domain dom;
u_int flags;
@ -1958,4 +1965,5 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_EVENT_BLOCK_JOB = 241,
REMOTE_PROC_DOMAIN_MIGRATE_GET_MAX_SPEED = 242,
REMOTE_PROC_DOMAIN_BLOCK_STATS_FLAGS = 243,
REMOTE_PROC_DOMAIN_SNAPSHOT_GET_PARENT = 244,
};

View File

@ -1273,7 +1273,9 @@ elsif ($opt_k) {
$single_ret_type = "int";
} else {
if ($name eq "domain_snapshot") {
push(@ret_list, "rv = get_nonnull_$name(dom, ret.$arg_name);");
my $dom = "$priv_src";
$dom =~ s/->conn//;
push(@ret_list, "rv = get_nonnull_$name($dom, ret.$arg_name);");
} else {
push(@ret_list, "rv = get_nonnull_$name($priv_src, ret.$arg_name);");
}