From patchwork Wed Jan 8 03:42:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 307994 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 904622C00A7 for ; Wed, 8 Jan 2014 15:16:14 +1100 (EST) Received: from localhost ([::1]:44782 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0k7l-0006kU-U0 for incoming@patchwork.ozlabs.org; Tue, 07 Jan 2014 22:48:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0k3X-0002aX-M4 for qemu-devel@nongnu.org; Tue, 07 Jan 2014 22:43:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0k3R-0002bI-Mb for qemu-devel@nongnu.org; Tue, 07 Jan 2014 22:43:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0k3R-0002b6-AP for qemu-devel@nongnu.org; Tue, 07 Jan 2014 22:43:41 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s083hd8K003743 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 7 Jan 2014 22:43:40 -0500 Received: from ad.nay.redhat.com ([10.66.6.190]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s083h3ji023501; Tue, 7 Jan 2014 22:43:37 -0500 From: Fam Zheng To: qemu-devel@nongnu.org Date: Wed, 8 Jan 2014 11:42:50 +0800 Message-Id: <1389152570-1815-12-git-send-email-famz@redhat.com> In-Reply-To: <1389152570-1815-1-git-send-email-famz@redhat.com> References: <1389152570-1815-1-git-send-email-famz@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, rjones@redhat.com, armbru@redhat.com, imain@redhat.com, stefanha@redhat.com, pbonzini@redhat.com Subject: [Qemu-devel] [PATCH v10 11/11] block: Allow backup on referenced named BlockDriverState 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 Drive backup is a read only operation on source bs. We want to allow this specific case to enable image-fleecing. Note that when image-fleecing job starts, the job still add its blocker to source bs, and any other operation on it will be blocked by that. Signed-off-by: Fam Zheng --- block.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block.c b/block.c index b28fb93..1bc00ef 100644 --- a/block.c +++ b/block.c @@ -988,6 +988,8 @@ void bdrv_set_backing_hd(BlockDriverState *bs, BlockDriverState *backing_hd) /* Otherwise we won't be able to commit due to check in bdrv_commit */ bdrv_op_unblock(bs->backing_hd, BLOCK_OP_TYPE_COMMIT, bs->backing_blocker); + bdrv_op_unblock(bs->backing_hd, BLOCK_OP_TYPE_BACKUP_SOURCE, + bs->backing_blocker); pstrcpy(bs->backing_file, sizeof(bs->backing_file), bs->backing_hd->file->filename); pstrcpy(bs->backing_format, sizeof(bs->backing_format),