qemu-devel
[Top][All Lists]
Advanced

[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>

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]