aboutsummaryrefslogtreecommitdiff
path: root/include/sysemu/kvm.h
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2016-07-14 13:56:30 +0800
committerMichael S. Tsirkin <mst@redhat.com>2016-07-21 20:44:18 +0300
commitd1f6af6a17a66f58c238e1c26b928cf71c0c11da (patch)
tree5ba4a4d466df886dce2c0857ce92cfb3620ffbb9 /include/sysemu/kvm.h
parentede9c94acf6cd1968de4188c0228b714ab871a86 (diff)
downloadqemu-d1f6af6a17a66f58c238e1c26b928cf71c0c11da.zip
qemu-d1f6af6a17a66f58c238e1c26b928cf71c0c11da.tar.gz
qemu-d1f6af6a17a66f58c238e1c26b928cf71c0c11da.tar.bz2
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>
Diffstat (limited to 'include/sysemu/kvm.h')
-rw-r--r--include/sysemu/kvm.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index ad6f837..e5d90bd 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -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);