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) {
}
}
+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");
#include <stdint.h>
#include <stdbool.h>
+#include <stdarg.h>
#include <sys/types.h>
typedef struct QTestState QTestState;
*/
void qtest_qmp(QTestState *s, const char *fmt, ...);
+/**
+ * qtest_qmpv:
+ * @s: #QTestState instance to operate on.
+ * @fmt: QMP message to send to QEMU
+ * @ap: QMP message arguments
+ *
+ * Sends a QMP message to QEMU.
+ */
+void qtest_qmpv(QTestState *s, const char *fmt, va_list ap);
+
/**
* qtest_get_irq:
* @s: #QTestState instance to operate on.
*
* Sends a QMP message to QEMU
*/
-#define qmp(fmt, ...) qtest_qmp(global_qtest, fmt, ## __VA_ARGS__)
+static inline void qmp(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ qtest_qmpv(global_qtest, fmt, ap);
+ va_end(ap);
+}
/**
* get_irq: