From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHGOg-0007c3-95 for qemu-devel@nongnu.org; Thu, 07 Jan 2016 14:38:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHGOf-0006Li-9m for qemu-devel@nongnu.org; Thu, 07 Jan 2016 14:38:58 -0500 References: <1451903234-32529-1-git-send-email-famz@redhat.com> <1451903234-32529-11-git-send-email-famz@redhat.com> From: John Snow Message-ID: <568EBECB.4040000@redhat.com> Date: Thu, 7 Jan 2016 14:38:51 -0500 MIME-Version: 1.0 In-Reply-To: <1451903234-32529-11-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 10/13] block: Assert that bdrv_release_dirty_bitmap succeeded List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Jeff Cody , Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org On 01/04/2016 05:27 AM, Fam Zheng wrote: > This makes sure we don't leak a dirty bitmap in any case. > > Signed-off-by: Fam Zheng > --- > block/dirty-bitmap.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c > index 9cac794..60ee965 100644 > --- a/block/dirty-bitmap.c > +++ b/block/dirty-bitmap.c > @@ -297,6 +297,7 @@ void bdrv_release_dirty_bitmap(BlockDriverState *bs, BdrvDirtyBitmap *bitmap) > return; > } > } > + abort(); > } > > void bdrv_disable_dirty_bitmap(BdrvDirtyBitmap *bitmap) > Before this patch: release can be called on a (BDS, BITMAP) pair in cases where the bitmap does not belong to the BDS and this function just ignored it. After this patch: We abort() in cases where we get this pairing incorrect. I don't think there is any reason to ever get this wrong on a call to this function, so this is alright. Reviewed-by: John Snow