diff options
Diffstat (limited to 'tests/qtest/libqos')
70 files changed, 936 insertions, 141 deletions
diff --git a/tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c b/tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c index 8f827aeb52..79631cc7a9 100644 --- a/tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c +++ b/tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" +#include "malloc.h" +#include "qgraph.h" #include "sdhci.h" typedef struct QXlnxZCU102Machine QXlnxZCU102Machine; diff --git a/tests/qtest/libqos/ahci.c b/tests/qtest/libqos/ahci.c index cc1b08eabe..2946abc15a 100644 --- a/tests/qtest/libqos/ahci.c +++ b/tests/qtest/libqos/ahci.c @@ -25,8 +25,8 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/ahci.h" -#include "libqos/pci-pc.h" +#include "ahci.h" +#include "pci-pc.h" #include "qemu-common.h" #include "qemu/host-utils.h" @@ -579,7 +579,7 @@ void ahci_write_fis(AHCIQState *ahci, AHCICommand *cmd) /* NCQ commands use exclusively 8 bit fields and needs no adjustment. * Only the count field needs to be adjusted for non-NCQ commands. * The auxiliary FIS fields are defined per-command and are not currently - * implemented in libqos/ahci.o, but may or may not need to be flipped. */ + * implemented in ahci.o, but may or may not need to be flipped. */ if (!cmd->props->ncq) { tmp.count = cpu_to_le16(tmp.count); } diff --git a/tests/qtest/libqos/ahci.h b/tests/qtest/libqos/ahci.h index 44ab1104b5..88835b6228 100644 --- a/tests/qtest/libqos/ahci.h +++ b/tests/qtest/libqos/ahci.h @@ -25,9 +25,9 @@ * THE SOFTWARE. */ -#include "libqos/libqos.h" -#include "libqos/pci.h" -#include "libqos/malloc-pc.h" +#include "libqos.h" +#include "pci.h" +#include "malloc-pc.h" /*** Supplementary PCI Config Space IDs & Masks ***/ #define PCI_DEVICE_ID_INTEL_Q35_AHCI (0x2922) diff --git a/tests/qtest/libqos/arm-imx25-pdk-machine.c b/tests/qtest/libqos/arm-imx25-pdk-machine.c index 0da3f19c0e..6692adfa4f 100644 --- a/tests/qtest/libqos/arm-imx25-pdk-machine.c +++ b/tests/qtest/libqos/arm-imx25-pdk-machine.c @@ -20,9 +20,9 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" -#include "libqos/i2c.h" +#include "malloc.h" +#include "qgraph.h" +#include "i2c.h" #define ARM_PAGE_SIZE 4096 #define IMX25_PDK_RAM_START 0x80000000 diff --git a/tests/qtest/libqos/arm-n800-machine.c b/tests/qtest/libqos/arm-n800-machine.c index 35f82070fa..ff2049c3a7 100644 --- a/tests/qtest/libqos/arm-n800-machine.c +++ b/tests/qtest/libqos/arm-n800-machine.c @@ -20,9 +20,9 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" -#include "libqos/i2c.h" +#include "malloc.h" +#include "qgraph.h" +#include "i2c.h" #define ARM_PAGE_SIZE 4096 #define N800_RAM_START 0x80000000 diff --git a/tests/qtest/libqos/arm-raspi2-machine.c b/tests/qtest/libqos/arm-raspi2-machine.c index 8480d80669..35bb4709a4 100644 --- a/tests/qtest/libqos/arm-raspi2-machine.c +++ b/tests/qtest/libqos/arm-raspi2-machine.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" +#include "malloc.h" +#include "qgraph.h" #include "sdhci.h" #define ARM_PAGE_SIZE 4096 diff --git a/tests/qtest/libqos/arm-sabrelite-machine.c b/tests/qtest/libqos/arm-sabrelite-machine.c index f6e403b538..72425f0ad4 100644 --- a/tests/qtest/libqos/arm-sabrelite-machine.c +++ b/tests/qtest/libqos/arm-sabrelite-machine.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" +#include "malloc.h" +#include "qgraph.h" #include "sdhci.h" #define ARM_PAGE_SIZE 4096 diff --git a/tests/qtest/libqos/arm-smdkc210-machine.c b/tests/qtest/libqos/arm-smdkc210-machine.c index eebac7feeb..321b8826d4 100644 --- a/tests/qtest/libqos/arm-smdkc210-machine.c +++ b/tests/qtest/libqos/arm-smdkc210-machine.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" +#include "malloc.h" +#include "qgraph.h" #include "sdhci.h" #define ARM_PAGE_SIZE 4096 diff --git a/tests/qtest/libqos/arm-virt-machine.c b/tests/qtest/libqos/arm-virt-machine.c index 9316598f9e..e0f5932284 100644 --- a/tests/qtest/libqos/arm-virt-machine.c +++ b/tests/qtest/libqos/arm-virt-machine.c @@ -19,9 +19,9 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" -#include "libqos/virtio-mmio.h" +#include "malloc.h" +#include "qgraph.h" +#include "virtio-mmio.h" #define ARM_PAGE_SIZE 4096 #define VIRTIO_MMIO_BASE_ADDR 0x0A003E00 diff --git a/tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c b/tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c index 473acce993..56e53c745b 100644 --- a/tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c +++ b/tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" +#include "malloc.h" +#include "qgraph.h" #include "sdhci.h" typedef struct QXilinxZynqA9Machine QXilinxZynqA9Machine; diff --git a/tests/qtest/libqos/e1000e.c b/tests/qtest/libqos/e1000e.c index e2927ed2da..a451f6168f 100644 --- a/tests/qtest/libqos/e1000e.c +++ b/tests/qtest/libqos/e1000e.c @@ -18,13 +18,13 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/pci-pc.h" +#include "pci-pc.h" #include "qemu/sockets.h" #include "qemu/iov.h" #include "qemu/module.h" #include "qemu/bitops.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" +#include "malloc.h" +#include "qgraph.h" #include "e1000e.h" #define E1000E_IMS (0x00d0) diff --git a/tests/qtest/libqos/e1000e.h b/tests/qtest/libqos/e1000e.h index 35183b2875..a22f5fdbad 100644 --- a/tests/qtest/libqos/e1000e.h +++ b/tests/qtest/libqos/e1000e.h @@ -19,7 +19,7 @@ #ifndef QGRAPH_E1000E_H #define QGRAPH_E1000E_H -#include "libqos/qgraph.h" +#include "qgraph.h" #include "pci.h" #define E1000E_RX0_MSG_ID (0) diff --git a/tests/qtest/libqos/fw_cfg.c b/tests/qtest/libqos/fw_cfg.c index 1f46258f96..6b8e1babe5 100644 --- a/tests/qtest/libqos/fw_cfg.c +++ b/tests/qtest/libqos/fw_cfg.c @@ -13,7 +13,7 @@ */ #include "qemu/osdep.h" -#include "libqos/fw_cfg.h" +#include "fw_cfg.h" #include "libqtest.h" #include "qemu/bswap.h" #include "hw/nvram/fw_cfg.h" diff --git a/tests/qtest/libqos/i2c-imx.c b/tests/qtest/libqos/i2c-imx.c index f33ece55a3..8f9a7e3831 100644 --- a/tests/qtest/libqos/i2c-imx.c +++ b/tests/qtest/libqos/i2c-imx.c @@ -18,7 +18,7 @@ */ #include "qemu/osdep.h" -#include "libqos/i2c.h" +#include "i2c.h" #include "libqtest.h" diff --git a/tests/qtest/libqos/i2c-omap.c b/tests/qtest/libqos/i2c-omap.c index 9ae8214fa8..eb4e453485 100644 --- a/tests/qtest/libqos/i2c-omap.c +++ b/tests/qtest/libqos/i2c-omap.c @@ -7,7 +7,7 @@ * See the COPYING file in the top-level directory. */ #include "qemu/osdep.h" -#include "libqos/i2c.h" +#include "i2c.h" #include "qemu/bswap.h" diff --git a/tests/qtest/libqos/i2c.c b/tests/qtest/libqos/i2c.c index 38f800dbab..ade1bdb40e 100644 --- a/tests/qtest/libqos/i2c.c +++ b/tests/qtest/libqos/i2c.c @@ -7,7 +7,7 @@ * See the COPYING file in the top-level directory. */ #include "qemu/osdep.h" -#include "libqos/i2c.h" +#include "i2c.h" #include "libqtest.h" void qi2c_send(QI2CDevice *i2cdev, const uint8_t *buf, uint16_t len) diff --git a/tests/qtest/libqos/i2c.h b/tests/qtest/libqos/i2c.h index c65f087834..1341bac1c5 100644 --- a/tests/qtest/libqos/i2c.h +++ b/tests/qtest/libqos/i2c.h @@ -10,7 +10,7 @@ #define LIBQOS_I2C_H #include "libqtest.h" -#include "libqos/qgraph.h" +#include "qgraph.h" typedef struct I2CAdapter I2CAdapter; struct I2CAdapter { diff --git a/tests/qtest/libqos/libqos-pc.c b/tests/qtest/libqos/libqos-pc.c index d04abc548b..db420a596e 100644 --- a/tests/qtest/libqos/libqos-pc.c +++ b/tests/qtest/libqos/libqos-pc.c @@ -1,7 +1,7 @@ #include "qemu/osdep.h" -#include "libqos/libqos-pc.h" -#include "libqos/malloc-pc.h" -#include "libqos/pci-pc.h" +#include "libqos-pc.h" +#include "malloc-pc.h" +#include "pci-pc.h" static QOSOps qos_ops = { .alloc_init = pc_alloc_init, diff --git a/tests/qtest/libqos/libqos-pc.h b/tests/qtest/libqos/libqos-pc.h index a0e4c45516..1a9923ead4 100644 --- a/tests/qtest/libqos/libqos-pc.h +++ b/tests/qtest/libqos/libqos-pc.h @@ -1,7 +1,7 @@ #ifndef LIBQOS_PC_H #define LIBQOS_PC_H -#include "libqos/libqos.h" +#include "libqos.h" QOSState *qtest_pc_vboot(const char *cmdline_fmt, va_list ap); QOSState *qtest_pc_boot(const char *cmdline_fmt, ...); diff --git a/tests/qtest/libqos/libqos-spapr.c b/tests/qtest/libqos/libqos-spapr.c index 8766d543ce..db0e87ba5c 100644 --- a/tests/qtest/libqos/libqos-spapr.c +++ b/tests/qtest/libqos/libqos-spapr.c @@ -1,7 +1,7 @@ #include "qemu/osdep.h" -#include "libqos/libqos-spapr.h" -#include "libqos/malloc-spapr.h" -#include "libqos/pci-spapr.h" +#include "libqos-spapr.h" +#include "malloc-spapr.h" +#include "pci-spapr.h" static QOSOps qos_ops = { .alloc_init = spapr_alloc_init, diff --git a/tests/qtest/libqos/libqos-spapr.h b/tests/qtest/libqos/libqos-spapr.h index 49bd72d20b..c61338917a 100644 --- a/tests/qtest/libqos/libqos-spapr.h +++ b/tests/qtest/libqos/libqos-spapr.h @@ -1,7 +1,7 @@ #ifndef LIBQOS_SPAPR_H #define LIBQOS_SPAPR_H -#include "libqos/libqos.h" +#include "libqos.h" QOSState *qtest_spapr_vboot(const char *cmdline_fmt, va_list ap); QOSState *qtest_spapr_boot(const char *cmdline_fmt, ...); diff --git a/tests/qtest/libqos/libqos.c b/tests/qtest/libqos/libqos.c index f229eb2cb8..2251e864ef 100644 --- a/tests/qtest/libqos/libqos.c +++ b/tests/qtest/libqos/libqos.c @@ -2,8 +2,8 @@ #include <sys/wait.h> #include "libqtest.h" -#include "libqos/libqos.h" -#include "libqos/pci.h" +#include "libqos.h" +#include "pci.h" #include "qapi/qmp/qdict.h" /*** Test Setup & Teardown ***/ diff --git a/tests/qtest/libqos/libqos.h b/tests/qtest/libqos/libqos.h index 8e971c25a3..e0b2bfe7ca 100644 --- a/tests/qtest/libqos/libqos.h +++ b/tests/qtest/libqos/libqos.h @@ -2,8 +2,8 @@ #define LIBQOS_H #include "libqtest.h" -#include "libqos/pci.h" -#include "libqos/malloc.h" +#include "pci.h" +#include "malloc.h" typedef struct QOSState QOSState; diff --git a/tests/qtest/libqos/libqtest.h b/tests/qtest/libqos/libqtest.h new file mode 100644 index 0000000000..f5cf93c386 --- /dev/null +++ b/tests/qtest/libqos/libqtest.h @@ -0,0 +1,736 @@ +/* + * QTest + * + * Copyright IBM, Corp. 2012 + * Copyright Red Hat, Inc. 2012 + * Copyright SUSE LINUX Products GmbH 2013 + * + * Authors: + * Anthony Liguori <aliguori@us.ibm.com> + * Paolo Bonzini <pbonzini@redhat.com> + * Andreas Färber <afaerber@suse.de> + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ +#ifndef LIBQTEST_H +#define LIBQTEST_H + +#include "qapi/qmp/qobject.h" +#include "qapi/qmp/qdict.h" + +typedef struct QTestState QTestState; + +/** + * qtest_initf: + * @fmt...: Format for creating other arguments to pass to QEMU, formatted + * like sprintf(). + * + * Convenience wrapper around qtest_init(). + * + * Returns: #QTestState instance. + */ +QTestState *qtest_initf(const char *fmt, ...) GCC_FMT_ATTR(1, 2); + +/** + * qtest_vinitf: + * @fmt: Format for creating other arguments to pass to QEMU, formatted + * like vsprintf(). + * @ap: Format arguments. + * + * Convenience wrapper around qtest_init(). + * + * Returns: #QTestState instance. + */ +QTestState *qtest_vinitf(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); + +/** + * qtest_init: + * @extra_args: other arguments to pass to QEMU. CAUTION: these + * arguments are subject to word splitting and shell evaluation. + * + * Returns: #QTestState instance. + */ +QTestState *qtest_init(const char *extra_args); + +/** + * qtest_init_without_qmp_handshake: + * @extra_args: other arguments to pass to QEMU. CAUTION: these + * arguments are subject to word splitting and shell evaluation. + * + * Returns: #QTestState instance. + */ +QTestState *qtest_init_without_qmp_handshake(const char *extra_args); + +/** + * qtest_init_with_serial: + * @extra_args: other arguments to pass to QEMU. CAUTION: these + * arguments are subject to word splitting and shell evaluation. + * @sock_fd: pointer to store the socket file descriptor for + * connection with serial. + * + * Returns: #QTestState instance. + */ +QTestState *qtest_init_with_serial(const char *extra_args, int *sock_fd); + +/** + * qtest_quit: + * @s: #QTestState instance to operate on. + * + * Shut down the QEMU process associated to @s. + */ +void qtest_quit(QTestState *s); + +/** + * qtest_qmp_fds: + * @s: #QTestState instance to operate on. + * @fds: array of file descriptors + * @fds_num: number of elements in @fds + * @fmt...: QMP message to send to qemu, formatted like + * qobject_from_jsonf_nofail(). See parse_escape() for what's + * supported after '%'. + * + * Sends a QMP message to QEMU with fds and returns the response. + */ +QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fds_num, + const char *fmt, ...) + GCC_FMT_ATTR(4, 5); + +/** + * qtest_qmp: + * @s: #QTestState instance to operate on. + * @fmt...: QMP message to send to qemu, formatted like + * qobject_from_jsonf_nofail(). See parse_escape() for what's + * supported after '%'. + * + * Sends a QMP message to QEMU and returns the response. + */ +QDict *qtest_qmp(QTestState *s, const char *fmt, ...) + GCC_FMT_ATTR(2, 3); + +/** + * qtest_qmp_send: + * @s: #QTestState instance to operate on. + * @fmt...: QMP message to send to qemu, formatted like + * qobject_from_jsonf_nofail(). See parse_escape() for what's + * supported after '%'. + * + * Sends a QMP message to QEMU and leaves the response in the stream. + */ +void qtest_qmp_send(QTestState *s, const char *fmt, ...) + GCC_FMT_ATTR(2, 3); + +/** + * qtest_qmp_send_raw: + * @s: #QTestState instance to operate on. + * @fmt...: text to send, formatted like sprintf() + * + * Sends text to the QMP monitor verbatim. Need not be valid JSON; + * this is useful for negative tests. + */ +void qtest_qmp_send_raw(QTestState *s, const char *fmt, ...) + GCC_FMT_ATTR(2, 3); + +/** + * qtest_vqmp_fds: + * @s: #QTestState instance to operate on. + * @fds: array of file descriptors + * @fds_num: number of elements in @fds + * @fmt: QMP message to send to QEMU, formatted like + * qobject_from_jsonf_nofail(). See parse_escape() for what's + * supported after '%'. + * @ap: QMP message arguments + * + * Sends a QMP message to QEMU with fds and returns the response. + */ +QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num, + const char *fmt, va_list ap) + GCC_FMT_ATTR(4, 0); + +/** + * qtest_vqmp: + * @s: #QTestState instance to operate on. + * @fmt: QMP message to send to QEMU, formatted like + * qobject_from_jsonf_nofail(). See parse_escape() for what's + * supported after '%'. + * @ap: QMP message arguments + * + * Sends a QMP message to QEMU and returns the response. + */ +QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap) + GCC_FMT_ATTR(2, 0); + +/** + * qtest_qmp_vsend_fds: + * @s: #QTestState instance to operate on. + * @fds: array of file descriptors + * @fds_num: number of elements in @fds + * @fmt: QMP message to send to QEMU, formatted like + * qobject_from_jsonf_nofail(). See parse_escape() for what's + * supported after '%'. + * @ap: QMP message arguments + * + * Sends a QMP message to QEMU and leaves the response in the stream. + */ +void qtest_qmp_vsend_fds(QTestState *s, int *fds, size_t fds_num, + const char *fmt, va_list ap) + GCC_FMT_ATTR(4, 0); + +/** + * qtest_qmp_vsend: + * @s: #QTestState instance to operate on. + * @fmt: QMP message to send to QEMU, formatted like + * qobject_from_jsonf_nofail(). See parse_escape() for what's + * supported after '%'. + * @ap: QMP message arguments + * + * Sends a QMP message to QEMU and leaves the response in the stream. + */ +void qtest_qmp_vsend(QTestState *s, const char *fmt, va_list ap) + GCC_FMT_ATTR(2, 0); + +/** + * qtest_receive: + * @s: #QTestState instance to operate on. + * + * Reads a QMP message from QEMU and returns the response. + */ +QDict *qtest_qmp_receive(QTestState *s); + +/** + * qtest_qmp_eventwait: + * @s: #QTestState instance to operate on. + * @s: #event event to wait for. + * + * Continuously polls for QMP responses until it receives the desired event. + */ +void qtest_qmp_eventwait(QTestState *s, const char *event); + +/** + * qtest_qmp_eventwait_ref: + * @s: #QTestState instance to operate on. + * @s: #event event to wait for. + * + * Continuously polls for QMP responses until it receives the desired event. + * Returns a copy of the event for further investigation. + */ +QDict *qtest_qmp_eventwait_ref(QTestState *s, const char *event); + +/** + * qtest_qmp_receive_success: + * @s: #QTestState instance to operate on + * @event_cb: Event callback + * @opaque: Argument for @event_cb + * + * Poll QMP messages until a command success response is received. + * If @event_cb, call it for each event received, passing @opaque, + * the event's name and data. + * Return the success response's "return" member. + */ +QDict *qtest_qmp_receive_success(QTestState *s, + void (*event_cb)(void *opaque, + const char *name, + QDict *data), + void *opaque); + +/** + * qtest_hmp: + * @s: #QTestState instance to operate on. + * @fmt...: HMP command to send to QEMU, formats arguments like sprintf(). + * + * Send HMP command to QEMU via QMP's human-monitor-command. + * QMP events are discarded. + * + * Returns: the command's output. The caller should g_free() it. + */ +char *qtest_hmp(QTestState *s, const char *fmt, ...) GCC_FMT_ATTR(2, 3); + +/** + * qtest_hmpv: + * @s: #QTestState instance to operate on. + * @fmt: HMP command to send to QEMU, formats arguments like vsprintf(). + * @ap: HMP command arguments + * + * Send HMP command to QEMU via QMP's human-monitor-command. + * QMP events are discarded. + * + * Returns: the command's output. The caller should g_free() it. + */ +char *qtest_vhmp(QTestState *s, const char *fmt, va_list ap) + GCC_FMT_ATTR(2, 0); + +void qtest_module_load(QTestState *s, const char *prefix, const char *libname); + +/** + * qtest_get_irq: + * @s: #QTestState instance to operate on. + * @num: Interrupt to observe. + * + * Returns: The level of the @num interrupt. + */ +bool qtest_get_irq(QTestState *s, int num); + +/** + * qtest_irq_intercept_in: + * @s: #QTestState instance to operate on. + * @string: QOM path of a device. + * + * Associate qtest irqs with the GPIO-in pins of the device + * whose path is specified by @string. + */ +void qtest_irq_intercept_in(QTestState *s, const char *string); + +/** + * qtest_irq_intercept_out: + * @s: #QTestState instance to operate on. + * @string: QOM path of a device. + * + * Associate qtest irqs with the GPIO-out pins of the device + * whose path is specified by @string. + */ +void qtest_irq_intercept_out(QTestState *s, const char *string); + +/** + * qtest_set_irq_in: + * @s: QTestState instance to operate on. + * @string: QOM path of a device + * @name: IRQ name + * @irq: IRQ number + * @level: IRQ level + * + * Force given device/irq GPIO-in pin to the given level. + */ +void qtest_set_irq_in(QTestState *s, const char *string, const char *name, + int irq, int level); + +/** + * qtest_outb: + * @s: #QTestState instance to operate on. + * @addr: I/O port to write to. + * @value: Value being written. + * + * Write an 8-bit value to an I/O port. + */ +void qtest_outb(QTestState *s, uint16_t addr, uint8_t value); + +/** + * qtest_outw: + * @s: #QTestState instance to operate on. + * @addr: I/O port to write to. + * @value: Value being written. + * + * Write a 16-bit value to an I/O port. + */ +void qtest_outw(QTestState *s, uint16_t addr, uint16_t value); + +/** + * qtest_outl: + * @s: #QTestState instance to operate on. + * @addr: I/O port to write to. + * @value: Value being written. + * + * Write a 32-bit value to an I/O port. + */ +void qtest_outl(QTestState *s, uint16_t addr, uint32_t value); + +/** + * qtest_inb: + * @s: #QTestState instance to operate on. + * @addr: I/O port to read from. + * + * Returns an 8-bit value from an I/O port. + */ +uint8_t qtest_inb(QTestState *s, uint16_t addr); + +/** + * qtest_inw: + * @s: #QTestState instance to operate on. + * @addr: I/O port to read from. + * + * Returns a 16-bit value from an I/O port. + */ +uint16_t qtest_inw(QTestState *s, uint16_t addr); + +/** + * qtest_inl: + * @s: #QTestState instance to operate on. + * @addr: I/O port to read from. + * + * Returns a 32-bit value from an I/O port. + */ +uint32_t qtest_inl(QTestState *s, uint16_t addr); + +/** + * qtest_writeb: + * @s: #QTestState instance to operate on. + * @addr: Guest address to write to. + * @value: Value being written. + * + * Writes an 8-bit value to memory. + */ +void qtest_writeb(QTestState *s, uint64_t addr, uint8_t value); + +/** + * qtest_writew: + * @s: #QTestState instance to operate on. + * @addr: Guest address to write to. + * @value: Value being written. + * + * Writes a 16-bit value to memory. + */ +void qtest_writew(QTestState *s, uint64_t addr, uint16_t value); + +/** + * qtest_writel: + * @s: #QTestState instance to operate on. + * @addr: Guest address to write to. + * @value: Value being written. + * + * Writes a 32-bit value to memory. + */ +void qtest_writel(QTestState *s, uint64_t addr, uint32_t value); + +/** + * qtest_writeq: + * @s: #QTestState instance to operate on. + * @addr: Guest address to write to. + * @value: Value being written. + * + * Writes a 64-bit value to memory. + */ +void qtest_writeq(QTestState *s, uint64_t addr, uint64_t value); + +/** + * qtest_readb: + * @s: #QTestState instance to operate on. + * @addr: Guest address to read from. + * + * Reads an 8-bit value from memory. + * + * Returns: Value read. + */ +uint8_t qtest_readb(QTestState *s, uint64_t addr); + +/** + * qtest_readw: + * @s: #QTestState instance to operate on. + * @addr: Guest address to read from. + * + * Reads a 16-bit value from memory. + * + * Returns: Value read. + */ +uint16_t qtest_readw(QTestState *s, uint64_t addr); + +/** + * qtest_readl: + * @s: #QTestState instance to operate on. + * @addr: Guest address to read from. + * + * Reads a 32-bit value from memory. + * + * Returns: Value read. + */ +uint32_t qtest_readl(QTestState *s, uint64_t addr); + +/** + * qtest_readq: + * @s: #QTestState instance to operate on. + * @addr: Guest address to read from. + * + * Reads a 64-bit value from memory. + * + * Returns: Value read. + */ +uint64_t qtest_readq(QTestState *s, uint64_t addr); + +/** + * qtest_memread: + * @s: #QTestState instance to operate on. + * @addr: Guest address to read from. + * @data: Pointer to where memory contents will be stored. + * @size: Number of bytes to read. + * + * Read guest memory into a buffer. + */ +void qtest_memread(QTestState *s, uint64_t addr, void *data, size_t size); + +/** + * qtest_rtas_call: + * @s: #QTestState instance to operate on. + * @name: name of the command to call. + * @nargs: Number of args. + * @args: Guest address to read args from. + * @nret: Number of return value. + * @ret: Guest address to write return values to. + * + * Call an RTAS function + */ +uint64_t qtest_rtas_call(QTestState *s, const char *name, + uint32_t nargs, uint64_t args, + uint32_t nret, uint64_t ret); + +/** + * qtest_bufread: + * @s: #QTestState instance to operate on. + * @addr: Guest address to read from. + * @data: Pointer to where memory contents will be stored. + * @size: Number of bytes to read. + * + * Read guest memory into a buffer and receive using a base64 encoding. + */ +void qtest_bufread(QTestState *s, uint64_t addr, void *data, size_t size); + +/** + * qtest_memwrite: + * @s: #QTestState instance to operate on. + * @addr: Guest address to write to. + * @data: Pointer to the bytes that will be written to guest memory. + * @size: Number of bytes to write. + * + * Write a buffer to guest memory. + */ +void qtest_memwrite(QTestState *s, uint64_t addr, const void *data, size_t size); + +/** + * qtest_bufwrite: + * @s: #QTestState instance to operate on. + * @addr: Guest address to write to. + * @data: Pointer to the bytes that will be written to guest memory. + * @size: Number of bytes to write. + * + * Write a buffer to guest memory and transmit using a base64 encoding. + */ +void qtest_bufwrite(QTestState *s, uint64_t addr, + const void *data, size_t size); + +/** + * qtest_memset: + * @s: #QTestState instance to operate on. + * @addr: Guest address to write to. + * @patt: Byte pattern to fill the guest memory region with. + * @size: Number of bytes to write. + * + * Write a pattern to guest memory. + */ +void qtest_memset(QTestState *s, uint64_t addr, uint8_t patt, size_t size); + +/** + * qtest_clock_step_next: + * @s: #QTestState instance to operate on. + * + * Advance the QEMU_CLOCK_VIRTUAL to the next deadline. + * + * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds. + */ +int64_t qtest_clock_step_next(QTestState *s); + +/** + * qtest_clock_step: + * @s: QTestState instance to operate on. + * @step: Number of nanoseconds to advance the clock by. + * + * Advance the QEMU_CLOCK_VIRTUAL by @step nanoseconds. + * + * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds. + */ +int64_t qtest_clock_step(QTestState *s, int64_t step); + +/** + * qtest_clock_set: + * @s: QTestState instance to operate on. + * @val: Nanoseconds value to advance the clock to. + * + * Advance the QEMU_CLOCK_VIRTUAL to @val nanoseconds since the VM was launched. + * + * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds. + */ +int64_t qtest_clock_set(QTestState *s, int64_t val); + +/** + * qtest_big_endian: + * @s: QTestState instance to operate on. + * + * Returns: True if the architecture under test has a big endian configuration. + */ +bool qtest_big_endian(QTestState *s); + +/** + * qtest_get_arch: + * + * Returns: The architecture for the QEMU executable under test. + */ +const char *qtest_get_arch(void); + +/** + * qtest_add_func: + * @str: Test case path. + * @fn: Test case function + * + * Add a GTester testcase with the given name and function. + * The path is prefixed with the architecture under test, as + * returned by qtest_get_arch(). + */ +void qtest_add_func(const char *str, void (*fn)(void)); + +/** + * qtest_add_data_func: + * @str: Test case path. + * @data: Test case data + * @fn: Test case function + * + * Add a GTester testcase with the given name, data and function. + * The path is prefixed with the architecture under test, as + * returned by qtest_get_arch(). + */ +void qtest_add_data_func(const char *str, const void *data, + void (*fn)(const void *)); + +/** + * qtest_add_data_func_full: + * @str: Test case path. + * @data: Test case data + * @fn: Test case function + * @data_free_func: GDestroyNotify for data + * + * Add a GTester testcase with the given name, data and function. + * The path is prefixed with the architecture under test, as + * returned by qtest_get_arch(). + * + * @data is passed to @data_free_func() on test completion. + */ +void qtest_add_data_func_full(const char *str, void *data, + void (*fn)(const void *), + GDestroyNotify data_free_func); + +/** + * qtest_add: + * @testpath: Test case path + * @Fixture: Fixture type + * @tdata: Test case data + * @fsetup: Test case setup function + * @ftest: Test case function + * @fteardown: Test case teardown function + * + * Add a GTester testcase with the given name, data and functions. + * The path is prefixed with the architecture under test, as + * returned by qtest_get_arch(). + */ +#define qtest_add(testpath, Fixture, tdata, fsetup, ftest, fteardown) \ + do { \ + char *path = g_strdup_printf("/%s/%s", qtest_get_arch(), testpath); \ + g_test_add(path, Fixture, tdata, fsetup, ftest, fteardown); \ + g_free(path); \ + } while (0) + +void qtest_add_abrt_handler(GHookFunc fn, const void *data); + +/** + * qtest_qmp_assert_success: + * @qts: QTestState instance to operate on + * @fmt...: QMP message to send to qemu, formatted like + * qobject_from_jsonf_nofail(). See parse_escape() for what's + * supported after '%'. + * + * Sends a QMP message to QEMU and asserts that a 'return' key is present in + * the response. + */ +void qtest_qmp_assert_success(QTestState *qts, const char *fmt, ...) + GCC_FMT_ATTR(2, 3); + +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); +void qmp_fd_vsend(int fd, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0); +void qmp_fd_send(int fd, const char *fmt, ...) GCC_FMT_ATTR(2, 3); +void qmp_fd_send_raw(int fd, const char *fmt, ...) GCC_FMT_ATTR(2, 3); +void qmp_fd_vsend_raw(int fd, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0); +QDict *qmp_fdv(int fd, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0); +QDict *qmp_fd(int fd, const char *fmt, ...) GCC_FMT_ATTR(2, 3); + +/** + * qtest_cb_for_every_machine: + * @cb: Pointer to the callback function + * @skip_old_versioned: true if versioned old machine types should be skipped + * + * Call a callback function for every name of all available machines. + */ +void qtest_cb_for_every_machine(void (*cb)(const char *machine), + bool skip_old_versioned); + +/** + * qtest_qmp_device_add_qdict: + * @qts: QTestState instance to operate on + * @drv: Name of the device that should be added + * @arguments: QDict with properties for the device to intialize + * + * Generic hot-plugging test via the device_add QMP command with properties + * supplied in form of QDict. Use NULL for empty properties list. + */ +void qtest_qmp_device_add_qdict(QTestState *qts, const char *drv, + const QDict *arguments); + +/** + * qtest_qmp_device_add: + * @qts: QTestState instance to operate on + * @driver: Name of the device that should be added + * @id: Identification string + * @fmt...: QMP message to send to qemu, formatted like + * qobject_from_jsonf_nofail(). See parse_escape() for what's + * supported after '%'. + * + * Generic hot-plugging test via the device_add QMP command. + */ +void qtest_qmp_device_add(QTestState *qts, const char *driver, const char *id, + const char *fmt, ...) GCC_FMT_ATTR(4, 5); + +/** + * qtest_qmp_device_del: + * @qts: QTestState instance to operate on + * @id: Identification string + * + * Generic hot-unplugging test via the device_del QMP command. + */ +void qtest_qmp_device_del(QTestState *qts, const char *id); + +/** + * qmp_rsp_is_err: + * @rsp: QMP response to check for error + * + * Test @rsp for error and discard @rsp. + * Returns 'true' if there is error in @rsp and 'false' otherwise. + */ +bool qmp_rsp_is_err(QDict *rsp); + +/** + * qmp_assert_error_class: + * @rsp: QMP response to check for error + * @class: an error class + * + * Assert the response has the given error class and discard @rsp. + */ +void qmp_assert_error_class(QDict *rsp, const char *class); + +/** + * qtest_probe_child: + * @s: QTestState instance to operate on. + * + * Returns: true if the child is still alive. + */ +bool qtest_probe_child(QTestState *s); + +/** + * qtest_set_expected_status: + * @s: QTestState instance to operate on. + * @status: an expected exit status. + * + * Set expected exit status of the child. + */ +void qtest_set_expected_status(QTestState *s, int status); + +QTestState *qtest_inproc_init(QTestState **s, bool log, const char* arch, + void (*send)(void*, const char*)); + +void qtest_client_inproc_recv(void *opaque, const char *str); +#endif diff --git a/tests/qtest/libqos/malloc-pc.c b/tests/qtest/libqos/malloc-pc.c index 6f92ce4135..16ff9609cc 100644 --- a/tests/qtest/libqos/malloc-pc.c +++ b/tests/qtest/libqos/malloc-pc.c @@ -11,8 +11,8 @@ */ #include "qemu/osdep.h" -#include "libqos/malloc-pc.h" -#include "libqos/fw_cfg.h" +#include "malloc-pc.h" +#include "fw_cfg.h" #include "standard-headers/linux/qemu_fw_cfg.h" diff --git a/tests/qtest/libqos/malloc-pc.h b/tests/qtest/libqos/malloc-pc.h index 21e75ae004..d8d79853c8 100644 --- a/tests/qtest/libqos/malloc-pc.h +++ b/tests/qtest/libqos/malloc-pc.h @@ -13,7 +13,7 @@ #ifndef LIBQOS_MALLOC_PC_H #define LIBQOS_MALLOC_PC_H -#include "libqos/malloc.h" +#include "malloc.h" void pc_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags); diff --git a/tests/qtest/libqos/malloc-spapr.c b/tests/qtest/libqos/malloc-spapr.c index 2a6b7e3776..84862e4876 100644 --- a/tests/qtest/libqos/malloc-spapr.c +++ b/tests/qtest/libqos/malloc-spapr.c @@ -6,7 +6,7 @@ */ #include "qemu/osdep.h" -#include "libqos/malloc-spapr.h" +#include "malloc-spapr.h" #include "qemu-common.h" diff --git a/tests/qtest/libqos/malloc-spapr.h b/tests/qtest/libqos/malloc-spapr.h index e5fe9bfc4b..f99572fd71 100644 --- a/tests/qtest/libqos/malloc-spapr.h +++ b/tests/qtest/libqos/malloc-spapr.h @@ -8,7 +8,7 @@ #ifndef LIBQOS_MALLOC_SPAPR_H #define LIBQOS_MALLOC_SPAPR_H -#include "libqos/malloc.h" +#include "malloc.h" void spapr_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags); diff --git a/tests/qtest/libqos/malloc.c b/tests/qtest/libqos/malloc.c index 615422a5c4..f708b01432 100644 --- a/tests/qtest/libqos/malloc.c +++ b/tests/qtest/libqos/malloc.c @@ -11,7 +11,7 @@ */ #include "qemu/osdep.h" -#include "libqos/malloc.h" +#include "malloc.h" #include "qemu-common.h" #include "qemu/host-utils.h" diff --git a/tests/qtest/libqos/meson.build b/tests/qtest/libqos/meson.build new file mode 100644 index 0000000000..19931b9248 --- /dev/null +++ b/tests/qtest/libqos/meson.build @@ -0,0 +1,57 @@ +libqos = static_library('qos', + files('../libqtest.c', + 'qgraph.c', + 'qos_external.c', + 'pci.c', + 'fw_cfg.c', + 'malloc.c', + 'libqos.c', + + # spapr + 'malloc-spapr.c', + 'libqos-spapr.c', + 'rtas.c', + 'pci-spapr.c', + + # pc + 'pci-pc.c', + 'malloc-pc.c', + 'libqos-pc.c', + 'ahci.c', + + # usb + 'usb.c', + + # qgraph devices: + 'e1000e.c', + 'i2c.c', + 'i2c-imx.c', + 'i2c-omap.c', + 'sdhci.c', + 'tpci200.c', + 'virtio.c', + 'virtio-9p.c', + 'virtio-balloon.c', + 'virtio-blk.c', + 'virtio-mmio.c', + 'virtio-net.c', + 'virtio-pci.c', + 'virtio-pci-modern.c', + 'virtio-rng.c', + 'virtio-scsi.c', + 'virtio-serial.c', + + # qgraph machines: + 'aarch64-xlnx-zcu102-machine.c', + 'arm-imx25-pdk-machine.c', + 'arm-n800-machine.c', + 'arm-raspi2-machine.c', + 'arm-sabrelite-machine.c', + 'arm-smdkc210-machine.c', + 'arm-virt-machine.c', + 'arm-xilinx-zynq-a9-machine.c', + 'ppc64_pseries-machine.c', + 'x86_64_pc-machine.c', +), build_by_default: false) + +qos = declare_dependency(link_whole: libqos) diff --git a/tests/qtest/libqos/pci-pc.c b/tests/qtest/libqos/pci-pc.c index 3bb2eb3ba8..f97844289f 100644 --- a/tests/qtest/libqos/pci-pc.c +++ b/tests/qtest/libqos/pci-pc.c @@ -12,7 +12,7 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/pci-pc.h" +#include "pci-pc.h" #include "qapi/qmp/qdict.h" #include "hw/pci/pci_regs.h" diff --git a/tests/qtest/libqos/pci-pc.h b/tests/qtest/libqos/pci-pc.h index 4690005232..49ec9507f2 100644 --- a/tests/qtest/libqos/pci-pc.h +++ b/tests/qtest/libqos/pci-pc.h @@ -13,9 +13,9 @@ #ifndef LIBQOS_PCI_PC_H #define LIBQOS_PCI_PC_H -#include "libqos/pci.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" +#include "pci.h" +#include "malloc.h" +#include "qgraph.h" typedef struct QPCIBusPC { QOSGraphObject obj; diff --git a/tests/qtest/libqos/pci-spapr.c b/tests/qtest/libqos/pci-spapr.c index d6f8c01cb7..262226985f 100644 --- a/tests/qtest/libqos/pci-spapr.c +++ b/tests/qtest/libqos/pci-spapr.c @@ -7,9 +7,9 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/pci-spapr.h" -#include "libqos/rtas.h" -#include "libqos/qgraph.h" +#include "pci-spapr.h" +#include "rtas.h" +#include "qgraph.h" #include "hw/pci/pci_regs.h" diff --git a/tests/qtest/libqos/pci-spapr.h b/tests/qtest/libqos/pci-spapr.h index d9e25631c6..20a43718b7 100644 --- a/tests/qtest/libqos/pci-spapr.h +++ b/tests/qtest/libqos/pci-spapr.h @@ -8,9 +8,9 @@ #ifndef LIBQOS_PCI_SPAPR_H #define LIBQOS_PCI_SPAPR_H -#include "libqos/malloc.h" -#include "libqos/pci.h" -#include "libqos/qgraph.h" +#include "malloc.h" +#include "pci.h" +#include "qgraph.h" /* From include/hw/pci-host/spapr.h */ diff --git a/tests/qtest/libqos/pci.c b/tests/qtest/libqos/pci.c index 2309a724e4..e1e96189c8 100644 --- a/tests/qtest/libqos/pci.c +++ b/tests/qtest/libqos/pci.c @@ -11,11 +11,11 @@ */ #include "qemu/osdep.h" -#include "libqos/pci.h" +#include "pci.h" #include "hw/pci/pci_regs.h" #include "qemu/host-utils.h" -#include "libqos/qgraph.h" +#include "qgraph.h" void qpci_device_foreach(QPCIBus *bus, int vendor_id, int device_id, void (*func)(QPCIDevice *dev, int devfn, void *data), diff --git a/tests/qtest/libqos/pci.h b/tests/qtest/libqos/pci.h index 590c175190..ee64fdecbd 100644 --- a/tests/qtest/libqos/pci.h +++ b/tests/qtest/libqos/pci.h @@ -14,7 +14,7 @@ #define LIBQOS_PCI_H #include "libqtest.h" -#include "libqos/qgraph.h" +#include "qgraph.h" #define QPCI_PIO_LIMIT 0x10000 diff --git a/tests/qtest/libqos/ppc64_pseries-machine.c b/tests/qtest/libqos/ppc64_pseries-machine.c index 5d7bd88f2f..24ca179976 100644 --- a/tests/qtest/libqos/ppc64_pseries-machine.c +++ b/tests/qtest/libqos/ppc64_pseries-machine.c @@ -18,10 +18,10 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/qgraph.h" +#include "qgraph.h" #include "pci-spapr.h" #include "qemu/module.h" -#include "libqos/malloc-spapr.h" +#include "malloc-spapr.h" typedef struct QSPAPR_pci_host QSPAPR_pci_host; typedef struct Qppc64_pseriesMachine Qppc64_pseriesMachine; diff --git a/tests/qtest/libqos/qgraph.c b/tests/qtest/libqos/qgraph.c index eb0af8ab4a..fc49cfa879 100644 --- a/tests/qtest/libqos/qgraph.c +++ b/tests/qtest/libqos/qgraph.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/queue.h" -#include "libqos/qgraph_internal.h" -#include "libqos/qgraph.h" +#include "qgraph_internal.h" +#include "qgraph.h" #define QGRAPH_PRINT_DEBUG 0 #define QOS_ROOT "" diff --git a/tests/qtest/libqos/qgraph.h b/tests/qtest/libqos/qgraph.h index db1244eb59..10543269ce 100644 --- a/tests/qtest/libqos/qgraph.h +++ b/tests/qtest/libqos/qgraph.h @@ -106,7 +106,7 @@ typedef void *(*QOSBeforeTest) (GString *cmd_line, void *arg); * <example> * <title>Creating new driver an its interface</title> * <programlisting> - #include "libqos/qgraph.h" + #include "qgraph.h" struct My_driver { QOSGraphObject obj; @@ -190,7 +190,7 @@ typedef void *(*QOSBeforeTest) (GString *cmd_line, void *arg); * <example> * <title>Creating new test</title> * <programlisting> - * #include "libqos/qgraph.h" + * #include "qgraph.h" * * static void my_test_function(void *obj, void *data) * { @@ -230,7 +230,7 @@ typedef void *(*QOSBeforeTest) (GString *cmd_line, void *arg); * a valid test path will be: * "/x86_64/pc/other_node/my_driver/my_interface/my_test". * - * Additional examples are also in libqos/test-qgraph.c + * Additional examples are also in test-qgraph.c * * Command line: * Command line is built by using node names and optional arguments diff --git a/tests/qtest/libqos/qgraph_internal.h b/tests/qtest/libqos/qgraph_internal.h index aa3123f0f2..968fa69450 100644 --- a/tests/qtest/libqos/qgraph_internal.h +++ b/tests/qtest/libqos/qgraph_internal.h @@ -20,11 +20,11 @@ #define QGRAPH_INTERNAL_H /* This header is declaring additional helper functions defined in - * libqos/qgraph.c + * qgraph.c * It should not be included in tests */ -#include "libqos/qgraph.h" +#include "qgraph.h" typedef struct QOSGraphMachine QOSGraphMachine; typedef enum QOSEdgeType QOSEdgeType; diff --git a/tests/qtest/libqos/qos_external.c b/tests/qtest/libqos/qos_external.c index 0dfc05cfb6..10ee0f75b2 100644 --- a/tests/qtest/libqos/qos_external.c +++ b/tests/qtest/libqos/qos_external.c @@ -24,10 +24,10 @@ #include "qapi/qmp/qstring.h" #include "qemu/module.h" #include "qapi/qmp/qlist.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" -#include "libqos/qgraph_internal.h" -#include "libqos/qos_external.h" +#include "malloc.h" +#include "qgraph.h" +#include "qgraph_internal.h" +#include "qos_external.h" static void machine_apply_to_node(const char *name) { diff --git a/tests/qtest/libqos/qos_external.h b/tests/qtest/libqos/qos_external.h index 56a2f37fde..8446e3df0b 100644 --- a/tests/qtest/libqos/qos_external.h +++ b/tests/qtest/libqos/qos_external.h @@ -19,7 +19,9 @@ #ifndef QOS_EXTERNAL_H #define QOS_EXTERNAL_H -#include "libqos/malloc.h" +#include "qgraph.h" + +#include "malloc.h" #include "qapi/qapi-types-machine.h" #include "qapi/qapi-types-qom.h" diff --git a/tests/qtest/libqos/rtas.c b/tests/qtest/libqos/rtas.c index d81ff4274d..db29d5554d 100644 --- a/tests/qtest/libqos/rtas.c +++ b/tests/qtest/libqos/rtas.c @@ -5,7 +5,7 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/rtas.h" +#include "rtas.h" static void qrtas_copy_args(QTestState *qts, uint64_t target_args, uint32_t nargs, uint32_t *args) diff --git a/tests/qtest/libqos/rtas.h b/tests/qtest/libqos/rtas.h index 459e23aaf4..f38f99dfab 100644 --- a/tests/qtest/libqos/rtas.h +++ b/tests/qtest/libqos/rtas.h @@ -5,7 +5,7 @@ #ifndef LIBQOS_RTAS_H #define LIBQOS_RTAS_H -#include "libqos/malloc.h" +#include "malloc.h" int qrtas_get_time_of_day(QTestState *qts, QGuestAllocator *alloc, struct tm *tm, uint32_t *ns); diff --git a/tests/qtest/libqos/sdhci.c b/tests/qtest/libqos/sdhci.c index fbf2e36aec..65f0d07fc5 100644 --- a/tests/qtest/libqos/sdhci.c +++ b/tests/qtest/libqos/sdhci.c @@ -18,7 +18,7 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/qgraph.h" +#include "qgraph.h" #include "pci.h" #include "qemu/module.h" #include "sdhci.h" diff --git a/tests/qtest/libqos/sdhci.h b/tests/qtest/libqos/sdhci.h index 1acd3096e2..22d647b1fd 100644 --- a/tests/qtest/libqos/sdhci.h +++ b/tests/qtest/libqos/sdhci.h @@ -19,7 +19,7 @@ #ifndef QGRAPH_QSDHCI_H #define QGRAPH_QSDHCI_H -#include "libqos/qgraph.h" +#include "qgraph.h" #include "pci.h" typedef struct QSDHCI QSDHCI; diff --git a/tests/qtest/libqos/tpci200.c b/tests/qtest/libqos/tpci200.c index ae590a456e..1787b1f188 100644 --- a/tests/qtest/libqos/tpci200.c +++ b/tests/qtest/libqos/tpci200.c @@ -10,8 +10,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/qgraph.h" -#include "libqos/pci.h" +#include "qgraph.h" +#include "pci.h" typedef struct QTpci200 QTpci200; typedef struct QIpack QIpack; diff --git a/tests/qtest/libqos/usb.c b/tests/qtest/libqos/usb.c index d7a9cb3c72..8b45b02984 100644 --- a/tests/qtest/libqos/usb.c +++ b/tests/qtest/libqos/usb.c @@ -14,7 +14,7 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "hw/usb/uhci-regs.h" -#include "libqos/usb.h" +#include "usb.h" void qusb_pci_init_one(QPCIBus *pcibus, struct qhc *hc, uint32_t devfn, int bar) { diff --git a/tests/qtest/libqos/usb.h b/tests/qtest/libqos/usb.h index eeced39a2f..50030d7fb1 100644 --- a/tests/qtest/libqos/usb.h +++ b/tests/qtest/libqos/usb.h @@ -1,7 +1,7 @@ #ifndef LIBQOS_USB_H #define LIBQOS_USB_H -#include "libqos/pci-pc.h" +#include "pci-pc.h" struct qhc { QPCIDevice *dev; diff --git a/tests/qtest/libqos/virtio-9p.c b/tests/qtest/libqos/virtio-9p.c index c87b56132a..2e300063e3 100644 --- a/tests/qtest/libqos/virtio-9p.c +++ b/tests/qtest/libqos/virtio-9p.c @@ -20,8 +20,8 @@ #include "libqtest.h" #include "qemu/module.h" #include "standard-headers/linux/virtio_ids.h" -#include "libqos/virtio-9p.h" -#include "libqos/qgraph.h" +#include "virtio-9p.h" +#include "qgraph.h" static QGuestAllocator *alloc; diff --git a/tests/qtest/libqos/virtio-9p.h b/tests/qtest/libqos/virtio-9p.h index be9621a5e3..b1e6badc4a 100644 --- a/tests/qtest/libqos/virtio-9p.h +++ b/tests/qtest/libqos/virtio-9p.h @@ -19,9 +19,9 @@ #ifndef TESTS_LIBQOS_VIRTIO_9P_H #define TESTS_LIBQOS_VIRTIO_9P_H -#include "libqos/qgraph.h" -#include "libqos/virtio.h" -#include "libqos/virtio-pci.h" +#include "qgraph.h" +#include "virtio.h" +#include "virtio-pci.h" typedef struct QVirtio9P QVirtio9P; typedef struct QVirtio9PPCI QVirtio9PPCI; diff --git a/tests/qtest/libqos/virtio-balloon.c b/tests/qtest/libqos/virtio-balloon.c index 9745f4a83c..a3da5c234d 100644 --- a/tests/qtest/libqos/virtio-balloon.c +++ b/tests/qtest/libqos/virtio-balloon.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/qgraph.h" -#include "libqos/virtio-balloon.h" +#include "qgraph.h" +#include "virtio-balloon.h" /* virtio-balloon-device */ static void *qvirtio_balloon_get_driver(QVirtioBalloon *v_balloon, diff --git a/tests/qtest/libqos/virtio-balloon.h b/tests/qtest/libqos/virtio-balloon.h index 5b919303a6..309894c338 100644 --- a/tests/qtest/libqos/virtio-balloon.h +++ b/tests/qtest/libqos/virtio-balloon.h @@ -19,9 +19,9 @@ #ifndef TESTS_LIBQOS_VIRTIO_BALLOON_H #define TESTS_LIBQOS_VIRTIO_BALLOON_H -#include "libqos/qgraph.h" -#include "libqos/virtio.h" -#include "libqos/virtio-pci.h" +#include "qgraph.h" +#include "virtio.h" +#include "virtio-pci.h" typedef struct QVirtioBalloon QVirtioBalloon; typedef struct QVirtioBalloonPCI QVirtioBalloonPCI; diff --git a/tests/qtest/libqos/virtio-blk.c b/tests/qtest/libqos/virtio-blk.c index 5fc69401be..5da02591bc 100644 --- a/tests/qtest/libqos/virtio-blk.c +++ b/tests/qtest/libqos/virtio-blk.c @@ -20,8 +20,8 @@ #include "libqtest.h" #include "qemu/module.h" #include "standard-headers/linux/virtio_blk.h" -#include "libqos/qgraph.h" -#include "libqos/virtio-blk.h" +#include "qgraph.h" +#include "virtio-blk.h" #define PCI_SLOT 0x04 #define PCI_FN 0x00 diff --git a/tests/qtest/libqos/virtio-blk.h b/tests/qtest/libqos/virtio-blk.h index 5170f13cfe..dcef38851e 100644 --- a/tests/qtest/libqos/virtio-blk.h +++ b/tests/qtest/libqos/virtio-blk.h @@ -19,9 +19,9 @@ #ifndef TESTS_LIBQOS_VIRTIO_BLK_H #define TESTS_LIBQOS_VIRTIO_BLK_H -#include "libqos/qgraph.h" -#include "libqos/virtio.h" -#include "libqos/virtio-pci.h" +#include "qgraph.h" +#include "virtio.h" +#include "virtio-pci.h" typedef struct QVirtioBlk QVirtioBlk; typedef struct QVirtioBlkPCI QVirtioBlkPCI; diff --git a/tests/qtest/libqos/virtio-mmio.c b/tests/qtest/libqos/virtio-mmio.c index e0a2bd7bc6..75efda3029 100644 --- a/tests/qtest/libqos/virtio-mmio.c +++ b/tests/qtest/libqos/virtio-mmio.c @@ -10,10 +10,10 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/virtio.h" -#include "libqos/virtio-mmio.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" +#include "virtio.h" +#include "virtio-mmio.h" +#include "malloc.h" +#include "qgraph.h" #include "standard-headers/linux/virtio_ring.h" static uint8_t qvirtio_mmio_config_readb(QVirtioDevice *d, uint64_t off) diff --git a/tests/qtest/libqos/virtio-mmio.h b/tests/qtest/libqos/virtio-mmio.h index 0e45778b07..30803bc91c 100644 --- a/tests/qtest/libqos/virtio-mmio.h +++ b/tests/qtest/libqos/virtio-mmio.h @@ -10,8 +10,8 @@ #ifndef LIBQOS_VIRTIO_MMIO_H #define LIBQOS_VIRTIO_MMIO_H -#include "libqos/virtio.h" -#include "libqos/qgraph.h" +#include "virtio.h" +#include "qgraph.h" #define QVIRTIO_MMIO_MAGIC_VALUE 0x000 #define QVIRTIO_MMIO_VERSION 0x004 diff --git a/tests/qtest/libqos/virtio-net.c b/tests/qtest/libqos/virtio-net.c index a9e253afe4..1cae07f60d 100644 --- a/tests/qtest/libqos/virtio-net.c +++ b/tests/qtest/libqos/virtio-net.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/qgraph.h" -#include "libqos/virtio-net.h" +#include "qgraph.h" +#include "virtio-net.h" #include "hw/virtio/virtio-net.h" diff --git a/tests/qtest/libqos/virtio-net.h b/tests/qtest/libqos/virtio-net.h index b8cbec04af..5ba2161de2 100644 --- a/tests/qtest/libqos/virtio-net.h +++ b/tests/qtest/libqos/virtio-net.h @@ -19,9 +19,9 @@ #ifndef TESTS_LIBQOS_VIRTIO_NET_H #define TESTS_LIBQOS_VIRTIO_NET_H -#include "libqos/qgraph.h" -#include "libqos/virtio.h" -#include "libqos/virtio-pci.h" +#include "qgraph.h" +#include "virtio.h" +#include "virtio-pci.h" typedef struct QVirtioNet QVirtioNet; typedef struct QVirtioNetPCI QVirtioNetPCI; diff --git a/tests/qtest/libqos/virtio-pci.c b/tests/qtest/libqos/virtio-pci.c index 62851c29bb..cd3c0f5bf3 100644 --- a/tests/qtest/libqos/virtio-pci.c +++ b/tests/qtest/libqos/virtio-pci.c @@ -9,13 +9,13 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/virtio.h" -#include "libqos/virtio-pci.h" -#include "libqos/pci.h" -#include "libqos/pci-pc.h" -#include "libqos/malloc.h" -#include "libqos/malloc-pc.h" -#include "libqos/qgraph.h" +#include "virtio.h" +#include "virtio-pci.h" +#include "pci.h" +#include "pci-pc.h" +#include "malloc.h" +#include "malloc-pc.h" +#include "qgraph.h" #include "standard-headers/linux/virtio_ring.h" #include "standard-headers/linux/virtio_pci.h" diff --git a/tests/qtest/libqos/virtio-pci.h b/tests/qtest/libqos/virtio-pci.h index 294d5567ee..f5115cacba 100644 --- a/tests/qtest/libqos/virtio-pci.h +++ b/tests/qtest/libqos/virtio-pci.h @@ -10,9 +10,9 @@ #ifndef LIBQOS_VIRTIO_PCI_H #define LIBQOS_VIRTIO_PCI_H -#include "libqos/virtio.h" -#include "libqos/pci.h" -#include "libqos/qgraph.h" +#include "virtio.h" +#include "pci.h" +#include "qgraph.h" typedef struct QVirtioPCIMSIXOps QVirtioPCIMSIXOps; diff --git a/tests/qtest/libqos/virtio-rng.c b/tests/qtest/libqos/virtio-rng.c index 46f8d95b1f..2e09dd7c48 100644 --- a/tests/qtest/libqos/virtio-rng.c +++ b/tests/qtest/libqos/virtio-rng.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/qgraph.h" -#include "libqos/virtio-rng.h" +#include "qgraph.h" +#include "virtio-rng.h" /* virtio-rng-device */ static void *qvirtio_rng_get_driver(QVirtioRng *v_rng, diff --git a/tests/qtest/libqos/virtio-rng.h b/tests/qtest/libqos/virtio-rng.h index 9342372efa..9ca102b599 100644 --- a/tests/qtest/libqos/virtio-rng.h +++ b/tests/qtest/libqos/virtio-rng.h @@ -19,9 +19,9 @@ #ifndef TESTS_LIBQOS_VIRTIO_RNG_H #define TESTS_LIBQOS_VIRTIO_RNG_H -#include "libqos/qgraph.h" -#include "libqos/virtio.h" -#include "libqos/virtio-pci.h" +#include "qgraph.h" +#include "virtio.h" +#include "virtio-pci.h" typedef struct QVirtioRng QVirtioRng; typedef struct QVirtioRngPCI QVirtioRngPCI; diff --git a/tests/qtest/libqos/virtio-scsi.c b/tests/qtest/libqos/virtio-scsi.c index c8c3598428..5644e32fc3 100644 --- a/tests/qtest/libqos/virtio-scsi.c +++ b/tests/qtest/libqos/virtio-scsi.c @@ -20,8 +20,8 @@ #include "libqtest.h" #include "qemu/module.h" #include "standard-headers/linux/virtio_ids.h" -#include "libqos/qgraph.h" -#include "libqos/virtio-scsi.h" +#include "qgraph.h" +#include "virtio-scsi.h" /* virtio-scsi-device */ static void *qvirtio_scsi_get_driver(QVirtioSCSI *v_scsi, diff --git a/tests/qtest/libqos/virtio-scsi.h b/tests/qtest/libqos/virtio-scsi.h index 9e3774d99a..531315e6ad 100644 --- a/tests/qtest/libqos/virtio-scsi.h +++ b/tests/qtest/libqos/virtio-scsi.h @@ -19,9 +19,9 @@ #ifndef TESTS_LIBQOS_VIRTIO_SCSI_H #define TESTS_LIBQOS_VIRTIO_SCSI_H -#include "libqos/qgraph.h" -#include "libqos/virtio.h" -#include "libqos/virtio-pci.h" +#include "qgraph.h" +#include "virtio.h" +#include "virtio-pci.h" typedef struct QVirtioSCSI QVirtioSCSI; typedef struct QVirtioSCSIPCI QVirtioSCSIPCI; diff --git a/tests/qtest/libqos/virtio-serial.c b/tests/qtest/libqos/virtio-serial.c index b95654085d..ee34afd95a 100644 --- a/tests/qtest/libqos/virtio-serial.c +++ b/tests/qtest/libqos/virtio-serial.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/qgraph.h" -#include "libqos/virtio-serial.h" +#include "qgraph.h" +#include "virtio-serial.h" static void *qvirtio_serial_get_driver(QVirtioSerial *v_serial, const char *interface) diff --git a/tests/qtest/libqos/virtio-serial.h b/tests/qtest/libqos/virtio-serial.h index 3328c6cf19..3db43b2bb8 100644 --- a/tests/qtest/libqos/virtio-serial.h +++ b/tests/qtest/libqos/virtio-serial.h @@ -19,9 +19,9 @@ #ifndef TESTS_LIBQOS_VIRTIO_SERIAL_H #define TESTS_LIBQOS_VIRTIO_SERIAL_H -#include "libqos/qgraph.h" -#include "libqos/virtio.h" -#include "libqos/virtio-pci.h" +#include "qgraph.h" +#include "virtio.h" +#include "virtio-pci.h" typedef struct QVirtioSerial QVirtioSerial; typedef struct QVirtioSerialPCI QVirtioSerialPCI; diff --git a/tests/qtest/libqos/virtio.c b/tests/qtest/libqos/virtio.c index 9aa360620c..6fe7bf9555 100644 --- a/tests/qtest/libqos/virtio.c +++ b/tests/qtest/libqos/virtio.c @@ -10,7 +10,7 @@ #include "qemu/osdep.h" #include "qemu/bswap.h" #include "libqtest.h" -#include "libqos/virtio.h" +#include "virtio.h" #include "standard-headers/linux/virtio_config.h" #include "standard-headers/linux/virtio_ring.h" diff --git a/tests/qtest/libqos/virtio.h b/tests/qtest/libqos/virtio.h index 529ef7555a..b8bd06e1b8 100644 --- a/tests/qtest/libqos/virtio.h +++ b/tests/qtest/libqos/virtio.h @@ -10,7 +10,7 @@ #ifndef LIBQOS_VIRTIO_H #define LIBQOS_VIRTIO_H -#include "libqos/malloc.h" +#include "malloc.h" #include "standard-headers/linux/virtio_ring.h" #define QVIRTIO_F_BAD_FEATURE 0x40000000ull diff --git a/tests/qtest/libqos/x86_64_pc-machine.c b/tests/qtest/libqos/x86_64_pc-machine.c index 0edb1c9144..ad96742a92 100644 --- a/tests/qtest/libqos/x86_64_pc-machine.c +++ b/tests/qtest/libqos/x86_64_pc-machine.c @@ -18,7 +18,7 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/qgraph.h" +#include "qgraph.h" #include "pci-pc.h" #include "qemu/module.h" #include "malloc-pc.h" |