aboutsummaryrefslogtreecommitdiff
path: root/contrib/libvhost-user/libvhost-user.h
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-03-08 15:04:52 +0100
committerMichael S. Tsirkin <mst@redhat.com>2019-03-12 22:31:21 -0400
commitb13919ab64e712158a031bf4ea48e92b20ed8ef5 (patch)
tree81b2892f8acabd4aee6cf981ebc74c26bcad4b2e /contrib/libvhost-user/libvhost-user.h
parent922ef483ec812730f87102b372691c510313fcea (diff)
libvhost-user: add vu_queue_unpop()
vhost-user-input will make use of this function to undo some queue pop in case the virtio queue does not have enough room. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190308140454.32437-11-marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'contrib/libvhost-user/libvhost-user.h')
-rw-r--r--contrib/libvhost-user/libvhost-user.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/contrib/libvhost-user/libvhost-user.h b/contrib/libvhost-user/libvhost-user.h
index c0133b7f3f..3de8414898 100644
--- a/contrib/libvhost-user/libvhost-user.h
+++ b/contrib/libvhost-user/libvhost-user.h
@@ -458,6 +458,20 @@ void vu_queue_notify(VuDev *dev, VuVirtq *vq);
*/
void *vu_queue_pop(VuDev *dev, VuVirtq *vq, size_t sz);
+
+/**
+ * vu_queue_unpop:
+ * @dev: a VuDev context
+ * @vq: a VuVirtq queue
+ * @elem: The #VuVirtqElement
+ * @len: number of bytes written
+ *
+ * Pretend the most recent element wasn't popped from the virtqueue. The next
+ * call to vu_queue_pop() will refetch the element.
+ */
+void vu_queue_unpop(VuDev *dev, VuVirtq *vq, VuVirtqElement *elem,
+ size_t len);
+
/**
* vu_queue_rewind:
* @dev: a VuDev context