From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3lUS-0002zO-2R for qemu-devel@nongnu.org; Tue, 01 Dec 2015 09:01:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3lUO-00049H-Qn for qemu-devel@nongnu.org; Tue, 01 Dec 2015 09:01:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3lUO-00049D-LF for qemu-devel@nongnu.org; Tue, 01 Dec 2015 09:01:04 -0500 References: <1447155689-26230-1-git-send-email-marcel@redhat.com> <20151201122900.530ef562@pixies> <565D88FD.7000709@redhat.com> <20151201151802.4bd51911@pixies> From: Marcel Apfelbaum Message-ID: <565DA81C.50003@redhat.com> Date: Tue, 1 Dec 2015 16:01:00 +0200 MIME-Version: 1.0 In-Reply-To: <20151201151802.4bd51911@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 03:18 PM, Shmulik Ladkani wrote: > Hi, > > 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... However I didn't see yet the vmxnet3 changes you propose. Maybe you can send an RFC and we'll check then. Thanks, Marcel