From: Leonardo Bras <leonardo@linux.ibm.com>
To: Alistair Francis <alistair.francis@wdc.com>,
David Gibson <david@gibson.dropbear.id.au>
Cc: Leonardo Bras <leonardo@linux.ibm.com>, qemu-devel@nongnu.org
Subject: [PATCH 1/1] device_tree: Add info message when dumping dtb to file
Date: Thu, 19 Mar 2020 00:32:00 -0300 [thread overview]
Message-ID: <20200319033200.390008-1-leonardo@linux.ibm.com> (raw)
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
next reply other threads:[~2020-03-19 3:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-19 3:32 Leonardo Bras [this message]
2020-03-19 3:47 ` [PATCH 1/1] device_tree: Add info message when dumping dtb to file Leonardo Bras
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=20200319033200.390008-1-leonardo@linux.ibm.com \
--to=leonardo@linux.ibm.com \
--cc=alistair.francis@wdc.com \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@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).