diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2016-09-07 17:20:48 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-09-09 20:58:34 +0300 |
commit | 297a75e6c55d91db2704a3d6e4029d99c7df51fd (patch) | |
tree | 43f752f0502cecc089680c1a08dc6b5cb6c3da9c /include | |
parent | 104e70cae78bd4afd95d948c6aff188f10508a9c (diff) |
virtio: add virtqueue_rewind()
virtqueue_discard() requires a VirtQueueElement but virtio-balloon does
not migrate its in-use element. Introduce a new function that is
similar to virtqueue_discard() but doesn't require a VirtQueueElement.
This will allow virtio-balloon to access element again after migration
with the usual proviso that the guest may have modified the vring since
last time.
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Roman Kagan <rkagan@virtuozzo.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Ladi Prosek <lprosek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/virtio/virtio.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index d2490c1975..f05559d569 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -154,6 +154,7 @@ void virtqueue_push(VirtQueue *vq, const VirtQueueElement *elem, void virtqueue_flush(VirtQueue *vq, unsigned int count); void virtqueue_discard(VirtQueue *vq, const VirtQueueElement *elem, unsigned int len); +bool virtqueue_rewind(VirtQueue *vq, unsigned int num); void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem, unsigned int len, unsigned int idx); |