[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC 06/10] vhost: Save masked_notifier state
From: |
Eugenio Pérez |
Subject: |
[RFC 06/10] vhost: Save masked_notifier state |
Date: |
Fri, 29 Jan 2021 21:54:11 +0100 |
It will be used to recover call eventfd.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
include/hw/virtio/vhost.h | 1 +
hw/virtio/vhost.c | 2 ++
2 files changed, 3 insertions(+)
diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h
index fca076e3f0..2be782cefd 100644
--- a/include/hw/virtio/vhost.h
+++ b/include/hw/virtio/vhost.h
@@ -28,6 +28,7 @@ struct vhost_virtqueue {
unsigned avail_size;
unsigned long long used_phys;
unsigned used_size;
+ bool notifier_is_masked;
EventNotifier masked_notifier;
struct vhost_dev *dev;
};
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 8683d507f5..040f68ff2e 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1526,6 +1526,8 @@ void vhost_virtqueue_mask(struct vhost_dev *hdev,
VirtIODevice *vdev, int n,
/* should only be called after backend is connected */
assert(hdev->vhost_ops);
+ hdev->vqs[index].notifier_is_masked = mask;
+
if (mask) {
assert(vdev->use_guest_notifier_mask);
file.fd = event_notifier_get_fd(&hdev->vqs[index].masked_notifier);
--
2.27.0
- [RFC 00/10] vDPA shadow virtqueue - notifications forwarding, Eugenio Pérez, 2021/01/29
- [RFC 01/10] virtio: Add virtqueue_set_handler, Eugenio Pérez, 2021/01/29
- [RFC 02/10] virtio: Add set_vq_handler, Eugenio Pérez, 2021/01/29
- [RFC 03/10] virtio: Add virtio_queue_get_idx, Eugenio Pérez, 2021/01/29
- [RFC 04/10] virtio: Add virtio_queue_host_notifier_status, Eugenio Pérez, 2021/01/29
- [RFC 05/10] vhost: Add vhost_dev_from_virtio, Eugenio Pérez, 2021/01/29
- [RFC 07/10] vhost: Add VhostShadowVirtqueue, Eugenio Pérez, 2021/01/29
- [RFC 06/10] vhost: Save masked_notifier state,
Eugenio Pérez <=
- [RFC 08/10] vhost: Add x-vhost-enable-shadow-vq qmp, Eugenio Pérez, 2021/01/29
- [RFC 10/10] vhost: Route host->guest notification through shadow virtqueue, Eugenio Pérez, 2021/01/29
- [RFC 09/10] vhost: Route guest->host notification through shadow virtqueue, Eugenio Pérez, 2021/01/29