From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8WSX-00057L-8E for qemu-devel@nongnu.org; Fri, 26 Jun 2015 12:26:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8WSV-00006H-Gk for qemu-devel@nongnu.org; Fri, 26 Jun 2015 12:26:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58590) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8WSV-000062-9I for qemu-devel@nongnu.org; Fri, 26 Jun 2015 12:26:31 -0400 References: <1434386038-9246-1-git-send-email-eric.auger@linaro.org> <1434386038-9246-7-git-send-email-eric.auger@linaro.org> <1435335678.3700.433.camel@redhat.com> From: Paolo Bonzini Message-ID: <558D7D31.1010009@redhat.com> Date: Fri, 26 Jun 2015 18:26:25 +0200 MIME-Version: 1.0 In-Reply-To: <1435335678.3700.433.camel@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RESEND PATCH v16 6/6] hw/vfio/platform: add irqfd support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson , Eric Auger Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, eric.auger@st.com, vikrams@codeaurora.org, patches@linaro.org, qemu-devel@nongnu.org, b.reynal@virtualopensystems.com, christoffer.dall@linaro.org 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