summary refs log tree commit diff stats
path: root/kvm-all.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-07-05 17:16:30 +0200
committerAvi Kivity <avi@redhat.com>2012-07-12 14:08:11 +0300
commit15b2bd1847239fe0b4a1041b69a631741d2e273a (patch)
tree36b395a7ea3642442e9f45ec4280013ca56ae033 /kvm-all.c
parentb1f416aa8d870fab71030abc9401cfc77b948e8e (diff)
downloadfocaccia-qemu-15b2bd1847239fe0b4a1041b69a631741d2e273a.tar.gz
focaccia-qemu-15b2bd1847239fe0b4a1041b69a631741d2e273a.zip
virtio: move common irqfd handling out of virtio-pci
All transports can use the same event handler for the irqfd, though the
exact mechanics of the assignment will be specific.  Note that there
are three states: handled by the kernel, handled in userspace, disabled.

This also lets virtio use event_notifier_set_handler.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'kvm-all.c')
-rw-r--r--kvm-all.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/kvm-all.c b/kvm-all.c
index 5a386b45f9..add24a14a9 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1163,11 +1163,21 @@ int kvm_irqchip_add_irqfd(KVMState *s, int fd, int virq)
     return kvm_irqchip_assign_irqfd(s, fd, virq, true);
 }
 
+int kvm_irqchip_add_irq_notifier(KVMState *s, EventNotifier *n, int virq)
+{
+    return kvm_irqchip_add_irqfd(s, event_notifier_get_fd(n), virq);
+}
+
 int kvm_irqchip_remove_irqfd(KVMState *s, int fd, int virq)
 {
     return kvm_irqchip_assign_irqfd(s, fd, virq, false);
 }
 
+int kvm_irqchip_remove_irq_notifier(KVMState *s, EventNotifier *n, int virq)
+{
+    return kvm_irqchip_remove_irqfd(s, event_notifier_get_fd(n), virq);
+}
+
 static int kvm_irqchip_create(KVMState *s)
 {
     QemuOptsList *list = qemu_find_opts("machine");