From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vl8zZ-0000pC-2h for qemu-devel@nongnu.org; Mon, 25 Nov 2013 22:07:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vl8zR-0008GT-BR for qemu-devel@nongnu.org; Mon, 25 Nov 2013 22:07:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:10459) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vl8zR-0008GI-3U for qemu-devel@nongnu.org; Mon, 25 Nov 2013 22:07:05 -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 rAQ374P2026811 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 25 Nov 2013 22:07:04 -0500 Message-ID: <5294104C.20409@redhat.com> Date: Tue, 26 Nov 2013 11:06:52 +0800 From: Fam Zheng MIME-Version: 1.0 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> In-Reply-To: <20131125112319.GG3009@dhcp-200-207.str.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed 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: Kevin Wolf Cc: hbrock@redhat.com, qemu-devel@nongnu.org, rjones@redhat.com, imain@redhat.com, stefanha@redhat.com, pbonzini@redhat.com 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_blocke= r); >> + 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_forma= t), > > We probably need separate blockers for "can be a backup source" and "ca= n > be a backup target". Because I think this allows using it as a > read-write target as well, which was not intended. > Yes. Will do it. > Do we need to cover this in other parts of the code as well, like when > adding a new BDS during external snapshot creation? > Does it have a name? If not I think we are safe there. Fam