mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
kvm-irqchip: simplify kvm_irqchip_add_msi_route
Changing the original MSIMessage parameter in kvm_irqchip_add_msi_route into the vector number. Vector index provides more information than the MSIMessage, we can retrieve the MSIMessage using the vector easily. This will avoid fetching MSIMessage every time before adding MSI routes. Meanwhile, the vector info will be used in the coming patches to further enable gsi route update notifications. Signed-off-by: Peter Xu <peterx@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
ede9c94acf
commit
d1f6af6a17
8 changed files with 41 additions and 26 deletions
|
@ -441,13 +441,12 @@ static void ivshmem_add_kvm_msi_virq(IVShmemState *s, int vector,
|
|||
Error **errp)
|
||||
{
|
||||
PCIDevice *pdev = PCI_DEVICE(s);
|
||||
MSIMessage msg = msix_get_message(pdev, vector);
|
||||
int ret;
|
||||
|
||||
IVSHMEM_DPRINTF("ivshmem_add_kvm_msi_virq vector:%d\n", vector);
|
||||
assert(!s->msi_vectors[vector].pdev);
|
||||
|
||||
ret = kvm_irqchip_add_msi_route(kvm_state, msg, pdev);
|
||||
ret = kvm_irqchip_add_msi_route(kvm_state, vector, pdev);
|
||||
if (ret < 0) {
|
||||
error_setg(errp, "kvm_irqchip_add_msi_route failed");
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue