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>
This commit is contained in:
Marc-André Lureau 2019-03-08 15:04:52 +01:00 committed by Michael S. Tsirkin
parent 922ef483ec
commit b13919ab64
2 changed files with 30 additions and 0 deletions

View file

@ -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