Received: from eggs.gnu.org ([208.118.235.92]:58864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgyWs-0007I2-Rx for qemu-devel@nongnu.org; Tue, 19 Jun 2012 09:31:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SgyWn-0008DA-CP for qemu-devel@nongnu.org; Tue, 19 Jun 2012 09:31:34 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:39811) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgyWn-0008C6-57 for qemu-devel@nongnu.org; Tue, 19 Jun 2012 09:31:29 -0400 From: Peter Maydell Date: Tue, 19 Jun 2012 14:31:13 +0100 Message-Id: <1340112673-14846-17-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1340112673-14846-1-git-send-email-peter.maydell@linaro.org> References: <1340112673-14846-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH 16/16] arm_boot: Conditionalised DTB command line update List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Anthony Liguori , qemu-devel@nongnu.org, Paul Brook From: Peter A. G. Crosthwaite The DTB command line should only be overwritten if the user provides a command line with -append. Otherwise whatever command line was in the DTB should stay unchanged. Signed-off-by: Peter A. G. Crosthwaite Signed-off-by: Peter Maydell --- hw/arm_boot.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/arm_boot.c b/hw/arm_boot.c index d0e643b..a1e6ddb 100644 --- a/hw/arm_boot.c +++ b/hw/arm_boot.c @@ -242,10 +242,12 @@ 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"); + if (binfo->kernel_cmdline && *binfo->kernel_cmdline) { + 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.1