qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH V1 2/2] arm_boot: conditionalised dtb comman


From: Peter Maydell
Subject: Re: [Qemu-devel] [RFC PATCH V1 2/2] arm_boot: conditionalised dtb command line update
Date: Fri, 1 Jun 2012 02:44:18 +0100

On 1 June 2012 02:16, Peter A. G. Crosthwaite
<address@hidden> wrote:
> @@ -240,10 +241,13 @@ static int load_dtb(target_phys_addr_t addr, const 
> struct arm_boot_info *binfo)
>         fprintf(stderr, "couldn't set /memory/reg\n");
>     }
>
> -    rc = qemu_devtree_setprop_string(fdt, "/chosen", "bootargs",
> -                                      binfo->kernel_cmdline);
> -    if (rc < 0) {
> -        fprintf(stderr, "couldn't set /chosen/bootargs\n");
> +    machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0);
> +    if (machine_opts && qemu_opt_get(machine_opts, "append")) {
> +        rc = qemu_devtree_setprop_string(fdt, "/chosen", "bootargs",
> +                                          binfo->kernel_cmdline);
> +        if (rc < 0) {
> +            fprintf(stderr, "couldn't set /chosen/bootargs\n");
> +        }
>     }

Can you just check for binfo->kernel_cmdline being NULL or not
rather than rereading the option via qemu_opt_get? The latter
seems pretty ugly.

-- PMM



reply via email to

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