From a6426475a75fb793d4c9dd9fe94815e8d18ddaa1 Mon Sep 17 00:00:00 2001 From: Vladimir Sementsov-Ogievskiy Date: Thu, 3 Mar 2022 20:43:41 +0100 Subject: 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 Reviewed-by: Hanna Reitz Message-Id: <20220303194349.2304213-9-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- block/dirty-bitmap.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'block/dirty-bitmap.c') diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index 9aa5aebaa9..da1b91166f 100644 --- a/block/dirty-bitmap.c +++ b/block/dirty-bitmap.c @@ -879,6 +879,12 @@ bool bdrv_dirty_bitmap_next_dirty_area(BdrvDirtyBitmap *bitmap, dirty_start, dirty_count); } +bool bdrv_dirty_bitmap_status(BdrvDirtyBitmap *bitmap, int64_t offset, + int64_t bytes, int64_t *count) +{ + return hbitmap_status(bitmap->bitmap, offset, bytes, count); +} + /** * bdrv_merge_dirty_bitmap: merge src into dest. * Ensures permissions on bitmaps are reasonable; use for public API. -- cgit v1.2.3