From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8Mgc-0002EL-Jj for qemu-devel@nongnu.org; Fri, 26 Jun 2015 02:00:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8MgZ-0006Bj-9E for qemu-devel@nongnu.org; Fri, 26 Jun 2015 02:00:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8MgZ-00069Y-4S for qemu-devel@nongnu.org; Fri, 26 Jun 2015 02:00:23 -0400 Date: Fri, 26 Jun 2015 14:00:18 +0800 From: Fam Zheng Message-ID: <20150626060018.GA19264@ad.nay.redhat.com> References: <1435234332-581-1-git-send-email-stefanha@redhat.com> <1435234332-581-5-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1435234332-581-5-git-send-email-stefanha@redhat.com> Subject: Re: [Qemu-devel] [PATCH 04/10] block: keep bitmap if incremental backup job is cancelled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Jeff Cody , qemu-devel@nongnu.org, mreitz@redhat.com, vsementsov@parallels.com, John Snow On Thu, 06/25 13:12, Stefan Hajnoczi wrote: > Reclaim the dirty bitmap if an incremental backup block job is > cancelled. The ret variable may be 0 when the job is cancelled so it's > not enough to check ret < 0. > > Signed-off-by: Stefan Hajnoczi > --- > block/backup.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/block/backup.c b/block/backup.c > index 4a1af68..ddf8424 100644 > --- a/block/backup.c > +++ b/block/backup.c > @@ -431,7 +431,7 @@ static void coroutine_fn backup_run(void *opaque) > > if (job->sync_bitmap) { > BdrvDirtyBitmap *bm; > - if (ret < 0) { > + if (ret < 0 || block_job_is_cancelled(&job->common)) { > /* Merge the successor back into the parent, delete nothing. */ > bm = bdrv_reclaim_dirty_bitmap(bs, job->sync_bitmap, NULL); > assert(bm); > -- > 2.4.3 > > Reviewed-by: Fam Zheng