Received: from eggs.gnu.org ([2001:4830:134:3::10]:32784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5Gw8-0007G7-Gk for qemu-devel@nongnu.org; Tue, 24 May 2016 14:20:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5Gw7-0007or-EG for qemu-devel@nongnu.org; Tue, 24 May 2016 14:20:12 -0400 References: <1463470536-8981-1-git-send-email-famz@redhat.com> <1463470536-8981-19-git-send-email-famz@redhat.com> From: Max Reitz Message-ID: <9bb99d99-adeb-7d4c-8367-8f093338141c@redhat.com> Date: Tue, 24 May 2016 20:20:01 +0200 MIME-Version: 1.0 In-Reply-To: <1463470536-8981-19-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EQjdwqiwB1uphF7xWI4JFKG5AStD49O5C" Subject: Re: [Qemu-devel] [PATCH v5 18/27] mirror: Disable image locking on target backing chain List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Jeff Cody , Markus Armbruster , Eric Blake , John Snow , qemu-block@nongnu.org, berrange@redhat.com, pbonzini@redhat.com, den@openvz.org, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EQjdwqiwB1uphF7xWI4JFKG5AStD49O5C From: Max Reitz To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Jeff Cody , Markus Armbruster , Eric Blake , John Snow , qemu-block@nongnu.org, berrange@redhat.com, pbonzini@redhat.com, den@openvz.org, stefanha@redhat.com Message-ID: <9bb99d99-adeb-7d4c-8367-8f093338141c@redhat.com> Subject: Re: [PATCH v5 18/27] mirror: Disable image locking on target backing chain References: <1463470536-8981-1-git-send-email-famz@redhat.com> <1463470536-8981-19-git-send-email-famz@redhat.com> In-Reply-To: <1463470536-8981-19-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 17.05.2016 09:35, Fam Zheng wrote: > In sync=3Dnone the backing image of s->target is s->common.bs, which co= uld > be exclusively locked, the image locking wouldn't work here. Why is the backing image s->common.bs when the bdrv_open() call explicitly specifies BDRV_O_NO_BACKING? Max > Later we can update completion code to lock it after the replaced node > has dropped its lock. >=20 > Signed-off-by: Fam Zheng > --- > blockdev.c | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > diff --git a/blockdev.c b/blockdev.c > index 250e3d2..3de54f0 100644 > --- a/blockdev.c > +++ b/blockdev.c > @@ -3626,6 +3626,12 @@ void qmp_drive_mirror(const char *device, const = char *target, > * file. > */ > target_bs =3D NULL; > + if (sync =3D=3D MIRROR_SYNC_MODE_NONE) { > + flags |=3D BDRV_O_NO_LOCK; > + } > + /* TODO: in mirror complete, after target_bs is switched to and th= e > + * original BDS's lock is dropped, we should enable the lock on ta= rget_bs. > + * */ > ret =3D bdrv_open(&target_bs, target, NULL, options, > flags | BDRV_O_NO_BACKING, &local_err); > if (ret < 0) { >=20 --EQjdwqiwB1uphF7xWI4JFKG5AStD49O5C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXRJtSAAoJEDuxQgLoOKyt3UsH/3Mh3IpzYWWZxq7e3F66UqB0 6muxW4QXfRam4AoH9HP/5+Cd6VlOW29sPwN5Hasjnn0X8G9CfriQGRwRe9D9WYI0 fYdEnpNoiJvFIiDKuGCnJM/NznHMM7bEnOs2caFmykao5CExnjr/D8qsmJS8ZkS5 jFE3NO5AgVR+OhQQs7pLh8bYZEI/tgUanhvgBibBFJthqL5tVTWjnqQxYLAYkIHJ rHwynvfbP4FLT0/iVIYA+6Hu1FXuo3p/Tqh3wss49oE5Jq6VbRx9dZrF2QXFdcFC fLQmyUALuufgXRiHnJ8DGiHCA8fjOZr7wYth3PwiG5QgtvqZuMpOaalD9EUvd6Q= =M5+r -----END PGP SIGNATURE----- --EQjdwqiwB1uphF7xWI4JFKG5AStD49O5C--