virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: virtualization@lists.linux-foundation.org
Cc: mst@redhat.com, linux-kernel@vger.kernel.org,
	sjur.brandeland@stericsson.com
Subject: [PATCH 3/5] tools/virtio: fix compile.
Date: Tue, 19 Feb 2013 08:59:30 +1030	[thread overview]
Message-ID: <1361226573-12481-4-git-send-email-rusty@rustcorp.com.au> (raw)
In-Reply-To: <1361226573-12481-1-git-send-email-rusty@rustcorp.com.au>

Didn't test that it actually works, mind you!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 tools/virtio/linux/virtio.h |    9 ++++++++-
 tools/virtio/virtio_test.c  |    6 +++---
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/tools/virtio/linux/virtio.h b/tools/virtio/linux/virtio.h
index 81847dd..ccfc901 100644
--- a/tools/virtio/linux/virtio.h
+++ b/tools/virtio/linux/virtio.h
@@ -86,6 +86,10 @@ typedef enum {
 	GFP_KERNEL,
 	GFP_ATOMIC,
 } gfp_t;
+
+#define __GFP_HIGHMEM 0
+#define __GFP_HIGH 0
+
 typedef enum {
 	IRQ_NONE,
 	IRQ_HANDLED
@@ -163,6 +167,8 @@ struct virtqueue {
 	void (*callback)(struct virtqueue *vq);
 	const char *name;
 	struct virtio_device *vdev;
+	unsigned int index;
+	unsigned int num_free;
 	void *priv;
 };
 
@@ -206,7 +212,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,
diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c
index fcc9aa2..a07142c 100644
--- a/tools/virtio/virtio_test.c
+++ b/tools/virtio/virtio_test.c
@@ -81,7 +81,7 @@ void vhost_vq_setup(struct vdev_info *dev, struct vq_info *info)
 	assert(r >= 0);
 }
 
-static void vq_info_add(struct vdev_info *dev, int num)
+static void vq_info_add(struct vdev_info *dev, int idx, int num)
 {
 	struct vq_info *info = &dev->vqs[dev->nvqs];
 	int r;
@@ -92,7 +92,7 @@ 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(idx, info->vring.num, 4096, &dev->vdev,
 				       true, info->ring,
 				       vq_notify, vq_callback, "test");
 	assert(info->vq);
@@ -277,7 +277,7 @@ int main(int argc, char **argv)
 
 done:
 	vdev_info_init(&dev, features);
-	vq_info_add(&dev, 256);
+	vq_info_add(&dev, 0, 256);
 	run_test(&dev, &dev.vqs[0], delayed, 0x100000);
 	return 0;
 }
-- 
1.7.10.4

  parent reply	other threads:[~2013-02-18 22:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-18 22:29 [PATCH 0/5] vringh Rusty Russell
2013-02-18 22:29 ` [PATCH 1/5] virtio_ring: expose virtio barriers for use in vringh Rusty Russell
2013-02-18 22:29 ` [PATCH 2/5] vringh: host-side implementation of virtio rings Rusty Russell
2013-02-18 22:29 ` Rusty Russell [this message]
2013-02-18 22:29 ` [PATCH 4/5] tools/virtio: separate headers more Rusty Russell
2013-02-18 22:29 ` [PATCH 5/5] tools/virtio: add vring_test Rusty Russell
2013-02-19  8:11 ` [PATCH 0/5] vringh Michael S. Tsirkin
2013-02-19 20:43   ` Rusty Russell
2013-02-24 22:30 ` Michael S. Tsirkin
2013-02-27 10:02 ` [PATCH] tools/virtio: add sg_unmark_end to scatterlist.h Wanlong Gao
2013-02-28  2:57   ` Rusty Russell
2013-02-28  3:39     ` Wanlong Gao
2013-02-28  3:55       ` Rusty Russell
2013-02-28  6:56         ` Wanlong Gao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1361226573-12481-4-git-send-email-rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=sjur.brandeland@stericsson.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).