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>
This commit is contained in:
Thomas Huth 2019-09-03 07:50:26 +02:00
parent 0ba67974af
commit dd21074972
33 changed files with 34 additions and 37 deletions

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

View File

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

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

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

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

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

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

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

View File

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

View File

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

View File

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

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

View File

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

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

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

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

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

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

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

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

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

View 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

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

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

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

View File

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

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

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

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

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

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

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

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