Skip to content

Commit

Permalink
armv7m: Guard against no -kernel argument
Browse files Browse the repository at this point in the history
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 <peter.crosthwaite@petalogix.com>
Tested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pete128 authored and pm215 committed Aug 13, 2012
1 parent 55e00a1 commit 01fd41a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hw/armv7m.c
Expand Up @@ -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) {
Expand Down

0 comments on commit 01fd41a

Please sign in to comment.