Sometime we need to check whether a queue is enabled, e.g for vhost,
we don't want to start the backend for the virtqueues that is not
enabled. So introduce a new method to do this.

Signed-off-by: Jason Wang <jasow...@redhat.com>
---
 include/hw/virtio/virtio-bus.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/hw/virtio/virtio-bus.h b/include/hw/virtio/virtio-bus.h
index 7fec9dc929..db20fecf13 100644
--- a/include/hw/virtio/virtio-bus.h
+++ b/include/hw/virtio/virtio-bus.h
@@ -84,6 +84,10 @@ typedef struct VirtioBusClass {
      */
     int (*ioeventfd_assign)(DeviceState *d, EventNotifier *notifier,
                             int n, bool assign);
+    /*
+     * is the queue enabled?
+     */
+    bool (*queue_enabled)(DeviceState *d, int n);
     /*
      * Does the transport have variable vring alignment?
      * (ie can it ever call virtio_queue_set_align()?)
-- 
2.19.1


Reply via email to