aboutsummaryrefslogtreecommitdiff
path: root/tests/libqtest.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libqtest.h')
-rw-r--r--tests/libqtest.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/libqtest.h b/tests/libqtest.h
index 70e9c5157c..d3da42623e 100644
--- a/tests/libqtest.h
+++ b/tests/libqtest.h
@@ -147,6 +147,23 @@ void qtest_qmp_eventwait(QTestState *s, const char *event);
QDict *qtest_qmp_eventwait_ref(QTestState *s, const char *event);
/**
+ * qtest_qmp_receive_success:
+ * @s: #QTestState instance to operate on
+ * @event_cb: Event callback
+ * @opaque: Argument for @event_cb
+ *
+ * Poll QMP messages until a command success response is received.
+ * If @event_cb, call it for each event received, passing @opaque,
+ * the event's name and data.
+ * Return the success response's "return" member.
+ */
+QDict *qtest_qmp_receive_success(QTestState *s,
+ void (*event_cb)(void *opaque,
+ const char *name,
+ QDict *data),
+ void *opaque);
+
+/**
* qtest_hmp:
* @s: #QTestState instance to operate on.
* @fmt...: HMP command to send to QEMU, formats arguments like sprintf().