From bc4ee65b8c309ed6a726e3ea1b73f7fa31b4bb95 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 24 Sep 2020 17:27:03 +0200 Subject: block/export: Add blk_exp_close_all(_type) This adds a function to shut down all block exports, and another one to shut down the block exports of a single type. The latter is used for now when stopping the NBD server. As soon as we implement support for multiple NBD servers, we'll need a per-server list of exports and it will be replaced by a function using that. As a side effect, the BlockExport layer has a list tracking all existing exports now. closed_exports loses its only user and can go away. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Message-Id: <20200924152717.287415-18-kwolf@redhat.com> Acked-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- blockdev-nbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'blockdev-nbd.c') diff --git a/blockdev-nbd.c b/blockdev-nbd.c index b34f159888..f927264777 100644 --- a/blockdev-nbd.c +++ b/blockdev-nbd.c @@ -345,7 +345,7 @@ void qmp_nbd_server_stop(Error **errp) return; } - nbd_export_close_all(); + blk_exp_close_all_type(BLOCK_EXPORT_TYPE_NBD); nbd_server_free(nbd_server); nbd_server = NULL; -- cgit 1.4.1