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

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

 



2011/6/1 Adam Litke <agl@xxxxxxxxxx>:
> 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@xxxxxxxxxx>
> ---
> Â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

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