Merge tag 'mac80211-for-davem-2015-01-15' of git://git.kernel.org/pub/scm/linux/kerne...
[linux-2.6-block.git] / tools / virtio / virtio_test.c
index db3437c641a64c467d3d7f01d84ffdb8670ef4ea..e0445898f08fa981d372d4de6bad4eebe265cb15 100644 (file)
@@ -11,6 +11,7 @@
 #include <sys/types.h>
 #include <fcntl.h>
 #include <stdbool.h>
+#include <linux/virtio_types.h>
 #include <linux/vhost.h>
 #include <linux/virtio.h>
 #include <linux/virtio_ring.h>
@@ -226,6 +227,14 @@ const struct option longopts[] = {
                .name = "no-indirect",
                .val = 'i',
        },
+       {
+               .name = "virtio-1",
+               .val = '1',
+       },
+       {
+               .name = "no-virtio-1",
+               .val = '0',
+       },
        {
                .name = "delayed-interrupt",
                .val = 'D',
@@ -243,6 +252,7 @@ static void help(void)
        fprintf(stderr, "Usage: virtio_test [--help]"
                " [--no-indirect]"
                " [--no-event-idx]"
+               " [--no-virtio-1]"
                " [--delayed-interrupt]"
                "\n");
 }
@@ -251,7 +261,7 @@ int main(int argc, char **argv)
 {
        struct vdev_info dev;
        unsigned long long features = (1ULL << VIRTIO_RING_F_INDIRECT_DESC) |
-               (1ULL << VIRTIO_RING_F_EVENT_IDX);
+               (1ULL << VIRTIO_RING_F_EVENT_IDX) | (1ULL << VIRTIO_F_VERSION_1);
        int o;
        bool delayed = false;
 
@@ -272,6 +282,9 @@ int main(int argc, char **argv)
                case 'i':
                        features &= ~(1ULL << VIRTIO_RING_F_INDIRECT_DESC);
                        break;
+               case '0':
+                       features &= ~(1ULL << VIRTIO_F_VERSION_1);
+                       break;
                case 'D':
                        delayed = true;
                        break;