qemu-devel
[Top][All Lists]
Advanced

[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: Gerd Hoffmann
Subject: Re: [Qemu-devel] [patch 2/2] add default pci subsystem id for all devices.
Date: Wed, 27 Aug 2008 16:19:17 +0200
User-agent: Thunderbird 2.0.0.16 (X11/20080723)

Paul Brook wrote:
> 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?

The wording in the resent patch should be more clear.

The intention is to be able to change the default subsystem id based on
the machine type.  pci drivers can easily set that directly, they don't
need this.

cheers,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]