qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC V6 04/33] qcow2: Add qcow2_dedup_read_missing_and_


From: Eric Blake
Subject: Re: [Qemu-devel] [RFC V6 04/33] qcow2: Add qcow2_dedup_read_missing_and_concatenate
Date: Wed, 06 Feb 2013 10:48:04 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 02/06/2013 05:31 AM, Benoît Canet wrote:
> This function is used to read missing data when unaligned writes are
> done. This function also concatenate missing data with the given
> qiov data in order to prepare a buffer used to look for duplicated
> clusters.
> 

> +/*
> + * Prepare a buffer containing all the required data required to compute 
> cluster
> + * sized deduplication hashes.
> + * If sector_num or nb_sectors are not cluster-aligned, missing data
> + * before/after the qiov will be read.
> + *
> + * @qiov:               the qiov for which missing data must be read
> + * @sector_num:         the first sectors that must be read into the qiov
> + * @nb_sectors:         the number of sectors to read into the qiov
> + * @data:               the place where the data will be concatenated and 
> stored

Since data was allocated with qemu_blockalign() instead of the more
typical malloc() or glib functions, you should document that the caller
is responsible to use qemu_vfree() to clean up data on success.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]