2011/6/1 Adam Litke <agl@xxxxxxxxxx>: > On 06/01/2011 12:13 PM, Matthias Bolte wrote: >> 2011/6/1 Adam Litke <agl@xxxxxxxxxx>: >> >> This commit has a pretty long summary line. > > Fixed. > >>> * src/remote/remote_protocol.x: provide defines for the new entry points >>> * src/remote/remote_driver.c daemon/remote.c: implement the client and >>> Âserver side >>> * daemon/remote_generator.pl: Specify the manually-written functions >>> >>> Signed-off-by: Adam Litke <agl@xxxxxxxxxx> >>> --- >>> Âdaemon/remote.c       Â|  71 +++++++++++++++++++++++++++++++++++++++++ >>> Âdaemon/remote_generator.pl  |  Â8 +++- >>> Âsrc/remote/remote_driver.c  |  72 +++++++++++++++++++++++++++++++++++++++-- >>> Âsrc/remote/remote_protocol.x |  44 +++++++++++++++++++++++++- >>> Â4 files changed, 188 insertions(+), 7 deletions(-) >>> >>> diff --git a/daemon/remote.c b/daemon/remote.c >>> index 2220655..f6aa78e 100644 >>> --- a/daemon/remote.c >>> +++ b/daemon/remote.c >>> @@ -1692,6 +1692,77 @@ no_memory: >>>   goto cleanup; >>> Â} >>> >>> +static int >>> +remoteDispatchDomainBlockPull(struct qemud_server *server ATTRIBUTE_UNUSED, >>> +               Âstruct qemud_client *client ATTRIBUTE_UNUSED, >>> +               ÂvirConnectPtr conn, >>> +               Âremote_message_header *hdr ATTRIBUTE_UNUSED, >>> +               Âremote_error * rerr, >>> +               Âremote_domain_block_pull_args *args, >>> +               Âremote_domain_block_pull_ret *ret) >>> +{ >>> +  ÂvirDomainPtr dom = NULL; >>> +  ÂvirDomainBlockPullInfo tmp; >>> +  Âint rv = -1; >>> + >>> +  Âif (!conn) { >>> +    ÂvirNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open")); >>> +    Âgoto cleanup; >>> +  Â} >>> + >>> +  Âif (!(dom = get_nonnull_domain(conn, args->dom))) >>> +    Âgoto cleanup; >>> + >>> +  Âif (virDomainBlockPull(dom, args->path, &tmp, args->flags) < 0) >>> +    Âgoto cleanup; >>> +  Ârv = 0; >>> +  Âret->info.cur = tmp.cur; >>> +  Âret->info.end = tmp.end; >>> + >>> +cleanup: >>> +  Âif (rv < 0) >>> +    ÂremoteDispatchError(rerr); >>> +  Âif (dom) >>> +    ÂvirDomainFree(dom); >>> +  Âreturn rv; >>> +} >>> + >>> +static int >>> +remoteDispatchDomainGetBlockPullInfo(struct qemud_server *server ATTRIBUTE_UNUSED, >>> +                   struct qemud_client *client ATTRIBUTE_UNUSED, >>> +                   virConnectPtr conn, >>> +                   remote_message_header *hdr ATTRIBUTE_UNUSED, >>> +                   remote_error * rerr, >>> +                   remote_domain_get_block_pull_info_args *args, >>> +                   remote_domain_get_block_pull_info_ret *ret) >>> +{ >>> +  ÂvirDomainPtr dom = NULL; >>> +  ÂvirDomainBlockPullInfo tmp; >>> +  Âint rv = -1; >>> + >>> +  Âif (!conn) { >>> +    ÂvirNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open")); >>> +    Âgoto cleanup; >>> +  Â} >>> + >>> +  Âif (!(dom = get_nonnull_domain(conn, args->dom))) >>> +    Âgoto cleanup; >>> + >>> +  Âif (virDomainGetBlockPullInfo(dom, args->path, &tmp, args->flags) < 0) >>> +    Âgoto cleanup; >>> +  Ârv = 0; >>> +  Âret->info.cur = tmp.cur; >>> +  Âret->info.end = tmp.end; >>> + >>> +cleanup: >>> +  Âif (rv < 0) >>> +    ÂremoteDispatchError(rerr); >>> +  Âif (dom) >>> +    ÂvirDomainFree(dom); >>> +  Âreturn rv; >>> +} >> >> The generator should be able to deal with this. I might have to tweak >> it to handle multi-return-value procedures more general. > > That would be excellent. ÂI am not doing anything particularly special. Yes works almost fine. I've attached a patch for the generator to deal with the placement of the struct in the signature. >>> Âstruct remote_num_of_networks_ret { >>> @@ -2176,7 +2213,12 @@ enum remote_procedure { >>>   REMOTE_PROC_DOMAIN_GET_BLKIO_PARAMETERS = 206, >>>   REMOTE_PROC_DOMAIN_MIGRATE_SET_MAX_SPEED = 207, >>>   REMOTE_PROC_STORAGE_VOL_UPLOAD = 208, >>> -  ÂREMOTE_PROC_STORAGE_VOL_DOWNLOAD = 209 >>> +  ÂREMOTE_PROC_STORAGE_VOL_DOWNLOAD = 209, >>> +  ÂREMOTE_PROC_DOMAIN_BLOCK_PULL = 210, >>> + >>> +  ÂREMOTE_PROC_DOMAIN_BLOCK_PULL_ALL = 211, >>> +  ÂREMOTE_PROC_DOMAIN_BLOCK_PULL_ABORT = 212, >>> +  ÂREMOTE_PROC_DOMAIN_GET_BLOCK_PULL_INFO = 213 >> >> Annotations for the generator go here. > > I am not sure what you mean by annotations for the generator. ÂCould you > explain further? Instead of the blacklist in the generator each procedure has a comment that tells the generator how to handle it. It's explained in the .x file. >> I also miss corresponding updates to src/remote_protocol-structs. > > Isn't this file generated from remote-protocol.x? ÂIt seems to have > exactly the same information. This file is not generated, it is used to verify that the existing XDR protocol is not changed, but only extended. When you have pdwtags installed the make check will verify this. Matthias
From 2c3c6e3bf72b5db6e01e4b333d000bb051a7019d Mon Sep 17 00:00:00 2001 From: Matthias Bolte <matthias.bolte@xxxxxxxxxxxxxx> Date: Wed, 1 Jun 2011 20:33:05 +0200 Subject: [PATCH] remote generator: Handle virDomainGetBlockPullInfo --- daemon/remote_generator.pl | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/daemon/remote_generator.pl b/daemon/remote_generator.pl index e204b76..2120e27 100755 --- a/daemon/remote_generator.pl +++ b/daemon/remote_generator.pl @@ -668,9 +668,10 @@ elsif ($opt_b) { my $struct_name = $call->{ProcName}; $struct_name =~ s/Get//; - if ($call->{ProcName} eq "DomainGetBlockInfo") { - # SPECIAL: virDomainGetBlockInfo has flags parameter after - # the struct parameter in its signature + if ($call->{ProcName} eq "DomainGetBlockInfo" || + $call->{ProcName} eq "DomainGetBlockPullInfo") { + # SPECIAL: virDomainGetBlockInfo and DomainGetBlockPullInfo have + # flags parameter after the struct parameter in the signature my $flags = pop(@args_list); push(@args_list, "&tmp"); push(@args_list, $flags); @@ -1203,9 +1204,10 @@ elsif ($opt_k) { my $struct_name = $call->{ProcName}; $struct_name =~ s/Get//; - if ($call->{ProcName} eq "DomainGetBlockInfo") { - # SPECIAL: virDomainGetBlockInfo has flags parameter after - # the struct parameter in its signature + if ($call->{ProcName} eq "DomainGetBlockInfo" || + $call->{ProcName} eq "DomainGetBlockPullInfo") { + # SPECIAL: virDomainGetBlockInfo and DomainGetBlockPullInfo have + # flags parameter after the struct parameter in the signature $last_arg = pop(@args_list); } -- 1.7.0.4
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list