[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/20] qemu-char: add pty watch
From: |
Amit Shah |
Subject: |
[Qemu-devel] [PATCH 09/20] qemu-char: add pty watch |
Date: |
Tue, 5 Mar 2013 23:21:24 +0530 |
From: Anthony Liguori <address@hidden>
This lets ptys support adding front end watchs.
Signed-off-by: Anthony Liguori <address@hidden>
Signed-off-by: Amit Shah <address@hidden>
---
qemu-char.c | 7 +++++++
1 file changed, 7 insertions(+)
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);
--
1.8.1.2
- [Qemu-devel] [PATCH 00/20] chardev flow control, Amit Shah, 2013/03/05
- [Qemu-devel] [PATCH 01/20] char-socket: fix error reporting, Amit Shah, 2013/03/05
- [Qemu-devel] [PATCH 02/20] qemu-char: remove dead/confusing logic with nb_stdio_clients, Amit Shah, 2013/03/05
- [Qemu-devel] [PATCH 03/20] char: add IOWatchPoll support, Amit Shah, 2013/03/05
- [Qemu-devel] [PATCH 04/20] qemu-char: convert fd_chr to use a GIOChannel, Amit Shah, 2013/03/05
- [Qemu-devel] [PATCH 05/20] qemu-char: convert pty to GIOChannel, Amit Shah, 2013/03/05
- [Qemu-devel] [PATCH 06/20] qemu-char: convert UDP to GIOChannel, Amit Shah, 2013/03/05
- [Qemu-devel] [PATCH 07/20] qemu-char: tcp: make use GIOChannel, Amit Shah, 2013/03/05
- [Qemu-devel] [PATCH 08/20] qemu-char: add watch support, Amit Shah, 2013/03/05
- [Qemu-devel] [PATCH 09/20] qemu-char: add pty watch,
Amit Shah <=
- [Qemu-devel] [PATCH 10/20] char: add gio watch fn for tcp backends, Amit Shah, 2013/03/05
- [Qemu-devel] [PATCH 11/20] qemu-char: use a glib timeout instead of qemu-timer, Amit Shah, 2013/03/05
- [Qemu-devel] [PATCH 12/20] qemu-char: remove use of QEMUTimer in favor of glib idle function, Amit Shah, 2013/03/05
- [Qemu-devel] [PATCH 13/20] qemu-char: make char drivers dynamically registerable, Amit Shah, 2013/03/05
- [Qemu-devel] [PATCH 14/20] qemu-char: move spice registration to spice-qemu-char.c, Amit Shah, 2013/03/05
- [Qemu-devel] [PATCH 15/20] qemu-char: move baum registration to baum.c, Amit Shah, 2013/03/05