aboutsummaryrefslogtreecommitdiffstats
path: root/tools/virtio
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2011-05-19 19:11:05 -0400
committerRusty Russell <rusty@rustcorp.com.au>2011-05-29 21:44:15 -0400
commit4423fe40b03f32b11e72ecfa03077e702e55d5a9 (patch)
tree88c59c0b04cd8c960944504e2ff081be48996316 /tools/virtio
parent8ea8cf89e19aeb596b818ee5f2bec8a8b0586b60 (diff)
virtio_test: support event index
Add ability to test the new event idx feature, enable by default. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'tools/virtio')
-rw-r--r--tools/virtio/virtio_test.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c
index df0c6d2c3860..74d3331bdaf9 100644
--- a/tools/virtio/virtio_test.c
+++ b/tools/virtio/virtio_test.c
@@ -198,6 +198,14 @@ const struct option longopts[] = {
198 .val = 'h', 198 .val = 'h',
199 }, 199 },
200 { 200 {
201 .name = "event-idx",
202 .val = 'E',
203 },
204 {
205 .name = "no-event-idx",
206 .val = 'e',
207 },
208 {
201 .name = "indirect", 209 .name = "indirect",
202 .val = 'I', 210 .val = 'I',
203 }, 211 },
@@ -211,13 +219,17 @@ const struct option longopts[] = {
211 219
212static void help() 220static void help()
213{ 221{
214 fprintf(stderr, "Usage: virtio_test [--help] [--no-indirect]\n"); 222 fprintf(stderr, "Usage: virtio_test [--help]"
223 " [--no-indirect]"
224 " [--no-event-idx]"
225 "\n");
215} 226}
216 227
217int main(int argc, char **argv) 228int main(int argc, char **argv)
218{ 229{
219 struct vdev_info dev; 230 struct vdev_info dev;
220 unsigned long long features = 1ULL << VIRTIO_RING_F_INDIRECT_DESC; 231 unsigned long long features = (1ULL << VIRTIO_RING_F_INDIRECT_DESC) |
232 (1ULL << VIRTIO_RING_F_EVENT_IDX);
221 int o; 233 int o;
222 234
223 for (;;) { 235 for (;;) {
@@ -228,6 +240,9 @@ int main(int argc, char **argv)
228 case '?': 240 case '?':
229 help(); 241 help();
230 exit(2); 242 exit(2);
243 case 'e':
244 features &= ~(1ULL << VIRTIO_RING_F_EVENT_IDX);
245 break;
231 case 'h': 246 case 'h':
232 help(); 247 help();
233 goto done; 248 goto done;