[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 16/27] virtio: Expose virtqueue_alloc_element
From: |
Eugenio Pérez |
Subject: |
[RFC PATCH 16/27] virtio: Expose virtqueue_alloc_element |
Date: |
Fri, 20 Nov 2020 19:50:54 +0100 |
Specify VirtQueueElement * as return type makes no harm at this moment.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
include/hw/virtio/virtio.h | 2 ++
hw/virtio/virtio.c | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index 79212141a6..ee8fe96f32 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -196,6 +196,8 @@ void virtqueue_fill(VirtQueue *vq, const VirtQueueElement
*elem,
unsigned int len, unsigned int idx);
void virtqueue_map(VirtIODevice *vdev, VirtQueueElement *elem);
+VirtQueueElement *virtqueue_alloc_element(size_t sz, unsigned out_num,
+ unsigned in_num);
void *virtqueue_pop(VirtQueue *vq, size_t sz);
unsigned int virtqueue_drop_all(VirtQueue *vq);
void *qemu_get_virtqueue_element(VirtIODevice *vdev, QEMUFile *f, size_t sz);
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index ad9dc5dfa7..a89525f067 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -1400,7 +1400,8 @@ void virtqueue_map(VirtIODevice *vdev, VirtQueueElement
*elem)
false);
}
-static void *virtqueue_alloc_element(size_t sz, unsigned out_num, unsigned
in_num)
+VirtQueueElement *virtqueue_alloc_element(size_t sz, unsigned out_num,
+ unsigned in_num)
{
VirtQueueElement *elem;
size_t in_addr_ofs = QEMU_ALIGN_UP(sz, __alignof__(elem->in_addr[0]));
--
2.18.4
- [RFC PATCH 06/27] virtio: Add virtio_queue_get_used_notify_split, (continued)
- [RFC PATCH 06/27] virtio: Add virtio_queue_get_used_notify_split, Eugenio Pérez, 2020/11/20
- [RFC PATCH 07/27] vhost: Route guest->host notification through qemu, Eugenio Pérez, 2020/11/20
- [RFC PATCH 08/27] vhost: Add a flag for software assisted Live Migration, Eugenio Pérez, 2020/11/20
- [RFC PATCH 09/27] vhost: Route host->guest notification through qemu, Eugenio Pérez, 2020/11/20
- [RFC PATCH 10/27] vhost: Allocate shadow vring, Eugenio Pérez, 2020/11/20
- [RFC PATCH 11/27] virtio: const-ify all virtio_tswap* functions, Eugenio Pérez, 2020/11/20
- [RFC PATCH 12/27] virtio: Add virtio_queue_full, Eugenio Pérez, 2020/11/20
- [RFC PATCH 13/27] vhost: Send buffers to device, Eugenio Pérez, 2020/11/20
- [RFC PATCH 14/27] virtio: Remove virtio_queue_get_used_notify_split, Eugenio Pérez, 2020/11/20
- [RFC PATCH 15/27] vhost: Do not invalidate signalled used, Eugenio Pérez, 2020/11/20
- [RFC PATCH 16/27] virtio: Expose virtqueue_alloc_element,
Eugenio Pérez <=
- [RFC PATCH 17/27] vhost: add vhost_vring_set_notification_rcu, Eugenio Pérez, 2020/11/20
- [RFC PATCH 18/27] vhost: add vhost_vring_poll_rcu, Eugenio Pérez, 2020/11/20
- [RFC PATCH 19/27] vhost: add vhost_vring_get_buf_rcu, Eugenio Pérez, 2020/11/20
- [RFC PATCH 20/27] vhost: Return used buffers, Eugenio Pérez, 2020/11/20
- [RFC PATCH 21/27] vhost: Add vhost_virtqueue_memory_unmap, Eugenio Pérez, 2020/11/20
- [RFC PATCH 22/27] vhost: Add vhost_virtqueue_memory_map, Eugenio Pérez, 2020/11/20
- [RFC PATCH 23/27] vhost: unmap qemu's shadow virtqueues on sw live migration, Eugenio Pérez, 2020/11/20
- [RFC PATCH 24/27] vhost: iommu changes, Eugenio Pérez, 2020/11/20