diff options
author | Andreas Färber <afaerber@suse.de> | 2013-07-29 18:36:59 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-11-05 17:47:29 +0100 |
commit | 5633b90ad44f08a57c44bb602cb0ae6668420ac9 (patch) | |
tree | d8af85867d14810cd40cd41a59b5490e349495ba /hw/arm | |
parent | 4bd2f93ff9dcf5fbbdb55affc55b7f1a568e43cf (diff) |
armv7m: Don't enforce use of kernel for qtest
Adopt error_report().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/arm')
-rw-r--r-- | hw/arm/armv7m.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index 89a9015de7..397e8dfb37 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -11,6 +11,8 @@ #include "hw/arm/arm.h" #include "hw/loader.h" #include "elf.h" +#include "sysemu/qtest.h" +#include "qemu/error-report.h" /* Bitbanded IO. Each word corresponds to a single bit. */ @@ -232,21 +234,22 @@ qemu_irq *armv7m_init(MemoryRegion *address_space_mem, big_endian = 0; #endif - if (!kernel_filename) { + if (!kernel_filename && !qtest_enabled()) { 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) { - image_size = load_image_targphys(kernel_filename, 0, flash_size); - lowaddr = 0; - } - if (image_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); - exit(1); + if (kernel_filename) { + image_size = load_elf(kernel_filename, NULL, NULL, &entry, &lowaddr, + NULL, big_endian, ELF_MACHINE, 1); + if (image_size < 0) { + image_size = load_image_targphys(kernel_filename, 0, flash_size); + lowaddr = 0; + } + if (image_size < 0) { + error_report("Could not load kernel '%s'", kernel_filename); + exit(1); + } } /* Hack to map an additional page of ram at the top of the address |