From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42150) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8WXh-0000QS-1u for qemu-devel@nongnu.org; Fri, 26 Jun 2015 12:31:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8WXd-0002kD-Ti for qemu-devel@nongnu.org; Fri, 26 Jun 2015 12:31:53 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:34918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8WXd-0002jy-Oi for qemu-devel@nongnu.org; Fri, 26 Jun 2015 12:31:49 -0400 Received: by wiga1 with SMTP id a1so22108011wig.0 for ; Fri, 26 Jun 2015 09:31:49 -0700 (PDT) Message-ID: <558D7E63.7000005@linaro.org> Date: Fri, 26 Jun 2015 18:31:31 +0200 From: Eric Auger MIME-Version: 1.0 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> In-Reply-To: <558D7D31.1010009@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: Paolo Bonzini , Alex Williamson 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 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 >