]> git.proxmox.com Git - mirror_qemu.git/commitdiff
libqtest: Avoid inline varargs functions
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 13 Mar 2014 11:24:15 +0000 (11:24 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 13 Mar 2014 12:31:05 +0000 (12:31 +0000)
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>
tests/libqtest.c
tests/libqtest.h

index f587d36176ed388c69ab9ca48743f6b0f95c95c1..b69dfca6bcedaf90841a64099e372e58784416c0 100644 (file)
@@ -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);
+}
index 9deebdcdfa4068e4f2cc4d3286c036aba3e29088..8268c098bf8f85739d0679c20d47d0f00d167c66 100644 (file)
@@ -356,16 +356,7 @@ static inline void qtest_end(void)
  *
  * Sends a QMP message to QEMU and returns the response.
  */
-static inline 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;
-}
+QDict *qmp(const char *fmt, ...);
 
 /**
  * qmp_discard_response:
@@ -373,14 +364,7 @@ static inline QDict *qmp(const char *fmt, ...)
  *
  * Sends a QMP message to QEMU and consumes the response.
  */
-static inline 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);
-}
+void qmp_discard_response(const char *fmt, ...);
 
 /**
  * get_irq: