aboutsummaryrefslogtreecommitdiff
path: root/block/monitor
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2020-09-24 17:27:01 +0200
committerKevin Wolf <kwolf@redhat.com>2020-10-02 15:46:40 +0200
commitb6076afcabc7a3947d0b212b956f4575e6795c56 (patch)
tree08a52b07e0496abdcaff8e3ee7a1db1cd7e41aba /block/monitor
parent8612c6867341e52416e63fce8b19ede8501c159a (diff)
block/export: Add node-name to BlockExportOptions
Every block export needs a block node to export, so add a 'node-name' option to BlockExportOptions and remove the replaced option 'device' from BlockExportOptionsNbd. 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 at all (so even without changing it to a 'node-name' option in block-export-add, this compatibility code would be necessary). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-Id: <20200924152717.287415-16-kwolf@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/monitor')
-rw-r--r--block/monitor/block-hmp-cmds.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/monitor/block-hmp-cmds.c b/block/monitor/block-hmp-cmds.c
index 662b7f7d00..db357cafcb 100644
--- a/block/monitor/block-hmp-cmds.c
+++ b/block/monitor/block-hmp-cmds.c
@@ -398,7 +398,7 @@ void hmp_nbd_server_start(Monitor *mon, const QDict *qdict)
Error *local_err = NULL;
BlockInfoList *block_list, *info;
SocketAddress *addr;
- BlockExportOptionsNbd export;
+ NbdServerAddOptions export;
if (writable && !all) {
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;
}
- export = (BlockExportOptionsNbd) {
+ export = (NbdServerAddOptions) {
.device = info->value->device,
.has_writable = true,
.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);
Error *local_err = NULL;
- BlockExportOptionsNbd export = {
+ NbdServerAddOptions export = {
.device = (char *) device,
.has_name = !!name,
.name = (char *) name,