aboutsummaryrefslogtreecommitdiff
path: root/storage-daemon/qemu-storage-daemon.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-10-02 16:19:42 +0100
committerPeter Maydell <peter.maydell@linaro.org>2020-10-02 16:19:42 +0100
commit469e72ab7dbbd7ff4ee601e5ea7c29545d46593b (patch)
tree0f49f57d83db9ae500cd79f8eb0455355ace4fe4 /storage-daemon/qemu-storage-daemon.c
parentdd8c1e808f1ca311e1f50bff218c3ee3198b1f02 (diff)
parentc508c73dca636cc0fc7413d1e4a43fcfe4a5698c (diff)
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Block layer patches: - Add block export infrastructure - iotests improvements - Document the throttle block filter - Misc code cleanups # gpg: Signature made Fri 02 Oct 2020 15:36:53 BST # gpg: using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6 # gpg: issuer "kwolf@redhat.com" # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full] # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6 * remotes/kevin/tags/for-upstream: (37 commits) qcow2: Use L1E_SIZE in qcow2_write_l1_entry() qemu-storage-daemon: Fix help line for --export iotests: Test block-export-* QMP interface iotests: Allow supported and unsupported formats at the same time iotests: Introduce qemu_nbd_list_log() iotests: Factor out qemu_tool_pipe_and_status() nbd: Deprecate nbd-server-add/remove nbd: Merge nbd_export_new() and nbd_export_create() block/export: Move writable to BlockExportOptions block/export: Add query-block-exports block/export: Create BlockBackend in blk_exp_add() block/export: Move blk to BlockExport block/export: Add BLOCK_EXPORT_DELETED event block/export: Add block-export-del block/export: Move strong user reference to block_exports block/export: Add 'id' option to block-export-add block/export: Add blk_exp_close_all(_type) block/export: Allocate BlockExport in blk_exp_add() block/export: Add node-name to BlockExportOptions block/export: Move AioContext from NBDExport to BlockExport ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'storage-daemon/qemu-storage-daemon.c')
-rw-r--r--storage-daemon/qemu-storage-daemon.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/storage-daemon/qemu-storage-daemon.c b/storage-daemon/qemu-storage-daemon.c
index 7e9b0e0d3f..1ae1cda481 100644
--- a/storage-daemon/qemu-storage-daemon.c
+++ b/storage-daemon/qemu-storage-daemon.c
@@ -35,8 +35,8 @@
#include "monitor/monitor-internal.h"
#include "qapi/error.h"
-#include "qapi/qapi-visit-block.h"
#include "qapi/qapi-visit-block-core.h"
+#include "qapi/qapi-visit-block-export.h"
#include "qapi/qapi-visit-control.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
@@ -92,7 +92,7 @@ static void help(void)
" --chardev <options> configure a character device backend\n"
" (see the qemu(1) man page for possible options)\n"
"\n"
-" --export [type=]nbd,device=<node-name>[,name=<export-name>]\n"
+" --export [type=]nbd,id=<id>,node-name=<node-name>[,name=<export-name>]\n"
" [,writable=on|off][,bitmap=<name>]\n"
" export the specified block node over NBD\n"
" (requires --nbd-server)\n"
@@ -101,9 +101,9 @@ static void help(void)
" configure a QMP monitor\n"
"\n"
" --nbd-server addr.type=inet,addr.host=<host>,addr.port=<port>\n"
-" [,tls-creds=<id>][,tls-authz=<id>]\n"
+" [,tls-creds=<id>][,tls-authz=<id>][,max-connections=<n>]\n"
" --nbd-server addr.type=unix,addr.path=<path>\n"
-" [,tls-creds=<id>][,tls-authz=<id>]\n"
+" [,tls-creds=<id>][,tls-authz=<id>][,max-connections=<n>]\n"
" start an NBD server for exporting block nodes\n"
"\n"
" --object help list object types that can be added\n"
@@ -150,17 +150,6 @@ static void init_qmp_commands(void)
qmp_marshal_qmp_capabilities, QCO_ALLOW_PRECONFIG);
}
-static void init_export(BlockExport *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;
@@ -235,14 +224,14 @@ static void process_options(int argc, char *argv[])
case OPTION_EXPORT:
{
Visitor *v;
- BlockExport *export;
+ BlockExportOptions *export;
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);
- init_export(export, &error_fatal);
- qapi_free_BlockExport(export);
+ qmp_block_export_add(export, &error_fatal);
+ qapi_free_BlockExportOptions(export);
break;
}
case OPTION_MONITOR: