From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aS41Y-0005S3-KG for qemu-devel@nongnu.org; Sat, 06 Feb 2016 09:39:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aS41X-0000yD-Kx for qemu-devel@nongnu.org; Sat, 06 Feb 2016 09:39:44 -0500 References: <20160206133618.GA16635@li141-249.members.linode.com> From: Max Reitz Message-ID: <56B605A7.8010101@redhat.com> Date: Sat, 6 Feb 2016 15:39:35 +0100 MIME-Version: 1.0 In-Reply-To: <20160206133618.GA16635@li141-249.members.linode.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gq3obikIppVSisSvGWEQCjFRarBT4mst9" Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v2] blockdev: unset inappropriate flags when changing medium List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alyssa Milburn , qemu-devel@nongnu.org Cc: Kevin Wolf , Markus Armbruster , qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gq3obikIppVSisSvGWEQCjFRarBT4mst9 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 06.02.2016 14:36, Alyssa Milburn wrote: > Most importantly, this removes BDRV_O_TEMPORARY, to avoid unlink()ing a= n > image which replaces a snapshotted one. >=20 > Signed-off-by: Alyssa Milburn > --- > blockdev.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/blockdev.c b/blockdev.c > index be4ca44..a916b06 100644 > --- a/blockdev.c > +++ b/blockdev.c > @@ -2514,6 +2514,8 @@ void qmp_blockdev_change_medium(const char *devic= e, const char *filename, > } > =20 > bdrv_flags =3D blk_get_open_flags_from_root_state(blk); > + bdrv_flags &=3D ~(BDRV_O_TEMPORARY | BDRV_O_SNAPSHOT | BDRV_O_NO_B= ACKING | > + BDRV_O_PROTOCOL); > =20 > if (!has_read_only) { > read_only =3D BLOCKDEV_CHANGE_READ_ONLY_MODE_RETAIN; >=20 Thanks, applied to my block tree: https://github.com/XanClic/qemu/commits/block Max --gq3obikIppVSisSvGWEQCjFRarBT4mst9 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 iQEcBAEBCAAGBQJWtgWnAAoJEDuxQgLoOKytiGQH+wTclvntgbrOEjPSOeG0NUPe iTX8C2p1jtuqKfgfFl100uwAI70yyHy3isJv19M6L5SLpuSxpkB6bIVqD/LmTJTE hpvDvLNjiNQmPnjtUzs3YAX5OTMSceeBfyINcu0mOG7jjLAbSdGVoNTrPdGcevPt nRAewCm8X6ATgJhTiz/hIT6OBX6iMfb1vkZmqx/pChSfX1wPKw212kkIIXhGUaG3 qZxhpFDNWj1ckvHxmOtCA5RLm1iOhC3HY04yDZTPbUXXiMBQHqrRmBiaE3DZZ58B LUl8BvKCnD2HLPhHhGUdzCncaMt+4Xz0/MqSubUXlSoE9Eoj5+4EtmNog5T7Jf4= =UUg2 -----END PGP SIGNATURE----- --gq3obikIppVSisSvGWEQCjFRarBT4mst9--