aboutsummaryrefslogtreecommitdiff
path: root/device_tree.c
diff options
context:
space:
mode:
authorLeonardo Bras <leonardo@linux.ibm.com>2020-03-19 01:03:26 -0300
committerAlistair Francis <alistair.francis@wdc.com>2020-03-20 14:55:44 -0700
commit9f252c7c88eacbf21dadcfe117b0d08f2e88ceeb (patch)
tree63a57be8a5fcb5edec171ae61f013e99da58b089 /device_tree.c
parent3d0ac346032a1fa9afafcaedc979a99f670e077e (diff)
device_tree: Add info message when dumping dtb to file
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> Message-Id: <20200319040326.391090-1-leonardo@linux.ibm.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'device_tree.c')
-rw-r--r--device_tree.c7
1 files changed, 6 insertions, 1 deletions
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);
}
}