[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [patch 2/2] add default pci subsystem id for all device
From: |
Paul Brook |
Subject: |
Re: [Qemu-devel] [patch 2/2] add default pci subsystem id for all devices. |
Date: |
Wed, 27 Aug 2008 14:52:14 +0100 |
User-agent: |
KMail/1.9.9 |
On Wednesday 27 August 2008, Gerd Hoffmann wrote:
> 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.
That's not what your comment says. Why are they extern variables if other
modules aren't supposed to modify them?
Paul