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>
55 lines
2.4 KiB
Plaintext
55 lines
2.4 KiB
Plaintext
QA output created by 220
|
|
== Creating huge file ==
|
|
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=564049465049088
|
|
== Populating refcounts ==
|
|
wrote 2097152/2097152 bytes at offset 4194304
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 8388608
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 10485760
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 12582912
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 14680064
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 16777216
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 18874368
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 20971520
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 23068672
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 25165824
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 27262976
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 29360128
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 31457280
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 33554432
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 35651584
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 37748736
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
== Checking file before ==
|
|
No errors were found on the image.
|
|
image size 39845888
|
|
== Trying to write compressed cluster ==
|
|
qemu-io: write failed: File too large
|
|
image size 562949957615616
|
|
== Writing normal cluster ==
|
|
wrote 2097152/2097152 bytes at offset 0
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
== Checking file after ==
|
|
wrote 1048576/1048576 bytes at offset 5242880
|
|
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 31457280/31457280 bytes at offset 8388608
|
|
30 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
|
|
8388589 leaked clusters were found on the image.
|
|
This means waste of disk space, but no harm to data.
|
|
*** done
|