summaryrefslogtreecommitdiffstats
path: root/tests/libqos/virtio-pci.c
diff options
context:
space:
mode:
authorThomas Huth2019-07-18 17:08:51 +0200
committerThomas Huth2019-08-15 19:24:10 +0200
commit2380d31e19ee32e6466c7724ab72ae9d2fa2db96 (patch)
tree27e207bcf2a29446fb76004cb4002998907b31ae /tests/libqos/virtio-pci.c
parenttests/libqos: Make generic virtio code independent from global_qtest (diff)
downloadqemu-2380d31e19ee32e6466c7724ab72ae9d2fa2db96.tar.gz
qemu-2380d31e19ee32e6466c7724ab72ae9d2fa2db96.tar.xz
qemu-2380d31e19ee32e6466c7724ab72ae9d2fa2db96.zip
tests/libqos: Make virtio-pci code independent from global_qtest
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>
Diffstat (limited to 'tests/libqos/virtio-pci.c')
-rw-r--r--tests/libqos/virtio-pci.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/libqos/virtio-pci.c b/tests/libqos/virtio-pci.c
index a622ca26ca..3f55c047a0 100644
--- a/tests/libqos/virtio-pci.c
+++ b/tests/libqos/virtio-pci.c
@@ -138,9 +138,9 @@ static bool qvirtio_pci_get_queue_isr_status(QVirtioDevice *d, QVirtQueue *vq)
/* No ISR checking should be done if masked, but read anyway */
return qpci_msix_pending(dev->pdev, vqpci->msix_entry);
} else {
- data = readl(vqpci->msix_addr);
+ data = qtest_readl(dev->pdev->bus->qts, vqpci->msix_addr);
if (data == vqpci->msix_data) {
- writel(vqpci->msix_addr, 0);
+ qtest_writel(dev->pdev->bus->qts, vqpci->msix_addr, 0);
return true;
} else {
return false;
@@ -162,9 +162,9 @@ static bool qvirtio_pci_get_config_isr_status(QVirtioDevice *d)
/* No ISR checking should be done if masked, but read anyway */
return qpci_msix_pending(dev->pdev, dev->config_msix_entry);
} else {
- data = readl(dev->config_msix_addr);
+ data = qtest_readl(dev->pdev->bus->qts, dev->config_msix_addr);
if (data == dev->config_msix_data) {
- writel(dev->config_msix_addr, 0);
+ qtest_writel(dev->pdev->bus->qts, dev->config_msix_addr, 0);
return true;
} else {
return false;