[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
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 09/10] qcow2: Make image inaccessible after failed qcow2_invalidate_cache(), (continued)
- [Qemu-devel] [PATCH 09/10] qcow2: Make image inaccessible after failed qcow2_invalidate_cache(), Kevin Wolf, 2015/12/22
- [Qemu-devel] [PATCH 10/10] qcow2: Add image locking, Kevin Wolf, 2015/12/22
- Re: [Qemu-devel] [PATCH 00/10] qcow2: Implement image locking, Fam Zheng, 2015/12/22
- Re: [Qemu-devel] [Qemu-block] [PATCH 00/10] qcow2: Implement image locking, Denis V. Lunev, 2015/12/23
- [Qemu-devel] [PATCH RFC 0/5] generic image locking and crash recovery, Denis V. Lunev, 2015/12/23
- [Qemu-devel] [PATCH 2/5] block: implemented bdrv_lock_image for raw file, Denis V. Lunev, 2015/12/23
- Re: [Qemu-devel] [PATCH 2/5] block: implemented bdrv_lock_image for raw file, Daniel P. Berrange, 2015/12/23
- [Qemu-devel] [PATCH 1/5] block: added lock image option and callback, Denis V. Lunev, 2015/12/23
- Re: [Qemu-devel] [PATCH 1/5] block: added lock image option and callback,
Eric Blake <=
- [Qemu-devel] [PATCH 3/5] block: added check image option and callback bdrv_is_opened_unclean, Denis V. Lunev, 2015/12/23
- Re: [Qemu-devel] [PATCH 3/5] block: added check image option and callback bdrv_is_opened_unclean, Fam Zheng, 2015/12/23
- Re: [Qemu-devel] [PATCH 3/5] block: added check image option and callback bdrv_is_opened_unclean, Denis V. Lunev, 2015/12/23
- [Qemu-devel] [PATCH 4/5] qcow2: implemented bdrv_is_opened_unclean, Denis V. Lunev, 2015/12/23
- [Qemu-devel] [PATCH 5/5] block/paralels: added paralles implementation for bdrv_is_opened_unclean, Denis V. Lunev, 2015/12/23
- Re: [Qemu-devel] [PATCH RFC 0/5] generic image locking and crash recovery, Fam Zheng, 2015/12/23
- Re: [Qemu-devel] [PATCH RFC 0/5] generic image locking and crash recovery, Denis V. Lunev, 2015/12/23
- Re: [Qemu-devel] [PATCH 00/10] qcow2: Implement image locking, Daniel P. Berrange, 2015/12/23