Exploit the new can_read timeout infrastructure in order to avoid hangs when no further activity happens on the main thread.
Signed-off-by: Heinz Graalfs <graa...@linux.vnet.ibm.com> --- hw/char/sclpconsole-lm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c index 80dd0a9..3575ef2 100644 --- a/hw/char/sclpconsole-lm.c +++ b/hw/char/sclpconsole-lm.c @@ -60,11 +60,11 @@ static int chr_can_read(void *opaque) SCLPConsoleLM *scon = opaque; if (scon->event.event_pending) { - return 0; + return -EAGAIN; } else if (SIZE_CONSOLE_BUFFER - scon->length) { return 1; } - return 0; + return -EAGAIN; } static void chr_read(void *opaque, const uint8_t *buf, int size) -- 1.8.3.1