[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V4 RESEND 17/22] virtio: introduce virtio_del_queue(
From: |
Jason Wang |
Subject: |
[Qemu-devel] [PATCH V4 RESEND 17/22] virtio: introduce virtio_del_queue() |
Date: |
Fri, 1 Feb 2013 15:39:51 +0800 |
Some device (such as virtio-net) needs the ability to destroy or re-order the
virtqueues, this patch adds a helper to do this.
Signed-off-by: Jason Wang <jasowang>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/virtio.c | 9 +++++++++
hw/virtio.h | 2 ++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/hw/virtio.c b/hw/virtio.c
index ca170c3..d8c77b0 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -701,6 +701,15 @@ VirtQueue *virtio_add_queue(VirtIODevice *vdev, int
queue_size,
return &vdev->vq[i];
}
+void virtio_del_queue(VirtIODevice *vdev, int n)
+{
+ if (n < 0 || n >= VIRTIO_PCI_QUEUE_MAX) {
+ abort();
+ }
+
+ vdev->vq[n].vring.num = 0;
+}
+
void virtio_irq(VirtQueue *vq)
{
trace_virtio_irq(vq);
diff --git a/hw/virtio.h b/hw/virtio.h
index 9cc7b85..d3da1d2 100644
--- a/hw/virtio.h
+++ b/hw/virtio.h
@@ -181,6 +181,8 @@ VirtQueue *virtio_add_queue(VirtIODevice *vdev, int
queue_size,
void (*handle_output)(VirtIODevice *,
VirtQueue *));
+void virtio_del_queue(VirtIODevice *vdev, int n);
+
void virtqueue_push(VirtQueue *vq, const VirtQueueElement *elem,
unsigned int len);
void virtqueue_flush(VirtQueue *vq, unsigned int count);
--
1.7.1
- [Qemu-devel] [PATCH V4 RESEND 07/22] net: introduce qemu_net_client_setup(), (continued)
- [Qemu-devel] [PATCH V4 RESEND 07/22] net: introduce qemu_net_client_setup(), Jason Wang, 2013/02/01
- [Qemu-devel] [PATCH V4 RESEND 08/22] net: introduce NetClientState destructor, Jason Wang, 2013/02/01
- [Qemu-devel] [PATCH V4 RESEND 13/22] tap: support enabling or disabling a queue, Jason Wang, 2013/02/01
- [Qemu-devel] [PATCH V4 RESEND 14/22] tap: introduce a helper to get the name of an interface, Jason Wang, 2013/02/01
- [Qemu-devel] [PATCH V4 RESEND 18/22] virtio: add a queue_index to VirtQueue, Jason Wang, 2013/02/01
- [Qemu-devel] [PATCH V4 RESEND 19/22] virtio-net: separate virtqueue from VirtIONet, Jason Wang, 2013/02/01
- [Qemu-devel] [PATCH V4 RESEND 15/22] tap: multiqueue support, Jason Wang, 2013/02/01
- [Qemu-devel] [PATCH V4 RESEND 17/22] virtio: introduce virtio_del_queue(),
Jason Wang <=
- [Qemu-devel] [PATCH V4 RESEND 21/22] virtio-net: migration support for multiqueue, Jason Wang, 2013/02/01
- [Qemu-devel] [PATCH V4 RESEND 12/22] tap: add Linux multiqueue support, Jason Wang, 2013/02/01
- [Qemu-devel] [PATCH V4 RESEND 22/22] virtio-net: compat multiqueue support, Jason Wang, 2013/02/01
- [Qemu-devel] [PATCH V4 RESEND 09/22] net: multiqueue support, Jason Wang, 2013/02/01
- Re: [Qemu-devel] [PATCH V4 RESEND 00/22] Multiqueue virtio-net, Jason Wang, 2013/02/01
- [Qemu-devel] [PATCH V4 RESEND 20/22] virtio-net: multiqueue support, Jason Wang, 2013/02/01
- [Qemu-devel] [PATCH V4 RESEND 10/22] tap: import linux multiqueue constants, Jason Wang, 2013/02/01