summary refs log tree commit diff stats
path: root/tests/libqos/virtio-mmio.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2019-10-23 11:04:18 +0100
committerMichael S. Tsirkin <mst@redhat.com>2019-10-25 07:46:22 -0400
commitbccd82b4073b7242876480d7f4d93bd281feb548 (patch)
tree998a46986ab0ddcab96e82455a8cb5f9c1c2172b /tests/libqos/virtio-mmio.c
parentc0f79698ed562814158d9652a29e77c97cc074f6 (diff)
downloadfocaccia-qemu-bccd82b4073b7242876480d7f4d93bd281feb548.tar.gz
focaccia-qemu-bccd82b4073b7242876480d7f4d93bd281feb548.zip
libqos: access VIRTIO 1.0 vring in little-endian
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>
Diffstat (limited to 'tests/libqos/virtio-mmio.c')
-rw-r--r--tests/libqos/virtio-mmio.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/libqos/virtio-mmio.c b/tests/libqos/virtio-mmio.c
index 78066e6e05..4db1f1b8bc 100644
--- a/tests/libqos/virtio-mmio.c
+++ b/tests/libqos/virtio-mmio.c
@@ -157,6 +157,7 @@ static QVirtQueue *qvirtio_mmio_virtqueue_setup(QVirtioDevice *d,
     uint64_t addr;
 
     vq = g_malloc0(sizeof(*vq));
+    vq->vdev = d;
     qvirtio_mmio_queue_select(d, index);
     qtest_writel(dev->qts, dev->addr + QVIRTIO_MMIO_QUEUE_ALIGN, dev->page_size);