qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: "qemu-ppc@nongnu.org list:PowerPC" <qemu-ppc@nongnu.org>
Cc: "Blue Swirl" <blauwirbel@gmail.com>,
	"Anthony Liguori" <aliguori@us.ibm.com>,
	"qemu-devel Developers" <qemu-devel@nongnu.org>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PULL 09/18] ppc405_boards: Don't enforce presence of firmware for qtest
Date: Mon,  2 Sep 2013 10:11:24 +0200	[thread overview]
Message-ID: <1378109493-41076-10-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1378109493-41076-1-git-send-email-agraf@suse.de>

From: Andreas Färber <afaerber@suse.de>

Adopt error_report() while at it.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/ppc/ppc405_boards.c | 35 ++++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index 807ada0..75b2177 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -27,9 +27,11 @@
 #include "hw/timer/m48t59.h"
 #include "hw/block/flash.h"
 #include "sysemu/sysemu.h"
+#include "sysemu/qtest.h"
 #include "block/block.h"
 #include "hw/boards.h"
 #include "qemu/log.h"
+#include "qemu/error-report.h"
 #include "hw/loader.h"
 #include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
@@ -252,17 +254,20 @@ static void ref405ep_init(QEMUMachineInitArgs *args)
         if (filename) {
             bios_size = load_image(filename, memory_region_get_ram_ptr(bios));
             g_free(filename);
+            if (bios_size < 0 || bios_size > BIOS_SIZE) {
+                error_report("Could not load PowerPC BIOS '%s'", bios_name);
+                exit(1);
+            }
+            bios_size = (bios_size + 0xfff) & ~0xfff;
+            memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios);
+        } else if (!qtest_enabled() || kernel_filename != NULL) {
+            error_report("Could not load PowerPC BIOS '%s'", bios_name);
+            exit(1);
         } else {
+            /* Avoid an uninitialized variable warning */
             bios_size = -1;
         }
-        if (bios_size < 0 || bios_size > BIOS_SIZE) {
-            fprintf(stderr, "qemu: could not load PowerPC bios '%s'\n",
-                    bios_name);
-            exit(1);
-        }
-        bios_size = (bios_size + 0xfff) & ~0xfff;
         memory_region_set_readonly(bios, true);
-        memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios);
     }
     /* Register FPGA */
 #ifdef DEBUG_BOARD_INIT
@@ -569,17 +574,17 @@ static void taihu_405ep_init(QEMUMachineInitArgs *args)
         if (filename) {
             bios_size = load_image(filename, memory_region_get_ram_ptr(bios));
             g_free(filename);
-        } else {
-            bios_size = -1;
-        }
-        if (bios_size < 0 || bios_size > BIOS_SIZE) {
-            fprintf(stderr, "qemu: could not load PowerPC bios '%s'\n",
-                    bios_name);
+            if (bios_size < 0 || bios_size > BIOS_SIZE) {
+                error_report("Could not load PowerPC BIOS '%s'", bios_name);
+                exit(1);
+            }
+            bios_size = (bios_size + 0xfff) & ~0xfff;
+            memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios);
+        } else if (!qtest_enabled()) {
+            error_report("Could not load PowerPC BIOS '%s'", bios_name);
             exit(1);
         }
-        bios_size = (bios_size + 0xfff) & ~0xfff;
         memory_region_set_readonly(bios, true);
-        memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios);
     }
     /* Register Linux flash */
     dinfo = drive_get(IF_PFLASH, 0, fl_idx);
-- 
1.8.1.4

  parent reply	other threads:[~2013-09-02  8:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-02  8:11 [Qemu-devel] [PULL 00/18] ppc patch queue 2013-09-02 Alexander Graf
2013-09-02  8:11 ` [Qemu-devel] [PULL 01/18] PPC: E500: Generate device tree on reset Alexander Graf
2013-09-02  8:11 ` [Qemu-devel] [PULL 02/18] pseries: Fix stalls on hypervisor virtual console Alexander Graf
2013-09-02  8:11 ` [Qemu-devel] [PULL 03/18] target-ppc: USE LPCR_ILE to control exception endian on POWER7 Alexander Graf
2013-09-02  8:11 ` [Qemu-devel] [PULL 04/18] target-ppc: POWER7 supports the MSR_LE bit Alexander Graf
2013-09-02  8:11 ` [Qemu-devel] [PULL 05/18] disas/ppc.c: Fix little endian disassembly Alexander Graf
2013-09-02  8:11 ` [Qemu-devel] [PULL 06/18] ppc: virtex_ml507: QEMU_OPTION_dtb support for this machine Alexander Graf
2013-09-02  8:11 ` [Qemu-devel] [PULL 07/18] ppc405_boards: Disable debug output Alexander Graf
2013-09-02  8:11 ` [Qemu-devel] [PULL 08/18] ppc405_uc: " Alexander Graf
2013-09-02  8:11 ` Alexander Graf [this message]
2013-09-02  8:11 ` [Qemu-devel] [PULL 10/18] target-ppc: fix bit extraction for FPBF and FPL Alexander Graf
2013-09-02  8:11 ` [Qemu-devel] [PULL 11/18] spapr-pci: fix config space access to support bridges Alexander Graf
2013-09-02  8:11 ` [Qemu-devel] [PULL 12/18] target-ppc: Use #define instead of opencoding SLB valid bit Alexander Graf
2013-09-02  8:11 ` [Qemu-devel] [PULL 13/18] spapr-pci: rework MSI/MSIX Alexander Graf
2013-09-02  8:11 ` [Qemu-devel] [PULL 14/18] xics: move registration of global state to realize() Alexander Graf
2013-09-02  8:11 ` [Qemu-devel] [PULL 15/18] pseries: Add H_SET_MODE hcall to change guest exception endianness Alexander Graf
2013-09-02  8:11 ` [Qemu-devel] [PULL 16/18] PPC: KVM: Compile fix for qemu_notify_event Alexander Graf
2013-09-02  8:11 ` [Qemu-devel] [PULL 17/18] spapr: add "stop-self" RTAS call required to support hot CPU unplug Alexander Graf
2013-09-02  8:11 ` [Qemu-devel] [PULL 18/18] PPC: spapr: iommu: rework traces Alexander Graf
2013-09-03  6:13 ` [Qemu-devel] [PULL 00/18] ppc patch queue 2013-09-02 Aurelien Jarno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1378109493-41076-10-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=aurelien@aurel32.net \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).