From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8Wm8-0001En-7k for qemu-devel@nongnu.org; Fri, 26 Jun 2015 12:46:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8Wm7-0001Mh-Ca for qemu-devel@nongnu.org; Fri, 26 Jun 2015 12:46:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8Wm7-0001MX-88 for qemu-devel@nongnu.org; Fri, 26 Jun 2015 12:46:47 -0400 Message-ID: <1435337205.3700.450.camel@redhat.com> From: Alex Williamson Date: Fri, 26 Jun 2015 10:46:45 -0600 In-Reply-To: <558D7E63.7000005@linaro.org> 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> <558D7D31.1010009@redhat.com> <558D7E63.7000005@linaro.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 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: Eric Auger Cc: b.reynal@virtualopensystems.com, peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, eric.auger@st.com, vikrams@codeaurora.org, patches@linaro.org, qemu-devel@nongnu.org, Paolo Bonzini , christoffer.dall@linaro.org On Fri, 2015-06-26 at 18:31 +0200, Eric Auger wrote: > 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 Yeah, I'm ok with that, it's less awkward from the class_init. Thanks, Alex