From mboxrd@z Thu Jan 1 00:00:00 1970 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) Message-ID: <4F117F49.1090208@web.de> Date: Sat, 14 Jan 2012 14:12:41 +0100 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] isapc: Fix segfault during initialization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel 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, -- 1.7.3.4