[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 11/12] tests/libqtest: Clean up how we read the Q
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PATCH v3 11/12] tests/libqtest: Clean up how we read the QMP greeting |
Date: |
Tue, 25 Jul 2017 16:15:22 -0500 |
From: Markus Armbruster <address@hidden>
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 <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
---
tests/libqtest.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 1b57cedca1..b0fcbf2872 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.13.3
- [Qemu-devel] [PATCH v3 01/12] qobject: Accept "%"PRId64 in qobject_from_jsonf(), (continued)
- [Qemu-devel] [PATCH v3 01/12] qobject: Accept "%"PRId64 in qobject_from_jsonf(), Eric Blake, 2017/07/25
- [Qemu-devel] [PATCH v3 02/12] qtest: Avoid passing raw strings through hmp(), Eric Blake, 2017/07/25
- [Qemu-devel] [PATCH v3 03/12] qtest: Document calling conventions, Eric Blake, 2017/07/25
- [Qemu-devel] [PATCH v3 05/12] tests: Clean up string interpolation into QMP input (simple cases), Eric Blake, 2017/07/25
- [Qemu-devel] [PATCH v3 06/12] tests/libqos/usb: Clean up string interpolation into QMP input, Eric Blake, 2017/07/25
- [Qemu-devel] [PATCH v3 04/12] tests: Pass literal format strings directly to qmp_FOO(), Eric Blake, 2017/07/25
- [Qemu-devel] [PATCH v3 07/12] qtest: Add a new helper qmp_cmd() and friends, Eric Blake, 2017/07/25
- [Qemu-devel] [PATCH v3 09/12] tests/libqos/pci: Clean up string interpolation into QMP input, Eric Blake, 2017/07/25
- [Qemu-devel] [PATCH v3 08/12] qtests: convert tests to use qmp_cmd, Eric Blake, 2017/07/25
- [Qemu-devel] [PATCH v3 10/12] tests: Clean up wait for event, Eric Blake, 2017/07/25
- [Qemu-devel] [PATCH v3 11/12] tests/libqtest: Clean up how we read the QMP greeting,
Eric Blake <=
- [Qemu-devel] [PATCH v3 12/12] tests/libqtest: Enable compile-time format string checking, Eric Blake, 2017/07/25