Message ID | 20190322092806.21838-2-jasowang@redhat.com |
---|---|
State | New |
Headers | show |
Series | Don't start virtqueues that are not enabled for vhost | expand |
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()?)
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 <jasowang@redhat.com> --- include/hw/virtio/virtio-bus.h | 4 ++++ 1 file changed, 4 insertions(+)