On Mon, Oct 21, 2019 at 02:48:08PM +0200, Thomas Huth wrote: > On 19/10/2019 08.38, Stefan Hajnoczi wrote: > > 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 <stefa...@redhat.com> > > --- > > tests/libqos/virtio.h | 4 +- > > tests/libqos/virtio-mmio.c | 1 + > > tests/libqos/virtio-pci.c | 1 + > > tests/libqos/virtio.c | 131 +++++++++++++++++++++++++++---------- > > tests/virtio-blk-test.c | 8 +-- > > 5 files changed, 106 insertions(+), 39 deletions(-) > [...] > > @@ -191,23 +248,23 @@ void qvring_init(QTestState *qts, const > > QGuestAllocator *alloc, QVirtQueue *vq, > > > > for (i = 0; i < vq->size - 1; i++) { > > /* vq->desc[i].addr */ > > - qtest_writeq(qts, vq->desc + (16 * i), 0); > > + qvirtio_writeq(vq->vdev, qts, vq->desc + (16 * i), 0); > > /* vq->desc[i].next */ > > - qtest_writew(qts, vq->desc + (16 * i) + 14, i + 1); > > + qvirtio_writew(vq->vdev, qts, vq->desc + (16 * i) + 14, i + 1); > > } > > > > /* vq->avail->flags */ > > - qtest_writew(qts, vq->avail, 0); > > + qvirtio_writew(vq->vdev, qts, vq->avail, 0); > > /* vq->avail->idx */ > > - qtest_writew(qts, vq->avail + 2, 0); > > + qvirtio_writew(vq->vdev, qts, vq->avail + 2, 0); > > /* vq->avail->used_event */ > > - qtest_writew(qts, vq->avail + 4 + (2 * vq->size), 0); > > + qvirtio_writew(vq->vdev, qts, vq->avail + 4 + (2 * vq->size), 0); > > > > /* vq->used->flags */ > > - qtest_writew(qts, vq->used, 0); > > + qvirtio_writew(vq->vdev, qts, vq->used, 0); > > /* vq->used->avail_event */ > > - qtest_writew(qts, vq->used + 2 + sizeof(struct vring_used_elem) * > > vq->size, > > - 0); > > + qvirtio_writew(vq->vdev, qts, vq->used + 2 + > > + sizeof(struct vring_used_elem) * vq->size, 0); > > Fix indentation in the above line?
Will fix in v4.
signature.asc
Description: PGP signature