[Qemu-devel] [PATCH 1/4] libvhost-user: vu_queue_started

Dr. David Alan Gilbert (git) posted 4 patches 8 years, 4 months ago
[Qemu-devel] [PATCH 1/4] libvhost-user: vu_queue_started
Posted by Dr. David Alan Gilbert (git) 8 years, 4 months ago
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

Add a vu_queue_started method to complement vu_queue_enabled.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 contrib/libvhost-user/libvhost-user.c | 6 ++++++
 contrib/libvhost-user/libvhost-user.h | 9 +++++++++
 2 files changed, 15 insertions(+)

diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c
index d27d6303db..5ee8483a32 100644
--- a/contrib/libvhost-user/libvhost-user.c
+++ b/contrib/libvhost-user/libvhost-user.c
@@ -943,6 +943,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 4021f1124e..94d7cc8fbd 100644
--- a/contrib/libvhost-user/libvhost-user.h
+++ b/contrib/libvhost-user/libvhost-user.h
@@ -335,6 +335,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
  * @vq: a VuVirtq queue
-- 
2.13.6


Re: [Qemu-devel] [PATCH 1/4] libvhost-user: vu_queue_started
Posted by Marc-André Lureau 8 years, 4 months ago
On Mon, Oct 2, 2017 at 9:15 PM, Dr. David Alan Gilbert (git)
<dgilbert@redhat.com> wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> Add a vu_queue_started method to complement vu_queue_enabled.
>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  contrib/libvhost-user/libvhost-user.c | 6 ++++++
>  contrib/libvhost-user/libvhost-user.h | 9 +++++++++
>  2 files changed, 15 insertions(+)
>
> diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c
> index d27d6303db..5ee8483a32 100644
> --- a/contrib/libvhost-user/libvhost-user.c
> +++ b/contrib/libvhost-user/libvhost-user.c
> @@ -943,6 +943,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 4021f1124e..94d7cc8fbd 100644
> --- a/contrib/libvhost-user/libvhost-user.h
> +++ b/contrib/libvhost-user/libvhost-user.h
> @@ -335,6 +335,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
>   * @vq: a VuVirtq queue
> --
> 2.13.6
>
>



-- 
Marc-André Lureau