From: Leonardo Bras Date: Thu, 19 Mar 2020 04:03:26 +0000 (-0300) Subject: device_tree: Add info message when dumping dtb to file X-Git-Tag: v5.0.0-rc0~14^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9f252c7c88eacbf21dadcfe117b0d08f2e88ceeb;p=thirdparty%2Fqemu.git 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 Message-Id: <20200319040326.391090-1-leonardo@linux.ibm.com> Reviewed-by: David Gibson Reviewed-by: Alistair Francis Signed-off-by: Alistair Francis --- diff --git a/device_tree.c b/device_tree.c index f8b46b3c733..bba6cc21641 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); } }