[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v2 23/36] rbd: ***ing s->snap/image_name in qemu
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH v2 23/36] rbd: ***ing s->snap/image_name in qemu_rbd_open() |
Date: |
Fri, 23 Feb 2018 00:34:28 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
I suppose the first word after the colon in your subject is supposed to
be "assign" and not what it currently is (which is something I am not
going to repeat!). :-)
On 2018-02-21 14:53, Kevin Wolf wrote:
> Now that the options are already available in qemu_rbd_open() and not
> only parsed in qemu_rbd_connect(), we can assign s->snap and
> s->image_name there instead of passing the fields by reference to
> qemu_rbd_connect().
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> block/rbd.c | 14 +++++---------
> 1 file changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/block/rbd.c b/block/rbd.c
> index 82f03505a9..a34bf0be46 100644
> --- a/block/rbd.c
> +++ b/block/rbd.c
[...]
> @@ -716,13 +710,15 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict
> *options, int flags,
> goto out;
> }
>
> - r = qemu_rbd_connect(&s->cluster, &s->io_ctx, &s->snap, &s->image_name,
> - opts, !(flags & BDRV_O_NOCACHE), keypairs, secretid,
> - errp);
> + r = qemu_rbd_connect(&s->cluster, &s->io_ctx, opts,
> + !(flags & BDRV_O_NOCACHE), keypairs, secretid,
> errp);
> if (r < 0) {
> goto out;
> }
>
> + s->snap = g_strdup(opts->snapshot);
> + s->image_name = g_strdup(opts->image);
> +
Same question as in patch 21: Should we guard these by checking
opts->has_* first?
Max
> /* rbd_open is always r/w */
> r = rbd_open(s->io_ctx, s->image_name, &s->image, s->snap);
> if (r < 0) {
>
signature.asc
Description: OpenPGP digital signature
- [Qemu-block] [PATCH v2 16/36] file-win32: Support .bdrv_co_create, (continued)
[Qemu-block] [PATCH v2 24/36] rbd: Use qemu_rbd_connect() in qemu_rbd_do_create(), Kevin Wolf, 2018/02/21
[Qemu-block] [PATCH v2 23/36] rbd: Assing s->snap/image_name in qemu_rbd_open(), Kevin Wolf, 2018/02/21
- Re: [Qemu-block] [PATCH v2 23/36] rbd: ***ing s->snap/image_name in qemu_rbd_open(),
Max Reitz <=
[Qemu-block] [PATCH v2 25/36] nfs: Use QAPI options in nfs_client_open(), Kevin Wolf, 2018/02/21
[Qemu-block] [PATCH v2 22/36] rbd: Support .bdrv_co_create, Kevin Wolf, 2018/02/21
[Qemu-block] [PATCH v2 27/36] sheepdog: QAPIfy "redundacy" create option, Kevin Wolf, 2018/02/21
[Qemu-block] [PATCH v2 26/36] nfs: Support .bdrv_co_create, Kevin Wolf, 2018/02/21
[Qemu-block] [PATCH v2 29/36] ssh: Use QAPI BlockdevOptionsSsh object, Kevin Wolf, 2018/02/21
[Qemu-block] [PATCH v2 28/36] sheepdog: Support .bdrv_co_create, Kevin Wolf, 2018/02/21