55 lines
2.3 KiB
Diff
55 lines
2.3 KiB
Diff
From 9e4727140479522c62070069d552b378c73864f3 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
|
|
Date: Wed, 20 Jul 2022 08:59:37 +0200
|
|
Subject: [PATCH] vhost: Expose vhost_svq_add
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
This allows external parts of SVQ to forward custom buffers to the
|
|
device.
|
|
|
|
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
|
|
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Signed-off-by: Jason Wang <jasowang@redhat.com>
|
|
Signed-off-by: fangyi <eric.fangyi@huawei.com>
|
|
---
|
|
hw/virtio/vhost-shadow-virtqueue.c | 6 +++---
|
|
hw/virtio/vhost-shadow-virtqueue.h | 3 +++
|
|
2 files changed, 6 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-virtqueue.c
|
|
index 3b5d3bd3f3..5a85365478 100644
|
|
--- a/hw/virtio/vhost-shadow-virtqueue.c
|
|
+++ b/hw/virtio/vhost-shadow-virtqueue.c
|
|
@@ -237,9 +237,9 @@ static void vhost_svq_kick(VhostShadowVirtqueue *svq)
|
|
*
|
|
* Return -EINVAL if element is invalid, -ENOSPC if dev queue is full
|
|
*/
|
|
-static int vhost_svq_add(VhostShadowVirtqueue *svq, const struct iovec *out_sg,
|
|
- size_t out_num, const struct iovec *in_sg,
|
|
- size_t in_num, VirtQueueElement *elem)
|
|
+int vhost_svq_add(VhostShadowVirtqueue *svq, const struct iovec *out_sg,
|
|
+ size_t out_num, const struct iovec *in_sg, size_t in_num,
|
|
+ VirtQueueElement *elem)
|
|
{
|
|
unsigned qemu_head;
|
|
unsigned ndescs = in_num + out_num;
|
|
diff --git a/hw/virtio/vhost-shadow-virtqueue.h b/hw/virtio/vhost-shadow-virtqueue.h
|
|
index d9fc1f1799..dd78f4bec2 100644
|
|
--- a/hw/virtio/vhost-shadow-virtqueue.h
|
|
+++ b/hw/virtio/vhost-shadow-virtqueue.h
|
|
@@ -86,6 +86,9 @@ bool vhost_svq_valid_features(uint64_t features, Error **errp);
|
|
|
|
void vhost_svq_push_elem(VhostShadowVirtqueue *svq,
|
|
const VirtQueueElement *elem, uint32_t len);
|
|
+int vhost_svq_add(VhostShadowVirtqueue *svq, const struct iovec *out_sg,
|
|
+ size_t out_num, const struct iovec *in_sg, size_t in_num,
|
|
+ VirtQueueElement *elem);
|
|
|
|
void vhost_svq_set_svq_kick_fd(VhostShadowVirtqueue *svq, int svq_kick_fd);
|
|
void vhost_svq_set_svq_call_fd(VhostShadowVirtqueue *svq, int call_fd);
|
|
--
|
|
2.27.0
|
|
|