diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2016-05-09 13:47:36 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2016-06-20 11:44:12 +0100 |
commit | 1373a4c2568282a8f998a778f09d9d628afcd7fd (patch) | |
tree | ff33e9d2399492b538e2646d2e024f2b4c41b50c /tests/virtio-blk-test.c | |
parent | 7ad1e708e68426b4deaeb975636396ac4d6266b1 (diff) |
libqos: drop duplicated virtio_config.h definitions
Note that VIRTIO_F_ANY_LAYOUT and VIRTIO_F_NOTIFY_ON_EMPTY are bit
numbers in virtio_config.h but bit masks in qtest virtio.h. Therefore
it's necessary to change users from X to (1u << X).
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1462798061-30382-4-git-send-email-stefanha@redhat.com
Diffstat (limited to 'tests/virtio-blk-test.c')
-rw-r--r-- | tests/virtio-blk-test.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/virtio-blk-test.c b/tests/virtio-blk-test.c index a0d2d83644..84eb056305 100644 --- a/tests/virtio-blk-test.c +++ b/tests/virtio-blk-test.c @@ -19,6 +19,7 @@ #include "libqos/malloc-generic.h" #include "qemu/bswap.h" #include "standard-headers/linux/virtio_ids.h" +#include "standard-headers/linux/virtio_config.h" #define QVIRTIO_BLK_F_BARRIER 0x00000001 #define QVIRTIO_BLK_F_SIZE_MAX 0x00000002 @@ -239,7 +240,7 @@ static void test_basic(const QVirtioBus *bus, QVirtioDevice *dev, guest_free(alloc, req_addr); - if (features & QVIRTIO_F_ANY_LAYOUT) { + if (features & (1u << VIRTIO_F_ANY_LAYOUT)) { /* Write and read with 2 descriptor layout */ /* Write request */ req.type = QVIRTIO_BLK_T_OUT; @@ -606,7 +607,8 @@ static void pci_idx(void) features = qvirtio_get_features(&qvirtio_pci, &dev->vdev); features = features & ~(QVIRTIO_F_BAD_FEATURE | QVIRTIO_F_RING_INDIRECT_DESC | - QVIRTIO_F_NOTIFY_ON_EMPTY | QVIRTIO_BLK_F_SCSI); + (1u << VIRTIO_F_NOTIFY_ON_EMPTY) | + QVIRTIO_BLK_F_SCSI); qvirtio_set_features(&qvirtio_pci, &dev->vdev, features); vqpci = (QVirtQueuePCI *)qvirtqueue_setup(&qvirtio_pci, &dev->vdev, |