[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v3 27/36] sheepdog: QAPIfy "redundancy" create o
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH v3 27/36] sheepdog: QAPIfy "redundancy" create option |
Date: |
Mon, 26 Feb 2018 13:28:46 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 2018-02-23 20:25, Kevin Wolf wrote:
> The "redundancy" option for Sheepdog image creation is currently a
> string that can encode one or two integers depending on its format,
> which at the same time implicitly selects a mode.
>
> This patch turns it into a QAPI union and converts the string into such
> a QAPI object before interpreting the values.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> Reviewed-by: Max Reitz <address@hidden>
> ---
> qapi/block-core.json | 45 +++++++++++++++++++++++++
> block/sheepdog.c | 94
> +++++++++++++++++++++++++++++++++++++---------------
> 2 files changed, 112 insertions(+), 27 deletions(-)
[...]
> @@ -1907,35 +1950,32 @@ static int parse_redundancy(BDRVSheepdogState *s,
> const char *opt)
> return -EINVAL;
> }
>
> - copy = strtol(n1, NULL, 10);
> - /* FIXME fix error checking by switching to qemu_strtol() */
> - if (copy > SD_MAX_COPIES || copy < 1) {
> - return -EINVAL;
> - }
> - if (!n2) {
> - inode->copy_policy = 0;
> - inode->nr_copies = copy;
> - return 0;
> + ret = qemu_strtol(n1, NULL, 10, ©);
(By the way: This was what I was thanking you for in v2 -- I just now
realized I was clever enough not to point to it in my reply...)
> + if (ret < 0) {
> + return ret;
> }
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-block] [PATCH v3 21/36] rbd: Pass BlockdevOptionsRbd to qemu_rbd_connect(), (continued)
- [Qemu-block] [PATCH v3 22/36] rbd: Support .bdrv_co_create, Kevin Wolf, 2018/02/23
- [Qemu-block] [PATCH v3 23/36] rbd: Assign s->snap/image_name in qemu_rbd_open(), Kevin Wolf, 2018/02/23
- [Qemu-block] [PATCH v3 20/36] rbd: Remove non-schema options from runtime_opts, Kevin Wolf, 2018/02/23
- [Qemu-block] [PATCH v3 24/36] rbd: Use qemu_rbd_connect() in qemu_rbd_do_create(), Kevin Wolf, 2018/02/23
- [Qemu-block] [PATCH v3 25/36] nfs: Use QAPI options in nfs_client_open(), Kevin Wolf, 2018/02/23
- [Qemu-block] [PATCH v3 26/36] nfs: Support .bdrv_co_create, Kevin Wolf, 2018/02/23
- [Qemu-block] [PATCH v3 27/36] sheepdog: QAPIfy "redundancy" create option, Kevin Wolf, 2018/02/23
- Re: [Qemu-block] [PATCH v3 27/36] sheepdog: QAPIfy "redundancy" create option,
Max Reitz <=
- [Qemu-block] [PATCH v3 28/36] sheepdog: Support .bdrv_co_create, Kevin Wolf, 2018/02/23
- [Qemu-block] [PATCH v3 29/36] ssh: Use QAPI BlockdevOptionsSsh object, Kevin Wolf, 2018/02/23
- [Qemu-block] [PATCH v3 30/36] ssh: QAPIfy host-key-check option, Kevin Wolf, 2018/02/23
- [Qemu-block] [PATCH v3 33/36] file-posix: Fix no-op bdrv_truncate() with falloc preallocation, Kevin Wolf, 2018/02/23
- [Qemu-block] [PATCH v3 31/36] ssh: Pass BlockdevOptionsSsh to connect_to_ssh(), Kevin Wolf, 2018/02/23
- [Qemu-block] [PATCH v3 32/36] ssh: Support .bdrv_co_create, Kevin Wolf, 2018/02/23
- [Qemu-block] [PATCH v3 34/36] block: Fail bdrv_truncate() with negative size, Kevin Wolf, 2018/02/23
- [Qemu-block] [PATCH v3 35/36] qemu-iotests: Test qcow2 over file image creation with QMP, Kevin Wolf, 2018/02/23