[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 54/55] ioapic: Use QOM realize for ioapic
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PULL 54/55] ioapic: Use QOM realize for ioapic |
Date: |
Tue, 23 Jul 2013 01:46:35 +0200 |
From: Hu Tao <address@hidden>
Signed-off-by: Hu Tao <address@hidden>
[AF: Tweaked error message]
Signed-off-by: Andreas Färber <address@hidden>
---
hw/intc/ioapic_common.c | 12 +++++-------
1 file 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;
}
--
1.8.1.4
- [Qemu-devel] [PULL 45/55] pflash_cfi02: Use QOM realize for pflash_cfi02, (continued)
- [Qemu-devel] [PULL 45/55] pflash_cfi02: Use QOM realize for pflash_cfi02, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 42/55] fdc: Use QOM realize for fdc, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 43/55] fdc: Improve error propagation for QOM realize, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 46/55] ahci: Use QOM realize for ahci, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 48/55] scsi/esp: Use QOM realize for scsi esp, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 49/55] megasas: Legacy command line handling fix, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 47/55] fw_cfg: Use QOM realize for fw_cfg, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 52/55] kvm/clock: Use QOM realize for kvmclock, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 51/55] hpet: Use QOM realize for hpet, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 53/55] kvmvapic: Use QOM realize, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 54/55] ioapic: Use QOM realize for ioapic,
Andreas Färber <=
- [Qemu-devel] [PULL 50/55] scsi: Improve error propagation for scsi_bus_legacy_handle_cmdline(), Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 55/55] isa-bus: Drop isabus_bridge_init() since it does nothing, Andreas Färber, 2013/07/22