diff mbox

[24/36] qtest: Drop unused qmp_fdv()

Message ID 1480535094-23831-25-git-send-email-eblake@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eric Blake Nov. 30, 2016, 7:44 p.m. UTC
Now that no more clients are passing variadic arguments, we can
simplify the testsuite by requiring that qmp_fd() be given the
final string to pass over the wire, rather than a dynamic JSON
string that has to be parsed into QObject and back out again.

Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/libqtest.h |  3 +--
 tests/libqtest.c | 17 +++--------------
 2 files changed, 4 insertions(+), 16 deletions(-)
diff mbox

Patch

diff --git a/tests/libqtest.h b/tests/libqtest.h
index c89c075..0adf880 100644
--- a/tests/libqtest.h
+++ b/tests/libqtest.h
@@ -927,7 +927,6 @@  static inline int64_t clock_set(int64_t val)
 QDict *qmp_fd_receive(int fd);
 void qmp_fd_sendv(int fd, const char *fmt, va_list ap);
 void qmp_fd_send(int fd, const char *fmt, ...);
-QDict *qmp_fdv(int fd, const char *fmt, va_list ap);
-QDict *qmp_fd(int fd, const char *fmt, ...);
+QDict *qmp_fd(int fd, const char *msg);

 #endif
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 1328bd9..b5b9f01 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -469,13 +469,6 @@  void qtest_async_qmpv(QTestState *s, const char *fmt, va_list ap)
     qmp_fd_sendv(s->qmp_fd, fmt, ap);
 }

-QDict *qmp_fdv(int fd, const char *fmt, va_list ap)
-{
-    qmp_fd_sendv(fd, fmt, ap);
-
-    return qmp_fd_receive(fd);
-}
-
 QDict *qtest_qmpv(QTestState *s, const char *fmt, va_list ap)
 {
     qtest_async_qmpv(s, fmt, ap);
@@ -484,15 +477,11 @@  QDict *qtest_qmpv(QTestState *s, const char *fmt, va_list ap)
     return qtest_qmp_receive(s);
 }

-QDict *qmp_fd(int fd, const char *fmt, ...)
+QDict *qmp_fd(int fd, const char *msg)
 {
-    va_list ap;
-    QDict *response;
+    qmp_fd_send(fd, msg);

-    va_start(ap, fmt);
-    response = qmp_fdv(fd, fmt, ap);
-    va_end(ap);
-    return response;
+    return qmp_fd_receive(fd);
 }

 void qmp_fd_send(int fd, const char *fmt, ...)