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. -- MST