Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 370928
b: refs/heads/master
c: 73640c9
h: refs/heads/master
v: v3
  • Loading branch information
Michael S. Tsirkin authored and Rusty Russell committed Mar 20, 2013
1 parent 2ebb8e3 commit 73cc631
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 29266e2e29f1f87b93321e56812f9fb16f91cb6d
refs/heads/master: 73640c991e2f2804939af70567b23e4c54b7c266
4 changes: 3 additions & 1 deletion trunk/drivers/vhost/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,9 @@ static long vhost_test_ioctl(struct file *f, unsigned int ioctl,
return vhost_test_reset_owner(n);
default:
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);
mutex_unlock(&n->dev.mutex);
return r;
Expand Down
2 changes: 1 addition & 1 deletion trunk/tools/virtio/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
all: test mod
test: virtio_test
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
mod:
${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test
Expand Down
7 changes: 6 additions & 1 deletion trunk/tools/virtio/linux/virtio.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ typedef __u16 u16;
typedef enum {
GFP_KERNEL,
GFP_ATOMIC,
__GFP_HIGHMEM,
__GFP_HIGH
} gfp_t;
typedef enum {
IRQ_NONE,
Expand Down Expand Up @@ -163,6 +165,8 @@ struct virtqueue {
void (*callback)(struct virtqueue *vq);
const char *name;
struct virtio_device *vdev;
unsigned int index;
unsigned int num_free;
void *priv;
};

Expand Down Expand Up @@ -206,7 +210,8 @@ bool virtqueue_enable_cb(struct virtqueue *vq);
bool virtqueue_enable_cb_delayed(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,
struct virtio_device *vdev,
bool weak_barriers,
Expand Down
3 changes: 2 additions & 1 deletion trunk/tools/virtio/virtio_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ static void vq_info_add(struct vdev_info *dev, int num)
assert(r >= 0);
memset(info->ring, 0, vring_size(num, 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,
vq_notify, vq_callback, "test");
assert(info->vq);
Expand Down

0 comments on commit 73cc631

Please sign in to comment.