aboutsummaryrefslogtreecommitdiff
path: root/accel
diff options
context:
space:
mode:
authorCornelia Huck <cohuck@redhat.com>2017-07-07 11:45:26 +0200
committerCornelia Huck <cohuck@redhat.com>2017-08-30 18:23:25 +0200
commit88c725c78e87eecb061f882177c7a6a2ac1059ad (patch)
treee5076aa2e2219460f4a6ca9b0a4cda8f345fe32e /accel
parent5f8c92e1d50d3629116497dd0a446e8cb28af7f8 (diff)
downloadqemu-88c725c78e87eecb061f882177c7a6a2ac1059ad.zip
qemu-88c725c78e87eecb061f882177c7a6a2ac1059ad.tar.gz
qemu-88c725c78e87eecb061f882177c7a6a2ac1059ad.tar.bz2
kvm: remove hard dependency on pci
The msi routing code in kvm calls some pci functions: provide some stubs to enable builds without pci. Also, to make this more obvious, guard them via a pci_available boolean (which also can be reused in other places). Fixes: e1d4fb2de ("kvm-irqchip: x86: add msi route notify fn") Fixes: 767a554a0 ("kvm-all: Pass requester ID to MSI routing functions") Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'accel')
-rw-r--r--accel/kvm/kvm-all.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 46ce479..f85553a 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -1248,7 +1248,7 @@ int kvm_irqchip_add_msi_route(KVMState *s, int vector, PCIDevice *dev)
int virq;
MSIMessage msg = {0, 0};
- if (dev) {
+ if (pci_available && dev) {
msg = pci_get_msi_message(dev, vector);
}
@@ -1271,7 +1271,7 @@ int kvm_irqchip_add_msi_route(KVMState *s, int vector, PCIDevice *dev)
kroute.u.msi.address_lo = (uint32_t)msg.address;
kroute.u.msi.address_hi = msg.address >> 32;
kroute.u.msi.data = le32_to_cpu(msg.data);
- if (kvm_msi_devid_required()) {
+ if (pci_available && kvm_msi_devid_required()) {
kroute.flags = KVM_MSI_VALID_DEVID;
kroute.u.msi.devid = pci_requester_id(dev);
}
@@ -1309,7 +1309,7 @@ int kvm_irqchip_update_msi_route(KVMState *s, int virq, MSIMessage msg,
kroute.u.msi.address_lo = (uint32_t)msg.address;
kroute.u.msi.address_hi = msg.address >> 32;
kroute.u.msi.data = le32_to_cpu(msg.data);
- if (kvm_msi_devid_required()) {
+ if (pci_available && kvm_msi_devid_required()) {
kroute.flags = KVM_MSI_VALID_DEVID;
kroute.u.msi.devid = pci_requester_id(dev);
}