]> git.proxmox.com Git - qemu.git/commitdiff
z2: Don't enforce use of -pflash for qtest
authorAndreas Färber <afaerber@suse.de>
Mon, 29 Jul 2013 15:15:55 +0000 (17:15 +0200)
committerAndreas Färber <afaerber@suse.de>
Tue, 5 Nov 2013 16:47:28 +0000 (17:47 +0100)
Signed-off-by: Andreas Färber <afaerber@suse.de>
hw/arm/z2.c

index a00fcc042d48af80a2c26ad44a7c3fe03fd8b832..d52c5019b30525d78bf007c7fbd43872405220e3 100644 (file)
@@ -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,7 +324,7 @@ 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);
@@ -331,7 +332,7 @@ static void z2_init(QEMUMachineInitArgs *args)
 
     if (!pflash_cfi01_register(Z2_FLASH_BASE,
                                NULL, "z2.flash0", Z2_FLASH_SIZE,
-                               dinfo->bdrv, sector_len,
+                               dinfo ? dinfo->bdrv : NULL, sector_len,
                                Z2_FLASH_SIZE / sector_len, 4, 0, 0, 0, 0,
                                be)) {
         fprintf(stderr, "qemu: Error registering flash memory.\n");