From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVjsH-0001ga-TC for qemu-devel@nongnu.org; Thu, 03 Apr 2014 11:48:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVjsB-0002Qz-M1 for qemu-devel@nongnu.org; Thu, 03 Apr 2014 11:48:17 -0400 Received: from cantor2.suse.de ([195.135.220.15]:59503 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVjsB-0002Qr-FK for qemu-devel@nongnu.org; Thu, 03 Apr 2014 11:48:11 -0400 Message-ID: <533D82B9.8010007@suse.de> Date: Thu, 03 Apr 2014 17:48:09 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1396533388-12069-1-git-send-email-peter.maydell@linaro.org> <1396533388-12069-2-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1396533388-12069-2-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [for-2.0 1/2] hw/arm/highbank: Don't segfault on unknown CPU names List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: Rob Herring , patches@linaro.org Am 03.04.2014 15:56, schrieb Peter Maydell: > If the user passes an unknown CPU name via the '-cpu' option, exit > with an error message rather than segfaulting. >=20 > Signed-off-by: Peter Maydell > --- > hw/arm/highbank.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c > index f66d57b..03545aa 100644 > --- a/hw/arm/highbank.c > +++ b/hw/arm/highbank.c > @@ -233,6 +233,11 @@ static void calxeda_init(QEMUMachineInitArgs *args= , enum cxmachines machine) > ARMCPU *cpu; > Error *err =3D NULL; > =20 > + if (!oc) { > + fprintf(stderr, "Unable to find CPU definition\n"); Old habits die hard... error_report() please. Otherwise looks good. One side effect of the cpu_arm_init() inlining here is that it didn't get the properties support for -cpu, I note. Regards, Andreas > + exit(1); > + } > + > cpu =3D ARM_CPU(object_new(object_class_get_name(oc))); > =20 > object_property_set_int(OBJECT(cpu), MPCORE_PERIPHBASE, "reset= -cbar", >=20 --=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