From patchwork Fri Aug 10 01:27:35 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: 176306 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 1DFE72C008E for ; Fri, 10 Aug 2012 11:29:00 +1000 (EST) Received: from localhost ([::1]:32856 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sze26-0002fk-4v for incoming@patchwork.ozlabs.org; Thu, 09 Aug 2012 21:28:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sze1x-0002fc-SJ for qemu-devel@nongnu.org; Thu, 09 Aug 2012 21:28:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sze1w-00052v-JI for qemu-devel@nongnu.org; Thu, 09 Aug 2012 21:28:49 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:53715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sze1w-00052h-DY for qemu-devel@nongnu.org; Thu, 09 Aug 2012 21:28:48 -0400 Received: by pbbrp12 with SMTP id rp12so1697101pbb.4 for ; Thu, 09 Aug 2012 18:28:47 -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:x-gm-message-state; bh=XeVLPt66gVqejW5vla5srDtQQ/7aFdrH00bmxJjka0w=; b=H6z4kTazPvqBLbJDZuxmGYOTgUV32rxi7veIOCKgDkr6n3tu+/RK/osxM8QlcZDCpS c4FKncgdOtTp573X8ThDWSgK2TNTaxFKpfkfqHEX6YOv09ng8rBwCcdrXebCZqc/dW6H LEDw6ZX+OVZHaiApDGDodWGgDEDWOgu3ou9vC6veDjdIpJZkzK7wr62X5lOZ/FTnZqwY s6YArRUN7J4BCT42JCLPrqLFFHC/DMuwJjBczV40oReDFm34wUWGmxEk5M9ueBMQPvBt 5w3QN6Bx1qczFiw3H4O7Tvi12kQH3OB1tcLvI0fVSmKgWzYZwE9wilROK6jJklI0XBK4 ozuw== Received: by 10.68.228.193 with SMTP id sk1mr8198529pbc.97.1344562126959; Thu, 09 Aug 2012 18:28:46 -0700 (PDT) Received: from localhost ([124.148.20.9]) by mx.google.com with ESMTPS id qp6sm2199330pbc.55.2012.08.09.18.28.44 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Aug 2012 18:28:46 -0700 (PDT) From: "Peter A. G. Crosthwaite" To: qemu-devel@nongnu.org, armbru@redhat.com Date: Fri, 10 Aug 2012 11:27:35 +1000 Message-Id: <1344562055-7347-1-git-send-email-peter.crosthwaite@petalogix.com> X-Mailer: git-send-email 1.7.0.4 X-Gm-Message-State: ALoCoQkclTR5vGw76z/5UF181W/weXpM/Yt1lam3R1B4332Gpk2alvzg6PVfjMf7et3Tz+4e/YlZ X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.45 Cc: peter.crosthwaite@petalogix.com, peter.maydell@linaro.org, paul@codesourcery.com Subject: [Qemu-devel] [PATCH] armv7m: Guard against no -kernel argument 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 A -kernel argument must be specified for this machine. Gaurd against no -kernel argument. Previously gave an unhelpful "bad address" error message. Signed-off-by: Peter A. G. Crosthwaite Tested-by: Markus Armbruster --- hw/armv7m.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/hw/armv7m.c b/hw/armv7m.c index 8cec78d..9f66667 100644 --- a/hw/armv7m.c +++ b/hw/armv7m.c @@ -227,6 +227,11 @@ qemu_irq *armv7m_init(MemoryRegion *address_space_mem, big_endian = 0; #endif + if (!kernel_filename) { + fprintf(stderr, "Guest image must be specified (using -kernel)\n"); + exit(1); + } + image_size = load_elf(kernel_filename, NULL, NULL, &entry, &lowaddr, NULL, big_endian, ELF_MACHINE, 1); if (image_size < 0) {