qemu-char: simplify pty polling
commit85a67692d04e15a6b7d5a0e2b9d573d8bffbe108
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 19 Apr 2013 15:32:07 +0000 (19 17:32 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 22 Apr 2013 13:52:20 +0000 (22 08:52 -0500)
tree360f1f11fd3c5a4f589bd273aa51e7b0d1c81587
parent910b63682ea72f34307b8797c4cc81a1f2a0c47f
qemu-char: simplify pty polling

There is no need to use a timer and pty_chr_read to detect a connected
pty.  It is simpler to just call g_poll periodically and check for POLLHUP.
It is done once per second, and only if the pty is disconnected, so it
is cheap enough.

Tested with "-monitor pty" and "-serial mon:pty", both of which work
correctly and do not freeze QEMU.  (How to test ptys?  "socat -,raw,echo=0
/dev/pts/4,raw").

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366385529-10329-3-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char.c