From patchwork Mon Aug 13 15:31:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 176997 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 BDF1A2C0088 for ; Tue, 14 Aug 2012 02:53:59 +1000 (EST) Received: from localhost ([::1]:42901 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0x14-0000Zb-G2 for incoming@patchwork.ozlabs.org; Mon, 13 Aug 2012 11:57:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0x0Z-00083i-W8 for qemu-devel@nongnu.org; Mon, 13 Aug 2012 11:56:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0x0X-00077f-As for qemu-devel@nongnu.org; Mon, 13 Aug 2012 11:56:47 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:40950) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0x0X-000773-3y for qemu-devel@nongnu.org; Mon, 13 Aug 2012 11:56:45 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1T0wcZ-0008DY-E2; Mon, 13 Aug 2012 16:31:59 +0100 From: Peter Maydell To: Anthony Liguori , Blue Swirl Date: Mon, 13 Aug 2012 16:31:51 +0100 Message-Id: <1344871919-31559-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1344871919-31559-1-git-send-email-peter.maydell@linaro.org> References: <1344871919-31559-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: qemu-devel@nongnu.org, Paul Brook Subject: [Qemu-devel] [PATCH 02/10] 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 From: "Peter A. G. Crosthwaite" A -kernel argument must be specified for this machine. Guard against no -kernel argument. Previously gave an unhelpful "bad address" error message. Signed-off-by: Peter A. G. Crosthwaite Tested-by: Markus Armbruster Signed-off-by: Peter Maydell --- hw/armv7m.c | 5 +++++ 1 file changed, 5 insertions(+) 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) {