Functions are equivalent, let's switch. Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx> --- hw/msi.c | 2 +- hw/msix.c | 2 +- kvm-stub.c | 2 +- kvm.h | 3 +-- qemu-kvm.c | 32 -------------------------------- 5 files changed, 4 insertions(+), 37 deletions(-) diff --git a/hw/msi.c b/hw/msi.c index 3e623c2..7bb3e2f 100644 --- a/hw/msi.c +++ b/hw/msi.c @@ -350,7 +350,7 @@ void msi_notify(PCIDevice *dev, unsigned int vector) } if (kvm_enabled() && kvm_irqchip_in_kernel()) { - kvm_set_irq(dev->msi_irq_entries[vector].gsi, 1, NULL); + kvm_irqchip_set_irq(kvm_state, dev->msi_irq_entries[vector].gsi, 1); return; } diff --git a/hw/msix.c b/hw/msix.c index 55ddbf4..7955221 100644 --- a/hw/msix.c +++ b/hw/msix.c @@ -494,7 +494,7 @@ void msix_notify(PCIDevice *dev, unsigned vector) } if (kvm_enabled() && kvm_irqchip_in_kernel()) { - kvm_set_irq(dev->msix_irq_entries[vector].gsi, 1, NULL); + kvm_irqchip_set_irq(kvm_state, dev->msix_irq_entries[vector].gsi, 1); return; } diff --git a/kvm-stub.c b/kvm-stub.c index 266dc4a..d22fcad 100644 --- a/kvm-stub.c +++ b/kvm-stub.c @@ -162,7 +162,7 @@ int kvm_irqchip_commit_routes(KVMState *s) return -ENOSYS; } -int kvm_set_irq(int irq, int level, int *status) +int kvm_irqchip_set_irq(KVMState *s, int irq, int level) { assert(0); return -ENOSYS; diff --git a/kvm.h b/kvm.h index b84aa40..3c3a510 100644 --- a/kvm.h +++ b/kvm.h @@ -228,13 +228,12 @@ int kvm_msi_message_del(KVMMsiMessage *msg); int kvm_msi_message_update(KVMMsiMessage *old, KVMMsiMessage *new); #ifndef NEED_CPU_H +int kvm_irqchip_set_irq(KVMState *s, int irq, int level); int kvm_irqchip_commit_routes(KVMState *s); #endif int kvm_irqchip_in_kernel(void); -int kvm_set_irq(int irq, int level, int *status); - #ifdef NEED_CPU_H #include "qemu-kvm.h" #endif diff --git a/qemu-kvm.c b/qemu-kvm.c index 10a313d..09a35f0 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -41,38 +41,6 @@ static inline void clear_gsi(KVMState *s, unsigned int gsi) } } -#ifdef KVM_CAP_IRQCHIP - -int kvm_set_irq(int irq, int level, int *status) -{ - struct kvm_irq_level event; - int r; - - if (!kvm_state->irqchip_in_kernel) { - return 0; - } - event.level = level; - event.irq = irq; - r = kvm_vm_ioctl(kvm_state, kvm_state->irqchip_inject_ioctl, - &event); - if (r < 0) { - perror("kvm_set_irq"); - } - - if (status) { -#ifdef KVM_CAP_IRQ_INJECT_STATUS - *status = (kvm_state->irqchip_inject_ioctl == KVM_IRQ_LINE) ? - 1 : event.status; -#else - *status = 1; -#endif - } - - return 1; -} - -#endif - #ifdef KVM_CAP_DEVICE_ASSIGNMENT int kvm_assign_pci_device(KVMState *s, struct kvm_assigned_pci_dev *assigned_dev) -- 1.7.3.4 -- 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