qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] device_tree: Add info message when dumping dtb to file
@ 2020-03-19  3:32 Leonardo Bras
  2020-03-19  3:47 ` Leonardo Bras
  0 siblings, 1 reply; 2+ messages in thread
From: Leonardo Bras @ 2020-03-19  3:32 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..2e45c18c79 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] 2+ messages in thread

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

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

On Thu, 2020-03-19 at 00:32 -0300, Leonardo Bras wrote:
>  error_report("%s: Failed dumping dtb to %s", __func__, dumpdtb)

Sorry, missed ending ';'.
I will send a v2. 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2020-03-19  3:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-19  3:32 [PATCH 1/1] device_tree: Add info message when dumping dtb to file Leonardo Bras
2020-03-19  3:47 ` Leonardo Bras

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).