[libvirt] [PATCH 4/6] Support volume data upload/download APIs in storage driver

Eric Blake eblake at redhat.com
Mon Mar 21 21:31:22 UTC 2011


On 03/18/2011 10:36 AM, Daniel P. Berrange wrote:
> * src/storage/storage_driver.c: Wire up upload/download APIs
> ---
>  src/storage/storage_driver.c |  133 +++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 131 insertions(+), 2 deletions(-)
> 
>  
> +static int
> +storageVolumeDownload(virStorageVolPtr obj,
> +                      virStreamPtr stream,
> +                      unsigned long long offset,
> +                      unsigned long long length,
> +                      unsigned int flags)
> +{
> +    if (vol->building) {
> +        virStorageReportError(VIR_ERR_INTERNAL_ERROR,
> +                              _("volume '%s' is still being allocated."),
> +                              vol->name);
> +        goto out;
> +    }
> +
> +    if (virFDStreamOpenFile(stream,
> +                            vol->target.path,
> +                            offset, length,
> +                            O_RDONLY) < 0)
> +        goto out;

Should we prohibit more than one stream attached to a volume at a time?
 It could be rather confusing if simultaneous transfers are taking place
to the same volume, especially if the transfers overlap in offsets of
the volume being addressed.

-- 
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/20110321/c4a5c11f/attachment-0001.sig>


More information about the libvir-list mailing list