[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 25/33] pc: ich9 lpc: make it work with global/com
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH v4 25/33] pc: ich9 lpc: make it work with global/compat properties |
Date: |
Mon, 2 Jun 2014 15:25:21 +0200 |
Propeties of object should be available after its instances_init()
callback is finished and not added in PCIDeviceClass.init which is
roughly corresponds to realize() method.
Moving properties adding into instances_init will fix missing
property error when global/compat property mechanism is used.
Signed-off-by: Igor Mammedov <address@hidden>
Acked-by: Peter Crosthwaite <address@hidden>
---
hw/isa/lpc_ich9.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index 51ce12d..46de3b6 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -563,7 +563,14 @@ static void ich9_lpc_add_properties(ICH9LPCState *lpc)
ich9_pm_add_properties(OBJECT(lpc), &lpc->pm, NULL);
}
-static int ich9_lpc_initfn(PCIDevice *d)
+static void ich9_lpc_initfn(Object *obj)
+{
+ ICH9LPCState *lpc = ICH9_LPC_DEVICE(obj);
+
+ ich9_lpc_add_properties(lpc);
+}
+
+static int ich9_lpc_init(PCIDevice *d)
{
ICH9LPCState *lpc = ICH9_LPC_DEVICE(d);
ISABus *isa_bus;
@@ -589,9 +596,6 @@ static int ich9_lpc_initfn(PCIDevice *d)
memory_region_add_subregion_overlap(pci_address_space_io(d),
ICH9_RST_CNT_IOPORT, &lpc->rst_cnt_mem,
1);
-
- ich9_lpc_add_properties(lpc);
-
return 0;
}
@@ -642,7 +646,7 @@ static void ich9_lpc_class_init(ObjectClass *klass, void
*data)
set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
dc->reset = ich9_lpc_reset;
- k->init = ich9_lpc_initfn;
+ k->init = ich9_lpc_init;
dc->vmsd = &vmstate_ich9_lpc;
k->config_write = ich9_lpc_config_write;
dc->desc = "ICH9 LPC bridge";
@@ -661,6 +665,7 @@ static const TypeInfo ich9_lpc_info = {
.name = TYPE_ICH9_LPC_DEVICE,
.parent = TYPE_PCI_DEVICE,
.instance_size = sizeof(struct ICH9LPCState),
+ .instance_init = ich9_lpc_initfn,
.class_init = ich9_lpc_class_init,
};
--
1.7.1
- [Qemu-devel] [PATCH v4 14/33] pc: add 'etc/reserved-memory-end' fw_cfg interface for SeaBIOS, (continued)
- [Qemu-devel] [PATCH v4 14/33] pc: add 'etc/reserved-memory-end' fw_cfg interface for SeaBIOS, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 15/33] pc: exit QEMU if compat machine doesn't support memory hotlpug, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 17/33] pc-dimm: add busy address check and address auto-allocation, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 16/33] pc: add memory hotplug handler to PC_MACHINE, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 18/33] pc-dimm: add busy slot check and slot auto-allocation, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 19/33] acpi: rename cpu_hotplug_defs.h to pc-hotplug.h, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 20/33] acpi: memory hotplug ACPI hardware implementation, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 21/33] trace: add acpi memory hotplug IO region events, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 23/33] acpi:piix4: allow plug/unlug callbacks handle not only PCI devices, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 22/33] trace: pc: add PC_DIMM slot & address allocation, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 25/33] pc: ich9 lpc: make it work with global/compat properties,
Igor Mammedov <=
- [Qemu-devel] [PATCH v4 24/33] acpi:piix4: add memory hotplug handling, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 26/33] acpi:ich9: add memory hotplug handling, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 27/33] pc: migrate piix4 & ich9 MemHotplugState, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 30/33] pc: ACPI BIOS: implement memory hotplug interface, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 28/33] pc: add acpi-device link to PCMachineState, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 31/33] pc: add "hotplug-memory-region-size" property to PC_MACHINE, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 32/33] pc: ACPI BIOS: reserve SRAT entry for hotplug mem hole, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 29/33] pc: propagate memory hotplug event to ACPI device, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 33/33] pc: ACPI BIOS: make GPE.3 handle memory hotplug event on PIIX and Q35 machines, Igor Mammedov, 2014/06/02