qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC V6 03/33] qcow2: Add deduplication structures and


From: Eric Blake
Subject: Re: [Qemu-devel] [RFC V6 03/33] qcow2: Add deduplication structures and fields.
Date: Wed, 06 Feb 2013 09:37:24 -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:
> Signed-off-by: Benoit Canet <address@hidden>
> ---
>  block/qcow2.h |   69 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 68 insertions(+), 1 deletion(-)
> 
> diff --git a/block/qcow2.h b/block/qcow2.h
> index 718b52b..c7b6860 100644
> --- a/block/qcow2.h
> +++ b/block/qcow2.h
> @@ -43,6 +43,10 @@
>  #define QCOW_OFLAG_COPIED     (1LL << 63)
>  /* indicate that the cluster is compressed (they never have the copied flag) 
> */
>  #define QCOW_OFLAG_COMPRESSED (1LL << 62)
> +/* indicate that the cluster must be processed when deduplication restart

s/restart/restarts./

> + * also indicate that the on disk dedup hash must be ignored and discarded
> + */
> +#define QCOW_OFLAG_TO_DEDUP (1LL << 61)
>  /* The cluster reads as all zeros */
>  #define QCOW_OFLAG_ZERO (1LL << 0)
>  
> @@ -58,6 +62,54 @@
>  
>  #define DEFAULT_CLUSTER_SIZE 65536
>  
> +#define HASH_LENGTH 32
> +
> +#define QCOW_STRATEGY_RAM     1
> +#define QCOW_STRATEGY_DISK    (1 << 1)
> +#define QCOW_STRATEGY_RUNNING (1 << 2)

For consistency, it would look better to use (1 << 0) for the first bit.
 Also, see my comments on patch 1/33 - reserving QCOW_STRATEGY_DISK when
you don't yet have it implemented doesn't make sense.  Is your plan to
have RAM and DISK mutually exclusive (if so, you don't need anything
now, and later on, you would add a single bit, set to 0 for RAM and 1
for disk) or can they both be set at once (in which case, having the RAM
bit now is okay, but I would rearrange bit orders so that today's RAM
bit is last leaving the door open to stick tomorrow's disk bit adjacent
to it).


> +/* deduplication node */
> +typedef struct {
> +    QCowHash hash;
> +    uint64_t physical_sect;       /* where the cluster is stored on disk */
> +    uint64_t first_logical_sect;  /* logical sector of the first occurence of

s/occurence/occurrence/

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