mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
vfio/pci: pass vector to virq functions
Pass the vector number to vfio_connect_kvm_msi_virq and vfio_remove_kvm_msi_virq, so it can be passed to their subroutines in a subsequent patch. No functional change. Signed-off-by: Steve Sistare <steven.sistare@oracle.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Link: https://lore.kernel.org/qemu-devel/1749569991-25171-15-git-send-email-steven.sistare@oracle.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
parent
8f5c696026
commit
d364d802fe
1 changed files with 7 additions and 6 deletions
|
@ -478,7 +478,7 @@ static void vfio_add_kvm_msi_virq(VFIOPCIDevice *vdev, VFIOMSIVector *vector,
|
|||
vector_n, &vdev->pdev);
|
||||
}
|
||||
|
||||
static void vfio_connect_kvm_msi_virq(VFIOMSIVector *vector)
|
||||
static void vfio_connect_kvm_msi_virq(VFIOMSIVector *vector, int nr)
|
||||
{
|
||||
const char *name = "kvm_interrupt";
|
||||
|
||||
|
@ -504,7 +504,8 @@ fail_notifier:
|
|||
vector->virq = -1;
|
||||
}
|
||||
|
||||
static void vfio_remove_kvm_msi_virq(VFIOMSIVector *vector)
|
||||
static void vfio_remove_kvm_msi_virq(VFIOPCIDevice *vdev, VFIOMSIVector *vector,
|
||||
int nr)
|
||||
{
|
||||
kvm_irqchip_remove_irqfd_notifier_gsi(kvm_state, &vector->kvm_interrupt,
|
||||
vector->virq);
|
||||
|
@ -581,7 +582,7 @@ static int vfio_msix_vector_do_use(PCIDevice *pdev, unsigned int nr,
|
|||
*/
|
||||
if (vector->virq >= 0) {
|
||||
if (!msg) {
|
||||
vfio_remove_kvm_msi_virq(vector);
|
||||
vfio_remove_kvm_msi_virq(vdev, vector, nr);
|
||||
} else {
|
||||
vfio_update_kvm_msi_virq(vector, *msg, pdev);
|
||||
}
|
||||
|
@ -593,7 +594,7 @@ static int vfio_msix_vector_do_use(PCIDevice *pdev, unsigned int nr,
|
|||
vfio_route_change = kvm_irqchip_begin_route_changes(kvm_state);
|
||||
vfio_add_kvm_msi_virq(vdev, vector, nr, true);
|
||||
kvm_irqchip_commit_route_changes(&vfio_route_change);
|
||||
vfio_connect_kvm_msi_virq(vector);
|
||||
vfio_connect_kvm_msi_virq(vector, nr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -687,7 +688,7 @@ static void vfio_commit_kvm_msi_virq_batch(VFIOPCIDevice *vdev)
|
|||
kvm_irqchip_commit_route_changes(&vfio_route_change);
|
||||
|
||||
for (i = 0; i < vdev->nr_vectors; i++) {
|
||||
vfio_connect_kvm_msi_virq(&vdev->msi_vectors[i]);
|
||||
vfio_connect_kvm_msi_virq(&vdev->msi_vectors[i], i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -827,7 +828,7 @@ static void vfio_msi_disable_common(VFIOPCIDevice *vdev)
|
|||
VFIOMSIVector *vector = &vdev->msi_vectors[i];
|
||||
if (vdev->msi_vectors[i].use) {
|
||||
if (vector->virq >= 0) {
|
||||
vfio_remove_kvm_msi_virq(vector);
|
||||
vfio_remove_kvm_msi_virq(vdev, vector, i);
|
||||
}
|
||||
qemu_set_fd_handler(event_notifier_get_fd(&vector->interrupt),
|
||||
NULL, NULL, NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue