[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 26/29] nbd: Merge nbd_export_new() and nbd_export_create()
From: |
Max Reitz |
Subject: |
Re: [PATCH 26/29] nbd: Merge nbd_export_new() and nbd_export_create() |
Date: |
Thu, 10 Sep 2020 17:30:51 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
On 07.09.20 20:20, Kevin Wolf wrote:
> There is no real reason any more why nbd_export_new() and
> nbd_export_create() should be separate functions. The latter only
> performs a few checks before it calls the former. Move all the checks to
> nbd/server.c and make the resulting function static.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> include/block/nbd.h | 7 +-----
> blockdev-nbd.c | 40 +++++----------------------------
> nbd/server.c | 54 ++++++++++++++++++++++++++++++++-------------
> 3 files changed, 45 insertions(+), 56 deletions(-)
I suppose it’s a question of style whether one big function (120 loc is
quite big) is better than two functions chain-calling each other (with a
poor split of functionality between the two).
I wouldn’t have anything against clearly splitting the functionality
into a function that checks the parameters, and another one that
actually creates the export.
In any case this isn’t the first function in qemu with more than 100 loc
and it won’t be the last; and it allows getting rid of two public
functions, so:
Reviewed-by: Max Reitz <mreitz@redhat.com>
signature.asc
Description: OpenPGP digital signature
- [PATCH 23/29] block/export: Create BlockBackend in blk_exp_add(), (continued)
- [PATCH 23/29] block/export: Create BlockBackend in blk_exp_add(), Kevin Wolf, 2020/09/07
- [PATCH 24/29] block/export: Add query-block-exports, Kevin Wolf, 2020/09/07
- [PATCH 22/29] block/export: Move blk to BlockExport, Kevin Wolf, 2020/09/07
- [PATCH 25/29] block/export: Move writable to BlockExportOptions, Kevin Wolf, 2020/09/07
- [PATCH 27/29] nbd: Deprecate nbd-server-add/remove, Kevin Wolf, 2020/09/07
- [PATCH 26/29] nbd: Merge nbd_export_new() and nbd_export_create(), Kevin Wolf, 2020/09/07
- Re: [PATCH 26/29] nbd: Merge nbd_export_new() and nbd_export_create(),
Max Reitz <=
- [PATCH 29/29] iotests: Test block-export-* QMP interface, Kevin Wolf, 2020/09/07
- [PATCH 28/29] iotests: Factor out qemu_tool_pipe_and_status(), Kevin Wolf, 2020/09/07
- Re: [PATCH 00/29] block/export: Add infrastructure and QAPI for block exports, Markus Armbruster, 2020/09/08