Signed-off-by: Max Reitz <mre...@redhat.com> --- block/fuse.c | 16 ++++++++++++++++ qapi/block.json | 15 +++++++++++++++ 2 files changed, 31 insertions(+)
diff --git a/block/fuse.c b/block/fuse.c index f18e8e7591..4e662e6dfb 100644 --- a/block/fuse.c +++ b/block/fuse.c @@ -123,6 +123,22 @@ fail: close_fuse_session(session); } +void qmp_fuse_export_remove(const char *mountpoint, Error **errp) +{ + BdrvFuseSession *session = NULL; + + if (sessions) { + session = g_hash_table_lookup(sessions, mountpoint); + } + + if (!session) { + error_setg(errp, "No export found on '%s'", mountpoint); + return; + } + + g_hash_table_remove(sessions, mountpoint); +} + /** * Drop all FUSE exports. */ diff --git a/qapi/block.json b/qapi/block.json index 03f8d1b537..26768dc8ef 100644 --- a/qapi/block.json +++ b/qapi/block.json @@ -340,6 +340,21 @@ }, 'if': 'defined(CONFIG_FUSE)' } +## +# @fuse-export-remove: +# +# Unmount an exported block graph node. +# +# @mountpoint: The export path given to fuse-export-add +# +# Since: 5.0 +## +{ 'command': 'fuse-export-remove', + 'data': { + 'mountpoint': 'str' + }, + 'if': 'defined(CONFIG_FUSE)' } + ## # @DEVICE_TRAY_MOVED: # -- 2.23.0