Files
qemu/tests/qemu-iotests/214.out
T
Marc-André Lureau 3c0c7bfeba qemu-io: propagate errors through Error API instead of printf
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>
2026-08-29 12:07:44 +04:00

50 lines
1.9 KiB
Plaintext

QA output created by 214
=== Corrupted size field in compressed cluster descriptor ===
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=8388608
wrote 2097152/2097152 bytes at offset 0
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 2097152/2097152 bytes at offset 2097152
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
qemu-io: read failed: Input/output error
No errors were found on the image.
read 4194304/4194304 bytes at offset 0
4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 4194304/4194304 bytes at offset 4194304
4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 4194304/4194304 bytes at offset 0
4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ERROR cluster 6 refcount=1 reference=3
ERROR cluster 7 refcount=1 reference=2
Repairing cluster 6 refcount=1 reference=3
Repairing cluster 7 refcount=1 reference=2
Repairing OFLAG_COPIED data cluster: l2_entry=8000000000c00000 refcount=3
Repairing OFLAG_COPIED data cluster: l2_entry=8000000000e00000 refcount=2
The following inconsistencies were found and repaired:
0 leaked clusters
4 corruptions
Double checking the fixed image now...
No errors were found on the image.
read 4194304/4194304 bytes at offset 0
4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 4194304/4194304 bytes at offset 4194304
4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
=== Write compressed data of multiple clusters ===
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2097152
Write uncompressed data:
wrote 524288/524288 bytes at offset 0
512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2097152
Write compressed data:
wrote 229376/229376 bytes at offset 0
224 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 229376/229376 bytes at offset 278528
224 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
"compressed-clusters": 8
*** done