aboutsummaryrefslogtreecommitdiff
path: root/include/hw/vfio/vfio-common.h
diff options
context:
space:
mode:
authorEric Auger <eric.auger@redhat.com>2019-06-13 09:57:37 -0600
committerAlex Williamson <alex.williamson@redhat.com>2019-06-13 09:57:37 -0600
commit201a733145751aa691e7e3b9c0f263f0c92db0c5 (patch)
tree647396feec60c11680bb64ae3eaff658469815ac /include/hw/vfio/vfio-common.h
parentc60807dea5930a402b77172da17e79b26f1af48b (diff)
vfio/common: Introduce vfio_set_irq_signaling helper
The code used to assign an interrupt index/subindex to an eventfd is duplicated many times. Let's introduce an helper that allows to set/unset the signaling for an ACTION_TRIGGER, ACTION_MASK or ACTION_UNMASK action. In the error message, we now use errno in case of any VFIO_DEVICE_SET_IRQS ioctl failure. Signed-off-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Li Qiang <liq3ea@gmail.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'include/hw/vfio/vfio-common.h')
-rw-r--r--include/hw/vfio/vfio-common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index e05bc09794..a88b69b675 100644
--- a/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -166,6 +166,8 @@ void vfio_put_base_device(VFIODevice *vbasedev);
void vfio_disable_irqindex(VFIODevice *vbasedev, int index);
void vfio_unmask_single_irqindex(VFIODevice *vbasedev, int index);
void vfio_mask_single_irqindex(VFIODevice *vbasedev, int index);
+int vfio_set_irq_signaling(VFIODevice *vbasedev, int index, int subindex,
+ int action, int fd, Error **errp);
void vfio_region_write(void *opaque, hwaddr addr,
uint64_t data, unsigned size);
uint64_t vfio_region_read(void *opaque,