diff mbox

[RFC,6/7] s390x/kvm: msi route fixup for non-pci

Message ID 20170707122159.24714-7-cohuck@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Cornelia Huck July 7, 2017, 12:21 p.m. UTC
On non-pci builds, we cannot have a pci device for which we
have to translate to adapter routes: just return -ENODEV.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 target/s390x/kvm.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index c5c7c27a21..911b6da3f0 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -2351,6 +2351,7 @@  int kvm_s390_vcpu_interrupt_post_load(S390CPU *cpu)
 int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route,
                              uint64_t address, uint32_t data, PCIDevice *dev)
 {
+#ifdef CONFIG_PCI
     S390PCIBusDevice *pbdev;
     uint32_t idx = data >> ZPCI_MSI_VEC_BITS;
     uint32_t vec = data & ZPCI_MSI_VEC_MASK;
@@ -2371,6 +2372,9 @@  int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route,
     route->u.adapter.ind_offset = pbdev->routes.adapter.ind_offset;
     route->u.adapter.adapter_id = pbdev->routes.adapter.adapter_id;
     return 0;
+#else
+    return -ENODEV;
+#endif
 }
 
 int kvm_arch_add_msi_route_post(struct kvm_irq_routing_entry *route,