add missing pty_chr_update_read_handler() in qemu_chr_open_pty()
PATCH 1/1 add missing pty_chr_update_read_handler() in qemu_chr_open_pty()
Currently pty code does not register i/o handler properly, so that one have to "ping" the pty in order for qemu to work, or else it is sitting in main loop doing nothing and using 100% CPU.
qemu -nographic -kernel /boot/vmlinuz-$(uname -r) -append console=ttyS0 -serial pty
shows this nicely: the process is eating 100% CPU until someone connects to the pty in question and sends a char to it.
Fix this by adding a call to pty_chr_update_read_handler() into qemu_chr_open_pty(). I'm not sure whenever this is the right thing to do, but at least it fixes the hang for me.
Signed-off-by Michael Tokarev <[email protected]>
--- qemu-char.c | 1 + 1 file changed, 1 insertion(+)
qemu-char.c +1 -0
@@ -1015,6 +1015,7 @@ static CharDriverState *qemu_chr_open_pty(QemuOpts *opts) s->fd = master_fd; s->timer =qemu_new_timer_ms (rt_clock, pty_chr_timer, chr); +pty_chr_update_read_handler (chr);return chr; }
Signature · 1 line
1.7.10.4