From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8Xos-000388-Tj for qemu-devel@nongnu.org; Mon, 14 Dec 2015 13:25:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8Xop-0001Yz-OL for qemu-devel@nongnu.org; Mon, 14 Dec 2015 13:25:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8Xop-0001Yi-JM for qemu-devel@nongnu.org; Mon, 14 Dec 2015 13:25:55 -0500 References: <1449994112-7054-1-git-send-email-shmulik.ladkani@ravellosystems.com> <1449994112-7054-6-git-send-email-shmulik.ladkani@ravellosystems.com> <566EF8FD.3080206@redhat.com> From: Marcel Apfelbaum Message-ID: <566F09AD.40803@redhat.com> Date: Mon, 14 Dec 2015 20:25:49 +0200 MIME-Version: 1.0 In-Reply-To: <566EF8FD.3080206@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 5/6] vmw_pvscsi: The pvscsi device is a PCIE endpoint List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Shmulik Ladkani , Dmitry Fleytman Cc: idan.brown@ravellosystems.com, qemu-devel@nongnu.org, "Michael S. Tsirkin" On 12/14/2015 07:14 PM, Paolo Bonzini wrote: > > > On 13/12/2015 09:08, Shmulik Ladkani wrote: >> + pvs_k->parent_dc_realize = dc->realize; > > Marcel, Michael, > > this creates a really nasty dependency on the contents of pci_qdev_realize. Hi Paolo, In this case is exactly want we want to do. We don't care what pci_qdev_realize does. We just want to made a change and then call it. We can think of it as "pre-realize." I think I already saw a "post-realize" or something. The usage is also documented in include/qom/object.h, how to derive "do_something" (see derived_do_something). > > Can you instead change PCIDeviceClass's pc->is_express to a function > pointer, and provide a sample implementation pci_is_express_true for the > devices that set is_express to true? I think I thougth about this too and I have nothing against it. The only "down side" I can see is that "is_express" means actually "can_be_express", and some classes keep it true even if sometimes is not actually a PCIe device. Now we change back the meaning to "is_really_express" :) , but we may encounter some side effects. (I understand that we keep it true so we don't have to maintain some complicated code on VMState related to the config space size.) Thanks, Marcel > > Thanks, > > Paolo >