diff options
author | Andreas Färber <afaerber@suse.de> | 2013-02-16 22:44:02 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-02-18 08:39:09 -0600 |
commit | b73cf9e93f1c7fd6e949f71172c49848b4d70aa9 (patch) | |
tree | 388aade6f78e3cefa2d88088779cd86873cdfcfd /tests/libqtest.c | |
parent | 6acf801de5a6e299c02ab3efe3e0dcd75ae678e0 (diff) |
libqtest: Introduce qtest_qmpv() and convert remaining macro
In order to convert qmp() macro to an inline function, expose a
qtest_qmpv() function, reused by qtest_qmp().
We can't apply GCC_FMT_ATTR() since fdc-test is using zero-length format
strings, which would result in warnings treated as errors.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1361051043-27944-3-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'tests/libqtest.c')
-rw-r--r-- | tests/libqtest.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/libqtest.c b/tests/libqtest.c index 762dec4ac0..da58ff5034 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -288,16 +288,13 @@ redo: return words; } -void qtest_qmp(QTestState *s, const char *fmt, ...) +void qtest_qmpv(QTestState *s, const char *fmt, va_list ap) { - va_list ap; bool has_reply = false; int nesting = 0; /* Send QMP request */ - va_start(ap, fmt); socket_sendf(s->qmp_fd, fmt, ap); - va_end(ap); /* Receive reply */ while (!has_reply || nesting > 0) { @@ -326,6 +323,15 @@ void qtest_qmp(QTestState *s, const char *fmt, ...) } } +void qtest_qmp(QTestState *s, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + qtest_qmpv(s, fmt, ap); + va_end(ap); +} + const char *qtest_get_arch(void) { const char *qemu = getenv("QTEST_QEMU_BINARY"); |