[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 14/27] qemu-img: Add "-L" option to sub comma
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [PATCH v5 14/27] qemu-img: Add "-L" option to sub commands |
Date: |
Tue, 24 May 2016 20:06:01 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 |
On 17.05.2016 09:35, Fam Zheng wrote:
> If specified, BDRV_O_NO_LOCK flag will be set when opening the image.
>
> Signed-off-by: Fam Zheng <address@hidden>
> ---
> qemu-img.c | 89
> ++++++++++++++++++++++++++++++++++++++++++++++++++------------
> 1 file changed, 72 insertions(+), 17 deletions(-)
>
> diff --git a/qemu-img.c b/qemu-img.c
> index 4792366..b13755b 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
[...]
> @@ -1206,6 +1220,7 @@ static int img_compare(int argc, char **argv)
> qemu_progress_init(progress, 2.0);
>
> flags = 0;
> + flags |= nolock ? BDRV_O_NO_LOCK : 0;
This reads weird. I'd either put this line below bdrv_parse_cache_mode()
or drop the line initializing src_flags to 0 (and make this a plain
assignment).
> ret = bdrv_parse_cache_mode(cache, &flags, &writethrough);
> if (ret < 0) {
> error_report("Invalid source cache option: %s", cache);
[...]
> @@ -1907,6 +1926,7 @@ static int img_convert(int argc, char **argv)
> }
>
> src_flags = 0;
> + src_flags |= nolock ? BDRV_O_NO_LOCK : 0;
Same here.
Also: Should we have distinct flags for source and target for convert?
For instance, I can imagine someone wanting not to lock the source but
leave the target in default exclusive mode.
> ret = bdrv_parse_cache_mode(src_cache, &src_flags, &src_writethrough);
> if (ret < 0) {
> error_report("Invalid source cache option: %s", src_cache);
[...]
> @@ -2881,6 +2924,7 @@ static int img_rebase(int argc, char **argv)
> qemu_progress_print(0, 100);
>
> flags = BDRV_O_RDWR | (unsafe ? BDRV_O_NO_BACKING : 0);
> + flags |= nolock ? BDRV_O_NO_LOCK : 0;
> ret = bdrv_parse_cache_mode(cache, &flags, &writethrough);
> if (ret < 0) {
> error_report("Invalid cache option: %s", cache);
What about the source/base image? And again, would it make sense to have
distinct flags for source and target?
Max
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v5 09/27] osdep: Introduce qemu_dup, (continued)
- [Qemu-devel] [PATCH v5 11/27] raw-posix: Implement .bdrv_lockf, Fam Zheng, 2016/05/17
- [Qemu-devel] [PATCH v5 10/27] raw-posix: Use qemu_dup, Fam Zheng, 2016/05/17
- [Qemu-devel] [PATCH v5 16/27] qemu-nbd: Add "--no-lock/-L" option, Fam Zheng, 2016/05/17
- [Qemu-devel] [PATCH v5 15/27] qemu-img: Update documentation of "-L" option, Fam Zheng, 2016/05/17
- [Qemu-devel] [PATCH v5 14/27] qemu-img: Add "-L" option to sub commands, Fam Zheng, 2016/05/17
- Re: [Qemu-devel] [PATCH v5 14/27] qemu-img: Add "-L" option to sub commands,
Max Reitz <=
- [Qemu-devel] [PATCH v5 13/27] qemu-io: Add "-L" option for BDRV_O_NO_LOCK, Fam Zheng, 2016/05/17
- [Qemu-devel] [PATCH v5 17/27] block: Don't lock drive-backup target image in none mode, Fam Zheng, 2016/05/17
- [Qemu-devel] [PATCH v5 18/27] mirror: Disable image locking on target backing chain, Fam Zheng, 2016/05/17
- [Qemu-devel] [PATCH v5 19/27] qemu-iotests: 140: Disable image lock for qemu-io access, Fam Zheng, 2016/05/17
- [Qemu-devel] [PATCH v5 21/27] qemu-iotests: Wait for QEMU processes before checking image in 091, Fam Zheng, 2016/05/17