qemu-e2k/chardev
Daniel P. Berrangé d96aa5db4f char: fix logging when chardev write fails
The qemu_chr_write_buffer() method sends data to the chardev backend for
writing, and then also writes to the log file. In case the chardev
backend only writes part of the data buffer, we need to make sure we
only log the same subset. qemu_chr_write_buffer() will be invoked again
later to write the rest of the buffer.

In the case the chardev backend returns an error though, no further
attempts to likely to be made to write the data. We must therefore write
the entire buffer to the log immediately.

An example where this is important is with the socket backend. This will
return -1 for all writes if no client is currently connected. We still
wish to write data to the log file when no client is present though.
This used to work because the chardev would return "len" to pretend it
had written all data when no client is connected, but this changed to
return an error in

  commit 271094474b
  Author: Dima Stepanov <dimastep@yandex-team.ru>
  Date: Thu May 28 12:11:18 2020 +0300

    char-socket: return -1 in case of disconnect during tcp_chr_write

and this broke the logging, resulting in all data being discarded when
no client is present.

Fixes: https://bugs.launchpad.net/qemu/+bug/1893691
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-30 19:11:36 +02:00
..
baum.c Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
char-console.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
char-fd.c util: rename qemu_open() to qemu_open_old() 2020-09-16 10:33:48 +01:00
char-fe.c chardev: Reduce "char-mux.h" scope, rename it "chardev-internal.h" 2020-07-13 11:59:47 +04:00
char-file.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
char-io.c chardev: use a child source for qio input source 2018-10-03 14:45:05 +04:00
char-mux.c chardev: Reduce "char-mux.h" scope, rename it "chardev-internal.h" 2020-07-13 11:59:47 +04:00
char-null.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
char-parallel.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
char-pipe.c util: rename qemu_open() to qemu_open_old() 2020-09-16 10:33:48 +01:00
char-pty.c Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
char-ringbuf.c Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
char-serial.c chardev: Add macOS to list of OSes that support -chardev serial 2020-05-04 14:35:23 +02:00
char-socket.c Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
char-stdio.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
char-udp.c Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
char-win-stdio.c Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
char-win.c chardev: Improve error report by calling error_setg_win32() 2020-03-09 13:36:15 +01:00
char.c char: fix logging when chardev write fails 2020-09-30 19:11:36 +02:00
chardev-internal.h Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
chardev-sysemu.c chardev: Extract system emulation specific code 2020-07-13 11:59:47 +04:00
meson.build meson: remove linkage of sdl to baum 2020-09-08 11:43:16 +02:00
msmouse.c Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
spice.c qemu/queue.h: add QLIST_SAFE_REMOVE() 2020-02-22 08:26:47 +00:00
testdev.c Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
trace-events trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
wctablet.c Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00