qemu-devel
[Top][All Lists]
Advanced

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

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


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 3/3] block: per caller dirty bitmap
Date: Mon, 04 Nov 2013 11:34:15 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

Il 04/11/2013 07:59, Fam Zheng ha scritto:
>>>
>> I think callers outside block.c should only call
>> hbitmap_set/hbitmap_reset; resetting is typically done before processing
>> sectors and setting after an error (both of which happen privately to
>> each task).
>>
>> Thus you probably should add a fourth patch which makes
>> bdrv_(re)set_dirty static and remove
>> bdrv_get_dirty/bdrv_dirty_iter_init/bdrv_get_dirty_count.
> I like the idea of adding a wrapper struct (will be BdrvDirtyBitmap) to
> HBitmap so that patch 1 is not needed, and HBitmap becomes (almost)
> internal to block.c.
> 
> But I'm not sure removing
> bdrv_get_dirty/bdrv_dirty_iter_init/bdrv_get_dirty_count is good, as we
> are exposing BdrvDirtyBitmap, we should also provide operations on it,
> instead of let callers to handle HBitmap pointer inside. In other words,
> I prefer to define BdrvDirtyBitmap structure in block.c and only put a
> type declaration in header.

If you want to expose BdrvDirtyBitmap, having wrappers is fine.  I was
thinking of exposing HBitmap instead and keeping BdrvDirtyBitmap internal.

Either way is fine, and as the person who writes the code you have the
privilege of making the choice. :)

Paolo



reply via email to

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