qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/5] block: added lock image option and callback


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 1/5] block: added lock image option and callback
Date: Wed, 23 Dec 2015 16:48:19 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 12/23/2015 12:46 AM, Denis V. Lunev wrote:
> From: Olga Krishtal <address@hidden>
> 
> 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 <address@hidden>
> Signed-off-by: Denis V. Lunev <address@hidden>
> CC: Kevin Wolf <address@hidden>
> CC: Max Reitz <address@hidden>
> CC: Eric Blake <address@hidden>
> CC: Fam Zheng <address@hidden>
> ---

> @@ -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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]