[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 18/27] sheepdog: QAPIfy "redundacy" create optio
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH 18/27] sheepdog: QAPIfy "redundacy" create option |
Date: |
Mon, 12 Feb 2018 17:03:23 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
On 2018-02-08 20:23, Kevin Wolf wrote:
> The "redundacy" 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>
> ---
> qapi/block-core.json | 45 ++++++++++++++++++++++++++
> block/sheepdog.c | 89
> ++++++++++++++++++++++++++++++++++++----------------
> 2 files changed, 107 insertions(+), 27 deletions(-)
Reviewed-by: Max Reitz <address@hidden>
> diff --git a/block/sheepdog.c b/block/sheepdog.c
> index f684477328..dc0348f120 100644
> --- a/block/sheepdog.c
> +++ b/block/sheepdog.c
[...]
> @@ -1912,35 +1954,28 @@ 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() */
But this is not the time? ;-)
> - if (copy > SD_MAX_COPIES || copy < 1) {
> - return -EINVAL;
> - }
> - if (!n2) {
> - inode->copy_policy = 0;
> - inode->nr_copies = copy;
> - return 0;
> - }
> + copy = strtol(n1, NULL, 10);
>
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-block] [PATCH 14/27] gluster: Support .bdrv_co_create, (continued)
- [Qemu-block] [PATCH 15/27] rbd: Support .bdrv_co_create, Kevin Wolf, 2018/02/08
- [Qemu-block] [PATCH 16/27] nfs: Use QAPI options in nfs_client_open(), Kevin Wolf, 2018/02/08
- [Qemu-block] [PATCH 17/27] nfs: Support .bdrv_co_create, Kevin Wolf, 2018/02/08
- [Qemu-block] [PATCH 19/27] sheepdog: Support .bdrv_co_create, Kevin Wolf, 2018/02/08
- [Qemu-block] [PATCH 18/27] sheepdog: QAPIfy "redundacy" create option, Kevin Wolf, 2018/02/08
- Re: [Qemu-block] [PATCH 18/27] sheepdog: QAPIfy "redundacy" create option,
Max Reitz <=
- [Qemu-block] [PATCH 20/27] ssh: Use QAPI BlockdevOptionsSsh object, Kevin Wolf, 2018/02/08
- [Qemu-block] [PATCH 21/27] ssh: QAPIfy host-key-check option, Kevin Wolf, 2018/02/08
- [Qemu-block] [PATCH 22/27] ssh: Pass BlockdevOptionsSsh to connect_to_ssh(), Kevin Wolf, 2018/02/08
- [Qemu-block] [PATCH 23/27] ssh: Support .bdrv_co_create, Kevin Wolf, 2018/02/08
- [Qemu-block] [PATCH 24/27] file-posix: Fix no-op bdrv_truncate() with falloc preallocation, Kevin Wolf, 2018/02/08