Signed-off-by: Marc-André Lureau <[email protected]>
---
tests/qemu-iotests/common.qemu | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu
index e5b6a6a87494..458ea9566818 100644
--- a/tests/qemu-iotests/common.qemu
+++ b/tests/qemu-iotests/common.qemu
@@ -287,6 +287,28 @@ _wait_event()
done
}
+# Run a QMP job command and wait for it to complete
+#
+# Sends the given QMP command, waits for the job to reach
+# "concluded" status, then dismisses it.
+#
+# $1: QEMU handle
+# $2: Job ID (must match the job-id in the command)
+# $3: QMP command string to send
+_run_qmp_job()
+{
+ local h=${1}
+ local job_id=${2}
+ local cmd=${3}
+
+ _send_qemu_cmd $h "$cmd" 'return'
+ _send_qemu_cmd $h '' '"concluded"'
+ _send_qemu_cmd $h \
+ "{ 'execute': 'job-dismiss',
+ 'arguments': { 'id': '$job_id' } }" 'return'
+}
+
+
# Launch a QEMU process.
#
# Input parameters:
--
2.56.0.rc0.29.g47ce80527c56