[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v2 01/12] virtio: Add support for guest setting of que
From: |
Evgeny Voevodin |
Subject: |
[Qemu-devel] [RFC v2 01/12] virtio: Add support for guest setting of queue size |
Date: |
Mon, 17 Sep 2012 14:00:31 +0400 |
From: Peter Maydell <address@hidden>
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 <address@hidden>
Signed-off-by: Evgeny Voevodin <address@hidden>
---
hw/virtio.c | 6 ++++++
hw/virtio.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/hw/virtio.c b/hw/virtio.c
index 209c763..5334326 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -628,6 +628,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 7a4f564..eb9953f 100644
--- a/hw/virtio.h
+++ b/hw/virtio.h
@@ -177,6 +177,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.9.5
- [Qemu-devel] [RFC v2 00/12] Virtio-mmio refactoring., Evgeny Voevodin, 2012/09/17
- [Qemu-devel] [RFC v2 08/12] hw/virtio-balloon.c: Add virtio-balloon device., Evgeny Voevodin, 2012/09/17
- [Qemu-devel] [RFC v2 05/12] hw/pci.c: Make pci_add_option_rom global visible, Evgeny Voevodin, 2012/09/17
- [Qemu-devel] [RFC v2 02/12] virtio: Support transports which can specify the vring alignment, Evgeny Voevodin, 2012/09/17
- [Qemu-devel] [RFC v2 03/12] Virtio: Add transport bindings., Evgeny Voevodin, 2012/09/17
- [Qemu-devel] [RFC v2 01/12] virtio: Add support for guest setting of queue size,
Evgeny Voevodin <=
- [Qemu-devel] [RFC v2 07/12] hw/virtio-serial-bus.c: Add virtio-serial device., Evgeny Voevodin, 2012/09/17
- [Qemu-devel] [RFC v2 06/12] Add MMIO based virtio transport, Evgeny Voevodin, 2012/09/17
- [Qemu-devel] [RFC v2 04/12] hw/qdev-properties.c: Add "transport" property., Evgeny Voevodin, 2012/09/17
- [Qemu-devel] [RFC v2 12/12] hw/exynos4210.c: Create two virtio-mmio transport instances., Evgeny Voevodin, 2012/09/17
- [Qemu-devel] [RFC v2 09/12] hw/virtio-net.c: Add virtio-net device., Evgeny Voevodin, 2012/09/17
- [Qemu-devel] [RFC v2 10/12] hw/virtio-blk.c: Add virtio-blk device., Evgeny Voevodin, 2012/09/17
- [Qemu-devel] [RFC v2 11/12] hw/virtio-pci-new.c: Add VirtIOPCI device., Evgeny Voevodin, 2012/09/17
- Re: [Qemu-devel] [RFC v2 00/12] Virtio-mmio refactoring., KONRAD Frédéric, 2012/09/27