[libvirt] [PATCH 2/6] Add public APIs for storage volume upload/download

Eric Blake eblake at redhat.com
Thu Mar 24 23:04:09 UTC 2011


On 03/23/2011 11:36 AM, Daniel P. Berrange wrote:
> New APIs are added allowing streaming of content to/from
> storage volumes.
> 
> * include/libvirt/libvirt.h.in: Add virStorageVolUpload and
>   virStorageVolDownload APIs
> * src/driver.h, src/libvirt.c, src/libvirt_public.syms: Stub
>   code for new APIs
> * src/storage/storage_driver.c, src/esx/esx_storage_driver.c:
>   Add dummy entries in driver table for new APIs
> ---
>  include/libvirt/libvirt.h.in |   10 +++
>  include/libvirt/virterror.h  |    1 +
>  src/driver.h                 |   14 ++++
>  src/esx/esx_storage_driver.c |    2 +
>  src/libvirt.c                |  140 ++++++++++++++++++++++++++++++++++++++++++
>  src/libvirt_public.syms      |    2 +
>  src/storage/storage_driver.c |    2 +
>  src/util/virterror.c         |    6 ++
>  8 files changed, 177 insertions(+), 0 deletions(-)

> +++ b/include/libvirt/virterror.h
> @@ -230,6 +230,7 @@ typedef enum {
>      VIR_ERR_HOOK_SCRIPT_FAILED = 70,	/* a synchronous hook script failed */
>      VIR_ERR_INVALID_DOMAIN_SNAPSHOT = 71,/* invalid domain snapshot */
>      VIR_ERR_NO_DOMAIN_SNAPSHOT = 72,	/* domain snapshot not found */
> +    VIR_ERR_INVALID_STREAM = 73         /* stream pointer not valid */

Add the trailing comma now, to reduce the diff burden later on the next
addition.

> +
> +/**
> + * virStorageVolUpload:
> + * @vol: pointer to volume to download

s/download/upload/

> + * @stream: stream to use as output

s/output/input/

> + * @offset: position to start writing to
> + * @length: limit on amount of data to upload
> + * @flags: flags for creation (unused, pass 0)
> + *
> + * Upload new content to the volume from a stream. This call
> + * will fail if @offset + @length exceeds the size of the
> + * volume. Otherwise, if @length is non-zero, and an error

s/and //

ACK with those four nits fixed.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110324/eb053c19/attachment-0001.sig>


More information about the libvir-list mailing list