qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [RFC PATCH V1 2/2] arm_boot: conditionalised dtb command li


From: Peter A. G. Crosthwaite
Subject: [Qemu-devel] [RFC PATCH V1 2/2] arm_boot: conditionalised dtb command line update
Date: Fri, 1 Jun 2012 11:16:12 +1000

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




reply via email to

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