qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [Qemu-devel] [PATCH 1/5] hbitmap: add next_zero functio


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH 1/5] hbitmap: add next_zero function
Date: Mon, 2 Oct 2017 19:16:37 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

02.10.2017 18:43, Eric Blake wrote:
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).

Oh, I forget to say it: it's based on your series)


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.



--
Best regards,
Vladimir




reply via email to

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