aboutsummaryrefslogtreecommitdiff
path: root/qapi
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-01-26 17:29:14 +0000
committerPeter Maydell <peter.maydell@linaro.org>2018-01-26 17:29:14 +0000
commit6233b4a8c2a32ef6955a921246fa08705bbb3676 (patch)
treed8985aba7aa14f1c066f8e75b1d479cf833edacd /qapi
parente607bbee553cfe73072870cef458cfa4e78133e2 (diff)
parent9776f0db6a19a0510e89b7aae38190b4811c95ba (diff)
downloadqemu-6233b4a8c2a32ef6955a921246fa08705bbb3676.zip
qemu-6233b4a8c2a32ef6955a921246fa08705bbb3676.tar.gz
qemu-6233b4a8c2a32ef6955a921246fa08705bbb3676.tar.bz2
Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2018-01-26' into staging
nbd patches for 2018-01-26 - Vladimir Sementsov-Ogievskiy - nbd export qmp interface - Eric Blake - hmp: Add nbd_server_remove to mirror QMP command - Edgar Kaziakhmedov - nbd: implement bdrv_get_info callback # gpg: Signature made Fri 26 Jan 2018 16:02:34 GMT # gpg: using RSA key 0xA7A16B4A2527436A # gpg: Good signature from "Eric Blake <eblake@redhat.com>" # gpg: aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" # gpg: aka "[jpeg image of size 6874]" # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2 F3AA A7A1 6B4A 2527 436A * remotes/ericb/tags/pull-nbd-2018-01-26: nbd: implement bdrv_get_info callback hmp: Add nbd_server_remove to mirror QMP command iotest 205: new test for qmp nbd-server-remove iotests: implement QemuIoInteractive class iotest 147: add cases to test new @name parameter of nbd-server-add qapi: add nbd-server-remove hmp: Add name parameter to nbd_server_add qapi: add name parameter to nbd-server-add Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qapi')
-rw-r--r--qapi/block.json50
1 files changed, 48 insertions, 2 deletions
diff --git a/qapi/block.json b/qapi/block.json
index f093fa3..c694524 100644
--- a/qapi/block.json
+++ b/qapi/block.json
@@ -213,14 +213,60 @@
#
# @device: The device name or node name of the node to be exported
#
+# @name: Export name. If unspecified, the @device parameter is used as the
+# export name. (Since 2.12)
+#
# @writable: Whether clients should be able to write to the device via the
# NBD connection (default false).
#
-# Returns: error if the device is already marked for export.
+# Returns: error if the server is not running, or export with the same name
+# already exists.
#
# Since: 1.3.0
##
-{ 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
+{ 'command': 'nbd-server-add',
+ 'data': {'device': 'str', '*name': 'str', '*writable': 'bool'} }
+
+##
+# @NbdServerRemoveMode:
+#
+# Mode for removing an NBD export.
+#
+# @safe: Remove export if there are no existing connections, fail otherwise.
+#
+# @hard: Drop all connections immediately and remove export.
+#
+# Potential additional modes to be added in the future:
+#
+# hide: Just hide export from new clients, leave existing connections as is.
+# Remove export after all clients are disconnected.
+#
+# soft: Hide export from new clients, answer with ESHUTDOWN for all further
+# requests from existing clients.
+#
+# Since: 2.12
+##
+{'enum': 'NbdServerRemoveMode', 'data': ['safe', 'hard']}
+
+##
+# @nbd-server-remove:
+#
+# Remove NBD export by name.
+#
+# @name: Export name.
+#
+# @mode: Mode of command operation. See @NbdServerRemoveMode description.
+# Default is 'safe'.
+#
+# Returns: error if
+# - the server is not running
+# - export is not found
+# - mode is 'safe' and there are existing connections
+#
+# Since: 2.12
+##
+{ 'command': 'nbd-server-remove',
+ 'data': {'name': 'str', '*mode': 'NbdServerRemoveMode'} }
##
# @nbd-server-stop: