From 5b1cb49704551cff8913032b22c9d6566d217cbb Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 24 Sep 2020 17:27:12 +0200 Subject: nbd: Merge nbd_export_new() and nbd_export_create() 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. What makes the current state stand out is that it's the only function in BlockExportDriver that is not a static function inside nbd/server.c, but a small wrapper in blockdev-nbd.c that then calls back into nbd/server.c for the real functionality. Move all the checks to nbd/server.c and make the resulting function static to improve readability. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Message-Id: <20200924152717.287415-27-kwolf@redhat.com> Acked-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- include/block/nbd.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'include/block/nbd.h') diff --git a/include/block/nbd.h b/include/block/nbd.h index 5270b7e..3dd9a04 100644 --- a/include/block/nbd.h +++ b/include/block/nbd.h @@ -330,12 +330,6 @@ int nbd_errno_to_system_errno(int err); typedef struct NBDExport NBDExport; typedef struct NBDClient NBDClient; -int nbd_export_create(BlockExport *exp, BlockExportOptions *exp_args, - Error **errp); -int nbd_export_new(BlockExport *blk_exp, - const char *name, const char *desc, - const char *bitmap, bool readonly, bool shared, - Error **errp); void nbd_export_set_on_eject_blk(BlockExport *exp, BlockBackend *blk); AioContext *nbd_export_aio_context(NBDExport *exp); @@ -349,6 +343,7 @@ void nbd_client_get(NBDClient *client); void nbd_client_put(NBDClient *client); void nbd_server_is_qemu_nbd(bool value); +bool nbd_server_is_running(void); void nbd_server_start(SocketAddress *addr, const char *tls_creds, const char *tls_authz, uint32_t max_connections, Error **errp); -- cgit v1.1