* [Qemu-devel] [PATCH][RESEND] char: Flush read buffer in mux_chr_can_read
@ 2010-06-02 7:05 Jan Kiszka
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2010-06-02 7:05 UTC (permalink / raw)
To: qemu-devel, Anthony Liguori; +Cc: Alexander Graf
From: Jan Kiszka <jan.kiszka@siemens.com>
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>
---
While this may not solve all problems on s390, it does improve the
muxed virtio console for x86 guest and still looks correct to me.
qemu-char.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/qemu-char.c b/qemu-char.c
index faaf624..00ded76 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -404,6 +404,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])
@@ -418,8 +420,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.6.0.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Qemu-devel] [PATCH][RESEND] char: Flush read buffer in mux_chr_can_read
@ 2010-10-19 15:04 Jan Kiszka
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2010-10-19 15:04 UTC (permalink / raw)
To: qemu-devel; +Cc: Anthony Liguori, Alexander Graf
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-10-19 15:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-02 7:05 [Qemu-devel] [PATCH][RESEND] char: Flush read buffer in mux_chr_can_read Jan Kiszka
-- strict thread matches above, loose matches on Subject: below --
2010-10-19 15:04 Jan Kiszka
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).