Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NelM4-000746-Om for qemu-devel@nongnu.org; Tue, 09 Feb 2010 03:21:57 -0500 Received: from [199.232.76.173] (port=55380 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NelM0-00071W-Rj for qemu-devel@nongnu.org; Tue, 09 Feb 2010 03:21:52 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NelLz-0005Ds-PW for qemu-devel@nongnu.org; Tue, 09 Feb 2010 03:21:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54140) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NelLz-0005Dk-Bq for qemu-devel@nongnu.org; Tue, 09 Feb 2010 03:21:51 -0500 From: Markus Armbruster Subject: Re: [Qemu-devel] Re: [PATCH] pci: initialize header type register. References: <20100208064147.GD22624@valinux.co.jp> <20100208101753.GA14662@redhat.com> <4B6FF203.6010304@redhat.com> <20100208162753.GA28230@redhat.com> <4B7048E9.6000706@redhat.com> <20100208173204.GA10716@redhat.com> <4B704BE5.9010205@redhat.com> <20100208173741.GB10716@redhat.com> <20100208182624.GD10716@redhat.com> <4B706C4E.2010508@redhat.com> Date: Tue, 09 Feb 2010 09:21:44 +0100 In-Reply-To: <4B706C4E.2010508@redhat.com> (Gerd Hoffmann's message of "Mon, 08 Feb 2010 20:55:58 +0100") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Blue Swirl , Isaku Yamahata , qemu-devel@nongnu.org, "Michael S. Tsirkin" Gerd Hoffmann writes: > Hi, > >> This still means we have two copies of same data >> and need to maintain code that keeps them in sync, >> even if that is called just at init time. > > No. There is nothing to keep in sync. And there is no extra copy of data. > > Today you have pci_set_*() calls somewhere in PCIDeviceInfo->init(). > I'd like to see them replaced with PCIDeviceInfo->$field + setup in > common code. The information that device $foo has vendor id 42 and > device id 4711 (and other properties) just moves from code to data. > > It is static information, it should be static data. And having the > information in a well defined place in a data structure instead of > hidden somewhere in the ->init() code makes it alot easier to reuse > the information for something else. That is the whole point. ACK