This is a small collection of build fixes that allow the qemu-kvm tree to build a ppc64-softmmu target with kvm enabled (provided device-assignment is disabled). Signed-off-by: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> --- Avi, Marcelo: This is really only for qemu-kvm, not upstream qemu, but since distros such as Fedora use this as base qemu source tree, it would be great to have these fixed. diff --git a/kvm-all.c b/kvm-all.c index 99eb095..03d4b31 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -941,6 +941,12 @@ int kvm_irqchip_commit_routes(KVMState *s) static void kvm_init_irq_routing(KVMState *s) { } + +int kvm_irqchip_commit_routes(KVMState *s) +{ + return -ENOSYS; +} + #endif /* !KVM_CAP_IRQ_ROUTING */ static int kvm_irqchip_create(KVMState *s) diff --git a/qemu-kvm.c b/qemu-kvm.c index 34e1ac8..108050b 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -30,6 +30,7 @@ #define ALIGN(x, y) (((x)+(y)-1) & ~((y)-1)) +#ifdef KVM_CAP_IRQ_ROUTING static inline void clear_gsi(KVMState *s, unsigned int gsi) { uint32_t *bitmap = s->used_gsi_bitmap; @@ -40,6 +41,7 @@ static inline void clear_gsi(KVMState *s, unsigned int gsi) DPRINTF("Invalid GSI %u\n", gsi); } } +#endif #ifdef KVM_CAP_DEVICE_ASSIGNMENT int kvm_assign_pci_device(KVMState *s, @@ -228,6 +230,7 @@ int kvm_del_irq_route(int gsi, int irqchip, int pin) int kvm_get_irq_route_gsi(void) { +#ifdef KVM_CAP_IRQ_ROUTING KVMState *s = kvm_state; int i, bit; uint32_t *buf = s->used_gsi_bitmap; @@ -243,8 +246,12 @@ int kvm_get_irq_route_gsi(void) } return -ENOSPC; +#else + return -ENOSYS; +#endif } +#ifdef KVM_CAP_IRQ_ROUTING static void kvm_msi_routing_entry(struct kvm_irq_routing_entry *e, KVMMsiMessage *msg) @@ -256,9 +263,11 @@ static void kvm_msi_routing_entry(struct kvm_irq_routing_entry *e, e->u.msi.address_hi = msg->addr_hi; e->u.msi.data = msg->data; } +#endif int kvm_msi_message_add(KVMMsiMessage *msg) { +#ifdef KVM_CAP_IRQ_ROUTING struct kvm_irq_routing_entry e; int ret; @@ -271,18 +280,26 @@ int kvm_msi_message_add(KVMMsiMessage *msg) kvm_msi_routing_entry(&e, msg); kvm_add_routing_entry(kvm_state, &e); return 0; +#else + return -ENOSYS; +#endif } int kvm_msi_message_del(KVMMsiMessage *msg) { +#ifdef KVM_CAP_IRQ_ROUTING struct kvm_irq_routing_entry e; kvm_msi_routing_entry(&e, msg); return kvm_del_routing_entry(&e); +#else + return -ENOSYS; +#endif } int kvm_msi_message_update(KVMMsiMessage *old, KVMMsiMessage *new) { +#ifdef KVM_CAP_IRQ_ROUTING struct kvm_irq_routing_entry e1, e2; int ret; @@ -300,6 +317,9 @@ int kvm_msi_message_update(KVMMsiMessage *old, KVMMsiMessage *new) } return 1; +#else + return -ENOSYS; +#endif } @@ -317,9 +337,8 @@ int kvm_assign_set_msix_entry(KVMState *s, #endif #if !defined(TARGET_I386) -int kvm_arch_init_irq_routing(void) +void kvm_arch_init_irq_routing(KVMState *s) { - return 0; } #endif -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html