[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/5] hbitmap: add next_zero function
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 1/5] hbitmap: add next_zero function |
Date: |
Mon, 2 Oct 2017 10:43:04 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 10/02/2017 09:39 AM, Vladimir Sementsov-Ogievskiy wrote:
> The function searches for next zero bit.
> Also add interface for BdrvDirtyBitmap.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
> include/block/dirty-bitmap.h | 1 +
> include/qemu/hbitmap.h | 8 ++++++++
> block/dirty-bitmap.c | 5 +++++
> util/hbitmap.c | 29 +++++++++++++++++++++++++++++
> 4 files changed, 43 insertions(+)
>
> +++ b/block/dirty-bitmap.c
> @@ -715,3 +715,8 @@ char *bdrv_dirty_bitmap_sha256(const BdrvDirtyBitmap
> *bitmap, Error **errp)
> {
> return hbitmap_sha256(bitmap->bitmap, errp);
> }
> +
> +int64_t bdrv_dirty_bitmap_next_zero(BdrvDirtyBitmap *bitmap, uint64_t offset)
> +{
> + return hbitmap_next_zero(bitmap->bitmap, offset);
> +}
Returns an answer in the same scale as the underlying hbitmap; if this
is applied before my byte-based dirty bitmap series, that means offset
is a sector count and the result is likewise a sector number (awkward);
if this is applied after my series, you pass in a byte offset start and
get a byte result (nice).
I don't see any obvious errors in the implementation, but DO think that
you should include a testsuite enhancement in tests/test-hbitmap.c to
cover the new functionality before we accept this.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 0/5] backup improvements part 1, Vladimir Sementsov-Ogievskiy, 2017/10/02
- [Qemu-devel] [PATCH 5/5] backup: use copy_bitmap in incremental backup, Vladimir Sementsov-Ogievskiy, 2017/10/02
- [Qemu-devel] [PATCH 3/5] backup: init copy_bitmap from sync_bitmap for incremental, Vladimir Sementsov-Ogievskiy, 2017/10/02
- [Qemu-devel] [PATCH 1/5] hbitmap: add next_zero function, Vladimir Sementsov-Ogievskiy, 2017/10/02
- [Qemu-devel] [PATCH 4/5] backup: simplify non-dirty bits progress processing, Vladimir Sementsov-Ogievskiy, 2017/10/02
- [Qemu-devel] [PATCH 2/5] backup: move from done_bitmap to copy_bitmap, Vladimir Sementsov-Ogievskiy, 2017/10/02
- Re: [Qemu-devel] [PATCH 0/5] backup improvements part 1, Eric Blake, 2017/10/02