All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/1] device_tree: Add info message when dumping dtb to file
@ 2020-03-19  4:03 Leonardo Bras
  2020-03-20  8:51 ` David Gibson
  2020-03-20 21:59 ` Alistair Francis
  0 siblings, 2 replies; 3+ messages in thread
From: Leonardo Bras @ 2020-03-19  4:03 UTC (permalink / raw)
  To: Alistair Francis, David Gibson; +Cc: Leonardo Bras, qemu-devel

When dumping dtb to a file, qemu exits silently before starting the VM.

Add info message so user can easily track why the proccess exits.
Add error message if dtb dump failed.

Signed-off-by: Leonardo Bras <leonardo@linux.ibm.com>
---
 device_tree.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/device_tree.c b/device_tree.c
index f8b46b3c73..bba6cc2164 100644
--- a/device_tree.c
+++ b/device_tree.c
@@ -530,7 +530,12 @@ void qemu_fdt_dumpdtb(void *fdt, int size)
 
     if (dumpdtb) {
         /* Dump the dtb to a file and quit */
-        exit(g_file_set_contents(dumpdtb, fdt, size, NULL) ? 0 : 1);
+        if (g_file_set_contents(dumpdtb, fdt, size, NULL)) {
+            info_report("dtb dumped to %s. Exiting.", dumpdtb);
+            exit(0);
+        }
+        error_report("%s: Failed dumping dtb to %s", __func__, dumpdtb);
+        exit(1);
     }
 }
 
-- 
2.24.1



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

* Re: [PATCH v2 1/1] device_tree: Add info message when dumping dtb to file
  2020-03-19  4:03 [PATCH v2 1/1] device_tree: Add info message when dumping dtb to file Leonardo Bras
@ 2020-03-20  8:51 ` David Gibson
  2020-03-20 21:59 ` Alistair Francis
  1 sibling, 0 replies; 3+ messages in thread
From: David Gibson @ 2020-03-20  8:51 UTC (permalink / raw)
  To: Leonardo Bras; +Cc: Alistair Francis, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1303 bytes --]

On Thu, Mar 19, 2020 at 01:03:26AM -0300, Leonardo Bras wrote:
> When dumping dtb to a file, qemu exits silently before starting the VM.
> 
> Add info message so user can easily track why the proccess exits.
> Add error message if dtb dump failed.
> 
> Signed-off-by: Leonardo Bras <leonardo@linux.ibm.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  device_tree.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/device_tree.c b/device_tree.c
> index f8b46b3c73..bba6cc2164 100644
> --- a/device_tree.c
> +++ b/device_tree.c
> @@ -530,7 +530,12 @@ void qemu_fdt_dumpdtb(void *fdt, int size)
>  
>      if (dumpdtb) {
>          /* Dump the dtb to a file and quit */
> -        exit(g_file_set_contents(dumpdtb, fdt, size, NULL) ? 0 : 1);
> +        if (g_file_set_contents(dumpdtb, fdt, size, NULL)) {
> +            info_report("dtb dumped to %s. Exiting.", dumpdtb);
> +            exit(0);
> +        }
> +        error_report("%s: Failed dumping dtb to %s", __func__, dumpdtb);
> +        exit(1);
>      }
>  }
>  

-- 
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] 3+ messages in thread

* Re: [PATCH v2 1/1] device_tree: Add info message when dumping dtb to file
  2020-03-19  4:03 [PATCH v2 1/1] device_tree: Add info message when dumping dtb to file Leonardo Bras
  2020-03-20  8:51 ` David Gibson
@ 2020-03-20 21:59 ` Alistair Francis
  1 sibling, 0 replies; 3+ messages in thread
From: Alistair Francis @ 2020-03-20 21:59 UTC (permalink / raw)
  To: Leonardo Bras
  Cc: Alistair Francis, qemu-devel@nongnu.org Developers, David Gibson

On Wed, Mar 18, 2020 at 9:03 PM Leonardo Bras <leonardo@linux.ibm.com> wrote:
>
> When dumping dtb to a file, qemu exits silently before starting the VM.
>
> Add info message so user can easily track why the proccess exits.
> Add error message if dtb dump failed.
>
> Signed-off-by: Leonardo Bras <leonardo@linux.ibm.com>

Thanks for the patch

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

I have sent a PR with this patch.

Alistair

> ---
>  device_tree.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/device_tree.c b/device_tree.c
> index f8b46b3c73..bba6cc2164 100644
> --- a/device_tree.c
> +++ b/device_tree.c
> @@ -530,7 +530,12 @@ void qemu_fdt_dumpdtb(void *fdt, int size)
>
>      if (dumpdtb) {
>          /* Dump the dtb to a file and quit */
> -        exit(g_file_set_contents(dumpdtb, fdt, size, NULL) ? 0 : 1);
> +        if (g_file_set_contents(dumpdtb, fdt, size, NULL)) {
> +            info_report("dtb dumped to %s. Exiting.", dumpdtb);
> +            exit(0);
> +        }
> +        error_report("%s: Failed dumping dtb to %s", __func__, dumpdtb);
> +        exit(1);
>      }
>  }
>
> --
> 2.24.1
>
>


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

end of thread, other threads:[~2020-03-20 22:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-19  4:03 [PATCH v2 1/1] device_tree: Add info message when dumping dtb to file Leonardo Bras
2020-03-20  8:51 ` David Gibson
2020-03-20 21:59 ` Alistair Francis

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.