qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH for-1.6? 04/14] gumstix: Don't enforce use of -pflas


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

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

diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c
index b8cab10..27117fa 100644
--- a/hw/arm/gumstix.c
+++ b/hw/arm/gumstix.c
@@ -42,6 +42,7 @@
 #include "hw/boards.h"
 #include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
+#include "sysemu/qtest.h"
 
 static const int sector_len = 128 * 1024;
 
@@ -58,7 +59,7 @@ static void connex_init(QEMUMachineInitArgs *args)
     cpu = pxa255_init(address_space_mem, connex_ram);
 
     dinfo = drive_get(IF_PFLASH, 0, 0);
-    if (!dinfo) {
+    if (!dinfo && !qtest_enabled()) {
         fprintf(stderr, "A flash image must be given with the "
                 "'pflash' parameter\n");
         exit(1);
@@ -69,11 +70,14 @@ static void connex_init(QEMUMachineInitArgs *args)
 #else
     be = 0;
 #endif
-    if (!pflash_cfi01_register(0x00000000, NULL, "connext.rom", connex_rom,
-                               dinfo->bdrv, sector_len, connex_rom / 
sector_len,
-                               2, 0, 0, 0, 0, be)) {
-        fprintf(stderr, "qemu: Error registering flash memory.\n");
-        exit(1);
+    if (dinfo) {
+        if (!pflash_cfi01_register(0x00000000, NULL, "connext.rom", connex_rom,
+                                   dinfo->bdrv, sector_len,
+                                   connex_rom / sector_len,
+                                   2, 0, 0, 0, 0, be)) {
+            fprintf(stderr, "qemu: Error registering flash memory.\n");
+            exit(1);
+        }
     }
 
     /* Interrupt line of NIC is connected to GPIO line 36 */
@@ -95,7 +99,7 @@ static void verdex_init(QEMUMachineInitArgs *args)
     cpu = pxa270_init(address_space_mem, verdex_ram, cpu_model ?: "pxa270-c0");
 
     dinfo = drive_get(IF_PFLASH, 0, 0);
-    if (!dinfo) {
+    if (!dinfo && !qtest_enabled()) {
         fprintf(stderr, "A flash image must be given with the "
                 "'pflash' parameter\n");
         exit(1);
@@ -106,11 +110,14 @@ static void verdex_init(QEMUMachineInitArgs *args)
 #else
     be = 0;
 #endif
-    if (!pflash_cfi01_register(0x00000000, NULL, "verdex.rom", verdex_rom,
-                               dinfo->bdrv, sector_len, verdex_rom / 
sector_len,
-                               2, 0, 0, 0, 0, be)) {
-        fprintf(stderr, "qemu: Error registering flash memory.\n");
-        exit(1);
+    if (dinfo) {
+        if (!pflash_cfi01_register(0x00000000, NULL, "verdex.rom", verdex_rom,
+                                   dinfo->bdrv, sector_len,
+                                   verdex_rom / sector_len,
+                                   2, 0, 0, 0, 0, be)) {
+            fprintf(stderr, "qemu: Error registering flash memory.\n");
+            exit(1);
+        }
     }
 
     /* Interrupt line of NIC is connected to GPIO line 99 */
-- 
1.8.1.4




reply via email to

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