diff mbox

libqos: fix qvring_init()

Message ID 1474903450-9605-1-git-send-email-lvivier@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Vivier Sept. 26, 2016, 3:24 p.m. UTC
"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>
---
 tests/libqos/virtio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefan Hajnoczi Sept. 27, 2016, 10:37 a.m. UTC | #1
On Mon, Sep 26, 2016 at 05:24:10PM +0200, Laurent Vivier wrote:
> "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>
> ---
>  tests/libqos/virtio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan
diff mbox

Patch

diff --git a/tests/libqos/virtio.c b/tests/libqos/virtio.c
index 37ff860..105bcce 100644
--- a/tests/libqos/virtio.c
+++ b/tests/libqos/virtio.c
@@ -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);
     }