[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 19/36] rbd: Factor out qemu_rbd_connect()
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [PATCH v2 19/36] rbd: Factor out qemu_rbd_connect() |
Date: |
Fri, 23 Feb 2018 00:10:54 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 2018-02-21 14:53, Kevin Wolf wrote:
> The code to establish an RBD connection is duplicated between open and
> create. In order to be able to share the code, factor out the code from
> qemu_rbd_open() as a first step.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> block/rbd.c | 100
> ++++++++++++++++++++++++++++++++++++------------------------
> 1 file changed, 60 insertions(+), 40 deletions(-)
>
> diff --git a/block/rbd.c b/block/rbd.c
> index 27fa11b473..4bbcce4eca 100644
> --- a/block/rbd.c
> +++ b/block/rbd.c
> @@ -544,32 +544,17 @@ out:
> return rados_str;
> }
>
> -static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags,
> - Error **errp)
> +static int qemu_rbd_connect(rados_t *cluster, rados_ioctx_t *io_ctx,
> + char **s_snap, char **s_image_name,
> + QDict *options, bool cache, Error **errp)
Bikeshedding ahead: Maybe this should be called qemu_rados_connect()?
I don't know anything about this, but there seems to be a distinction
between rados_* functions and rbd_* functions -- the former work on the
pool, the latter on the single block device.
Since this function only connects to the pool and not to a single device
within, I think it should be called qemu_rados_connect() instead of
qemu_rbd_connect().
(Also because qemu_rbd_connect() seems so similar to qemu_rbd_open().)
Up to you:
Reviewed-by: Max Reitz <address@hidden>
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v2 17/36] gluster: Support .bdrv_co_create, (continued)
- [Qemu-devel] [PATCH v2 20/36] rbd: Remove non-schema options from runtime_opts, Kevin Wolf, 2018/02/21
- [Qemu-devel] [PATCH v2 18/36] rbd: Fix use after free in qemu_rbd_set_keypairs() error path, Kevin Wolf, 2018/02/21
- [Qemu-devel] [PATCH v2 19/36] rbd: Factor out qemu_rbd_connect(), Kevin Wolf, 2018/02/21
- Re: [Qemu-devel] [PATCH v2 19/36] rbd: Factor out qemu_rbd_connect(),
Max Reitz <=
- [Qemu-devel] [PATCH v2 16/36] file-win32: Support .bdrv_co_create, Kevin Wolf, 2018/02/21
- [Qemu-devel] [PATCH v2 24/36] rbd: Use qemu_rbd_connect() in qemu_rbd_do_create(), Kevin Wolf, 2018/02/21
- [Qemu-devel] [PATCH v2 23/36] rbd: Assing s->snap/image_name in qemu_rbd_open(), Kevin Wolf, 2018/02/21
- [Qemu-devel] [PATCH v2 21/36] rbd: Pass BlockdevOptionsRbd to qemu_rbd_connect(), Kevin Wolf, 2018/02/21