Patchwork [PULL,04/58] puv3: Turn puv3_load_kernel() into a no-op for qtest without -kernel

login
register
mail settings
Submitter Andreas Färber
Date Oct. 8, 2013, 5:44 p.m.
Message ID <1381254296-3203-5-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/281579/
State New
Headers show

Comments

Andreas Färber - Oct. 8, 2013, 5:44 p.m.
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 | 4 ++++
 1 file changed, 4 insertions(+)

Patch

diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c
index a900061..e05cbc1 100644
--- a/hw/unicore32/puv3.c
+++ b/hw/unicore32/puv3.c
@@ -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 */