[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/19] char: add gio watch fn for tcp backends
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 10/19] char: add gio watch fn for tcp backends |
Date: |
Mon, 18 Feb 2013 15:48:07 -0600 |
From: Amit Shah <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 e59e580..160bcea 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -2462,6 +2462,12 @@ static ssize_t tcp_chr_recv(CharDriverState *chr, char
*buf, size_t len)
}
#endif
+static GSource *tcp_chr_add_watch(CharDriverState *chr, GIOCondition cond)
+{
+ TCPCharDriver *s = chr->opaque;
+ return g_io_create_watch(s->chan, cond);
+}
+
static gboolean tcp_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque)
{
CharDriverState *chr = opaque;
@@ -2676,6 +2682,7 @@ static CharDriverState *qemu_chr_open_socket_fd(int fd,
bool do_nodelay,
chr->chr_close = tcp_chr_close;
chr->get_msgfd = tcp_get_msgfd;
chr->chr_add_client = tcp_chr_add_client;
+ chr->chr_add_watch = tcp_chr_add_watch;
if (is_listen) {
s->listen_fd = fd;
--
1.8.0
- [Qemu-devel] [PATCH 00/19] chardev flow control, Anthony Liguori, 2013/02/19
- [Qemu-devel] [PATCH 11/19] qemu-char: use a glib timeout instead of qemu-timer, Anthony Liguori, 2013/02/18
- [Qemu-devel] [PATCH 12/19] qemu-char: remove use of QEMUTimer in favor of glib idle function, Anthony Liguori, 2013/02/18
- [Qemu-devel] [PATCH 13/19] qemu-char: make char drivers dynamically registerable, Anthony Liguori, 2013/02/18
- [Qemu-devel] [PATCH 14/19] qemu-char: move spice registration to spice-qemu-char.c, Anthony Liguori, 2013/02/18
- [Qemu-devel] [PATCH 19/19] virtio: console: add flow control, Anthony Liguori, 2013/02/18
- [Qemu-devel] [PATCH 18/19] serial: add flow control to transmit, Anthony Liguori, 2013/02/18
- [Qemu-devel] [PATCH 15/19] qemu-char: move baum registration to baum.c, Anthony Liguori, 2013/02/18