mirror of
https://gitlab.com/qemu-project/qemu.git
synced 2026-10-28 14:04:39 +08:00
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>
17 lines
814 B
Plaintext
17 lines
814 B
Plaintext
QA output created by 305
|
|
### Create the image
|
|
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
|
|
### Fill the first refcount block and one data cluster from the second
|
|
wrote 126976/126976 bytes at offset 0
|
|
124 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
### Discard two of the last data clusters, leave one in the middle
|
|
discard 1024/1024 bytes at offset 123904
|
|
1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
discard 1024/1024 bytes at offset 125952
|
|
1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
### Corrupt the offset of the second refcount block
|
|
### Try to allocate the discarded clusters again
|
|
qcow2: Marking image as corrupt: Refblock offset 0x20600 unaligned (reftable index: 0x1); further corruption events will be suppressed
|
|
qemu-io: write failed: Input/output error
|
|
*** done
|