From patchwork Fri Aug 10 01:27:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: armv7m: Guard against no -kernel argument From: "Peter A. G. Crosthwaite" X-Patchwork-Id: 176306 Message-Id: <1344562055-7347-1-git-send-email-peter.crosthwaite@petalogix.com> To: qemu-devel@nongnu.org, armbru@redhat.com Cc: peter.crosthwaite@petalogix.com, peter.maydell@linaro.org, paul@codesourcery.com Date: Fri, 10 Aug 2012 11:27:35 +1000 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) {