[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 07/20] block: allow customizing the granularity
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 07/20] block: allow customizing the granularity of the dirty bitmap |
Date: |
Fri, 14 Dec 2012 14:27:04 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 |
On 12/12/2012 06:46 AM, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> block-migration.c | 5 +++--
> block.c | 17 ++++++++++-------
> block.h | 5 +----
> block/mirror.c | 14 ++++----------
> qapi-schema.json | 4 +++-
> 5 files changed, 21 insertions(+), 24 deletions(-)
>
> @@ -4218,16 +4220,17 @@ void *qemu_blockalign(BlockDriverState *bs, size_t
> size)
> return qemu_memalign((bs && bs->buffer_alignment) ? bs->buffer_alignment
> : 512, size);
> }
>
> -void bdrv_set_dirty_tracking(BlockDriverState *bs, int enable)
> +void bdrv_set_dirty_tracking(BlockDriverState *bs, int granularity)
> {
> int64_t bitmap_size;
>
> - if (enable) {
> - if (!bs->dirty_bitmap) {
> - bitmap_size = (bdrv_getlength(bs) >> BDRV_SECTOR_BITS);
> - bs->dirty_bitmap = hbitmap_alloc(bitmap_size,
> -
> BDRV_LOG_SECTORS_PER_DIRTY_CHUNK);
> - }
> + assert((granularity & (granularity - 1)) == 0);
> +
> + if (granularity) {
> + granularity >>= BDRV_SECTOR_BITS;
Given that granularity is specified in bytes, does it make sense for a
user to want a granularity of 4G? I guess another way of wording this
question is: Are you sure 'int granularity' is the right type?
> +++ b/qapi-schema.json
> @@ -667,10 +667,12 @@
> #
> # @count: number of dirty bytes according to the dirty bitmap
> #
> +# @granularity: granularity of the dirty bitmap in bytes
Mention that this field was added in 1.4.
> +#
> # Since: 1.3
> ##
> { 'type': 'BlockDirtyInfo',
> - 'data': {'count': 'int'} }
> + 'data': {'count': 'int', 'granularity': 'int'} }
>
> ##
> # @BlockInfo:
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 00/20] Block device mirroring enhancements, 12-12-12 edition, Paolo Bonzini, 2012/12/12
- [Qemu-devel] [PATCH 02/20] add hierarchical bitmap data type and test cases, Paolo Bonzini, 2012/12/12
- [Qemu-devel] [PATCH 04/20] block: make round_to_clusters public, Paolo Bonzini, 2012/12/12
- [Qemu-devel] [PATCH 03/20] block: implement dirty bitmap using HBitmap, Paolo Bonzini, 2012/12/12
- [Qemu-devel] [PATCH 05/20] mirror: perform COW if the cluster size is bigger than the granularity, Paolo Bonzini, 2012/12/12
- [Qemu-devel] [PATCH 07/20] block: allow customizing the granularity of the dirty bitmap, Paolo Bonzini, 2012/12/12
- Re: [Qemu-devel] [PATCH 07/20] block: allow customizing the granularity of the dirty bitmap,
Eric Blake <=
- [Qemu-devel] [PATCH 06/20] block: return count of dirty sectors, not chunks, Paolo Bonzini, 2012/12/12
- [Qemu-devel] [PATCH 09/20] mirror: switch mirror_iteration to AIO, Paolo Bonzini, 2012/12/12
- [Qemu-devel] [PATCH 08/20] mirror: allow customizing the granularity, Paolo Bonzini, 2012/12/12
- [Qemu-devel] [PATCH 10/20] mirror: add buf-size argument to drive-mirror, Paolo Bonzini, 2012/12/12