qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: qemu-devel <qemu-devel@nongnu.org>
Cc: Anthony Liguori <aliguori@us.ibm.com>, Alexander Graf <agraf@suse.de>
Subject: [Qemu-devel] [PATCH][RESEND] char: Flush read buffer in mux_chr_can_read
Date: Tue, 19 Oct 2010 17:04:01 +0200	[thread overview]
Message-ID: <4CBDB361.1060606@siemens.com> (raw)

Move the buffer flush from mux_chr_read to mux_chr_can_read. While the
latter is called periodically, the former will only be invoked when new
characters arrive at the back-end. This caused problems to front-end
drivers whenever they were unable to read data immediately, e.g.
virtio-console attached to stdio.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 qemu-char.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index 6d2dce7..f4c3876 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -398,6 +398,8 @@ static int mux_chr_can_read(void *opaque)
     MuxDriver *d = chr->opaque;
     int m = d->focus;
 
+    mux_chr_accept_input(opaque);
+
     if ((d->prod[m] - d->cons[m]) < MUX_BUFFER_SIZE)
         return 1;
     if (d->chr_can_read[m])
@@ -412,8 +414,6 @@ static void mux_chr_read(void *opaque, const uint8_t *buf, int size)
     int m = d->focus;
     int i;
 
-    mux_chr_accept_input (opaque);
-
     for(i = 0; i < size; i++)
         if (mux_proc_byte(chr, d, buf[i])) {
             if (d->prod[m] == d->cons[m] &&
-- 
1.7.1

             reply	other threads:[~2010-10-19 15:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-19 15:04 Jan Kiszka [this message]
2010-10-19 15:22 ` [Qemu-devel] Re: [PATCH][RESEND] char: Flush read buffer in mux_chr_can_read Alexander Graf
2010-10-19 15:26   ` Jan Kiszka
2010-11-17 10:18 ` Jan Kiszka
2010-11-17 11:55   ` Alexander Graf
2010-11-17 11:58     ` Jan Kiszka
2010-11-17 12:00       ` Alexander Graf
  -- strict thread matches above, loose matches on Subject: below --
2010-06-02  7:05 [Qemu-devel] " Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CBDB361.1060606@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=agraf@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).