Re: [Qemu-devel] [PATCH v2] block: per caller dirty bitmap

2013-11-12 Thread Kevin Wolf
Am 04.11.2013 um 10:30 hat Fam Zheng geschrieben: Previously a BlockDriverState has only one dirty bitmap, so only one caller (e.g. a block job) can keep track of writing. This changes the dirty bitmap to a list and creates a BdrvDirtyBitmap for each caller, the lifecycle is managed with these

Re: [Qemu-devel] [PATCH v2] block: per caller dirty bitmap

2013-11-12 Thread Eric Blake
On 11/12/2013 03:46 AM, Kevin Wolf wrote: +++ b/block/qapi.c @@ -204,14 +204,6 @@ void bdrv_query_info(BlockDriverState *bs, info-io_status = bs-iostatus; } -if (bs-dirty_bitmap) { -info-has_dirty = true; -info-dirty = g_malloc0(sizeof(*info-dirty)); -

Re: [Qemu-devel] [PATCH v2] block: per caller dirty bitmap

2013-11-11 Thread Stefan Hajnoczi
On Mon, Nov 04, 2013 at 11:55:47AM +0100, Paolo Bonzini wrote: Il 04/11/2013 11:47, Fam Zheng ha scritto: -void bdrv_set_dirty_tracking(BlockDriverState *bs, int granularity); -int bdrv_get_dirty(BlockDriverState *bs, int64_t sector); +typedef struct BdrvDirtyBitmap BdrvDirtyBitmap;

Re: [Qemu-devel] [PATCH v2] block: per caller dirty bitmap

2013-11-11 Thread Stefan Hajnoczi
On Mon, Nov 04, 2013 at 05:30:10PM +0800, Fam Zheng wrote: @@ -2785,9 +2792,7 @@ static int coroutine_fn bdrv_co_do_writev(BlockDriverState *bs, ret = bdrv_co_flush(bs); } -if (bs-dirty_bitmap) { bdrv_set_dirty(bs, sector_num, nb_sectors); -} Forgot to

Re: [Qemu-devel] [PATCH v2] block: per caller dirty bitmap

2013-11-11 Thread Stefan Hajnoczi
On Mon, Nov 04, 2013 at 05:30:10PM +0800, Fam Zheng wrote: Previously a BlockDriverState has only one dirty bitmap, so only one caller (e.g. a block job) can keep track of writing. This changes the dirty bitmap to a list and creates a BdrvDirtyBitmap for each caller, the lifecycle is managed

Re: [Qemu-devel] [PATCH v2] block: per caller dirty bitmap

2013-11-04 Thread Paolo Bonzini
Il 04/11/2013 10:30, Fam Zheng ha scritto: diff --git a/include/block/block.h b/include/block/block.h index 3560deb..06f424c 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -388,12 +388,15 @@ void *qemu_blockalign(BlockDriverState *bs, size_t size); bool

Re: [Qemu-devel] [PATCH v2] block: per caller dirty bitmap

2013-11-04 Thread Fam Zheng
On 11/04/2013 06:37 PM, Paolo Bonzini wrote: Il 04/11/2013 10:30, Fam Zheng ha scritto: diff --git a/include/block/block.h b/include/block/block.h index 3560deb..06f424c 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -388,12 +388,15 @@ void *qemu_blockalign(BlockDriverState

Re: [Qemu-devel] [PATCH v2] block: per caller dirty bitmap

2013-11-04 Thread Paolo Bonzini
Il 04/11/2013 11:47, Fam Zheng ha scritto: -void bdrv_set_dirty_tracking(BlockDriverState *bs, int granularity); -int bdrv_get_dirty(BlockDriverState *bs, int64_t sector); +typedef struct BdrvDirtyBitmap BdrvDirtyBitmap; +BdrvDirtyBitmap *bdrv_create_dirty_bitmap(BlockDriverState *bs, int

Re: [Qemu-devel] [PATCH v2] block: per caller dirty bitmap

2013-11-04 Thread Benoît Canet
Le Monday 04 Nov 2013 à 17:30:10 (+0800), Fam Zheng a écrit : Previously a BlockDriverState has only one dirty bitmap, so only one caller (e.g. a block job) can keep track of writing. This changes the dirty bitmap to a list and creates a BdrvDirtyBitmap for each caller, the lifecycle is

Re: [Qemu-devel] [PATCH v2] block: per caller dirty bitmap

2013-11-04 Thread Fam Zheng
On 11/04/2013 10:38 PM, Benoît Canet wrote: Le Monday 04 Nov 2013 à 17:30:10 (+0800), Fam Zheng a écrit : Previously a BlockDriverState has only one dirty bitmap, so only one caller (e.g. a block job) can keep track of writing. This changes the dirty bitmap to a list and creates a