hw/lm32: print error if cpu model is not found
QEMU crashed if a the given cpu_model is not found. Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
667ff9612b
commit
f41152bd9d
@ -101,6 +101,11 @@ static void lm32_evr_init(QEMUMachineInitArgs *args)
|
||||
cpu_model = "lm32-full";
|
||||
}
|
||||
cpu = cpu_lm32_init(cpu_model);
|
||||
if (cpu == NULL) {
|
||||
fprintf(stderr, "qemu: unable to find CPU '%s'\n", cpu_model);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
env = &cpu->env;
|
||||
reset_info->cpu = cpu;
|
||||
|
||||
@ -198,6 +203,11 @@ static void lm32_uclinux_init(QEMUMachineInitArgs *args)
|
||||
cpu_model = "lm32-full";
|
||||
}
|
||||
cpu = cpu_lm32_init(cpu_model);
|
||||
if (cpu == NULL) {
|
||||
fprintf(stderr, "qemu: unable to find CPU '%s'\n", cpu_model);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
env = &cpu->env;
|
||||
reset_info->cpu = cpu;
|
||||
|
||||
|
@ -108,6 +108,11 @@ milkymist_init(QEMUMachineInitArgs *args)
|
||||
cpu_model = "lm32-full";
|
||||
}
|
||||
cpu = cpu_lm32_init(cpu_model);
|
||||
if (cpu == NULL) {
|
||||
fprintf(stderr, "qemu: unable to find CPU '%s'\n", cpu_model);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
env = &cpu->env;
|
||||
reset_info->cpu = cpu;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user