From 7105007a5c8ae6228d78487e1e382d53863ab2c9 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Thu, 13 Oct 2016 17:58:26 -0400 Subject: block: Assert that bdrv_release_dirty_bitmap succeeded We use a loop over bs->dirty_bitmaps to make sure the caller is only releasing a bitmap owned by bs. Let's also assert that in this case the caller is releasing a bitmap that does exist. Signed-off-by: Fam Zheng Reviewed-by: Max Reitz Signed-off-by: John Snow Message-id: 1476395910-8697-7-git-send-email-jsnow@redhat.com Signed-off-by: Max Reitz --- block/dirty-bitmap.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'block/dirty-bitmap.c') diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index 860acc9b5b..31d5296ef7 100644 --- a/block/dirty-bitmap.c +++ b/block/dirty-bitmap.c @@ -305,6 +305,9 @@ static void bdrv_do_release_matching_dirty_bitmap(BlockDriverState *bs, } } } + if (bitmap) { + abort(); + } } void bdrv_release_dirty_bitmap(BlockDriverState *bs, BdrvDirtyBitmap *bitmap) -- cgit v1.2.1