qemu-e2k/nbd
Eric Blake 8db7e2d657 nbd/server: Refactor handling of command sanity checks
Upcoming additions to support NBD 64-bit effect lengths will add a new
command flag NBD_CMD_FLAG_PAYLOAD_LEN that needs to be considered in
our sanity checks of the client's messages (that is, more than just
CMD_WRITE have the potential to carry a client payload when extended
headers are in effect).  But before we can start to support that, it
is easier to first refactor the existing set of various if statements
over open-coded combinations of request->type to instead be a single
switch statement over all command types that sets witnesses, then
straight-line processing based on the witnesses.  No semantic change
is intended.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-ID: <20230829175826.377251-24-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
2023-09-25 08:43:22 -05:00
..
client-connection.c nbd: Replace bool structured_reply with mode enum 2023-09-22 17:19:27 -05:00
client.c nbd: Prepare for 64-bit request effect lengths 2023-09-25 08:35:06 -05:00
common.c nbd: Add types for extended headers 2023-09-22 17:21:08 -05:00
meson.build nbd: move connection code from block/nbd to nbd/client-connection 2021-06-18 10:59:53 -05:00
nbd-internal.h nbd: Add types for extended headers 2023-09-22 17:21:08 -05:00
server.c nbd/server: Refactor handling of command sanity checks 2023-09-25 08:43:22 -05:00
trace-events nbd: Prepare for 64-bit request effect lengths 2023-09-25 08:35:06 -05:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00