Every block export needs a block node to export, so move the 'device'
option from BlockExportOptionsNbd to BlockExportOptions.
To maintain compatibility in nbd-server-add, BlockExportOptionsNbd needs
to be wrapped by a new type NbdServerAddOptions that adds 'device' back
because nbd-server-add doesn't use the BlockExportOptions base type.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
+++ b/qapi/block-export.json
@@ -62,9 +62,8 @@
##
# @BlockExportOptionsNbd:
#
-# An NBD block export.
-#
-# @device: The device name or node name of the node to be exported
+# An NBD block export (options shared between nbd-server-add and the NBD branch
+# of block-export-add).
#
# @name: Export name. If unspecified, the @device parameter is used as the
# export name. (Since 2.12)
@@ -82,8 +81,21 @@
# Since: 5.0
##
{ 'struct': 'BlockExportOptionsNbd',
- 'data': {'device': 'str', '*name': 'str', '*description': 'str',
- '*writable': 'bool', '*bitmap': 'str' } }
+ 'data': { '*name': 'str', '*description': 'str',
+ '*writable': 'bool', '*bitmap': 'str' } }
+
+##
+# @NbdServerAddOptions:
+#
+# An NBD block export.
+#
+# @device: The device name or node name of the node to be exported
+#
+# Since: 5.0
##
# @nbd-server-add:
@@ -96,7 +108,7 @@
# Since: 1.3.0
##
{ 'command': 'nbd-server-add',
- 'data': 'BlockExportOptionsNbd', 'boxed': true }
+ 'data': 'NbdServerAddOptions', 'boxed': true }
##
# @NbdServerRemoveMode:
@@ -167,6 +179,8 @@
# Describes a block export, i.e. how single node should be exported on an
# external interface.
#
+# @device: The device name or node name of the node to be exported
+#
# @writethrough: If true, caches are flushed after every write request to the
# export before completion is signalled. (since: 5.2;
# default: false)
@@ -175,6 +189,7 @@
##
{ 'union': 'BlockExportOptions',
'base': { 'type': 'BlockExportType',
+ 'device': 'str',