From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WgtQR-00075X-W0 for qemu-devel@nongnu.org; Sun, 04 May 2014 06:13:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WgtQJ-00071m-Fp for qemu-devel@nongnu.org; Sun, 04 May 2014 06:13:39 -0400 Received: from mout.web.de ([212.227.15.3]:58995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WgtQJ-00071W-69 for qemu-devel@nongnu.org; Sun, 04 May 2014 06:13:31 -0400 Message-ID: <536612C3.5000203@web.de> Date: Sun, 04 May 2014 12:13:23 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1398882243-14783-1-git-send-email-kwolf@redhat.com> <1398882243-14783-17-git-send-email-kwolf@redhat.com> In-Reply-To: <1398882243-14783-17-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="G9sK5VkpJkefP58uBH5loHE9iTwUEeVbj" Subject: Re: [Qemu-devel] [PULL 16/31] block: Fix open_flags in bdrv_reopen() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-devel@nongnu.org Cc: Max Reitz This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --G9sK5VkpJkefP58uBH5loHE9iTwUEeVbj Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2014-04-30 20:23, Kevin Wolf wrote: > Use the same function as bdrv_open() for determining what the right > flags for bs->file are. Without doing this, a reopen means that > bs->file loses BDRV_O_CACHE_WB or BDRV_O_UNMAP if bs doesn't have it as= > well. >=20 > Signed-off-by: Kevin Wolf > Reviewed-by: Max Reitz > --- > block.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/block.c b/block.c > index 9f6f07e..b749d31 100644 > --- a/block.c > +++ b/block.c > @@ -1525,8 +1525,11 @@ BlockReopenQueue *bdrv_reopen_queue(BlockReopenQ= ueue *bs_queue, > QSIMPLEQ_INIT(bs_queue); > } > =20 > + /* bdrv_open() masks this flag out */ > + flags &=3D ~BDRV_O_PROTOCOL; > + > if (bs->file) { > - bdrv_reopen_queue(bs_queue, bs->file, flags); > + bdrv_reopen_queue(bs_queue, bs->file, bdrv_inherited_flags(fla= gs)); > } > =20 > bs_entry =3D g_new0(BlockReopenQueueEntry, 1); >=20 This breaks the "commit" monitor command for disks in snapshot mode. Returned error is "no permission" (I assume -EPERM). Jan --G9sK5VkpJkefP58uBH5loHE9iTwUEeVbj 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.0.19 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlNmEscACgkQitSsb3rl5xTtigCg60lLkYeHDBjMHf7YUQgHWcwg OawAoLBxmomlZfSM2qgbbRJUvYmSpQbB =Wu1/ -----END PGP SIGNATURE----- --G9sK5VkpJkefP58uBH5loHE9iTwUEeVbj--