aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2013-03-17 22:52:18 -0400
committerRusty Russell <rusty@rustcorp.com.au>2013-03-19 23:30:41 -0400
commit73640c991e2f2804939af70567b23e4c54b7c266 (patch)
tree40800f0b2ddd54ef17160879bada9d1e16a4ce01
parent29266e2e29f1f87b93321e56812f9fb16f91cb6d (diff)
tools/virtio: fix build for 3.8
Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r--drivers/vhost/test.c4
-rw-r--r--tools/virtio/Makefile2
-rw-r--r--tools/virtio/linux/virtio.h7
-rw-r--r--tools/virtio/virtio_test.c3
4 files changed, 12 insertions, 4 deletions
diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c
index 91d6f060aade..329d3021d059 100644
--- a/drivers/vhost/test.c
+++ b/drivers/vhost/test.c
@@ -275,7 +275,9 @@ static long vhost_test_ioctl(struct file *f, unsigned int ioctl,
275 return vhost_test_reset_owner(n); 275 return vhost_test_reset_owner(n);
276 default: 276 default:
277 mutex_lock(&n->dev.mutex); 277 mutex_lock(&n->dev.mutex);
278 r = vhost_dev_ioctl(&n->dev, ioctl, arg); 278 r = vhost_dev_ioctl(&n->dev, ioctl, argp);
279 if (r == -ENOIOCTLCMD)
280 r = vhost_vring_ioctl(&n->dev, ioctl, argp);
279 vhost_test_flush(n); 281 vhost_test_flush(n);
280 mutex_unlock(&n->dev.mutex); 282 mutex_unlock(&n->dev.mutex);
281 return r; 283 return r;
diff --git a/tools/virtio/Makefile b/tools/virtio/Makefile
index d1d442ed106a..b48c4329e644 100644
--- a/tools/virtio/Makefile
+++ b/tools/virtio/Makefile
@@ -1,7 +1,7 @@
1all: test mod 1all: test mod
2test: virtio_test 2test: virtio_test
3virtio_test: virtio_ring.o virtio_test.o 3virtio_test: virtio_ring.o virtio_test.o
4CFLAGS += -g -O2 -Wall -I. -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -MMD 4CFLAGS += -g -O2 -Wall -I. -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD
5vpath %.c ../../drivers/virtio 5vpath %.c ../../drivers/virtio
6mod: 6mod:
7 ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test 7 ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test
diff --git a/tools/virtio/linux/virtio.h b/tools/virtio/linux/virtio.h
index 81847dd08bd0..390c4cb3b018 100644
--- a/tools/virtio/linux/virtio.h
+++ b/tools/virtio/linux/virtio.h
@@ -85,6 +85,8 @@ typedef __u16 u16;
85typedef enum { 85typedef enum {
86 GFP_KERNEL, 86 GFP_KERNEL,
87 GFP_ATOMIC, 87 GFP_ATOMIC,
88 __GFP_HIGHMEM,
89 __GFP_HIGH
88} gfp_t; 90} gfp_t;
89typedef enum { 91typedef enum {
90 IRQ_NONE, 92 IRQ_NONE,
@@ -163,6 +165,8 @@ struct virtqueue {
163 void (*callback)(struct virtqueue *vq); 165 void (*callback)(struct virtqueue *vq);
164 const char *name; 166 const char *name;
165 struct virtio_device *vdev; 167 struct virtio_device *vdev;
168 unsigned int index;
169 unsigned int num_free;
166 void *priv; 170 void *priv;
167}; 171};
168 172
@@ -206,7 +210,8 @@ bool virtqueue_enable_cb(struct virtqueue *vq);
206bool virtqueue_enable_cb_delayed(struct virtqueue *vq); 210bool virtqueue_enable_cb_delayed(struct virtqueue *vq);
207 211
208void *virtqueue_detach_unused_buf(struct virtqueue *vq); 212void *virtqueue_detach_unused_buf(struct virtqueue *vq);
209struct virtqueue *vring_new_virtqueue(unsigned int num, 213struct virtqueue *vring_new_virtqueue(unsigned int index,
214 unsigned int num,
210 unsigned int vring_align, 215 unsigned int vring_align,
211 struct virtio_device *vdev, 216 struct virtio_device *vdev,
212 bool weak_barriers, 217 bool weak_barriers,
diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c
index fcc9aa25fd08..faf3f0c9d71f 100644
--- a/tools/virtio/virtio_test.c
+++ b/tools/virtio/virtio_test.c
@@ -92,7 +92,8 @@ static void vq_info_add(struct vdev_info *dev, int num)
92 assert(r >= 0); 92 assert(r >= 0);
93 memset(info->ring, 0, vring_size(num, 4096)); 93 memset(info->ring, 0, vring_size(num, 4096));
94 vring_init(&info->vring, num, info->ring, 4096); 94 vring_init(&info->vring, num, info->ring, 4096);
95 info->vq = vring_new_virtqueue(info->vring.num, 4096, &dev->vdev, 95 info->vq = vring_new_virtqueue(info->idx,
96 info->vring.num, 4096, &dev->vdev,
96 true, info->ring, 97 true, info->ring,
97 vq_notify, vq_callback, "test"); 98 vq_notify, vq_callback, "test");
98 assert(info->vq); 99 assert(info->vq);