tools/virtio: add virtio 1.0 in virtio_test
authorMichael S. Tsirkin <mst@redhat.com>
Sun, 14 Dec 2014 20:49:16 +0000 (22:49 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 15 Dec 2014 21:49:22 +0000 (23:49 +0200)
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
tools/virtio/virtio_test.c

index 67873c3..e044589 100644 (file)
@@ -228,6 +228,14 @@ const struct option longopts[] = {
                .val = 'i',
        },
        {
+               .name = "virtio-1",
+               .val = '1',
+       },
+       {
+               .name = "no-virtio-1",
+               .val = '0',
+       },
+       {
                .name = "delayed-interrupt",
                .val = 'D',
        },
@@ -244,6 +252,7 @@ static void help(void)
        fprintf(stderr, "Usage: virtio_test [--help]"
                " [--no-indirect]"
                " [--no-event-idx]"
+               " [--no-virtio-1]"
                " [--delayed-interrupt]"
                "\n");
 }
@@ -252,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;
 
@@ -273,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;