From 06f3ed26983a04df74729d748a7b05400d8f3386 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
Date: Tue, 9 Apr 2013 16:51:23 +0200
Subject: [PATCH] shix: Catch CPU initialization errors
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

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

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

diff --git a/hw/sh4/shix.c b/hw/sh4/shix.c
index c23d4afb10..f5cfef9e3b 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");
-- 
2.30.2