From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org,
Alistair Francis <alistair.francis@wdc.com>,
Bernhard Beschow <shentey@gmail.com>,
David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH] softmmu: Provide a clue as to why device tree loading failed
Date: Sun, 16 Jan 2022 12:46:49 +0100 [thread overview]
Message-ID: <20220116114649.40859-1-shentey@gmail.com> (raw)
fdt_open_into() obligingly returns an error code in case the operation
failed. So be obliging as well and use it in the error message.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
softmmu/device_tree.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/softmmu/device_tree.c b/softmmu/device_tree.c
index 3965c834ca..31d1066940 100644
--- a/softmmu/device_tree.c
+++ b/softmmu/device_tree.c
@@ -60,7 +60,8 @@ void *create_device_tree(int *sizep)
}
ret = fdt_open_into(fdt, fdt, *sizep);
if (ret) {
- error_report("Unable to copy device tree in memory");
+ error_report("%s: Unable to copy device tree into memory: %s",
+ __func__, fdt_strerror(ret));
exit(1);
}
@@ -104,7 +105,8 @@ void *load_device_tree(const char *filename_path, int *sizep)
ret = fdt_open_into(fdt, fdt, dt_size);
if (ret) {
- error_report("Unable to copy device tree in memory");
+ error_report("%s: Unable to copy device tree into memory: %s",
+ __func__, fdt_strerror(ret));
goto fail;
}
--
2.34.1
next reply other threads:[~2022-01-16 11:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-16 11:46 Bernhard Beschow [this message]
2022-01-16 21:07 ` [PATCH] softmmu: Provide a clue as to why device tree loading failed Philippe Mathieu-Daudé via
2022-01-17 1:16 ` David Gibson
2022-01-17 22:58 ` Alistair Francis
2022-01-18 11:34 ` Laurent Vivier
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=20220116114649.40859-1-shentey@gmail.com \
--to=shentey@gmail.com \
--cc=alistair.francis@wdc.com \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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).