From patchwork Mon Jul 29 04:25:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 262663 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9FA072C010B for ; Mon, 29 Jul 2013 14:26:44 +1000 (EST) Received: from localhost ([::1]:47776 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3f2g-0005Xh-NM for incoming@patchwork.ozlabs.org; Mon, 29 Jul 2013 00:26:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3f28-0005QD-T1 for qemu-devel@nongnu.org; Mon, 29 Jul 2013 00:26:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3f1x-0005ws-DR for qemu-devel@nongnu.org; Mon, 29 Jul 2013 00:26:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13860) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3f1x-0005wo-6H for qemu-devel@nongnu.org; Mon, 29 Jul 2013 00:25:57 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6T4Pupm023341 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 29 Jul 2013 00:25:56 -0400 Received: from T430s.nay.redhat.com ([10.66.6.13]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r6T4PnIu000956; Mon, 29 Jul 2013 00:25:53 -0400 From: Fam Zheng To: qemu-devel@nongnu.org Date: Mon, 29 Jul 2013 12:25:29 +0800 Message-Id: <1375071932-31627-2-git-send-email-famz@redhat.com> In-Reply-To: <1375071932-31627-1-git-send-email-famz@redhat.com> References: <1375071932-31627-1-git-send-email-famz@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, famz@redhat.com, imain@redhat.com, stefanha@redhat.com, pbonzini@redhat.com Subject: [Qemu-devel] [RFC PATCH 1/4] block/backup: delete target after completion callback 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 Move bdrv_delete(target) one line down to give block job caller a chance to handle target on completion before deleting it. Signed-off-by: Fam Zheng Reviewed-by: Eric Blake --- block/backup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/backup.c b/block/backup.c index 6ae8a05..d80341c 100644 --- a/block/backup.c +++ b/block/backup.c @@ -338,9 +338,9 @@ static void coroutine_fn backup_run(void *opaque) hbitmap_free(job->bitmap); bdrv_iostatus_disable(target); - bdrv_delete(target); block_job_completed(&job->common, ret); + bdrv_delete(target); } void backup_start(BlockDriverState *bs, BlockDriverState *target,