]> git.proxmox.com Git - mirror_qemu.git/commitdiff
tests/libqtest: Use libqtest-single.h in tests that require global_qtest
authorThomas Huth <thuth@redhat.com>
Tue, 3 Sep 2019 05:50:26 +0000 (07:50 +0200)
committerThomas Huth <thuth@redhat.com>
Thu, 5 Sep 2019 11:18:52 +0000 (13:18 +0200)
Tests that require global_qtest or the related wrapper functions now
use the libqtest-single.h header that is dedicated for everything
related to global_qtest. The core libqtest.c and libqtest.h files are
now completely indepedent from global_qtest, so that the core library
is now not depending on a global state anymore.

Message-Id: <20190904130047.25808-7-thuth@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
33 files changed:
tests/cpu-plug-test.c
tests/display-vga-test.c
tests/e1000e-test.c
tests/fdc-test.c
tests/i440fx-test.c
tests/i82801b11-test.c
tests/intel-hda-test.c
tests/ioh3420-test.c
tests/ipmi-kcs-test.c
tests/libqtest-single.h
tests/libqtest.c
tests/libqtest.h
tests/m25p80-test.c
tests/qos-test.c
tests/rtc-test.c
tests/rtl8139-test.c
tests/test-arm-mptimer.c
tests/test-netfilter.c
tests/test-x86-cpuid-compat.c
tests/tmp105-test.c
tests/tpm-crb-test.c
tests/tpm-tests.c
tests/tpm-tis-test.c
tests/usb-hcd-ohci-test.c
tests/usb-hcd-uhci-test.c
tests/usb-hcd-xhci-test.c
tests/vhost-user-test.c
tests/virtio-9p-test.c
tests/virtio-blk-test.c
tests/virtio-ccw-test.c
tests/virtio-net-test.c
tests/virtio-scsi-test.c
tests/virtio-serial-test.c

index 3049620854ac42bd8f38ba518b1728855c03d471..776407e1b60577ec77f94828125f862dbb60cd59 100644 (file)
@@ -10,7 +10,7 @@
 #include "qemu/osdep.h"
 
 #include "qemu-common.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qapi/qmp/qdict.h"
 
 struct PlugTestData {
index bd176dcf3a2d9e52eeec3a28c0dd4b01dc5932c6..ace3bb28e0e81e79c2d053dcb27302f9a27d94f2 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 
 static void pci_cirrus(void)
 {
index 93628c588d1024cf8a2072bdc10c0c78a631494a..1a232a663ab0d4bd0ff2d5f052f9383fb4f19ddc 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qemu-common.h"
 #include "libqos/pci-pc.h"
 #include "qemu/sockets.h"
index 31cd3295c102f556ea14a1b57967b91f7c7533f9..26b69f7c5cd8dc66626ee3866c449eb4033d70c2 100644 (file)
@@ -25,7 +25,7 @@
 #include "qemu/osdep.h"
 
 
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qapi/qmp/qdict.h"
 #include "qemu-common.h"
 
index 69205b58a8cf7971ed808580247800bb754f29d2..1f57d9684b00da6bd07cabdb27e6b8d6cbe9c014 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "qemu/osdep.h"
 
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "libqos/pci.h"
 #include "libqos/pci-pc.h"
 #include "hw/pci/pci_regs.h"
index a6e31594c927afdaaa6e6c0576a59930a74e7a29..4345da338b4bec47701b5c06ab9fa8e51cd81040 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void nop(void)
index b782b2e9444601a915745045588ca8ddfc095d1d..fc25ccc33cc809cca04b880a382fd3d186683b2a 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 
 #define HDA_ID "hda0"
 #define CODEC_DEVICES " -device hda-output,bus=" HDA_ID ".0" \
index b54c4b9f11a19921e733c765cd03b39bbeae04f4..f6ca43cca7458f75f8285799144bb5ca75d8d7d7 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void nop(void)
index a2354c10c7fe5e222e45802f6c94c4da2e990eb3..693a6aacb521edbfe5260d478549754bf79dace8 100644 (file)
@@ -24,8 +24,7 @@
 
 #include "qemu/osdep.h"
 
-
-#include "libqtest.h"
+#include "libqtest-single.h"
 
 #define IPMI_IRQ        5
 
index 49259558a578eeafec1165878ab81394ed0c0d9d..6f1bb1331c5217763d5d49e5d707103ea2fc3b39 100644 (file)
 #ifndef LIBQTEST_SINGLE_H
 #define LIBQTEST_SINGLE_H
 
+#include "libqtest.h"
+
+QTestState *global_qtest __attribute__((common, weak));
+
 /**
  * qtest_start:
  * @args: other arguments to pass to QEMU
index e5101d9d3a58e39e539dc3286f640e41c2cdc128..0a6b91737e8de85d1fa245181f13f5e39e0a5626 100644 (file)
@@ -35,8 +35,6 @@
 #define SOCKET_TIMEOUT 50
 #define SOCKET_MAX_FDS 16
 
-QTestState *global_qtest;
-
 struct QTestState
 {
     int fd;
index 6a7d7e41ad61ccd5217992dc74f57163ad2097c0..c8cffe5d6832f72741208bd7df755dd041690056 100644 (file)
@@ -22,8 +22,6 @@
 
 typedef struct QTestState QTestState;
 
-extern QTestState *global_qtest;
-
 /**
  * qtest_initf:
  * @fmt...: Format for creating other arguments to pass to QEMU, formatted
@@ -641,8 +639,6 @@ void qtest_add_abrt_handler(GHookFunc fn, const void *data);
 void qtest_qmp_assert_success(QTestState *qts, const char *fmt, ...)
     GCC_FMT_ATTR(2, 3);
 
-#include "libqtest-single.h"
-
 QDict *qmp_fd_receive(int fd);
 void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num,
                       const char *fmt, va_list ap) GCC_FMT_ATTR(4, 0);
index 055f7246a88054b4a4ac283e4b52068360f2f829..50c6b79fb3ac0a1402b78a582e21974d3b017fa3 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/bswap.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 
 /*
  * ASPEED SPI Controller registers
index 3c0071b3b707a0561167da0550afd5f4408cff6b..fd70d73ea541baed201f518ed6a2ba9aab73193c 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "qemu/osdep.h"
 #include <getopt.h>
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qbool.h"
 #include "qapi/qmp/qstring.h"
index 509be707e3471cc1662e62ca613ed2b2a50e256e..6309b0ef6cc2f2ce496178d4a28fda4899827698 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "qemu/osdep.h"
 
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qemu/timer.h"
 #include "hw/timer/mc146818rtc_regs.h"
 
index d6d0c249095bf83163e510b5e5acac809574c5e3..450604926492c850e7a080c0ccf38e5f9132ef52 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "libqos/pci-pc.h"
 #include "qemu/timer.h"
 #include "qemu-common.h"
index 156a39f50dd87094189ea1b6d25eeedc2efa56e0..7a56d56da94f3c80730132797e826a49db35350f 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/timer.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 
 #define TIMER_BLOCK_SCALE(s)    ((((s) & 0xff) + 1) * 10)
 
index e47075dd06b67bd46239c78aab2d245f505cfe55..22927ee6abb9bf09f3bde15dddc7652bfb4e18e4 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qapi/qmp/qdict.h"
 
 /* add a netfilter to a netdev and then remove it */
index e75b9599502a3843743802836a78c3926a74c05f..772287bdb4844035d340c384bb142ca33b5cbf08 100644 (file)
@@ -4,7 +4,7 @@
 #include "qapi/qmp/qlist.h"
 #include "qapi/qmp/qnum.h"
 #include "qapi/qmp/qbool.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 
 static char *get_cpu0_qom_path(void)
 {
index f599309a4a0d3b4d3d9abae8920b0eda20dd9cd5..f930a96b83e0412081a6dba94b0cf3ab8b8e0be8 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "qemu/osdep.h"
 
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "libqos/qgraph.h"
 #include "libqos/i2c.h"
 #include "qapi/qmp/qdict.h"
index a139caa51df17e48a171c2f7198eec3dcf6cb1cb..632fb7fbd86fa1dd9a078d913ee12199656da701 100644 (file)
@@ -15,7 +15,7 @@
 
 #include "hw/acpi/tpm.h"
 #include "io/channel-socket.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qemu/module.h"
 #include "tpm-emu.h"
 
index e640777aa9c261f65eb88d7364e04054747281e5..6e45a0ba852552fa269b69f57cb00873bd1f7407 100644 (file)
@@ -15,7 +15,7 @@
 #include "qemu/osdep.h"
 #include <glib/gstdio.h>
 
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "tpm-tests.h"
 
 static bool
index 92a7e95aad28a22c7005cbefa36fc0d8bcae830f..dcf30e05b74325e74be94e4a70bbe72171d370ac 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "hw/acpi/tpm.h"
 #include "io/channel-socket.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qemu/module.h"
 #include "tpm-emu.h"
 
index 0cd73b73639c33428168a74916370920e816149a..19d760f3fb2d00874e660f80c50553a83eae764f 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qemu/module.h"
 #include "libqos/usb.h"
 #include "libqos/qgraph.h"
index 2eef8e3d1c402671867a731307463c07c595fdaf..7a117b64d90c802ffeecd5cd092a196eac725a43 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "libqos/libqos.h"
 #include "libqos/usb.h"
 #include "libqos/libqos-pc.h"
index 01845371f97f3cab950a54465c51da84c34efa65..10ef9d2a91ad8bfab48d26a68c6ab2ad5a4cbefc 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "libqos/usb.h"
 
 
index 6ae8a23688a51809d8168809ed6af9da79629efd..91ea373ba5915c37216a36f0f7cc376e66c945fa 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "qemu/osdep.h"
 
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qapi/error.h"
 #include "qapi/qmp/qdict.h"
 #include "qemu/config-file.h"
index 30e6cf3e637c5e7b1b8edd0c2ca5c4b35682372e..e7b58e3a0c3c4ce373b8546e9916418f12ffca6f 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qemu/module.h"
 #include "hw/9pfs/9p.h"
 #include "hw/9pfs/9p-synth.h"
index 45375dc4ffeb5da03ec425f17827cd926115f50c..ed1316739275a56e6d8a7291968cfdfe6c6e77fd 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qemu/bswap.h"
 #include "qemu/module.h"
 #include "standard-headers/linux/virtio_blk.h"
index 9f445ef4adf458c624026b9c1fabd8e178dc5dd7..d05236407b0e5ef5a532f988b041e5afa550022f 100644 (file)
@@ -14,7 +14,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "libqos/virtio.h"
 
 static void virtio_balloon_nop(void)
index 840875aaae004d2e55c7312fed793e2e1bf29395..a08e2ffe123f89a3f6fdcfd2cd4e4993b6f525a5 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qemu/iov.h"
 #include "qemu/module.h"
 #include "qapi/qmp/qdict.h"
index 09348765d7303a2550136c8346e0840a07799308..7c8f9b27f8d6cf575adf6dbbedc59623d41c554d 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qemu/module.h"
 #include "scsi/constants.h"
 #include "libqos/libqos-pc.h"
index e584ad76e847a56ee51e4054aae372912b43d2c9..2541034822d89fba0102222634de2ed185274dde 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qemu/module.h"
 #include "libqos/virtio-serial.h"