From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@mailo.com>,
"Markus Armbruster" <armbru@redhat.com>
Subject: Re: [PATCH v2 22/39] qemu-io: propagate errors through Error API instead of printf
Date: Mon, 10 Aug 2026 19:19:25 +0100 [thread overview]
Message-ID: <anoWLcR_xLmgUb8U@redhat.com> (raw)
In-Reply-To: <20260626-qemu-no-hmp-v2-22-8af31bc54c61@redhat.com>
On Fri, Jun 26, 2026 at 01:19:23AM +0400, Marc-André Lureau wrote:
> 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>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> include/qemu-io.h | 4 +-
> block/monitor/block-hmp-cmds.c | 2 +-
> qemu-io-cmds.c | 414 +++++++++++++------------
> qemu-io.c | 17 +-
> tests/qemu-iotests/004.out | 20 +-
> tests/qemu-iotests/021.out | 60 ++--
> tests/qemu-iotests/026.out | 228 +++++++-------
> tests/qemu-iotests/060.out | 44 ++-
> tests/qemu-iotests/071.out | 10 +-
> tests/qemu-iotests/072.out | 2 +-
> tests/qemu-iotests/080.out | 4 +-
> tests/qemu-iotests/081.out | 2 +-
> tests/qemu-iotests/083.out | 36 +--
> tests/qemu-iotests/089.out | 4 +-
> tests/qemu-iotests/114.out | 2 +-
> tests/qemu-iotests/134.out | 2 +-
> tests/qemu-iotests/137.out | 2 +-
> tests/qemu-iotests/153.out | 12 +-
> tests/qemu-iotests/171 | 2 +-
> tests/qemu-iotests/171.out | 68 ++--
> tests/qemu-iotests/205 | 2 +-
> tests/qemu-iotests/214.out | 2 +-
> tests/qemu-iotests/220.out | 2 +-
> tests/qemu-iotests/225.out | 4 +-
> tests/qemu-iotests/244.out | 12 +-
> tests/qemu-iotests/249.out | 6 +-
> tests/qemu-iotests/271.out | 14 +-
> tests/qemu-iotests/289.out | 2 +-
> tests/qemu-iotests/305.out | 2 +-
> tests/qemu-iotests/307.out | 2 +-
> tests/qemu-iotests/tests/backup-discard-source | 4 +-
> tests/qemu-iotests/tests/copy-before-write | 66 ++--
> tests/qemu-iotests/tests/file-io-error.out | 2 +-
> tests/qemu-iotests/tests/image-fleecing.out | 12 +-
> tests/qemu-iotests/tests/inactive-node-nbd.out | 8 +-
> 35 files changed, 552 insertions(+), 523 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
next prev parent reply other threads:[~2026-08-10 18:19 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-25 21:19 [PATCH v2 00/39] Make HMP optional (and later standalone) Marc-André Lureau
2026-06-25 21:19 ` [PATCH v2 01/39] vl: fix -monitor none prefix matching Marc-André Lureau
2026-08-10 17:30 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 02/39] hmp: remove 'vcpu' argument from trace-event help Marc-André Lureau
2026-08-10 17:31 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 03/39] hmp: fix snapshot_blkdev argument type Marc-André Lureau
2026-08-10 17:35 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 04/39] target/i386: decouple cpu_x86_inject_mce() from Monitor Marc-André Lureau
2026-08-10 17:40 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 05/39] target/i386: return an error for invalid CPU in hmp_mce() Marc-André Lureau
2026-08-10 17:42 ` Daniel P. Berrangé
2026-08-10 20:16 ` Philippe Mathieu-Daudé
2026-06-25 21:19 ` [PATCH v2 06/39] system: move gpa2hva() to system memory unit Marc-André Lureau
2026-08-10 17:44 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 07/39] s390x: prevent crash if given invalid CPU# Marc-André Lureau
2026-08-10 17:44 ` Daniel P. Berrangé
2026-08-10 21:01 ` Philippe Mathieu-Daudé
2026-06-25 21:19 ` [PATCH v2 08/39] system: decouple qmp_inject_nmi() from Monitor Marc-André Lureau
2026-08-10 17:48 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 09/39] hmp: correct the nmi documentation Marc-André Lureau
2026-08-10 17:51 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 10/39] monitor: move HMP-only fields from Monitor to MonitorHMP Marc-André Lureau
2026-08-10 17:54 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 11/39] tests/functional: use query-version QMP command instead of HMP Marc-André Lureau
2026-08-10 17:54 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 12/39] net/qapi: add x-query-usernet command Marc-André Lureau
2026-08-10 17:56 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 13/39] python, tests: switch usernet queries from HMP to QMP Marc-André Lureau
2026-08-10 18:00 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 14/39] tests/qtest/pnv: drop unnecessary -serial mon:stdio Marc-André Lureau
2026-08-10 18:01 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 15/39] tests/qtest/qmp-test: don't depend on human-monitor-command Marc-André Lureau
2026-08-10 18:03 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 16/39] tests/qtest/numa-test: replace HMP "info numa" with QMP query-cpus-fast Marc-André Lureau
2026-08-10 18:04 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 17/39] tests/qtest/cdrom-test: replace HMP "info block" with QMP query-block Marc-André Lureau
2026-08-10 18:05 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 18/39] tests/qtest/device-introspect-test: fix test without HMP Marc-André Lureau
2026-06-25 21:19 ` [PATCH v2 19/39] tests/qemu-iotests/205: fix race in assertExportNotFound Marc-André Lureau
2026-08-10 18:15 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 20/39] net: add x-query-network QMP command Marc-André Lureau
2026-06-25 21:19 ` [PATCH v2 21/39] tests/qtest/netdev-socket: replace HMP with x-query-network QMP Marc-André Lureau
2026-06-25 21:19 ` [PATCH v2 22/39] qemu-io: propagate errors through Error API instead of printf Marc-André Lureau
2026-08-10 18:19 ` Daniel P. Berrangé [this message]
2026-06-25 21:19 ` [PATCH v2 23/39] RFC: qtest: add qemu-io command to the qtest protocol Marc-André Lureau
2026-08-10 18:22 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 24/39] RFC: qtest/ide-test: convert to use qtest qemu-io command Marc-André Lureau
2026-08-10 18:22 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 25/39] block: add x-qemu-io QMP command Marc-André Lureau
2026-08-10 18:26 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 26/39] tests/qemu-iotests: add qmp_qemu_io() Marc-André Lureau
2026-08-10 18:24 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 27/39] tests/qemu-iotests: convert pause/resume_drive() to QMP Marc-André Lureau
2026-08-10 18:26 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 28/39] build-sys: add 'hmp' option Marc-André Lureau
2026-08-10 18:27 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 29/39] monitor: reject readline monitor when HMP is disabled Marc-André Lureau
2026-08-10 18:28 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 30/39] tests: skip HMP-dependent tests " Marc-André Lureau
2026-08-10 18:29 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 31/39] util: guard monitor_vprintf callers with CONFIG_HMP Marc-André Lureau
2026-08-10 18:34 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 32/39] qapi: make HMP-specific schema entries conditional on CONFIG_HMP Marc-André Lureau
2026-08-10 18:35 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 33/39] system: guard HMP initialization paths with CONFIG_HMP Marc-André Lureau
2026-06-25 21:19 ` [PATCH v2 34/39] Guard HMP command implementations " Marc-André Lureau
2026-08-10 18:36 ` Daniel P. Berrangé
2026-06-25 21:19 ` [PATCH v2 35/39] target: guard MonitorDef tables " Marc-André Lureau
2026-08-10 21:44 ` Philippe Mathieu-Daudé
2026-06-25 21:19 ` [PATCH v2 36/39] hw: guard BusClass::print_dev " Marc-André Lureau
2026-06-25 21:19 ` [PATCH v2 37/39] build-sys: make HMP source files conditional on have_hmp Marc-André Lureau
2026-06-25 21:19 ` [PATCH v2 38/39] monitor: guard HMP internal helpers with CONFIG_HMP Marc-André Lureau
2026-06-25 21:19 ` [PATCH v2 39/39] monitor: guard HMP monitor API " Marc-André Lureau
2026-08-10 21:49 ` [PATCH v2 00/39] Make HMP optional (and later standalone) Philippe Mathieu-Daudé
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=anoWLcR_xLmgUb8U@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=philmd@mailo.com \
--cc=qemu-devel@nongnu.org \
/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.