mirror of
https://github.com/qemu/qemu.git
synced 2024-11-28 22:33:36 +08:00
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:
parent
0ba67974af
commit
dd21074972
@ -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 {
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "libqtest.h"
|
||||
#include "libqtest-single.h"
|
||||
|
||||
static void pci_cirrus(void)
|
||||
{
|
||||
|
@ -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"
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
|
||||
|
||||
#include "libqtest.h"
|
||||
#include "libqtest-single.h"
|
||||
#include "qapi/qmp/qdict.h"
|
||||
#include "qemu-common.h"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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)
|
||||
|
@ -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" \
|
||||
|
@ -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)
|
||||
|
@ -24,8 +24,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
|
||||
|
||||
#include "libqtest.h"
|
||||
#include "libqtest-single.h"
|
||||
|
||||
#define IPMI_IRQ 5
|
||||
|
||||
|
@ -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
|
||||
|
@ -35,8 +35,6 @@
|
||||
#define SOCKET_TIMEOUT 50
|
||||
#define SOCKET_MAX_FDS 16
|
||||
|
||||
QTestState *global_qtest;
|
||||
|
||||
struct QTestState
|
||||
{
|
||||
int fd;
|
||||
|
@ -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);
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/bswap.h"
|
||||
#include "libqtest.h"
|
||||
#include "libqtest-single.h"
|
||||
|
||||
/*
|
||||
* ASPEED SPI Controller registers
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "libqtest.h"
|
||||
#include "libqtest-single.h"
|
||||
#include "libqos/usb.h"
|
||||
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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)
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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…
Reference in New Issue
Block a user