From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZC7K8-0004TB-1w for qemu-devel@nongnu.org; Mon, 06 Jul 2015 10:24:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZC7K3-0001M4-Sd for qemu-devel@nongnu.org; Mon, 06 Jul 2015 10:24:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53266) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZC7K3-0001Li-Fp for qemu-devel@nongnu.org; Mon, 06 Jul 2015 10:24:39 -0400 From: Stefan Hajnoczi Date: Mon, 6 Jul 2015 15:24:23 +0100 Message-Id: <1436192669-10062-5-git-send-email-stefanha@redhat.com> In-Reply-To: <1436192669-10062-1-git-send-email-stefanha@redhat.com> References: <1436192669-10062-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH v2 04/10] block: keep bitmap if incremental backup job is cancelled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , famz@redhat.com, John Snow , Jeff Cody , mreitz@redhat.com, vsementsov@parallels.com, Stefan Hajnoczi 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 d3c7d9f..965654d 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