diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2013-07-23 10:56:55 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-07-23 10:56:55 -0500 |
commit | 931f0adf64261bf7eb3efaafb4430c04a6a3e6f6 (patch) | |
tree | 4dedbea9096972d9215cfb1358f57e6e3acd8d43 /include | |
parent | 3464700f6aecb3e2aa9098839d90672d6b3fa974 (diff) | |
parent | 52785d99513e4f5d8c3d94f4362ff54aba88f33c (diff) | |
download | qemu-931f0adf64261bf7eb3efaafb4430c04a6a3e6f6.zip qemu-931f0adf64261bf7eb3efaafb4430c04a6a3e6f6.tar.gz qemu-931f0adf64261bf7eb3efaafb4430c04a6a3e6f6.tar.bz2 |
Merge remote-tracking branch 'afaerber/tags/qom-devices-for-anthony' into staging
QOM device refactorings
* Avoid TYPE_* in VMStateDescription name
* Replace some DO_UPCAST()s and FROM_SYSBUS()s with QOM casts
* Limit legacy SCSI command line handling to non-hotplugged devices
* Replace some SysBusDeviceClass::init with DeviceClass::realize
# gpg: Signature made Mon 22 Jul 2013 06:31:42 PM CDT using RSA key ID 3E7E013F
# gpg: Can't check signature: public key not found
# By Hu Tao (26) and others
# Via Andreas Färber
* afaerber/tags/qom-devices-for-anthony: (55 commits)
isa-bus: Drop isabus_bridge_init() since it does nothing
ioapic: Use QOM realize for ioapic
kvmvapic: Use QOM realize
kvm/clock: Use QOM realize for kvmclock
hpet: Use QOM realize for hpet
scsi: Improve error propagation for scsi_bus_legacy_handle_cmdline()
megasas: Legacy command line handling fix
scsi/esp: Use QOM realize for scsi esp
fw_cfg: Use QOM realize for fw_cfg
ahci: Use QOM realize for ahci
pflash_cfi02: Use QOM realize for pflash_cfi02
pflash_cfi01: Use QOM realize for pflash_cfi01
fdc: Improve error propagation for QOM realize
fdc: Use QOM realize for fdc
kvm/clock: QOM'ify some more
hpet: QOM'ify some more
scsi/esp: QOM'ify some more
fwcfg: QOM'ify some more
ahci: QOM'ify some more
pflash-cfi02: QOM'ify some more
...
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/pci-host/q35.h | 10 | ||||
-rw-r--r-- | include/hw/scsi/scsi.h | 4 | ||||
-rw-r--r-- | include/hw/sysbus.h | 12 |
3 files changed, 22 insertions, 4 deletions
diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h index b083831..3cb631e 100644 --- a/include/hw/pci-host/q35.h +++ b/include/hw/pci-host/q35.h @@ -43,7 +43,10 @@ OBJECT_CHECK(MCHPCIState, (obj), TYPE_MCH_PCI_DEVICE) typedef struct MCHPCIState { - PCIDevice d; + /*< private >*/ + PCIDevice parent_obj; + /*< public >*/ + MemoryRegion *ram_memory; MemoryRegion *pci_address_space; MemoryRegion *system_memory; @@ -59,7 +62,10 @@ typedef struct MCHPCIState { } MCHPCIState; typedef struct Q35PCIHost { - PCIExpressHost host; + /*< private >*/ + PCIExpressHost parent_obj; + /*< public >*/ + MCHPCIState mch; } Q35PCIHost; diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h index 9786e00..8786531 100644 --- a/include/hw/scsi/scsi.h +++ b/include/hw/scsi/scsi.h @@ -162,8 +162,8 @@ static inline SCSIBus *scsi_bus_from_device(SCSIDevice *d) SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockDriverState *bdrv, int unit, bool removable, int bootindex, - const char *serial); -int scsi_bus_legacy_handle_cmdline(SCSIBus *bus); + const char *serial, Error **errp); +void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, Error **errp); /* * Predefined sense codes diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h index 7c2e316..8c17165 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -23,8 +23,20 @@ typedef struct SysBusDevice SysBusDevice; #define SYS_BUS_DEVICE_GET_CLASS(obj) \ OBJECT_GET_CLASS(SysBusDeviceClass, (obj), TYPE_SYS_BUS_DEVICE) +/** + * SysBusDeviceClass: + * @init: Callback function invoked when the #DeviceState.realized property + * is changed to %true. Deprecated, new types inheriting directly from + * TYPE_SYS_BUS_DEVICE should use #DeviceClass.realize instead, new leaf + * types should consult their respective parent type. + * + * SysBusDeviceClass is not overriding #DeviceClass.realize, so derived + * classes overriding it are not required to invoke its implementation. + */ typedef struct SysBusDeviceClass { + /*< private >*/ DeviceClass parent_class; + /*< public >*/ int (*init)(SysBusDevice *dev); } SysBusDeviceClass; |