qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] libqos: fix qvring_init()
@ 2016-09-26 15:24 Laurent Vivier
  2016-09-27 10:37 ` Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent Vivier @ 2016-09-26 15:24 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel, Laurent Vivier

"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(-)

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);
     }
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] libqos: fix qvring_init()
  2016-09-26 15:24 [Qemu-devel] [PATCH] libqos: fix qvring_init() Laurent Vivier
@ 2016-09-27 10:37 ` Stefan Hajnoczi
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2016-09-27 10:37 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: Stefan Hajnoczi, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 521 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-27 10:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-26 15:24 [Qemu-devel] [PATCH] libqos: fix qvring_init() Laurent Vivier
2016-09-27 10:37 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).