Add a helper function to trigger an IRQ. This function is usefull when an IRQ line has to be raised and lowered such as when using MSI-X. Signed-off-by: Sasha Levin <levinsasha928@xxxxxxxxx> --- tools/kvm/include/kvm/kvm.h | 1 + tools/kvm/kvm.c | 6 ++++++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/tools/kvm/include/kvm/kvm.h b/tools/kvm/include/kvm/kvm.h index 1cbe3c7..ccb20bf 100644 --- a/tools/kvm/include/kvm/kvm.h +++ b/tools/kvm/include/kvm/kvm.h @@ -63,6 +63,7 @@ void kvm__setup_bios(struct kvm *kvm); void kvm__start_timer(struct kvm *kvm); void kvm__stop_timer(struct kvm *kvm); void kvm__irq_line(struct kvm *kvm, int irq, int level); +void kvm__irq_trigger(struct kvm *kvm, int irq); bool kvm__emulate_io(struct kvm *kvm, u16 port, void *data, int direction, int size, u32 count); bool kvm__emulate_mmio(struct kvm *kvm, u64 phys_addr, u8 *data, u32 len, u8 is_write); void kvm__register_mem(struct kvm *kvm, u64 guest_phys, u64 size, void *userspace_addr); diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c index 740851d..be4a02a 100644 --- a/tools/kvm/kvm.c +++ b/tools/kvm/kvm.c @@ -676,6 +676,12 @@ void kvm__irq_line(struct kvm *kvm, int irq, int level) die_perror("KVM_IRQ_LINE failed"); } +void kvm__irq_trigger(struct kvm *kvm, int irq) +{ + kvm__irq_line(kvm, irq, 1); + kvm__irq_line(kvm, irq, 0); +} + void kvm__dump_mem(struct kvm *kvm, unsigned long addr, unsigned long size) { unsigned char *p; -- 1.7.6 -- 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