summaryrefslogtreecommitdiffstats
path: root/tests/libqos/virtio-mmio.c
diff options
context:
space:
mode:
authorStefan Hajnoczi2016-05-09 14:47:37 +0200
committerStefan Hajnoczi2016-06-20 12:44:12 +0200
commitee3b850a70613a9e0cedef8c79f76e9ee45cbef3 (patch)
tree89886d0aab0f638ae133ea35f6478d836348ad9a /tests/libqos/virtio-mmio.c
parentlibqos: drop duplicated virtio_config.h definitions (diff)
downloadqemu-ee3b850a70613a9e0cedef8c79f76e9ee45cbef3.tar.gz
qemu-ee3b850a70613a9e0cedef8c79f76e9ee45cbef3.tar.xz
qemu-ee3b850a70613a9e0cedef8c79f76e9ee45cbef3.zip
libqos: drop duplicated virtio_ring.h bit definitions
Note that virtio_ring.h defines feature bits using their bit number: #define VIRTIO_RING_F_INDIRECT_DESC 28 On the other hand libqos virtio.h uses the bit mask: #define QVIRTIO_F_RING_INDIRECT_DESC 0x10000000 The patch makes the necessary adjustments. I have used "1u << BITMASK" instead of "1ULL << BITMASK" because the 64-bit feature fields are not implemented in libqos virtio. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1462798061-30382-5-git-send-email-stefanha@redhat.com
Diffstat (limited to 'tests/libqos/virtio-mmio.c')
-rw-r--r--tests/libqos/virtio-mmio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/libqos/virtio-mmio.c b/tests/libqos/virtio-mmio.c
index e15b480ab8..ccb92d9eef 100644
--- a/tests/libqos/virtio-mmio.c
+++ b/tests/libqos/virtio-mmio.c
@@ -13,6 +13,7 @@
#include "libqos/virtio-mmio.h"
#include "libqos/malloc.h"
#include "libqos/malloc-generic.h"
+#include "standard-headers/linux/virtio_ring.h"
static uint8_t qvirtio_mmio_config_readb(QVirtioDevice *d, uint64_t addr)
{
@@ -135,8 +136,8 @@ static QVirtQueue *qvirtio_mmio_virtqueue_setup(QVirtioDevice *d,
vq->free_head = 0;
vq->num_free = vq->size;
vq->align = dev->page_size;
- vq->indirect = (dev->features & QVIRTIO_F_RING_INDIRECT_DESC) != 0;
- vq->event = (dev->features & QVIRTIO_F_RING_EVENT_IDX) != 0;
+ vq->indirect = (dev->features & (1u << VIRTIO_RING_F_INDIRECT_DESC)) != 0;
+ vq->event = (dev->features & (1u << VIRTIO_RING_F_EVENT_IDX)) != 0;
writel(dev->addr + QVIRTIO_MMIO_QUEUE_NUM, vq->size);