mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-31 14:23:53 -06:00
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
2 changed files with 15 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue