Re: [libvirt] [PATCH 3/9] Remote driver implmentation of job info API

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

 



On Thu, Feb 18, 2010 at 03:56:09PM +0000, Daniel P. Berrange wrote:
> * src/remote/remote_protocol.x: Define wire protocol format
>   for virDomainGetJobInfo API
> * src/remote/remote_driver.c, daemon/remote.c: Implement client
>   and server marshalling code for virDomainGetJobInfo()
> * daemon/remote_dispatch_args.h, daemon/remote_dispatch_prototypes.h
>   daemon/remote_dispatch_ret.h, daemon/remote_dispatch_table.h,
>   src/remote/remote_protocol.c, src/remote/remote_protocol.h: Rebuild
>   files from src/remote/remote_protocol.x
> ---
>  daemon/remote.c                     |   44 +++++++++++++++++++++++++++++++++++
>  daemon/remote_dispatch_args.h       |    1 +
>  daemon/remote_dispatch_prototypes.h |    8 ++++++
>  daemon/remote_dispatch_ret.h        |    1 +
>  daemon/remote_dispatch_table.h      |    5 ++++
>  src/remote/remote_driver.c          |   42 ++++++++++++++++++++++++++++++++-
>  src/remote/remote_protocol.c        |   40 +++++++++++++++++++++++++++++++
>  src/remote/remote_protocol.h        |   26 ++++++++++++++++++++
>  src/remote/remote_protocol.x        |   27 ++++++++++++++++++++-
>  9 files changed, 192 insertions(+), 2 deletions(-)
> 
> diff --git a/daemon/remote.c b/daemon/remote.c
> index eacc6f9..67d663e 100644
> --- a/daemon/remote.c
> +++ b/daemon/remote.c
> @@ -5386,6 +5386,50 @@ remoteDispatchCpuBaseline(struct qemud_server *server ATTRIBUTE_UNUSED,
>      }
>  
>      ret->cpu = cpu;
> +
> +    return 0;
> +}
> +
> +
> +static int
> +remoteDispatchDomainGetJobInfo (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_job_info_args *args,
> +                                remote_domain_get_job_info_ret *ret)
> +{
> +    virDomainPtr dom;
> +    virDomainJobInfo info;
> +
> +    dom = get_nonnull_domain (conn, args->dom);
> +    if (dom == NULL) {
> +        remoteDispatchConnError(rerr, conn);
> +        return -1;
> +    }
> +
> +    if (virDomainGetJobInfo (dom, &info) == -1) {
> +        virDomainFree(dom);
> +        remoteDispatchConnError(rerr, conn);
> +        return -1;
> +    }
> +
> +    ret->type = info.type;
> +    ret->timeElapsed = info.timeElapsed;
> +    ret->timeRemaining = info.timeRemaining;
> +    ret->dataTotal = info.dataTotal;
> +    ret->dataProcessed = info.dataProcessed;
> +    ret->dataRemaining = info.dataRemaining;
> +    ret->memTotal = info.memTotal;
> +    ret->memProcessed = info.memProcessed;
> +    ret->memRemaining = info.memRemaining;
> +    ret->fileTotal = info.fileTotal;
> +    ret->fileProcessed = info.fileProcessed;
> +    ret->fileRemaining = info.fileRemaining;
> +
> +    virDomainFree(dom);
> +
>      return 0;
>  }

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

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