qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v5 3/3] convert pci-host to QOM


From: Wanpeng Li
Subject: [Qemu-devel] [PATCH v5 3/3] convert pci-host to QOM
Date: Thu, 8 Nov 2012 13:36:12 +0800

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 <address@hidden>
Signed-off-by: Wanpeng Li <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]