aboutsummaryrefslogtreecommitdiff
path: root/tests/libqtest.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-03-13 11:24:15 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-03-13 12:31:05 +0000
commit0100f42550201f346cc0c20c1864f941509eb592 (patch)
tree469672084dd74e42e10639363520f54ba3c57ee5 /tests/libqtest.c
parent750036a848ea913ba6343718ffa70da98f7eef6b (diff)
downloadqemu-0100f42550201f346cc0c20c1864f941509eb592.zip
qemu-0100f42550201f346cc0c20c1864f941509eb592.tar.gz
qemu-0100f42550201f346cc0c20c1864f941509eb592.tar.bz2
libqtest: Avoid inline varargs functions
Older versions of gcc (eg 4.6) can't handle varargs functions declared inline for anything other than completely trivial uses, and complain: tests/qom-test.c: In function 'qmp': tests/libqtest.h:359:60: sorry, unimplemented: function 'qmp' can never be inlined because it uses variable argument lists Avoid this problem by putting the functions into libqtest.c instead of using inline definitions in libqtest.h. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'tests/libqtest.c')
-rw-r--r--tests/libqtest.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/libqtest.c b/tests/libqtest.c
index f587d36..b69dfca 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -581,3 +581,23 @@ void qtest_memwrite(QTestState *s, uint64_t addr, const void *data, size_t size)
qtest_sendf(s, "\n");
qtest_rsp(s, 0);
}
+
+QDict *qmp(const char *fmt, ...)
+{
+ va_list ap;
+ QDict *response;
+
+ va_start(ap, fmt);
+ response = qtest_qmpv(global_qtest, fmt, ap);
+ va_end(ap);
+ return response;
+}
+
+void qmp_discard_response(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ qtest_qmpv_discard_response(global_qtest, fmt, ap);
+ va_end(ap);
+}