Commit 73640c99 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin Committed by Rusty Russell

tools/virtio: fix build for 3.8

Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 29266e2e
...@@ -275,7 +275,9 @@ static long vhost_test_ioctl(struct file *f, unsigned int ioctl, ...@@ -275,7 +275,9 @@ static long vhost_test_ioctl(struct file *f, unsigned int ioctl,
return vhost_test_reset_owner(n); return vhost_test_reset_owner(n);
default: default:
mutex_lock(&n->dev.mutex); mutex_lock(&n->dev.mutex);
r = vhost_dev_ioctl(&n->dev, ioctl, arg); r = vhost_dev_ioctl(&n->dev, ioctl, argp);
if (r == -ENOIOCTLCMD)
r = vhost_vring_ioctl(&n->dev, ioctl, argp);
vhost_test_flush(n); vhost_test_flush(n);
mutex_unlock(&n->dev.mutex); mutex_unlock(&n->dev.mutex);
return r; return r;
......
all: test mod all: test mod
test: virtio_test test: virtio_test
virtio_test: virtio_ring.o virtio_test.o virtio_test: virtio_ring.o virtio_test.o
CFLAGS += -g -O2 -Wall -I. -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -MMD CFLAGS += -g -O2 -Wall -I. -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD
vpath %.c ../../drivers/virtio vpath %.c ../../drivers/virtio
mod: mod:
${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test
......
...@@ -85,6 +85,8 @@ typedef __u16 u16; ...@@ -85,6 +85,8 @@ typedef __u16 u16;
typedef enum { typedef enum {
GFP_KERNEL, GFP_KERNEL,
GFP_ATOMIC, GFP_ATOMIC,
__GFP_HIGHMEM,
__GFP_HIGH
} gfp_t; } gfp_t;
typedef enum { typedef enum {
IRQ_NONE, IRQ_NONE,
...@@ -163,6 +165,8 @@ struct virtqueue { ...@@ -163,6 +165,8 @@ struct virtqueue {
void (*callback)(struct virtqueue *vq); void (*callback)(struct virtqueue *vq);
const char *name; const char *name;
struct virtio_device *vdev; struct virtio_device *vdev;
unsigned int index;
unsigned int num_free;
void *priv; void *priv;
}; };
...@@ -206,7 +210,8 @@ bool virtqueue_enable_cb(struct virtqueue *vq); ...@@ -206,7 +210,8 @@ bool virtqueue_enable_cb(struct virtqueue *vq);
bool virtqueue_enable_cb_delayed(struct virtqueue *vq); bool virtqueue_enable_cb_delayed(struct virtqueue *vq);
void *virtqueue_detach_unused_buf(struct virtqueue *vq); void *virtqueue_detach_unused_buf(struct virtqueue *vq);
struct virtqueue *vring_new_virtqueue(unsigned int num, struct virtqueue *vring_new_virtqueue(unsigned int index,
unsigned int num,
unsigned int vring_align, unsigned int vring_align,
struct virtio_device *vdev, struct virtio_device *vdev,
bool weak_barriers, bool weak_barriers,
......
...@@ -92,7 +92,8 @@ static void vq_info_add(struct vdev_info *dev, int num) ...@@ -92,7 +92,8 @@ static void vq_info_add(struct vdev_info *dev, int num)
assert(r >= 0); assert(r >= 0);
memset(info->ring, 0, vring_size(num, 4096)); memset(info->ring, 0, vring_size(num, 4096));
vring_init(&info->vring, num, info->ring, 4096); vring_init(&info->vring, num, info->ring, 4096);
info->vq = vring_new_virtqueue(info->vring.num, 4096, &dev->vdev, info->vq = vring_new_virtqueue(info->idx,
info->vring.num, 4096, &dev->vdev,
true, info->ring, true, info->ring,
vq_notify, vq_callback, "test"); vq_notify, vq_callback, "test");
assert(info->vq); assert(info->vq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment