From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36816) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlZeO-0004Am-GJ for qemu-devel@nongnu.org; Fri, 24 Apr 2015 05:11:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YlZeK-0001cK-Fp for qemu-devel@nongnu.org; Fri, 24 Apr 2015 05:11:56 -0400 Received: from mail-wg0-x235.google.com ([2a00:1450:400c:c00::235]:36181) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlZeK-0001cE-95 for qemu-devel@nongnu.org; Fri, 24 Apr 2015 05:11:52 -0400 Received: by wgen6 with SMTP id n6so43839764wge.3 for ; Fri, 24 Apr 2015 02:11:51 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <553A08D3.3020609@redhat.com> Date: Fri, 24 Apr 2015 11:11:47 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1429778977-1632-1-git-send-email-eric.auger@linaro.org> <5538BBD3.9040404@redhat.com> <5538BE19.6030009@linaro.org> <5538C246.20304@redhat.com> <553A0657.6050100@linaro.org> In-Reply-To: <553A0657.6050100@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 0/2] irq: add get_gsi callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Auger , eric.auger@st.com, qemu-devel@nongnu.org, alex.williamson@redhat.com, peter.maydell@linaro.org, agraf@suse.de Cc: kvmarm@lists.cs.columbia.edu, patches@linaro.org On 24/04/2015 11:01, Eric Auger wrote: >> > void sysbus_init_irq(SysBusDevice *dev, qemu_irq *p) >> > { >> > SysBusDeviceClass *sdc = SYSBUS_DEVICE_GET_CLASS(dev); >> > qdev_init_gpio_out_named(DEVICE(dev), p, SYSBUS_DEVICE_GPIO_IRQ, 1, >> > sdc->irq_set_hook); >> > } > Hi Paolo > > I implemented this alternative but my concern is the check method is > called before the qemu_irq setting. So on this callback I cannot > retrieve the qemu_irq VFIOINTp struct container object needed to setup > irqfd hence does not work for me. Isn't the qemu_irq passed as the third argument to the callback? I thought this solution was fine because you weren't passing the "int n" from sysbus_connect_irq to your notifier. If you really cannot make it work, I guess your "sysbus: add irq_routing_notifier" patch would be okay. I would only ask you to move the function pointer from SysBusDevice to SysBusDeviceClass. Thanks, Paolo > I would need a post_check cb. Do you > think it it sensible to add another cb?