Print an error message as done for the r2d machine and exit.

Signed-off-by: Andreas Färber <afaer...@suse.de>
---
 hw/sh4/shix.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/sh4/shix.c b/hw/sh4/shix.c
index c23d4af..f5cfef9 100644
--- a/hw/sh4/shix.c
+++ b/hw/sh4/shix.c
@@ -52,6 +52,10 @@ static void shix_init(QEMUMachineInitArgs *args)
 
     printf("Initializing CPU\n");
     env = cpu_init(cpu_model);
+    if (env == NULL) {
+        fprintf(stderr, "Unable to find CPU definition\n");
+        exit(1);
+    }
 
     /* Allocate memory space */
     printf("Allocating ROM\n");
-- 
1.8.1.4


Reply via email to