From patchwork Wed Jul 10 08:16:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 257997 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3A9412C0299 for ; Wed, 10 Jul 2013 20:08:51 +1000 (EST) Received: from localhost ([::1]:40935 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwrKL-00014W-3c for incoming@patchwork.ozlabs.org; Wed, 10 Jul 2013 06:08:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwpbP-000560-FE for qemu-devel@nongnu.org; Wed, 10 Jul 2013 04:18:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UwpbK-0001CE-VT for qemu-devel@nongnu.org; Wed, 10 Jul 2013 04:18:19 -0400 Received: from mail-wg0-f49.google.com ([74.125.82.49]:56072) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwpbK-0001C6-PV for qemu-devel@nongnu.org; Wed, 10 Jul 2013 04:18:14 -0400 Received: by mail-wg0-f49.google.com with SMTP id a12so5789598wgh.16 for ; Wed, 10 Jul 2013 01:18:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=fISjM8zcMtgynptcw2nB52urVtvZ951pcKz1jeeFs+I=; b=XykfC9dHPiPmjHB6QDTTxupsX8D2jlYPIXCvewIigoM618+uVRJIh5iblMRJVk0lyD aUNYpUjA6rvJ8DKXZXkSTOMqUJlLm2/Eq041RLy3/M2b63Z+CVDyl6/rE+htCJReBX8G l7piEfCv+2LFOIVkWlyyjo1rb1JfmNaKMrI60xVok7bgZkPDz2eAXm8F3Ugwm9Vg0CTv OPrr/5/ppQLx26zg4qmnJZKZwM3kNf1dF0ArYujun/OWcX5+eEs8uG/FEA8M8YFxmdut xexGNiPrTfgUkA4TtvVVKt6Cg01kHpHVO03gAAgf7eulBcqZhr/E58AD5GC1jbfxqGul UYDA== X-Received: by 10.180.38.37 with SMTP id d5mr34234782wik.37.1373444293828; Wed, 10 Jul 2013 01:18:13 -0700 (PDT) Received: from localhost ([193.120.41.118]) by mx.google.com with ESMTPSA id o10sm34284781wiz.5.2013.07.10.01.17.58 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Jul 2013 01:18:09 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 754223E0EE8; Wed, 10 Jul 2013 09:16:26 +0100 (BST) From: Grant Likely To: Date: Wed, 10 Jul 2013 09:16:23 +0100 Message-Id: <1373444183-11557-1-git-send-email-grant.likely@linaro.org> X-Mailer: git-send-email 1.8.1.2 X-Gm-Message-State: ALoCoQm7gJJFiP8zg08R76Df2w4Alx7yt2KJ25Nq6Cli2kITLbynBzkP9fxybsXO7x5hz3RspEsp X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.82.49 X-Mailman-Approved-At: Wed, 10 Jul 2013 06:07:04 -0400 Cc: Grant Likely , Peter Maydell , qemu-devel@nongnu.org, patches@linaro.org Subject: [Qemu-devel] [PATCH v2] Make -kernel flag optional on ARM. 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 Sometimes we want to boot the system via firmware instead of loading a kernel into ram with the -kernel parameter. This patch makes the -kernel parameter optional so that a bios image provided by the -pflash flag will be executed. For example: qemu-system-arm -M vexpress-a15 -pflash Note: Currently the file must be at least the size of the emulated flash device (ie 64M for VExpress) otherwise QEMU will silently not use the data. This will be fixed in a separate patch v2: just return if the kernel filename isn't provided Signed-off-by: Grant Likely Cc: Peter Maydell Cc: qemu-devel@nongnu.org --- hw/arm/boot.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 7c0090f..e702fd7 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -361,11 +361,8 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info) int big_endian; QemuOpts *machine_opts; - /* Load the kernel. */ - if (!info->kernel_filename) { - fprintf(stderr, "Kernel image must be specified\n"); - exit(1); - } + if (!info->kernel_filename) + return; machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0); if (machine_opts) {