From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KYKpt-0004oQ-CR for qemu-devel@nongnu.org; Wed, 27 Aug 2008 09:13:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KYKps-0004o6-US for qemu-devel@nongnu.org; Wed, 27 Aug 2008 09:13:20 -0400 Received: from [199.232.76.173] (port=35802 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KYKps-0004ns-Ex for qemu-devel@nongnu.org; Wed, 27 Aug 2008 09:13:20 -0400 Received: from mx2.redhat.com ([66.187.237.31]:46326) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KYKpr-0001kw-QD for qemu-devel@nongnu.org; Wed, 27 Aug 2008 09:13:20 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id m7RDChDn017617 for ; Wed, 27 Aug 2008 09:13:03 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m7RDCW55010998 for ; Wed, 27 Aug 2008 09:12:32 -0400 Received: from zweiblum.travel.kraxel.org (vpn-4-120.str.redhat.com [10.32.4.120]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id m7RDCQ37014771 for ; Wed, 27 Aug 2008 09:12:26 -0400 Message-ID: <48B552B9.3040002@redhat.com> Date: Wed, 27 Aug 2008 15:12:25 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [patch 2/2] add default pci subsystem id for all devices. References: <48B3DE05.3000009@redhat.com> <200808271310.30313.paul@codesourcery.com> In-Reply-To: <200808271310.30313.paul@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Paul Brook wrote: > On Tuesday 26 August 2008, Gerd Hoffmann wrote: >> This sets a default PCI subsystem ID for all emulated PCI devices. >> PCI specs require this, so do it. Individual devices can overwrite >> it of course. The defaults are global variables so they can easily >> be changed (before device creation) > > This is just asking for trouble. Having devices set magic global variables > before they create the device is a truly horrible API. The global variables are just for the *default* value, i.e. what devices get prefilled by pci_register_device(). If a pci device wants set specific subsystem IDs it can just do so in the init function where the other config space fields are filled. There is no need for devices to ever fiddle with the global variables. cheers, Gerd