From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46985) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkuGF-0006Bx-2G for qemu-devel@nongnu.org; Mon, 25 Nov 2013 06:23:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VkuG8-0000rk-Ny for qemu-devel@nongnu.org; Mon, 25 Nov 2013 06:23:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:4013) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkuG8-0000rd-EH for qemu-devel@nongnu.org; Mon, 25 Nov 2013 06:23:20 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAPBNJLk029818 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 25 Nov 2013 06:23:19 -0500 Date: Mon, 25 Nov 2013 12:23:19 +0100 From: Kevin Wolf Message-ID: <20131125112319.GG3009@dhcp-200-207.str.redhat.com> References: <1385097894-1380-1-git-send-email-famz@redhat.com> <1385097894-1380-8-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1385097894-1380-8-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 7/7] block: Allow backup on referenced named BlockDriverState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: hbrock@redhat.com, qemu-devel@nongnu.org, rjones@redhat.com, imain@redhat.com, stefanha@redhat.com, pbonzini@redhat.com Am 22.11.2013 um 06:24 hat Fam Zheng geschrieben: > 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 a5da656..d30be51 100644 > --- a/block.c > +++ b/block.c > @@ -1179,6 +1179,8 @@ int bdrv_open(BlockDriverState *bs, const char *filename, QDict *options, > "device is used as backing hd of '%s'", > bs->device_name); > bdrv_op_block_all(bs->backing_hd, bs->backing_blocker); > + bdrv_op_unblock(bs->backing_hd, BLOCK_OP_TYPE_BACKUP, > + bs->backing_blocker); > pstrcpy(bs->backing_file, sizeof(bs->backing_file), > bs->backing_hd->filename); > pstrcpy(bs->backing_format, sizeof(bs->backing_format), We probably need separate blockers for "can be a backup source" and "can be a backup target". Because I think this allows using it as a read-write target as well, which was not intended. Do we need to cover this in other parts of the code as well, like when adding a new BDS during external snapshot creation? Kevin