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

[libvirt] Re: [PATCH 4/6] remote-driver: Add domainMemoryStats support



On Thu, Dec 17, 2009 at 05:41:45PM -0500, Adam Litke wrote:
> Use a dynamically sized xdr_array to pass memory stats on the wire.  This
> supports the addition of future memory stats and reduces the message size since
> only supported statistics are returned.
> 
> Signed-off-by: Adam Litke <agl us ibm com>
> To: libvirt list <libvir-list redhat com>
> Cc: Daniel Veillard <veillard redhat com>
> Cc: Daniel P. Berrange <berrange redhat com>
> ---
>  daemon/remote.c              |   56 ++++++++++++++++++++++++++++++++++++++++++
>  src/remote/remote_driver.c   |   44 ++++++++++++++++++++++++++++++++-
>  src/remote/remote_protocol.c |   35 ++++++++++++++++++++++++++
>  src/remote/remote_protocol.h |   25 ++++++++++++++++++
>  src/remote/remote_protocol.x |   18 ++++++++++++-
>  5 files changed, 176 insertions(+), 2 deletions(-)
> 


> +struct remote_domain_memory_stats_ret {
> +        u_int len;
> +        struct remote_domain_memory_stat *stats;
> +};
> +typedef struct remote_domain_memory_stats_ret remote_domain_memory_stats_ret;



> +
> +struct remote_domain_memory_stats_ret {
> +    u_int len;
> +    remote_domain_memory_stat<REMOTE_DOMAIN_MEMORY_STATS_MAX>;
> +};

Something odd happened in the RPC generated code here, because rpcgen
should create you an explicit length field without you needing one. I
think it is because I forgot the param name on the array in the 
example I gave you. Basically it should work just like the existing
'struct remote_domain_get_scheduler_parameters_ret' definition

   struct remote_domain_memory_stats_ret {
      remote_domain_memory_stat stats<REMOTE_DOMAIN_MEMORY_STATS_MAX>;
  };


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


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