qemu-e2k/io
Kevin Wolf 7c1f51bf38 nbd/server: Fix drained_poll to wake coroutine in right AioContext
nbd_drained_poll() generally runs in the main thread, not whatever
iothread the NBD server coroutine is meant to run in, so it can't
directly reenter the coroutines to wake them up.

The code seems to have the right intention, it specifies the correct
AioContext when it calls qemu_aio_coroutine_enter(). However, this
functions doesn't schedule the coroutine to run in that AioContext, but
it assumes it is already called in the home thread of the AioContext.

To fix this, add a new thread-safe qio_channel_wake_read() that can be
called in the main thread to wake up the coroutine in its AioContext,
and use this in nbd_drained_poll().

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230517152834.277483-3-kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2023-05-19 19:16:53 +02:00
..
channel-buffer.c io: Add support for MSG_PEEK for socket channel 2023-02-06 19:22:56 +01:00
channel-command.c io: Add support for MSG_PEEK for socket channel 2023-02-06 19:22:56 +01:00
channel-file.c io: Add support for MSG_PEEK for socket channel 2023-02-06 19:22:56 +01:00
channel-null.c io: Add support for MSG_PEEK for socket channel 2023-02-06 19:22:56 +01:00
channel-socket.c win32: replace closesocket() with close() wrapper 2023-03-13 15:39:31 +04:00
channel-tls.c io: tls: Inherit QIO_CHANNEL_FEATURE_SHUTDOWN on server side 2023-04-12 21:19:05 +02:00
channel-util.c io: Fix Lesser GPL version number 2020-10-29 09:57:37 +00:00
channel-watch.c win32: avoid mixing SOCKET and file descriptor space 2023-03-13 15:39:31 +04:00
channel-websock.c io: Add support for MSG_PEEK for socket channel 2023-02-06 19:22:56 +01:00
channel.c nbd/server: Fix drained_poll to wake coroutine in right AioContext 2023-05-19 19:16:53 +02:00
dns-resolver.c build-sys: add HAVE_IPPROTO_MPTCP 2021-09-30 15:30:25 +02:00
meson.build io: add a QIOChannelNull equivalent to /dev/null 2022-06-22 18:11:21 +01:00
net-listener.c io/net-listener: Call the notifier during finalize 2021-06-08 19:36:17 +01:00
task.c io: Fix Lesser GPL version number 2020-10-29 09:57:37 +00:00
trace-events io: add a QIOChannelNull equivalent to /dev/null 2022-06-22 18:11:21 +01:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00