qemu-nbd: Use blk_exp_add() to create the export
commit00917172a688892003605836454312364864e89d
authorKevin Wolf <kwolf@redhat.com>
Thu, 24 Sep 2020 15:26:57 +0000 (24 17:26 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 2 Oct 2020 13:46:40 +0000 (2 15:46 +0200)
tree3fca6db1e76258e0021de8cc9406806f9c20e80f
parentd794f7f3728df0845be978a3c9aecead9d48c81d
qemu-nbd: Use blk_exp_add() to create the export

With this change, NBD exports are now only created through the
BlockExport interface. This allows us finally to move things from the
NBD layer to the BlockExport layer if they make sense for other export
types, too.

blk_exp_add() returns only a weak reference, so the explicit
nbd_export_put() goes away.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200924152717.287415-12-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
qemu-nbd.c