block/export: Move writable to BlockExportOptions

The 'writable' option is a basic option that will probably be applicable
to most if not all export types that we will implement. Move it from NBD
to the generic BlockExport layer.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200924152717.287415-26-kwolf@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Kevin Wolf 2020-09-24 17:27:11 +02:00
parent 8cade320c8
commit 30dbc81d31
5 changed files with 32 additions and 26 deletions

View file

@ -74,9 +74,6 @@
# @description: Free-form description of the export, up to 4096 bytes.
# (Since 5.0)
#
# @writable: Whether clients should be able to write to the device via the
# NBD connection (default false).
#
# @bitmap: Also export the dirty bitmap reachable from @device, so the
# NBD client can use NBD_OPT_SET_META_CONTEXT with
# "qemu:dirty-bitmap:NAME" to inspect the bitmap. (since 4.0)
@ -85,7 +82,7 @@
##
{ 'struct': 'BlockExportOptionsNbd',
'data': { '*name': 'str', '*description': 'str',
'*writable': 'bool', '*bitmap': 'str' } }
'*bitmap': 'str' } }
##
# @NbdServerAddOptions:
@ -94,11 +91,15 @@
#
# @device: The device name or node name of the node to be exported
#
# @writable: Whether clients should be able to write to the device via the
# NBD connection (default false).
#
# Since: 5.0
##
{ 'struct': 'NbdServerAddOptions',
'base': 'BlockExportOptionsNbd',
'data': { 'device': 'str' } }
'data': { 'device': 'str',
'*writable': 'bool' } }
##
# @nbd-server-add:
@ -188,6 +189,9 @@
#
# @node-name: The node name of the block node to be exported (since: 5.2)
#
# @writable: True if clients should be able to write to the export
# (default false)
#
# @writethrough: If true, caches are flushed after every write request to the
# export before completion is signalled. (since: 5.2;
# default: false)
@ -198,6 +202,7 @@
'base': { 'type': 'BlockExportType',
'id': 'str',
'node-name': 'str',
'*writable': 'bool',
'*writethrough': 'bool' },
'discriminator': 'type',
'data': {