qgraph merge
Subsystems (2)
[Qemu-devel] [PULL 01/57] chardev-socket: do not blindly reset handlers when switching GMainContext
In reply to Paolo BonziniIf the socket is connecting or connected, tcp_chr_update_read_handler will be called but it should not set the NetListener's callbacks again. Otherwise, tcp_chr_accept is invoked while the socket is in connected state and you get an assertion failure.
--- chardev/char-socket.c | 2 +- tests/test-char.c | 102 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 102 insertions(+), 2 deletions(-)
chardev/char-socket.c +1 -1
@@ -632,7 +632,7 @@ static void tcp_chr_update_read_handler(Chardev *chr) {SocketChardev *s =SOCKET_CHARDEV (chr); -if (s->listener) { +if (s->listener && s->state ==TCP_CHARDEV_STATE_DISCONNECTED ) {/* * It's possible that chardev context is changed in * qemu_chr_be_update_read_handlers(). Reset it for QIO net
tests/test-char.c +101 -1
119 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 02/57] tests/libqos: introduce virtio_start_device
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
This function is intended to group all the qvirtio_* functions that start the qvirtio devices.
Applied in all tests using this combination of functions.
--- tests/libqos/virtio.c | 7 +++++++ tests/libqos/virtio.h | 1 + tests/vhost-user-test.c | 4 +--- tests/virtio-9p-test.c | 4 +--- tests/virtio-blk-test.c | 9 ++------- tests/virtio-net-test.c | 4 +--- tests/virtio-scsi-test.c | 4 +--- 7 files changed, 14 insertions(+), 19 deletions(-)
tests/libqos/virtio.c +7 -0
@@ -365,3 +365,10 @@ const char *qvirtio_get_dev_type(void)return "pci" ; } } + +void qvirtio_start_device (QVirtioDevice *vdev) +{ +qvirtio_reset (vdev); +qvirtio_set_acknowledge (vdev); +qvirtio_set_driver (vdev); +}
tests/libqos/virtio.h +1 -0
@@ -146,5 +146,6 @@ bool qvirtqueue_get_buf(QVirtQueue *vq, uint32_t *desc_idx, uint32_t *len);void qvirtqueue_set_used_event (QVirtQueue *vq,uint16_t idx);const char *qvirtio_get_dev_type (void ); +void qvirtio_start_device (QVirtioDevice *vdev);#endif
tests/vhost-user-test.c +1 -3
@@ -204,9 +204,7 @@ static void init_virtio_dev(QTestState *qts, TestServer *s, uint32_t features_mag_assert_nonnull (s->dev);qvirtio_pci_device_enable (s->dev); -qvirtio_reset (&s->dev->vdev); -qvirtio_set_acknowledge (&s->dev->vdev); -qvirtio_set_driver (&s->dev->vdev); +qvirtio_start_device (&s->dev->vdev); s->alloc =pc_alloc_init (qts);
tests/virtio-9p-test.c +1 -3
@@ -65,9 +65,7 @@ static QVirtIO9P *qvirtio_9p_pci_start(void) v9p->dev = (QVirtioDevice *) dev;qvirtio_pci_device_enable (dev); -qvirtio_reset (v9p->dev); -qvirtio_set_acknowledge (v9p->dev); -qvirtio_set_driver (v9p->dev); +qvirtio_start_device (v9p->dev); v9p->vq =qvirtqueue_setup (v9p->dev, v9p->qs->alloc,0 );
tests/virtio-blk-test.c +2 -7
@@ -122,10 +122,7 @@ static QVirtioPCIDevice *virtio_blk_pci_init(QPCIBus *bus, int slot) g_assert_cmphex(dev->pdev->devfn, ==, ((slot << 3) | PCI_FN));qvirtio_pci_device_enable (dev); -qvirtio_reset (&dev->vdev); -qvirtio_set_acknowledge (&dev->vdev); -qvirtio_set_driver (&dev->vdev); - +qvirtio_start_device (&dev->vdev);return dev; }
@@ -833,9 +830,7 @@ static void mmio_basic(void)g_assert (dev !=NULL ); g_assert_cmphex(dev->vdev.device_type, ==, VIRTIO_ID_BLOCK); -qvirtio_reset (&dev->vdev); -qvirtio_set_acknowledge (&dev->vdev); -qvirtio_set_driver (&dev->vdev); +qvirtio_start_device (&dev->vdev); alloc =generic_alloc_init (MMIO_RAM_ADDR ,MMIO_RAM_SIZE ,MMIO_PAGE_SIZE ); vq =qvirtqueue_setup (&dev->vdev, alloc,0 );
tests/virtio-net-test.c +1 -3
@@ -44,9 +44,7 @@ static QVirtioPCIDevice *virtio_net_pci_init(QPCIBus *bus, int slot) g_assert_cmphex(dev->vdev.device_type, ==, VIRTIO_ID_NET);qvirtio_pci_device_enable (dev); -qvirtio_reset (&dev->vdev); -qvirtio_set_acknowledge (&dev->vdev); -qvirtio_set_driver (&dev->vdev); +qvirtio_start_device (&dev->vdev);return dev; }
tests/virtio-scsi-test.c +1 -3
@@ -159,9 +159,7 @@ static QVirtIOSCSI *qvirtio_scsi_pci_init(int slot) g_assert_cmphex(vs->dev->device_type, ==, VIRTIO_ID_SCSI);qvirtio_pci_device_enable (dev); -qvirtio_reset (vs->dev); -qvirtio_set_acknowledge (vs->dev); -qvirtio_set_driver (vs->dev); +qvirtio_start_device (vs->dev); vs->num_queues =qvirtio_config_readl (vs->dev,0 );
Signature · 1 line
1.8.3.1
The following changes since commit 3a75ef6a0fe397b0d36930415be6b123750a6afe:
Merge remote-tracking branch 'remotes/kraxel/tags/usb-20190307-pull-request' into staging (2019-03-07 14:06:42 +0000)
are available in the git repository at:
git://github.com/bonzini/qemu.git tags/for-upstream-qgraph
for you to fetch changes up to 15bd8b2cdabbf8f3371f2e30b1ef04cf9fe9ec87:
qos-test: megasas test node (2019-03-07 17:25:09 +0100)
----------------------------------------------------------------
qgraph project from GSoC 2018
----------------------------------------------------------------
Emanuele Giuseppe Esposito (45):
tests/libqos: introduce virtio_start_device tests/libqos: rename qpci_init_pc and qpci_init_spapr functions
tests: qgraph API for the qtest driver framework tests/libqos: pci-pc driver and interface nodes tests/libqos: x86_64/pc machine node
tests/libqos: sdhci driver and interface nodes tests/libqos: arm/raspi2 machine node
tests/libqos: arm/smdkc210 machine node tests/libqos: arm/sabrelite machine node tests/libqos: arm/xilinx-zynq-a9 machine node tests/libqos: aarch64/xlnx-zcu102 machine node
qos-test: sdhci test node
tests/libqos: pci-spapr driver and interface nodes tests/qgraph: ppc64/pseries machine node tests/libqos: has_buggy_msi flag
tests/libqos: e1000e driver and interface nodes
qos-test: e1000e test node
tests/libqos: virtio-pci driver and interface nodes tests/libqos: virtio-mmio driver and interface nodes tests/libqos: arm/virt machine node
tests/libqos: virtio-serial driver and interface nodes
qos-test: virtio-console and virtio-serial test node tests/libqos: virtio-9p driver and interface nodes
qos-test: virtio-9p test node
tests/libqos: virtio-balloon driver and interface nodes tests/qgraph: remove virtio-balloon-test tests/libqos: virtio-rng driver and interface nodes
qos-test: virtio-rng test node
tests/libqos: virtio-blk driver and interface nodes tests/libqos: virtio-net driver and interface nodes
qos-test: virtio-net test node
tests/libqos: virtio-scsi driver and interface nodes
qos-test: virtio-scsi test node
qos-test: ac97 test node
qos-test: tpci200 test node
qos-test: ipoctal232 test node
qos-test: ne2k_pci test node
qos-test: nvme test node
qos-test: pcnet test node
qos-test: spapr-phb test node
qos-test: usb-hcd-ohci test node
qos-test: vmxnet3 test node
qos-test: es1370 test node
qos-test: eepro100 test node
qos-test: e1000 test node
Paolo Bonzini (12):
chardev-socket: do not blindly reset handlers when switching GMainContext tests/libqos: embed allocators instead of malloc-ing them separately tests/qgraph: add generic PCI testcases
tests/libqos: remove global_qtest from virtio endianness checks tests/qgraph: add generic virtio testcases
qos-test: virtio-blk test node
tests/libqos: support multiqueue for virtio-net
vhost-user-test: always use 256 MiB of guest memory
qos-test: vhost-user test node
tests/libqos: remove pre-qgraph QVirtioPCIDevice API
tests: move virtio entirely to qos-test
qos-test: megasas test node
chardev/char-socket.c | 2 +- configure | 2 +- include/qemu/module.h | 2 + tests/Makefile.include | 129 +++-- tests/ac97-test.c | 47 +- tests/ahci-test.c | 6 +- tests/drive_del-test.c | 25 +- tests/e1000-test.c | 64 ++- tests/e1000e-test.c | 358 +++----------- tests/eepro100-test.c | 65 ++- tests/es1370-test.c | 46 +- tests/i440fx-test.c | 2 +- tests/ide-test.c | 19 +- tests/ipoctal232-test.c | 35 +- tests/libqos/aarch64-xlnx-zcu102-machine.c | 94 ++++ tests/libqos/ahci.c | 2 +- tests/libqos/arm-raspi2-machine.c | 91 ++++ tests/libqos/arm-sabrelite-machine.c | 91 ++++ tests/libqos/arm-smdkc210-machine.c | 91 ++++ tests/libqos/arm-virt-machine.c | 90 ++++ tests/libqos/arm-xilinx-zynq-a9-machine.c | 94 ++++ tests/libqos/e1000e.c | 260 ++++++++++ tests/libqos/e1000e.h | 53 ++ tests/libqos/libqos-pc.c | 5 +- tests/libqos/libqos-spapr.c | 5 +- tests/libqos/libqos.c | 13 +- tests/libqos/libqos.h | 13 +- tests/libqos/malloc-generic.c | 39 -- tests/libqos/malloc-generic.h | 21 - tests/libqos/malloc-pc.c | 18 +- tests/libqos/malloc-pc.h | 4 +- tests/libqos/malloc-spapr.c | 19 +- tests/libqos/malloc-spapr.h | 4 +- tests/libqos/malloc.c | 42 +- tests/libqos/malloc.h | 21 +- tests/libqos/pci-pc.c | 86 ++-- tests/libqos/pci-pc.h | 29 +- tests/libqos/pci-spapr.c | 119 +++-- tests/libqos/pci-spapr.h | 26 +- tests/libqos/pci.c | 46 +- tests/libqos/pci.h | 16 + tests/libqos/ppc64_pseries-machine.c | 111 +++++ tests/libqos/qgraph.c | 753 +++++++++++++++++++++++++++++ tests/libqos/qgraph.h | 575 ++++++++++++++++++++++ tests/libqos/qgraph_internal.h | 257 ++++++++++ tests/libqos/sdhci.c | 163 +++++++ tests/libqos/sdhci.h | 70 +++ tests/libqos/tpci200.c | 65 +++ tests/libqos/virtio-9p.c | 173 +++++++ tests/libqos/virtio-9p.h | 42 ++ tests/libqos/virtio-balloon.c | 113 +++++ tests/libqos/virtio-balloon.h | 39 ++ tests/libqos/virtio-blk.c | 124 +++++ tests/libqos/virtio-blk.h | 40 ++ tests/libqos/virtio-mmio.c | 116 +++-- tests/libqos/virtio-mmio.h | 6 +- tests/libqos/virtio-net.c | 195 ++++++++ tests/libqos/virtio-net.h | 41 ++ tests/libqos/virtio-pci.c | 187 ++++--- tests/libqos/virtio-pci.h | 18 +- tests/libqos/virtio-rng.c | 110 +++++ tests/libqos/virtio-rng.h | 39 ++ tests/libqos/virtio-scsi.c | 117 +++++ tests/libqos/virtio-scsi.h | 39 ++ tests/libqos/virtio-serial.c | 110 +++++ tests/libqos/virtio-serial.h | 39 ++ tests/libqos/virtio.c | 24 +- tests/libqos/virtio.h | 11 +- tests/libqos/x86_64_pc-machine.c | 114 +++++ tests/libqtest.h | 6 + tests/megasas-test.c | 80 +-- tests/ne2000-test.c | 46 +- tests/nvme-test.c | 78 +-- tests/pci-test.c | 25 + tests/pcnet-test.c | 46 +- tests/q35-test.c | 4 +- tests/qos-test.c | 445 +++++++++++++++++ tests/rtas-test.c | 2 +- tests/rtl8139-test.c | 2 +- tests/sdhci-test.c | 185 +------ tests/spapr-phb-test.c | 32 +- tests/tco-test.c | 2 +- tests/test-char.c | 102 +++- tests/test-qgraph.c | 434 +++++++++++++++++ tests/tpci200-test.c | 31 -- tests/usb-hcd-ehci-test.c | 2 +- tests/usb-hcd-ohci-test.c | 54 ++- tests/vhost-user-test.c | 385 ++++++--------- tests/virtio-9p-test.c | 220 +++------ tests/virtio-balloon-test.c | 33 -- tests/virtio-blk-test.c | 471 +++++++----------- tests/virtio-console-test.c | 38 -- tests/virtio-net-test.c | 226 +++------ tests/virtio-rng-test.c | 27 +- tests/virtio-scsi-test.c | 145 +++--- tests/virtio-serial-test.c | 27 +- tests/virtio-test.c | 25 + tests/vmxnet3-test.c | 46 +- 98 files changed, 6885 insertions(+), 2219 deletions(-) create mode 100644 tests/libqos/aarch64-xlnx-zcu102-machine.c create mode 100644 tests/libqos/arm-raspi2-machine.c create mode 100644 tests/libqos/arm-sabrelite-machine.c create mode 100644 tests/libqos/arm-smdkc210-machine.c create mode 100644 tests/libqos/arm-virt-machine.c create mode 100644 tests/libqos/arm-xilinx-zynq-a9-machine.c create mode 100644 tests/libqos/e1000e.c create mode 100644 tests/libqos/e1000e.h delete mode 100644 tests/libqos/malloc-generic.c delete mode 100644 tests/libqos/malloc-generic.h create mode 100644 tests/libqos/ppc64_pseries-machine.c create mode 100644 tests/libqos/qgraph.c create mode 100644 tests/libqos/qgraph.h create mode 100644 tests/libqos/qgraph_internal.h create mode 100644 tests/libqos/sdhci.c create mode 100644 tests/libqos/sdhci.h create mode 100644 tests/libqos/tpci200.c create mode 100644 tests/libqos/virtio-9p.c create mode 100644 tests/libqos/virtio-9p.h create mode 100644 tests/libqos/virtio-balloon.c create mode 100644 tests/libqos/virtio-balloon.h create mode 100644 tests/libqos/virtio-blk.c create mode 100644 tests/libqos/virtio-blk.h create mode 100644 tests/libqos/virtio-net.c create mode 100644 tests/libqos/virtio-net.h create mode 100644 tests/libqos/virtio-rng.c create mode 100644 tests/libqos/virtio-rng.h create mode 100644 tests/libqos/virtio-scsi.c create mode 100644 tests/libqos/virtio-scsi.h create mode 100644 tests/libqos/virtio-serial.c create mode 100644 tests/libqos/virtio-serial.h create mode 100644 tests/libqos/x86_64_pc-machine.c create mode 100644 tests/pci-test.c create mode 100644 tests/qos-test.c create mode 100644 tests/test-qgraph.c delete mode 100644 tests/tpci200-test.c delete mode 100644 tests/virtio-balloon-test.c delete mode 100644 tests/virtio-console-test.c create mode 100644 tests/virtio-test.c
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 03/57] tests/libqos: rename qpci_init_pc and qpci_init_spapr functions
From: Emanuele Giuseppe Esposito <[email protected]>
Rename qpci_init_pc in qpci_pc_new and qpci_init_spapr in qpci_spapr_new, since these function actually allocate a new pci struct and initialize it (compare to object_new and object_initialize).
Changed QOSOps field name from qpci_init to qpci_new.
--- tests/e1000e-test.c | 2 +- tests/i440fx-test.c | 2 +- tests/ide-test.c | 2 +- tests/libqos/ahci.c | 2 +- tests/libqos/libqos-pc.c | 2 +- tests/libqos/libqos-spapr.c | 2 +- tests/libqos/libqos.c | 2 +- tests/libqos/libqos.h | 2 +- tests/libqos/pci-pc.c | 2 +- tests/libqos/pci-pc.h | 12 +++++++++++- tests/libqos/pci-spapr.c | 2 +- tests/libqos/pci-spapr.h | 2 +- tests/q35-test.c | 4 ++-- tests/rtl8139-test.c | 2 +- tests/sdhci-test.c | 2 +- tests/tco-test.c | 2 +- tests/usb-hcd-ehci-test.c | 2 +- tests/vhost-user-test.c | 2 +- 18 files changed, 29 insertions(+), 19 deletions(-)
tests/e1000e-test.c +1 -1
@@ -395,7 +395,7 @@ static void data_test_init(e1000e_device *d) test_alloc =pc_alloc_init (global_qtest);g_assert_nonnull (test_alloc); - test_bus =qpci_init_pc (global_qtest, test_alloc); + test_bus =qpci_new_pc (global_qtest, test_alloc);g_assert_nonnull (test_bus);e1000e_device_init (test_bus, d);
tests/i440fx-test.c +1 -1
@@ -38,7 +38,7 @@ static QPCIBus *test_start_get_bus(const TestData *s) cmdline =g_strdup_printf ("-smp %d" , s->num_cpus);qtest_start (cmdline);g_free (cmdline); -return qpci_init_pc (global_qtest,NULL ); +return qpci_new_pc (global_qtest,NULL ); }static void test_i440fx_defaults (gconstpointer opaque)
tests/ide-test.c +1 -1
@@ -157,7 +157,7 @@ static QPCIDevice *get_pci_device(QPCIBar *bmdma_bar, QPCIBar *ide_bar)uint16_t vendor_id, device_id;if (!pcibus) { - pcibus =qpci_init_pc (global_qtest,NULL ); + pcibus =qpci_new_pc (global_qtest,NULL ); }/* Find PCI device and verify it's the right one */
tests/libqos/ahci.c +1 -1
@@ -130,7 +130,7 @@ QPCIDevice *get_ahci_device(QTestState *qts, uint32_t *fingerprint)uint32_t ahci_fingerprint;QPCIBus *pcibus; - pcibus =qpci_init_pc (qts,NULL ); + pcibus =qpci_new_pc (qts,NULL );/* Find the AHCI PCI device and verify it's the right one. */ ahci =qpci_device_find (pcibus,QPCI_DEVFN (0x1F ,0x02 ));
tests/libqos/libqos-pc.c +1 -1
@@ -6,7 +6,7 @@static QOSOps qos_ops = { .init_allocator = pc_alloc_init_flags, .uninit_allocator = pc_alloc_uninit, - .qpci_init = qpci_init_pc, + .qpci_new = qpci_new_pc, .qpci_free = qpci_free_pc, .shutdown = qtest_pc_shutdown, };
tests/libqos/libqos-spapr.c +1 -1
@@ -6,7 +6,7 @@static QOSOps qos_ops = { .init_allocator = spapr_alloc_init_flags, .uninit_allocator = spapr_alloc_uninit, - .qpci_init = qpci_init_spapr, + .qpci_new = qpci_new_spapr, .qpci_free = qpci_free_spapr, .shutdown = qtest_spapr_shutdown, };
tests/libqos/libqos.c +1 -1
@@ -25,7 +25,7 @@ QOSState *qtest_vboot(QOSOps *ops, const char *cmdline_fmt, va_list ap) qs->ops = ops;if (ops) { qs->alloc = ops->init_allocator (qs->qts,ALLOC_NO_FLAGS ); - qs->pcibus = ops->qpci_init (qs->qts, qs->alloc); + qs->pcibus = ops->qpci_new (qs->qts, qs->alloc); }g_free (cmdline);
tests/libqos/libqos.h +1 -1
@@ -10,7 +10,7 @@ typedef struct QOSState QOSState;typedef struct QOSOps {QGuestAllocator *(*init_allocator)(QTestState *qts,QAllocOpts );void (*uninit_allocator)(QGuestAllocator *); -QPCIBus *(*qpci_init)(QTestState *qts,QGuestAllocator *alloc); +QPCIBus *(*qpci_new)(QTestState *qts,QGuestAllocator *alloc);void (*qpci_free)(QPCIBus *bus);void (*shutdown)(QOSState *); }QOSOps ;
tests/libqos/pci-pc.c +1 -1
@@ -116,7 +116,7 @@ static void qpci_pc_config_writel(QPCIBus *bus, int devfn, uint8_t offset, uint3qtest_outl (bus->qts,0xcfc , value); } -QPCIBus *qpci_init_pc (QTestState *qts,QGuestAllocator *alloc) +QPCIBus *qpci_new_pc (QTestState *qts,QGuestAllocator *alloc) {QPCIBusPC *ret =g_new0 (QPCIBusPC,1 );
tests/libqos/pci-pc.h +11 -1
@@ -16,7 +16,17 @@#include "libqos/pci.h" #include "libqos/malloc.h" -QPCIBus *qpci_init_pc (QTestState *qts,QGuestAllocator *alloc); +/* qpci_pc_new(): +* @qts: The %QTestState for this PC machine +* @alloc: A previously initialized @alloc providing memory for @qts +* +* This function creates a new QPCIBusPC object, +* and properly initialize its fields. +* +* Returns a newly allocated QPCIBus. +*/ +QPCIBus *qpci_new_pc (QTestState *qts,QGuestAllocator *alloc); +void qpci_free_pc (QPCIBus *bus);#endif
tests/libqos/pci-spapr.c +1 -1
@@ -160,7 +160,7 @@ static void qpci_spapr_config_writel(QPCIBus *bus, int devfn, uint8_t offset,#define SPAPR_PCI_MMIO32_WIN_SIZE 0x80000000/* 2 GiB */ #define SPAPR_PCI_IO_WIN_SIZE 0x10000 -QPCIBus *qpci_init_spapr (QTestState *qts,QGuestAllocator *alloc) +QPCIBus *qpci_new_spapr (QTestState *qts,QGuestAllocator *alloc) {QPCIBusSPAPR *ret =g_new0 (QPCIBusSPAPR,1 );
tests/libqos/pci-spapr.h +1 -1
@@ -11,7 +11,7 @@#include "libqos/malloc.h" #include "libqos/pci.h" -QPCIBus *qpci_init_spapr (QTestState *qts,QGuestAllocator *alloc); +QPCIBus *qpci_new_spapr (QTestState *qts,QGuestAllocator *alloc);void qpci_free_spapr (QPCIBus *bus);#endif
tests/q35-test.c +2 -2
@@ -87,7 +87,7 @@ static void test_smram_lock(void)qtest_start ("-M q35" ); - pcibus =qpci_init_pc (global_qtest,NULL ); + pcibus =qpci_new_pc (global_qtest,NULL );g_assert (pcibus !=NULL ); pcidev =qpci_device_find (pcibus,0 );
@@ -146,7 +146,7 @@ static void test_tseg_size(const void *data)g_free (cmdline);/* locate the DRAM controller */ - pcibus =qpci_init_pc (global_qtest,NULL ); + pcibus =qpci_new_pc (global_qtest,NULL );g_assert (pcibus !=NULL ); pcidev =qpci_device_find (pcibus,0 );g_assert (pcidev !=NULL );
tests/rtl8139-test.c +1 -1
@@ -35,7 +35,7 @@ static QPCIDevice *get_device(void) {QPCIDevice *dev; - pcibus =qpci_init_pc (global_qtest,NULL ); + pcibus =qpci_new_pc (global_qtest,NULL );qpci_device_foreach (pcibus,0x10ec ,0x8139 , save_fn, &dev);g_assert (dev !=NULL );
tests/sdhci-test.c +1 -1
@@ -187,7 +187,7 @@ static QSDHCI *machine_start(const struct sdhci_t *test) global_qtest =qtest_initf ("-machine %s -device sdhci-pci" , test->machine); - s->pci.bus =qpci_init_pc (global_qtest,NULL ); + s->pci.bus =qpci_new_pc (global_qtest,NULL );/* Find PCI device and verify it's the right one */ s->pci.dev =qpci_device_find (s->pci.bus,QPCI_DEVFN (4 ,0 ));
tests/tco-test.c +1 -1
@@ -64,7 +64,7 @@ static void test_init(TestData *d) global_qtest = qs;qtest_irq_intercept_in (qs,"ioapic" ); - d->bus =qpci_init_pc (qs,NULL ); + d->bus =qpci_new_pc (qs,NULL ); d->dev =qpci_device_find (d->bus,QPCI_DEVFN (0x1f ,0x00 ));g_assert (d->dev !=NULL );
tests/usb-hcd-ehci-test.c +1 -1
@@ -52,7 +52,7 @@ static void ehci_port_test(struct qhc *hc, int port, uint32_t expect)static void test_init (void ) { - pcibus =qpci_init_pc (global_qtest,NULL ); + pcibus =qpci_new_pc (global_qtest,NULL );g_assert (pcibus !=NULL );qusb_pci_init_one (pcibus, &uhci1,QPCI_DEVFN (0x1d ,0 ),4 );
tests/vhost-user-test.c +1 -1
@@ -197,7 +197,7 @@ static void init_virtio_dev(QTestState *qts, TestServer *s, uint32_t features_mauint32_t features;int i; - s->bus =qpci_init_pc (qts,NULL ); + s->bus =qpci_new_pc (qts,NULL );g_assert_nonnull (s->bus); s->dev =qvirtio_pci_device_find (s->bus,VIRTIO_ID_NET );
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 06/57] tests/libqos: pci-pc driver and interface nodes
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add pci-bus-pc node, move QPCIBusPC struct declaration in its header (since it will be needed by other drivers) and introduce a setter method for drivers that do not need to allocate but have to initialize QPCIBusPC.
--- tests/Makefile.include | 6 +++- tests/libqos/pci-pc.c | 83 ++++++++++++++++++++++++++++++++------------------ tests/libqos/pci-pc.h | 19 +++++++++++- tests/libqos/pci.c | 32 +++++++++++++++++-- tests/libqos/pci.h | 12 ++++++++ 5 files changed, 118 insertions(+), 34 deletions(-)
tests/Makefile.include +5 -1
@@ -749,11 +749,15 @@ libqos-imx-obj-y = $(libqos-obj-y) tests/libqos/i2c-imx.o libqos-usb-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/libqos/usb.o libqos-virtio-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/libqos/virtio.o tests/libqos/virtio-pci.o tests/libqos/virtio-mmio.o +# Devices +qos-test-obj-y = tests/qos-test.o $(libqgraph-obj-y) +qos-test-obj-y += $(libqos-pc-obj-y) + check-unit-y += tests/test-qgraph$(EXESUF) tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y) check-qtest-generic-y += tests/qos-test$(EXESUF) -tests/qos-test$(EXESUF): tests/qos-test.o $(libqgraph-obj-y) +tests/qos-test$(EXESUF): $(qos-test-obj-y) tests/qmp-test$(EXESUF): tests/qmp-test.o tests/qmp-cmd-test$(EXESUF): tests/qmp-cmd-test.o
tests/libqos/pci-pc.c +53 -30
115 lines not on this page · raw message
tests/libqos/pci-pc.h +18 -1
@@ -15,6 +15,22 @@#include "libqos/pci.h" #include "libqos/malloc.h" +#include "libqos/qgraph.h" + +typedef struct QPCIBusPC { +QOSGraphObject obj; +QPCIBus bus; +}QPCIBusPC ; + +/* qpci_init_pc(): +* @ret: A valid QPCIBusPC * pointer +* @qts: The %QTestState for this PC machine +* @alloc: A previously initialized @alloc providing memory for @qts +* +* This function initializes an already allocated +* QPCIBusPC object. +*/ +void qpci_init_pc (QPCIBusPC *ret,QTestState *qts,QGuestAllocator *alloc);/* qpci_pc_new(): * @qts: The %QTestState for this PC machine
@@ -23,7 +39,8 @@* This function creates a new QPCIBusPC object, * and properly initialize its fields. * -* Returns a newly allocated QPCIBus. +* Returns the QPCIBus *bus field of a newly +* allocated QPCIBusPC. */ QPCIBus *qpci_new_pc (QTestState *qts,QGuestAllocator *alloc);
tests/libqos/pci.c +30 -2
@@ -15,6 +15,7 @@#include "hw/pci/pci_regs.h" #include "qemu/host-utils.h" +#include "libqos/qgraph.h" void qpci_device_foreach(QPCIBus *bus, int vendor_id, int device_id, void (*func)(QPCIDevice *dev, int devfn, void *data),
@@ -50,13 +51,20 @@ void qpci_device_foreach(QPCIBus *bus, int vendor_id, int device_id, } } +static void qpci_device_set (QPCIDevice *dev,QPCIBus *bus,int devfn) +{ +g_assert (dev); + + dev->bus = bus; + dev->devfn = devfn; +} +QPCIDevice *qpci_device_find (QPCIBus *bus,int devfn) {QPCIDevice *dev; dev =g_malloc0 (sizeof (*dev)); - dev->bus = bus; - dev->devfn = devfn; +qpci_device_set (dev, bus, devfn);if (qpci_config_readw (dev,PCI_VENDOR_ID ) ==0xFFFF ) {g_free (dev);
@@ -66,6 +74,17 @@ QPCIDevice *qpci_device_find(QPCIBus *bus, int devfn)return dev; } +void qpci_device_init (QPCIDevice *dev,QPCIBus *bus,QPCIAddress *addr) +{ +uint16_t vendor_id, device_id; + +qpci_device_set (dev, bus, addr->devfn); + vendor_id =qpci_config_readw (dev,PCI_VENDOR_ID ); + device_id =qpci_config_readw (dev,PCI_DEVICE_ID ); +g_assert (!addr->vendor_id || vendor_id == addr->vendor_id); +g_assert (!addr->device_id || device_id == addr->device_id); +} +void qpci_device_enable (QPCIDevice *dev) {uint16_t cmd;
@@ -395,3 +414,12 @@ QPCIBar qpci_legacy_iomap(QPCIDevice *dev, uint16_t addr)QPCIBar bar = { .addr = addr };return bar; } + +void add_qpci_address (QOSGraphEdgeOptions *opts,QPCIAddress *addr) +{ +g_assert (addr); +g_assert (opts); + + opts->arg = addr; + opts->size_arg =sizeof (QPCIAddress); +}
tests/libqos/pci.h +12 -0
@@ -14,6 +14,7 @@#define LIBQOS_PCI_H #include "libqtest.h" +#include "libqos/qgraph.h" #define QPCI_PIO_LIMIT 0x10000
@@ -22,6 +23,7 @@typedef struct QPCIDevice QPCIDevice ;typedef struct QPCIBus QPCIBus ;typedef struct QPCIBar QPCIBar ; +typedef struct QPCIAddress QPCIAddress ;struct QPCIBus {uint8_t (*pio_readb)(QPCIBus *bus,uint32_t addr);
@@ -51,6 +53,7 @@ struct QPCIBus {QTestState *qts;uint16_t pio_alloc_ptr;uint64_t mmio_alloc_ptr, mmio_limit; + };struct QPCIBar {
@@ -66,10 +69,17 @@ struct QPCIDeviceuint64_t msix_table_off, msix_pba_off; }; +struct QPCIAddress { +uint32_t devfn; +uint16_t vendor_id; +uint16_t device_id; +}; +void qpci_device_foreach (QPCIBus *bus,int vendor_id,int device_id,void (*func)(QPCIDevice *dev,int devfn,void *data),void *data);QPCIDevice *qpci_device_find (QPCIBus *bus,int devfn); +void qpci_device_init (QPCIDevice *dev,QPCIBus *bus,QPCIAddress *addr);void qpci_device_enable (QPCIDevice *dev);uint8_t qpci_find_capability (QPCIDevice *dev,uint8_t id);
@@ -110,4 +120,6 @@ void qpci_iounmap(QPCIDevice *dev, QPCIBar addr);QPCIBar qpci_legacy_iomap (QPCIDevice *dev,uint16_t addr);void qpci_unplug_acpi_device_test (const char *id,uint8_t slot); + +void add_qpci_address (QOSGraphEdgeOptions *opts,QPCIAddress *addr);#endif
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 07/57] tests/libqos: x86_64/pc machine node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add pc machine for the x86_64 QEMU binary. This machine contains an i440FX-pcihost driver, that contains itself a pci-bus-pc that produces the pci-bus interface.
--- tests/Makefile.include | 3 ++ tests/libqos/x86_64_pc-machine.c | 114 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 tests/libqos/x86_64_pc-machine.c
tests/Makefile.include +3 -0
@@ -753,6 +753,9 @@ libqos-virtio-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/libqos/virt qos-test-obj-y = tests/qos-test.o $(libqgraph-obj-y) qos-test-obj-y += $(libqos-pc-obj-y) +# Machines +qos-test-obj-y += tests/libqos/x86_64_pc-machine.o + check-unit-y += tests/test-qgraph$(EXESUF) tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y)
tests/libqos/x86_64_pc-machine.c new file +114 -0
114 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 04/57] tests/libqos: embed allocators instead of malloc-ing them separately
In reply to Paolo Bonziniqgraph will embed these objects instead of allocating them in a separate object. Expose a new API "generic_alloc_init" and "generic_alloc_destroy" for that, and rename the existing API with s/init/new/ and s/uninit/free/.
--- tests/ahci-test.c | 6 ++-- tests/e1000e-test.c | 22 +++++++------- tests/ide-test.c | 17 +++++------ tests/libqos/libqos-pc.c | 3 +- tests/libqos/libqos-spapr.c | 3 +- tests/libqos/libqos.c | 13 ++++---- tests/libqos/libqos.h | 11 ++++--- tests/libqos/malloc-generic.c | 21 ++----------- tests/libqos/malloc-generic.h | 7 ++--- tests/libqos/malloc-pc.c | 18 ++--------- tests/libqos/malloc-pc.h | 4 +-- tests/libqos/malloc-spapr.c | 19 ++---------- tests/libqos/malloc-spapr.h | 4 +-- tests/libqos/malloc.c | 42 ++++---------------------- tests/libqos/malloc.h | 21 +++++++++---- tests/rtas-test.c | 2 +- tests/vhost-user-test.c | 10 +++---- tests/virtio-9p-test.c | 12 ++++---- tests/virtio-blk-test.c | 69 ++++++++++++++++++++++--------------------- tests/virtio-net-test.c | 10 +++---- tests/virtio-scsi-test.c | 14 ++++----- 21 files changed, 124 insertions(+), 204 deletions(-)
tests/ahci-test.c +3 -3
@@ -162,7 +162,7 @@ static AHCIQState *ahci_vboot(const char *cli, va_list ap) s =g_new0 (AHCIQState,1 ); s->parent =qtest_pc_vboot (cli, ap); global_qtest = s->parent->qts; -alloc_set_flags (s->parent->alloc,ALLOC_LEAK_ASSERT ); +alloc_set_flags (&s->parent->alloc,ALLOC_LEAK_ASSERT );/* Verify that we have an AHCI device present. */ s->dev =get_ahci_device (s->parent->qts, &s->fingerprint);
@@ -1039,7 +1039,7 @@ static void test_dma_fragmented(void)generate_pattern (tx, bufsize,AHCI_SECTOR_SIZE );/* Create a DMA buffer in guest memory, and write our pattern to it. */ - ptr =guest_alloc (ahci->parent->alloc, bufsize); + ptr =guest_alloc (&ahci->parent->alloc, bufsize);g_assert (ptr);bufwrite (ptr, tx, bufsize);
@@ -1059,7 +1059,7 @@ static void test_dma_fragmented(void)/* Read back the guest's receive buffer into local memory */ bufread (ptr, rx, bufsize); -guest_free (ahci->parent->alloc, ptr); +guest_free (&ahci->parent->alloc, ptr); g_assert_cmphex(memcmp(tx, rx, bufsize), ==, 0);
tests/e1000e-test.c +10 -12
@@ -94,7 +94,7 @@ typedef struct e1000e_device { } e1000e_device;static int test_sockets[2 ]; -static QGuestAllocator *test_alloc; +static QGuestAllocator test_alloc;static QPCIBus *test_bus;static void e1000e_pci_foreach_callback (QPCIDevice *dev,int devfn,void *data)
@@ -165,7 +165,7 @@ static void e1000e_device_init(QPCIBus *bus, e1000e_device *d) val | E1000E_CTRL_EXT_DRV_LOAD | E1000E_CTRL_EXT_TXLSFLOW);/* Allocate and setup TX ring */ - d->tx_ring =guest_alloc (test_alloc,E1000E_RING_LEN ); + d->tx_ring =guest_alloc (&test_alloc,E1000E_RING_LEN );g_assert (d->tx_ring !=0 );e1000e_macreg_write (d,E1000E_TDBAL , (uint32_t ) d->tx_ring);
@@ -178,7 +178,7 @@ static void e1000e_device_init(QPCIBus *bus, e1000e_device *d)e1000e_macreg_write (d,E1000E_TCTL ,E1000E_TCTL_EN );/* Allocate and setup RX ring */ - d->rx_ring =guest_alloc (test_alloc,E1000E_RING_LEN ); + d->rx_ring =guest_alloc (&test_alloc,E1000E_RING_LEN );g_assert (d->rx_ring !=0 );e1000e_macreg_write (d,E1000E_RDBAL , (uint32_t )d->rx_ring);
@@ -268,7 +268,7 @@ static void e1000e_send_verify(e1000e_device *d)uint32_t recv_len;/* Prepare test data buffer */ -uint64_t data =guest_alloc (test_alloc, data_len); +uint64_t data =guest_alloc (&test_alloc, data_len);memwrite (data,"TEST" ,5 );/* Prepare TX descriptor */
@@ -296,7 +296,7 @@ static void e1000e_send_verify(e1000e_device *d) g_assert_cmpstr(buffer, == , "TEST");/* Free test data buffer */ -guest_free (test_alloc, data); +guest_free (&test_alloc, data); }static void e1000e_receive_verify (e1000e_device *d)
@@ -348,7 +348,7 @@ static void e1000e_receive_verify(e1000e_device *d) g_assert_cmpint(ret, == , sizeof(test) + sizeof(len));/* Prepare test data buffer */ -uint64_t data =guest_alloc (test_alloc, data_len); +uint64_t data =guest_alloc (&test_alloc, data_len);/* Prepare RX descriptor */ memset (&descr,0 ,sizeof (descr));
@@ -369,7 +369,7 @@ static void e1000e_receive_verify(e1000e_device *d) g_assert_cmpstr(buffer, == , "TEST");/* Free test data buffer */ -guest_free (test_alloc, data); +guest_free (&test_alloc, data); }static void e1000e_device_clear (QPCIBus *bus,e1000e_device *d)
@@ -392,10 +392,8 @@ static void data_test_init(e1000e_device *d)qtest_start (cmdline);g_free (cmdline); - test_alloc =pc_alloc_init (global_qtest); -g_assert_nonnull (test_alloc); - - test_bus =qpci_new_pc (global_qtest, test_alloc); +pc_alloc_init (&test_alloc, global_qtest,0 ); + test_bus =qpci_new_pc (global_qtest, &test_alloc);g_assert_nonnull (test_bus);e1000e_device_init (test_bus, d);
@@ -405,7 +403,7 @@ static void data_test_clear(e1000e_device *d) {e1000e_device_clear (test_bus, d);close (test_sockets[0 ]); -pc_alloc_uninit (test_alloc); +alloc_destroy (&test_alloc);g_free (d->pci_dev);qpci_free_pc (test_bus);qtest_end ();
tests/ide-test.c +8 -9
@@ -120,7 +120,7 @@ enum {#define assert_bit_clear (data, mask) g_assert_cmphex((data) & (mask), ==, 0)static QPCIBus *pcibus =NULL ; -static QGuestAllocator *guest_malloc; +static QGuestAllocator guest_malloc;static char tmp_path[] ="/tmp/qtest.XXXXXX" ;static char debug_path[] ="/tmp/qtest-blkdebug.XXXXXX" ;
@@ -135,7 +135,7 @@ static void ide_test_start(const char *cmdline_fmt, ...)va_end (ap);qtest_start (cmdline); - guest_malloc =pc_alloc_init (global_qtest); +pc_alloc_init (&guest_malloc, global_qtest,0 );g_free (cmdline); }
@@ -146,8 +146,7 @@ static void ide_test_quit(void)qpci_free_pc (pcibus); pcibus =NULL ; } -pc_alloc_uninit (guest_malloc); - guest_malloc =NULL ; +alloc_destroy (&guest_malloc);qtest_end (); }
@@ -246,7 +245,7 @@ static int send_dma_request(int cmd, uint64_t sector, int nb_sectors,/* Setup PRDT */ len =sizeof (*prdt) * prdt_entries; - guest_prdt =guest_alloc (guest_malloc, len); + guest_prdt =guest_alloc (&guest_malloc, len);memwrite (guest_prdt, prdt, len);qpci_io_writel (dev, bmdma_bar, bmreg_prdt, guest_prdt);
@@ -311,7 +310,7 @@ static void test_bmdma_simple_rw(void)uint8_t *buf;uint8_t *cmpbuf;size_t len =512 ; -uintptr_t guest_buf =guest_alloc (guest_malloc, len); +uintptr_t guest_buf =guest_alloc (&guest_malloc, len);PrdtEntry prdt[] = { {
@@ -381,7 +380,7 @@ static void test_bmdma_trim(void)const uint64_t bad_range =trim_range_le (TEST_IMAGE_SIZE /512 -1 ,2 );size_t len =512 ;uint8_t *buf; -uintptr_t guest_buf =guest_alloc (guest_malloc, len); +uintptr_t guest_buf =guest_alloc (&guest_malloc, len);PrdtEntry prdt[] = { {
@@ -625,7 +624,7 @@ static void make_dirty(uint8_t device) dev =get_pci_device (&bmdma_bar, &ide_bar); - guest_buf =guest_alloc (guest_malloc, len); + guest_buf =guest_alloc (&guest_malloc, len); buf =g_malloc (len);memset (buf,rand () %255 +1 , len);g_assert (guest_buf);
@@ -986,7 +985,7 @@ static void test_cdrom_dma(void) "-device ide-cd,drive=sr0,bus=ide.0", tmp_path);qtest_irq_intercept_in (global_qtest,"ioapic" ); - guest_buf =guest_alloc (guest_malloc, len); + guest_buf =guest_alloc (&guest_malloc, len); prdt[0 ].addr =cpu_to_le32 (guest_buf); prdt[0 ].size =cpu_to_le32 (len |PRDT_EOT );
tests/libqos/libqos-pc.c +1 -2
@@ -4,8 +4,7 @@#include "libqos/pci-pc.h" static QOSOps qos_ops = { - .init_allocator = pc_alloc_init_flags, - .uninit_allocator = pc_alloc_uninit, + .alloc_init = pc_alloc_init, .qpci_new = qpci_new_pc, .qpci_free = qpci_free_pc, .shutdown = qtest_pc_shutdown,
tests/libqos/libqos-spapr.c +1 -2
@@ -4,8 +4,7 @@#include "libqos/pci-spapr.h" static QOSOps qos_ops = { - .init_allocator = spapr_alloc_init_flags, - .uninit_allocator = spapr_alloc_uninit, + .alloc_init = spapr_alloc_init, .qpci_new = qpci_new_spapr, .qpci_free = qpci_free_spapr, .shutdown = qtest_spapr_shutdown,
tests/libqos/libqos.c +5 -8
@@ -24,8 +24,8 @@ QOSState *qtest_vboot(QOSOps *ops, const char *cmdline_fmt, va_list ap) qs->qts =qtest_init (cmdline); qs->ops = ops;if (ops) { - qs->alloc = ops->init_allocator (qs->qts,ALLOC_NO_FLAGS ); - qs->pcibus = ops->qpci_new (qs->qts, qs->alloc); + ops->alloc_init (&qs->alloc, qs->qts,ALLOC_NO_FLAGS ); + qs->pcibus = ops->qpci_new (qs->qts, &qs->alloc); }g_free (cmdline);
@@ -58,11 +58,8 @@ void qtest_common_shutdown(QOSState *qs) qs->ops->qpci_free (qs->pcibus); qs->pcibus =NULL ; } -if (qs->alloc && qs->ops->uninit_allocator) { - qs->ops->uninit_allocator (qs->alloc); - qs->alloc =NULL ; - } } +alloc_destroy (&qs->alloc);qtest_quit (qs->qts);g_free (qs); }
@@ -116,7 +113,7 @@ void migrate(QOSState *from, QOSState *to, const char *uri)/* If we were running, we can wait for an event. */ if (running) { -migrate_allocator (from->alloc, to->alloc); +migrate_allocator (&from->alloc, &to->alloc);set_context (to);qtest_qmp_eventwait (to->qts,"RESUME" );return ;
@@ -146,7 +143,7 @@ void migrate(QOSState *from, QOSState *to, const char *uri)g_assert_not_reached (); } -migrate_allocator (from->alloc, to->alloc); +migrate_allocator (&from->alloc, &to->alloc);set_context (to); }
tests/libqos/libqos.h +5 -6
@@ -3,13 +3,12 @@#include "libqtest.h" #include "libqos/pci.h" -#include "libqos/malloc-pc.h" +#include "libqos/malloc.h" typedef struct QOSState QOSState ; typedef struct QOSOps { - QGuestAllocator *(*init_allocator)(QTestState *qts, QAllocOpts); - void (*uninit_allocator)(QGuestAllocator *); + void (*alloc_init)(QGuestAllocator *, QTestState *, QAllocOpts); QPCIBus *(*qpci_new)(QTestState *qts, QGuestAllocator *alloc); void (*qpci_free)(QPCIBus *bus); void (*shutdown)(QOSState *);
@@ -17,7 +16,7 @@ typedef struct QOSOps {struct QOSState {QTestState *qts; -QGuestAllocator *alloc; +QGuestAllocator alloc;QPCIBus *pcibus;QOSOps *ops; };
@@ -36,12 +35,12 @@ void generate_pattern(void *buffer, size_t len, size_t cycle_len);static inline uint64_t qmalloc (QOSState *q,size_t bytes) { -return guest_alloc (q->alloc, bytes); +return guest_alloc (&q->alloc, bytes); }static inline void qfree (QOSState *q,uint64_t addr) { -guest_free (q->alloc, addr); +guest_free (&q->alloc, addr); }#endif
tests/libqos/malloc-generic.c +3 -18
@@ -15,25 +15,10 @@* Mostly for valgrind happiness, but it does offer * a chokepoint for debugging guest memory leaks, too. */ -void generic_alloc_uninit (QGuestAllocator *allocator) +void generic_alloc_init (QGuestAllocator *s,uint64_t base_addr, +uint64_t size,uint32_t page_size) { -alloc_uninit (allocator); -} - -QGuestAllocator *generic_alloc_init_flags (uint64_t base_addr,uint64_t size, -uint32_t page_size,QAllocOpts flags) -{ -QGuestAllocator *s;uint64_t start = base_addr + (1 <<20 );/* Start at 1MB */ - s =alloc_init_flags (flags, start, start + size); -alloc_set_page_size (s, page_size); - -return s; -} - -inline QGuestAllocator *generic_alloc_init (uint64_t base_addr,uint64_t size, -uint32_t page_size) -{ -return generic_alloc_init_flags (base_addr, size, page_size,ALLOC_NO_FLAGS ); +alloc_init (s,0 , start, start + size, page_size); }
tests/libqos/malloc-generic.h +2 -5
@@ -12,10 +12,7 @@#include "libqos/malloc.h" -QGuestAllocator *generic_alloc_init (uint64_t base_addr,uint64_t size, -uint32_t page_size); -QGuestAllocator *generic_alloc_init_flags (uint64_t base_addr,uint64_t size, -uint32_t page_size,QAllocOpts flags); -void generic_alloc_uninit (QGuestAllocator *allocator); +void generic_alloc_init (QGuestAllocator *s,uint64_t base_addr,uint64_t size, +uint32_t page_size);#endif
tests/libqos/malloc-pc.c +2 -16
@@ -24,28 +24,14 @@* Mostly for valgrind happiness, but it does offer * a chokepoint for debugging guest memory leaks, too. */ -void pc_alloc_uninit (QGuestAllocator *allocator) +void pc_alloc_init (QGuestAllocator *s,QTestState *qts,QAllocOpts flags) { -alloc_uninit (allocator); -} - -QGuestAllocator *pc_alloc_init_flags (QTestState *qts,QAllocOpts flags) -{ -QGuestAllocator *s;uint64_t ram_size;QFWCFG *fw_cfg =pc_fw_cfg_init (qts); ram_size =qfw_cfg_get_u64 (fw_cfg,FW_CFG_RAM_SIZE ); - s =alloc_init_flags (flags,1 <<20 ,MIN (ram_size,0xE0000000 )); -alloc_set_page_size (s,PAGE_SIZE ); +alloc_init (s, flags,1 <<20 ,MIN (ram_size,0xE0000000 ),PAGE_SIZE );/* clean-up */ g_free (fw_cfg); - -return s; -} - -inline QGuestAllocator *pc_alloc_init (QTestState *qts) -{ -return pc_alloc_init_flags (qts,ALLOC_NO_FLAGS ); }
tests/libqos/malloc-pc.h +1 -3
@@ -15,8 +15,6 @@#include "libqos/malloc.h" -QGuestAllocator *pc_alloc_init (QTestState *qts); -QGuestAllocator *pc_alloc_init_flags (QTestState *qts,QAllocOpts flags); -void pc_alloc_uninit (QGuestAllocator *allocator); +void pc_alloc_init (QGuestAllocator *s,QTestState *qts,QAllocOpts flags);#endif
tests/libqos/malloc-spapr.c +2 -17
@@ -17,22 +17,7 @@*/ #define SPAPR_MIN_SIZE 0x10000000 -void spapr_alloc_uninit (QGuestAllocator *allocator) +void spapr_alloc_init (QGuestAllocator *s,QTestState *qts,QAllocOpts flags) { -alloc_uninit (allocator); -} - -QGuestAllocator *spapr_alloc_init_flags (QTestState *qts,QAllocOpts flags) -{ -QGuestAllocator *s; - - s =alloc_init_flags (flags,1 <<20 ,SPAPR_MIN_SIZE ); -alloc_set_page_size (s,PAGE_SIZE ); - -return s; -} - -QGuestAllocator *spapr_alloc_init (void ) -{ -return spapr_alloc_init_flags (NULL ,ALLOC_NO_FLAGS ); +alloc_init (s, flags,1 <<20 ,SPAPR_MIN_SIZE ,PAGE_SIZE ); }
tests/libqos/malloc-spapr.h +1 -3
@@ -10,8 +10,6 @@#include "libqos/malloc.h" -QGuestAllocator *spapr_alloc_init (void ); -QGuestAllocator *spapr_alloc_init_flags (QTestState *qts,QAllocOpts flags); -void spapr_alloc_uninit (QGuestAllocator *allocator); +void spapr_alloc_init (QGuestAllocator *s,QTestState *qts,QAllocOpts flags);#endif
tests/libqos/malloc.c +6 -36
81 lines not on this page · raw message
tests/libqos/malloc.h +15 -6
@@ -23,19 +23,28 @@ typedef enum {ALLOC_PARANOID =0x04 } QAllocOpts; -typedef struct QGuestAllocator QGuestAllocator ; +typedef QTAILQ_HEAD(MemList, MemBlock) MemList; -void alloc_uninit (QGuestAllocator *allocator); +typedef struct QGuestAllocator { +QAllocOpts opts; +uint64_t start; +uint64_t end; +uint32_t page_size; + +MemList *used; +MemList *free; +}QGuestAllocator ;/* Always returns page aligned values */ uint64_t guest_alloc (QGuestAllocator *allocator,size_t size);void guest_free (QGuestAllocator *allocator,uint64_t addr);void migrate_allocator (QGuestAllocator *src,QGuestAllocator *dst); -QGuestAllocator *alloc_init (uint64_t start,uint64_t end); -QGuestAllocator *alloc_init_flags (QAllocOpts flags, -uint64_t start,uint64_t end); -void alloc_set_page_size (QGuestAllocator *allocator,size_t page_size);void alloc_set_flags (QGuestAllocator *allocator,QAllocOpts opts); +void alloc_init (QGuestAllocator *alloc,QAllocOpts flags, +uint64_t start,uint64_t end, +size_t page_size); +void alloc_destroy (QGuestAllocator *allocator); +#endif
tests/rtas-test.c +1 -1
@@ -17,7 +17,7 @@ static void test_rtas_get_time_of_day(void) global_qtest = qs->qts; t1 =time (NULL ); - ret =qrtas_get_time_of_day (qs->qts, qs->alloc, &tm, &ns); + ret =qrtas_get_time_of_day (qs->qts, &qs->alloc, &tm, &ns); g_assert_cmpint(ret, ==, 0); t2 =mktimegm (&tm);g_assert (t2 - t1 <5 );/* 5 sec max to run the test */
tests/vhost-user-test.c +5 -5
@@ -158,7 +158,7 @@ typedef struct TestServer {bool test_fail;int test_flags;int queues; -QGuestAllocator *alloc; +QGuestAllocator alloc; } TestServer;static TestServer *test_server_new (const gchar *name);
@@ -206,10 +206,10 @@ static void init_virtio_dev(QTestState *qts, TestServer *s, uint32_t features_maqvirtio_pci_device_enable (s->dev);qvirtio_start_device (&s->dev->vdev); - s->alloc =pc_alloc_init (qts); +pc_alloc_init (&s->alloc, qts,0 );for (i =0 ; i < s->queues *2 ; i++) { - s->vq[i] =qvirtqueue_setup (&s->dev->vdev, s->alloc, i); + s->vq[i] =qvirtqueue_setup (&s->dev->vdev, &s->alloc, i); } features =qvirtio_get_features (&s->dev->vdev);
@@ -224,9 +224,9 @@ static void uninit_virtio_dev(TestServer *s)int i;for (i =0 ; i < s->queues *2 ; i++) { -qvirtqueue_cleanup (s->dev->vdev.bus, s->vq[i], s->alloc); +qvirtqueue_cleanup (s->dev->vdev.bus, s->vq[i], &s->alloc); } -pc_alloc_uninit (s->alloc); +alloc_destroy (&s->alloc);qvirtio_pci_device_free (s->dev); }
tests/virtio-9p-test.c +6 -6
@@ -67,7 +67,7 @@ static QVirtIO9P *qvirtio_9p_pci_start(void)qvirtio_pci_device_enable (dev);qvirtio_start_device (v9p->dev); - v9p->vq =qvirtqueue_setup (v9p->dev, v9p->qs->alloc,0 ); + v9p->vq =qvirtqueue_setup (v9p->dev, &v9p->qs->alloc,0 );qvirtio_set_driver_ok (v9p->dev);
@@ -76,7 +76,7 @@ static QVirtIO9P *qvirtio_9p_pci_start(void)static void qvirtio_9p_pci_stop (QVirtIO9P *v9p) { -qvirtqueue_cleanup (v9p->dev->bus, v9p->vq, v9p->qs->alloc); +qvirtqueue_cleanup (v9p->dev->bus, v9p->vq, &v9p->qs->alloc);qvirtio_pci_device_disable (container_of (v9p->dev, QVirtioPCIDevice, vdev));qvirtio_pci_device_free ((QVirtioPCIDevice *)v9p->dev);qvirtio_9p_stop (v9p);
@@ -222,7 +222,7 @@ static P9Req *v9fs_req_init(QVirtIO9P *v9p, uint32_t size, uint8_t id, req->v9p = v9p; req->t_size = total_size; - req->t_msg =guest_alloc (v9p->qs->alloc, req->t_size); + req->t_msg =guest_alloc (&v9p->qs->alloc, req->t_size);v9fs_memwrite (req, &hdr,7 ); req->tag = tag;return req;
@@ -232,7 +232,7 @@ static void v9fs_req_send(P9Req *req) {QVirtIO9P *v9p = req->v9p; - req->r_msg =guest_alloc (v9p->qs->alloc,P9_MAX_SIZE ); + req->r_msg =guest_alloc (&v9p->qs->alloc,P9_MAX_SIZE ); req->free_head =qvirtqueue_add (v9p->vq, req->t_msg, req->t_size, false, true);qvirtqueue_add (v9p->vq, req->r_msg,P9_MAX_SIZE , true, false);
@@ -290,8 +290,8 @@ static void v9fs_req_free(P9Req *req) {QVirtIO9P *v9p = req->v9p; -guest_free (v9p->qs->alloc, req->t_msg); -guest_free (v9p->qs->alloc, req->r_msg); +guest_free (&v9p->qs->alloc, req->t_msg); +guest_free (&v9p->qs->alloc, req->r_msg);g_free (req); }
tests/virtio-blk-test.c +35 -34
224 lines not on this page · raw message
tests/virtio-net-test.c +5 -5
@@ -228,16 +228,16 @@ static void pci_basic(gconstpointer data) "virtio-net-pci,netdev=hs0", sv[1]); dev =virtio_net_pci_init (qs->pcibus,PCI_SLOT ); - rx = (QVirtQueuePCI *)qvirtqueue_setup (&dev->vdev, qs->alloc,0 ); - tx = (QVirtQueuePCI *)qvirtqueue_setup (&dev->vdev, qs->alloc,1 ); + rx = (QVirtQueuePCI *)qvirtqueue_setup (&dev->vdev, &qs->alloc,0 ); + tx = (QVirtQueuePCI *)qvirtqueue_setup (&dev->vdev, &qs->alloc,1 );driver_init (&dev->vdev); -func (&dev->vdev, qs->alloc, &rx->vq, &tx->vq, sv[0 ]); +func (&dev->vdev, &qs->alloc, &rx->vq, &tx->vq, sv[0 ]);/* End test */ close (sv[0 ]); -qvirtqueue_cleanup (dev->vdev.bus, &tx->vq, qs->alloc); -qvirtqueue_cleanup (dev->vdev.bus, &rx->vq, qs->alloc); +qvirtqueue_cleanup (dev->vdev.bus, &tx->vq, &qs->alloc); +qvirtqueue_cleanup (dev->vdev.bus, &rx->vq, &qs->alloc);qvirtio_pci_device_disable (dev);g_free (dev->pdev);g_free (dev);
tests/virtio-scsi-test.c +7 -7
@@ -62,7 +62,7 @@ static void qvirtio_scsi_pci_free(QVirtIOSCSI *vs)int i;for (i =0 ; i < vs->num_queues +2 ; i++) { -qvirtqueue_cleanup (vs->dev->bus, vs->vq[i], vs->qs->alloc); +qvirtqueue_cleanup (vs->dev->bus, vs->vq[i], &vs->qs->alloc); }qvirtio_pci_device_disable (container_of (vs->dev, QVirtioPCIDevice, vdev));qvirtio_pci_device_free ((QVirtioPCIDevice *)vs->dev);
@@ -75,7 +75,7 @@ static uint64_t qvirtio_scsi_alloc(QVirtIOSCSI *vs, size_t alloc_size, {uint64_t addr; - addr =guest_alloc (vs->qs->alloc, alloc_size); + addr =guest_alloc (&vs->qs->alloc, alloc_size);if (data) {memwrite (addr, data, alloc_size); }
@@ -133,10 +133,10 @@ static uint8_t virtio_scsi_do_command(QVirtIOSCSI *vs, const uint8_t *cdb,memread (resp_addr, resp_out,sizeof (*resp_out)); } -guest_free (vs->qs->alloc, req_addr); -guest_free (vs->qs->alloc, resp_addr); -guest_free (vs->qs->alloc, data_in_addr); -guest_free (vs->qs->alloc, data_out_addr); +guest_free (&vs->qs->alloc, req_addr); +guest_free (&vs->qs->alloc, resp_addr); +guest_free (&vs->qs->alloc, data_in_addr); +guest_free (&vs->qs->alloc, data_out_addr);return response; }
@@ -166,7 +166,7 @@ static QVirtIOSCSI *qvirtio_scsi_pci_init(int slot) g_assert_cmpint(vs->num_queues, <, MAX_NUM_QUEUES);for (i =0 ; i < vs->num_queues +2 ; i++) { - vs->vq[i] =qvirtqueue_setup (vs->dev, vs->qs->alloc, i); + vs->vq[i] =qvirtqueue_setup (vs->dev, &vs->qs->alloc, i); }/* Clear the POWER ON OCCURRED unit attention */
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 09/57] tests/libqos: arm/raspi2 machine node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add arm/raspi2 machine to the graph. This machine contains a generic-sdhci, so its constructor must take care of setting it properly when called.
--- tests/Makefile.include | 1 + tests/libqos/arm-raspi2-machine.c | 91 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 tests/libqos/arm-raspi2-machine.c
tests/Makefile.include +1 -0
@@ -755,6 +755,7 @@ qos-test-obj-y += $(libqos-pc-obj-y) qos-test-obj-y += tests/libqos/sdhci.o # Machines +qos-test-obj-y += tests/libqos/arm-raspi2-machine.o qos-test-obj-y += tests/libqos/x86_64_pc-machine.o check-unit-y += tests/test-qgraph$(EXESUF)
tests/libqos/arm-raspi2-machine.c new file +91 -0
91 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 08/57] tests/libqos: sdhci driver and interface nodes
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add qgraph nodes for sdhci-pci and generic-sdhci (memory mapped) drivers. Both drivers implement (produce) the same interface sdhci, that provides the readw - readq - writeq functions.
--- tests/Makefile.include | 1 + tests/libqos/sdhci.c | 163 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/libqos/sdhci.h | 70 +++++++++++++++++++++ 3 files changed, 234 insertions(+) create mode 100644 tests/libqos/sdhci.c create mode 100644 tests/libqos/sdhci.h
tests/Makefile.include +1 -0
@@ -752,6 +752,7 @@ libqos-virtio-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/libqos/virt # Devices qos-test-obj-y = tests/qos-test.o $(libqgraph-obj-y) qos-test-obj-y += $(libqos-pc-obj-y) +qos-test-obj-y += tests/libqos/sdhci.o # Machines qos-test-obj-y += tests/libqos/x86_64_pc-machine.o
tests/libqos/sdhci.c new file +163 -0
163 lines not on this page · raw message
tests/libqos/sdhci.h new file +70 -0
70 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 10/57] tests/libqos: arm/smdkc210 machine node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add arm/smdkc210 machine machine to the graph. This machine contains generic-sdhci, so its constructor must take care of setting it properly when called.
--- tests/Makefile.include | 1 + tests/libqos/arm-smdkc210-machine.c | 91 +++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 tests/libqos/arm-smdkc210-machine.c
tests/Makefile.include +1 -0
@@ -756,6 +756,7 @@ qos-test-obj-y += tests/libqos/sdhci.o # Machines qos-test-obj-y += tests/libqos/arm-raspi2-machine.o +qos-test-obj-y += tests/libqos/arm-smdkc210-machine.o qos-test-obj-y += tests/libqos/x86_64_pc-machine.o check-unit-y += tests/test-qgraph$(EXESUF)
tests/libqos/arm-smdkc210-machine.c new file +91 -0
91 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 11/57] tests/libqos: arm/sabrelite machine node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add arm/sabrelite machine to the graph. This machine contains generic-sdhci, so its constructor must take care of setting it properly when called.
--- tests/Makefile.include | 1 + tests/libqos/arm-sabrelite-machine.c | 91 ++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 tests/libqos/arm-sabrelite-machine.c
tests/Makefile.include +1 -0
@@ -756,6 +756,7 @@ qos-test-obj-y += tests/libqos/sdhci.o # Machines qos-test-obj-y += tests/libqos/arm-raspi2-machine.o +qos-test-obj-y += tests/libqos/arm-sabrelite-machine.o qos-test-obj-y += tests/libqos/arm-smdkc210-machine.o qos-test-obj-y += tests/libqos/x86_64_pc-machine.o
tests/libqos/arm-sabrelite-machine.c new file +91 -0
91 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 12/57] tests/libqos: arm/xilinx-zynq-a9 machine node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add xilinx-zynq-a9 machine to the graph. This machine contains generic-sdhci, so its constructor must take care of setting it properly when called.
--- tests/Makefile.include | 1 + tests/libqos/arm-xilinx-zynq-a9-machine.c | 94 +++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 tests/libqos/arm-xilinx-zynq-a9-machine.c
tests/Makefile.include +1 -0
@@ -758,6 +758,7 @@ qos-test-obj-y += tests/libqos/sdhci.o qos-test-obj-y += tests/libqos/arm-raspi2-machine.o qos-test-obj-y += tests/libqos/arm-sabrelite-machine.o qos-test-obj-y += tests/libqos/arm-smdkc210-machine.o +qos-test-obj-y += tests/libqos/arm-xilinx-zynq-a9-machine.o qos-test-obj-y += tests/libqos/x86_64_pc-machine.o check-unit-y += tests/test-qgraph$(EXESUF)
tests/libqos/arm-xilinx-zynq-a9-machine.c new file +94 -0
94 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 13/57] tests/libqos: aarch64/xlnx-zcu102 machine node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add xlnx-zcu102 machine to the graph. This machine contains generic-sdhci, so its constructor must take care of setting it properly when called.
--- tests/Makefile.include | 1 + tests/libqos/aarch64-xlnx-zcu102-machine.c | 94 ++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 tests/libqos/aarch64-xlnx-zcu102-machine.c
tests/Makefile.include +1 -0
@@ -755,6 +755,7 @@ qos-test-obj-y += $(libqos-pc-obj-y) qos-test-obj-y += tests/libqos/sdhci.o # Machines +qos-test-obj-y += tests/libqos/aarch64-xlnx-zcu102-machine.o qos-test-obj-y += tests/libqos/arm-raspi2-machine.o qos-test-obj-y += tests/libqos/arm-sabrelite-machine.o qos-test-obj-y += tests/libqos/arm-smdkc210-machine.o
tests/libqos/aarch64-xlnx-zcu102-machine.c new file +94 -0
94 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 15/57] tests/qgraph: add generic PCI testcases
In reply to Paolo Bonzini--- tests/Makefile.include | 1 + tests/pci-test.c | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 tests/pci-test.c
tests/Makefile.include +1 -0
@@ -760,6 +760,7 @@ qos-test-obj-y += tests/libqos/arm-xilinx-zynq-a9-machine.o qos-test-obj-y += tests/libqos/x86_64_pc-machine.o # Tests +qos-test-obj-y += tests/pci-test.o qos-test-obj-y += tests/sdhci-test.o check-unit-y += tests/test-qgraph$(EXESUF)
tests/pci-test.c new file +25 -0
@@ -0,0 +1,25 @@ +/* +* QTest testcase for PCI +* +* Copyright (c) 2018 Red Hat, Inc. +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#include "qemu/osdep.h" +#include "libqtest.h" +#include "libqos/qgraph.h" +#include "libqos/pci.h" + +/* Tests only initialization so far. TODO: Replace with functional tests */ +static void nop (void *obj,void *data,QGuestAllocator *alloc) +{ +} + +static void register_pci_test (void ) +{ +qos_add_test ("nop" ,"pci-device" , nop,NULL ); +} + +libqos_init (register_pci_test);
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 14/57] qos-test: sdhci test node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Convert tests/sdhci-test in first qgraph test node, sdhci-test. This test consumes an sdhci interface and checks that its function return the expected values.
Note that this test does not allocate any sdhci structure, it's all done by the qtest walking graph mechanism
--- tests/Makefile.include | 7 +- tests/sdhci-test.c | 185 ++++++------------------------------------------- 2 files changed, 24 insertions(+), 168 deletions(-)
tests/Makefile.include +3 -4
@@ -229,7 +229,6 @@ check-qtest-i386-y += tests/test-announce-self$(EXESUF) check-qtest-i386-y += tests/test-x86-cpuid-compat$(EXESUF) check-qtest-i386-y += tests/numa-test$(EXESUF) check-qtest-x86_64-y += $(check-qtest-i386-y) -check-qtest-x86_64-$(CONFIG_SDHCI) += tests/sdhci-test$(EXESUF) check-qtest-alpha-y += tests/boot-serial-test$(EXESUF) check-qtest-alpha-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF)
@@ -299,11 +298,9 @@ check-qtest-arm-y += tests/m25p80-test$(EXESUF) check-qtest-arm-$(CONFIG_VIRTIO_BLK) += tests/virtio-blk-test$(EXESUF) check-qtest-arm-y += tests/test-arm-mptimer$(EXESUF) check-qtest-arm-y += tests/boot-serial-test$(EXESUF) -check-qtest-arm-$(CONFIG_SDHCI) += tests/sdhci-test$(EXESUF) check-qtest-arm-y += tests/hexloader-test$(EXESUF) check-qtest-aarch64-y = tests/numa-test$(EXESUF) -check-qtest-aarch64-$(CONFIG_SDHCI) += tests/sdhci-test$(EXESUF) check-qtest-aarch64-y += tests/boot-serial-test$(EXESUF) check-qtest-aarch64-y += tests/migration-test$(EXESUF)
@@ -762,6 +759,9 @@ qos-test-obj-y += tests/libqos/arm-smdkc210-machine.o qos-test-obj-y += tests/libqos/arm-xilinx-zynq-a9-machine.o qos-test-obj-y += tests/libqos/x86_64_pc-machine.o +# Tests +qos-test-obj-y += tests/sdhci-test.o + check-unit-y += tests/test-qgraph$(EXESUF) tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y)
@@ -857,7 +857,6 @@ tests/test-arm-mptimer$(EXESUF): tests/test-arm-mptimer.o tests/test-qapi-util$(EXESUF): tests/test-qapi-util.o $(test-util-obj-y) tests/numa-test$(EXESUF): tests/numa-test.o tests/vmgenid-test$(EXESUF): tests/vmgenid-test.o tests/boot-sector.o tests/acpi-utils.o -tests/sdhci-test$(EXESUF): tests/sdhci-test.o $(libqos-pc-obj-y) tests/cdrom-test$(EXESUF): tests/cdrom-test.o tests/boot-sector.o $(libqos-obj-y) tests/migration/stress$(EXESUF): tests/migration/stress.o
tests/sdhci-test.c +21 -164
243 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 16/57] tests/libqos: pci-spapr driver and interface nodes
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add pci-bus-spapr node, that produces pci-bus. Move QPCIBusSPAPR struct declaration in its header (since it will be needed by other drivers) and introduce a setter method for drivers that do not need to allocate but have to initialize QPCIBusSPAPR.
--- tests/Makefile.include | 2 +- tests/libqos/pci-spapr.c | 116 +++++++++++++++++++++++++---------------------- tests/libqos/pci-spapr.h | 24 ++++++++++ 3 files changed, 88 insertions(+), 54 deletions(-)
tests/Makefile.include +1 -1
@@ -748,7 +748,7 @@ libqos-virtio-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/libqos/virt # Devices qos-test-obj-y = tests/qos-test.o $(libqgraph-obj-y) -qos-test-obj-y += $(libqos-pc-obj-y) +qos-test-obj-y += $(libqos-pc-obj-y) $(libqos-spapr-obj-y) qos-test-obj-y += tests/libqos/sdhci.o # Machines
tests/libqos/pci-spapr.c +63 -53
156 lines not on this page · raw message
tests/libqos/pci-spapr.h +24 -0
@@ -10,7 +10,31 @@#include "libqos/malloc.h" #include "libqos/pci.h" +#include "libqos/qgraph.h" +/* From include/hw/pci-host/spapr.h */ + +typedef struct QPCIWindow { +uint64_t pci_base;/* window address in PCI space */ +uint64_t size;/* window size */ +}QPCIWindow ; + +typedef struct QPCIBusSPAPR { +QOSGraphObject obj; +QPCIBus bus; +QGuestAllocator *alloc; + +uint64_t buid; + +uint64_t pio_cpu_base; +QPCIWindow pio; + +uint64_t mmio32_cpu_base; +QPCIWindow mmio32; +}QPCIBusSPAPR ; + +void qpci_init_spapr (QPCIBusSPAPR *ret,QTestState *qts, +QGuestAllocator *alloc);QPCIBus *qpci_new_spapr (QTestState *qts,QGuestAllocator *alloc);void qpci_free_spapr (QPCIBus *bus);
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 17/57] tests/qgraph: ppc64/pseries machine node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add pseries machine for the ppc64 QEMU binary. This machine contains a spapr-pci-host-bridge driver, that contains itself a pci-bus-spapr that produces the pci-bus interface.
--- tests/Makefile.include | 1 + tests/libqos/ppc64_pseries-machine.c | 111 +++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 tests/libqos/ppc64_pseries-machine.c
tests/Makefile.include +1 -0
@@ -757,6 +757,7 @@ qos-test-obj-y += tests/libqos/arm-raspi2-machine.o qos-test-obj-y += tests/libqos/arm-sabrelite-machine.o qos-test-obj-y += tests/libqos/arm-smdkc210-machine.o qos-test-obj-y += tests/libqos/arm-xilinx-zynq-a9-machine.o +qos-test-obj-y += tests/libqos/ppc64_pseries-machine.o qos-test-obj-y += tests/libqos/x86_64_pc-machine.o # Tests
tests/libqos/ppc64_pseries-machine.c new file +111 -0
111 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 18/57] tests/libqos: has_buggy_msi flag
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
The Qgraph framework makes any test using
pci bus run the same function using pci-pci and pci-spapr bus. However, some tests are not ready to use the spapr bus, due to a MSI bug. Until it does not get fixed, this flag allows them to skip the test
--- tests/libqos/pci-pc.c | 3 +++ tests/libqos/pci-spapr.c | 3 +++ tests/libqos/pci.c | 14 ++++++++++++++ tests/libqos/pci.h | 4 ++++ 4 files changed, 24 insertions(+)
tests/libqos/pci-pc.c +3 -0
@@ -124,6 +124,9 @@ void qpci_init_pc(QPCIBusPC *qpci, QTestState *qts, QGuestAllocator *alloc) {assert (qts); +/* tests can use pci-bus */ + qpci->bus.has_buggy_msi = FALSE; + qpci->bus.pio_readb = qpci_pc_pio_readb; qpci->bus.pio_readw = qpci_pc_pio_readw; qpci->bus.pio_readl = qpci_pc_pio_readl;
tests/libqos/pci-spapr.c +3 -0
@@ -155,6 +155,9 @@ void qpci_init_spapr(QPCIBusSPAPR *qpci, QTestState *qts, {assert (qts); +/* tests cannot use spapr, needs to be fixed first */ + qpci->bus.has_buggy_msi = TRUE; + qpci->alloc = alloc; qpci->bus.pio_readb = qpci_spapr_pio_readb;
tests/libqos/pci.c +14 -0
@@ -51,6 +51,20 @@ void qpci_device_foreach(QPCIBus *bus, int vendor_id, int device_id, } } +bool qpci_has_buggy_msi (QPCIDevice *dev) +{ +return dev->bus->has_buggy_msi; +} + +bool qpci_check_buggy_msi (QPCIDevice *dev) +{ +if (qpci_has_buggy_msi (dev)) { +g_test_skip ("Skipping due to incomplete support for MSI" ); +return true; + } +return false; +} +static void qpci_device_set (QPCIDevice *dev,QPCIBus *bus,int devfn) {g_assert (dev);
tests/libqos/pci.h +4 -0
@@ -53,6 +53,7 @@ struct QPCIBus {QTestState *qts;uint16_t pio_alloc_ptr;uint64_t mmio_alloc_ptr, mmio_limit; +bool has_buggy_msi;/* TRUE for spapr, FALSE for pci */ };
@@ -81,6 +82,9 @@ void qpci_device_foreach(QPCIBus *bus, int vendor_id, int device_id,QPCIDevice *qpci_device_find (QPCIBus *bus,int devfn);void qpci_device_init (QPCIDevice *dev,QPCIBus *bus,QPCIAddress *addr); +bool qpci_has_buggy_msi (QPCIDevice *dev); +bool qpci_check_buggy_msi (QPCIDevice *dev); +void qpci_device_enable (QPCIDevice *dev);uint8_t qpci_find_capability (QPCIDevice *dev,uint8_t id);void qpci_msix_enable (QPCIDevice *dev);
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 05/57] tests: qgraph API for the qtest driver framework
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add qgraph API that allows to add/remove nodes and edges from the graph, implementation of Depth First Search to discover the paths and basic unit test to check correctness of the API.
Included also a main executable that takes care of starting the framework, create the nodes, set the available drivers/machines, discover the path and run tests.
graph.h provides the public API to manage the graph nodes/edges graph_extra.h provides a more private API used successively by the gtest integration part qos-test.c provides the main executable
[Paolo's changes compared to the Google Summer of Code submission:
* added subprocess to test options
* refactored object creation to support live migration tests
* removed driver .before callback (unused)
* removed test .after callbacks (replaced by GTest destruction queue)]
--- configure | 2 +- include/qemu/module.h | 2 + tests/Makefile.include | 13 +- tests/libqos/qgraph.c | 753 +++++++++++++++++++++++++++++++++++++++++ tests/libqos/qgraph.h | 575 +++++++++++++++++++++++++++++++ tests/libqos/qgraph_internal.h | 257 ++++++++++++++ tests/libqtest.h | 3 + tests/qos-test.c | 445 ++++++++++++++++++++++++ tests/test-qgraph.c | 434 ++++++++++++++++++++++++ 9 files changed, 2481 insertions(+), 3 deletions(-) create mode 100644 tests/libqos/qgraph.c create mode 100644 tests/libqos/qgraph.h create mode 100644 tests/libqos/qgraph_internal.h create mode 100644 tests/qos-test.c create mode 100644 tests/test-qgraph.c
configure +1 -1
@@ -7647,7 +7647,7 @@ fi # tests might fail. Prefer to keep the relevant files in their own # directory and symlink the directory instead. DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/qapi-schema tests/tcg/xtensa tests/qemu-iotests tests/vm" -DIRS="$DIRS tests/fp" +DIRS="$DIRS tests/fp tests/qgraph" DIRS="$DIRS docs docs/interop fsdev scsi" DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas pc-bios/s390-ccw" DIRS="$DIRS roms/seabios roms/vgabios"
include/qemu/module.h +2 -0
@@ -45,6 +45,7 @@ typedef enum {MODULE_INIT_QOM ,MODULE_INIT_TRACE ,MODULE_INIT_XEN_BACKEND , +MODULE_INIT_LIBQOS , MODULE_INIT_MAX } module_init_type;
@@ -54,6 +55,7 @@ typedef enum {#define trace_init (function) module_init(function, MODULE_INIT_TRACE)#define xen_backend_init (function) module_init(function, \ MODULE_INIT_XEN_BACKEND) +#define libqos_init (function) module_init(function, MODULE_INIT_LIBQOS)#define block_module_load_one (lib) module_load_one("block-", lib)#define ui_module_load_one (lib) module_load_one("ui-", lib)
tests/Makefile.include +11 -2
@@ -732,7 +732,10 @@ tests/test-crypto-ivgen$(EXESUF): tests/test-crypto-ivgen.o $(test-crypto-obj-y) tests/test-crypto-afsplit$(EXESUF): tests/test-crypto-afsplit.o $(test-crypto-obj-y) tests/test-crypto-block$(EXESUF): tests/test-crypto-block.o $(test-crypto-obj-y) -libqos-obj-y = tests/libqos/pci.o tests/libqos/fw_cfg.o tests/libqos/malloc.o +libqgraph-obj-y = tests/libqos/qgraph.o + +libqos-obj-y = $(libqgraph-obj-y) tests/libqos/pci.o tests/libqos/fw_cfg.o +libqos-obj-y += tests/libqos/malloc.o tests/libqos/malloc-generic.o libqos-obj-y += tests/libqos/i2c.o tests/libqos/libqos.o libqos-spapr-obj-y = $(libqos-obj-y) tests/libqos/malloc-spapr.o libqos-spapr-obj-y += tests/libqos/libqos-spapr.o
@@ -744,7 +747,13 @@ libqos-pc-obj-y += tests/libqos/ahci.o libqos-omap-obj-y = $(libqos-obj-y) tests/libqos/i2c-omap.o libqos-imx-obj-y = $(libqos-obj-y) tests/libqos/i2c-imx.o libqos-usb-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/libqos/usb.o -libqos-virtio-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/libqos/virtio.o tests/libqos/virtio-pci.o tests/libqos/virtio-mmio.o tests/libqos/malloc-generic.o +libqos-virtio-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/libqos/virtio.o tests/libqos/virtio-pci.o tests/libqos/virtio-mmio.o + +check-unit-y += tests/test-qgraph$(EXESUF) +tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y) + +check-qtest-generic-y += tests/qos-test$(EXESUF) +tests/qos-test$(EXESUF): tests/qos-test.o $(libqgraph-obj-y) tests/qmp-test$(EXESUF): tests/qmp-test.o tests/qmp-cmd-test$(EXESUF): tests/qmp-cmd-test.o
tests/libqos/qgraph.c new file +753 -0
753 lines not on this page · raw message
tests/libqos/qgraph.h new file +575 -0
575 lines not on this page · raw message
tests/libqos/qgraph_internal.h new file +257 -0
257 lines not on this page · raw message
tests/libqtest.h +3 -0
@@ -598,6 +598,9 @@ static inline QTestState *qtest_start(const char *args)*/ static inline void qtest_end (void ) { +if (!global_qtest) { +return ; + }qtest_quit (global_qtest); global_qtest =NULL ; }
tests/qos-test.c new file +445 -0
445 lines not on this page · raw message
tests/test-qgraph.c new file +434 -0
434 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 19/57] tests/libqos: e1000e driver and interface nodes
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add qgraph nodes for virtio-e1000e.
It consumes a pci-bus, and it's directly used by tests (e1000e is pci based).
--- tests/Makefile.include | 1 + tests/libqos/e1000e.c | 260 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/libqos/e1000e.h | 53 ++++++++++ 3 files changed, 314 insertions(+) create mode 100644 tests/libqos/e1000e.c create mode 100644 tests/libqos/e1000e.h
tests/Makefile.include +1 -0
@@ -749,6 +749,7 @@ libqos-virtio-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/libqos/virt # Devices qos-test-obj-y = tests/qos-test.o $(libqgraph-obj-y) qos-test-obj-y += $(libqos-pc-obj-y) $(libqos-spapr-obj-y) +qos-test-obj-y += tests/libqos/e1000e.o qos-test-obj-y += tests/libqos/sdhci.o # Machines
tests/libqos/e1000e.c new file +260 -0
260 lines not on this page · raw message
tests/libqos/e1000e.h new file +53 -0
53 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 21/57] tests/libqos: virtio-pci driver and interface nodes
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add QOSGraphObject to QVirtioPCIDevice structure, with a basic constructor. virtio-pci is not present in qgraph, since it will be used as starting point by its subclasses (virtio-*-pci)
--- tests/Makefile.include | 1 + tests/libqos/virtio-pci.c | 106 ++++++++++++++++++++++++++++++++++------------ tests/libqos/virtio-pci.h | 14 ++++++ tests/virtio-blk-test.c | 6 +++ 4 files changed, 99 insertions(+), 28 deletions(-)
tests/Makefile.include +1 -0
@@ -750,6 +750,7 @@ qos-test-obj-y = tests/qos-test.o $(libqgraph-obj-y) qos-test-obj-y += $(libqos-pc-obj-y) $(libqos-spapr-obj-y) qos-test-obj-y += tests/libqos/e1000e.o qos-test-obj-y += tests/libqos/sdhci.o +qos-test-obj-y += $(libqos-virtio-obj-y) # Machines qos-test-obj-y += tests/libqos/aarch64-xlnx-zcu102-machine.o
tests/libqos/virtio-pci.c +78 -28
240 lines not on this page · raw message
tests/libqos/virtio-pci.h +14 -0
@@ -12,8 +12,10 @@#include "libqos/virtio.h" #include "libqos/pci.h" +#include "libqos/qgraph.h" typedef struct QVirtioPCIDevice { + QOSGraphObject obj; QVirtioDevice vdev; QPCIDevice *pdev; QPCIBar bar;
@@ -31,11 +33,23 @@ typedef struct QVirtQueuePCI {extern const QVirtioBus qvirtio_pci; +void virtio_pci_init (QVirtioPCIDevice *dev,QPCIBus *bus,QPCIAddress * addr); +QVirtioPCIDevice *virtio_pci_new (QPCIBus *bus,QPCIAddress * addr);QVirtioPCIDevice *qvirtio_pci_device_find (QPCIBus *bus,uint16_t device_type);QVirtioPCIDevice *qvirtio_pci_device_find_slot (QPCIBus *bus,uint16_t device_type,int slot);void qvirtio_pci_device_free (QVirtioPCIDevice *dev); +/* virtio-pci object functions available for subclasses that +* override the original start_hw and destroy +* function. All virtio-xxx-pci subclass that override must +* take care of calling these two functions in the respective +* places +*/ +void qvirtio_pci_destructor (QOSGraphObject *obj); +void qvirtio_pci_start_hw (QOSGraphObject *obj); + +void qvirtio_pci_device_enable (QVirtioPCIDevice *d);void qvirtio_pci_device_disable (QVirtioPCIDevice *d);
tests/virtio-blk-test.c +6 -0
@@ -412,6 +412,7 @@ static void pci_basic(void)qvirtqueue_cleanup (dev->vdev.bus, &vqpci->vq, &qs->alloc);qvirtio_pci_device_disable (dev);qvirtio_pci_device_free (dev); +g_free (dev);qtest_shutdown (qs); }
@@ -505,6 +506,7 @@ static void pci_indirect(void)qvirtqueue_cleanup (dev->vdev.bus, &vqpci->vq, &qs->alloc);qvirtio_pci_device_disable (dev);qvirtio_pci_device_free (dev); +g_free (dev);qtest_shutdown (qs); }
@@ -534,6 +536,7 @@ static void pci_config(void)qvirtio_pci_device_disable (dev);qvirtio_pci_device_free (dev); +g_free (dev);qtest_shutdown (qs); }
@@ -642,6 +645,7 @@ static void pci_msix(void)qpci_msix_disable (dev->pdev);qvirtio_pci_device_disable (dev);qvirtio_pci_device_free (dev); +g_free (dev);qtest_shutdown (qs); }
@@ -765,6 +769,7 @@ static void pci_idx(void)qpci_msix_disable (dev->pdev);qvirtio_pci_device_disable (dev);qvirtio_pci_device_free (dev); +g_free (dev);qtest_shutdown (qs); }
@@ -785,6 +790,7 @@ static void pci_hotplug(void)g_assert (dev);qvirtio_pci_device_disable (dev);qvirtio_pci_device_free (dev); +g_free (dev);/* unplug secondary disk */ if (strcmp (arch,"i386" ) ==0 ||strcmp (arch,"x86_64" ) ==0 ) {
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 22/57] tests/libqos: remove global_qtest from virtio endianness checks
In reply to Paolo BonziniThis is needed to support migration tests with qgraph.
--- tests/libqos/virtio-pci.c | 11 ++++++++++- tests/libqos/virtio.c | 5 +++++ tests/libqos/virtio.h | 8 ++------ 3 files changed, 17 insertions(+), 7 deletions(-)
tests/libqos/virtio-pci.c +10 -1
@@ -43,6 +43,14 @@ typedef struct QVirtioPCIForeachData {void *user_data; } QVirtioPCIForeachData; +static inline bool qvirtio_pci_is_big_endian (QVirtioPCIDevice *dev) +{ +QPCIBus *bus = dev->pdev->bus; + +/* FIXME: virtio 1.0 is always little-endian */ +return qtest_big_endian (bus->qts); +} +void qvirtio_pci_device_free (QVirtioPCIDevice *dev) {g_free (dev->pdev);
@@ -56,6 +64,7 @@ static void qvirtio_pci_init_from_pcidev(QVirtioPCIDevice *dev, QPCIDevice *pci_ dev->config_msix_entry =-1 ; dev->vdev.bus = &qvirtio_pci; + dev->vdev.big_endian =qvirtio_pci_is_big_endian (dev);/* each virtio-xxx-pci device should override at least this function */ dev->obj.get_driver =NULL ;
@@ -99,7 +108,7 @@ static uint8_t qvirtio_pci_config_readb(QVirtioDevice *d, uint64_t off)* so with a big-endian guest the order has been reversed, * reverse it again * virtio-1.0 is always little-endian, like PCI, but this -* case will be managed inside qvirtio_is_big_endian() +* case will be managed inside qvirtio_pci_is_big_endian() */ static uint16_t qvirtio_pci_config_readw (QVirtioDevice *d,uint64_t off)
tests/libqos/virtio.c +5 -0
@@ -372,3 +372,8 @@ void qvirtio_start_device(QVirtioDevice *vdev)qvirtio_set_acknowledge (vdev);qvirtio_set_driver (vdev); } + +bool qvirtio_is_big_endian (QVirtioDevice *d) +{ +return d->big_endian; +}
tests/libqos/virtio.h +2 -6
@@ -21,6 +21,7 @@ typedef struct QVirtioDevice {const QVirtioBus *bus;/* Device type */ uint16_t device_type; +bool big_endian; } QVirtioDevice; typedef struct QVirtQueue {
@@ -90,12 +91,6 @@ struct QVirtioBus {void (*virtqueue_kick)(QVirtioDevice *d,QVirtQueue *vq); }; -static inline bool qvirtio_is_big_endian (QVirtioDevice *d) -{ -/* FIXME: virtio 1.0 is always little-endian */ -return qtest_big_endian (global_qtest); -} -static inline uint32_t qvring_size (uint32_t num,uint32_t align) { return ((sizeof(struct vring_desc) * num + sizeof(uint16_t) * (3 + num)
@@ -109,6 +104,7 @@ uint32_t qvirtio_config_readl(QVirtioDevice *d, uint64_t addr);uint64_t qvirtio_config_readq (QVirtioDevice *d,uint64_t addr);uint32_t qvirtio_get_features (QVirtioDevice *d);void qvirtio_set_features (QVirtioDevice *d,uint32_t features); +bool qvirtio_is_big_endian (QVirtioDevice *d);void qvirtio_reset (QVirtioDevice *d);void qvirtio_set_acknowledge (QVirtioDevice *d);
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 20/57] qos-test: e1000e test node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Convert tests/e1000e-test in qgraph test node, e1000e-test. This test consumes an e1000e interface and checks that its function return the expected values.
Note that this test does not allocate any e1000e structure, it's all done by the qtest walking graph mechanism
--- tests/Makefile.include | 3 +- tests/e1000e-test.c | 356 +++++++++++-------------------------------------- 2 files changed, 78 insertions(+), 281 deletions(-)
tests/Makefile.include +1 -2
@@ -167,7 +167,6 @@ check-qtest-virtio-$(CONFIG_VIRTIO_SERIAL) += tests/virtio-serial-test$(EXESUF) check-qtest-virtio-y += $(check-qtest-virtioserial-y) check-qtest-pci-y += tests/e1000-test$(EXESUF) -check-qtest-pci-y += tests/e1000e-test$(EXESUF) check-qtest-pci-$(CONFIG_RTL8139_PCI) += tests/rtl8139-test$(EXESUF) check-qtest-pci-$(CONFIG_PCNET_PCI) += tests/pcnet-test$(EXESUF) check-qtest-pci-$(CONFIG_EEPRO100_PCI) += tests/eepro100-test$(EXESUF)
@@ -762,6 +761,7 @@ qos-test-obj-y += tests/libqos/ppc64_pseries-machine.o qos-test-obj-y += tests/libqos/x86_64_pc-machine.o # Tests +qos-test-obj-y += tests/e1000e-test.o qos-test-obj-y += tests/pci-test.o qos-test-obj-y += tests/sdhci-test.o
@@ -801,7 +801,6 @@ tests/i440fx-test$(EXESUF): tests/i440fx-test.o $(libqos-pc-obj-y) tests/q35-test$(EXESUF): tests/q35-test.o $(libqos-pc-obj-y) tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y) tests/e1000-test$(EXESUF): tests/e1000-test.o -tests/e1000e-test$(EXESUF): tests/e1000e-test.o $(libqos-pc-obj-y) tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o $(libqos-pc-obj-y) tests/pcnet-test$(EXESUF): tests/pcnet-test.o tests/pnv-xscom-test$(EXESUF): tests/pnv-xscom-test.o
tests/e1000e-test.c +77 -279
420 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 23/57] tests/libqos: virtio-mmio driver and interface nodes
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add virtio-mmio node in qgraph framework.
virtio-mmio produces virtio-bus, the interface consumed by all virtio-*-device nodes.
Being a memory-mapped device, it doesn't have to provide a constructor to qgraph, since it's always "contained" inside some other nodes.
--- tests/libqos/virtio-mmio.c | 116 +++++++++++++++++++++++++++------------------ tests/libqos/virtio-mmio.h | 6 ++- tests/virtio-blk-test.c | 3 +- 3 files changed, 77 insertions(+), 48 deletions(-)
tests/libqos/virtio-mmio.c +70 -46
@@ -12,74 +12,74 @@#include "libqos/virtio.h" #include "libqos/virtio-mmio.h" #include "libqos/malloc.h" -#include "libqos/malloc-generic.h" +#include "libqos/qgraph.h" #include "standard-headers/linux/virtio_ring.h" static uint8_t qvirtio_mmio_config_readb (QVirtioDevice *d,uint64_t off) { -QVirtioMMIODevice *dev = (QVirtioMMIODevice *)d; -return readb (dev->addr +QVIRTIO_MMIO_DEVICE_SPECIFIC + off); +QVirtioMMIODevice *dev =container_of (d, QVirtioMMIODevice, vdev); +return qtest_readb (dev->qts, dev->addr +QVIRTIO_MMIO_DEVICE_SPECIFIC + off); }static uint16_t qvirtio_mmio_config_readw (QVirtioDevice *d,uint64_t off) { -QVirtioMMIODevice *dev = (QVirtioMMIODevice *)d; -return readw (dev->addr +QVIRTIO_MMIO_DEVICE_SPECIFIC + off); +QVirtioMMIODevice *dev =container_of (d, QVirtioMMIODevice, vdev); +return qtest_readw (dev->qts, dev->addr +QVIRTIO_MMIO_DEVICE_SPECIFIC + off); }static uint32_t qvirtio_mmio_config_readl (QVirtioDevice *d,uint64_t off) { -QVirtioMMIODevice *dev = (QVirtioMMIODevice *)d; -return readl (dev->addr +QVIRTIO_MMIO_DEVICE_SPECIFIC + off); +QVirtioMMIODevice *dev =container_of (d, QVirtioMMIODevice, vdev); +return qtest_readl (dev->qts, dev->addr +QVIRTIO_MMIO_DEVICE_SPECIFIC + off); }static uint64_t qvirtio_mmio_config_readq (QVirtioDevice *d,uint64_t off) { -QVirtioMMIODevice *dev = (QVirtioMMIODevice *)d; -return readq (dev->addr +QVIRTIO_MMIO_DEVICE_SPECIFIC + off); +QVirtioMMIODevice *dev =container_of (d, QVirtioMMIODevice, vdev); +return qtest_readq (dev->qts, dev->addr +QVIRTIO_MMIO_DEVICE_SPECIFIC + off); }static uint32_t qvirtio_mmio_get_features (QVirtioDevice *d) { -QVirtioMMIODevice *dev = (QVirtioMMIODevice *)d; -writel (dev->addr +QVIRTIO_MMIO_HOST_FEATURES_SEL ,0 ); -return readl (dev->addr +QVIRTIO_MMIO_HOST_FEATURES ); +QVirtioMMIODevice *dev =container_of (d, QVirtioMMIODevice, vdev); +qtest_writel (dev->qts, dev->addr +QVIRTIO_MMIO_HOST_FEATURES_SEL ,0 ); +return qtest_readl (dev->qts, dev->addr +QVIRTIO_MMIO_HOST_FEATURES ); }static void qvirtio_mmio_set_features (QVirtioDevice *d,uint32_t features) { -QVirtioMMIODevice *dev = (QVirtioMMIODevice *)d; +QVirtioMMIODevice *dev =container_of (d, QVirtioMMIODevice, vdev); dev->features = features; -writel (dev->addr +QVIRTIO_MMIO_GUEST_FEATURES_SEL ,0 ); -writel (dev->addr +QVIRTIO_MMIO_GUEST_FEATURES , features); +qtest_writel (dev->qts, dev->addr +QVIRTIO_MMIO_GUEST_FEATURES_SEL ,0 ); +qtest_writel (dev->qts, dev->addr +QVIRTIO_MMIO_GUEST_FEATURES , features); }static uint32_t qvirtio_mmio_get_guest_features (QVirtioDevice *d) { -QVirtioMMIODevice *dev = (QVirtioMMIODevice *)d; +QVirtioMMIODevice *dev =container_of (d, QVirtioMMIODevice, vdev);return dev->features; }static uint8_t qvirtio_mmio_get_status (QVirtioDevice *d) { -QVirtioMMIODevice *dev = (QVirtioMMIODevice *)d; -return (uint8_t )readl (dev->addr +QVIRTIO_MMIO_DEVICE_STATUS ); +QVirtioMMIODevice *dev =container_of (d, QVirtioMMIODevice, vdev); +return (uint8_t )qtest_readl (dev->qts, dev->addr +QVIRTIO_MMIO_DEVICE_STATUS ); }static void qvirtio_mmio_set_status (QVirtioDevice *d,uint8_t status) { -QVirtioMMIODevice *dev = (QVirtioMMIODevice *)d; -writel (dev->addr +QVIRTIO_MMIO_DEVICE_STATUS , (uint32_t )status); +QVirtioMMIODevice *dev =container_of (d, QVirtioMMIODevice, vdev); +qtest_writel (dev->qts, dev->addr +QVIRTIO_MMIO_DEVICE_STATUS , (uint32_t )status); }static bool qvirtio_mmio_get_queue_isr_status (QVirtioDevice *d,QVirtQueue *vq) { -QVirtioMMIODevice *dev = (QVirtioMMIODevice *)d; +QVirtioMMIODevice *dev =container_of (d, QVirtioMMIODevice, vdev);uint32_t isr; - isr =readl (dev->addr +QVIRTIO_MMIO_INTERRUPT_STATUS ) &1 ; + isr =qtest_readl (dev->qts, dev->addr +QVIRTIO_MMIO_INTERRUPT_STATUS ) &1 ;if (isr !=0 ) { -writel (dev->addr +QVIRTIO_MMIO_INTERRUPT_ACK ,1 ); +qtest_writel (dev->qts, dev->addr +QVIRTIO_MMIO_INTERRUPT_ACK ,1 );return true; }
@@ -88,12 +88,12 @@ static bool qvirtio_mmio_get_queue_isr_status(QVirtioDevice *d, QVirtQueue *vq)static bool qvirtio_mmio_get_config_isr_status (QVirtioDevice *d) { -QVirtioMMIODevice *dev = (QVirtioMMIODevice *)d; +QVirtioMMIODevice *dev =container_of (d, QVirtioMMIODevice, vdev);uint32_t isr; - isr =readl (dev->addr +QVIRTIO_MMIO_INTERRUPT_STATUS ) &2 ; + isr =qtest_readl (dev->qts, dev->addr +QVIRTIO_MMIO_INTERRUPT_STATUS ) &2 ;if (isr !=0 ) { -writel (dev->addr +QVIRTIO_MMIO_INTERRUPT_ACK ,2 ); +qtest_writel (dev->qts, dev->addr +QVIRTIO_MMIO_INTERRUPT_ACK ,2 );return true; }
@@ -102,34 +102,34 @@ static bool qvirtio_mmio_get_config_isr_status(QVirtioDevice *d)static void qvirtio_mmio_queue_select (QVirtioDevice *d,uint16_t index) { -QVirtioMMIODevice *dev = (QVirtioMMIODevice *)d; -writel (dev->addr +QVIRTIO_MMIO_QUEUE_SEL , (uint32_t )index); +QVirtioMMIODevice *dev =container_of (d, QVirtioMMIODevice, vdev); +qtest_writel (dev->qts, dev->addr +QVIRTIO_MMIO_QUEUE_SEL , (uint32_t )index); - g_assert_cmphex(readl(dev->addr + QVIRTIO_MMIO_QUEUE_PFN), ==, 0); + g_assert_cmphex(qtest_readl(dev->qts, dev->addr + QVIRTIO_MMIO_QUEUE_PFN), ==, 0); }static uint16_t qvirtio_mmio_get_queue_size (QVirtioDevice *d) { -QVirtioMMIODevice *dev = (QVirtioMMIODevice *)d; -return (uint16_t )readl (dev->addr +QVIRTIO_MMIO_QUEUE_NUM_MAX ); +QVirtioMMIODevice *dev =container_of (d, QVirtioMMIODevice, vdev); +return (uint16_t )qtest_readl (dev->qts, dev->addr +QVIRTIO_MMIO_QUEUE_NUM_MAX ); }static void qvirtio_mmio_set_queue_address (QVirtioDevice *d,uint32_t pfn) { -QVirtioMMIODevice *dev = (QVirtioMMIODevice *)d; -writel (dev->addr +QVIRTIO_MMIO_QUEUE_PFN , pfn); +QVirtioMMIODevice *dev =container_of (d, QVirtioMMIODevice, vdev); +qtest_writel (dev->qts, dev->addr +QVIRTIO_MMIO_QUEUE_PFN , pfn); }static QVirtQueue *qvirtio_mmio_virtqueue_setup (QVirtioDevice *d,QGuestAllocator *alloc,uint16_t index) { -QVirtioMMIODevice *dev = (QVirtioMMIODevice *)d; +QVirtioMMIODevice *dev =container_of (d, QVirtioMMIODevice, vdev);QVirtQueue *vq;uint64_t addr; vq =g_malloc0 (sizeof (*vq));qvirtio_mmio_queue_select (d, index); -writel (dev->addr +QVIRTIO_MMIO_QUEUE_ALIGN , dev->page_size); +qtest_writel (dev->qts, dev->addr +QVIRTIO_MMIO_QUEUE_ALIGN , dev->page_size); vq->index = index; vq->size =qvirtio_mmio_get_queue_size (d);
@@ -139,7 +139,7 @@ static QVirtQueue *qvirtio_mmio_virtqueue_setup(QVirtioDevice *d, vq->indirect = (dev->features & (1u <<VIRTIO_RING_F_INDIRECT_DESC )) !=0 ; vq->event = (dev->features & (1u <<VIRTIO_RING_F_EVENT_IDX )) !=0 ; -writel (dev->addr +QVIRTIO_MMIO_QUEUE_NUM , vq->size); +qtest_writel (dev->qts, dev->addr +QVIRTIO_MMIO_QUEUE_NUM , vq->size);/* Check different than 0 */ g_assert_cmpint(vq->size, !=, 0);
@@ -163,8 +163,8 @@ static void qvirtio_mmio_virtqueue_cleanup(QVirtQueue *vq,static void qvirtio_mmio_virtqueue_kick (QVirtioDevice *d,QVirtQueue *vq) { -QVirtioMMIODevice *dev = (QVirtioMMIODevice *)d; -writel (dev->addr +QVIRTIO_MMIO_QUEUE_NOTIFY , vq->index); +QVirtioMMIODevice *dev =container_of (d, QVirtioMMIODevice, vdev); +qtest_writel (dev->qts, dev->addr +QVIRTIO_MMIO_QUEUE_NOTIFY , vq->index); }const QVirtioBus qvirtio_mmio = {
@@ -187,21 +187,45 @@ const QVirtioBus qvirtio_mmio = { .virtqueue_kick = qvirtio_mmio_virtqueue_kick, }; -QVirtioMMIODevice *qvirtio_mmio_init_device (uint64_t addr,uint32_t page_size) +static void *qvirtio_mmio_get_driver (void *obj,const char *interface) { -QVirtioMMIODevice *dev; -uint32_t magic; - dev =g_malloc0 (sizeof (*dev)); +QVirtioMMIODevice *virtio_mmio = obj; +if (!g_strcmp0 (interface,"virtio-bus" )) { +return &virtio_mmio->vdev; + } +fprintf (stderr,"%s not present in virtio-mmio\n" , interface); +g_assert_not_reached (); +} + +static void qvirtio_mmio_start_hw (QOSGraphObject *obj) +{ +QVirtioMMIODevice *dev = (QVirtioMMIODevice *) obj; +qvirtio_start_device (&dev->vdev); +} - magic =readl (addr +QVIRTIO_MMIO_MAGIC_VALUE ); +void qvirtio_mmio_init_device (QVirtioMMIODevice *dev,QTestState *qts, +uint64_t addr,uint32_t page_size) +{ +uint32_t magic; + magic =qtest_readl (qts, addr +QVIRTIO_MMIO_MAGIC_VALUE );g_assert (magic == ('v' |'i' <<8 |'r' <<16 |'t' <<24 )); + dev->qts = qts; dev->addr = addr; dev->page_size = page_size; - dev->vdev.device_type =readl (addr +QVIRTIO_MMIO_DEVICE_ID ); + dev->vdev.device_type =qtest_readl (qts, addr +QVIRTIO_MMIO_DEVICE_ID ); dev->vdev.bus = &qvirtio_mmio; -writel (addr +QVIRTIO_MMIO_GUEST_PAGE_SIZE , page_size); +qtest_writel (qts, addr +QVIRTIO_MMIO_GUEST_PAGE_SIZE , page_size); + + dev->obj.get_driver = qvirtio_mmio_get_driver; + dev->obj.start_hw = qvirtio_mmio_start_hw; +} -return dev; +static void virtio_mmio_register_nodes (void ) +{ +qos_node_create_driver ("virtio-mmio" ,NULL ); +qos_node_produces ("virtio-mmio" ,"virtio-bus" ); } + +libqos_init (virtio_mmio_register_nodes);
tests/libqos/virtio-mmio.h +5 -1
@@ -11,6 +11,7 @@#define LIBQOS_VIRTIO_MMIO_H #include "libqos/virtio.h" +#include "libqos/qgraph.h" #define QVIRTIO_MMIO_MAGIC_VALUE 0x000#define QVIRTIO_MMIO_VERSION 0x004
@@ -33,7 +34,9 @@#define QVIRTIO_MMIO_DEVICE_SPECIFIC 0x100 typedef struct QVirtioMMIODevice { + QOSGraphObject obj; QVirtioDevice vdev; + QTestState *qts; uint64_t addr; uint32_t page_size; uint32_t features; /* As it cannot be read later, save it */
@@ -41,6 +44,7 @@ typedef struct QVirtioMMIODevice {extern const QVirtioBus qvirtio_mmio; -QVirtioMMIODevice *qvirtio_mmio_init_device (uint64_t addr,uint32_t page_size); +void qvirtio_mmio_init_device (QVirtioMMIODevice *dev,QTestState *qts, +uint64_t addr,uint32_t page_size);#endif
tests/virtio-blk-test.c +2 -1
@@ -833,7 +833,8 @@ static void mmio_basic(void)arm_test_start (); - dev =qvirtio_mmio_init_device (MMIO_DEV_BASE_ADDR ,MMIO_PAGE_SIZE ); + dev =g_malloc0 (sizeof (QVirtioMMIODevice)); +qvirtio_mmio_init_device (dev, global_qtest,MMIO_DEV_BASE_ADDR ,MMIO_PAGE_SIZE );g_assert (dev !=NULL ); g_assert_cmphex(dev->vdev.device_type, ==, VIRTIO_ID_BLOCK);
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 25/57] tests/qgraph: add generic virtio testcases
In reply to Paolo Bonzini--- tests/Makefile.include | 1 + tests/virtio-test.c | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 tests/virtio-test.c
tests/Makefile.include +1 -0
@@ -766,6 +766,7 @@ qos-test-obj-y += tests/libqos/x86_64_pc-machine.o qos-test-obj-y += tests/e1000e-test.o qos-test-obj-y += tests/pci-test.o qos-test-obj-y += tests/sdhci-test.o +qos-test-obj-y += tests/virtio-test.o check-unit-y += tests/test-qgraph$(EXESUF) tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y)
tests/virtio-test.c new file +25 -0
@@ -0,0 +1,25 @@ +/* +* QTest testcase for virtio +* +* Copyright (c) 2018 Red Hat, Inc. +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#include "qemu/osdep.h" +#include "libqtest.h" +#include "libqos/qgraph.h" +#include "libqos/pci.h" + +/* Tests only initialization so far. TODO: Replace with functional tests */ +static void nop (void *obj,void *data,QGuestAllocator *alloc) +{ +} + +static void register_virtio_test (void ) +{ +qos_add_test ("nop" ,"virtio" , nop,NULL ); +} + +libqos_init (register_virtio_test);
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 24/57] tests/libqos: arm/virt machine node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add arm/virt machine to the graph. This machine contains virtio-mmio, so its constructor must take care of setting it properly when called.
--- tests/Makefile.include | 1 + tests/libqos/arm-virt-machine.c | 90 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 tests/libqos/arm-virt-machine.c
tests/Makefile.include +1 -0
@@ -757,6 +757,7 @@ qos-test-obj-y += tests/libqos/aarch64-xlnx-zcu102-machine.o qos-test-obj-y += tests/libqos/arm-raspi2-machine.o qos-test-obj-y += tests/libqos/arm-sabrelite-machine.o qos-test-obj-y += tests/libqos/arm-smdkc210-machine.o +qos-test-obj-y += tests/libqos/arm-virt-machine.o qos-test-obj-y += tests/libqos/arm-xilinx-zynq-a9-machine.o qos-test-obj-y += tests/libqos/ppc64_pseries-machine.o qos-test-obj-y += tests/libqos/x86_64_pc-machine.o
tests/libqos/arm-virt-machine.c new file +90 -0
90 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 27/57] qos-test: virtio-console and virtio-serial test node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Convert tests/virtio-console-test and tests/virtio-serial-test in qgraph test node. This test consumes a virtio-serial interface and checks that its function return the expected values.
Note that this test does not allocate any virtio-console or virtio-serial structure, it's all done by the qtest walking graph mechanism
--- tests/Makefile.include | 18 +++++++----------- tests/libqos/virtio.c | 1 + tests/virtio-console-test.c | 38 -------------------------------------- tests/virtio-serial-test.c | 27 ++++++++++++--------------- 4 files changed, 20 insertions(+), 64 deletions(-) delete mode 100644 tests/virtio-console-test.c
tests/Makefile.include +7 -11
@@ -153,18 +153,14 @@ check-qtest-generic-y += tests/cdrom-test$(EXESUF) check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF) -check-qtest-virtioserial-$(CONFIG_VIRTIO_SERIAL) += tests/virtio-console-test$(EXESUF) - -check-qtest-virtio-$(CONFIG_VIRTIO_NET) += tests/virtio-net-test$(EXESUF) -check-qtest-virtio-$(CONFIG_VIRTIO_BALLOON) += tests/virtio-balloon-test$(EXESUF) -check-qtest-virtio-$(CONFIG_VIRTIO_BLK) += tests/virtio-blk-test$(EXESUF) -check-qtest-virtio-$(CONFIG_VIRTIO_RNG) += tests/virtio-rng-test$(EXESUF) -check-qtest-virtio-$(CONFIG_VIRTIO_SCSI) += tests/virtio-scsi-test$(EXESUF) +check-qtest-virtio-y += tests/virtio-net-test$(EXESUF) +check-qtest-virtio-y += tests/virtio-balloon-test$(EXESUF) +check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF) +check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF) +check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF) ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy) check-qtest-virtio-$(CONFIG_VIRTIO_9P) += tests/virtio-9p-test$(EXESUF) endif -check-qtest-virtio-$(CONFIG_VIRTIO_SERIAL) += tests/virtio-serial-test$(EXESUF) -check-qtest-virtio-y += $(check-qtest-virtioserial-y) check-qtest-pci-y += tests/e1000-test$(EXESUF) check-qtest-pci-$(CONFIG_RTL8139_PCI) += tests/rtl8139-test$(EXESUF)
@@ -315,6 +311,7 @@ check-qtest-s390x-$(CONFIG_POSIX) += tests/test-filter-redirector$(EXESUF) check-qtest-s390x-y += tests/drive_del-test$(EXESUF) check-qtest-s390x-y += tests/device-plug-test$(EXESUF) check-qtest-s390x-y += tests/virtio-ccw-test$(EXESUF) +check-qtest-s390x-y += tests/virtio-balloon-test$(EXESUF) check-qtest-s390x-y += tests/cpu-plug-test$(EXESUF) check-qtest-s390x-y += tests/migration-test$(EXESUF)
@@ -768,6 +765,7 @@ qos-test-obj-y += tests/e1000e-test.o qos-test-obj-y += tests/pci-test.o qos-test-obj-y += tests/sdhci-test.o qos-test-obj-y += tests/virtio-test.o +qos-test-obj-y += tests/virtio-serial-test.o check-unit-y += tests/test-qgraph$(EXESUF) tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y)
@@ -820,8 +818,6 @@ tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o $(libqos-pc-obj-y) $(lib tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o $(libqos-pc-obj-y) tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o $(libqos-virtio-obj-y) tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o $(libqos-virtio-obj-y) -tests/virtio-serial-test$(EXESUF): tests/virtio-serial-test.o $(libqos-virtio-obj-y) -tests/virtio-console-test$(EXESUF): tests/virtio-console-test.o $(libqos-virtio-obj-y) tests/tpci200-test$(EXESUF): tests/tpci200-test.o tests/display-vga-test$(EXESUF): tests/display-vga-test.o tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o
tests/libqos/virtio.c +1 -0
@@ -352,6 +352,7 @@ void qvirtqueue_set_used_event(QVirtQueue *vq, uint16_t idx)/* * qvirtio_get_dev_type: * Returns: the preferred virtio bus/device type for the current architecture. +* TODO: delete this */ const char *qvirtio_get_dev_type (void ) {
tests/virtio-console-test.c deleted +0 -38
@@ -1,38 +0,0 @@ -/* -* QTest testcase for VirtIO Console -* -* Copyright (c) 2014 SUSE LINUX Products GmbH -* -* This work is licensed under the terms of the GNU GPL, version 2 or later. -* See the COPYING file in the top-level directory. -*/ - -#include "qemu/osdep.h" -#include "libqtest.h" -#include "libqos/virtio.h" - -/* Tests only initialization so far. TODO: Replace with functional tests */ -static void console_nop (void ) -{ - global_qtest =qtest_initf ("-device virtio-serial-%s,id=vser0 " -"-device virtconsole,bus=vser0.0" , -qvirtio_get_dev_type ()); -qtest_end (); -} - -static void serialport_nop (void ) -{ - global_qtest =qtest_initf ("-device virtio-serial-%s,id=vser0 " -"-device virtserialport,bus=vser0.0" , -qvirtio_get_dev_type ()); -qtest_end (); -} - -int main (int argc,char **argv) -{ -g_test_init (&argc, &argv,NULL ); -qtest_add_func ("/virtio/console/nop" , console_nop); -qtest_add_func ("/virtio/serialport/nop" , serialport_nop); - -return g_test_run (); -}
tests/virtio-serial-test.c +12 -15
@@ -9,33 +9,30 @@#include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/virtio.h" +#include "libqos/virtio-serial.h" /* Tests only initialization so far. TODO: Replace with functional tests */ -static void virtio_serial_nop (void ) +static void virtio_serial_nop (void *obj,void *data,QGuestAllocator *alloc) { +/* no operation */ } -static void hotplug (void ) +static void serial_hotplug (void *obj,void *data,QGuestAllocator *alloc) {qtest_qmp_device_add ("virtserialport" ,"hp-port" ,"{}" ); -qtest_qmp_device_del ("hp-port" ); } -int main (int argc,char **argv) +static void register_virtio_serial_test (void ) { -int ret; - -g_test_init (&argc, &argv,NULL ); -qtest_add_func ("/virtio/serial/nop" , virtio_serial_nop); -qtest_add_func ("/virtio/serial/hotplug" , hotplug); +QOSGraphTestOptions opts = { }; - global_qtest =qtest_initf ("-device virtio-serial-%s" , -qvirtio_get_dev_type ()); - ret =g_test_run (); + opts.edge.before_cmd_line ="-device virtconsole,bus=vser0.0" ; +qos_add_test ("console-nop" ,"virtio-serial" , virtio_serial_nop, &opts); -qtest_end (); + opts.edge.before_cmd_line ="-device virtserialport,bus=vser0.0" ; +qos_add_test ("serialport-nop" ,"virtio-serial" , virtio_serial_nop, &opts); -return ret; +qos_add_test ("hotplug" ,"virtio-serial" , serial_hotplug,NULL ); } +libqos_init (register_virtio_serial_test);
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 26/57] tests/libqos: virtio-serial driver and interface nodes
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add qgraph nodes for virtio-serial-pci and virtio-serial-device. Both nodes produce virtio-serial, but virtio-serial-pci receives a pci-bus and uses virtio-pci QOSGraphObject and functions, while virtio-serial-device receives a virtio-bus and implements its own functions
--- tests/Makefile.include | 1 + tests/libqos/virtio-serial.c | 110 +++++++++++++++++++++++++++++++++++++++++++ tests/libqos/virtio-serial.h | 39 +++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 tests/libqos/virtio-serial.c create mode 100644 tests/libqos/virtio-serial.h
tests/Makefile.include +1 -0
@@ -751,6 +751,7 @@ qos-test-obj-y += $(libqos-pc-obj-y) $(libqos-spapr-obj-y) qos-test-obj-y += tests/libqos/e1000e.o qos-test-obj-y += tests/libqos/sdhci.o qos-test-obj-y += $(libqos-virtio-obj-y) +qos-test-obj-y += tests/libqos/virtio-serial.o # Machines qos-test-obj-y += tests/libqos/aarch64-xlnx-zcu102-machine.o
tests/libqos/virtio-serial.c new file +110 -0
110 lines not on this page · raw message
tests/libqos/virtio-serial.h new file +39 -0
@@ -0,0 +1,39 @@ +/* +* libqos driver framework +* +* Copyright (c) 2018 Emanuele Giuseppe Esposito <[email protected]> +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License version 2 as published by the Free Software Foundation. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, see <http://www.gnu.org/licenses/> +*/ + +#include "libqos/qgraph.h" +#include "libqos/virtio.h" +#include "libqos/virtio-pci.h" + +typedef struct QVirtioSerial QVirtioSerial ; +typedef struct QVirtioSerialPCI QVirtioSerialPCI ; +typedef struct QVirtioSerialDevice QVirtioSerialDevice ; + +struct QVirtioSerial { +QVirtioDevice *vdev; +}; + +struct QVirtioSerialPCI { +QVirtioPCIDevice pci_vdev; +QVirtioSerial serial; +}; + +struct QVirtioSerialDevice { +QOSGraphObject obj; +QVirtioSerial serial; +};
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 28/57] tests/libqos: virtio-9p driver and interface nodes
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add qgraph nodes for virtio-9p-pci and virtio-9p-device. Both nodes produce virtio-9p, but virtio-9p-pci receives a pci-bus and overrides virtio-pci QOSGraphObject and its functions, while virtio-9p-device receives a virtio and implements its own functions
--- tests/Makefile.include | 1 + tests/libqos/virtio-9p.c | 173 +++++++++++++++++++++++++++++++++++++++++++++++ tests/libqos/virtio-9p.h | 42 ++++++++++++ 3 files changed, 216 insertions(+) create mode 100644 tests/libqos/virtio-9p.c create mode 100644 tests/libqos/virtio-9p.h
tests/Makefile.include +1 -0
@@ -748,6 +748,7 @@ qos-test-obj-y += $(libqos-pc-obj-y) $(libqos-spapr-obj-y) qos-test-obj-y += tests/libqos/e1000e.o qos-test-obj-y += tests/libqos/sdhci.o qos-test-obj-y += $(libqos-virtio-obj-y) +qos-test-obj-$(CONFIG_VIRTFS) += tests/libqos/virtio-9p.o qos-test-obj-y += tests/libqos/virtio-serial.o # Machines
tests/libqos/virtio-9p.c new file +173 -0
173 lines not on this page · raw message
tests/libqos/virtio-9p.h new file +42 -0
42 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 30/57] tests/libqos: virtio-balloon driver and interface nodes
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add qgraph nodes for virtio-balloon-pci and virtio-balloon-device. Both nodes produce virtio-balloon, but virtio-balloon-pci receives a pci-bus and uses virtio-pci QOSGraphObject and functions, while virtio-balloon-device receives a virtio and implements its own functions
--- tests/Makefile.include | 1 + tests/libqos/virtio-balloon.c | 113 ++++++++++++++++++++++++++++++++++++++++++ tests/libqos/virtio-balloon.h | 39 +++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 tests/libqos/virtio-balloon.c create mode 100644 tests/libqos/virtio-balloon.h
tests/Makefile.include +1 -0
@@ -746,6 +746,7 @@ qos-test-obj-y += tests/libqos/e1000e.o qos-test-obj-y += tests/libqos/sdhci.o qos-test-obj-y += $(libqos-virtio-obj-y) qos-test-obj-$(CONFIG_VIRTFS) += tests/libqos/virtio-9p.o +qos-test-obj-y += tests/libqos/virtio-balloon.o qos-test-obj-y += tests/libqos/virtio-serial.o # Machines
tests/libqos/virtio-balloon.c new file +113 -0
113 lines not on this page · raw message
tests/libqos/virtio-balloon.h new file +39 -0
@@ -0,0 +1,39 @@ +/* +* libqos driver framework +* +* Copyright (c) 2018 Emanuele Giuseppe Esposito <[email protected]> +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License version 2 as published by the Free Software Foundation. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, see <http://www.gnu.org/licenses/> +*/ + +#include "libqos/qgraph.h" +#include "libqos/virtio.h" +#include "libqos/virtio-pci.h" + +typedef struct QVirtioBalloon QVirtioBalloon ; +typedef struct QVirtioBalloonPCI QVirtioBalloonPCI ; +typedef struct QVirtioBalloonDevice QVirtioBalloonDevice ; + +struct QVirtioBalloon { +QVirtioDevice *vdev; +}; + +struct QVirtioBalloonPCI { +QVirtioPCIDevice pci_vdev; +QVirtioBalloon balloon; +}; + +struct QVirtioBalloonDevice { +QOSGraphObject obj; +QVirtioBalloon balloon; +};
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 32/57] tests/libqos: virtio-rng driver and interface nodes
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add qgraph nodes for virtio-rng-pci and virtio-rng-device. Both nodes produce virtio-rng, but virtio-rng-pci receives a pci-bus and uses virtio-pci QOSGraphObject and functions, while virtio-rng-device receives a virtio and implements its own functions
--- tests/Makefile.include | 1 + tests/libqos/virtio-rng.c | 110 ++++++++++++++++++++++++++++++++++++++++++++++ tests/libqos/virtio-rng.h | 39 ++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 tests/libqos/virtio-rng.c create mode 100644 tests/libqos/virtio-rng.h
tests/Makefile.include +1 -0
@@ -745,6 +745,7 @@ qos-test-obj-y += tests/libqos/sdhci.o qos-test-obj-y += $(libqos-virtio-obj-y) qos-test-obj-$(CONFIG_VIRTFS) += tests/libqos/virtio-9p.o qos-test-obj-y += tests/libqos/virtio-balloon.o +qos-test-obj-y += tests/libqos/virtio-rng.o qos-test-obj-y += tests/libqos/virtio-serial.o # Machines
tests/libqos/virtio-rng.c new file +110 -0
110 lines not on this page · raw message
tests/libqos/virtio-rng.h new file +39 -0
@@ -0,0 +1,39 @@ +/* +* libqos driver framework +* +* Copyright (c) 2018 Emanuele Giuseppe Esposito <[email protected]> +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License version 2 as published by the Free Software Foundation. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, see <http://www.gnu.org/licenses/> +*/ + +#include "libqos/qgraph.h" +#include "libqos/virtio.h" +#include "libqos/virtio-pci.h" + +typedef struct QVirtioRng QVirtioRng ; +typedef struct QVirtioRngPCI QVirtioRngPCI ; +typedef struct QVirtioRngDevice QVirtioRngDevice ; + +struct QVirtioRng { +QVirtioDevice *vdev; +}; + +struct QVirtioRngPCI { +QVirtioPCIDevice pci_vdev; +QVirtioRng rng; +}; + +struct QVirtioRngDevice { +QOSGraphObject obj; +QVirtioRng rng; +};
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 33/57] qos-test: virtio-rng test node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Convert tests/virtio-rng-test in qgraph test node, virtio-rng-test. This test consumes a virtio-rng interface and checks that its function return the expected values.
Some functions are implemented only for virtio-rng-pci, so they don't consume virtio-rng, but virtio-rng-pci
Note that this test does not allocate any virtio-rng structure, it's all done by the qtest walking graph mechanism
--- tests/Makefile.include | 3 +-- tests/virtio-rng-test.c | 27 +++++++-------------------- 2 files changed, 8 insertions(+), 22 deletions(-)
tests/Makefile.include +1 -2
@@ -155,7 +155,6 @@ check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF) check-qtest-virtio-y += tests/virtio-net-test$(EXESUF) check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF) -check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF) check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF) check-qtest-pci-y += tests/e1000-test$(EXESUF)
@@ -764,6 +763,7 @@ qos-test-obj-y += tests/pci-test.o qos-test-obj-y += tests/sdhci-test.o qos-test-obj-y += tests/virtio-test.o qos-test-obj-$(CONFIG_VIRTFS) += tests/virtio-9p-test.o +qos-test-obj-y += tests/virtio-rng-test.o qos-test-obj-y += tests/virtio-serial-test.o check-unit-y += tests/test-qgraph$(EXESUF)
@@ -813,7 +813,6 @@ tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y) tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o $(libqos-virtio-obj-y) tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o $(libqos-pc-obj-y) $(libqos-virtio-obj-y) -tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o $(libqos-pc-obj-y) tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o $(libqos-virtio-obj-y) tests/tpci200-test$(EXESUF): tests/tpci200-test.o tests/display-vga-test$(EXESUF): tests/display-vga-test.o
tests/virtio-rng-test.c +7 -20
@@ -9,16 +9,12 @@#include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/pci.h" +#include "libqos/qgraph.h" +#include "libqos/virtio-rng.h" #define PCI_SLOT_HP 0x06 -/* Tests only initialization so far. TODO: Replace with functional tests */ -static void pci_nop (void ) -{ -} - -static void hotplug (void ) +static void rng_hotplug (void *obj,void *data,QGuestAllocator *alloc) {const char *arch =qtest_get_arch ();
@@ -30,18 +26,9 @@ static void hotplug(void) } } -int main (int argc,char **argv) +static void register_virtio_rng_test (void ) { -int ret; - -g_test_init (&argc, &argv,NULL ); -qtest_add_func ("/virtio/rng/pci/nop" , pci_nop); -qtest_add_func ("/virtio/rng/pci/hotplug" , hotplug); - -qtest_start ("-device virtio-rng-pci" ); - ret =g_test_run (); - -qtest_end (); - -return ret; +qos_add_test ("hotplug" ,"virtio-rng-pci" , rng_hotplug,NULL ); } + +libqos_init (register_virtio_rng_test);
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 34/57] tests/libqos: virtio-blk driver and interface nodes
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add qgraph nodes for virtio-blk-pci and virtio-blk-device. Both nodes produce virtio-blk, but virtio-blk-pci receives a pci-bus and uses virtio-pci QOSGraphObject and functions, while virtio-blk-device receives a virtio and implements its own functions
--- tests/Makefile.include | 1 + tests/libqos/virtio-blk.c | 124 ++++++++++++++++++++++++++++++++++++++++++++++ tests/libqos/virtio-blk.h | 40 +++++++++++++++ 3 files changed, 165 insertions(+) create mode 100644 tests/libqos/virtio-blk.c create mode 100644 tests/libqos/virtio-blk.h
tests/Makefile.include +1 -0
@@ -744,6 +744,7 @@ qos-test-obj-y += tests/libqos/sdhci.o qos-test-obj-y += $(libqos-virtio-obj-y) qos-test-obj-$(CONFIG_VIRTFS) += tests/libqos/virtio-9p.o qos-test-obj-y += tests/libqos/virtio-balloon.o +qos-test-obj-y += tests/libqos/virtio-blk.o qos-test-obj-y += tests/libqos/virtio-rng.o qos-test-obj-y += tests/libqos/virtio-serial.o
tests/libqos/virtio-blk.c new file +124 -0
124 lines not on this page · raw message
tests/libqos/virtio-blk.h new file +40 -0
@@ -0,0 +1,40 @@ +/* +* libqos driver framework +* +* Copyright (c) 2018 Emanuele Giuseppe Esposito <[email protected]> +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License version 2 as published by the Free Software Foundation. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, see <http://www.gnu.org/licenses/> +*/ + +#include "libqos/qgraph.h" +#include "libqos/virtio.h" +#include "libqos/virtio-pci.h" + +typedef struct QVirtioBlk QVirtioBlk ; +typedef struct QVirtioBlkPCI QVirtioBlkPCI ; +typedef struct QVirtioBlkDevice QVirtioBlkDevice ; + +/* virtqueue is created in each test */ +struct QVirtioBlk { +QVirtioDevice *vdev; +}; + +struct QVirtioBlkPCI { +QVirtioPCIDevice pci_vdev; +QVirtioBlk blk; +}; + +struct QVirtioBlkDevice { +QOSGraphObject obj; +QVirtioBlk blk; +};
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 29/57] qos-test: virtio-9p test node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Convert tests/virtio-9p-test into a qgraph test node.
This test consumes a virtio-9p interface and checks that its functions return the expected values.
Note that this test does not allocate any virtio-9p structure, it's all done by the qtest walking graph mechanism
--- tests/Makefile.include | 5 +- tests/virtio-9p-test.c | 218 +++++++++++++++++-------------------------------- 2 files changed, 78 insertions(+), 145 deletions(-)
tests/Makefile.include +1 -4
@@ -158,9 +158,6 @@ check-qtest-virtio-y += tests/virtio-balloon-test$(EXESUF) check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF) check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF) check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF) -ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy) -check-qtest-virtio-$(CONFIG_VIRTIO_9P) += tests/virtio-9p-test$(EXESUF) -endif check-qtest-pci-y += tests/e1000-test$(EXESUF) check-qtest-pci-$(CONFIG_RTL8139_PCI) += tests/rtl8139-test$(EXESUF)
@@ -766,6 +763,7 @@ qos-test-obj-y += tests/e1000e-test.o qos-test-obj-y += tests/pci-test.o qos-test-obj-y += tests/sdhci-test.o qos-test-obj-y += tests/virtio-test.o +qos-test-obj-$(CONFIG_VIRTFS) += tests/virtio-9p-test.o qos-test-obj-y += tests/virtio-serial-test.o check-unit-y += tests/test-qgraph$(EXESUF)
@@ -818,7 +816,6 @@ tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o $(libqos-pc-obj-y) $(libqos-virtio-obj-y) tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o $(libqos-pc-obj-y) tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o $(libqos-virtio-obj-y) -tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o $(libqos-virtio-obj-y) tests/tpci200-test$(EXESUF): tests/tpci200-test.o tests/display-vga-test$(EXESUF): tests/display-vga-test.o tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o
tests/virtio-9p-test.c +77 -141
417 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 31/57] tests/qgraph: remove virtio-balloon-test
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
The tests/virtio-balloon-test is covered by generic virtio tests, so remove it.
--- tests/Makefile.include | 3 --- tests/virtio-balloon-test.c | 33 --------------------------------- 2 files changed, 36 deletions(-) delete mode 100644 tests/virtio-balloon-test.c
tests/Makefile.include +0 -3
@@ -154,7 +154,6 @@ check-qtest-generic-y += tests/cdrom-test$(EXESUF) check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF) check-qtest-virtio-y += tests/virtio-net-test$(EXESUF) -check-qtest-virtio-y += tests/virtio-balloon-test$(EXESUF) check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF) check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF) check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF)
@@ -308,7 +307,6 @@ check-qtest-s390x-$(CONFIG_POSIX) += tests/test-filter-redirector$(EXESUF) check-qtest-s390x-y += tests/drive_del-test$(EXESUF) check-qtest-s390x-y += tests/device-plug-test$(EXESUF) check-qtest-s390x-y += tests/virtio-ccw-test$(EXESUF) -check-qtest-s390x-y += tests/virtio-balloon-test$(EXESUF) check-qtest-s390x-y += tests/cpu-plug-test$(EXESUF) check-qtest-s390x-y += tests/migration-test$(EXESUF)
@@ -811,7 +809,6 @@ tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o tests/ne2000-test$(EXESUF): tests/ne2000-test.o tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y) -tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-test.o $(libqos-virtio-obj-y) tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o $(libqos-virtio-obj-y) tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o $(libqos-pc-obj-y) $(libqos-virtio-obj-y)
tests/virtio-balloon-test.c deleted +0 -33
@@ -1,33 +0,0 @@ -/* -* QTest testcase for VirtIO Balloon -* -* Copyright (c) 2014 SUSE LINUX Products GmbH -* -* This work is licensed under the terms of the GNU GPL, version 2 or later. -* See the COPYING file in the top-level directory. -*/ - -#include "qemu/osdep.h" -#include "libqtest.h" -#include "libqos/virtio.h" - -/* Tests only initialization so far. TODO: Replace with functional tests */ -static void balloon_nop (void ) -{ -} - -int main (int argc,char **argv) -{ -int ret; - -g_test_init (&argc, &argv,NULL ); -qtest_add_func ("/virtio/balloon/nop" , balloon_nop); - - global_qtest =qtest_initf ("-device virtio-balloon-%s" , -qvirtio_get_dev_type ()); - ret =g_test_run (); - -qtest_end (); - -return ret; -}
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 36/57] tests/libqos: virtio-net driver and interface nodes
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add qgraph nodes for virtio-net-pci and virtio-net-device. Both nodes produce virtio-net, but virtio-net-pci receives a pci-bus and overrides virtio-pci QOSGraphObject and its functions, while virtio-net-device receives a virtio and implements its own functions
--- tests/Makefile.include | 1 + tests/libqos/virtio-net.c | 182 ++++++++++++++++++++++++++++++++++++++++++++++ tests/libqos/virtio-net.h | 41 +++++++++++ tests/libqos/virtio.c | 1 + tests/libqos/virtio.h | 1 + 5 files changed, 226 insertions(+) create mode 100644 tests/libqos/virtio-net.c create mode 100644 tests/libqos/virtio-net.h
tests/Makefile.include +1 -0
@@ -743,6 +743,7 @@ qos-test-obj-y += $(libqos-virtio-obj-y) qos-test-obj-$(CONFIG_VIRTFS) += tests/libqos/virtio-9p.o qos-test-obj-y += tests/libqos/virtio-balloon.o qos-test-obj-y += tests/libqos/virtio-blk.o +qos-test-obj-y += tests/libqos/virtio-net.o qos-test-obj-y += tests/libqos/virtio-rng.o qos-test-obj-y += tests/libqos/virtio-serial.o
tests/libqos/virtio-net.c new file +182 -0
182 lines not on this page · raw message
tests/libqos/virtio-net.h new file +41 -0
41 lines not on this page · raw message
tests/libqos/virtio.c +1 -0
@@ -40,6 +40,7 @@ uint32_t qvirtio_get_features(QVirtioDevice *d)void qvirtio_set_features (QVirtioDevice *d,uint32_t features) { + d->features = features; d->bus->set_features (d, features); }
tests/libqos/virtio.h +1 -0
@@ -21,6 +21,7 @@ typedef struct QVirtioDevice {const QVirtioBus *bus;/* Device type */ uint16_t device_type; +uint64_t features;bool big_endian; } QVirtioDevice;
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 37/57] qos-test: virtio-net test node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Convert tests/virtio-net-test in qgraph test node, virtio-net-test. This test consumes a virtio-net interface and checks that its function return the expected values.
Some functions are implemented only for virtio-net-pci, so they don't consume virtio-net, but virtio-net-pci
Note that this test does not allocate any virtio-net structure, it's all done by the qtest walking graph mechanism
--- tests/Makefile.include | 3 +- tests/virtio-net-test.c | 224 ++++++++++++++++-------------------------------- 2 files changed, 75 insertions(+), 152 deletions(-)
tests/Makefile.include +1 -2
@@ -153,7 +153,6 @@ check-qtest-generic-y += tests/cdrom-test$(EXESUF) check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF) -check-qtest-virtio-y += tests/virtio-net-test$(EXESUF) check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF) check-qtest-pci-y += tests/e1000-test$(EXESUF)
@@ -764,6 +763,7 @@ qos-test-obj-y += tests/sdhci-test.o qos-test-obj-y += tests/virtio-test.o qos-test-obj-$(CONFIG_VIRTFS) += tests/virtio-9p-test.o qos-test-obj-y += tests/virtio-blk-test.o +qos-test-obj-y += tests/virtio-net-test.o qos-test-obj-y += tests/virtio-rng-test.o qos-test-obj-y += tests/virtio-serial-test.o
@@ -812,7 +812,6 @@ tests/ne2000-test$(EXESUF): tests/ne2000-test.o tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y) tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o -tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o $(libqos-pc-obj-y) $(libqos-virtio-obj-y) tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o $(libqos-virtio-obj-y) tests/tpci200-test$(EXESUF): tests/tpci200-test.o tests/display-vga-test$(EXESUF): tests/display-vga-test.o
tests/virtio-net-test.c +74 -150
283 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 39/57] vhost-user-test: always use 256 MiB of guest memory
In reply to Paolo BonziniSome tests are using a small amount of RAM for the guest (2 MiB) in order to save host memory, others are using 512 MiB.
However, pSeries machines only support multiples of 256 MiB. Using 256 MiB of memory does not use more host memory than now, even for the migration test that starts two guests, and it allows running the test on pSeries too.
This of course is not optimal, it would be nice to let the qgraph machine object judge how much memory to provide. This is left for future work, together with a more generic framework that wraps the QEMU command line.
--- tests/vhost-user-test.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
tests/vhost-user-test.c +9 -9
@@ -704,7 +704,7 @@ static void test_read_guest_mem(const void *arg) "read-guest-memfd" : "read-guest-mem"); test_server_listen(server); - qemu_cmd =get_qemu_cmd (server,512 , memfd,"" ,"" ); + qemu_cmd =get_qemu_cmd (server,256 , memfd,"" ,"" ); s =qtest_start (qemu_cmd);g_free (qemu_cmd);
@@ -739,7 +739,7 @@ static void test_migrate(void)test_server_listen (s);test_server_listen (dest); - cmd =get_qemu_cmd (s,2 ,TEST_MEMFD_AUTO ,"" ,"" ); + cmd =get_qemu_cmd (s,256 ,TEST_MEMFD_AUTO ,"" ,"" ); from =qtest_start (cmd);g_free (cmd);
@@ -749,10 +749,10 @@ static void test_migrate(void) } size =get_log_size (s); - g_assert_cmpint(size, ==, (2 * 1024 * 1024) / (VHOST_LOG_PAGE * 8)); + g_assert_cmpint(size, ==, (256 * 1024 * 1024) / (VHOST_LOG_PAGE * 8)); tmp =g_strdup_printf (" -incoming %s" , uri); - cmd =get_qemu_cmd (dest,2 ,TEST_MEMFD_AUTO ,"" , tmp); + cmd =get_qemu_cmd (dest,256 ,TEST_MEMFD_AUTO ,"" , tmp);g_free (tmp); to =qtest_init (cmd);g_free (cmd);
@@ -863,7 +863,7 @@ static void test_reconnect_subprocess(void)char *cmd;g_thread_new ("connect" , connect_thread, s); - cmd =get_qemu_cmd (s,2 ,TEST_MEMFD_AUTO ,",server" ,"" ); + cmd =get_qemu_cmd (s,256 ,TEST_MEMFD_AUTO ,",server" ,"" );qtest_start (cmd);g_free (cmd);
@@ -908,7 +908,7 @@ static void test_connect_fail_subprocess(void) s->test_fail = true;g_thread_new ("connect" , connect_thread, s); - cmd =get_qemu_cmd (s,2 ,TEST_MEMFD_AUTO ,",server" ,"" ); + cmd =get_qemu_cmd (s,256 ,TEST_MEMFD_AUTO ,",server" ,"" );qtest_start (cmd);g_free (cmd);
@@ -941,7 +941,7 @@ static void test_flags_mismatch_subprocess(void) s->test_flags =TEST_FLAGS_DISCONNECT ;g_thread_new ("connect" , connect_thread, s); - cmd =get_qemu_cmd (s,2 ,TEST_MEMFD_AUTO ,",server" ,"" ); + cmd =get_qemu_cmd (s,256 ,TEST_MEMFD_AUTO ,",server" ,"" );qtest_start (cmd);g_free (cmd);
@@ -982,14 +982,14 @@ static void test_multiqueue(void) cmd =g_strdup_printf ( QEMU_CMD_MEMFD QEMU_CMD_CHR QEMU_CMD_NETDEV ",queues=%d ""-device virtio-net-pci,netdev=net0,mq=on,vectors=%d" , -512 ,512 , s->chr_name, +256 ,256 , s->chr_name, s->socket_path,"" , s->chr_name, s->queues, s->queues *2 +2 ); }else { cmd =g_strdup_printf ( QEMU_CMD_MEM QEMU_CMD_CHR QEMU_CMD_NETDEV ",queues=%d ""-device virtio-net-pci,netdev=net0,mq=on,vectors=%d" , -512 ,512 , s->mem_path, s->chr_name, +256 ,256 , s->mem_path, s->chr_name, s->socket_path,"" , s->chr_name, s->queues, s->queues *2 +2 ); }
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 35/57] qos-test: virtio-blk test node
In reply to Paolo BonziniConvert tests/virtio-blk-test in qgraph test node, virtio-blk-test. This test consumes a virtio-blk interface and checks that its function return the expected values.
Some functions are implemented only for virtio-blk-pci, so they don't consume virtio-blk, but virtio-blk-pci
Note that this test does not allocate any virtio-blk structure, it's all done by the qtest walking graph mechanism. The allocator is also provided by qgraph; remove malloc-generic.c and malloc-generic.h which are not used anymore.
--- tests/Makefile.include | 6 +- tests/libqos/malloc-generic.c | 24 --- tests/libqos/malloc-generic.h | 18 -- tests/libqtest.h | 3 + tests/virtio-blk-test.c | 474 ++++++++++++++++-------------------------- 5 files changed, 189 insertions(+), 336 deletions(-) delete mode 100644 tests/libqos/malloc-generic.c delete mode 100644 tests/libqos/malloc-generic.h
tests/Makefile.include +2 -4
@@ -154,7 +154,6 @@ check-qtest-generic-y += tests/cdrom-test$(EXESUF) check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF) check-qtest-virtio-y += tests/virtio-net-test$(EXESUF) -check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF) check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF) check-qtest-pci-y += tests/e1000-test$(EXESUF)
@@ -285,7 +284,6 @@ check-qtest-arm-y += tests/pca9552-test$(EXESUF) check-qtest-arm-y += tests/ds1338-test$(EXESUF) check-qtest-arm-y += tests/microbit-test$(EXESUF) check-qtest-arm-y += tests/m25p80-test$(EXESUF) -check-qtest-arm-$(CONFIG_VIRTIO_BLK) += tests/virtio-blk-test$(EXESUF) check-qtest-arm-y += tests/test-arm-mptimer$(EXESUF) check-qtest-arm-y += tests/boot-serial-test$(EXESUF) check-qtest-arm-y += tests/hexloader-test$(EXESUF)
@@ -722,7 +720,7 @@ tests/test-crypto-block$(EXESUF): tests/test-crypto-block.o $(test-crypto-obj-y) libqgraph-obj-y = tests/libqos/qgraph.o libqos-obj-y = $(libqgraph-obj-y) tests/libqos/pci.o tests/libqos/fw_cfg.o -libqos-obj-y += tests/libqos/malloc.o tests/libqos/malloc-generic.o +libqos-obj-y += tests/libqos/malloc.o libqos-obj-y += tests/libqos/i2c.o tests/libqos/libqos.o libqos-spapr-obj-y = $(libqos-obj-y) tests/libqos/malloc-spapr.o libqos-spapr-obj-y += tests/libqos/libqos-spapr.o
@@ -764,6 +762,7 @@ qos-test-obj-y += tests/pci-test.o qos-test-obj-y += tests/sdhci-test.o qos-test-obj-y += tests/virtio-test.o qos-test-obj-$(CONFIG_VIRTFS) += tests/virtio-9p-test.o +qos-test-obj-y += tests/virtio-blk-test.o qos-test-obj-y += tests/virtio-rng-test.o qos-test-obj-y += tests/virtio-serial-test.o
@@ -811,7 +810,6 @@ tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o tests/ne2000-test$(EXESUF): tests/ne2000-test.o tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y) -tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o $(libqos-virtio-obj-y) tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o $(libqos-pc-obj-y) $(libqos-virtio-obj-y) tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o $(libqos-virtio-obj-y)
tests/libqos/malloc-generic.c deleted +0 -24
@@ -1,24 +0,0 @@ -/* -* Basic libqos generic malloc support -* -* Copyright (c) 2014 Marc Marí -* -* This work is licensed under the terms of the GNU GPL, version 2 or later. -* See the COPYING file in the top-level directory. -*/ - -#include "qemu/osdep.h" -#include "libqos/malloc-generic.h" -#include "libqos/malloc.h" - -/* -* Mostly for valgrind happiness, but it does offer -* a chokepoint for debugging guest memory leaks, too. -*/ -void generic_alloc_init (QGuestAllocator *s,uint64_t base_addr, -uint64_t size,uint32_t page_size) -{ -uint64_t start = base_addr + (1 <<20 );/* Start at 1MB */ - -alloc_init (s,0 , start, start + size, page_size); -}
tests/libqos/malloc-generic.h deleted +0 -18
@@ -1,18 +0,0 @@ -/* -* Basic libqos generic malloc support -* -* Copyright (c) 2014 Marc Marí -* -* 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 LIBQOS_MALLOC_GENERIC_H -#define LIBQOS_MALLOC_GENERIC_H - -#include "libqos/malloc.h" - -void generic_alloc_init (QGuestAllocator *s,uint64_t base_addr,uint64_t size, -uint32_t page_size); - -#endif
tests/libqtest.h +3 -0
@@ -17,6 +17,9 @@#ifndef LIBQTEST_H #define LIBQTEST_H +#include "qapi/qmp/qobject.h" +#include "qapi/qmp/qdict.h" +typedef struct QTestState QTestState ;extern QTestState *global_qtest;
tests/virtio-blk-test.c +184 -290
759 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 38/57] tests/libqos: support multiqueue for virtio-net
In reply to Paolo BonziniInitialize the additional virtqueues if they are supported. This is needed to switch vhost-user-test's multiqueue test to the virtio-net qgraph.
--- tests/libqos/virtio-net.c | 21 +++++++++++++++++---- tests/libqos/virtio-net.h | 4 ++-- tests/virtio-net-test.c | 6 +++--- 3 files changed, 22 insertions(+), 9 deletions(-)
tests/libqos/virtio-net.c +17 -4
@@ -27,14 +27,19 @@ static QGuestAllocator *alloc;static void virtio_net_cleanup (QVirtioNet *interface) { -qvirtqueue_cleanup (interface->vdev->bus, interface->rx, alloc); -qvirtqueue_cleanup (interface->vdev->bus, interface->tx, alloc); +int i; + +for (i =0 ; i < interface->n_queues; i++) { +qvirtqueue_cleanup (interface->vdev->bus, interface->queues[i], alloc); + } +g_free (interface->queues); }static void virtio_net_setup (QVirtioNet *interface) {QVirtioDevice *vdev = interface->vdev;uint64_t features; +int i; features =qvirtio_get_features (vdev); features &= ~(QVIRTIO_F_BAD_FEATURE |
@@ -42,8 +47,16 @@ static void virtio_net_setup(QVirtioNet *interface) (1u << VIRTIO_RING_F_EVENT_IDX));qvirtio_set_features (vdev, features); - interface->rx =qvirtqueue_setup (vdev, alloc,0 ); - interface->tx =qvirtqueue_setup (vdev, alloc,1 ); +if (features & (1u <<VIRTIO_NET_F_MQ )) { + interface->n_queues =qvirtio_config_readw (vdev,8 ) *2 ; + }else { + interface->n_queues =2 ; + } + + interface->queues = g_new(QVirtQueue *, interface->n_queues); +for (i =0 ; i < interface->n_queues; i++) { + interface->queues[i] =qvirtqueue_setup (vdev, alloc, i); + }qvirtio_set_driver_ok (vdev); }
tests/libqos/virtio-net.h +2 -2
@@ -26,8 +26,8 @@ typedef struct QVirtioNetDevice QVirtioNetDevice;struct QVirtioNet {QVirtioDevice *vdev; -QVirtQueue *rx; -QVirtQueue *tx; +int n_queues; +QVirtQueue **queues; };struct QVirtioNetPCI {
tests/virtio-net-test.c +3 -3
@@ -136,8 +136,8 @@ static void send_recv_test(void *obj, void *data, QGuestAllocator *t_alloc) {QVirtioNet *net_if = obj;QVirtioDevice *dev = net_if->vdev; -QVirtQueue *rx = net_if->rx; -QVirtQueue *tx = net_if->tx; +QVirtQueue *rx = net_if->queues[0 ]; +QVirtQueue *tx = net_if->queues[1 ];int *sv = data;rx_test (dev, t_alloc, rx, sv[0 ]);
@@ -148,7 +148,7 @@ static void stop_cont_test(void *obj, void *data, QGuestAllocator *t_alloc) {QVirtioNet *net_if = obj;QVirtioDevice *dev = net_if->vdev; -QVirtQueue *rx = net_if->rx; +QVirtQueue *rx = net_if->queues[0 ];int *sv = data;rx_stop_cont_test (dev, t_alloc, rx, sv[0 ]);
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 41/57] tests/libqos: virtio-scsi driver and interface nodes
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Add qgraph nodes for virtio-scsi-pci and virtio-scsi-device. Both nodes produce virtio-scsi, but virtio-scsi-pci receives a pci-bus and uses virtio-pci QOSGraphObject and its functions, while virtio-scsi-device receives a virtio and implements its own functions
--- tests/Makefile.include | 1 + tests/libqos/virtio-scsi.c | 117 +++++++++++++++++++++++++++++++++++++++++++++ tests/libqos/virtio-scsi.h | 39 +++++++++++++++ 3 files changed, 157 insertions(+) create mode 100644 tests/libqos/virtio-scsi.c create mode 100644 tests/libqos/virtio-scsi.h
tests/Makefile.include +1 -0
@@ -743,6 +743,7 @@ qos-test-obj-y += tests/libqos/virtio-balloon.o qos-test-obj-y += tests/libqos/virtio-blk.o qos-test-obj-y += tests/libqos/virtio-net.o qos-test-obj-y += tests/libqos/virtio-rng.o +qos-test-obj-y += tests/libqos/virtio-scsi.o qos-test-obj-y += tests/libqos/virtio-serial.o # Machines
tests/libqos/virtio-scsi.c new file +117 -0
117 lines not on this page · raw message
tests/libqos/virtio-scsi.h new file +39 -0
@@ -0,0 +1,39 @@ +/* +* libqos driver framework +* +* Copyright (c) 2018 Emanuele Giuseppe Esposito <[email protected]> +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License version 2 as published by the Free Software Foundation. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, see <http://www.gnu.org/licenses/> +*/ + +#include "libqos/qgraph.h" +#include "libqos/virtio.h" +#include "libqos/virtio-pci.h" + +typedef struct QVirtioSCSI QVirtioSCSI ; +typedef struct QVirtioSCSIPCI QVirtioSCSIPCI ; +typedef struct QVirtioSCSIDevice QVirtioSCSIDevice ; + +struct QVirtioSCSI { +QVirtioDevice *vdev; +}; + +struct QVirtioSCSIPCI { +QVirtioPCIDevice pci_vdev; +QVirtioSCSI scsi; +}; + +struct QVirtioSCSIDevice { +QOSGraphObject obj; +QVirtioSCSI scsi; +};
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 40/57] qos-test: vhost-user test node
In reply to Paolo BonziniConvert tests/virtio-net-test in qgraph test node, virtio-net-test. This test consumes a virtio-net interface and checks that its function return the expected values.
Note that this test does not allocate any virtio-net structure, it's all done by the qtest walking graph mechanism. Nevertheless, vhost-user-test is a bit more complex than the other tests, because it requires more complicated setup of back-ends and thus almost each test has a slightly different opts.before function.
--- tests/Makefile.include | 5 +- tests/vhost-user-test.c | 381 +++++++++++++++++++----------------------------- 2 files changed, 152 insertions(+), 234 deletions(-)
tests/Makefile.include +1 -4
@@ -204,7 +204,6 @@ check-qtest-i386-$(CONFIG_USB_XHCI_NEC) += tests/usb-hcd-xhci-test$(EXESUF) check-qtest-i386-y += tests/cpu-plug-test$(EXESUF) check-qtest-i386-y += tests/q35-test$(EXESUF) check-qtest-i386-y += tests/vmgenid-test$(EXESUF) -check-qtest-i386-$(CONFIG_VHOST_NET_USER) += tests/vhost-user-test$(EXESUF) check-qtest-i386-$(CONFIG_TPM_CRB) += tests/tpm-crb-swtpm-test$(EXESUF) check-qtest-i386-$(CONFIG_TPM_CRB) += tests/tpm-crb-test$(EXESUF) check-qtest-i386-$(CONFIG_TPM_TIS) += tests/tpm-tis-swtpm-test$(EXESUF)
@@ -760,6 +759,7 @@ qos-test-obj-y += tests/libqos/x86_64_pc-machine.o qos-test-obj-y += tests/e1000e-test.o qos-test-obj-y += tests/pci-test.o qos-test-obj-y += tests/sdhci-test.o +qos-test-obj-$(CONFIG_VHOST_NET_USER) += tests/vhost-user-test.o $(chardev-obj-y) $(test-io-obj-y) qos-test-obj-y += tests/virtio-test.o qos-test-obj-$(CONFIG_VIRTFS) += tests/virtio-9p-test.o qos-test-obj-y += tests/virtio-blk-test.o
@@ -835,9 +835,6 @@ tests/usb-hcd-xhci-test$(EXESUF): tests/usb-hcd-xhci-test.o $(libqos-usb-obj-y) tests/cpu-plug-test$(EXESUF): tests/cpu-plug-test.o tests/migration-test$(EXESUF): tests/migration-test.o tests/test-announce-self$(EXESUF): tests/test-announce-self.o -tests/vhost-user-test$(EXESUF): tests/vhost-user-test.o $(test-util-obj-y) \ - $(qtest-obj-y) $(test-io-obj-y) $(libqos-virtio-obj-y) $(libqos-pc-obj-y) \ - $(chardev-obj-y) tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o tests/test-qemu-opts$(EXESUF): tests/test-qemu-opts.o $(test-util-obj-y) tests/test-keyval$(EXESUF): tests/test-keyval.o $(test-util-obj-y) $(test-qapi-obj-y)
tests/vhost-user-test.c +151 -230
561 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 42/57] qos-test: virtio-scsi test node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Convert tests/virtio-scsi-test in qgraph test node, virtio-scsi-test. This test consumes a virtio-scsi interface and checks that its function return the expected values.
Some functions are implemented only for virtio-scsi-pci, so they don't consume virtio-scsi, but virtio-scsi-pci
Note that this test does not allocate any virtio-scsi structure, it's all done by the qtest walking graph mechanism
--- tests/Makefile.include | 4 +- tests/virtio-scsi-test.c | 143 +++++++++++++++++++---------------------------- 2 files changed, 60 insertions(+), 87 deletions(-)
tests/Makefile.include +1 -3
@@ -153,8 +153,6 @@ check-qtest-generic-y += tests/cdrom-test$(EXESUF) check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF) -check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF) - check-qtest-pci-y += tests/e1000-test$(EXESUF) check-qtest-pci-$(CONFIG_RTL8139_PCI) += tests/rtl8139-test$(EXESUF) check-qtest-pci-$(CONFIG_PCNET_PCI) += tests/pcnet-test$(EXESUF)
@@ -766,6 +764,7 @@ qos-test-obj-$(CONFIG_VIRTFS) += tests/virtio-9p-test.o qos-test-obj-y += tests/virtio-blk-test.o qos-test-obj-y += tests/virtio-net-test.o qos-test-obj-y += tests/virtio-rng-test.o +qos-test-obj-y += tests/virtio-scsi-test.o qos-test-obj-y += tests/virtio-serial-test.o check-unit-y += tests/test-qgraph$(EXESUF)
@@ -813,7 +812,6 @@ tests/ne2000-test$(EXESUF): tests/ne2000-test.o tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y) tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o -tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o $(libqos-virtio-obj-y) tests/tpci200-test$(EXESUF): tests/tpci200-test.o tests/display-vga-test$(EXESUF): tests/display-vga-test.o tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o
tests/virtio-scsi-test.c +59 -84
224 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 43/57] tests/libqos: remove pre-qgraph QVirtioPCIDevice API
In reply to Paolo BonziniRemove the qvirtio_pci_device_find* and qvirtio_pci_device_free APIs, now that they do not have any users.
--- tests/libqos/virtio-pci.c | 112 +++++++--------------------------------------- tests/libqos/virtio-pci.h | 4 -- 2 files changed, 17 insertions(+), 99 deletions(-)
tests/libqos/virtio-pci.c +17 -95
@@ -35,14 +35,6 @@* original qvirtio_pci_destructor and qvirtio_pci_start_hw. */ -typedef struct QVirtioPCIForeachData { -void (*func)(QVirtioDevice *d,void *data); -uint16_t device_type; -bool has_slot; -int slot; -void *user_data; -}QVirtioPCIForeachData ; -static inline bool qvirtio_pci_is_big_endian (QVirtioPCIDevice *dev) {QPCIBus *bus = dev->pdev->bus;
@@ -51,50 +43,6 @@ static inline bool qvirtio_pci_is_big_endian(QVirtioPCIDevice *dev)return qtest_big_endian (bus->qts); } -void qvirtio_pci_device_free (QVirtioPCIDevice *dev) -{ -g_free (dev->pdev); -} - -static void qvirtio_pci_init_from_pcidev (QVirtioPCIDevice *dev,QPCIDevice *pci_dev) -{ - dev->pdev = pci_dev; - dev->vdev.device_type =qpci_config_readw (pci_dev,PCI_SUBSYSTEM_ID ); - - dev->config_msix_entry =-1 ; - - dev->vdev.bus = &qvirtio_pci; - dev->vdev.big_endian =qvirtio_pci_is_big_endian (dev); - -/* each virtio-xxx-pci device should override at least this function */ - dev->obj.get_driver =NULL ; - dev->obj.start_hw = qvirtio_pci_start_hw; - dev->obj.destructor = qvirtio_pci_destructor; -} - -static void qvirtio_pci_foreach_callback ( -QPCIDevice *dev,int devfn,void *data) -{ -QVirtioPCIForeachData *d = data; -QVirtioPCIDevice *vpcidev =g_new0 (QVirtioPCIDevice,1 ); - -qvirtio_pci_init_from_pcidev (vpcidev, dev); -if (vpcidev->vdev.device_type == d->device_type && - (!d->has_slot || vpcidev->pdev->devfn == d->slot <<3 )) { - d->func (&vpcidev->vdev, d->user_data); - }else { -qvirtio_pci_device_free (vpcidev); -g_free (vpcidev); - } -} - -static void qvirtio_pci_assign_device (QVirtioDevice *d,void *data) -{ -QVirtioPCIDevice **vpcidev = data; -assert (!*vpcidev); - *vpcidev =container_of (d, QVirtioPCIDevice, vdev); -} -#define CONFIG_BASE (dev) (VIRTIO_PCI_CONFIG_OFF((dev)->pdev->msix_enabled))static uint8_t qvirtio_pci_config_readb (QVirtioDevice *d,uint64_t off)
@@ -317,48 +265,6 @@ const QVirtioBus qvirtio_pci = { .virtqueue_kick = qvirtio_pci_virtqueue_kick, }; -/* TODO: delete this once qgraph is completed */ -static void qvirtio_pci_foreach (QPCIBus *bus,uint16_t device_type, -bool has_slot,int slot, -void (*func)(QVirtioDevice *d,void *data),void *data) -{ -QVirtioPCIForeachData d = { .func = func, - .device_type = device_type, - .has_slot = has_slot, - .slot = slot, - .user_data = data }; - -qpci_device_foreach (bus,PCI_VENDOR_ID_REDHAT_QUMRANET ,-1 , - qvirtio_pci_foreach_callback, &d); -} - -QVirtioPCIDevice *qvirtio_pci_device_find (QPCIBus *bus,uint16_t device_type) -{ -QVirtioPCIDevice *dev =NULL ; - -qvirtio_pci_foreach (bus, device_type, false,0 , - qvirtio_pci_assign_device, &dev); - -if (dev) { - dev->vdev.bus = &qvirtio_pci; - } - -return dev; -} - -QVirtioPCIDevice *qvirtio_pci_device_find_slot (QPCIBus *bus, -uint16_t device_type,int slot) -{ -QVirtioPCIDevice *dev =NULL ; - -qvirtio_pci_foreach (bus, device_type, true, slot, - qvirtio_pci_assign_device, &dev); - - dev->vdev.bus = &qvirtio_pci; - -return dev; -} -void qvirtio_pci_device_enable (QVirtioPCIDevice *d) {qpci_device_enable (d->pdev);
@@ -445,7 +351,7 @@ void qvirtio_pci_destructor(QOSGraphObject *obj) {QVirtioPCIDevice *dev = (QVirtioPCIDevice *)obj;qvirtio_pci_device_disable (dev); -qvirtio_pci_device_free (dev); +g_free (dev->pdev); }void qvirtio_pci_start_hw (QOSGraphObject *obj)
@@ -455,6 +361,22 @@ void qvirtio_pci_start_hw(QOSGraphObject *obj)qvirtio_start_device (&dev->vdev); } +static void qvirtio_pci_init_from_pcidev (QVirtioPCIDevice *dev,QPCIDevice *pci_dev) +{ + dev->pdev = pci_dev; + dev->vdev.device_type =qpci_config_readw (pci_dev,PCI_SUBSYSTEM_ID ); + + dev->config_msix_entry =-1 ; + + dev->vdev.bus = &qvirtio_pci; + dev->vdev.big_endian =qvirtio_pci_is_big_endian (dev); + +/* each virtio-xxx-pci device should override at least this function */ + dev->obj.get_driver =NULL ; + dev->obj.start_hw = qvirtio_pci_start_hw; + dev->obj.destructor = qvirtio_pci_destructor; +} +void virtio_pci_init (QVirtioPCIDevice *dev,QPCIBus *bus,QPCIAddress * addr) {QPCIDevice *pci_dev =qpci_device_find (bus, addr->devfn);
tests/libqos/virtio-pci.h +0 -4
@@ -35,10 +35,6 @@ extern const QVirtioBus qvirtio_pci;void virtio_pci_init (QVirtioPCIDevice *dev,QPCIBus *bus,QPCIAddress * addr);QVirtioPCIDevice *virtio_pci_new (QPCIBus *bus,QPCIAddress * addr); -QVirtioPCIDevice *qvirtio_pci_device_find (QPCIBus *bus,uint16_t device_type); -QVirtioPCIDevice *qvirtio_pci_device_find_slot (QPCIBus *bus, -uint16_t device_type,int slot); -void qvirtio_pci_device_free (QVirtioPCIDevice *dev);/* virtio-pci object functions available for subclasses that * override the original start_hw and destroy
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 44/57] tests: move virtio entirely to qos-test
In reply to Paolo BonziniThe only remaining test that needs libqos-virtio-obj-y is drive_del-test, which really only needs a function. Move that function to the test and remove libqos-virtio-obj-y.
--- tests/Makefile.include | 9 ++++----- tests/drive_del-test.c | 25 +++++++++++++++++++------ tests/libqos/virtio.c | 18 ------------------ tests/libqos/virtio.h | 1 - 4 files changed, 23 insertions(+), 30 deletions(-)
tests/Makefile.include +4 -5
@@ -161,7 +161,6 @@ check-qtest-pci-$(CONFIG_NE2000_PCI) += tests/ne2000-test$(EXESUF) check-qtest-pci-$(CONFIG_NVME_PCI) += tests/nvme-test$(EXESUF) check-qtest-pci-$(CONFIG_AC97) += tests/ac97-test$(EXESUF) check-qtest-pci-$(CONFIG_ES1370) += tests/es1370-test$(EXESUF) -check-qtest-pci-$(CONFIG_VIRTIO) += $(check-qtest-virtio-y) check-qtest-pci-$(CONFIG_IPACK) += tests/tpci200-test$(EXESUF) check-qtest-pci-$(CONFIG_IPACK) += $(check-qtest-ipack-y) check-qtest-pci-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF)
@@ -254,7 +253,6 @@ check-qtest-ppc64-$(CONFIG_SLIRP) += tests/pxe-test$(EXESUF) check-qtest-ppc64-$(CONFIG_USB_OHCI) += tests/usb-hcd-ohci-test$(EXESUF) check-qtest-ppc64-$(CONFIG_USB_UHCI) += tests/usb-hcd-uhci-test$(EXESUF) check-qtest-ppc64-$(CONFIG_USB_XHCI_NEC) += tests/usb-hcd-xhci-test$(EXESUF) -check-qtest-ppc64-$(CONFIG_VIRTIO) += $(check-qtest-virtio-y) check-qtest-ppc64-$(CONFIG_SLIRP) += tests/test-netfilter$(EXESUF) check-qtest-ppc64-$(CONFIG_POSIX) += tests/test-filter-mirror$(EXESUF) check-qtest-ppc64-$(CONFIG_RTL8139_PCI) += tests/test-filter-redirector$(EXESUF)
@@ -728,18 +726,19 @@ libqos-pc-obj-y += tests/libqos/ahci.o libqos-omap-obj-y = $(libqos-obj-y) tests/libqos/i2c-omap.o libqos-imx-obj-y = $(libqos-obj-y) tests/libqos/i2c-imx.o libqos-usb-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/libqos/usb.o -libqos-virtio-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/libqos/virtio.o tests/libqos/virtio-pci.o tests/libqos/virtio-mmio.o # Devices qos-test-obj-y = tests/qos-test.o $(libqgraph-obj-y) qos-test-obj-y += $(libqos-pc-obj-y) $(libqos-spapr-obj-y) qos-test-obj-y += tests/libqos/e1000e.o qos-test-obj-y += tests/libqos/sdhci.o -qos-test-obj-y += $(libqos-virtio-obj-y) +qos-test-obj-y += tests/libqos/virtio.o qos-test-obj-$(CONFIG_VIRTFS) += tests/libqos/virtio-9p.o qos-test-obj-y += tests/libqos/virtio-balloon.o qos-test-obj-y += tests/libqos/virtio-blk.o +qos-test-obj-y += tests/libqos/virtio-mmio.o qos-test-obj-y += tests/libqos/virtio-net.o +qos-test-obj-y += tests/libqos/virtio-pci.o qos-test-obj-y += tests/libqos/virtio-rng.o qos-test-obj-y += tests/libqos/virtio-scsi.o qos-test-obj-y += tests/libqos/virtio-serial.o
@@ -819,7 +818,7 @@ tests/qom-test$(EXESUF): tests/qom-test.o tests/test-hmp$(EXESUF): tests/test-hmp.o tests/machine-none-test$(EXESUF): tests/machine-none-test.o tests/device-plug-test$(EXESUF): tests/device-plug-test.o -tests/drive_del-test$(EXESUF): tests/drive_del-test.o $(libqos-virtio-obj-y) +tests/drive_del-test$(EXESUF): tests/drive_del-test.o tests/nvme-test$(EXESUF): tests/nvme-test.o $(libqos-pc-obj-y) tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o tests/i82801b11-test$(EXESUF): tests/i82801b11-test.o
tests/drive_del-test.c +19 -6
@@ -63,6 +63,24 @@ static void test_drive_without_dev(void)qtest_end (); } +/* +* qvirtio_get_dev_type: +* Returns: the preferred virtio bus/device type for the current architecture. +* TODO: delete this +*/ +static const char *qvirtio_get_dev_type (void ) +{ +const char *arch =qtest_get_arch (); + +if (g_str_equal (arch,"arm" ) ||g_str_equal (arch,"aarch64" )) { +return "device" ;/* for virtio-mmio */ + }else if (g_str_equal (arch,"s390x" )) { +return "ccw" ; + }else { +return "pci" ; + } +} +static void test_after_failed_device_add (void ) {char driver[32 ];
@@ -119,16 +137,11 @@ static void test_drive_del_device_del(void)int main (int argc,char **argv) { -const char *arch =qtest_get_arch (); -g_test_init (&argc, &argv,NULL );qtest_add_func ("/drive_del/without-dev" , test_drive_without_dev); -/* TODO I guess any arch with a hot-pluggable virtio bus would do */ -if (!strcmp (arch,"i386" ) || !strcmp (arch,"x86_64" ) || - !strcmp (arch,"ppc" ) || !strcmp (arch,"ppc64" ) || - !strcmp (arch,"s390x" )) { +if (qvirtio_get_dev_type () !=NULL ) {qtest_add_func ("/drive_del/after_failed_device_add" , test_after_failed_device_add); qtest_add_func("/blockdev/drive_del_device_del",
tests/libqos/virtio.c +0 -18
@@ -350,24 +350,6 @@ void qvirtqueue_set_used_event(QVirtQueue *vq, uint16_t idx)writew (vq->avail +4 + (2 * vq->size), idx); } -/* -* qvirtio_get_dev_type: -* Returns: the preferred virtio bus/device type for the current architecture. -* TODO: delete this -*/ -const char *qvirtio_get_dev_type (void ) -{ -const char *arch =qtest_get_arch (); - -if (g_str_equal (arch,"arm" ) ||g_str_equal (arch,"aarch64" )) { -return "device" ;/* for virtio-mmio */ - }else if (g_str_equal (arch,"s390x" )) { -return "ccw" ; - }else { -return "pci" ; - } -} -void qvirtio_start_device (QVirtioDevice *vdev) {qvirtio_reset (vdev);
tests/libqos/virtio.h +0 -1
@@ -142,7 +142,6 @@ bool qvirtqueue_get_buf(QVirtQueue *vq, uint32_t *desc_idx, uint32_t *len);void qvirtqueue_set_used_event (QVirtQueue *vq,uint16_t idx); -const char *qvirtio_get_dev_type (void );void qvirtio_start_device (QVirtioDevice *vdev);#endif
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 45/57] qos-test: ac97 test node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Convert tests/ac97-test to a driver node; currently it runs the PCI nop test only, therefore we're not placing it in tests/libqos.
--- tests/Makefile.include | 3 +-- tests/ac97-test.c | 47 ++++++++++++++++++++++++++++++++++++----------- 2 files changed, 37 insertions(+), 13 deletions(-)
tests/Makefile.include +1 -2
@@ -159,7 +159,6 @@ check-qtest-pci-$(CONFIG_PCNET_PCI) += tests/pcnet-test$(EXESUF) check-qtest-pci-$(CONFIG_EEPRO100_PCI) += tests/eepro100-test$(EXESUF) check-qtest-pci-$(CONFIG_NE2000_PCI) += tests/ne2000-test$(EXESUF) check-qtest-pci-$(CONFIG_NVME_PCI) += tests/nvme-test$(EXESUF) -check-qtest-pci-$(CONFIG_AC97) += tests/ac97-test$(EXESUF) check-qtest-pci-$(CONFIG_ES1370) += tests/es1370-test$(EXESUF) check-qtest-pci-$(CONFIG_IPACK) += tests/tpci200-test$(EXESUF) check-qtest-pci-$(CONFIG_IPACK) += $(check-qtest-ipack-y)
@@ -754,6 +753,7 @@ qos-test-obj-y += tests/libqos/ppc64_pseries-machine.o qos-test-obj-y += tests/libqos/x86_64_pc-machine.o # Tests +qos-test-obj-y += tests/ac97-test.o qos-test-obj-y += tests/e1000e-test.o qos-test-obj-y += tests/pci-test.o qos-test-obj-y += tests/sdhci-test.o
@@ -822,7 +822,6 @@ tests/drive_del-test$(EXESUF): tests/drive_del-test.o tests/nvme-test$(EXESUF): tests/nvme-test.o $(libqos-pc-obj-y) tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o tests/i82801b11-test$(EXESUF): tests/i82801b11-test.o -tests/ac97-test$(EXESUF): tests/ac97-test.o tests/es1370-test$(EXESUF): tests/es1370-test.o tests/intel-hda-test$(EXESUF): tests/intel-hda-test.o tests/ioh3420-test$(EXESUF): tests/ioh3420-test.o
tests/ac97-test.c +36 -11
59 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 46/57] qos-test: tpci200 test node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Convert tests/tpci200-test to a driver node; currently it runs the PCI nop test only, but it also produces the ipack interface.
--- tests/Makefile.include | 3 +-- tests/libqos/tpci200.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/tpci200-test.c | 31 ------------------------ 3 files changed, 66 insertions(+), 33 deletions(-) create mode 100644 tests/libqos/tpci200.c delete mode 100644 tests/tpci200-test.c
tests/Makefile.include +1 -2
@@ -160,7 +160,6 @@ check-qtest-pci-$(CONFIG_EEPRO100_PCI) += tests/eepro100-test$(EXESUF) check-qtest-pci-$(CONFIG_NE2000_PCI) += tests/ne2000-test$(EXESUF) check-qtest-pci-$(CONFIG_NVME_PCI) += tests/nvme-test$(EXESUF) check-qtest-pci-$(CONFIG_ES1370) += tests/es1370-test$(EXESUF) -check-qtest-pci-$(CONFIG_IPACK) += tests/tpci200-test$(EXESUF) check-qtest-pci-$(CONFIG_IPACK) += $(check-qtest-ipack-y) check-qtest-pci-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF) check-qtest-pci-$(CONFIG_HDA) += tests/intel-hda-test$(EXESUF)
@@ -731,6 +730,7 @@ qos-test-obj-y = tests/qos-test.o $(libqgraph-obj-y) qos-test-obj-y += $(libqos-pc-obj-y) $(libqos-spapr-obj-y) qos-test-obj-y += tests/libqos/e1000e.o qos-test-obj-y += tests/libqos/sdhci.o +qos-test-obj-y += tests/libqos/tpci200.o qos-test-obj-y += tests/libqos/virtio.o qos-test-obj-$(CONFIG_VIRTFS) += tests/libqos/virtio-9p.o qos-test-obj-y += tests/libqos/virtio-balloon.o
@@ -811,7 +811,6 @@ tests/ne2000-test$(EXESUF): tests/ne2000-test.o tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y) tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o -tests/tpci200-test$(EXESUF): tests/tpci200-test.o tests/display-vga-test$(EXESUF): tests/display-vga-test.o tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o tests/qom-test$(EXESUF): tests/qom-test.o
tests/libqos/tpci200.c new file +65 -0
65 lines not on this page · raw message
tests/tpci200-test.c deleted +0 -31
@@ -1,31 +0,0 @@ -/* -* QTest testcase for tpci200 PCI-IndustryPack bridge -* -* Copyright (c) 2014 SUSE LINUX Products GmbH -* -* This work is licensed under the terms of the GNU GPL, version 2 or later. -* See the COPYING file in the top-level directory. -*/ - -#include "qemu/osdep.h" -#include "libqtest.h" - -/* Tests only initialization so far. TODO: Replace with functional tests */ -static void nop (void ) -{ -} - -int main (int argc,char **argv) -{ -int ret; - -g_test_init (&argc, &argv,NULL ); -qtest_add_func ("/tpci200/nop" , nop); - -qtest_start ("-device tpci200" ); - ret =g_test_run (); - -qtest_end (); - -return ret; -}
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 47/57] qos-test: ipoctal232 test node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Convert tests/ipoctal232-test to a driver node; currently it runs the PCI nop test only, therefore we're not placing it in tests/libqos.
This test creates a tpci200 node that produces an interface ipack consumed by the ipoctal232 device.
--- tests/Makefile.include | 5 +---- tests/ipoctal232-test.c | 35 ++++++++++++++++++++++++++--------- 2 files changed, 27 insertions(+), 13 deletions(-)
tests/Makefile.include +1 -4
@@ -151,8 +151,6 @@ check-qtest-generic-y += tests/qmp-cmd-test$(EXESUF) check-qtest-generic-y += tests/device-introspect-test$(EXESUF) check-qtest-generic-y += tests/cdrom-test$(EXESUF) -check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF) - check-qtest-pci-y += tests/e1000-test$(EXESUF) check-qtest-pci-$(CONFIG_RTL8139_PCI) += tests/rtl8139-test$(EXESUF) check-qtest-pci-$(CONFIG_PCNET_PCI) += tests/pcnet-test$(EXESUF)
@@ -160,7 +158,6 @@ check-qtest-pci-$(CONFIG_EEPRO100_PCI) += tests/eepro100-test$(EXESUF) check-qtest-pci-$(CONFIG_NE2000_PCI) += tests/ne2000-test$(EXESUF) check-qtest-pci-$(CONFIG_NVME_PCI) += tests/nvme-test$(EXESUF) check-qtest-pci-$(CONFIG_ES1370) += tests/es1370-test$(EXESUF) -check-qtest-pci-$(CONFIG_IPACK) += $(check-qtest-ipack-y) check-qtest-pci-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF) check-qtest-pci-$(CONFIG_HDA) += tests/intel-hda-test$(EXESUF) check-qtest-pci-$(CONFIG_IVSHMEM_DEVICE) += tests/ivshmem-test$(EXESUF)
@@ -755,6 +752,7 @@ qos-test-obj-y += tests/libqos/x86_64_pc-machine.o # Tests qos-test-obj-y += tests/ac97-test.o qos-test-obj-y += tests/e1000e-test.o +qos-test-obj-y += tests/ipoctal232-test.o qos-test-obj-y += tests/pci-test.o qos-test-obj-y += tests/sdhci-test.o qos-test-obj-$(CONFIG_VHOST_NET_USER) += tests/vhost-user-test.o $(chardev-obj-y) $(test-io-obj-y)
@@ -812,7 +810,6 @@ tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y) tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o tests/display-vga-test$(EXESUF): tests/display-vga-test.o -tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o tests/qom-test$(EXESUF): tests/qom-test.o tests/test-hmp$(EXESUF): tests/test-hmp.o tests/machine-none-test$(EXESUF): tests/machine-none-test.o
tests/ipoctal232-test.c +26 -9
@@ -9,23 +9,40 @@#include "qemu/osdep.h" #include "libqtest.h" +#include "libqos/qgraph.h" + +typedef struct QIpoctal232 QIpoctal232 ; + +struct QIpoctal232 { +QOSGraphObject obj; +};/* Tests only initialization so far. TODO: Replace with functional tests */ -static void nop (void ) +static void nop (void *obj,void *data,QGuestAllocator *alloc) { } -int main (int argc,char **argv) +static void *ipoctal232_create (void *pci_bus,QGuestAllocator *alloc, +void *addr) { -int ret; +QIpoctal232 *ipoctal232 =g_new0 (QIpoctal232,1 ); -g_test_init (&argc, &argv,NULL ); -qtest_add_func ("/ipoctal232/tpci200/nop" , nop); +return &ipoctal232->obj; +} -qtest_start ("-device tpci200,id=ipack0 -device ipoctal232,bus=ipack0.0" ); - ret =g_test_run (); +static void ipoctal232_register_nodes (void ) +{ +qos_node_create_driver ("ipoctal232" , ipoctal232_create); +qos_node_consumes ("ipoctal232" ,"ipack" , &(QOSGraphEdgeOptions ) { + .extra_device_opts ="bus=ipack0.0" , + }); +} -qtest_end (); +libqos_init (ipoctal232_register_nodes); -return ret; +static void register_ipoctal232_test (void ) +{ +qos_add_test ("nop" ,"ipoctal232" , nop,NULL ); } + +libqos_init (register_ipoctal232_test);
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 48/57] qos-test: ne2k_pci test node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Convert tests/ne2000-test to a driver node; currently it runs the PCI nop test only, therefore we're not placing it in tests/libqos.
The actual device consumed by the test is ne2k_pci.
--- tests/Makefile.include | 3 +-- tests/ne2000-test.c | 46 ++++++++++++++++++++++++++++++++++++---------- 2 files changed, 37 insertions(+), 12 deletions(-)
tests/Makefile.include +1 -2
@@ -155,7 +155,6 @@ check-qtest-pci-y += tests/e1000-test$(EXESUF) check-qtest-pci-$(CONFIG_RTL8139_PCI) += tests/rtl8139-test$(EXESUF) check-qtest-pci-$(CONFIG_PCNET_PCI) += tests/pcnet-test$(EXESUF) check-qtest-pci-$(CONFIG_EEPRO100_PCI) += tests/eepro100-test$(EXESUF) -check-qtest-pci-$(CONFIG_NE2000_PCI) += tests/ne2000-test$(EXESUF) check-qtest-pci-$(CONFIG_NVME_PCI) += tests/nvme-test$(EXESUF) check-qtest-pci-$(CONFIG_ES1370) += tests/es1370-test$(EXESUF) check-qtest-pci-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF)
@@ -753,6 +752,7 @@ qos-test-obj-y += tests/libqos/x86_64_pc-machine.o qos-test-obj-y += tests/ac97-test.o qos-test-obj-y += tests/e1000e-test.o qos-test-obj-y += tests/ipoctal232-test.o +qos-test-obj-y += tests/ne2000-test.o qos-test-obj-y += tests/pci-test.o qos-test-obj-y += tests/sdhci-test.o qos-test-obj-$(CONFIG_VHOST_NET_USER) += tests/vhost-user-test.o $(chardev-obj-y) $(test-io-obj-y)
@@ -805,7 +805,6 @@ tests/pcnet-test$(EXESUF): tests/pcnet-test.o tests/pnv-xscom-test$(EXESUF): tests/pnv-xscom-test.o tests/eepro100-test$(EXESUF): tests/eepro100-test.o tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o -tests/ne2000-test$(EXESUF): tests/ne2000-test.o tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y) tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o
tests/ne2000-test.c +36 -10
59 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 49/57] qos-test: nvme test node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Convert tests/nvme-test to a driver node; the code to discover the PCI device is replaced by generic qgraph code, therefore we're not placing it in tests/libqos.
--- tests/Makefile.include | 3 +- tests/nvme-test.c | 78 +++++++++++++++++++++++++++----------------------- 2 files changed, 43 insertions(+), 38 deletions(-)
tests/Makefile.include +1 -2
@@ -155,7 +155,6 @@ check-qtest-pci-y += tests/e1000-test$(EXESUF) check-qtest-pci-$(CONFIG_RTL8139_PCI) += tests/rtl8139-test$(EXESUF) check-qtest-pci-$(CONFIG_PCNET_PCI) += tests/pcnet-test$(EXESUF) check-qtest-pci-$(CONFIG_EEPRO100_PCI) += tests/eepro100-test$(EXESUF) -check-qtest-pci-$(CONFIG_NVME_PCI) += tests/nvme-test$(EXESUF) check-qtest-pci-$(CONFIG_ES1370) += tests/es1370-test$(EXESUF) check-qtest-pci-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF) check-qtest-pci-$(CONFIG_HDA) += tests/intel-hda-test$(EXESUF)
@@ -753,6 +752,7 @@ qos-test-obj-y += tests/ac97-test.o qos-test-obj-y += tests/e1000e-test.o qos-test-obj-y += tests/ipoctal232-test.o qos-test-obj-y += tests/ne2000-test.o +qos-test-obj-y += tests/nvme-test.o qos-test-obj-y += tests/pci-test.o qos-test-obj-y += tests/sdhci-test.o qos-test-obj-$(CONFIG_VHOST_NET_USER) += tests/vhost-user-test.o $(chardev-obj-y) $(test-io-obj-y)
@@ -814,7 +814,6 @@ tests/test-hmp$(EXESUF): tests/test-hmp.o tests/machine-none-test$(EXESUF): tests/machine-none-test.o tests/device-plug-test$(EXESUF): tests/device-plug-test.o tests/drive_del-test$(EXESUF): tests/drive_del-test.o -tests/nvme-test$(EXESUF): tests/nvme-test.o $(libqos-pc-obj-y) tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o tests/i82801b11-test$(EXESUF): tests/i82801b11-test.o tests/es1370-test$(EXESUF): tests/es1370-test.o
tests/nvme-test.c +42 -36
107 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 50/57] qos-test: pcnet test node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Convert tests/pcnet-test to a driver node; currently it runs the PCI nop test only, therefore we're not placing it in tests/libqos.
--- tests/Makefile.include | 3 +-- tests/pcnet-test.c | 46 ++++++++++++++++++++++++++++++++++++---------- 2 files changed, 37 insertions(+), 12 deletions(-)
tests/Makefile.include +1 -2
@@ -153,7 +153,6 @@ check-qtest-generic-y += tests/cdrom-test$(EXESUF) check-qtest-pci-y += tests/e1000-test$(EXESUF) check-qtest-pci-$(CONFIG_RTL8139_PCI) += tests/rtl8139-test$(EXESUF) -check-qtest-pci-$(CONFIG_PCNET_PCI) += tests/pcnet-test$(EXESUF) check-qtest-pci-$(CONFIG_EEPRO100_PCI) += tests/eepro100-test$(EXESUF) check-qtest-pci-$(CONFIG_ES1370) += tests/es1370-test$(EXESUF) check-qtest-pci-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF)
@@ -754,6 +753,7 @@ qos-test-obj-y += tests/ipoctal232-test.o qos-test-obj-y += tests/ne2000-test.o qos-test-obj-y += tests/nvme-test.o qos-test-obj-y += tests/pci-test.o +qos-test-obj-y += tests/pcnet-test.o qos-test-obj-y += tests/sdhci-test.o qos-test-obj-$(CONFIG_VHOST_NET_USER) += tests/vhost-user-test.o $(chardev-obj-y) $(test-io-obj-y) qos-test-obj-y += tests/virtio-test.o
@@ -801,7 +801,6 @@ tests/q35-test$(EXESUF): tests/q35-test.o $(libqos-pc-obj-y) tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y) tests/e1000-test$(EXESUF): tests/e1000-test.o tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o $(libqos-pc-obj-y) -tests/pcnet-test$(EXESUF): tests/pcnet-test.o tests/pnv-xscom-test$(EXESUF): tests/pnv-xscom-test.o tests/eepro100-test$(EXESUF): tests/eepro100-test.o tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o
tests/pcnet-test.c +36 -10
59 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 52/57] qos-test: usb-hcd-ohci test node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Convert tests/usb-hcd-ohci-test to a driver node; currently it runs the PCI nop test only, therefore we're not placing it in tests/libqos.
--- tests/Makefile.include | 4 +--- tests/usb-hcd-ohci-test.c | 54 +++++++++++++++++++++++++++++++++++------------ 2 files changed, 42 insertions(+), 16 deletions(-)
tests/Makefile.include +1 -3
@@ -184,7 +184,6 @@ check-qtest-i386-$(CONFIG_VMXNET3_PCI) += tests/vmxnet3-test$(EXESUF) check-qtest-i386-$(CONFIG_PVPANIC) += tests/pvpanic-test$(EXESUF) check-qtest-i386-$(CONFIG_I82801B11) += tests/i82801b11-test$(EXESUF) check-qtest-i386-$(CONFIG_IOH3420) += tests/ioh3420-test$(EXESUF) -check-qtest-i386-$(CONFIG_USB_OHCI) += tests/usb-hcd-ohci-test$(EXESUF) check-qtest-i386-$(CONFIG_USB_UHCI) += tests/usb-hcd-uhci-test$(EXESUF) ifeq ($(CONFIG_USB_ECHI)$(CONFIG_USB_UHCI),yy) check-qtest-i386-y += tests/usb-hcd-ehci-test$(EXESUF)
@@ -241,7 +240,6 @@ check-qtest-ppc64-y += tests/migration-test$(EXESUF) check-qtest-ppc64-y += tests/test-announce-self$(EXESUF) check-qtest-ppc64-$(CONFIG_PSERIES) += tests/rtas-test$(EXESUF) check-qtest-ppc64-$(CONFIG_SLIRP) += tests/pxe-test$(EXESUF) -check-qtest-ppc64-$(CONFIG_USB_OHCI) += tests/usb-hcd-ohci-test$(EXESUF) check-qtest-ppc64-$(CONFIG_USB_UHCI) += tests/usb-hcd-uhci-test$(EXESUF) check-qtest-ppc64-$(CONFIG_USB_XHCI_NEC) += tests/usb-hcd-xhci-test$(EXESUF) check-qtest-ppc64-$(CONFIG_SLIRP) += tests/test-netfilter$(EXESUF)
@@ -755,6 +753,7 @@ qos-test-obj-y += tests/pci-test.o qos-test-obj-y += tests/pcnet-test.o qos-test-obj-y += tests/sdhci-test.o qos-test-obj-y += tests/spapr-phb-test.o +qos-test-obj-y += tests/usb-hcd-ohci-test.o $(libqos-usb-obj-y) qos-test-obj-$(CONFIG_VHOST_NET_USER) += tests/vhost-user-test.o $(chardev-obj-y) $(test-io-obj-y) qos-test-obj-y += tests/virtio-test.o qos-test-obj-$(CONFIG_VIRTFS) += tests/virtio-9p-test.o
@@ -817,7 +816,6 @@ tests/i82801b11-test$(EXESUF): tests/i82801b11-test.o tests/es1370-test$(EXESUF): tests/es1370-test.o tests/intel-hda-test$(EXESUF): tests/intel-hda-test.o tests/ioh3420-test$(EXESUF): tests/ioh3420-test.o -tests/usb-hcd-ohci-test$(EXESUF): tests/usb-hcd-ohci-test.o $(libqos-usb-obj-y) tests/usb-hcd-uhci-test$(EXESUF): tests/usb-hcd-uhci-test.o $(libqos-usb-obj-y) tests/usb-hcd-ehci-test$(EXESUF): tests/usb-hcd-ehci-test.o $(libqos-usb-obj-y) tests/usb-hcd-xhci-test$(EXESUF): tests/usb-hcd-xhci-test.o $(libqos-usb-obj-y)
tests/usb-hcd-ohci-test.c +41 -13
71 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 51/57] qos-test: spapr-phb test node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Convert tests/spapr-phb-test to a qgraph test node, spapr-phb-test. This test adds another spapr-pci-host-bridge device in the ppc64/pseries machine
--- tests/Makefile.include | 3 +-- tests/spapr-phb-test.c | 32 ++++++++++++++------------------ 2 files changed, 15 insertions(+), 20 deletions(-)
tests/Makefile.include +1 -2
@@ -235,7 +235,6 @@ check-qtest-ppc-y += tests/boot-serial-test$(EXESUF) check-qtest-ppc-$(CONFIG_M48T59) += tests/m48t59-test$(EXESUF) check-qtest-ppc64-y += $(check-qtest-ppc-y) -check-qtest-ppc64-$(CONFIG_PSERIES) += tests/spapr-phb-test$(EXESUF) check-qtest-ppc64-$(CONFIG_PSERIES) += tests/device-plug-test$(EXESUF) check-qtest-ppc64-$(CONFIG_POWERNV) += tests/pnv-xscom-test$(EXESUF) check-qtest-ppc64-y += tests/migration-test$(EXESUF)
@@ -755,6 +754,7 @@ qos-test-obj-y += tests/nvme-test.o qos-test-obj-y += tests/pci-test.o qos-test-obj-y += tests/pcnet-test.o qos-test-obj-y += tests/sdhci-test.o +qos-test-obj-y += tests/spapr-phb-test.o qos-test-obj-$(CONFIG_VHOST_NET_USER) += tests/vhost-user-test.o $(chardev-obj-y) $(test-io-obj-y) qos-test-obj-y += tests/virtio-test.o qos-test-obj-$(CONFIG_VIRTFS) += tests/virtio-9p-test.o
@@ -777,7 +777,6 @@ tests/rtc-test$(EXESUF): tests/rtc-test.o tests/m48t59-test$(EXESUF): tests/m48t59-test.o tests/hexloader-test$(EXESUF): tests/hexloader-test.o tests/endianness-test$(EXESUF): tests/endianness-test.o -tests/spapr-phb-test$(EXESUF): tests/spapr-phb-test.o $(libqos-obj-y) tests/prom-env-test$(EXESUF): tests/prom-env-test.o $(libqos-obj-y) tests/rtas-test$(EXESUF): tests/rtas-test.o $(libqos-spapr-obj-y) tests/fdc-test$(EXESUF): tests/fdc-test.o
tests/spapr-phb-test.c +14 -18
@@ -7,29 +7,25 @@* This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. */ -#include "qemu/osdep.h" +#include "qemu/osdep.h" #include "libqtest.h" +#include "libqos/qgraph.h" -#define TYPE_SPAPR_PCI_HOST_BRIDGE "spapr-pci-host-bridge" - -/* Tests only initialization so far. TODO: Replace with functional tests */ -static void test_phb_device (void ) +/* Tests only initialization so far. TODO: Replace with functional tests, +* for example by producing pci-bus. +*/ +static void test_phb_device (void *obj,void *data,QGuestAllocator *alloc) { } -int main (int argc,char **argv) +static void register_phb_test (void ) { -int ret; - -g_test_init (&argc, &argv,NULL ); -qtest_add_func ("/spapr-phb/device" , test_phb_device); - -qtest_start ("-device " TYPE_SPAPR_PCI_HOST_BRIDGE ",index=30" ); - - ret =g_test_run (); - -qtest_end (); - -return ret; +qos_add_test ("spapr-phb-test" ,"ppc64/pseries" , + test_phb_device, &(QOSGraphTestOptions ) { + .edge.before_cmd_line ="-device spapr-pci-host-bridge" +",index=30" , + }); } + +libqos_init (register_phb_test);
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 53/57] qos-test: vmxnet3 test node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Convert tests/vmxnet3-test to a driver node; currently it runs the PCI nop test only, therefore we're not placing it in tests/libqos.
--- tests/Makefile.include | 3 +-- tests/vmxnet3-test.c | 46 ++++++++++++++++++++++++++++++++++++---------- 2 files changed, 37 insertions(+), 12 deletions(-)
tests/Makefile.include +1 -2
@@ -180,7 +180,6 @@ check-qtest-i386-y += tests/drive_del-test$(EXESUF) check-qtest-i386-$(CONFIG_WDT_IB700) += tests/wdt_ib700-test$(EXESUF) check-qtest-i386-y += tests/tco-test$(EXESUF) check-qtest-i386-y += $(check-qtest-pci-y) -check-qtest-i386-$(CONFIG_VMXNET3_PCI) += tests/vmxnet3-test$(EXESUF) check-qtest-i386-$(CONFIG_PVPANIC) += tests/pvpanic-test$(EXESUF) check-qtest-i386-$(CONFIG_I82801B11) += tests/i82801b11-test$(EXESUF) check-qtest-i386-$(CONFIG_IOH3420) += tests/ioh3420-test$(EXESUF)
@@ -762,6 +761,7 @@ qos-test-obj-y += tests/virtio-net-test.o qos-test-obj-y += tests/virtio-rng-test.o qos-test-obj-y += tests/virtio-scsi-test.o qos-test-obj-y += tests/virtio-serial-test.o +qos-test-obj-y += tests/vmxnet3-test.o check-unit-y += tests/test-qgraph$(EXESUF) tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y)
@@ -801,7 +801,6 @@ tests/e1000-test$(EXESUF): tests/e1000-test.o tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o $(libqos-pc-obj-y) tests/pnv-xscom-test$(EXESUF): tests/pnv-xscom-test.o tests/eepro100-test$(EXESUF): tests/eepro100-test.o -tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y) tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o
tests/vmxnet3-test.c +36 -10
59 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 54/57] qos-test: es1370 test node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Convert tests/es1370-test to a driver node; currently it runs the PCI nop test only, therefore we're not placing it in tests/libqos.
--- tests/Makefile.include | 3 +-- tests/es1370-test.c | 46 ++++++++++++++++++++++++++++++++++++---------- 2 files changed, 37 insertions(+), 12 deletions(-)
tests/Makefile.include +1 -2
@@ -154,7 +154,6 @@ check-qtest-generic-y += tests/cdrom-test$(EXESUF) check-qtest-pci-y += tests/e1000-test$(EXESUF) check-qtest-pci-$(CONFIG_RTL8139_PCI) += tests/rtl8139-test$(EXESUF) check-qtest-pci-$(CONFIG_EEPRO100_PCI) += tests/eepro100-test$(EXESUF) -check-qtest-pci-$(CONFIG_ES1370) += tests/es1370-test$(EXESUF) check-qtest-pci-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF) check-qtest-pci-$(CONFIG_HDA) += tests/intel-hda-test$(EXESUF) check-qtest-pci-$(CONFIG_IVSHMEM_DEVICE) += tests/ivshmem-test$(EXESUF)
@@ -745,6 +744,7 @@ qos-test-obj-y += tests/libqos/x86_64_pc-machine.o # Tests qos-test-obj-y += tests/ac97-test.o qos-test-obj-y += tests/e1000e-test.o +qos-test-obj-y += tests/es1370-test.o qos-test-obj-y += tests/ipoctal232-test.o qos-test-obj-y += tests/ne2000-test.o qos-test-obj-y += tests/nvme-test.o
@@ -812,7 +812,6 @@ tests/device-plug-test$(EXESUF): tests/device-plug-test.o tests/drive_del-test$(EXESUF): tests/drive_del-test.o tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o tests/i82801b11-test$(EXESUF): tests/i82801b11-test.o -tests/es1370-test$(EXESUF): tests/es1370-test.o tests/intel-hda-test$(EXESUF): tests/intel-hda-test.o tests/ioh3420-test$(EXESUF): tests/ioh3420-test.o tests/usb-hcd-uhci-test$(EXESUF): tests/usb-hcd-uhci-test.o $(libqos-usb-obj-y)
tests/es1370-test.c +36 -10
59 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 55/57] qos-test: eepro100 test node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Convert tests/eepro100-test to a driver node; currently it runs the PCI nop test only, therefore we're not placing it in tests/libqos. For now, all nodes share the same constructor and destructor.
--- tests/Makefile.include | 3 +-- tests/eepro100-test.c | 65 +++++++++++++++++++++++++++++++------------------- 2 files changed, 41 insertions(+), 27 deletions(-)
tests/Makefile.include +1 -2
@@ -153,7 +153,6 @@ check-qtest-generic-y += tests/cdrom-test$(EXESUF) check-qtest-pci-y += tests/e1000-test$(EXESUF) check-qtest-pci-$(CONFIG_RTL8139_PCI) += tests/rtl8139-test$(EXESUF) -check-qtest-pci-$(CONFIG_EEPRO100_PCI) += tests/eepro100-test$(EXESUF) check-qtest-pci-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF) check-qtest-pci-$(CONFIG_HDA) += tests/intel-hda-test$(EXESUF) check-qtest-pci-$(CONFIG_IVSHMEM_DEVICE) += tests/ivshmem-test$(EXESUF)
@@ -744,6 +743,7 @@ qos-test-obj-y += tests/libqos/x86_64_pc-machine.o # Tests qos-test-obj-y += tests/ac97-test.o qos-test-obj-y += tests/e1000e-test.o +qos-test-obj-y += tests/eepro100-test.o qos-test-obj-y += tests/es1370-test.o qos-test-obj-y += tests/ipoctal232-test.o qos-test-obj-y += tests/ne2000-test.o
@@ -800,7 +800,6 @@ tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y) tests/e1000-test$(EXESUF): tests/e1000-test.o tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o $(libqos-pc-obj-y) tests/pnv-xscom-test$(EXESUF): tests/pnv-xscom-test.o -tests/eepro100-test$(EXESUF): tests/eepro100-test.o tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y) tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o
tests/eepro100-test.c +40 -25
82 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 56/57] qos-test: e1000 test node
In reply to Paolo BonziniFrom: Emanuele Giuseppe Esposito <[email protected]>
Convert tests/e1000-test to a driver node; currently it runs the PCI nop test only, therefore we're not placing it in tests/libqos.
--- tests/Makefile.include | 3 +-- tests/e1000-test.c | 64 +++++++++++++++++++++++++++++++------------------- 2 files changed, 41 insertions(+), 26 deletions(-)
tests/Makefile.include +1 -2
@@ -151,7 +151,6 @@ check-qtest-generic-y += tests/qmp-cmd-test$(EXESUF) check-qtest-generic-y += tests/device-introspect-test$(EXESUF) check-qtest-generic-y += tests/cdrom-test$(EXESUF) -check-qtest-pci-y += tests/e1000-test$(EXESUF) check-qtest-pci-$(CONFIG_RTL8139_PCI) += tests/rtl8139-test$(EXESUF) check-qtest-pci-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF) check-qtest-pci-$(CONFIG_HDA) += tests/intel-hda-test$(EXESUF)
@@ -742,6 +741,7 @@ qos-test-obj-y += tests/libqos/x86_64_pc-machine.o # Tests qos-test-obj-y += tests/ac97-test.o +qos-test-obj-y += tests/e1000-test.o qos-test-obj-y += tests/e1000e-test.o qos-test-obj-y += tests/eepro100-test.o qos-test-obj-y += tests/es1370-test.o
@@ -797,7 +797,6 @@ tests/m25p80-test$(EXESUF): tests/m25p80-test.o tests/i440fx-test$(EXESUF): tests/i440fx-test.o $(libqos-pc-obj-y) tests/q35-test$(EXESUF): tests/q35-test.o $(libqos-pc-obj-y) tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y) -tests/e1000-test$(EXESUF): tests/e1000-test.o tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o $(libqos-pc-obj-y) tests/pnv-xscom-test$(EXESUF): tests/pnv-xscom-test.o tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o
tests/e1000-test.c +40 -24
81 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 57/57] qos-test: megasas test node
In reply to Paolo BonziniConvert tests/megasas-test to a driver node; the code to discover the PCI device is replaced by generic qgraph code.
--- tests/Makefile.include | 3 +- tests/megasas-test.c | 80 +++++++++++++++++++++++++------------------------- 2 files changed, 41 insertions(+), 42 deletions(-)
tests/Makefile.include +1 -2
@@ -155,7 +155,6 @@ check-qtest-pci-$(CONFIG_RTL8139_PCI) += tests/rtl8139-test$(EXESUF) check-qtest-pci-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF) check-qtest-pci-$(CONFIG_HDA) += tests/intel-hda-test$(EXESUF) check-qtest-pci-$(CONFIG_IVSHMEM_DEVICE) += tests/ivshmem-test$(EXESUF) -check-qtest-pci-$(CONFIG_MEGASAS_SCSI_PCI) += tests/megasas-test$(EXESUF) check-qtest-i386-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF) check-qtest-i386-y += tests/fdc-test$(EXESUF)
@@ -746,6 +745,7 @@ qos-test-obj-y += tests/e1000e-test.o qos-test-obj-y += tests/eepro100-test.o qos-test-obj-y += tests/es1370-test.o qos-test-obj-y += tests/ipoctal232-test.o +qos-test-obj-y += tests/megasas-test.o qos-test-obj-y += tests/ne2000-test.o qos-test-obj-y += tests/nvme-test.o qos-test-obj-y += tests/pci-test.o
@@ -827,7 +827,6 @@ tests/test-filter-mirror$(EXESUF): tests/test-filter-mirror.o $(qtest-obj-y) tests/test-filter-redirector$(EXESUF): tests/test-filter-redirector.o $(qtest-obj-y) tests/test-x86-cpuid-compat$(EXESUF): tests/test-x86-cpuid-compat.o $(qtest-obj-y) tests/ivshmem-test$(EXESUF): tests/ivshmem-test.o contrib/ivshmem-server/ivshmem-server.o $(libqos-pc-obj-y) $(libqos-spapr-obj-y) -tests/megasas-test$(EXESUF): tests/megasas-test.o $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/vhost-user-bridge$(EXESUF): tests/vhost-user-bridge.o $(test-util-obj-y) libvhost-user.a tests/test-uuid$(EXESUF): tests/test-uuid.o $(test-util-obj-y) tests/test-arm-mptimer$(EXESUF): tests/test-arm-mptimer.o
tests/megasas-test.c +40 -40
114 lines not on this page · raw message
Signature · 1 line
1.8.3.1
Peter Maydell
AppliedQuoted 10 lines · Paolo Bonzini
The following changes since commit
3a75ef6a0fe397b0d36930415be6b123750a6afe:Merge remote-tracking branch 'remotes/kraxel/tags/usb-20190307-pull-request' into staging (2019-03-07 14:06:42 +0000)
are available in the git repository at:
git://github.com/bonzini/qemu.gittags/for-upstream-qgraph
Quoted 8 lines
for you to fetch changes up to
15bd8b2cdabbf8f3371f2e30b1ef04cf9fe9ec87:qos-test: megasas test node (2019-03-07 17:25:09 +0100)
----------------------------------------------------------------
qgraph project from GSoC 2018----------------------------------------------------------------
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/4.0
for any user-visible changes.
-- PMM