From patchwork Thu Nov 8 05:36:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wanpeng Li X-Patchwork-Id: 197766 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D095E2C007B for ; Thu, 8 Nov 2012 16:36:58 +1100 (EST) Received: from localhost ([::1]:42543 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWKnQ-0002U3-Uv for incoming@patchwork.ozlabs.org; Thu, 08 Nov 2012 00:36:56 -0500 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 d28relay02.in.ibm.com (9.184.220.59) by e28smtp04.in.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 8 Nov 2012 11:06:31 +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 Received: from localhost ([9.123.236.63]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id qA8B6KbK005048; Thu, 8 Nov 2012 22:06:20 +1100 From: Wanpeng Li To: Anthony Liguori Date: Thu, 8 Nov 2012 13:36:12 +0800 Message-Id: <1352352972-2510-4-git-send-email-liwanp@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.5.4 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> x-cbid: 12110805-5564-0000-0000-0000053C0C4C X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 122.248.162.4 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 Subject: [Qemu-devel] [PATCH v5 3/3] convert pci-host to QOM X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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)