From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3ls4-0001mj-Bv for qemu-devel@nongnu.org; Tue, 01 Dec 2015 09:25:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3ls0-00038o-Ai for qemu-devel@nongnu.org; Tue, 01 Dec 2015 09:25:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59377) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3ls0-00038i-4y for qemu-devel@nongnu.org; Tue, 01 Dec 2015 09:25:28 -0500 References: <1447155689-26230-1-git-send-email-marcel@redhat.com> <20151201122900.530ef562@pixies> <565D88FD.7000709@redhat.com> <20151201151802.4bd51911@pixies> <565DA81C.50003@redhat.com> <20151201161927.41e37652@pixies> From: Marcel Apfelbaum Message-ID: <565DADD4.5010502@redhat.com> Date: Tue, 1 Dec 2015 16:25:24 +0200 MIME-Version: 1.0 In-Reply-To: <20151201161927.41e37652@pixies> Content-Type: text/plain; charset=windows-1252; format=flowed 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: Shmulik Ladkani Cc: kraxel@redhat.com, qemu-devel@nongnu.org, ehabkost@redhat.com, mst@redhat.com On 12/01/2015 04:19 PM, Shmulik Ladkani wrote: > 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. > Thanks and please post the fix before our next rc. If you don't have the time, please let me know and I'll submit a fix. Thanks again! Marcel