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 <[email protected]>
> ---
>  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 via email to