From: Kevin Wolf <kwolf@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org, richard.henderson@linaro.org,
Hanna Reitz <hreitz@redhat.com>, Eric Blake <eblake@redhat.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
qemu-block@nongnu.org
Subject: Re: [GIT PULL 21/50] qemu-io: propagate errors through Error API instead of printf
Date: Thu, 17 Sep 2026 15:23:48 +0200 [thread overview]
Message-ID: <aqvp5H5FvEao80BV@redhat.com> (raw)
In-Reply-To: <20260829-nohmp-v1-21-4dcc2b4b0055@redhat.com>
Am 28.08.2026 um 22:42 hat Marc-André Lureau geschrieben:
> Convert the qemu-io command infrastructure to use QEMU's Error API
> (Error **errp) for error propagation instead of printing directly to
> stdout/stderr via printf/fprintf.
>
> The cfunc_t typedef, all ~35 command functions, the dispatcher chain
> (command/init_check_command/qemuio_command), and helper functions
> (parse_pattern, create_iovec, qemu_io_alloc_from_file) all gain an
> Error **errp parameter. Async completion callbacks (aio_read_done,
> aio_write_done, aio_discard_done) use error_report() since they have
> no Error path back to the caller.
>
> Update tests:
> - error_report_err() prepends qemu-io: prefix
> - copy-before-write: check the HMP return value, rather than stdio
> - other tests: update to check JSON {"return": "Error: error text"}
>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Message-ID: <20260828-qemu-no-hmp-v5-21-9227de146347@redhat.com>
This was not a great change, it results in a mess for qemu-io output.
When used from HMP, success output still ends up on stdout, but (some)
errors go to the monitor instead now. Some commands may even get their
output split across both stdout and the monitor. The old experience
wasn't great (everything should have gone to the monitor instead of
having everything in the terminal), but the new one is terrible.
Please fix the inconsistency or revert.
> diff --git a/tests/qemu-iotests/004.out b/tests/qemu-iotests/004.out
> index fb8593289f51..37da6024809f 100644
> --- a/tests/qemu-iotests/004.out
> +++ b/tests/qemu-iotests/004.out
> @@ -6,36 +6,36 @@ wrote 1048576/1048576 bytes at offset 133169152
> 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
>
> write into image boundary
> -write failed: Input/output error
> +qemu-io: write failed: Input/output error
> [...]
Instead changing the output of all test outputs to include an
unnecessary and inconsistently applied "qemu-io" prefix, it would have
been better to disable the prefix after command line parsing.
qemu-io is still primarily an interactive program, and constantly
printing the name of the program you're interacting with has little
value.
Kevin
next prev parent reply other threads:[~2026-09-17 13:24 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 20:41 [GIT PULL 00/50] Make HMP optional Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 01/50] build-sys: introduce CONFIG_HMP Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 02/50] vl: fix -monitor none prefix matching Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 03/50] hmp: remove 'vcpu' argument from trace-event help Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 04/50] hmp: fix snapshot_blkdev argument type Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 05/50] target/i386: decouple cpu_x86_inject_mce() from Monitor Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 06/50] target/i386: return an error for invalid CPU in hmp_mce() Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 07/50] system: move gpa2hva() to system memory unit Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 08/50] monitor: move HMP-only fields from Monitor to MonitorHMP Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 09/50] tests/functional: use query-version QMP command instead of HMP Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 10/50] net/qapi: add x-query-usernet command Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 11/50] python, tests: switch usernet queries from HMP to QMP Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 12/50] tests/qtest/pnv: drop unnecessary -serial mon:stdio Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 13/50] tests/qtest/qmp-test: don't depend on human-monitor-command Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 14/50] tests/qtest/numa-test: replace HMP "info numa" with QMP query-cpus-fast Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 15/50] tests/qtest/cdrom-test: replace HMP "info block" with QMP query-block Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 16/50] tests/qtest/device-introspect-test: replace 'info qom-tree' Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 17/50] tests/qtest/device-introspect-test: restrict test when !CONFIG_HMP Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 18/50] tests/qemu-iotests/205: fix race in assertExportNotFound Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 19/50] net: add x-query-network QMP command Marc-André Lureau
2026-08-28 20:41 ` [GIT PULL 20/50] tests/qtest/netdev-socket: replace HMP with x-query-network QMP Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 21/50] qemu-io: propagate errors through Error API instead of printf Marc-André Lureau
2026-09-17 13:23 ` Kevin Wolf [this message]
2026-09-21 11:42 ` Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 22/50] block: add x-qemu-io QMP command Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 23/50] qtest: add qemu-io command to the qtest protocol Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 24/50] qtest/ide-test: convert to use qtest qemu-io command Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 25/50] tests/qemu-iotests: add qmp_qemu_io() Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 26/50] tests/qemu-iotests: convert pause/resume_drive() to QMP Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 27/50] monitor: reject readline monitor when HMP is disabled Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 28/50] system: guard HMP initialization paths with CONFIG_HMP Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 29/50] tests: skip HMP-dependent tests when HMP is disabled Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 30/50] monitor: isolate HMP declarations in hmp.h Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 31/50] monitor: change HMPCommand cmd to take MonitorHMP Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 32/50] monitor: make hmp_handle_error() " Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 33/50] monitor: add monitor_cur_hmp() helper Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 34/50] qemu-print: document HMP/QMP behaviour better Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 35/50] error-report: switch to use monitor_cur_hmp() Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 36/50] monitor: tighten monitor_set_cpu()/get_cpu() Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 37/50] monitor: tighten monitor_printf*() Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 38/50] hexagon: make dump_mmu() take MonitorHMP Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 39/50] qdev-monitor: make print_dev() callback " Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 40/50] qapi: make HMP-specific schema entries conditional on CONFIG_HMP Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 41/50] Guard HMP command implementations with CONFIG_HMP Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 42/50] target: guard MonitorDef tables " Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 43/50] hw: guard BusClass::print_dev " Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 44/50] hexagon: condition HMP-specific code Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 45/50] build-sys: make HMP source files conditional on have_hmp Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 46/50] stubs: split monitor-core stubs into separate compilation units Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 47/50] monitor: move monitor_hmp_print*() functions to hmp.c Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 48/50] monitor: move HMP-specific to monitor-hmp-internal.h Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 49/50] build-sys: add 'hmp' option Marc-André Lureau
2026-08-28 20:42 ` [GIT PULL 50/50] gitlab: --disable-hmp in build-without-defaults Marc-André Lureau
2026-08-29 0:52 ` [GIT PULL 00/50] Make HMP optional Richard Henderson
2026-08-29 8:18 ` Marc-André Lureau
2026-08-29 9:14 ` [GIT PULL v2 " marcandre.lureau
2026-09-01 9:10 ` Peter Maydell
2026-09-01 10:18 ` Marc-André Lureau
2026-09-02 10:10 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aqvp5H5FvEao80BV@redhat.com \
--to=kwolf@redhat.com \
--cc=eblake@redhat.com \
--cc=hreitz@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=vsementsov@yandex-team.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.