From patchwork Sat Jan 14 13:12:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 136078 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 056B0B6F62 for ; Sun, 15 Jan 2012 00:12:54 +1100 (EST) Received: from localhost ([::1]:36401 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rm3Pf-0002Y8-MA for incoming@patchwork.ozlabs.org; Sat, 14 Jan 2012 08:12:51 -0500 Received: from eggs.gnu.org ([140.186.70.92]:39145) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rm3Pa-0002Y2-Mm for qemu-devel@nongnu.org; Sat, 14 Jan 2012 08:12:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rm3PZ-0000et-CV for qemu-devel@nongnu.org; Sat, 14 Jan 2012 08:12:46 -0500 Received: from fmmailgate03.web.de ([217.72.192.234]:55111) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rm3PZ-0000en-4R for qemu-devel@nongnu.org; Sat, 14 Jan 2012 08:12:45 -0500 Received: from moweb001.kundenserver.de (moweb001.kundenserver.de [172.19.20.114]) by fmmailgate03.web.de (Postfix) with ESMTP id B1F3E1AFB3FB8 for ; Sat, 14 Jan 2012 14:12:43 +0100 (CET) Received: from mchn199C.mchp.siemens.de ([95.157.56.37]) by smtp.web.de (mrweb002) with ESMTPA (Nemesis) id 0MDxWR-1Rtxe11kpr-00H5fx; Sat, 14 Jan 2012 14:12:42 +0100 Message-ID: <4F117F49.1090208@web.de> Date: Sat, 14 Jan 2012 14:12:41 +0100 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Anthony Liguori X-Enigmail-Version: 1.3.4 X-Provags-ID: V02:K0:ECDJHie4Yv+AmGK4EiJlDO5YYsAIjM0rwIU4LiTXzbP WeMemWMcFSwOumhIcLZuT4QemcFHEWIux4ZrJQ+RS8OcgxDUGU xd8Cxzixw/itRd9qlpW4VlsHciMc9WBP37wXu87EkNLlMn950h k1FR+SJnuMB4VkVGheroWJkJCG6rIe8C34SATcyFxQa7Ksmf61 YtkOK3SRRHkcFCRidClUw== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 217.72.192.234 Cc: qemu-devel Subject: [Qemu-devel] [PATCH] isapc: Fix segfault during initialization 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 From: Jan Kiszka Linking the RTC device state to the PIIX does not belong into the common path that is shared with the isapc. QEMU crashes otherwise. Signed-off-by: Jan Kiszka --- hw/pc_piix.c | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/pc_piix.c b/hw/pc_piix.c index b70431f..3aea3cc 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -201,6 +201,17 @@ static void pc_init1(MemoryRegion *system_memory, } idebus[0] = qdev_get_child_bus(&dev->qdev, "ide.0"); idebus[1] = qdev_get_child_bus(&dev->qdev, "ide.1"); + + /* FIXME there's some major spaghetti here. Somehow we create the + * devices on the PIIX before we actually create it. We create the + * PIIX3 deep in the recess of the i440fx creation too and then lose + * the DeviceState. + * + * For now, let's "fix" this by making judicious use of paths. This + * is not generally the right way to do this. + */ + qdev_property_add_child(qdev_resolve_path("/i440fx/piix3", NULL), + "rtc", (DeviceState *)rtc_state, NULL); } else { for(i = 0; i < MAX_IDE_BUS; i++) { ISADevice *dev; @@ -211,17 +222,6 @@ static void pc_init1(MemoryRegion *system_memory, } } - /* FIXME there's some major spaghetti here. Somehow we create the devices - * on the PIIX before we actually create it. We create the PIIX3 deep in - * the recess of the i440fx creation too and then lose the DeviceState. - * - * For now, let's "fix" this by making judicious use of paths. This is not - * generally the right way to do this. - */ - - qdev_property_add_child(qdev_resolve_path("/i440fx/piix3", NULL), - "rtc", (DeviceState *)rtc_state, NULL); - audio_init(isa_bus, pci_enabled ? pci_bus : NULL); pc_cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device,