Browse Source

tests/libqtest: Use libqtest-single.h in tests that require global_qtest

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>
pull/106/head
Thomas Huth 7 years ago
parent
commit
dd21074972
  1. 2
      tests/cpu-plug-test.c
  2. 2
      tests/display-vga-test.c
  3. 2
      tests/e1000e-test.c
  4. 2
      tests/fdc-test.c
  5. 2
      tests/i440fx-test.c
  6. 2
      tests/i82801b11-test.c
  7. 2
      tests/intel-hda-test.c
  8. 2
      tests/ioh3420-test.c
  9. 3
      tests/ipmi-kcs-test.c
  10. 4
      tests/libqtest-single.h
  11. 2
      tests/libqtest.c
  12. 4
      tests/libqtest.h
  13. 2
      tests/m25p80-test.c
  14. 2
      tests/qos-test.c
  15. 2
      tests/rtc-test.c
  16. 2
      tests/rtl8139-test.c
  17. 2
      tests/test-arm-mptimer.c
  18. 2
      tests/test-netfilter.c
  19. 2
      tests/test-x86-cpuid-compat.c
  20. 2
      tests/tmp105-test.c
  21. 2
      tests/tpm-crb-test.c
  22. 2
      tests/tpm-tests.c
  23. 2
      tests/tpm-tis-test.c
  24. 2
      tests/usb-hcd-ohci-test.c
  25. 2
      tests/usb-hcd-uhci-test.c
  26. 2
      tests/usb-hcd-xhci-test.c
  27. 2
      tests/vhost-user-test.c
  28. 2
      tests/virtio-9p-test.c
  29. 2
      tests/virtio-blk-test.c
  30. 2
      tests/virtio-ccw-test.c
  31. 2
      tests/virtio-net-test.c
  32. 2
      tests/virtio-scsi-test.c
  33. 2
      tests/virtio-serial-test.c

2
tests/cpu-plug-test.c

@ -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 {

2
tests/display-vga-test.c

@ -8,7 +8,7 @@
*/
#include "qemu/osdep.h"
#include "libqtest.h"
#include "libqtest-single.h"
static void pci_cirrus(void)
{

2
tests/e1000e-test.c

@ -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"

2
tests/fdc-test.c

@ -25,7 +25,7 @@
#include "qemu/osdep.h"
#include "libqtest.h"
#include "libqtest-single.h"
#include "qapi/qmp/qdict.h"
#include "qemu-common.h"

2
tests/i440fx-test.c

@ -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"

2
tests/i82801b11-test.c

@ -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)

2
tests/intel-hda-test.c

@ -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" \

2
tests/ioh3420-test.c

@ -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)

3
tests/ipmi-kcs-test.c

@ -24,8 +24,7 @@
#include "qemu/osdep.h"
#include "libqtest.h"
#include "libqtest-single.h"
#define IPMI_IRQ 5

4
tests/libqtest-single.h

@ -11,6 +11,10 @@
#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

2
tests/libqtest.c

@ -35,8 +35,6 @@
#define SOCKET_TIMEOUT 50
#define SOCKET_MAX_FDS 16
QTestState *global_qtest;
struct QTestState
{
int fd;

4
tests/libqtest.h

@ -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);

2
tests/m25p80-test.c

@ -25,7 +25,7 @@
#include "qemu/osdep.h"
#include "qemu/bswap.h"
#include "libqtest.h"
#include "libqtest-single.h"
/*
* ASPEED SPI Controller registers

2
tests/qos-test.c

@ -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"

2
tests/rtc-test.c

@ -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"

2
tests/rtl8139-test.c

@ -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"

2
tests/test-arm-mptimer.c

@ -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)

2
tests/test-netfilter.c

@ -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 */

2
tests/test-x86-cpuid-compat.c

@ -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)
{

2
tests/tmp105-test.c

@ -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"

2
tests/tpm-crb-test.c

@ -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"

2
tests/tpm-tests.c

@ -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

2
tests/tpm-tis-test.c

@ -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"

2
tests/usb-hcd-ohci-test.c

@ -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"

2
tests/usb-hcd-uhci-test.c

@ -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"

2
tests/usb-hcd-xhci-test.c

@ -8,7 +8,7 @@
*/
#include "qemu/osdep.h"
#include "libqtest.h"
#include "libqtest-single.h"
#include "libqos/usb.h"

2
tests/vhost-user-test.c

@ -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"

2
tests/virtio-9p-test.c

@ -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"

2
tests/virtio-blk-test.c

@ -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"

2
tests/virtio-ccw-test.c

@ -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)

2
tests/virtio-net-test.c

@ -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"

2
tests/virtio-scsi-test.c

@ -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"

2
tests/virtio-serial-test.c

@ -8,7 +8,7 @@
*/
#include "qemu/osdep.h"
#include "libqtest.h"
#include "libqtest-single.h"
#include "qemu/module.h"
#include "libqos/virtio-serial.h"

Loading…
Cancel
Save