diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2014-02-04 15:04:19 +1100 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2014-03-05 03:06:47 +0100 |
commit | 3b66da82cebf3ddd1c2e06233c647369f617a6bc (patch) | |
tree | 3aed2426bf57afa65cda7ba99296cfe0c3d2f149 /hw/ppc/spapr.c | |
parent | 18674b26788a9e47f1157170234e32ece2044367 (diff) |
spapr: print more detailed error message on failed load_elf()
This makes use of new error codes which load_elf() can return and
prints more informative error message.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/ppc/spapr.c')
-rw-r--r-- | hw/ppc/spapr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 851ce4b97a..c9dfc6cb8c 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1306,15 +1306,15 @@ static void ppc_spapr_init(QEMUMachineInitArgs *args) kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL, NULL, &lowaddr, NULL, 1, ELF_MACHINE, 0); - if (kernel_size < 0) { + if (kernel_size == ELF_LOAD_WRONG_ENDIAN) { kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL, NULL, &lowaddr, NULL, 0, ELF_MACHINE, 0); kernel_le = kernel_size > 0; } if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + fprintf(stderr, "qemu: error loading %s: %s\n", + kernel_filename, load_elf_strerror(kernel_size)); exit(1); } |