From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5IMT-0002zv-2L for qemu-devel@nongnu.org; Wed, 17 Jun 2015 14:46:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5IMQ-0002oH-A8 for qemu-devel@nongnu.org; Wed, 17 Jun 2015 14:46:56 -0400 Received: from mail-wg0-f52.google.com ([74.125.82.52]:35980) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5IMQ-0002nU-4U for qemu-devel@nongnu.org; Wed, 17 Jun 2015 14:46:54 -0400 Received: by wgzl5 with SMTP id l5so44414055wgz.3 for ; Wed, 17 Jun 2015 11:46:52 -0700 (PDT) Date: Wed, 17 Jun 2015 21:46:49 +0300 From: Shmulik Ladkani Message-ID: <20150617214649.7740e8b9@pixies> In-Reply-To: <55813F8E.1000105@gmail.com> References: <1434443079-25755-1-git-send-email-shmulik.ladkani@ravellosystems.com> <55813F8E.1000105@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v1] pci: Don't register a specialized 'config_write' if default behavior is intended List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum Cc: Leonid Shatz , Hannes Reinecke , Idan Brown , qemu-devel@nongnu.org, "Michael S. Tsirkin" Hi, On Wed, 17 Jun 2015 12:36:14 +0300, marcel.apfelbaum@gmail.com wrote: > > NOTE: > > Not sure if my statement regarding ommitting 'config_write' holds > > for the megasas case: > > It's parent is TYPE_MEGASAS_BASE whose parent is TYPE_PCI_DEVICE. > > Can we assume 'config_write' will be set to > > 'pci_default_write_config' in this case? > No need to assume here, you can simply add a trace and check. > However, the do_pci_register_device method assigns config_write method > to PCIDevice *instances* using the class method or the default > pci_default_write_config. > > Since TYPE_MEGASAS_BASE does not define a config_write method, the > field will remain NULL. Anyway, you are welcomed to run it and > double-check. Verified; do_pci_register_device indeed sets it to pci_default_write_config. Thanks, Shmulik