qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 09/19] qemu-char: add pty watch


From: Anthony Liguori
Subject: [Qemu-devel] [PATCH 09/19] qemu-char: add pty watch
Date: Mon, 18 Feb 2013 15:48:06 -0600

This lets ptys support adding front end watchs.

Signed-off-by: Anthony Liguori <address@hidden>
---
 qemu-char.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/qemu-char.c b/qemu-char.c
index 572c5ea..e59e580 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);
-- 
1.8.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]