qtest: Add function to send QMP commands

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Kevin Wolf 2012-04-26 19:07:55 +02:00
parent c68b039aa9
commit a3ca163cb5
2 changed files with 123 additions and 37 deletions

View file

@ -37,6 +37,15 @@ QTestState *qtest_init(const char *extra_args);
*/
void qtest_quit(QTestState *s);
/**
* qtest_qmp:
* @s: QTestState instance to operate on.
* @fmt...: QMP message to send to qemu
*
* Sends a QMP message to QEMU
*/
void qtest_qmp(QTestState *s, const char *fmt, ...);
/**
* qtest_get_irq:
* @s: QTestState instance to operate on.
@ -206,6 +215,14 @@ void qtest_add_func(const char *str, void (*fn));
global_qtest = qtest_init((args)) \
)
/**
* qmp:
* @fmt...: QMP message to send to qemu
*
* Sends a QMP message to QEMU
*/
#define qmp(fmt, ...) qtest_qmp(global_qtest, fmt, ## __VA_ARGS__)
/**
* get_irq:
* @num: Interrupt to observe.