From patchwork Wed Jan 30 11:44:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Char flow control patches Date: Wed, 30 Jan 2013 01:44:09 -0000 From: Amit Shah X-Patchwork-Id: 216852 Message-Id: <20130130114409.GA2990@amit.redhat.com> To: Anthony Liguori Cc: qemu list Hi Anthony, I did some basic testing of the char flow control patches from your char-flow.2 branch. With the following patch applied, things seem to be working fine. I tested the isa-serial and virtio-serial devices. I haven't yet tested with virtio-serial flow control, but at least no regressions as of now. In addition to this, we should also have the following, but the above masks these: @@ -1067,7 +1067,7 @@ static gboolean pty_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque) if (len > s->read_bytes) len = s->read_bytes; if (len == 0) - return TRUE; + return FALSE; status = g_io_channel_read_chars(s->fd, (gchar *)buf, len, &size, NULL); if (status != G_IO_STATUS_NORMAL) { pty_chr_state(chr, 0); @@ -2237,7 +2237,7 @@ static gboolean udp_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque) GIOStatus status; if (s->max_size == 0) - return TRUE; + return FALSE; status = g_io_channel_read_chars(s->chan, (gchar *)s->buf, sizeof(s->buf), &bytes_read, NULL); s->bufcnt = bytes_read; @@ -2492,7 +2492,7 @@ static gboolean tcp_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque) int len, size; if (!s->connected || s->max_size <= 0) { - return TRUE; + return FALSE; } len = sizeof(buf); if (len > s->max_size) Amit diff --git a/qemu-char.c b/qemu-char.c index 2b714cf..5731d02 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -569,7 +569,7 @@ static gboolean io_watch_poll_prepare(GSource *source, gint *timeout_) iwp->max_size = iwp->fd_can_read(iwp->opaque); if (iwp->max_size == 0) { - return TRUE; + return FALSE; } return g_io_watch_funcs.prepare(source, timeout_);