* [PATCH] softmmu: Provide a clue as to why device tree loading failed
@ 2022-01-16 11:46 Bernhard Beschow
2022-01-16 21:07 ` Philippe Mathieu-Daudé via
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Bernhard Beschow @ 2022-01-16 11:46 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Alistair Francis, Bernhard Beschow, David Gibson
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] softmmu: Provide a clue as to why device tree loading failed
2022-01-16 11:46 [PATCH] softmmu: Provide a clue as to why device tree loading failed Bernhard Beschow
@ 2022-01-16 21:07 ` Philippe Mathieu-Daudé via
2022-01-17 1:16 ` David Gibson
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-01-16 21:07 UTC (permalink / raw)
To: Bernhard Beschow, qemu-devel; +Cc: qemu-trivial, Alistair Francis, David Gibson
On 16/1/22 12:46, Bernhard Beschow wrote:
> 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(-)
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] softmmu: Provide a clue as to why device tree loading failed
2022-01-16 11:46 [PATCH] softmmu: Provide a clue as to why device tree loading failed Bernhard Beschow
2022-01-16 21:07 ` 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
3 siblings, 0 replies; 5+ messages in thread
From: David Gibson @ 2022-01-17 1:16 UTC (permalink / raw)
To: Bernhard Beschow; +Cc: qemu-trivial, Alistair Francis, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1544 bytes --]
On Sun, Jan 16, 2022 at 12:46:49PM +0100, Bernhard Beschow wrote:
> 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>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> 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;
> }
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] softmmu: Provide a clue as to why device tree loading failed
2022-01-16 11:46 [PATCH] softmmu: Provide a clue as to why device tree loading failed Bernhard Beschow
2022-01-16 21:07 ` 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
3 siblings, 0 replies; 5+ messages in thread
From: Alistair Francis @ 2022-01-17 22:58 UTC (permalink / raw)
To: Bernhard Beschow
Cc: QEMU Trivial, Alistair Francis, qemu-devel@nongnu.org Developers,
David Gibson
On Sun, Jan 16, 2022 at 9:49 PM Bernhard Beschow <shentey@gmail.com> wrote:
>
> 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>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> 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
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] softmmu: Provide a clue as to why device tree loading failed
2022-01-16 11:46 [PATCH] softmmu: Provide a clue as to why device tree loading failed Bernhard Beschow
` (2 preceding siblings ...)
2022-01-17 22:58 ` Alistair Francis
@ 2022-01-18 11:34 ` Laurent Vivier
3 siblings, 0 replies; 5+ messages in thread
From: Laurent Vivier @ 2022-01-18 11:34 UTC (permalink / raw)
To: Bernhard Beschow, qemu-devel; +Cc: qemu-trivial, Alistair Francis, David Gibson
Le 16/01/2022 à 12:46, Bernhard Beschow a écrit :
> 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;
> }
>
Applied to my trivial-patches branch.
Thanks,
Laurent
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-01-18 11:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-16 11:46 [PATCH] softmmu: Provide a clue as to why device tree loading failed Bernhard Beschow
2022-01-16 21:07 ` 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
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.