]> git.proxmox.com Git - mirror_qemu.git/commitdiff
riscv: Suppress the error report for QEMU testing with riscv_find_firmware()
authorBin Meng <bin.meng@windriver.com>
Fri, 1 May 2020 15:50:54 +0000 (08:50 -0700)
committerAlistair Francis <alistair.francis@wdc.com>
Wed, 3 Jun 2020 16:11:51 +0000 (09:11 -0700)
We only ship plain binary bios images in the QEMU source. With Spike
machine that uses ELF images as the default bios, running QEMU test
will complain hence let's suppress the error report for QEMU testing.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Message-Id: <1588348254-7241-6-git-send-email-bmeng.cn@gmail.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
hw/riscv/boot.c

index 726300a171e09e6c7096dc540311c2da33bf6012..da5817d43895ac5282b96091b373cf7ba473c528 100644 (file)
@@ -88,9 +88,17 @@ char *riscv_find_firmware(const char *firmware_filename)
 
     filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, firmware_filename);
     if (filename == NULL) {
-        error_report("Unable to load the RISC-V firmware \"%s\"",
-                     firmware_filename);
-        exit(1);
+        if (!qtest_enabled()) {
+            /*
+             * We only ship plain binary bios images in the QEMU source.
+             * With Spike machine that uses ELF images as the default bios,
+             * running QEMU test will complain hence let's suppress the error
+             * report for QEMU testing.
+             */
+            error_report("Unable to load the RISC-V firmware \"%s\"",
+                         firmware_filename);
+            exit(1);
+        }
     }
 
     return filename;