qemu-e2k/nbd
Eric Blake bfe04d0a7d nbd: Use enum for various negotiation modes
Deciphering the hard-coded list of integer return values from
nbd_start_negotiate() will only get more confusing when adding support
for 64-bit extended headers.  Better is to name things in an enum.
Although the function in question is private to client.c, putting the
enum in a public header and including an enum-to-string conversion
will allow its use in more places in upcoming patches.

The enum is intentionally laid out so that operators like <= can be
used to group multiple modes with similar characteristics, and where
the least powerful mode has value 0, even though this patch does not
exploit that.  No semantic change intended.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-ID: <20230608135653.2918540-9-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
2023-07-19 15:26:13 -05:00
..
client-connection.c bulk: Remove pointless QOM casts 2023-06-05 20:48:34 +02:00
client.c nbd: Use enum for various negotiation modes 2023-07-19 15:26:13 -05:00
common.c nbd: Use enum for various negotiation modes 2023-07-19 15:26:13 -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 coroutine: Clean up superfluous inclusion of qemu/coroutine.h 2023-01-19 10:18:28 +01:00
server.c nbd: s/handle/cookie/ to match NBD spec 2023-07-19 15:25:30 -05:00
trace-events nbd: s/handle/cookie/ to match NBD spec 2023-07-19 15:25:30 -05:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00