qemu/nbd
Sergio Lopez b4961249af nbd/server: attach client channel to the export's AioContext
On creation, the export's AioContext is set to the same one as the
BlockBackend, while the AioContext in the client QIOChannel is left
untouched.

As a result, when using data-plane, nbd_client_receive_next_request()
schedules coroutines in the IOThread AioContext, while the client's
QIOChannel is serviced from the main_loop, potentially triggering the
assertion at qio_channel_restart_[read|write].

To fix this, as soon we have the export corresponding to the client,
we call qio_channel_attach_aio_context() to attach the QIOChannel
context to the export's AioContext. This matches with the logic at
blk_aio_attached().

RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1748253
Signed-off-by: Sergio Lopez <slp@redhat.com>
Message-Id: <20190912110032.26395-1-slp@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2019-09-24 07:30:19 -05:00
..
client.c nbd/client: Add hint when TLS is missing 2019-09-24 07:30:19 -05:00
common.c nbd: Prepare for NBD_CMD_FLAG_FAST_ZERO 2019-09-05 16:03:13 -05:00
Makefile.objs nbd: Split nbd.c 2016-01-15 18:58:02 +01:00
nbd-internal.h Include qemu/main-loop.h less 2019-08-16 13:31:52 +02:00
server.c nbd/server: attach client channel to the export's AioContext 2019-09-24 07:30:19 -05:00
trace-events trace: Remove trailing newline in events 2019-09-18 10:19:47 +01:00