diff options
author | Eric Auger <eric.auger@redhat.com> | 2019-07-02 19:18:16 +0200 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2019-07-02 13:16:29 -0600 |
commit | 5053bd781143c354dfe3c8747d6c013dc22851b6 (patch) | |
tree | d52f43d184221b64017519560d1e1deb8efa558a /hw/vfio | |
parent | d53f7a61c345f3412af2a43fe21fd4dbaa877368 (diff) |
vfio/pci: Trace vfio_set_irq_signaling() failure in vfio_msix_vector_release()
Report an error in case we fail to set a trigger action
on any VFIO_PCI_MSIX_IRQ_INDEX subindex. This might be
useful in debugging a device that is not working properly.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reported-by: Coverity (CID 1402196)
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'hw/vfio')
-rw-r--r-- | hw/vfio/pci.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index ce3fe96efe..d7a4e1875c 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -551,9 +551,12 @@ static void vfio_msix_vector_release(PCIDevice *pdev, unsigned int nr) */ if (vector->virq >= 0) { int32_t fd = event_notifier_get_fd(&vector->interrupt); + Error *err = NULL; - vfio_set_irq_signaling(&vdev->vbasedev, VFIO_PCI_MSIX_IRQ_INDEX, nr, - VFIO_IRQ_SET_ACTION_TRIGGER, fd, NULL); + if (vfio_set_irq_signaling(&vdev->vbasedev, VFIO_PCI_MSIX_IRQ_INDEX, nr, + VFIO_IRQ_SET_ACTION_TRIGGER, fd, &err)) { + error_reportf_err(err, VFIO_MSG_PREFIX, vdev->vbasedev.name); + } } } |