Received: from eggs.gnu.org ([2001:4830:134:3::10]:51412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZb4V-0000Xl-4j for qemu-devel@nongnu.org; Sat, 27 Feb 2016 04:21:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZb4U-0005eu-D9 for qemu-devel@nongnu.org; Sat, 27 Feb 2016 04:21:55 -0500 From: Fam Zheng Date: Sat, 27 Feb 2016 17:20:53 +0800 Message-Id: <1456564857-29160-12-git-send-email-famz@redhat.com> In-Reply-To: <1456564857-29160-1-git-send-email-famz@redhat.com> References: <1456564857-29160-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v3 11/15] block: Assert that bdrv_release_dirty_bitmap succeeded List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org 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 --- block/dirty-bitmap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index a0c5acb..27d33e7 100644 --- a/block/dirty-bitmap.c +++ b/block/dirty-bitmap.c @@ -304,6 +304,9 @@ static void bdrv_do_release_matching_dirty_bitmap(BlockDriverState *bs, } } } + if (bitmap) { + abort(); + } } void bdrv_release_dirty_bitmap(BlockDriverState *bs, BdrvDirtyBitmap *bitmap) -- 2.4.3