[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v3 12/12] hw/lm32: print error if cpu model is not fo
From: |
Michael Walle |
Subject: |
[Qemu-devel] [PULL v3 12/12] hw/lm32: print error if cpu model is not found |
Date: |
Thu, 28 Nov 2013 19:43:22 +0100 |
QEMU crashed if a the given cpu_model is not found.
Signed-off-by: Michael Walle <address@hidden>
---
hw/lm32/lm32_boards.c | 10 ++++++++++
hw/lm32/milkymist.c | 5 +++++
2 files changed, 15 insertions(+)
diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c
index c032bb8..5e22e9b 100644
--- a/hw/lm32/lm32_boards.c
+++ b/hw/lm32/lm32_boards.c
@@ -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;
diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c
index 15053c4..baf234c 100644
--- a/hw/lm32/milkymist.c
+++ b/hw/lm32/milkymist.c
@@ -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;
--
1.7.10.4
- [Qemu-devel] [PULL v3 01/12] lm32_sys: increase test case name length limit, (continued)
- [Qemu-devel] [PULL v3 01/12] lm32_sys: increase test case name length limit, Michael Walle, 2013/11/28
- [Qemu-devel] [PULL v3 03/12] milkymist-uart: use qemu_chr_fe_write_all() instead of qemu_chr_fe_write(), Michael Walle, 2013/11/28
- [Qemu-devel] [PULL v3 04/12] lm32_uart/lm32_juart: use qemu_chr_fe_write_all(), Michael Walle, 2013/11/28
- [Qemu-devel] [PULL v3 06/12] target-lm32: kill cpu_abort() calls, Michael Walle, 2013/11/28
- [Qemu-devel] [PULL v3 09/12] lm32_sys: print test result on stderr, Michael Walle, 2013/11/28
- [Qemu-devel] [PULL v3 07/12] target-lm32: move model features to LM32CPU, Michael Walle, 2013/11/28
- [Qemu-devel] [PULL v3 05/12] milkymist-vgafb: swap pixel data in source buffer, Michael Walle, 2013/11/28
- [Qemu-devel] [PULL v3 10/12] lm32_sys: dump cpu state if test case fails, Michael Walle, 2013/11/28
- [Qemu-devel] [PULL v3 11/12] target-lm32: stop VM on illegal or unknown instruction, Michael Walle, 2013/11/28
- [Qemu-devel] [PULL v3 08/12] target-lm32: add breakpoint/watchpoint support, Michael Walle, 2013/11/28
- [Qemu-devel] [PULL v3 12/12] hw/lm32: print error if cpu model is not found,
Michael Walle <=