nbd: Merge nbd_export_new() and nbd_export_create()
commit5b1cb49704551cff8913032b22c9d6566d217cbb
authorKevin Wolf <kwolf@redhat.com>
Thu, 24 Sep 2020 15:27:12 +0000 (24 17:27 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 2 Oct 2020 13:46:40 +0000 (2 15:46 +0200)
treed235f78a3c7516fc334f96497e37f145f1ef1eff
parent30dbc81d310cc5c78589ab689083371c4bfced1f
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 <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200924152717.287415-27-kwolf@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev-nbd.c
include/block/nbd.h
nbd/server.c