Skip to content

Fix and improve chardev open error messages

Markus Armbruster qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest19 patches 25 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/19Revert "qemu-char: Print strerror message on failure" and depsconsole.c console.h hw/baum.c +6 more+84 -1221 reply
2/19qemu-char: Use qemu_open() to avoid leaking fds to childrenqemu-char.c+4 -41 reply
3/19qemu-char: Re-apply style fixes from just reverted aad04cd0qemu-char.c+14 -71 reply
4/19qemu-char: qemu_chr_open_fd() can't fail, don't checkqemu-char.c+0 -41 reply
5/19vl.c: Error locations for options using add_device_config()vl.c+4 -00 replies
6/19gdbstub: Error locations for -gdbvl.c+4 -62 replies
7/19sockets: Drop sockets_debug debug codeqemu-sockets.c+2 -410 replies
8/19sockets: Clean up inet_listen_opts()'s convoluted bind() loopqemu-sockets.c+6 -80 replies
9/19sockets: Chardev open error reporting, sockets partqemu-char.c qemu-sockets.c+70 -8511 replies
10/19qemu-char: Chardev open error reporting, !_WIN32 partqemu-char.c+15 -46 replies
11/19qemu-char: Chardev open error reporting, _WIN32 partqemu-char.c+51 -140 replies
12/19qemu-char: Chardev open error reporting, tty partqemu-char.c+6 -00 replies
13/19qemu-char: Chardev open error reporting, parport partqemu-char.c+18 -30 replies
14/19console: Eliminate text_consoles[]console.c+4 -140 replies
15/19console: Chardev open error reporting, console partconsole.c+1 -10 replies
16/19spice-qemu-char: Chardev open error reporting, spicevmc partspice-qemu-char.c+6 -60 replies
17/19baum: Chardev open error reporting, braille parthw/baum.c+6 -30 replies
18/19qemu-char: Chardev open error reporting, generic partqemu-char.c+6 -90 replies
19/19qemu-char: Fix legacy chardev syntax error reportingqemu-char.c vl.c+3 -70 replies

Reviews trailers per patch

3 of 19 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAnthony LiguoriKevin Wolf
SeriesR-b
1/19
2/19R-b
3/19R-b
4/19R-b
5/19
6/19
7/19
8/19
9/19
10/19
11/19
12/19
13/19
14/19
15/19
16/19
17/19
18/19
19/19

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 00/19] Fix and improve chardev open error messages

Our chardev open error messages are an embarrassment. Commit 6e1db57b tried to improve the useless "opening backend FOO failed" message in qemu_chr_open_opts(), but it is flawed: some failure modes went from an unhelpful "failed" to an outright misleading error message (see first patch for details). And even for failure modes where the message isn't misleading, it's still sub-par.

Clue: many backends already report their errors. The "failed" message is merely redundant then.

Since I'm touching the error reporting anyway, convert it to error_report(), so that a future a monitor command to add character devices emits its errors to the monitor, not stderr.

Outline:

[01-04/19] Revert the flawed commit
[05-06/19] Prepare for use of error_report()
[07-17/19] Make the backends report decent errors on all failure paths
[ 18/18] Rip out the useless "failed" message
[ 19/19] Bonus fix: legacy chardev syntax error reporting

Markus Armbruster (19):
Revert "qemu-char: Print strerror message on failure" and deps
qemu-char: Use qemu_open() to avoid leaking fds to children
qemu-char: Re-apply style fixes from just reverted aad04cd0
qemu-char: qemu_chr_open_fd() can't fail, don't check vl.c: Error locations for options using add_device_config()
gdbstub: Error locations for -gdb
sockets: Drop sockets_debug debug code
sockets: Clean up inet_listen_opts()'s convoluted bind() loop
sockets: Chardev open error reporting, sockets part
qemu-char: Chardev open error reporting, !_WIN32 part
qemu-char: Chardev open error reporting, _WIN32 part
qemu-char: Chardev open error reporting, tty part
qemu-char: Chardev open error reporting, parport part
console: Eliminate text_consoles[]
console: Chardev open error reporting, console part
spice-qemu-char: Chardev open error reporting, spicevmc part
baum: Chardev open error reporting, braille part
qemu-char: Chardev open error reporting, generic part
qemu-char: Fix legacy chardev syntax error reporting

 console.c         |   28 ++----
 console.h         |    2 +-
 hw/baum.c         |   16 ++--
 hw/baum.h         |    2 +-
 hw/msmouse.c      |    5 +-
 hw/msmouse.h      |    2 +-
 qemu-char.c       |  263 ++++++++++++++++++++++++++++++-----------------------
 qemu-sockets.c    |  203 +++++++++++++++--------------------------
 spice-qemu-char.c |   21 ++--
 ui/qemu-spice.h   |    2 +-
 vl.c              |   20 ++---
 11 files changed, 265 insertions(+), 299 deletions(-)
Signature · 1 line
1.7.6.5