qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	Pawel Moll <pawel.moll@arm.com>,
	patches@linaro.org
Subject: [Qemu-devel] [RFC 1/4] virtio: Add support for guest setting of queue size
Date: Mon, 14 Nov 2011 14:55:25 +0000	[thread overview]
Message-ID: <1321282528-19070-2-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1321282528-19070-1-git-send-email-peter.maydell@linaro.org>

The MMIO virtio transport spec allows the guest to tell the host how
large the queue size is. Add virtio_queue_set_num() function which
implements this in the QEMU common virtio support code.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/virtio.c |    6 ++++++
 hw/virtio.h |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/virtio.c b/hw/virtio.c
index 7011b5b..5bd43a1 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -619,6 +619,12 @@ target_phys_addr_t virtio_queue_get_addr(VirtIODevice *vdev, int n)
     return vdev->vq[n].pa;
 }
 
+void virtio_queue_set_num(VirtIODevice *vdev, int n, int num)
+{
+    vdev->vq[n].vring.num = num;
+    virtqueue_init(&vdev->vq[n]);
+}
+
 int virtio_queue_get_num(VirtIODevice *vdev, int n)
 {
     return vdev->vq[n].vring.num;
diff --git a/hw/virtio.h b/hw/virtio.h
index 2d18209..352aba6 100644
--- a/hw/virtio.h
+++ b/hw/virtio.h
@@ -178,6 +178,7 @@ void virtio_config_writew(VirtIODevice *vdev, uint32_t addr, uint32_t data);
 void virtio_config_writel(VirtIODevice *vdev, uint32_t addr, uint32_t data);
 void virtio_queue_set_addr(VirtIODevice *vdev, int n, target_phys_addr_t addr);
 target_phys_addr_t virtio_queue_get_addr(VirtIODevice *vdev, int n);
+void virtio_queue_set_num(VirtIODevice *vdev, int n, int num);
 int virtio_queue_get_num(VirtIODevice *vdev, int n);
 void virtio_queue_notify(VirtIODevice *vdev, int n);
 uint16_t virtio_queue_vector(VirtIODevice *vdev, int n);
-- 
1.7.1

  reply	other threads:[~2011-11-14 14:55 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-14 14:55 [Qemu-devel] [RFC 0/4] virtio-mmio transport Peter Maydell
2011-11-14 14:55 ` Peter Maydell [this message]
2011-11-14 14:55 ` [Qemu-devel] [RFC 2/4] virtio: Support transports which can specify the vring alignment Peter Maydell
2011-11-14 14:55 ` [Qemu-devel] [RFC 3/4] Add MMIO based virtio transport Peter Maydell
2011-11-14 14:55 ` [Qemu-devel] [RFC 4/4] hw/vexpress.c: Add MMIO " Peter Maydell
2011-11-14 15:41 ` [Qemu-devel] [RFC 0/4] virtio-mmio transport Stefan Hajnoczi
2011-11-16 14:33 ` Paolo Bonzini
2011-11-16 18:41   ` Peter Maydell
2011-11-16 19:56     ` Anthony Liguori
2011-11-17 11:20       ` Pawel Moll
2011-11-17 11:44         ` Paolo Bonzini
2011-12-09 15:16       ` Paul Brook
2011-12-09 15:57         ` Anthony Liguori
2011-12-12  2:52           ` Paul Brook
2011-12-12 11:16             ` Pawel Moll
2011-12-12 14:45               ` Paul Brook
2011-12-12 14:51                 ` Pawel Moll
2011-12-16  5:36                 ` Rusty Russell
2011-12-12 12:14 ` Stefan Hajnoczi
2011-12-12 12:28   ` Pawel Moll
2011-12-12 13:12     ` Michael S. Tsirkin
2011-12-12 13:19       ` Pawel Moll
2011-12-12 15:11     ` Stefan Hajnoczi
2011-12-12 15:18       ` Peter Maydell
2011-12-12 15:21       ` Pawel Moll

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=1321282528-19070-2-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=aliguori@us.ibm.com \
    --cc=patches@linaro.org \
    --cc=pawel.moll@arm.com \
    --cc=qemu-devel@nongnu.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).