From patchwork Fri Jun 1 01:16:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peter A. G. Crosthwaite" X-Patchwork-Id: 162254 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 89180B7004 for ; Fri, 1 Jun 2012 11:17:11 +1000 (EST) Received: from localhost ([::1]:56895 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SaGUH-0003rq-CE for incoming@patchwork.ozlabs.org; Thu, 31 May 2012 21:17:09 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SaGTh-0002Au-3z for qemu-devel@nongnu.org; Thu, 31 May 2012 21:16:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SaGTf-0001fW-2M for qemu-devel@nongnu.org; Thu, 31 May 2012 21:16:32 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:41169) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SaGTe-0001b4-Sw for qemu-devel@nongnu.org; Thu, 31 May 2012 21:16:30 -0400 Received: by mail-pz0-f45.google.com with SMTP id v2so2256541dad.4 for ; Thu, 31 May 2012 18:16:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references:x-gm-message-state; bh=57+78hYCJ9VAhn0A0a+DMpYA4xzJpBaZRWvKvL0ZWUM=; b=ZK3jqPeTu7a5axj7MsNCWB/9g/Grenwu2cHEZzBtAo674KY4+yYLrnVFxcoDnaarAe rdB/ikXAwDXf8j1JCn7Ny3zexrO44ol6BVGu8QuxB+jxMsbD3/1vrN4aAwj9mJdJ5LZm jDzl/rKKyKL9mtsxAqKrpyH+b2xBMy2Bi01T8dwnLe/pH8wv9GSP0o+q7moKLOqN32e6 o+1j394BVFrwc61hjfljPP355ypOCjwXR9YK/o+yTGC4RmPXcGTZyrR1dMAbQDssY2b8 foQr/mjimENaU3q19irvaxj/7mi5RqnKaNIN4YY61NZjEhJRtySOuuAnks3YjSMla/kF odIg== Received: by 10.68.138.166 with SMTP id qr6mr5060254pbb.43.1338513389927; Thu, 31 May 2012 18:16:29 -0700 (PDT) Received: from localhost ([124.148.20.9]) by mx.google.com with ESMTPS id np8sm854595pbc.71.2012.05.31.18.16.26 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 31 May 2012 18:16:29 -0700 (PDT) From: "Peter A. G. Crosthwaite" To: edgar.iglesias@gmail.com, qemu-devel@nongnu.org Date: Fri, 1 Jun 2012 11:16:12 +1000 Message-Id: X-Mailer: git-send-email 1.7.3.2 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQkG3ZPl1sQyosZa3+xtkf0RKPH7H8sGoky45IOc8Gq0QYUBzep2YFLyf6NWi392S0PLhitJ X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.45 Cc: peter.crosthwaite@petalogix.com, peter.maydell@linaro.org, john.williams@petalogix.com Subject: [Qemu-devel] [RFC PATCH V1 2/2] arm_boot: conditionalised dtb command line update X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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) {