Take advantage of Andreas's pci-host patchset, add instance_init function to fully implement convert pci-host to QOM.
Signed-off-by: Anthony Liguori <aligu...@us.ibm.com> Signed-off-by: Wanpeng Li <liw...@linux.vnet.ibm.com> --- hw/pci_host.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/hw/pci_host.c b/hw/pci_host.c index 68e328c..ce6b28f 100644 --- a/hw/pci_host.c +++ b/hw/pci_host.c @@ -165,11 +165,20 @@ const MemoryRegionOps pci_host_data_be_ops = { .endianness = DEVICE_BIG_ENDIAN, }; +static void pci_host_initfn(Object *obj) +{ + PCIHostState *s = PCI_HOST_BRIDGE(obj); + + object_property_add_link(obj, "mmio", "memory-region", + (Object **)&s->address_space, NULL); +} + static const TypeInfo pci_host_type_info = { .name = TYPE_PCI_HOST_BRIDGE, .parent = TYPE_SYS_BUS_DEVICE, .abstract = true, .instance_size = sizeof(PCIHostState), + .instance_init = pci_host_initfn, }; static void pci_host_register_types(void) -- 1.7.7.6