Revision 3e40ba0f hw/misc/vfio.c

b/hw/misc/vfio.c
905 905

  
906 906
static void vfio_disable_msix(VFIODevice *vdev)
907 907
{
908
    int i;
909

  
908 910
    msix_unset_vector_notifiers(&vdev->pdev);
909 911

  
912
    /*
913
     * MSI-X will only release vectors if MSI-X is still enabled on the
914
     * device, check through the rest and release it ourselves if necessary.
915
     */
916
    for (i = 0; i < vdev->nr_vectors; i++) {
917
        if (vdev->msi_vectors[i].use) {
918
            vfio_msix_vector_release(&vdev->pdev, i);
919
        }
920
    }
921

  
910 922
    if (vdev->nr_vectors) {
911 923
        vfio_disable_irqindex(vdev, VFIO_PCI_MSIX_IRQ_INDEX);
912 924
    }

Also available in: Unified diff