[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 05/31] qemu-storage-daemon: Use qmp_block_export_add()
From: |
Kevin Wolf |
Subject: |
[PATCH v2 05/31] qemu-storage-daemon: Use qmp_block_export_add() |
Date: |
Thu, 24 Sep 2020 17:26:51 +0200 |
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>
---
storage-daemon/qemu-storage-daemon.c | 13 +------------
1 file changed, 1 insertion(+), 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;
}
--
2.25.4
- [PATCH v2 00/31] block/export: Add infrastructure and QAPI for block exports, Kevin Wolf, 2020/09/24
- [PATCH v2 01/31] nbd: Remove unused nbd_export_get_blockdev(), Kevin Wolf, 2020/09/24
- [PATCH v2 02/31] qapi: Create block-export module, Kevin Wolf, 2020/09/24
- [PATCH v2 03/31] qapi: Rename BlockExport to BlockExportOptions, Kevin Wolf, 2020/09/24
- [PATCH v2 08/31] nbd: Add max-connections to nbd-server-start, Kevin Wolf, 2020/09/24
- [PATCH v2 09/31] nbd: Add writethrough to block-export-add, Kevin Wolf, 2020/09/24
- [PATCH v2 04/31] block/export: Add BlockExport infrastructure and block-export-add, Kevin Wolf, 2020/09/24
- [PATCH v2 06/31] qemu-nbd: Use raw block driver for --offset, Kevin Wolf, 2020/09/24
- [PATCH v2 05/31] qemu-storage-daemon: Use qmp_block_export_add(),
Kevin Wolf <=
- [PATCH v2 07/31] block/export: Remove magic from block-export-add, Kevin Wolf, 2020/09/24
- [PATCH v2 10/31] nbd: Remove NBDExport.close callback, Kevin Wolf, 2020/09/24
- [PATCH v2 11/31] qemu-nbd: Use blk_exp_add() to create the export, Kevin Wolf, 2020/09/24
- [PATCH v2 14/31] block/export: Move AioContext from NBDExport to BlockExport, Kevin Wolf, 2020/09/24
- [PATCH v2 16/31] block/export: Allocate BlockExport in blk_exp_add(), Kevin Wolf, 2020/09/24
- [PATCH v2 12/31] nbd/server: Simplify export shutdown, Kevin Wolf, 2020/09/24
- [PATCH v2 13/31] block/export: Move refcount from NBDExport to BlockExport, Kevin Wolf, 2020/09/24
- [PATCH v2 19/31] block/export: Move strong user reference to block_exports, Kevin Wolf, 2020/09/24
- [PATCH v2 15/31] block/export: Add node-name to BlockExportOptions, Kevin Wolf, 2020/09/24
- [PATCH v2 17/31] block/export: Add blk_exp_close_all(_type), Kevin Wolf, 2020/09/24