diff options
author | John Snow <jsnow@redhat.com> | 2015-04-28 15:27:51 -0400 |
---|---|---|
committer | John Snow <jsnow@redhat.com> | 2015-04-28 15:27:51 -0400 |
commit | ba4ed39346c1bdbfefd1d781b39009f90822b956 (patch) | |
tree | 138ecd884fc65df94f6a2ec8584d1333a3c77161 /tests/libqtest.h | |
parent | 8fe941f749b2db3735abade1c298552de4eab496 (diff) | |
download | qemu-ba4ed39346c1bdbfefd1d781b39009f90822b956.tar.gz qemu-ba4ed39346c1bdbfefd1d781b39009f90822b956.tar.bz2 qemu-ba4ed39346c1bdbfefd1d781b39009f90822b956.zip |
libqtest: add qmp_async
Add qmp_async, which lets us send QMP commands asynchronously.
This is useful when we want to send commands that will trigger
event responses, but we don't know in what order to expect them.
Sometimes the event responses may arrive even before the command
confirmation will show up, so it is convenient to leave the responses
in the stream.
Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1426018503-821-5-git-send-email-jsnow@redhat.com
Diffstat (limited to 'tests/libqtest.h')
-rw-r--r-- | tests/libqtest.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/libqtest.h b/tests/libqtest.h index 30009ca5c9..4b54b5da9e 100644 --- a/tests/libqtest.h +++ b/tests/libqtest.h @@ -64,6 +64,15 @@ void qtest_qmp_discard_response(QTestState *s, const char *fmt, ...); QDict *qtest_qmp(QTestState *s, const char *fmt, ...); /** + * qtest_async_qmp: + * @s: #QTestState instance to operate on. + * @fmt...: QMP message to send to qemu + * + * Sends a QMP message to QEMU and leaves the response in the stream. + */ +void qtest_async_qmp(QTestState *s, const char *fmt, ...); + +/** * qtest_qmpv_discard_response: * @s: #QTestState instance to operate on. * @fmt: QMP message to send to QEMU @@ -84,6 +93,16 @@ void qtest_qmpv_discard_response(QTestState *s, const char *fmt, va_list ap); QDict *qtest_qmpv(QTestState *s, const char *fmt, va_list ap); /** + * qtest_async_qmpv: + * @s: #QTestState instance to operate on. + * @fmt: QMP message to send to QEMU + * @ap: QMP message arguments + * + * Sends a QMP message to QEMU and leaves the response in the stream. + */ +void qtest_async_qmpv(QTestState *s, const char *fmt, va_list ap); + +/** * qtest_receive: * @s: #QTestState instance to operate on. * @@ -420,6 +439,14 @@ static inline void qtest_end(void) QDict *qmp(const char *fmt, ...); /** + * qmp_async: + * @fmt...: QMP message to send to qemu + * + * Sends a QMP message to QEMU and leaves the response in the stream. + */ +void qmp_async(const char *fmt, ...); + +/** * qmp_discard_response: * @fmt...: QMP message to send to qemu * |