[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 24/26] ioapic: use realize for ioapic
From: |
Hu Tao |
Subject: |
[Qemu-devel] [PATCH 24/26] ioapic: use realize for ioapic |
Date: |
Sat, 22 Jun 2013 16:50:36 +0800 |
Cc: Paolo Bonzini <address@hidden>
Cc: "Andreas Färber" <address@hidden>
Cc: Anthony Liguori <address@hidden>
Cc: Igor Mammedov <address@hidden>
Signed-off-by: Hu Tao <address@hidden>
---
hw/intc/ioapic_common.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/hw/intc/ioapic_common.c b/hw/intc/ioapic_common.c
index 5c5bb3c..6077024 100644
--- a/hw/intc/ioapic_common.c
+++ b/hw/intc/ioapic_common.c
@@ -57,14 +57,15 @@ 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, "invalid ioapic number: %d", ioapic_no);
+ return;
}
info = IOAPIC_COMMON_GET_CLASS(s);
@@ -72,8 +73,6 @@ static int ioapic_init_common(SysBusDevice *dev)
sysbus_init_mmio(&s->busdev, &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.3.1
- [Qemu-devel] [PATCH 18/26] scsi esp: QOM'ify some more, (continued)
- [Qemu-devel] [PATCH 18/26] scsi esp: QOM'ify some more, Hu Tao, 2013/06/22
- [Qemu-devel] [PATCH 22/26] kvmclock: QOM'ify some more, Hu Tao, 2013/06/22
- [Qemu-devel] [PATCH 25/26] isa bus: use realize for isa bus, Hu Tao, 2013/06/22
- [Qemu-devel] [PATCH 23/26] kvmvapic realize, Hu Tao, 2013/06/22
- [Qemu-devel] [PATCH 26/26] ehci: use realize for ehci, Hu Tao, 2013/06/22
- [Qemu-devel] [PATCH 20/26] hpet: QOM'ify some more, Hu Tao, 2013/06/22
- [Qemu-devel] [PATCH 24/26] ioapic: use realize for ioapic,
Hu Tao <=
- Re: [Qemu-devel] [PATCH 00/26] use realizefn for SysBusDevice, part 1, Andreas Färber, 2013/06/30