From 3c3bc462adeb561f5dfdcbb84ae691c95ccef916 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 24 Sep 2020 17:27:06 +0200 Subject: block/export: Add block-export-del Implement a new QMP command block-export-del and make nbd-server-remove a wrapper around it. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Message-Id: <20200924152717.287415-21-kwolf@redhat.com> Acked-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- qapi/block-export.json | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'qapi') diff --git a/qapi/block-export.json b/qapi/block-export.json index 658bdf05e1..3d22527c84 100644 --- a/qapi/block-export.json +++ b/qapi/block-export.json @@ -116,9 +116,9 @@ 'data': 'NbdServerAddOptions', 'boxed': true } ## -# @NbdServerRemoveMode: +# @BlockExportRemoveMode: # -# Mode for removing an NBD export. +# Mode for removing a block export. # # @safe: Remove export if there are no existing connections, fail otherwise. # @@ -134,16 +134,16 @@ # # Since: 2.12 ## -{'enum': 'NbdServerRemoveMode', 'data': ['safe', 'hard']} +{'enum': 'BlockExportRemoveMode', 'data': ['safe', 'hard']} ## # @nbd-server-remove: # # Remove NBD export by name. # -# @name: Export name. +# @name: Block export id. # -# @mode: Mode of command operation. See @NbdServerRemoveMode description. +# @mode: Mode of command operation. See @BlockExportRemoveMode description. # Default is 'safe'. # # Returns: error if @@ -154,7 +154,7 @@ # Since: 2.12 ## { 'command': 'nbd-server-remove', - 'data': {'name': 'str', '*mode': 'NbdServerRemoveMode'} } + 'data': {'name': 'str', '*mode': 'BlockExportRemoveMode'} } ## # @nbd-server-stop: @@ -213,3 +213,23 @@ ## { 'command': 'block-export-add', 'data': 'BlockExportOptions', 'boxed': true } + +## +# @block-export-del: +# +# Request to remove a block export. This drops the user's reference to the +# export, but the export may still stay around after this command returns until +# the shutdown of the export has completed. +# +# @id: Block export id. +# +# @mode: Mode of command operation. See @BlockExportRemoveMode description. +# Default is 'safe'. +# +# Returns: Error if the export is not found or @mode is 'safe' and the export +# is still in use (e.g. by existing client connections) +# +# Since: 5.2 +## +{ 'command': 'block-export-del', + 'data': { 'id': 'str', '*mode': 'BlockExportRemoveMode' } } -- cgit v1.2.3