usbfuzz-afl/qemu_mode/qemu/contrib/libvhost-user/libvhost-user.c
/* Fetch avail_idx from VQ memory only when we really need to know if
 * guest has added some buffers. */
Fetch avail_idx from VQ memory only when we really need to know if
guest has added some buffers.
Fetch avail_idx from VQ memory only when we really need to know if guest has added some buffers .
bool
vu_queue_empty(VuDev *dev, VuVirtq *vq)
{
    if (unlikely(dev->broken) ||
        unlikely(!vq->vring.avail)) {
        return true;
    }
    if (vq->shadow_avail_idx != vq->last_avail_idx) {
        return false;
    }
    return vring_avail_idx(vq) == vq->last_avail_idx;
}
bool vu_queue_empty ( VuDev * dev , VuVirtq * vq ) { if ( unlikely ( dev -> broken ) || unlikely ( ! vq -> vring . avail ) ) { return true ; } if ( vq -> shadow_avail_idx != vq -> last_avail_idx ) { return false ; } return vring_avail_idx ( vq ) == vq -> last_avail_idx ; }
Fetch avail_idx from VQ memory only when we really need to know if
 guest has added some buffers.
Fetch avail_idx from VQ memory only when we really need to know if guest has added some buffers .