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

Re: [libvirt] [PATCH] Add new API virDomainBlockPull* to header and drivers



2011/6/1 Adam Litke <agl us ibm com>:
> Set up the types for the block pull functions and insert them into the
> virDriver structure definition.  Because of static initializers, update every
> driver and set the new fields to NULL.
>
> * include/libvirt/libvirt.h.in: new API
> * src/driver.h src/*/*_driver.c src/vbox/vbox_tmpl.c: add the new
>  entry to the driver structure
> * python/generator.py: fix compiler errors, the actual python bindings are
>  implemented later
>
> Signed-off-by: Adam Litke <agl us ibm com>
> ---
>  include/libvirt/libvirt.h.in |   92 ++++++++++++++++++++++++++++++++++++++++++
>  python/generator.py          |    3 +
>  src/driver.h                 |   21 ++++++++++
>  src/esx/esx_driver.c         |    4 ++
>  src/lxc/lxc_driver.c         |    4 ++
>  src/openvz/openvz_driver.c   |    4 ++
>  src/phyp/phyp_driver.c       |    4 ++
>  src/qemu/qemu_driver.c       |    4 ++
>  src/remote/remote_driver.c   |    4 ++
>  src/test/test_driver.c       |    4 ++
>  src/uml/uml_driver.c         |    4 ++
>  src/vbox/vbox_tmpl.c         |    4 ++
>  src/xen/xen_driver.c         |    4 ++

Changing all the other driver files will go away when you rebase to
git head because of named initializers.

>  13 files changed, 156 insertions(+), 0 deletions(-)
>
> diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
> index 5783303..9af1b76 100644
> --- a/include/libvirt/libvirt.h.in
> +++ b/include/libvirt/libvirt.h.in
> @@ -1145,6 +1145,98 @@ int virDomainUpdateDeviceFlags(virDomainPtr domain,
>                                const char *xml, unsigned int flags);
>
>  /*
> + * BlockPull API
> + */
> +
> +/* An iterator for initiating and monitoring block pull operations */
> +typedef unsigned long long virDomainBlockPullCursor;
> +
> +typedef struct _virDomainBlockPullInfo virDomainBlockPullInfo;
> +struct _virDomainBlockPullInfo {
> +    /*
> +     * The following fields provide an indication of block pull progress.   cur
> +     * indicates the current position and will be between 0 and @end.   end is
> +     * the final cursor position for this operation and represents completion.
> +     * To approximate progress, divide @cur by @end.
> +     */
> +    virDomainBlockPullCursor cur;
> +    virDomainBlockPullCursor end;
> +};
> +typedef virDomainBlockPullInfo *virDomainBlockPullInfoPtr;
> +
> +/**
> + * virDomainBlockPull:
> + * @dom: pointer to domain object
> + * @path: Fully-qualified filename of disk
> + * @info: A pointer to a virDomainBlockPullInfo structure, or NULL
> + * @flags: currently unused, for future extension
> + *
> + * Populate a disk image with data from its backing image.  Once all data from
> + * its backing image has been pulled, the disk no longer depends on a backing
> + * image.  This function works incrementally, performing a small amount of work
> + * each time it is called.  When successful, @info is updated with the current
> + * progress.
> + *
> + * Returns -1 in case of failure, 0 when successful.
> + */
> +int                 virDomainBlockPull(virDomainPtr dom,
> +                                       const char *path,
> +                                       virDomainBlockPullInfoPtr info,
> +                                       unsigned int flags);
> +

You're documenting the functions twice, in libvirt.h and in libvirt.c.
Typically the functions are just documented in libvirt.c.

Matthias


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