puv3: Turn puv3_load_kernel() into a no-op for qtest without -kernel
authorAndreas Färber <afaerber@suse.de>
Mon, 29 Jul 2013 16:43:57 +0000 (18:43 +0200)
committerAndreas Färber <afaerber@suse.de>
Tue, 5 Nov 2013 16:47:28 +0000 (17:47 +0100)
Replacing the assert() with more user-friendly error handling is left
for a follow-up.

Signed-off-by: Andreas Färber <afaerber@suse.de>
hw/unicore32/puv3.c

index a9000617b4207b9e561af5ca6beff0acbfd2cb64..e05cbc131ed93cf6e55a3354dbccf6731b113713 100644 (file)
@@ -17,6 +17,7 @@
 #include "hw/boards.h"
 #include "hw/loader.h"
 #include "hw/i386/pc.h"
+#include "sysemu/qtest.h"
 
 #undef DEBUG_PUV3
 #include "hw/unicore32/puv3.h"
@@ -84,6 +85,9 @@ static void puv3_load_kernel(const char *kernel_filename)
 {
     int size;
 
+    if (kernel_filename == NULL && qtest_enabled()) {
+        return;
+    }
     assert(kernel_filename != NULL);
 
     /* only zImage format supported */