From: Bin Meng Date: Fri, 1 May 2020 15:50:54 +0000 (-0700) Subject: riscv: Suppress the error report for QEMU testing with riscv_find_firmware() X-Git-Tag: qemu-xen-4.15.0~159^2~14 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ac5f7246d74eecb1da1e5561d933a3c139c71c78;p=qemu-xen.git 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 Reviewed-by: Anup Patel Message-Id: <1588348254-7241-6-git-send-email-bmeng.cn@gmail.com> Signed-off-by: Alistair Francis --- diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c index 726300a171..da5817d438 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;