[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: [PATCH] pci: initialize header type register.

From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] Re: [PATCH] pci: initialize header type register.
Date: Mon, 8 Feb 2010 22:19:19 +0200
User-agent: Mutt/1.5.19 (2009-01-05)

On Mon, Feb 08, 2010 at 08:55:58PM +0100, Gerd Hoffmann wrote:
>   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.

We still need it in config array which is read by guest.
So that is two places.

> 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.
> cheers,
>   Gerd

more important IMO is making code easier to follow.


reply via email to

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