From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBt8r-0000t6-Jh for qemu-devel@nongnu.org; Wed, 23 Dec 2015 18:48:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBt8o-00064v-CC for qemu-devel@nongnu.org; Wed, 23 Dec 2015 18:48:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51455) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBt8o-00064r-43 for qemu-devel@nongnu.org; Wed, 23 Dec 2015 18:48:22 -0500 References: <567A4EB0.1040807@parallels.com> <1450856816-9816-1-git-send-email-den@openvz.org> <1450856816-9816-2-git-send-email-den@openvz.org> From: Eric Blake Message-ID: <567B32C3.4050603@redhat.com> Date: Wed, 23 Dec 2015 16:48:19 -0700 MIME-Version: 1.0 In-Reply-To: <1450856816-9816-2-git-send-email-den@openvz.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="SEXEnHKD1jfHjAiW6acJcOGdUg35C8PVG" Subject: Re: [Qemu-devel] [PATCH 1/5] block: added lock image option and callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" Cc: Kevin Wolf , Olga Krishtal , Fam Zheng , qemu-devel@nongnu.org, Max Reitz This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SEXEnHKD1jfHjAiW6acJcOGdUg35C8PVG Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/23/2015 12:46 AM, Denis V. Lunev wrote: > From: Olga Krishtal >=20 > While opening the image we want to be sure that we are the > one who works with image, anf if it is not true - s/anf/and/ > opening the image for writing should fail. >=20 > There are 2 ways at the moment: no lock at all and lock the file > image. >=20 > Signed-off-by: Olga Krishtal > Signed-off-by: Denis V. Lunev > CC: Kevin Wolf > CC: Max Reitz > CC: Eric Blake > CC: Fam Zheng > --- > @@ -895,6 +897,12 @@ static QemuOptsList bdrv_runtime_opts =3D { > .type =3D QEMU_OPT_BOOL, > .help =3D "Ignore flush requests", > }, > + { > + .name =3D "lock", > + .type =3D QEMU_OPT_STRING, > + .help =3D "How to lock the image: none or lockfile", > + .def_value_str =3D "none", If locking is not on by default, then it is not providing the protection we want. Having multiple lock styles doesn't help much - advisory locking is only useful if all clients use the same style. > +++ b/qapi/block-core.json > @@ -2408,3 +2408,12 @@ > ## > { 'command': 'block-set-write-threshold', > 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } } > + > +## > +# @BdrvLockImage: > +# > +#An enumeration of lock types to lock image file. > +# @none - do not lock the image file > +# @lockfile I know you said this series was rough, but you didn't document much about what lockfile means. > +## Since 2.6 > +{ 'enum': 'BdrvLockImage', 'data':['none', 'lockfile']} >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --SEXEnHKD1jfHjAiW6acJcOGdUg35C8PVG 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWezLEAAoJEKeha0olJ0NqaoQH/3c8xa5IaBZX+pACIkOifPC1 uljyczFFifc82l0VdXqb5shdBoqeBhMc5y9wdj4YlqO237K44W/96SgDg4ou6/XL 9T8jPDA3qsqqDyRwz8Ky7zhZ6BbHtsRUmx4vdmpXIRlzho+cx61RGJ9P9wbtvM/l J6AR2u7jUAy57oK6mB9gGaUNZ7BjOt3kcKLEnVC912j8RNynUMixLHQMX2QF82zk PrBuCXx+6NHtQxrY6AsHNo3ABLeSzIu9X3bc+7j1ajepkZl9PNFXQAWiMXOLOaam NPN+U9EXbR/R+cISnmFl+9hvMa4wV0tBZYDyRq9/EThMJNR556Q+sy791D8Vnvg= =XNDF -----END PGP SIGNATURE----- --SEXEnHKD1jfHjAiW6acJcOGdUg35C8PVG--