Commit 2380d31e authored by Thomas Huth's avatar Thomas Huth
Browse files

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: default avatarStefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Message-Id: <20190813093047.27948-3-thuth@redhat.com>
Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
parent 1999a70a
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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;