aboutsummaryrefslogtreecommitdiff
path: root/include/qemu/hbitmap.h
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2022-03-03 20:43:41 +0100
committerHanna Reitz <hreitz@redhat.com>2022-03-07 09:33:30 +0100
commita6426475a75fb793d4c9dd9fe94815e8d18ddaa1 (patch)
tree4d51988de6bc5f7c12b7b927799f68b054595e8f /include/qemu/hbitmap.h
parent84b1e80f67f74a9d505802343458d4ebe8bdb3e4 (diff)
downloadqemu-a6426475a75fb793d4c9dd9fe94815e8d18ddaa1.zip
qemu-a6426475a75fb793d4c9dd9fe94815e8d18ddaa1.tar.gz
qemu-a6426475a75fb793d4c9dd9fe94815e8d18ddaa1.tar.bz2
block/dirty-bitmap: introduce bdrv_dirty_bitmap_status()
Add a convenient function similar with bdrv_block_status() to get status of dirty bitmap. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Hanna Reitz <hreitz@redhat.com> Message-Id: <20220303194349.2304213-9-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Diffstat (limited to 'include/qemu/hbitmap.h')
-rw-r--r--include/qemu/hbitmap.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/qemu/hbitmap.h b/include/qemu/hbitmap.h
index 5e71b6d..5bd986a 100644
--- a/include/qemu/hbitmap.h
+++ b/include/qemu/hbitmap.h
@@ -340,6 +340,18 @@ bool hbitmap_next_dirty_area(const HBitmap *hb, int64_t start, int64_t end,
int64_t max_dirty_count,
int64_t *dirty_start, int64_t *dirty_count);
+/*
+ * bdrv_dirty_bitmap_status:
+ * @hb: The HBitmap to operate on
+ * @start: The bit to start from
+ * @count: Number of bits to proceed
+ * @pnum: Out-parameter. How many bits has same value starting from @start
+ *
+ * Returns true if bitmap is dirty at @start, false otherwise.
+ */
+bool hbitmap_status(const HBitmap *hb, int64_t start, int64_t count,
+ int64_t *pnum);
+
/**
* hbitmap_iter_next:
* @hbi: HBitmapIter to operate on.