Skip to content
Snippets Groups Projects
Commit 9ffb8270 authored by Eric Blake's avatar Eric Blake
Browse files

io: Yield rather than wait when already in coroutine


The new qio_channel_{read,write}{,v}_all functions are documented
as yielding until data is available.  When used on a blocking
channel, this yield is done via qio_channel_wait() which spawns
a nested event loop under the hood (so it is that secondary loop
which yields as needed); but if we are already in a coroutine (at
which point QIO_CHANNEL_ERR_BLOCK is only possible if we are a
non-blocking channel), we want to yield the current coroutine
instead of spawning a nested event loop.

Signed-off-by: default avatarEric Blake <eblake@redhat.com>
Message-Id: <20170905191114.5959-2-eblake@redhat.com>
Acked-by: default avatarDaniel P. Berrange <berrange@redhat.com>
[commit message updated]
Signed-off-by: default avatarEric Blake <eblake@redhat.com>
parent 3f5c4076
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment