From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIXX7-00029f-6Y for qemu-devel@nongnu.org; Thu, 30 Jun 2016 04:41:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bIXX2-0005O5-0c for qemu-devel@nongnu.org; Thu, 30 Jun 2016 04:41:12 -0400 Received: from [59.151.112.132] (port=37012 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIXX1-0005M3-Gu for qemu-devel@nongnu.org; Thu, 30 Jun 2016 04:41:07 -0400 Message-ID: <5774DC40.8090806@cn.fujitsu.com> Date: Thu, 30 Jun 2016 16:45:52 +0800 From: Changlong Xie MIME-Version: 1.0 References: <1467273706-5732-1-git-send-email-xiecl.fnst@cn.fujitsu.com> <20160630082515.GG23296@ad.usersys.redhat.com> In-Reply-To: <20160630082515.GG23296@ad.usersys.redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] dirty-bitmap: remove unnecessary return List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: qemu devel , Kevin Wolf , Jeff Cody , Max Reitz , Stefan Hajnoczi On 06/30/2016 04:25 PM, Fam Zheng wrote: > On Thu, 06/30 16:01, Changlong Xie wrote: >> Otherwise, we could never trigger assert(!bitmap->successor) >> >> Signed-off-by: Changlong Xie >> --- >> block/dirty-bitmap.c | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c >> index 4902ca5..e9df5ac 100644 >> --- a/block/dirty-bitmap.c >> +++ b/block/dirty-bitmap.c >> @@ -131,7 +131,6 @@ int bdrv_dirty_bitmap_create_successor(BlockDriverState *bs, >> if (bdrv_dirty_bitmap_frozen(bitmap)) { >> error_setg(errp, "Cannot create a successor for a bitmap that is " >> "currently frozen"); >> - return -1; >> } >> assert(!bitmap->successor); > > This is wrong. Then we will always trigger assert for a frozen bitmap. > IMO, when it's a frozen bitmap, we will always return -1. So "assert(!bitmap->successor)" is useless here, am i right? > Fam > > >