From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vlbnw-0006Uj-Gk for qemu-devel@nongnu.org; Wed, 27 Nov 2013 04:53:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vlbnq-0000fY-C0 for qemu-devel@nongnu.org; Wed, 27 Nov 2013 04:53:08 -0500 Received: from cantor2.suse.de ([195.135.220.15]:37586 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vlbnq-0000fQ-28 for qemu-devel@nongnu.org; Wed, 27 Nov 2013 04:53:02 -0500 Message-ID: <5295C0FA.9050109@suse.de> Date: Wed, 27 Nov 2013 10:52:58 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH arm-devs v1 3/6] arm/highbank: Use object_new() rather than cpu_arm_init() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: Peter Maydell , QEMU Developers , Mark Langsdorf Am 27.11.2013 10:10, schrieb Peter Maydell: > On 27 November 2013 09:02, Peter Crosthwaite > wrote: >> To allow the machine model to set device properties before CPU >> realization. >> >> Signed-off-by: Peter Crosthwaite >> --- >> >> hw/arm/highbank.c | 13 ++++++++++--- >> 1 file changed, 10 insertions(+), 3 deletions(-) >> >> diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c >> index fe98ef1..70831ba 100644 >> --- a/hw/arm/highbank.c >> +++ b/hw/arm/highbank.c >> @@ -228,11 +228,18 @@ static void calxeda_init(QEMUMachineInitArgs *ar= gs, enum cxmachines machine) >> } >> } >> >> + cpu_model =3D g_strdup_printf("%s-" TYPE_ARM_CPU, cpu_model); >> + >=20 > Please use cpu_class_by_name() rather than hand-constructing > the classname. (see also the hw/arm/virt.c code I posted the other > day, which needs to set a property for other reasons.) >=20 >> for (n =3D 0; n < smp_cpus; n++) { >> ARMCPU *cpu; >> - cpu =3D cpu_arm_init(cpu_model); >> - if (cpu =3D=3D NULL) { >> - fprintf(stderr, "Unable to find CPU definition\n"); >> + Error *err =3D NULL; >> + >> + cpu =3D ARM_CPU(object_new(cpu_model)); >> + g_free((void *)cpu_model); >> + >> + object_property_set_bool(OBJECT(cpu), true, "realized", &err)= ; >> + if (err) { >> + fprintf(stderr, "%s\n", error_get_pretty(err)); And use of error_report() (without \n) will be appreciated. :) Cheers, Andreas >> exit(1); >> } >=20 > thanks > -- PMM --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg