Skip to contentSkip to conversation

tests/libqtest: Remove unused global_qtest-related wrapper functions

PATCH In review Thomas Huth 3 participants 3 messages May 10, 2019 – May 15, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/libqtest: Remove unused global_qtest-related wrapper functions

A bunch of the wrapper functions that use global_qtest are not used anymore. Remove them to avoid that they are used in new code again.

---
 tests/libqtest.c |  11 +----
 tests/libqtest.h | 108 -----------------------------------------------
 2 files changed, 1 insertion(+), 118 deletions(-)
tests/libqtest.c +1 -10
index c49b85482d..8ac0c02af4 100644
@@ -1038,15 +1038,6 @@ QDict *qmp(const char *fmt, ...)
     return response;
 }
 
-void qmp_send(const char *fmt, ...)
-{
-    va_list ap;
-
-    va_start(ap, fmt);
-    qtest_qmp_vsend(global_qtest, fmt, ap);
-    va_end(ap);
-}
-
 char *hmp(const char *fmt, ...)
 {
     va_list ap;
@@ -1232,7 +1223,7 @@ void qtest_qmp_device_del(const char *id)
                                     &got_event);
     qobject_unref(rsp);
     if (!got_event) {
-        rsp = qmp_receive();
+        rsp = qtest_qmp_receive(global_qtest);
         g_assert_cmpstr(qdict_get_try_str(rsp, "event"),
                         ==, "DEVICE_DELETED");
         qobject_unref(rsp);
tests/libqtest.h +0 -108

144 lines not on this page · raw message

Signature · 1 line
2.21.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Thomas Huth

A bunch of the wrapper functions that use global_qtest are not used anymore. Remove them to avoid that they are used in new code again.

---
 tests/libqtest.c |  11 +----
 tests/libqtest.h | 108 -----------------------------------------------
 2 files changed, 1 insertion(+), 118 deletions(-)

Nice!

tests/libqtest.h static inline bool get_irq(int num) · line 704

Quoted 8 lines
tests/libqtest.h +0 -8
-/**
- * qtest_irq_intercept_out:
- * @string: QOM path of a device.
- *
- * Associate qtest irqs with the GPIO-out pins of the device
- * whose path is specified by @string.
- */
-static inline void irq_intercept_out(const char *string)

Fixes a copy-and-paste misdocumentation bug while at it :)

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
Reviewed-by on v1 1/1
#2 lore raw
In reply to Thomas Huth
Quoted 8 lines · Thomas Huth

A bunch of the wrapper functions that use global_qtest are not used anymore. Remove them to avoid that they are used in new code again.

---
 tests/libqtest.c |  11 +----
 tests/libqtest.h | 108 -----------------------------------------------
 2 files changed, 1 insertion(+), 118 deletions(-)