qemu-cr16/monitor
Markus Armbruster 548f1abacb monitor: Clean up HMP gdbserver error reporting
HMP command gdbserver used to emit two error messages for certain
errors.  For instance, with -M none:

    (qemu) gdbserver
    gdbstub: meaningless to attach gdb to a machine without any CPU.
    Could not open gdbserver on device 'tcp::1234'

The first message is the specific error, and the second one a generic
additional message that feels superfluous to me.

Commit c0e6b8b798 (system: propagate Error to gdbserver_start (and
other device setups)) turned the first message into a warning:

    warning: gdbstub: meaningless to attach gdb to a machine without any CPU.
    Could not open gdbserver on device 'tcp::1234'

This is arguably worse.

hmp_gdbserver() passes &error_warn to gdbserver_start(), so that
failure gets reported as warning, and then additionally emits the
generic error on failure.  This is a misuse of &error_warn.

Instead, receive the error in &err and report it, as usual.  With
this, gdbserver reports just the error:

    gdbstub: meaningless to attach gdb to a machine without any CPU.

Cc: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20250923091000.3180122-2-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2025-09-30 14:43:52 +02:00
..
fds.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
hmp-cmds-target.c monitor/hmp-cmds-target: add CPU_DUMP_VPU in hmp_info_registers() 2025-07-04 12:17:52 +02:00
hmp-cmds.c monitor: Clean up HMP gdbserver error reporting 2025-09-30 14:43:52 +02:00
hmp-target.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
hmp.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
meson.build util/qemu-config: Extract QMP commands to qemu-config-qmp.c 2024-04-18 11:17:27 +02:00
monitor-internal.h qapi: Move and rename qapi/qmp/dispatch.h to qapi/qmp-registry.h 2025-02-10 15:33:29 +01:00
monitor.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
qemu-config-qmp.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
qmp-cmds-control.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
qmp-cmds.c migration/block: Rewrite disk activation 2025-01-09 17:38:57 -03:00
qmp.c monitor: don't wake up qmp_dispatcher_co coroutine upon cleanup 2025-05-02 23:51:30 +02:00
trace-events docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00