mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23: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
|
@ -474,7 +474,18 @@ static inline void cpu_synchronize_post_init(CPUState *cpu)
|
|||
}
|
||||
}
|
||||
|
||||
int kvm_irqchip_add_msi_route(KVMState *s, MSIMessage msg, PCIDevice *dev);
|
||||
/**
|
||||
* kvm_irqchip_add_msi_route - Add MSI route for specific vector
|
||||
* @s: KVM state
|
||||
* @vector: which vector to add. This can be either MSI/MSIX
|
||||
* vector. The function will automatically detect whether
|
||||
* MSI/MSIX is enabled, and fetch corresponding MSI
|
||||
* message.
|
||||
* @dev: Owner PCI device to add the route. If @dev is specified
|
||||
* as @NULL, an empty MSI message will be inited.
|
||||
* @return: virq (>=0) when success, errno (<0) when failed.
|
||||
*/
|
||||
int kvm_irqchip_add_msi_route(KVMState *s, int vector, PCIDevice *dev);
|
||||
int kvm_irqchip_update_msi_route(KVMState *s, int virq, MSIMessage msg,
|
||||
PCIDevice *dev);
|
||||
void kvm_irqchip_release_virq(KVMState *s, int virq);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue