qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH for-1.6? 05/14] z2: Don't enforce use of -pflash for


From: Andreas Färber
Subject: [Qemu-devel] [PATCH for-1.6? 05/14] z2: Don't enforce use of -pflash for qtest
Date: Mon, 29 Jul 2013 19:15:32 +0200

Signed-off-by: Andreas Färber <address@hidden>
---
 hw/arm/z2.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/hw/arm/z2.c b/hw/arm/z2.c
index 07a127b..e32efc0 100644
--- a/hw/arm/z2.c
+++ b/hw/arm/z2.c
@@ -24,6 +24,7 @@
 #include "ui/console.h"
 #include "audio/audio.h"
 #include "exec/address-spaces.h"
+#include "sysemu/qtest.h"
 
 #ifdef DEBUG_Z2
 #define DPRINTF(fmt, ...) \
@@ -323,19 +324,21 @@ static void z2_init(QEMUMachineInitArgs *args)
     be = 0;
 #endif
     dinfo = drive_get(IF_PFLASH, 0, 0);
-    if (!dinfo) {
+    if (!dinfo && !qtest_enabled()) {
         fprintf(stderr, "Flash image must be given with the "
                 "'pflash' parameter\n");
         exit(1);
     }
 
-    if (!pflash_cfi01_register(Z2_FLASH_BASE,
-                               NULL, "z2.flash0", Z2_FLASH_SIZE,
-                               dinfo->bdrv, sector_len,
-                               Z2_FLASH_SIZE / sector_len, 4, 0, 0, 0, 0,
-                               be)) {
-        fprintf(stderr, "qemu: Error registering flash memory.\n");
-        exit(1);
+    if (dinfo) {
+        if (!pflash_cfi01_register(Z2_FLASH_BASE,
+                                   NULL, "z2.flash0", Z2_FLASH_SIZE,
+                                   dinfo->bdrv, sector_len,
+                                   Z2_FLASH_SIZE / sector_len, 4, 0, 0, 0, 0,
+                                   be)) {
+            fprintf(stderr, "qemu: Error registering flash memory.\n");
+            exit(1);
+        }
     }
 
     /* setup keypad */
-- 
1.8.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]