summaryrefslogtreecommitdiffstats
path: root/drivers/vhost/vhost.h
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2016-03-04 06:24:52 -0500
committerMichael S. Tsirkin <mst@redhat.com>2016-03-11 02:18:50 +0200
commitd4a60603fa0b42012decfa058dfa44cffde7a10c (patch)
treee67544642fc442b1c3823a4cef4a744cc8e81bf1 /drivers/vhost/vhost.h
parent526d3e7ff515582eaf7cf5d9da2a11bf681204e6 (diff)
downloadlinux-d4a60603fa0b42012decfa058dfa44cffde7a10c.tar.bz2
vhost: introduce vhost_vq_avail_empty()
This patch introduces a helper which will return true if we're sure that the available ring is empty for a specific vq. When we're not sure, e.g vq access failure, return false instead. This could be used for busy polling code to exit the busy loop. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vhost/vhost.h')
-rw-r--r--drivers/vhost/vhost.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
index eef33b11a7ed..af5af773bf7a 100644
--- a/drivers/vhost/vhost.h
+++ b/drivers/vhost/vhost.h
@@ -159,6 +159,7 @@ void vhost_add_used_and_signal_n(struct vhost_dev *, struct vhost_virtqueue *,
struct vring_used_elem *heads, unsigned count);
void vhost_signal(struct vhost_dev *, struct vhost_virtqueue *);
void vhost_disable_notify(struct vhost_dev *, struct vhost_virtqueue *);
+bool vhost_vq_avail_empty(struct vhost_dev *, struct vhost_virtqueue *);
bool vhost_enable_notify(struct vhost_dev *, struct vhost_virtqueue *);
int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log,