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>
Showing
- Makefile 1 addition, 1 deletionMakefile
- Makefile.hw 1 addition, 1 deletionMakefile.hw
- hw/arm_sysctl.c 16 additions, 4 deletionshw/arm_sysctl.c
- hw/armv7m.c 17 additions, 5 deletionshw/armv7m.c
- hw/axis_dev88.c 1 addition, 1 deletionhw/axis_dev88.c
- hw/cs4231.c 1 addition, 1 deletionhw/cs4231.c
- hw/eccmemctl.c 18 additions, 3 deletionshw/eccmemctl.c
- hw/escc.c 57 additions, 35 deletionshw/escc.c
- hw/esp.c 6 additions, 8 deletionshw/esp.c
- hw/etraxfs.c 1 addition, 1 deletionhw/etraxfs.c
- hw/etraxfs_pic.c 15 additions, 3 deletionshw/etraxfs_pic.c
- hw/fdc.c 31 additions, 13 deletionshw/fdc.c
- hw/i2c.c 9 additions, 2 deletionshw/i2c.c
- hw/i2c.h 1 addition, 1 deletionhw/i2c.h
- hw/integratorcp.c 21 additions, 9 deletionshw/integratorcp.c
- hw/iommu.c 8 additions, 6 deletionshw/iommu.c
- hw/m48t59.c 30 additions, 9 deletionshw/m48t59.c
- hw/mips_malta.c 2 additions, 2 deletionshw/mips_malta.c
- hw/musicpal.c 1 addition, 1 deletionhw/musicpal.c
- hw/pc.c 2 additions, 2 deletionshw/pc.c
Loading
Please register or sign in to comment