diff options
author | Bin Meng <bin.meng@windriver.com> | 2020-05-01 08:50:54 -0700 |
---|---|---|
committer | Alistair Francis <alistair.francis@wdc.com> | 2020-06-03 09:11:51 -0700 |
commit | ac5f7246d74eecb1da1e5561d933a3c139c71c78 (patch) | |
tree | df354235418ab82082147079f83bb20f403eef3b | |
parent | 5cc7a54c2e91d82cb6a52e4921325c511fd90712 (diff) | |
download | qemu-ac5f7246d74eecb1da1e5561d933a3c139c71c78.zip qemu-ac5f7246d74eecb1da1e5561d933a3c139c71c78.tar.gz qemu-ac5f7246d74eecb1da1e5561d933a3c139c71c78.tar.bz2 |
riscv: Suppress the error report for QEMU testing with riscv_find_firmware()
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>
-rw-r--r-- | hw/riscv/boot.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c index 726300a..da5817d 100644 --- a/hw/riscv/boot.c +++ b/hw/riscv/boot.c @@ -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; |