nbd/server: Allow users to adjust handshake limit in QMP
authorEric Blake <eblake@redhat.com>
Mon, 3 Feb 2025 22:26:07 +0000 (16:26 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 11 Feb 2025 19:45:47 +0000 (13:45 -0600)
commitff12e6a5ff904e68e222b0ba567938943e0f4b68
tree21a5020995363442d264b4d3b3bade8594e2d929
parent617017f8dce8d8f0cd4d175cbfaac0b4077b4a1e
nbd/server: Allow users to adjust handshake limit in QMP

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>
Message-ID: <20250203222722.650694-6-eblake@redhat.com>
[eblake: s/max-secs/max-seconds/ in QMP]
Acked-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
block/monitor/block-hmp-cmds.c
blockdev-nbd.c
include/block/nbd.h
qapi/block-export.json