Révision | e0e706bff19e0d355a3a2d4f7d4967e5b251d88d (tree) |
---|---|
l'heure | 2019-06-16 22:31:41 |
Auteur | Richard Henderson <richard.henderson@lina...> |
Commiter | Yoshinori Sato |
hw/rx: Honor -accel qtest
Issue an error if no kernel, no bios, and not qtest'ing.
Fixes make check-qtest-rx: test/qom-test.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Message-Id: <20190607091116.49044-16-ysato@users.sourceforge.jp>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
We could squash this with the previous patch
@@ -21,11 +21,13 @@ | ||
21 | 21 | |
22 | 22 | #include "qemu/osdep.h" |
23 | 23 | #include "qapi/error.h" |
24 | +#include "qemu/error-report.h" | |
24 | 25 | #include "hw/hw.h" |
25 | 26 | #include "hw/rx/rx62n.h" |
26 | 27 | #include "hw/loader.h" |
27 | 28 | #include "hw/sysbus.h" |
28 | 29 | #include "sysemu/sysemu.h" |
30 | +#include "sysemu/qtest.h" | |
29 | 31 | #include "cpu.h" |
30 | 32 | |
31 | 33 | /* |
@@ -190,8 +192,14 @@ static void rx62n_realize(DeviceState *dev, Error **errp) | ||
190 | 192 | memory_region_init_rom(&s->c_flash, NULL, "codeflash", |
191 | 193 | RX62N_CFLASH_SIZE, errp); |
192 | 194 | memory_region_add_subregion(s->sysmem, RX62N_CFLASH_BASE, &s->c_flash); |
195 | + | |
193 | 196 | if (!s->kernel) { |
194 | - rom_add_file_fixed(bios_name, RX62N_CFLASH_BASE, 0); | |
197 | + if (bios_name) { | |
198 | + rom_add_file_fixed(bios_name, RX62N_CFLASH_BASE, 0); | |
199 | + } else if (!qtest_enabled()) { | |
200 | + error_report("No bios or kernel specified"); | |
201 | + exit(1); | |
202 | + } | |
195 | 203 | } |
196 | 204 | |
197 | 205 | /* Initialize CPU */ |