From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3lmN-0004B5-3Z for qemu-devel@nongnu.org; Tue, 01 Dec 2015 09:19:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3lmF-0001Jh-G0 for qemu-devel@nongnu.org; Tue, 01 Dec 2015 09:19:39 -0500 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:34407) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3lmF-0001JJ-7v for qemu-devel@nongnu.org; Tue, 01 Dec 2015 09:19:31 -0500 Received: by wmvv187 with SMTP id v187so208961269wmv.1 for ; Tue, 01 Dec 2015 06:19:30 -0800 (PST) Date: Tue, 1 Dec 2015 16:19:27 +0200 From: Shmulik Ladkani Message-ID: <20151201161927.41e37652@pixies> In-Reply-To: <565DA81C.50003@redhat.com> References: <1447155689-26230-1-git-send-email-marcel@redhat.com> <20151201122900.530ef562@pixies> <565D88FD.7000709@redhat.com> <20151201151802.4bd51911@pixies> <565DA81C.50003@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V5] hw/virtio: Add PCIe capability to virtio devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum Cc: kraxel@redhat.com, qemu-devel@nongnu.org, ehabkost@redhat.com, mst@redhat.com Hi, On Tue, 1 Dec 2015 16:01:00 +0200, marcel@redhat.com wrote: > On 12/01/2015 03:18 PM, Shmulik Ladkani wrote: > > On Tue, 1 Dec 2015 13:48:13 +0200, marcel@redhat.com wrote: > >>> May I suggest the following: > >>> - Expose 'pci_qdev_realize' > >>> - Have 'virtio_pci_class_init' arm it's own dc->realize, > >>> which will first set 'QEMU_PCI_CAP_EXPRESS' flag as needed, > >>> and then call 'pci_qdev_realize' > >>> - Now, in 'virtio_pci_realize' we may use 'pci_is_express' instead of > >>> directly checking the proxy->flags > >>> > >>> If this sounds ok, I'll submit a fix. > >> > >> Give it a try, sure, but you don't need to expose pci_qdev_realize, > >> you can 'hijack' parent's realize method before replacing it. > > > > Actually I caught this as I needed to do something very similar to > > vmxnet3. > > > > Since we need this in 2 places, I thought it would be better to expose > > pci_qdev_realize (maybe name it better) and not store parent's original > > realize before replacing it. > > > > WDYT? > > Personally I don't think pci_qdev_realize should be visible outside hw/pci/pci.c > because "realize" should be private to object... Thanks I'll follow that path and submit a patch shortly.