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 15:12:25 +0200
User-agent: Thunderbird 2.0.0.16 (X11/20080723)

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




reply via email to

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