From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaWst-0003xi-B3 for qemu-devel@nongnu.org; Mon, 29 Feb 2016 18:05:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaWss-00023T-FN for qemu-devel@nongnu.org; Mon, 29 Feb 2016 18:05:47 -0500 References: <1456564857-29160-1-git-send-email-famz@redhat.com> <1456564857-29160-12-git-send-email-famz@redhat.com> From: John Snow Message-ID: <56D4CEC2.3020401@redhat.com> Date: Mon, 29 Feb 2016 18:05:38 -0500 MIME-Version: 1.0 In-Reply-To: <1456564857-29160-12-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-block] [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: Fam Zheng , qemu-devel@nongnu.org Cc: Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org On 02/27/2016 04:20 AM, Fam Zheng wrote: > 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) > Bad context, but I assume what happens is if we have a bitmap, we have an early return above, so this should be unreachable. Reviewed-by: John Snow