Make char muxer more robust wrt small FIFOs
authorAlexander Graf <agraf@suse.de>
Thu, 1 Apr 2010 15:36:23 +0000 (17:36 +0200)
committerJunfeng Dong <junfeng.dong@intel.com>
Tue, 19 Nov 2013 10:57:38 +0000 (18:57 +0800)
commitedc8516c6aa50c9826c479c3364870549062a943
tree634525ea9082d9cc465881da3bdf480adcd1fe57
parentde5bebb7702c3ba855962407256fac19446a71bc
Make char muxer more robust wrt small FIFOs

Virtio-Console can only process one character at a time. Using it on S390
gave me strage "lags" where I got the character I pressed before when
pressing one. So I typed in "abc" and only received "a", then pressed "d"
but the guest received "b" and so on.

While the stdio driver calls a poll function that just processes on its
queue in case virtio-console can't take multiple characters at once, the
muxer does not have such callbacks, so it can't empty its queue.

To work around that limitation, I introduced a new timer that only gets
active when the guest can not receive any more characters. In that case
it polls again after a while to check if the guest is now receiving input.

This patch fixes input when using -nographic on s390 for me.
qemu-char.c