Re: [libvirt] Re: [PATCH 04/12] Domain Events - rpc changes

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

 



On Fri, Oct 17, 2008 at 11:58:15AM -0400, Ben Guthro wrote:
> Changes to the RPC protocol
> 
>  remote_dispatch_localvars.h   |    3 +++
>  remote_dispatch_proc_switch.h |   18 ++++++++++++++++++
>  remote_dispatch_prototypes.h  |    3 +++
>  remote_protocol.c             |   35 +++++++++++++++++++++++++++++++++++
>  remote_protocol.h             |   28 ++++++++++++++++++++++++++++
>  remote_protocol.x             |   23 ++++++++++++++++++++++-
>  6 files changed, 109 insertions(+), 1 deletion(-)

[snip generated code]

> diff --git a/qemud/remote_protocol.x b/qemud/remote_protocol.x
> index f1bd9ff..5981702 100644
> --- a/qemud/remote_protocol.x
> +++ b/qemud/remote_protocol.x
> @@ -965,6 +965,23 @@ struct remote_storage_vol_get_path_ret {
>      remote_nonnull_string name;
>  };
>  
> +/* Events */
> +struct remote_domain_events_register_args {
> +    unsigned long int callback;      /* To store a client pointer */
> +    unsigned long int user_data;     /* For the remote callback opaque data */
> +};
> +
> +struct remote_domain_events_deregister_args {
> +    unsigned long int callback;     /* To store a client pointer */
> +};
> +
> +struct remote_domain_event_ret {
> +    remote_nonnull_domain dom;
> +    int event;
> +    unsigned long int callback;
> +    unsigned long int user_data;
> +};

Using a 'unsigned long int' field to transmit the raw pointer feels a little
wrong to me. Could we have the client side pass a simple integer 'token' when
registering / unregistering, and have that 'token' passed back by the server
in the actual event. The client could use this token to lookup the callback
and user_data. 

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
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]