From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Subject: Re: [PATCH 2/2] nbd/server: Allow users to adjust handshake limit in QMP
Date: Wed, 05 Feb 2025 07:55:56 +0100 [thread overview]
Message-ID: <87h6587udf.fsf@pond.sub.org> (raw)
In-Reply-To: <20250203222722.650694-6-eblake@redhat.com> (Eric Blake's message of "Mon, 3 Feb 2025 16:26:07 -0600")
Eric Blake <eblake@redhat.com> writes:
> Although defaulting the handshake limit to 10 seconds was a nice QoI
> change to weed out intentionally slow clients, it can interfere with
> integration testing done with manual NBD_OPT commands over 'nbdsh
> --opt-mode'. Expose a QMP knob 'handshake-max-secs' to allow the user
> to alter the timeout away from the default.
>
> The parameter name here intentionally matches the spelling of the
> constant added in commit fb1c2aaa98, and not the command-line spelling
> added in the previous patch for qemu-nbd; that's because in QMP,
> longer names serve as good self-documentation, and unlike the command
> line, machines don't have problems generating longer spellings.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> qapi/block-export.json | 10 ++++++++++
> include/block/nbd.h | 6 +++---
> block/monitor/block-hmp-cmds.c | 4 ++--
> blockdev-nbd.c | 26 ++++++++++++++++++--------
> 4 files changed, 33 insertions(+), 13 deletions(-)
>
> diff --git a/qapi/block-export.json b/qapi/block-export.json
> index ce33fe378df..58ae6a5e1d7 100644
> --- a/qapi/block-export.json
> +++ b/qapi/block-export.json
> @@ -17,6 +17,10 @@
> #
> # @addr: Address on which to listen.
> #
> +# @handshake-max-secs: Time limit, in seconds, at which a client that
> +# has not completed the negotiation handshake will be disconnected,
> +# or 0 for no limit (since 10.0; default: 10).
> +#
> # @tls-creds: ID of the TLS credentials object (since 2.6).
> #
> # @tls-authz: ID of the QAuthZ authorization object used to validate
> @@ -34,6 +38,7 @@
> ##
> { 'struct': 'NbdServerOptions',
> 'data': { 'addr': 'SocketAddress',
> + '*handshake-max-secs': 'uint32',
> '*tls-creds': 'str',
> '*tls-authz': 'str',
> '*max-connections': 'uint32' } }
Standard question on time: are we confident the granularity will
suffice?
On naming... We use "seconds" (StatsUnit in qapi/stats.json), and "sec"
(SnapshotInfo in qapi/block-core.json), but not "secs". Do we care?
> @@ -52,6 +57,10 @@
> #
> # @addr: Address on which to listen.
> #
> +# @handshake-max-secs: Time limit, in seconds, at which a client that
> +# has not completed the negotiation handshake will be disconnected,
> +# or 0 for no limit (since 10.0; default: 10).
> +#
> # @tls-creds: ID of the TLS credentials object (since 2.6).
> #
> # @tls-authz: ID of the QAuthZ authorization object used to validate
> @@ -72,6 +81,7 @@
> ##
> { 'command': 'nbd-server-start',
> 'data': { 'addr': 'SocketAddressLegacy',
> + '*handshake-max-secs': 'uint32',
> '*tls-creds': 'str',
> '*tls-authz': 'str',
> '*max-connections': 'uint32' },
[...]
next prev parent reply other threads:[~2025-02-05 6:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-03 22:26 [PATCH 0/2] nbd: Allow debugging tuning of handshake limit Eric Blake
2025-02-03 22:26 ` [PATCH 1/2] qemu-nbd: Allow users to adjust " Eric Blake
2025-02-06 7:02 ` Vladimir Sementsov-Ogievskiy
2025-02-03 22:26 ` [PATCH 2/2] nbd/server: Allow users to adjust handshake limit in QMP Eric Blake
2025-02-05 6:55 ` Markus Armbruster [this message]
2025-02-05 20:36 ` Eric Blake
2025-02-06 5:54 ` Markus Armbruster
2025-02-06 7:20 ` Vladimir Sementsov-Ogievskiy
2025-02-10 21:46 ` Eric Blake
2025-02-12 14:33 ` Vladimir Sementsov-Ogievskiy
-- strict thread matches above, loose matches on Subject: below --
2024-08-09 16:14 [PATCH for-9.2 0/2] NBD: tune handshake timeout Eric Blake
2024-08-09 16:14 ` [PATCH 2/2] nbd/server: Allow users to adjust handshake limit in QMP Eric Blake
2024-10-02 13:18 ` Vladimir Sementsov-Ogievskiy
2024-10-02 13:49 ` Markus Armbruster
2024-10-02 13:58 ` Vladimir Sementsov-Ogievskiy
2024-10-02 15:14 ` Markus Armbruster
2024-10-02 15:20 ` Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h6587udf.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@yandex-team.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).