[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 025/106] pc: ich9 lpc: make it work with global/co
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v2 025/106] pc: ich9 lpc: make it work with global/compat properties |
Date: |
Wed, 18 Jun 2014 19:17:10 +0300 |
From: Igor Mammedov <address@hidden>
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>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/isa/lpc_ich9.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index 97f69d6..ad43475 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;
}
@@ -641,7 +645,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";
@@ -660,6 +664,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,
};
--
MST
- [Qemu-devel] [PULL v2 007/106] qdev: hotplug for bus-less devices, (continued)
- [Qemu-devel] [PULL v2 007/106] qdev: hotplug for bus-less devices, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 009/106] pc: implement pc-dimm device abstraction, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 011/106] pc-dimm: do not allow setting an in-use memdev, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 010/106] memory: add memory_region_is_mapped() API, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 012/106] pc: initialize memory hotplug address space, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 014/106] pc: add 'etc/reserved-memory-end' fw_cfg interface for SeaBIOS, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 018/106] pc-dimm: add busy slot check and slot auto-allocation, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 021/106] trace: add acpi memory hotplug IO region events, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 022/106] trace: pc: add PC_DIMM slot & address allocation, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 023/106] acpi:piix4: allow plug/unlug callbacks handle not only PCI devices, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 025/106] pc: ich9 lpc: make it work with global/compat properties,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v2 024/106] acpi:piix4: add memory hotplug handling, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 026/106] acpi:ich9: add memory hotplug handling, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] per-machine vs per-qemu-version compat_props macros (was Re: acpi:ich9: add memory hotplug handling), Eduardo Habkost, 2014/06/24
- Re: [Qemu-devel] per-machine vs per-qemu-version compat_props macros (was Re: acpi:ich9: add memory hotplug handling), Peter Maydell, 2014/06/24
- Re: [Qemu-devel] per-machine vs per-qemu-version compat_props macros (was Re: acpi:ich9: add memory hotplug handling), Eduardo Habkost, 2014/06/24
- Re: [Qemu-devel] per-machine vs per-qemu-version compat_props macros (was Re: acpi:ich9: add memory hotplug handling), Marcel Apfelbaum, 2014/06/24
- Re: [Qemu-devel] per-machine vs per-qemu-version compat_props macros (was Re: acpi:ich9: add memory hotplug handling), Peter Maydell, 2014/06/24
- Re: [Qemu-devel] per-machine vs per-qemu-version compat_props macros (was Re: acpi:ich9: add memory hotplug handling), Eduardo Habkost, 2014/06/24
- Re: [Qemu-devel] per-machine vs per-qemu-version compat_props macros (was Re: acpi:ich9: add memory hotplug handling), Eduardo Habkost, 2014/06/24
[Qemu-devel] [PULL v2 027/106] pc: migrate piix4 & ich9 MemHotplugState, Michael S. Tsirkin, 2014/06/18