qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: Rob Herring <rob.herring@linaro.org>, patches@linaro.org
Subject: Re: [Qemu-devel] [for-2.0 1/2] hw/arm/highbank: Don't segfault on unknown CPU names
Date: Thu, 03 Apr 2014 17:48:09 +0200	[thread overview]
Message-ID: <533D82B9.8010007@suse.de> (raw)
In-Reply-To: <1396533388-12069-2-git-send-email-peter.maydell@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.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  hw/arm/highbank.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> 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 = NULL;
>  
> +        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 = ARM_CPU(object_new(object_class_get_name(oc)));
>  
>          object_property_set_int(OBJECT(cpu), MPCORE_PERIPHBASE, "reset-cbar",
> 


-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2014-04-03 15:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-03 13:56 [Qemu-devel] [for-2.0 0/2] A15 board bugfixes Peter Maydell
2014-04-03 13:56 ` [Qemu-devel] [for-2.0 1/2] hw/arm/highbank: Don't segfault on unknown CPU names Peter Maydell
2014-04-03 15:48   ` Andreas Färber [this message]
2014-04-03 13:56 ` [Qemu-devel] [for-2.0 2/2] hw/arm/vexpress, hw/arm/highbank: Don't insist that CPU has reset-cbar property Peter Maydell
2014-04-03 14:25 ` [Qemu-devel] [for-2.0 0/2] A15 board bugfixes Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=533D82B9.8010007@suse.de \
    --to=afaerber@suse.de \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rob.herring@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).