The dtb command line should only be overwritten if the user provides a command line. Otherwise whatever command line was in the dtb should stay unchanged.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwa...@petalogix.com> --- hw/arm_boot.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/arm_boot.c b/hw/arm_boot.c index 8e25873b..d040c58 100644 --- a/hw/arm_boot.c +++ b/hw/arm_boot.c @@ -219,6 +219,7 @@ static int load_dtb(target_phys_addr_t addr, const struct arm_boot_info *binfo) void *fdt = NULL; char *filename; int size, rc; + QemuOpts *machine_opts; filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, binfo->dtb_filename); if (!filename) { @@ -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"); + } } if (binfo->initrd_size) { -- 1.7.3.2