From patchwork Mon Jun 15 15:02:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 484340 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C372614018C for ; Tue, 16 Jun 2015 01:02:40 +1000 (AEST) Received: from localhost ([::1]:34658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4VuH-0006uh-5S for incoming@patchwork.ozlabs.org; Mon, 15 Jun 2015 11:02:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4Vu0-0006Uf-LA for qemu-devel@nongnu.org; Mon, 15 Jun 2015 11:02:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4Vtw-00065i-Kp for qemu-devel@nongnu.org; Mon, 15 Jun 2015 11:02:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4Vtw-00065e-FW; Mon, 15 Jun 2015 11:02:16 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id E5B8E2B6498; Mon, 15 Jun 2015 15:02:15 +0000 (UTC) Received: from localhost (ovpn-112-26.ams2.redhat.com [10.36.112.26]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5FF2EC2032340; Mon, 15 Jun 2015 11:02:15 -0400 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Date: Mon, 15 Jun 2015 16:02:14 +0100 Message-Id: <1434380534-7680-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Jeff Cody , qemu-stable@nongnu.org, Stefan Hajnoczi Subject: [Qemu-devel] [PATCH] block: keep bitmap if incremental backup job is cancelled X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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. Reviewed-by: John Snow 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 d3f648d..c1ad975 100644 --- a/block/backup.c +++ b/block/backup.c @@ -430,7 +430,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);