From bcf0836d0fb32ef5442fd3f47fd1b115c362be43 Mon Sep 17 00:00:00 2001 From: "Dr. David Alan Gilbert" Date: Mon, 2 Oct 2017 20:15:18 +0100 Subject: libvhost-user: vu_queue_started MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a vu_queue_started method to complement vu_queue_enabled. Signed-off-by: Dr. David Alan Gilbert Message-Id: <20171002191521.15748-2-dgilbert@redhat.com> Reviewed-by: Marc-André Lureau Reviewed-by: Maxime Coquelin --- contrib/libvhost-user/libvhost-user.c | 6 ++++++ contrib/libvhost-user/libvhost-user.h | 9 +++++++++ 2 files changed, 15 insertions(+) (limited to 'contrib/libvhost-user') diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c index a0e0da4ccb..62be958f59 100644 --- a/contrib/libvhost-user/libvhost-user.c +++ b/contrib/libvhost-user/libvhost-user.c @@ -966,6 +966,12 @@ vu_queue_enabled(VuDev *dev, VuVirtq *vq) return vq->enable; } +bool +vu_queue_started(const VuDev *dev, const VuVirtq *vq) +{ + return vq->started; +} + static inline uint16_t vring_avail_flags(VuVirtq *vq) { diff --git a/contrib/libvhost-user/libvhost-user.h b/contrib/libvhost-user/libvhost-user.h index 5825b66880..ff8059257e 100644 --- a/contrib/libvhost-user/libvhost-user.h +++ b/contrib/libvhost-user/libvhost-user.h @@ -334,6 +334,15 @@ void vu_queue_set_notification(VuDev *dev, VuVirtq *vq, int enable); */ bool vu_queue_enabled(VuDev *dev, VuVirtq *vq); +/** + * vu_queue_started: + * @dev: a VuDev context + * @vq: a VuVirtq queue + * + * Returns: whether the queue is started. + */ +bool vu_queue_started(const VuDev *dev, const VuVirtq *vq); + /** * vu_queue_empty: * @dev: a VuDev context -- cgit v1.2.3