Skip to contentSkip to conversation

add missing pty_chr_update_read_handler() in qemu_chr_open_pty()

PATCH New Michael Tokarev 1 participant 1 message Sep 4, 2012

lore
Share & tools
lore
#0 lore raw

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.

---
 qemu-char.c |    1 +
 1 file changed, 1 insertion(+)
qemu-char.c +1 -0
index 398baf1..35a58bf 100644
@@ -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