qemu/nbd
Stefan Hajnoczi 7075d23511 nbd/server: introduce NBDClient->lock to protect fields
NBDClient has a number of fields that are accessed by both the export
AioContext and the main loop thread. When the AioContext lock is removed
these fields will need another form of protection.

Add NBDClient->lock and protect fields that are accessed by both
threads. Also add assertions where possible and otherwise add doc
comments stating assumptions about which thread and lock holding.

Note this patch moves the client->recv_coroutine assertion from
nbd_co_receive_request() to nbd_trip() where client->lock is held.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20231221192452.1785567-7-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2023-12-21 21:59:10 +01:00
..
client-connection.c nbd/client: Request extended headers during negotiation 2023-10-05 11:02:08 -05:00
client.c nbd/client: Request extended headers during negotiation 2023-10-05 11:02:08 -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/server: Prepare to receive extended header requests 2023-10-05 11:02:08 -05:00
server.c nbd/server: introduce NBDClient->lock to protect fields 2023-12-21 21:59:10 +01:00
trace-events nbd/server: Add FLAG_PAYLOAD support to CMD_BLOCK_STATUS 2023-10-05 11:02:08 -05:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00