From: Fam Zheng <f...@redhat.com> 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 <f...@redhat.com> Reviewed-by: Max Reitz <mre...@redhat.com> Signed-off-by: John Snow <js...@redhat.com> Message-id: 1470096763-14033-7-git-send-email-js...@redhat.com Signed-off-by: Max Reitz <mre...@redhat.com> --- block/dirty-bitmap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index 860acc9..31d5296 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) -- 2.5.5