From 1c8222b014484145d66740d0597ae86b4a989b73 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 24 Sep 2020 17:26:54 +0200 Subject: nbd: Add max-connections to nbd-server-start This is a QMP equivalent of qemu-nbd's --shared option, limiting the maximum number of clients that can attach at the same time. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Eric Blake Message-Id: <20200924152717.287415-9-kwolf@redhat.com> Acked-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- qapi/block-export.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'qapi') diff --git a/qapi/block-export.json b/qapi/block-export.json index 5890a94..8aa8a01 100644 --- a/qapi/block-export.json +++ b/qapi/block-export.json @@ -20,13 +20,16 @@ # is only resolved at time of use, so can be deleted and # recreated on the fly while the NBD server is active. # If missing, it will default to denying access (since 4.0). +# @max-connections: The maximum number of connections to allow at the same +# time, 0 for unlimited. (since 5.2; default: 0) # # Since: 4.2 ## { 'struct': 'NbdServerOptions', 'data': { 'addr': 'SocketAddress', '*tls-creds': 'str', - '*tls-authz': 'str'} } + '*tls-authz': 'str', + '*max-connections': 'uint32' } } ## # @nbd-server-start: @@ -46,6 +49,8 @@ # is only resolved at time of use, so can be deleted and # recreated on the fly while the NBD server is active. # If missing, it will default to denying access (since 4.0). +# @max-connections: The maximum number of connections to allow at the same +# time, 0 for unlimited. (since 5.2; default: 0) # # Returns: error if the server is already running. # @@ -54,7 +59,8 @@ { 'command': 'nbd-server-start', 'data': { 'addr': 'SocketAddressLegacy', '*tls-creds': 'str', - '*tls-authz': 'str'} } + '*tls-authz': 'str', + '*max-connections': 'uint32' } } ## # @BlockExportOptionsNbd: -- cgit v1.1