qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v22 11/30] qcow2: autoloading dirty bitmaps


From: Eric Blake
Subject: Re: [Qemu-block] [PATCH v22 11/30] qcow2: autoloading dirty bitmaps
Date: Thu, 29 Jun 2017 20:35:16 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0

On 06/28/2017 07:05 AM, Vladimir Sementsov-Ogievskiy wrote:
> Auto loading bitmaps are bitmaps in Qcow2, with the AUTO flag set. They
> are loaded when the image is opened and become BdrvDirtyBitmaps for the
> corresponding drive.
> 
> Extra data in bitmaps is not supported for now.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> Reviewed-by: Max Reitz <address@hidden>
> Reviewed-by: John Snow <address@hidden>
> ---
>  block/qcow2-bitmap.c | 389 
> +++++++++++++++++++++++++++++++++++++++++++++++++++
>  block/qcow2.c        |  17 ++-
>  block/qcow2.h        |   2 +
>  3 files changed, 406 insertions(+), 2 deletions(-)

> +
> +/* load_bitmap_data
> + * @bitmap_table entries must satisfy specification constraints.
> + * @bitmap must be cleared */
> +static int load_bitmap_data(BlockDriverState *bs,
> +                            const uint64_t *bitmap_table,
> +                            uint32_t bitmap_table_size,
> +                            BdrvDirtyBitmap *bitmap)
> +{
> +    int ret = 0;
> +    BDRVQcow2State *s = bs->opaque;
> +    uint64_t sector, sbc;
> +    uint64_t bm_size = bdrv_dirty_bitmap_size(bitmap);

Right now, this is returned as the size in sectors (my series changes it
to be the size in bytes, but that's being rebased on top of yours)

> +    uint8_t *buf = NULL;
> +    uint64_t i, tab_size =
> +            size_to_clusters(s,
> +                bdrv_dirty_bitmap_serialization_size(bitmap, 0, bm_size));

But bdrv_dirty_bitmap_serialization_size() takes count according to the
underlying hbitmap granularity.  Hmm - you found a bug in my series -
when I convert dirty-bitmap.c to use byte-based counts everywhere, I
forgot to convert bdrv_dirty_bitmap_serialization_size().  Good thing
yours is going in first ;)

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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