aboutsummaryrefslogtreecommitdiff
path: root/qemu-char.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2013-03-05 23:21:24 +0530
committerAnthony Liguori <aliguori@us.ibm.com>2013-03-08 13:57:15 -0600
commite6a87ed837b52aea903c25693b1e3703824b9ef7 (patch)
treee31d81b8af751f608b7be1c187ef52d364323b4e /qemu-char.c
parent23673ca740e0eda66901ca801a5a901df378b063 (diff)
downloadqemu-e6a87ed837b52aea903c25693b1e3703824b9ef7.zip
qemu-e6a87ed837b52aea903c25693b1e3703824b9ef7.tar.gz
qemu-e6a87ed837b52aea903c25693b1e3703824b9ef7.tar.bz2
qemu-char: add pty watch
This lets ptys support adding front end watchs. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Message-id: 23380f37b22d407ba0b9e080f6ea0d66b279f2d2.1362505276.git.amit.shah@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-char.c')
-rw-r--r--qemu-char.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/qemu-char.c b/qemu-char.c
index 7091743..f1d089f 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -1008,6 +1008,12 @@ static int pty_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
return io_channel_send_all(s->fd, buf, len);
}
+static GSource *pty_chr_add_watch(CharDriverState *chr, GIOCondition cond)
+{
+ PtyCharDriver *s = chr->opaque;
+ return g_io_create_watch(s->fd, cond);
+}
+
static int pty_chr_read_poll(void *opaque)
{
CharDriverState *chr = opaque;
@@ -1161,6 +1167,7 @@ static CharDriverState *qemu_chr_open_pty(QemuOpts *opts)
chr->chr_write = pty_chr_write;
chr->chr_update_read_handler = pty_chr_update_read_handler;
chr->chr_close = pty_chr_close;
+ chr->chr_add_watch = pty_chr_add_watch;
s->fd = io_channel_from_fd(master_fd);
s->timer = qemu_new_timer_ms(rt_clock, pty_chr_timer, chr);