From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T20S0-0008I0-7C for qemu-devel@nongnu.org; Thu, 16 Aug 2012 09:49:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T20Ru-0004wA-9G for qemu-devel@nongnu.org; Thu, 16 Aug 2012 09:49:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33754) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T20Ru-0004w5-0p for qemu-devel@nongnu.org; Thu, 16 Aug 2012 09:49:22 -0400 Message-ID: <502CFA5E.50900@redhat.com> Date: Thu, 16 Aug 2012 07:49:18 -0600 From: Eric Blake MIME-Version: 1.0 References: <1345107632-10460-1-git-send-email-kwolf@redhat.com> <502CEDE9.9010504@redhat.com> <502CF711.2060000@redhat.com> In-Reply-To: <502CF711.2060000@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigE756A19376F9932D95E6FE24" Subject: Re: [Qemu-devel] [PATCH] Documentation: Warn against qemu-img on active image List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Peter Maydell , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigE756A19376F9932D95E6FE24 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/16/2012 07:35 AM, Kevin Wolf wrote: > Am 16.08.2012 14:56, schrieb Eric Blake: >> On 08/16/2012 04:00 AM, Peter Maydell wrote: >>> On 16 August 2012 10:00, Kevin Wolf wrote: >>>> People have repeatedly expected that you can do things like snapshot= ting >>>> an image with qemu-img while a qemu instance is running. Maybe we ne= ed >>>> to consider locking the files while they are in use, >> >> Sounds like a nice feature bit to add to qcow2v3, where both qemu-img >> and qemu check if the locking feature is enabled for an image, as well= >> as maintain a header bit that is set when the image is open read-write= >> and refuse to use the image if the lock bit is set. >=20 > I thought the same. However, then you need some way to override this > mechanism when recovering from a crash etc., so it's not a trivial > addition and it would be user-visible. Good point. With fcntl() locking, the lock goes away on crash; but with file modification locking, the lock can get stuck so you have to provide overrides; and once you provide overrides, the lock is not quite as powerful. So maybe it's best to just leave locking up to management apps (after all, libvirt already has a lock protocol support, currently built on sanlock but also with a patch proposed for using fcntl()). >> Is this strong enough? Remember, with qcow2v3 and qed, the mere act o= f >> opening an image will perform refcount checks that modify the image, >> unless you explicitly request otherwise, which means even a query of t= he >> file metadata may result in modifying the image as part of the default= >> open.=20 >=20 > Not for read-only opens. I think qemu-img gets this right meanwhile, so= > that images are opened read-only when they are only queried. Then it might also be worth documenting which actions are read-only queries vs. potential modifications, in the docs for each action. (For example, 'info' is read-only, 'convert' is read-only when creating a copy although consistency is essential for it to be useful, 'check' is readonly while 'check -r' is read-write,...) --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigE756A19376F9932D95E6FE24 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJQLPpfAAoJEKeha0olJ0NqC0gH/jS7otwbHoG012BIt56PDvIW f9vaNnINPluyXPZ3AvRS2pyRNV3i42Bao9kTKoyoCN78tKC5B7rYt62zbGZT1ti1 ka1KGduDFHcYyHyStu92e6/yFDQW3JYYxUvbquWvhu49D2G7eQ4CD2Cprw/h1SgO cqnai3ZdX7EVBph5ftTGMihQVeN5YV23KtRYNecrkYaUF2s0KSq3fJZkl/3WMV3F s3C+emS/mZfV+33+met0GAALTRcgkwuF+voMlk5CR92SsrcIWKMot8lAn0hGxCXx TYHuMkXzN5Po8ooVEjUj5SpKfJbbttl2t+mMGVF7NHB/qx9cF0lElePx5PldAIY= =ZewV -----END PGP SIGNATURE----- --------------enigE756A19376F9932D95E6FE24--