qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/1] device_tree: Add info message when dumping dtb to fil


From: David Gibson
Subject: Re: [PATCH v2 1/1] device_tree: Add info message when dumping dtb to file
Date: Fri, 20 Mar 2020 19:51:20 +1100

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 <address@hidden>

Reviewed-by: David Gibson <address@hidden>

> ---
>  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: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]