tools/virtio: add virtio 1.0 in virtio_test

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Michael S. Tsirkin 2014-12-14 22:49:16 +02:00
parent 1620ecb8b8
commit 43b09122ce
1 changed files with 13 additions and 1 deletions

View File

@ -227,6 +227,14 @@ const struct option longopts[] = {
.name = "no-indirect", .name = "no-indirect",
.val = 'i', .val = 'i',
}, },
{
.name = "virtio-1",
.val = '1',
},
{
.name = "no-virtio-1",
.val = '0',
},
{ {
.name = "delayed-interrupt", .name = "delayed-interrupt",
.val = 'D', .val = 'D',
@ -244,6 +252,7 @@ static void help(void)
fprintf(stderr, "Usage: virtio_test [--help]" fprintf(stderr, "Usage: virtio_test [--help]"
" [--no-indirect]" " [--no-indirect]"
" [--no-event-idx]" " [--no-event-idx]"
" [--no-virtio-1]"
" [--delayed-interrupt]" " [--delayed-interrupt]"
"\n"); "\n");
} }
@ -252,7 +261,7 @@ int main(int argc, char **argv)
{ {
struct vdev_info dev; struct vdev_info dev;
unsigned long long features = (1ULL << VIRTIO_RING_F_INDIRECT_DESC) | 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; int o;
bool delayed = false; bool delayed = false;
@ -273,6 +282,9 @@ int main(int argc, char **argv)
case 'i': case 'i':
features &= ~(1ULL << VIRTIO_RING_F_INDIRECT_DESC); features &= ~(1ULL << VIRTIO_RING_F_INDIRECT_DESC);
break; break;
case '0':
features &= ~(1ULL << VIRTIO_F_VERSION_1);
break;
case 'D': case 'D':
delayed = true; delayed = true;
break; break;