From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3kor-0002di-Fa for qemu-devel@nongnu.org; Tue, 01 Dec 2015 08:18:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3koo-0000Qj-Af for qemu-devel@nongnu.org; Tue, 01 Dec 2015 08:18:09 -0500 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:33290) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3koo-0000Qe-11 for qemu-devel@nongnu.org; Tue, 01 Dec 2015 08:18:06 -0500 Received: by wmec201 with SMTP id c201so204823928wme.0 for ; Tue, 01 Dec 2015 05:18:05 -0800 (PST) Date: Tue, 1 Dec 2015 15:18:02 +0200 From: Shmulik Ladkani Message-ID: <20151201151802.4bd51911@pixies> In-Reply-To: <565D88FD.7000709@redhat.com> References: <1447155689-26230-1-git-send-email-marcel@redhat.com> <20151201122900.530ef562@pixies> <565D88FD.7000709@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 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?