From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rm4l1-0006JU-TC for qemu-devel@nongnu.org; Sat, 14 Jan 2012 09:39:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rm4l0-0003WV-MQ for qemu-devel@nongnu.org; Sat, 14 Jan 2012 09:38:59 -0500 Received: from cantor2.suse.de ([195.135.220.15]:34425 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rm4l0-0003Tr-BW for qemu-devel@nongnu.org; Sat, 14 Jan 2012 09:38:58 -0500 Message-ID: <4F119311.4080204@suse.de> Date: Sat, 14 Jan 2012 15:37:05 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <4F117F49.1090208@web.de> In-Reply-To: <4F117F49.1090208@web.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] isapc: Fix segfault during initialization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Anthony Liguori , qemu-devel Am 14.01.2012 14:12, schrieb Jan Kiszka: > From: Jan Kiszka >=20 > Linking the RTC device state to the PIIX does not belong into the > common path that is shared with the isapc. QEMU crashes otherwise. Doesn't that indicate a missing NULL-check or something in qdev_property_add_child() that should be fixed, too? Andreas >=20 > Signed-off-by: Jan Kiszka > --- > hw/pc_piix.c | 22 +++++++++++----------- > 1 files changed, 11 insertions(+), 11 deletions(-) >=20 > 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] =3D qdev_get_child_bus(&dev->qdev, "ide.0"); > idebus[1] =3D 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 creat= e the > + * PIIX3 deep in the recess of the i440fx creation too and the= n 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", NUL= L), > + "rtc", (DeviceState *)rtc_state, NULL)= ; > } else { > for(i =3D 0; i < MAX_IDE_BUS; i++) { > ISADevice *dev; > @@ -211,17 +222,6 @@ static void pc_init1(MemoryRegion *system_memory, > } > } > =20 > - /* 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 DeviceS= tate. > - * > - * For now, let's "fix" this by making judicious use of paths. Th= is 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); > =20 > pc_cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device, --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg