OSDN Git Service

vfio/common: Introduce vfio_set_irq_signaling helper
authorEric Auger <eric.auger@redhat.com>
Thu, 13 Jun 2019 15:57:37 +0000 (09:57 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 13 Jun 2019 15:57:37 +0000 (09:57 -0600)
commit201a733145751aa691e7e3b9c0f263f0c92db0c5
tree647396feec60c11680bb64ae3eaff658469815ac
parentc60807dea5930a402b77172da17e79b26f1af48b
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>
hw/vfio/common.c
hw/vfio/pci.c
hw/vfio/platform.c
include/hw/vfio/vfio-common.h