From 3ee3122c0d2614297890ded2017655fc2a139af6 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Thu, 27 Jul 2017 01:56:13 +0200 Subject: hw/mips: load_elf_strerror to report kernel loading failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Emulated MIPS boards bail out with a simple "could not load kernel" when a kernel could not be load, without specifying the underlying reason. Fix that by calling load_elf_strerror. At the same time use error_report to report the error instead of fprintf. Signed-off-by: Aurelien Jarno Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Yongbok Kim --- hw/mips/mips_mipssim.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'hw/mips/mips_mipssim.c') diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c index 6990b1b0dd..07fc4c2300 100644 --- a/hw/mips/mips_mipssim.c +++ b/hw/mips/mips_mipssim.c @@ -78,8 +78,9 @@ static int64_t load_kernel(void) if ((entry & ~0x7fffffffULL) == 0x80000000) entry = (int32_t)entry; } else { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - loaderparams.kernel_filename); + error_report("qemu: could not load kernel '%s': %s", + loaderparams.kernel_filename, + load_elf_strerror(kernel_size)); exit(1); } -- cgit v1.2.3