[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
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [RFC V6 00/33] QCOW2 deduplication core functionality, Benoît Canet, 2013/02/06
- [Qemu-devel] [RFC V6 02/33] qmp: Add DedupStatus enum., Benoît Canet, 2013/02/06
- [Qemu-devel] [RFC V6 01/33] qcow2: Add deduplication to the qcow2 specification., Benoît Canet, 2013/02/06
- [Qemu-devel] [RFC V6 03/33] qcow2: Add deduplication structures and fields., Benoît Canet, 2013/02/06
- [Qemu-devel] [RFC V6 04/33] qcow2: Add qcow2_de dup_read_missing_and_concatenate, Benoît Canet, 2013/02/06
- Re: [Qemu-devel] [RFC V6 04/33] qcow2: Add qcow2_dedup_read_missing_and_concatenate, Eric Blake, 2013/02/06
- [Qemu-devel] [RFC V6 06/33] qcow2: Create a way to link to l2 tables when deduplicating., Benoît Canet, 2013/02/06
- [Qemu-devel] [RFC V6 05/33] qcow2: Make update_refcount public., Benoît Canet, 2013/02/06