qtest_init() still uses the qtest_qmp_discard_response(s, "") hack to
receive the greeting, even though we have qtest_qmp_receive() since
commit 66e0c7b. Put it to use.
Bonus: gets rid of an empty format string. A step towards
compile-time format string checking without triggering
-Wformat-zero-length.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
tests/libqtest.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 4a5492a..7e5425d 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -230,9 +230,11 @@ QTestState *qtest_init_without_qmp_handshake(const char *extra_args)
QTestState *qtest_init(const char *extra_args)
{
QTestState *s = qtest_init_without_qmp_handshake(extra_args);
+ QDict *greeting;
/* Read the QMP greeting and then do the handshake */
- qtest_qmp_discard_response(s, "");
+ greeting = qtest_qmp_receive(s);
+ QDECREF(greeting);
qtest_qmp_discard_response(s, "{ 'execute': 'qmp_capabilities' }");
return s;
--
2.7.5