diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2012-12-24 17:37:01 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2013-01-07 19:42:23 +0200 |
commit | f56a12475ff1b8aa61210d08522c3c8aaf0e2648 (patch) | |
tree | 04ebf83a43ca66048af15b44779578f39f360a8a /hw/vhost.h | |
parent | 24f4fe345c1b80bab1ee18573914123d8028a9e6 (diff) |
vhost: backend masking support
Support backend guest notifier masking in vhost-net:
create eventfd at device init, when masked,
make vhost use that as eventfd instead of
sending an interrupt.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/vhost.h')
-rw-r--r-- | hw/vhost.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/hw/vhost.h b/hw/vhost.h index 6f6a906f4f..44c61a5877 100644 --- a/hw/vhost.h +++ b/hw/vhost.h @@ -18,6 +18,7 @@ struct vhost_virtqueue { void *ring; unsigned long long ring_phys; unsigned ring_size; + EventNotifier masked_notifier; }; typedef unsigned long vhost_log_chunk_t; @@ -53,4 +54,13 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev); int vhost_dev_enable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev); void vhost_dev_disable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev); +/* Test and clear masked event pending status. + * Should be called after unmask to avoid losing events. + */ +bool vhost_virtqueue_pending(struct vhost_dev *hdev, int n); + +/* Mask/unmask events from this vq. + */ +void vhost_virtqueue_mask(struct vhost_dev *hdev, VirtIODevice *vdev, int n, + bool mask); #endif |