This field comes either LE with virtio 1.0, either guest endian with legacy. It must only be accessed with an accessor that knows about the appropriate endianness.
Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm.com> --- hw/virtio/dataplane/vring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/dataplane/vring.c b/hw/virtio/dataplane/vring.c index 3fa421b9d773..a93ee2d338d7 100644 --- a/hw/virtio/dataplane/vring.c +++ b/hw/virtio/dataplane/vring.c @@ -117,7 +117,7 @@ void vring_disable_notification(VirtIODevice *vdev, Vring *vring) bool vring_enable_notification(VirtIODevice *vdev, Vring *vring) { if (virtio_has_feature(vdev, VIRTIO_RING_F_EVENT_IDX)) { - vring_avail_event(&vring->vr) = vring->vr.avail->idx; + vring_avail_event(&vring->vr) = vring_get_avail_idx(vdev, vring); } else { vring_clear_used_flags(vdev, vring, VRING_USED_F_NO_NOTIFY); }