On 12/23/2015 12:46 AM, Denis V. Lunev wrote: > From: Olga Krishtal <okrish...@virtuozzo.com> > > 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. > > There are 2 ways at the moment: no lock at all and lock the file > image. > > Signed-off-by: Olga Krishtal <okrish...@virtuozzo.com> > Signed-off-by: Denis V. Lunev <d...@openvz.org> > CC: Kevin Wolf <kw...@redhat.com> > CC: Max Reitz <mre...@redhat.com> > CC: Eric Blake <ebl...@redhat.com> > CC: Fam Zheng <f...@redhat.com> > --- > @@ -895,6 +897,12 @@ static QemuOptsList bdrv_runtime_opts = { > .type = QEMU_OPT_BOOL, > .help = "Ignore flush requests", > }, > + { > + .name = "lock", > + .type = QEMU_OPT_STRING, > + .help = "How to lock the image: none or lockfile", > + .def_value_str = "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']} > -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature