|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [RESEND PATCH v16 6/6] hw/vfio/platform: add irqfd support |
Date: | Fri, 26 Jun 2015 18:26:25 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 |
On 26/06/2015 18:21, Alex Williamson wrote: >> > +#ifdef CONFIG_KVM >> > + if (kvm_irqfds_enabled() && kvm_resamplefds_enabled() && >> > + vdev->irqfd_allowed) { >> > + sbc->connect_irq_notifier = vfio_start_irqfd_injection; > Should we be abstracting this to a > sysbus_register_connect_irq_notifier()? It seems a littler personal to > be reaching in and setting it ourselves and would avoid us needing to > reference the class. It's your class, so it's not too bad to touch it from that point of view; on the other hand it's ugly to do it here nevertheless. :) I think you should always set "sbc->connect_irq_notifier = vfio_start_irqfd_injection" in the class_init function. The vfio_start_irqfd_injection function can just exit if it finds "!kvm_enabled() || !kvm_irqfds_enabled() || !kvm_resamplefds_enabled() || !vdev->irqfd_allowed". Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |