From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlGPI-0001HS-OV for qemu-devel@nongnu.org; Tue, 26 Nov 2013 06:02:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlGPC-0000Rz-Pc for qemu-devel@nongnu.org; Tue, 26 Nov 2013 06:02:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50944) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlGPC-0000Ro-GH for qemu-devel@nongnu.org; Tue, 26 Nov 2013 06:02:10 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAQB29vB030393 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 26 Nov 2013 06:02:09 -0500 Date: Tue, 26 Nov 2013 12:02:11 +0100 From: Kevin Wolf Message-ID: <20131126110211.GA3013@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> <20131125112319.GG3009@dhcp-200-207.str.redhat.com> <5294104C.20409@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5294104C.20409@redhat.com> Content-Transfer-Encoding: quoted-printable 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 26.11.2013 um 04:06 hat Fam Zheng geschrieben: > On 2013=E5=B9=B411=E6=9C=8825=E6=97=A5 19:23, Kevin Wolf wrote: > >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_block= er); > >>+ 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_form= at), > > > >We probably need separate blockers for "can be a backup source" and "c= an > >be a backup target". Because I think this allows using it as a > >read-write target as well, which was not intended. > > >=20 > Yes. Will do it. >=20 > >Do we need to cover this in other parts of the code as well, like when > >adding a new BDS during external snapshot creation? > > >=20 > Does it have a name? If not I think we are safe there. Not yet, but I think it won't be long until we do have named nodes created this way, so considering it now certainly can't hurt. Kevin