From: Changbin Du via <qemu-devel@nongnu.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org,
"Changbin Du" <changbin.du@huawei.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH v3] hw/arm/boot: Report error msg if loading elf/dtb failed
Date: Tue, 3 Sep 2024 21:39:40 +0800 [thread overview]
Message-ID: <20240903133940.3447430-1-changbin.du@huawei.com> (raw)
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
next reply other threads:[~2024-09-03 14:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-03 13:39 Changbin Du via [this message]
2024-09-03 13:52 ` [PATCH v3] hw/arm/boot: Report error msg if loading elf/dtb failed Philippe Mathieu-Daudé
2024-09-03 16:38 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240903133940.3447430-1-changbin.du@huawei.com \
--to=qemu-devel@nongnu.org \
--cc=changbin.du@huawei.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).