From eed8b691783264013142ed0273e08f5a7f913569 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Mon, 24 Feb 2020 15:29:57 +0100 Subject: qemu-storage-daemon: Add --nbd-server option Add a --nbd-server option to qemu-storage-daemon to start the built-in NBD server right away. It maps the arguments for nbd-server-start to the command line, with the exception that it uses SocketAddress instead of SocketAddressLegacy: New interfaces shouldn't use legacy types, and the additional nesting would be nasty on the command line. Example (only with required options): --nbd-server addr.type=inet,addr.host=localhost,addr.port=10809 Signed-off-by: Kevin Wolf Message-Id: <20200224143008.13362-10-kwolf@redhat.com> Acked-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- blockdev-nbd.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'blockdev-nbd.c') diff --git a/blockdev-nbd.c b/blockdev-nbd.c index de2f2ff713..d8c892f7da 100644 --- a/blockdev-nbd.c +++ b/blockdev-nbd.c @@ -132,6 +132,11 @@ void nbd_server_start(SocketAddress *addr, const char *tls_creds, nbd_server = NULL; } +void nbd_server_start_options(NbdServerOptions *arg, Error **errp) +{ + nbd_server_start(arg->addr, arg->tls_creds, arg->tls_authz, errp); +} + void qmp_nbd_server_start(SocketAddressLegacy *addr, bool has_tls_creds, const char *tls_creds, bool has_tls_authz, const char *tls_authz, -- cgit v1.2.3