diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2022-03-03 20:43:35 +0100 |
---|---|---|
committer | Hanna Reitz <hreitz@redhat.com> | 2022-03-07 09:33:30 +0100 |
commit | 34ffacb7f4e781873ffdee54c7bb800fa1853a92 (patch) | |
tree | b3f32f036f1dfcf37da59bd2a9a663eb39103269 /block/dirty-bitmap.c | |
parent | 051f66caa2716b1e01cf44f15b8fcd885d6d7784 (diff) |
block/dirty-bitmap: bdrv_merge_dirty_bitmap(): add return value
That simplifies handling failure in existing code and in further new
usage of bdrv_merge_dirty_bitmap().
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220303194349.2304213-3-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Diffstat (limited to 'block/dirty-bitmap.c')
-rw-r--r-- | block/dirty-bitmap.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index 0334b85805..9aa5aebaa9 100644 --- a/block/dirty-bitmap.c +++ b/block/dirty-bitmap.c @@ -884,11 +884,14 @@ bool bdrv_dirty_bitmap_next_dirty_area(BdrvDirtyBitmap *bitmap, * Ensures permissions on bitmaps are reasonable; use for public API. * * @backup: If provided, make a copy of dest here prior to merge. + * + * Returns true on success, false on failure. In case of failure bitmaps are + * untouched. */ -void bdrv_merge_dirty_bitmap(BdrvDirtyBitmap *dest, const BdrvDirtyBitmap *src, +bool bdrv_merge_dirty_bitmap(BdrvDirtyBitmap *dest, const BdrvDirtyBitmap *src, HBitmap **backup, Error **errp) { - bool ret; + bool ret = false; bdrv_dirty_bitmaps_lock(dest->bs); if (src->bs != dest->bs) { @@ -916,6 +919,8 @@ out: if (src->bs != dest->bs) { bdrv_dirty_bitmaps_unlock(src->bs); } + + return ret; } /** |