]> git.proxmox.com Git - mirror_qemu.git/commitdiff
libqos: fix qvring_init()
authorLaurent Vivier <lvivier@redhat.com>
Mon, 26 Sep 2016 15:24:10 +0000 (17:24 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 28 Sep 2016 10:21:46 +0000 (11:21 +0100)
"vq->desc[i].addr" is a 64bit value,
so write it with writeq(), not writew().

struct vring_desc {
    __virtio64 addr;
    __virtio32 len;
    __virtio16 flags;
    __virtio16 next;
};

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-id: 1474903450-9605-1-git-send-email-lvivier@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
tests/libqos/virtio.c

index 37ff860c1683eb7df7a400f9631cfe7f9948a4dc..105bccecaaa3ad27dbe6437a8b9f091161f4c5e5 100644 (file)
@@ -147,7 +147,7 @@ void qvring_init(const QGuestAllocator *alloc, QVirtQueue *vq, uint64_t addr)
 
     for (i = 0; i < vq->size - 1; i++) {
         /* vq->desc[i].addr */
-        writew(vq->desc + (16 * i), 0);
+        writeq(vq->desc + (16 * i), 0);
         /* vq->desc[i].next */
         writew(vq->desc + (16 * i) + 14, i + 1);
     }