On 25/8/26 21:09, Marc-André Lureau wrote:
Add a "qemu-io" command to the qtest protocol so that tests can issue
block layer I/O commands without going through the HMP monitor's
"human-monitor-command" QMP, or use QMP at all.
Unfortunately, many tests will prefer to use QMP as they also monitor
and log other events. It's easier if it is pipelined in the same stream.
Signed-off-by: Marc-André Lureau <[email protected]>
---
system/qtest.c | 14 ++++++++++++++
tests/qtest/libqtest.c | 14 ++++++++++++++
tests/qtest/libqtest.h | 11 +++++++++++
3 files changed, 39 insertions(+)
+/**
+ * qtest_qemu_io:
+ * @s: #QTestState instance to operate on.
+ * @device: block device node-name or BlockBackend name.
+ * @fmt: qemu-io command to send, formats arguments like sprintf().
+ *
+ * Send a qemu-io command via the qtest protocol.
+ */
+void qtest_qemu_io(QTestState *s, const char *device,
+ const char *fmt, ...) G_GNUC_PRINTF(3, 4);
+
Again qemu-io is a CLI tool to send block commands via command line.
Here we don't call the tool, we run the command directly; that's why
I'd prefer qtest_block_command() or similar. Anyhow,
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>