Skip to content

Commit 844c822

Browse files
vivierstefanhaRH
authored andcommitted
libqos: fix qvring_init()
"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 <[email protected]> Message-id: [email protected] Signed-off-by: Stefan Hajnoczi <[email protected]>
1 parent eb7b5c3 commit 844c822

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/libqos/virtio.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void qvring_init(const QGuestAllocator *alloc, QVirtQueue *vq, uint64_t addr)
147147

148148
for (i = 0; i < vq->size - 1; i++) {
149149
/* vq->desc[i].addr */
150-
writew(vq->desc + (16 * i), 0);
150+
writeq(vq->desc + (16 * i), 0);
151151
/* vq->desc[i].next */
152152
writew(vq->desc + (16 * i) + 14, i + 1);
153153
}

0 commit comments

Comments
 (0)