summaryrefslogtreecommitdiff
path: root/tests/libqos
AgeCommit message (Collapse)Author
2020-01-12tests/libqos: Move the libqos files under tests/qtest/Thomas Huth
The qos stuff belongs to qtest, so move it into that directory, too. Message-Id: <20191218103059.11729-8-thuth@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2019-10-29libqos: tolerate wait-unplug migration stateJens Freimann
Signed-off-by: Jens Freimann <jfreimann@redhat.com> Message-Id: <20191029114905.6856-10-jfreimann@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-10-25libqos: add VIRTIO PCI 1.0 supportStefan Hajnoczi
Implement the VIRTIO 1.0 virtio-pci interface. The main change here is that the register layout is no longer a fixed layout in BAR 0. Instead we have to iterate of PCI Capabilities to find descriptions of where various registers are located. The vring registers are also more fine-grained, allowing for more flexible vring layouts, but we don't take advantage of that. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Sergio Lopez <slp@redhat.com> Message-Id: <20191023100425.12168-17-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Thomas Huth <thuth@redhat.com>
2019-10-25libqos: extract Legacy virtio-pci.c codeStefan Hajnoczi
The current libqos virtio-pci.c code implements the VIRTIO Legacy interface. Extract existing code in preparation for VIRTIO 1.0 support. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Sergio Lopez <slp@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20191023100425.12168-16-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-10-25libqos: make the virtio-pci BAR index configurableStefan Hajnoczi
The Legacy virtio-pci interface always uses BAR 0. VIRTIO 1.0 may need to use a different BAR index, so make it configurable. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20191023100425.12168-15-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-10-25libqos: expose common virtqueue setup/cleanup functionsStefan Hajnoczi
The VIRTIO 1.0 code will need to perform additional steps but it will reuse the common virtqueue setup/cleanup code. Make these functions public. Make sure to invoke callbacks via QVirtioBus instead of directly calling the virtio-pci Legacy versions of these functions. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Sergio Lopez <slp@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20191023100425.12168-14-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-10-25libqos: add MSI-X callbacks to QVirtioPCIDeviceStefan Hajnoczi
The MSI-X vectors are programmed differently in the VIRTIO 1.0 and Legacy interfaces. Introduce callbacks so different implementations can be used depending on the interface version. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Sergio Lopez <slp@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20191023100425.12168-13-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-10-25libqos: pass full QVirtQueue to set_queue_address()Stefan Hajnoczi
Instead of just passing the vring page frame number, pass the full QVirtQueue. This will allow the VIRTIO 1.0 transport to program the fine-grained vring address registers in the future. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Sergio Lopez <slp@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20191023100425.12168-12-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-10-25libqos: add iteration support to qpci_find_capability()Stefan Hajnoczi
VIRTIO 1.0 PCI devices have multiple PCI_CAP_ID_VNDR capabilities so we need a way to iterate over them. Extend qpci_find_capability() to take the last address. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> -- v3: * Document qpci_find_capability() Message-Id: <20191023100425.12168-11-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-10-25libqos: access VIRTIO 1.0 vring in little-endianStefan Hajnoczi
VIRTIO 1.0 uses little-endian for the vring. Legacy VIRTIO uses guest endianness. Adjust the code to handle both. Note that qvirtio_readq() is not defined because it has no users. All the other accessors are really needed. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20191023100425.12168-10-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-10-25libqos: implement VIRTIO 1.0 FEATURES_OK stepStefan Hajnoczi
Device initialization has an extra step in VIRTIO 1.0. The FEATURES_OK status bit is set to indicate that feature negotiation has completed. The driver then reads the status register again to check that the device agrees with the final features. Implement this step as part of qvirtio_set_features() instead of introducing a separate function. This way all existing code works without modifications. The check in qvirtio_set_driver_ok() needs to be updated because FEATURES_OK will be set for VIRTIO 1.0 devices. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20191023100425.12168-9-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Thomas Huth" <thuth@redhat.com>
2019-10-25libqos: enforce Device Initialization orderStefan Hajnoczi
According to VIRTIO 1.1 "3.1.1 Driver Requirements: Device Initialization", configuration space and virtqueues cannot be accessed before features have been negotiated. Enforce this requirement. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20191023100425.12168-8-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com>
2019-10-25libqos: add missing virtio-9p feature negotiationStefan Hajnoczi
VIRTIO Device Initialization requires feature negotiation. The libqos virtio-9p driver lacks feature negotiation and is therefore non-compliant. libqos tests acknowledge all feature bits advertised by the device, except VIRTIO_F_BAD_FEATURE (which devices use to detect broken drivers!) and VIRTIO_RING_F_EVENT_IDX (which is not implemented in libqos and accepting it would break notifications). Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20191023100425.12168-7-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Thomas Huth" <thuth@redhat.com>
2019-10-25libqos: extend feature bits to 64-bitStefan Hajnoczi
In VIRTIO 1.0 feature bits changed from 32-bit to 64-bit. (In fact, the transports allow even more feature bits but nothing uses more than 64 bits today.) Add 64-bit feature bit support to virtio-mmio and virtio-pci. This will be necessary for VIRTIO 1.0 support. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20191023100425.12168-4-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-10-25libqos: read QVIRTIO_MMIO_VERSION registerStefan Hajnoczi
There was no real virtio-mmio ABI change between Legacy and VIRTIO 1.0 except that the Version field was incremented from 1 to 2. However, QEMU does not allow Legacy drivers to perform VIRTIO 1.0 operations like accessing 64-bit feature bits. Since we will introduce 64-bit feature bit support we need a way to differentiate between virtio-mmio Version 1 and 2 to avoid upsetting QEMU when we operate in Legacy mode. Stash away the Version field so later patches can change behavior depending on the version. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20191023100425.12168-3-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-09-05tests/libqos: Replace clock_step with qtest_clock_step in virtio codeThomas Huth
Library functions should not rely on functions that require global_qtest (since they might get used in tests that deal with multiple states). Commit 1999a70a05ad603d ("Make generic virtio code independent from global_qtest") already tried to clean the libqos virtio code, but I missed to replace the clock_step() function. Thus change it now to qtest_clock_step() instead. The logic of the qvirtio_wait_config_isr() function is now pushed to the virtio-mmio.c and virtio-pci.c files instead, since we can get the QTestState here easily. Message-Id: <20190904130047.25808-4-thuth@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2019-09-05tests/libqos/e1000e: Make e1000e libqos functions independent from global_qtestThomas Huth
libqos library functions should never depend on functions (like memread(), memwrite() or clock_step()) that require global_qtest to be set, since library functions might get used in qtests that track multiple states, too. Thus let's replace the global_qtest-related functions with their independent counterparts. Message-Id: <20190904130047.25808-3-thuth@redhat.com> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2019-08-15tests/libqtest: Make qtest_qmp_device_add/del independent from global_qtestThomas Huth
Generic library functions like qtest_qmp_device_add() and _del() should not depend on the global_qtest variable. Pass the test state via parameter instead. Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20190813093047.27948-6-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2019-08-15tests/libqos: Make virtio-pci code independent from global_qtestThomas Huth
The libqos library functions should never depend on global_qtest, since these functions might be used in tests that track multiple test states. So let's use the test state of the QPCIDevice instead. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190813093047.27948-3-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2019-08-15tests/libqos: Make generic virtio code independent from global_qtestThomas Huth
The libqos library functions should never depend on global_qtest, since these functions might be used in tests that track multiple test states. Pass around a pointer to the QTestState instead. Message-Id: <20190814195920.32023-1-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2019-08-15tests: Set read-zeroes on for null-co driverAndrey Shinkevich
This patch is to reduce the number of Valgrind report messages about using uninitialized memory with the null-co driver. It helps to filter real memory issues and is the same work done for the iotests with the commit ID a6862418fec4072. Suggested-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> Message-Id: <1564404360-733987-1-git-send-email-andrey.shinkevich@virtuozzo.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2019-08-15libqos: Account for the ctrl queue in virtio-netOleinik, Alexander
The number of queues is 2n+1, where n == 1 when multiqueue is disabled Signed-off-by: Alexander Oleinik <alxndr@bu.edu> Message-Id: <20190805032400.8054-1-alxndr@bu.edu> [thuth: fixed "intefaces" typo] Signed-off-by: Thomas Huth <thuth@redhat.com>
2019-06-12Supply missing header guardsMarkus Armbruster
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190604181618.19980-5-armbru@redhat.com>
2019-06-12Include qemu/module.h where needed, drop it from qemu-common.hMarkus Armbruster
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190523143508.25387-4-armbru@redhat.com> [Rebased with conflicts resolved automatically, except for hw/usb/dev-hub.c hw/misc/exynos4210_rng.c hw/misc/bcm2835_rng.c hw/misc/aspeed_scu.c hw/display/virtio-vga.c hw/arm/stm32f205_soc.c; ui/cocoa.m fixed up]
2019-06-03libqos: i2c: move address into QI2CDevicePaolo Bonzini
This removes the hardcoded I2C address from the tests. The address is passed via QOSGraphEdgeOptions to i2c_device_create and stored in the QI2CDevice. The i2c_send and i2c_recv functions, along with their wrappers, therefore, can be changed to take a QI2CDevice rather than an adapter/address pair. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-06-03tests: convert ds1338-test to qtestPaolo Bonzini
This way, ds1338-test will run for every machine that exposes an i2c-bus. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-06-03tests: convert OMAP i2c tests to qgraphPaolo Bonzini
This way, pca9952-test and tmp105-test will run for every machine that exposes an i2c-bus. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-06-03libqos: add ARM imx25-pdk machine objectPaolo Bonzini
This is used to test imx_i2c. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-06-03libqos: add ARM n800 machine objectPaolo Bonzini
This is used to test omap_i2c. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-06-03libqos: convert I2C to qgraphPaolo Bonzini
Create an i2c-bus interface, corresponding to the I2CAdapter struct. Wrap IMXI2C and OMAPI2C with a QOSGraphObject, and add the get_driver function to retrieve the I2CAdapter. The conversion is still not complete; for simplicity, i2c_recv and i2c_send (along with their wrappers) still take an adapter/address pair. Fixing that would be complicated until the tests are converted to qgraph, so it is left for after the conversion. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-06-03libqos: split I2CAdapter initialization and allocationPaolo Bonzini
Provide *_init functions that populate an I2CAdapter struct without allocating one, and make the existing *_create functions wrap them. Because in the new setup *_create might return a pointer inside the IMXI2C or OMAPI2C struct, create companion *_free functions to go back to the outer pointer. All this is temporary until allocation will be handled entirely by qgraph. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-06-03libqos: fix omap-i2c receiving more than 4 bytesPaolo Bonzini
If more than 4 bytes are received, the FIFO cannot host the entire contents of the transfer and STP will be nonzero before entering the transfer loop. Also, CNT will contain the number of bytes left to be transferred instead of the total number of bytes in the transfer. (Reverse engineered from the omap_i2c.c source code; no available datasheet). This will fix ds1338-test for omap-i2c. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-06-03libqos: move common i2c code to libqosPaolo Bonzini
The functions to read/write 8-bit or 16-bit registers are the same in tmp105 and pca9552 tests, and in fact they are a special case of "read block"/"write block" functionality; read block in turn is used in ds1338-test. Move everything inside libqos-test, removing the duplication. Account for the small differences by adding to tmp105-test.c the "read register after writing" behavior that is specific to it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-06-03qgraph: fix qos_node_contains with optionsPaolo Bonzini
Currently, if qos_node_contains was passed options, it would still create an edge without any options. Instead, in that case NULL acts as a terminator. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-05-23tests: fw_cfg: add a function to get the fw_cfg fileLi Qiang
This is useful to write qtest about fw_cfg file entry. Signed-off-by: Li Qiang <liq3ea@163.com> Acked-by: Thomas Huth <thuth@redhat.com> Tested-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190424140643.62457-3-liq3ea@163.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2019-05-23tests/libqos: Add pc_fw_cfg_uninit() and use itPhilippe Mathieu-Daudé
The pc_fw_cfg_init() function allocates an IO QFWCFG object. Add the pc_fw_cfg_uninit() function to deallocate it (and use it). Signed-off-by: Li Qiang <liq3ea@163.com> Tested-by: Thomas Huth <thuth@redhat.com> Message-Id: <20190424140643.62457-2-liq3ea@163.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> [PMD: Split patch, fill commit description, call uninit in malloc-pc.c] Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2019-05-23tests/libqos: Add io_fw_cfg_uninit() and mm_fw_cfg_uninit()Philippe Mathieu-Daudé
The mm_fw_cfg_init() allocates a QFWCFG object, add mm_fw_cfg_uninit() to deallocate it. Similarly with io_fw_cfg_init(), add io_fw_cfg_uninit(). Signed-off-by: Li Qiang <liq3ea@163.com> Tested-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190424140643.62457-2-liq3ea@163.com> [PMD: Split patch, filled commit description] Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2019-05-21tests/libqos: Get rid of global_qtest dependency in qvring_init()Thomas Huth
Library functions should not depend on global_qtest functions like writew() and writeq(), so that they can also be used in tests that deal with multiple QTestStates at the same time (like migration tests). Message-Id: <20190515174328.16361-2-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2019-05-13Clean up ill-advised or unusual header guardsMarkus Armbruster
Leading underscores are ill-advised because such identifiers are reserved. Trailing underscores are merely ugly. Strip both. Our header guards commonly end in _H. Normalize the exceptions. Done with scripts/clean-header-guards.pl. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190315145123.28030-7-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> [Changes to slirp/ dropped, as we're about to spin it off]
2019-05-13Clean up header guards that don't match their file nameMarkus Armbruster
Header guard symbols should match their file name to make guard collisions less likely. Cleaned up with scripts/clean-header-guards.pl, followed by some renaming of new guard symbols picked by the script to better ones. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190315145123.28030-6-armbru@redhat.com> [Rebase to master: update include/hw/net/ne2000-isa.h]
2019-05-13Clean up includesMarkus Armbruster
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes, with the changes to the following files manually reverted: contrib/libvhost-user/libvhost-user-glib.h contrib/libvhost-user/libvhost-user.c contrib/libvhost-user/libvhost-user.h linux-user/mips64/cpu_loop.c linux-user/mips64/signal.c linux-user/sparc64/cpu_loop.c linux-user/sparc64/signal.c linux-user/x86_64/cpu_loop.c linux-user/x86_64/signal.c slirp/src/* target/s390x/gen-features.c tests/fp/platform.h tests/migration/s390x/a-b-bios.c tests/test-rcu-simpleq.c tests/test-rcu-tailq.c tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c We're in the process of spinning out slirp/. tests/fp/platform.h is has to include qemu/osdep.h because tests/fp/berkeley-softfloat-3/ and tests/fp/berkeley-testfloat-3/ don't. tests/uefi-test-tools/ is guest software. The remaining reverts are the same as in commit b7d89466dde. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190313162812.8885-1-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Revert change to tests/fp/platform.h, adjust commit message]
2019-05-08tests: qpci_unplug_acpi_device_test() should not rely on global_qtestThomas Huth
libqos functions should not use functions that require global_qtest to be set, since such library functions could also be used by tests that deal with multiple test states. Add a parameter to this function to explicitly specify the test state. Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190508143209.24350-1-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2019-04-08test qgraph.c: Fix segs due to out of scope defaultDr. David Alan Gilbert
The test uses the trick: if (!opts) { opts = &(QOSGraph...Options) { }; } in a couple of places, however the temporary created by the &() {} goes out of scope at the bottom of the if, and results in a seg or assert when opts-> fields are used (on fedora 30's gcc 9). Fixes: fc281c802022cb3a73a5 Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190405184037.16799-1-dgilbert@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2019-04-08tests/libqos: fix usage of bool in pci-spapr.cJafar Abdi
Clean up wrong usage of FALSE and TRUE in places that use "bool" from stdbool.h. FALSE and TRUE (with capital letters) are the constants defined by glib for being used with the "gboolean" type of glib. But some parts of the code also use TRUE and FALSE for variables that are declared as "bool" (the type from <stdbool.h>). Signed-off-by: Jafar Abdi <cafer.abdi@gmail.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Message-Id: <1553351197-14581-4-git-send-email-cafer.abdi@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2019-04-08tests/libqos: fix usage of bool in pci-pc.cJafar Abdi
Clean up wrong usage of FALSE and TRUE in places that use "bool" from stdbool.h. FALSE and TRUE (with capital letters) are the constants defined by glib for being used with the "gboolean" type of glib. But some parts of the code also use TRUE and FALSE for variables that are declared as "bool" (the type from <stdbool.h>). Signed-off-by: Jafar Abdi <cafer.abdi@gmail.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <1553351197-14581-3-git-send-email-cafer.abdi@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2019-03-12ahci-test: Drop dependence on global_qtestEric Blake
Managing parallel connections to two different monitors via the implicit global_qtest makes it hard to copy-and-paste code to tests that are not aware of the implicit state; the management of global_qtest is even harder to follow because it was masked behind set_context(). Instead, explicitly pass QTestState* around (generally, by reusing the member already present in ahci->parent QOSState), and call explicit qtest_* functions on all places that interact with a monitor. We can assert that the conversion is correct by checking that global_qtest remains NULL throughout the test (a later patch that changes global_qtest to not be a public global variable will drop the assertions). Signed-off-by: Eric Blake <eblake@redhat.com> Acked-by: John Snow <jsnow@redhat.com> [thuth: rebased patch to current master branch] Signed-off-by: Thomas Huth <thuth@redhat.com>
2019-03-07qos-test: tpci200 test nodeEmanuele Giuseppe Esposito
Convert tests/tpci200-test to a driver node; currently it runs the PCI nop test only, but it also produces the ipack interface. Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-03-07tests: move virtio entirely to qos-testPaolo Bonzini
The 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. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-03-07tests/libqos: remove pre-qgraph QVirtioPCIDevice APIPaolo Bonzini
Remove the qvirtio_pci_device_find* and qvirtio_pci_device_free APIs, now that they do not have any users. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-03-07tests/libqos: virtio-scsi driver and interface nodesEmanuele Giuseppe Esposito
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 Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>