]> git.proxmox.com Git - mirror_qemu.git/commitdiff
armv7m: Guard against no -kernel argument
authorPeter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Mon, 13 Aug 2012 10:04:05 +0000 (11:04 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 13 Aug 2012 10:04:05 +0000 (11:04 +0100)
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>
hw/armv7m.c

index 8cec78db96e558f9a9ea33f9fc715527b721eeb0..9f66667c6d4f87cdcde3937cfb53ef2d83c7c197 100644 (file)
@@ -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) {