diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2020-05-22 01:06:44 +0300 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2020-05-28 13:15:22 -0500 |
commit | 7ae89a0de945616fcde5947cec5aecb8dce07d81 (patch) | |
tree | 3f491af0f124e09ece7a88bf07aabe39d92a7950 /block | |
parent | 38908bbc65bcabf110dcc87a84c518e3e6d9a183 (diff) |
block/dirty-bitmap: add bdrv_has_named_bitmaps helper
To be used for bitmap migration in further commit.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200521220648.3255-3-vsementsov@virtuozzo.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/dirty-bitmap.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index f9bfc77985..c01319b188 100644 --- a/block/dirty-bitmap.c +++ b/block/dirty-bitmap.c @@ -818,6 +818,19 @@ bool bdrv_has_readonly_bitmaps(BlockDriverState *bs) return false; } +bool bdrv_has_named_bitmaps(BlockDriverState *bs) +{ + BdrvDirtyBitmap *bm; + + QLIST_FOREACH(bm, &bs->dirty_bitmaps, list) { + if (bdrv_dirty_bitmap_name(bm)) { + return true; + } + } + + return false; +} + /* Called with BQL taken. */ void bdrv_dirty_bitmap_set_persistence(BdrvDirtyBitmap *bitmap, bool persistent) { |