From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlcJ7-0004Jn-8G for qemu-devel@nongnu.org; Fri, 24 Apr 2015 08:02:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YlcJ1-0007dM-0A for qemu-devel@nongnu.org; Fri, 24 Apr 2015 08:02:09 -0400 Received: from mail-wg0-f47.google.com ([74.125.82.47]:34154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlcJ0-0007dD-Ql for qemu-devel@nongnu.org; Fri, 24 Apr 2015 08:02:02 -0400 Received: by wgso17 with SMTP id o17so48232099wgs.1 for ; Fri, 24 Apr 2015 05:02:02 -0700 (PDT) Message-ID: <553A301D.3070503@linaro.org> Date: Fri, 24 Apr 2015 13:59:25 +0200 From: Eric Auger 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> <553A08D3.3020609@redhat.com> <553A0A4D.905@linaro.org> <553A0CF5.9030304@redhat.com> <553A115E.1050705@linaro.org> <553A14D3.1030300@redhat.com> In-Reply-To: <553A14D3.1030300@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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: Paolo Bonzini , 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 04/24/2015 12:02 PM, Paolo Bonzini wrote: > > > On 24/04/2015 11:48, Eric Auger wrote: >>>> What did the notifier code look like with your patch? >> Currently both notifiers are stored in the VFIOINTp struct. They are >> initialized in vfio_init_intp. VFIO platform device holds a list of >> VFIOINTp struct. >> >> When the vfio_start_irqfd callback is called the qemuirq is not yet >> initialized so I cannot retrieve the EventNotifiers by container_of. > > Understood better now. I would pass the "Object **child" variable of > object_set_link_property to the callback then (in qom/object.c). > > Then I would go for the other solution (the notifier, just adding the > callback to SysbusDeviceClass). But I still do not understand why you > didn't have exactly the same problem :) unless you were walking the list > to find the relevant VFIOINTp. Hi Paolo, Yes I was walking the list ;-) So is my understanding coherent: revert to first patch but moving notifier in class Thanks Eric > > Paolo > >> I can allocate and initialize them in the callback but I need a place to >> store them to close the eventfd. >> >> Also at the moment I start irqfd I must take some actions to stop (user >> side) eventfd trigger; this also urges me to get access to VFIOINTp >> struct. Some extracted pieces below (under work).