[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v4 03/20] virtio: Add virtio_queue_is_host_notifier_enabled
From: |
Eugenio Pérez |
Subject: |
[RFC PATCH v4 03/20] virtio: Add virtio_queue_is_host_notifier_enabled |
Date: |
Fri, 1 Oct 2021 09:05:46 +0200 |
This allows shadow virtqueue code to assert the queue status before
making changes.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
include/hw/virtio/virtio.h | 1 +
hw/virtio/virtio.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index 5fe575b8f0..2fe03f64c6 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -318,6 +318,7 @@ void virtio_device_release_ioeventfd(VirtIODevice *vdev);
bool virtio_device_ioeventfd_enabled(VirtIODevice *vdev);
EventNotifier *virtio_queue_get_host_notifier(VirtQueue *vq);
void virtio_queue_set_host_notifier_enabled(VirtQueue *vq, bool enabled);
+bool virtio_queue_is_host_notifier_enabled(const VirtQueue *vq);
void virtio_queue_host_notifier_read(EventNotifier *n);
void virtio_queue_aio_set_host_notifier_handler(VirtQueue *vq, AioContext *ctx,
VirtIOHandleAIOOutput
handle_output);
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index ab516ac614..f04de57409 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -3591,6 +3591,11 @@ EventNotifier *virtio_queue_get_host_notifier(VirtQueue
*vq)
return &vq->host_notifier;
}
+bool virtio_queue_is_host_notifier_enabled(const VirtQueue *vq)
+{
+ return vq->host_notifier_enabled;
+}
+
void virtio_queue_set_host_notifier_enabled(VirtQueue *vq, bool enabled)
{
vq->host_notifier_enabled = enabled;
--
2.27.0
- [RFC PATCH v4 00/20] vDPA shadow virtqueue, Eugenio Pérez, 2021/10/01
- [RFC PATCH v4 02/20] virtio-net: Honor VIRTIO_CONFIG_S_DEVICE_STOPPED, Eugenio Pérez, 2021/10/01
- [RFC PATCH v4 03/20] virtio: Add virtio_queue_is_host_notifier_enabled,
Eugenio Pérez <=
- [RFC PATCH v4 04/20] vhost: Make vhost_virtqueue_{start,stop} public, Eugenio Pérez, 2021/10/01
- [RFC PATCH v4 01/20] virtio: Add VIRTIO_F_QUEUE_STATE, Eugenio Pérez, 2021/10/01
- [RFC PATCH v4 05/20] vhost: Add x-vhost-enable-shadow-vq qmp, Eugenio Pérez, 2021/10/01
[RFC PATCH v4 06/20] vhost: Add VhostShadowVirtqueue, Eugenio Pérez, 2021/10/01
[RFC PATCH v4 07/20] vdpa: Register vdpa devices in a list, Eugenio Pérez, 2021/10/01
[RFC PATCH v4 08/20] vhost: Route guest->host notification through shadow virtqueue, Eugenio Pérez, 2021/10/01