summaryrefslogtreecommitdiffstats
path: root/tests/qtest/libqos
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qtest/libqos')
-rw-r--r--tests/qtest/libqos/libqtest.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/qtest/libqos/libqtest.h b/tests/qtest/libqos/libqtest.h
index 9b3f99b322..b7a776068c 100644
--- a/tests/qtest/libqos/libqtest.h
+++ b/tests/qtest/libqos/libqtest.h
@@ -199,6 +199,16 @@ void qtest_qmp_vsend(QTestState *s, const char *fmt, va_list ap)
QDict *qtest_qmp_receive_dict(QTestState *s);
/**
+ * qtest_qmp_receive:
+ * @s: #QTestState instance to operate on.
+ *
+ * Reads a QMP message from QEMU and returns the response.
+ * Buffers all the events received meanwhile, until a
+ * call to qtest_qmp_eventwait
+ */
+QDict *qtest_qmp_receive(QTestState *s);
+
+/**
* qtest_qmp_eventwait:
* @s: #QTestState instance to operate on.
* @event: event to wait for.
@@ -218,6 +228,19 @@ void qtest_qmp_eventwait(QTestState *s, const char *event);
QDict *qtest_qmp_eventwait_ref(QTestState *s, const char *event);
/**
+ * qtest_qmp_event_ref:
+ * @s: #QTestState instance to operate on.
+ * @event: event to return.
+ *
+ * Removes non-matching events from the buffer that was set by
+ * qtest_qmp_receive, until an event bearing the given name is found,
+ * and returns it.
+ * If no event matches, clears the buffer and returns NULL.
+ *
+ */
+QDict *qtest_qmp_event_ref(QTestState *s, const char *event);
+
+/**
* qtest_qmp_receive_success:
* @s: #QTestState instance to operate on
* @event_cb: Event callback