char: Flush read buffer in mux_chr_can_read
PATCH RESEND 1/1 char: Flush read buffer in mux_chr_can_read
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.
--- qemu-char.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
qemu-char.c +2 -2
@@ -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] &&
Signature · 1 line
1.7.1
Quoted 10 lines · Alexander Graf
Am 19.10.2010 um 17:04 schrieb Jan Kiszka <[email protected]>:
Quoted 5 lines
Move the buffer flush from
mux_chr_readtomux_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.This should help ny s390 virtio console issue, right? :) I'll try it out asap, worst case that might take until the weekend.
I think you already tried and still found some scenarios broken (we still need to understand them IIRC). However, this one fixes at least those virtio-console scenarios I tested (with x86 guests).
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux
Am 19.10.2010 um 17:04 schrieb Jan Kiszka <[email protected]>:
Quoted 5 lines
Move the buffer flush from
mux_chr_readtomux_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.
This should help ny s390 virtio console issue, right? :) I'll try it out asap, worst case that might take until the weekend.
Alex
Quoted 1 line
Quoted 6 lines · Jan Kiszka
Move the buffer flush from
mux_chr_readtomux_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.
Ping.
Quoted 27 lines
Signed-off-by Jan Kiszka <[email protected]>--- qemu-char.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)qemu-char.c +2
-2@@ -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] &&
Quoted 9 lines · Jan Kiszka
Quoted 6 lines · Jan Kiszka
Move the buffer flush from
mux_chr_readtomux_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.Ping.
It's still broken, even with this patch applied.
Alex
Quoted 11 lines · Alexander Graf
Quoted 8 lines · Jan Kiszka
Quoted 6 lines · Jan Kiszka
Move the buffer flush from
mux_chr_readtomux_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.
Quoted 4 lines
Quoted 1 line
Ping.
It's still broken, even with this patch applied.
No surprise. Still, the patch fixes other archs (namely x86).
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux
Quoted 12 lines · Jan Kiszka
Quoted 11 lines · Alexander Graf
Quoted 8 lines · Jan Kiszka
Quoted 6 lines · Jan Kiszka
Move the buffer flush from
mux_chr_readtomux_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.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Ping.
It's still broken, even with this patch applied.
No surprise. Still, the patch fixes other archs (namely x86).
Sure, no complaints on the patch from my side. The framework is still broken though :).
Alex