From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMzYk-00041n-5J for qemu-devel@nongnu.org; Sat, 23 Jan 2016 09:53:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMzYg-0003QS-5e for qemu-devel@nongnu.org; Sat, 23 Jan 2016 09:53:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMzYf-0003Pu-W7 for qemu-devel@nongnu.org; Sat, 23 Jan 2016 09:52:58 -0500 Date: Sat, 23 Jan 2016 12:52:54 -0200 From: Eduardo Habkost Message-ID: <20160123145254.GD4218@thinpad.lan.raisama.net> References: <1451994098-6972-1-git-send-email-kraxel@redhat.com> <1451994098-6972-6-git-send-email-kraxel@redhat.com> <1452095101.6096.55.camel@redhat.com> <20160119151302.GB3869@thinpad.lan.raisama.net> <1453281011.11804.40.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1453281011.11804.40.camel@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 05/11] igd: TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE: call parent realize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: igvt-g@ml01.01.org, xen-devel@lists.xensource.com, Stefano Stabellini , qemu-devel@nongnu.org, Cao jin , vfio-users@redhat.com On Wed, Jan 20, 2016 at 10:10:11AM +0100, Gerd Hoffmann wrote: > Hi, > > > > > > + i440fx_realize = k->realize; > > > > > k->realize = igd_pt_i440fx_realize; > > > > > > ... because we are overriding it right here. > > > > Many device classes have a parent_realize field so they can keep > > a pointer to the original realize function. It's better than a > > static variable. > > How does the attached patch (incremental fix, not tested yet) look like? Looks good. Reviewed-by: Eduardo Habkost But, I have a similar question to the one I had about patch 04/11: how did this ever work before? Does that mean i440fx_realize() was never called when creating/initializing a TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE before? -- Eduardo From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eduardo Habkost Subject: Re: [PATCH v3 05/11] igd: TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE: call parent realize Date: Sat, 23 Jan 2016 12:52:54 -0200 Message-ID: <20160123145254.GD4218@thinpad.lan.raisama.net> References: <1451994098-6972-1-git-send-email-kraxel@redhat.com> <1451994098-6972-6-git-send-email-kraxel@redhat.com> <1452095101.6096.55.camel@redhat.com> <20160119151302.GB3869@thinpad.lan.raisama.net> <1453281011.11804.40.camel@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1453281011.11804.40.camel@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org To: Gerd Hoffmann Cc: igvt-g@ml01.01.org, xen-devel@lists.xensource.com, Stefano Stabellini , qemu-devel@nongnu.org, Cao jin , vfio-users@redhat.com List-Id: xen-devel@lists.xenproject.org On Wed, Jan 20, 2016 at 10:10:11AM +0100, Gerd Hoffmann wrote: > Hi, > > > > > > + i440fx_realize = k->realize; > > > > > k->realize = igd_pt_i440fx_realize; > > > > > > ... because we are overriding it right here. > > > > Many device classes have a parent_realize field so they can keep > > a pointer to the original realize function. It's better than a > > static variable. > > How does the attached patch (incremental fix, not tested yet) look like? Looks good. Reviewed-by: Eduardo Habkost But, I have a similar question to the one I had about patch 04/11: how did this ever work before? Does that mean i440fx_realize() was never called when creating/initializing a TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE before? -- Eduardo