diff options
author | Kevin Wolf <kwolf@redhat.com> | 2020-09-24 17:26:51 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2020-10-02 15:46:40 +0200 |
commit | 060102ad655544501b9d0d9f3fc8b8675883b463 (patch) | |
tree | c98d63c84664fb1ca4b2dd84c2f7161e7fd4232b /storage-daemon | |
parent | 56ee86261e0ffa151e82b383d9628cf5660be355 (diff) |
qemu-storage-daemon: Use qmp_block_export_add()
No reason to duplicate the functionality locally, we can now just reuse
the QMP command block-export-add for --export.
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-6-kwolf@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'storage-daemon')
-rw-r--r-- | storage-daemon/qemu-storage-daemon.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/storage-daemon/qemu-storage-daemon.c b/storage-daemon/qemu-storage-daemon.c index ed26097254..b6f678d3ab 100644 --- a/storage-daemon/qemu-storage-daemon.c +++ b/storage-daemon/qemu-storage-daemon.c @@ -150,17 +150,6 @@ static void init_qmp_commands(void) qmp_marshal_qmp_capabilities, QCO_ALLOW_PRECONFIG); } -static void init_export(BlockExportOptions *export, Error **errp) -{ - switch (export->type) { - case BLOCK_EXPORT_TYPE_NBD: - qmp_nbd_server_add(&export->u.nbd, errp); - break; - default: - g_assert_not_reached(); - } -} - static void process_options(int argc, char *argv[]) { int c; @@ -241,7 +230,7 @@ static void process_options(int argc, char *argv[]) visit_type_BlockExportOptions(v, NULL, &export, &error_fatal); visit_free(v); - init_export(export, &error_fatal); + qmp_block_export_add(export, &error_fatal); qapi_free_BlockExportOptions(export); break; } |