aboutsummaryrefslogtreecommitdiff
path: root/tests/virtio-net-test.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2016-05-09 13:47:37 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2016-06-20 11:44:12 +0100
commitee3b850a70613a9e0cedef8c79f76e9ee45cbef3 (patch)
tree89886d0aab0f638ae133ea35f6478d836348ad9a /tests/virtio-net-test.c
parent1373a4c2568282a8f998a778f09d9d628afcd7fd (diff)
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/virtio-net-test.c')
-rw-r--r--tests/virtio-net-test.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/virtio-net-test.c b/tests/virtio-net-test.c
index e49c13ea5f..17124509a3 100644
--- a/tests/virtio-net-test.c
+++ b/tests/virtio-net-test.c
@@ -21,6 +21,7 @@
#include "qemu/bswap.h"
#include "hw/virtio/virtio-net.h"
#include "standard-headers/linux/virtio_ids.h"
+#include "standard-headers/linux/virtio_ring.h"
#define PCI_SLOT_HP 0x06
#define PCI_SLOT 0x04
@@ -70,8 +71,8 @@ static void driver_init(const QVirtioBus *bus, QVirtioDevice *dev)
features = qvirtio_get_features(bus, dev);
features = features & ~(QVIRTIO_F_BAD_FEATURE |
- QVIRTIO_F_RING_INDIRECT_DESC |
- QVIRTIO_F_RING_EVENT_IDX);
+ (1u << VIRTIO_RING_F_INDIRECT_DESC) |
+ (1u << VIRTIO_RING_F_EVENT_IDX));
qvirtio_set_features(bus, dev, features);
qvirtio_set_driver_ok(bus, dev);