On 06/26/2015 06:26 PM, Paolo Bonzini wrote: > > > 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". OK thanks for the guidance. Alex, are you OK with that solution. It avoids touching the other patch
Thanks Eric > > Paolo >