From patchwork Mon Jun 18 01:35:36 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: 165369 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 6F349B72C1 for ; Mon, 18 Jun 2012 11:26:14 +1000 (EST) Received: from localhost ([::1]:43021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgQjM-0006ue-9K for incoming@patchwork.ozlabs.org; Sun, 17 Jun 2012 21:26:12 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgQj6-0006lN-9x for qemu-devel@nongnu.org; Sun, 17 Jun 2012 21:25:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SgQj4-0003QG-Hl for qemu-devel@nongnu.org; Sun, 17 Jun 2012 21:25:55 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:49564) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgQj4-0003Kb-Bg for qemu-devel@nongnu.org; Sun, 17 Jun 2012 21:25:54 -0400 Received: by mail-pz0-f45.google.com with SMTP id n2so5625846dad.4 for ; Sun, 17 Jun 2012 18:25:53 -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=szw0TZbVDFsv1+GsTMYjl7nA8x2761sLcYiCpbS0s18=; b=XsNJl9b6XabyGmpwGOiR/OrxRkXtY4KxwmeE/7wb3H4ZRLuD+NKZEI6S/Ek1Yxd/P+ 5Ch1dHhNQ8LHQbHU32c4jAngymsL++1TcP8HCqKXj3z+E74OoXZSOz5qBIhWAe6IGa91 xF15nJ2zFN4Wh3l02t2bgbmugCRYShYrKhltY/SAj+LKpjKPjohLntfFpdclHyBovdMG hlUbRwCv0VkW9UTJRuXXlJnIuJCtoSCcI7hlldrbfE1bMc32IPaD4CXeHb3vjH2fz8Ok 2i17HMX9wudYh4DPB/kWjk7hj2yS2K4j+9Cruow4iSHG9kcblNnOfS1FbB+CKCK26XTk //oA== Received: by 10.68.241.8 with SMTP id we8mr45744257pbc.130.1339982753287; Sun, 17 Jun 2012 18:25:53 -0700 (PDT) Received: from localhost ([124.148.20.9]) by mx.google.com with ESMTPS id he9sm21937046pbc.68.2012.06.17.18.25.49 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 17 Jun 2012 18:25:52 -0700 (PDT) From: "Peter A. G. Crosthwaite" To: edgar.iglesias@gmail.com, qemu-devel@nongnu.org Date: Mon, 18 Jun 2012 11:35:36 +1000 Message-Id: X-Mailer: git-send-email 1.7.3.2 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQk4koxvg8fZH0JcfFvYaTNCbwTGuj4szShkWr51KRJJ32T9i3ygFoko0V5c6VaxyrQOy7x5 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] [PATCH v2 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 with -apend. Otherwise whatever command line was in the DTB should stay unchanged. Signed-off-by: Peter A. G. Crosthwaite Reviewed-by: Peter Maydell --- changed since v1: checked cmd line string in binfo rather than machine opt 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 f0fa23c..1b110ca 100644 --- a/hw/arm_boot.c +++ b/hw/arm_boot.c @@ -240,10 +240,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) {