From patchwork Wed Oct 3 13:28:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 188772 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 A15772C00A2 for ; Wed, 3 Oct 2012 23:48:55 +1000 (EST) Received: from localhost ([::1]:39623 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJP0k-00069L-W5 for incoming@patchwork.ozlabs.org; Wed, 03 Oct 2012 09:29:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJOzx-0004A4-UI for qemu-devel@nongnu.org; Wed, 03 Oct 2012 09:28:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJOzr-0006Zm-Sk for qemu-devel@nongnu.org; Wed, 03 Oct 2012 09:28:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45781) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJOzr-0006ZI-LU for qemu-devel@nongnu.org; Wed, 03 Oct 2012 09:28:19 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q93DSJLv010385 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 3 Oct 2012 09:28:19 -0400 Received: from blackpad.lan.raisama.net (vpn1-7-147.gru2.redhat.com [10.97.7.147]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q93DSI7U013879; Wed, 3 Oct 2012 09:28:18 -0400 Received: by blackpad.lan.raisama.net (Postfix, from userid 500) id F0F12203604; Wed, 3 Oct 2012 10:29:19 -0300 (BRT) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Wed, 3 Oct 2012 10:28:58 -0300 Message-Id: <1349270954-4657-3-git-send-email-ehabkost@redhat.com> In-Reply-To: <1349270954-4657-1-git-send-email-ehabkost@redhat.com> References: <1349270954-4657-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Gleb Natapov , Paolo Bonzini Subject: [Qemu-devel] [RFC 02/18] pc: create PC object on pc_init1() 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 It would be interesting to make the generic machine intialization code create a machine object instead, but changing the machine initialization function signature is a nightmare, so by now I am creating the object inside pc_init1(). The object is not used for anything by now, but it will be used during some steps of the initialization, later. Signed-off-by: Eduardo Habkost --- hw/pc_piix.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/pc_piix.c b/hw/pc_piix.c index fd5898f..28b5f8a 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -148,6 +148,7 @@ static void pc_init1(MemoryRegion *system_memory, MemoryRegion *pci_memory; MemoryRegion *rom_memory; void *fw_cfg = NULL; + PC *pc = PC(object_new(TYPE_PC_MACHINE)); pc_cpus_init(cpu_model); @@ -285,6 +286,8 @@ static void pc_init1(MemoryRegion *system_memory, if (pci_enabled) { pc_pci_device_init(pci_bus); } + + qdev_init_nofail(DEVICE(pc)); } static void pc_init_pci(ram_addr_t ram_size,