From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWKnB-0002L2-GH for qemu-devel@nongnu.org; Thu, 08 Nov 2012 00:36:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TWKnA-0003rE-DI for qemu-devel@nongnu.org; Thu, 08 Nov 2012 00:36:41 -0500 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:60959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWKn9-0003qm-AY for qemu-devel@nongnu.org; Thu, 08 Nov 2012 00:36:40 -0500 Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 8 Nov 2012 11:06:33 +0530 Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qA85aUSv19005592 for ; Thu, 8 Nov 2012 11:06:30 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qA8B6L4s005074 for ; Thu, 8 Nov 2012 22:06:21 +1100 From: Wanpeng Li Date: Thu, 8 Nov 2012 13:36:12 +0800 Message-Id: <1352352972-2510-4-git-send-email-liwanp@linux.vnet.ibm.com> In-Reply-To: <1352352972-2510-1-git-send-email-liwanp@linux.vnet.ibm.com> References: <1352352972-2510-1-git-send-email-liwanp@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v5 3/3] convert pci-host to QOM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Ram Pai , "Michael S. Tsirkin" , Jan Kiszka , qemu-devel@nongnu.org, Liu Ping Fan , Blue Swirl , Stefan Weil , Avi Kivity , Paolo Bonzini , Wanpeng Li 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 Signed-off-by: Wanpeng Li --- 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