From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaoQZ-0006Cr-0x for qemu-devel@nongnu.org; Mon, 28 Oct 2013 11:08:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VaoQQ-0004tl-F8 for qemu-devel@nongnu.org; Mon, 28 Oct 2013 11:08:22 -0400 Received: from nodalink.pck.nerim.net ([62.212.105.220]:37004 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaoQQ-0004sz-5v for qemu-devel@nongnu.org; Mon, 28 Oct 2013 11:08:14 -0400 Date: Mon, 28 Oct 2013 16:08:10 +0100 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20131028150809.GE2890@irqsave.net> References: <1382660107-26518-1-git-send-email-thibaut.laurent@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1382660107-26518-1-git-send-email-thibaut.laurent@gmail.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] Fix COR by disabling BDRV_O_COPY_ON_READ before opening the backing_file. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thibaut LAURENT Cc: qemu-devel@nongnu.org Le Friday 25 Oct 2013 =E0 02:15:07 (+0200), Thibaut LAURENT a =E9crit : > Since commit 0ebd24e0a203cf2852c310b59fbe050190dc6c8c, > bdrv_open_common will throw an error when trying to open a file > read-only with the BDRV_O_COPY_ON_READ flag set. > Although BDRV_O_RDWR is unset for the backing files, > BDRV_O_COPY_ON_READ is still passed on if copy-on-read was requested > for the drive. Let's unset this flag too before opening the backing > file, or bdrv_open_common will fail. >=20 > Signed-off-by: Thibaut LAURENT > --- > block.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/block.c b/block.c > index fd05a80..4474012 100644 > --- a/block.c > +++ b/block.c > @@ -999,7 +999,8 @@ int bdrv_open_backing_file(BlockDriverState *bs, QD= ict *options, Error **errp) > } > =20 > /* backing files always opened read-only */ > - back_flags =3D bs->open_flags & ~(BDRV_O_RDWR | BDRV_O_SNAPSHOT); > + back_flags =3D bs->open_flags & ~(BDRV_O_RDWR | BDRV_O_SNAPSHOT | > + BDRV_O_COPY_ON_READ); > =20 > ret =3D bdrv_open(bs->backing_hd, > *backing_filename ? backing_filename : NULL, optio= ns, > --=20 > 1.8.4.1 >=20 >=20 Reviewed-by: Benoit Canet