vhost: introduce vhost_vq_avail_empty()
authorJason Wang <jasowang@redhat.com>
Fri, 4 Mar 2016 11:24:52 +0000 (06:24 -0500)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 11 Mar 2016 00:18:50 +0000 (02:18 +0200)
commitd4a60603fa0b42012decfa058dfa44cffde7a10c
treee67544642fc442b1c3823a4cef4a744cc8e81bf1
parent526d3e7ff515582eaf7cf5d9da2a11bf681204e6
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>
drivers/vhost/vhost.c
drivers/vhost/vhost.h