diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2018-10-07 09:37:44 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-03-07 17:28:26 +0100 |
commit | d5006a45f572ee4c0768d810d91920b2b2a7421b (patch) | |
tree | 513ae2ceb9999ce00f5e4241d1647ba93e1adb3d /tests/libqos/virtio-pci.c | |
parent | 1ce66ecec0f26ea6a3b450c66bde6fe171471f1c (diff) |
tests/libqos: remove global_qtest from virtio endianness checks
This is needed to support migration tests with qgraph.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/libqos/virtio-pci.c')
-rw-r--r-- | tests/libqos/virtio-pci.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/libqos/virtio-pci.c b/tests/libqos/virtio-pci.c index 6bcdbbb64d..0b58b74267 100644 --- a/tests/libqos/virtio-pci.c +++ b/tests/libqos/virtio-pci.c @@ -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) |