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 /hw/intc | |
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 'hw/intc')
-rw-r--r-- | hw/intc/ioapic_common.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/hw/intc/ioapic_common.c b/hw/intc/ioapic_common.c index 5c5bb3c..6b705c1 100644 --- a/hw/intc/ioapic_common.c +++ b/hw/intc/ioapic_common.c @@ -57,23 +57,22 @@ static int ioapic_dispatch_post_load(void *opaque, int version_id) return 0; } -static int ioapic_init_common(SysBusDevice *dev) +static void ioapic_common_realize(DeviceState *dev, Error **errp) { IOAPICCommonState *s = IOAPIC_COMMON(dev); IOAPICCommonClass *info; static int ioapic_no; if (ioapic_no >= MAX_IOAPICS) { - return -1; + error_setg(errp, "Only %d ioapics allowed", MAX_IOAPICS); + return; } info = IOAPIC_COMMON_GET_CLASS(s); info->init(s, ioapic_no); - sysbus_init_mmio(&s->busdev, &s->io_memory); + sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->io_memory); ioapic_no++; - - return 0; } static const VMStateDescription vmstate_ioapic_common = { @@ -95,10 +94,9 @@ static const VMStateDescription vmstate_ioapic_common = { static void ioapic_common_class_init(ObjectClass *klass, void *data) { - SysBusDeviceClass *sc = SYS_BUS_DEVICE_CLASS(klass); DeviceClass *dc = DEVICE_CLASS(klass); - sc->init = ioapic_init_common; + dc->realize = ioapic_common_realize; dc->vmsd = &vmstate_ioapic_common; dc->no_user = 1; } |