qapi: Rename BlockExport to BlockExportOptions

The name BlockExport will be used for the struct containing the runtime
state of block exports, so change the name of export creation options.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200924152717.287415-4-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:26:49 +02:00
parent 5daa6bfd8e
commit 143ea7670c
4 changed files with 14 additions and 14 deletions

View File

@ -398,7 +398,7 @@ void hmp_nbd_server_start(Monitor *mon, const QDict *qdict)
Error *local_err = NULL; Error *local_err = NULL;
BlockInfoList *block_list, *info; BlockInfoList *block_list, *info;
SocketAddress *addr; SocketAddress *addr;
BlockExportNbd export; BlockExportOptionsNbd export;
if (writable && !all) { if (writable && !all) {
error_setg(&local_err, "-w only valid together with -a"); error_setg(&local_err, "-w only valid together with -a");
@ -431,7 +431,7 @@ void hmp_nbd_server_start(Monitor *mon, const QDict *qdict)
continue; continue;
} }
export = (BlockExportNbd) { export = (BlockExportOptionsNbd) {
.device = info->value->device, .device = info->value->device,
.has_writable = true, .has_writable = true,
.writable = writable, .writable = writable,
@ -458,7 +458,7 @@ void hmp_nbd_server_add(Monitor *mon, const QDict *qdict)
bool writable = qdict_get_try_bool(qdict, "writable", false); bool writable = qdict_get_try_bool(qdict, "writable", false);
Error *local_err = NULL; Error *local_err = NULL;
BlockExportNbd export = { BlockExportOptionsNbd export = {
.device = (char *) device, .device = (char *) device,
.has_name = !!name, .has_name = !!name,
.name = (char *) name, .name = (char *) name,

View File

@ -148,7 +148,7 @@ void qmp_nbd_server_start(SocketAddressLegacy *addr,
qapi_free_SocketAddress(addr_flat); qapi_free_SocketAddress(addr_flat);
} }
void qmp_nbd_server_add(BlockExportNbd *arg, Error **errp) void qmp_nbd_server_add(BlockExportOptionsNbd *arg, Error **errp)
{ {
BlockDriverState *bs = NULL; BlockDriverState *bs = NULL;
BlockBackend *on_eject_blk; BlockBackend *on_eject_blk;

View File

@ -57,7 +57,7 @@
'*tls-authz': 'str'} } '*tls-authz': 'str'} }
## ##
# @BlockExportNbd: # @BlockExportOptionsNbd:
# #
# An NBD block export. # An NBD block export.
# #
@ -78,7 +78,7 @@
# #
# Since: 5.0 # Since: 5.0
## ##
{ 'struct': 'BlockExportNbd', { 'struct': 'BlockExportOptionsNbd',
'data': {'device': 'str', '*name': 'str', '*description': 'str', 'data': {'device': 'str', '*name': 'str', '*description': 'str',
'*writable': 'bool', '*bitmap': 'str' } } '*writable': 'bool', '*bitmap': 'str' } }
@ -93,7 +93,7 @@
# Since: 1.3.0 # Since: 1.3.0
## ##
{ 'command': 'nbd-server-add', { 'command': 'nbd-server-add',
'data': 'BlockExportNbd', 'boxed': true } 'data': 'BlockExportOptionsNbd', 'boxed': true }
## ##
# @NbdServerRemoveMode: # @NbdServerRemoveMode:
@ -159,16 +159,16 @@
'data': [ 'nbd' ] } 'data': [ 'nbd' ] }
## ##
# @BlockExport: # @BlockExportOptions:
# #
# Describes a block export, i.e. how single node should be exported on an # Describes a block export, i.e. how single node should be exported on an
# external interface. # external interface.
# #
# Since: 4.2 # Since: 4.2
## ##
{ 'union': 'BlockExport', { 'union': 'BlockExportOptions',
'base': { 'type': 'BlockExportType' }, 'base': { 'type': 'BlockExportType' },
'discriminator': 'type', 'discriminator': 'type',
'data': { 'data': {
'nbd': 'BlockExportNbd' 'nbd': 'BlockExportOptionsNbd'
} } } }

View File

@ -150,7 +150,7 @@ static void init_qmp_commands(void)
qmp_marshal_qmp_capabilities, QCO_ALLOW_PRECONFIG); qmp_marshal_qmp_capabilities, QCO_ALLOW_PRECONFIG);
} }
static void init_export(BlockExport *export, Error **errp) static void init_export(BlockExportOptions *export, Error **errp)
{ {
switch (export->type) { switch (export->type) {
case BLOCK_EXPORT_TYPE_NBD: case BLOCK_EXPORT_TYPE_NBD:
@ -235,14 +235,14 @@ static void process_options(int argc, char *argv[])
case OPTION_EXPORT: case OPTION_EXPORT:
{ {
Visitor *v; Visitor *v;
BlockExport *export; BlockExportOptions *export;
v = qobject_input_visitor_new_str(optarg, "type", &error_fatal); v = qobject_input_visitor_new_str(optarg, "type", &error_fatal);
visit_type_BlockExport(v, NULL, &export, &error_fatal); visit_type_BlockExportOptions(v, NULL, &export, &error_fatal);
visit_free(v); visit_free(v);
init_export(export, &error_fatal); init_export(export, &error_fatal);
qapi_free_BlockExport(export); qapi_free_BlockExportOptions(export);
break; break;
} }
case OPTION_MONITOR: case OPTION_MONITOR: