qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] hw/arm/boot: Report error msg if loading elf/dtb failed
@ 2024-09-03 13:39 Changbin Du via
  2024-09-03 13:52 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 3+ messages in thread
From: Changbin Du via @ 2024-09-03 13:39 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-arm, qemu-devel, Changbin Du, Philippe Mathieu-Daudé

Print errors before exit. Do not exit silently.

Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Changbin Du <changbin.du@huawei.com>

---
v3: use load_elf_strerror() to format errno.
v2: remove msg for arm_load_dtb.
---
 hw/arm/boot.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index d480a7da02cf..6c895e05cbc0 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -839,6 +839,8 @@ static ssize_t arm_load_elf(struct arm_boot_info *info, uint64_t *pentry,
                       1, data_swab, as);
     if (ret <= 0) {
         /* The header loaded but the image didn't */
+        error_report("Couldn't load elf '%s': %s",
+                     info->kernel_filename, load_elf_strerror(ret));
         exit(1);
     }
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-03 16:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-03 13:39 [PATCH v3] hw/arm/boot: Report error msg if loading elf/dtb failed Changbin Du via
2024-09-03 13:52 ` Philippe Mathieu-Daudé
2024-09-03 16:38   ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).