Commit Graph

9 Commits

Author SHA1 Message Date
Gerd Hoffmann ee6847d19b qdev: rework device properties.
This patch is a major overhaul of the device properties.  The properties
are saved directly in the device state struct now, the linked list of
property values is gone.

Advantages:
  * We don't have to maintain the list with the property values.
  * The value in the property list and the value actually used by
    the device can't go out of sync any more (used to happen for
    the pci.devfn == -1 case) because there is only one place where
    the value is stored.
  * A record describing the property is required now, you can't set
    random properties any more.

There are bus-specific and device-specific properties.  The former
should be used for properties common to all bus drivers.  Typical
use case is bus addressing, i.e. pci.devfn and i2c.address.

Properties have a PropertyInfo struct attached with name, size and
function pointers to parse and print properties.  A few common property
types have PropertyInfos defined in qdev-properties.c.  Drivers are free
to implement their own very special property parsers if needed.

Properties can have default values.  If unset they are zero-filled.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 17:28:51 -05:00
Gerd Hoffmann 074f2fff79 qdev: move name+size into DeviceInfo (v2)
Rationale: move device information from code to data structures.

v2: Adapt the drivers missed in the first version.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-06-11 13:47:36 +01:00
Paul Brook 1ea96673c6 SMBus qdev conversion
Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-05-14 22:35:08 +01:00
balrog ab7d91318b Fix smbus_eeprom.c compile with DEBUG (spotted by Duilio Protti).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4645 c046a42c-6fe2-441c-8c8c-71466251a162
2008-06-02 01:48:27 +00:00
pbrook 87ecb68bdf Break up vl.h.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-17 17:14:51 +00:00
ths 3b46e62427 find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in the regex.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3177 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-17 08:09:54 +00:00
ths 5fafdf24ef find -type f | xargs sed -i 's/[\t ]$//g' # on most files
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-16 21:08:06 +00:00
pbrook 0ff596d02f I2C/SMBus framework.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2845 c046a42c-6fe2-441c-8c8c-71466251a162
2007-05-23 00:03:59 +00:00
ths 3fffc2234f PIIX4 SMBus host, EEPROM device emulation, by Ed Swierk.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2379 c046a42c-6fe2-441c-8c8c-71466251a162
2007-02-02 03:13:18 +00:00