Révision | 8c5d50236b48571f5eaf64339c13539a03cf5eb5 (tree) |
---|---|
l'heure | 2020-03-16 00:12:48 |
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,12 +21,14 @@ | ||
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 "hw/qdev-properties.h" |
29 | 30 | #include "sysemu/sysemu.h" |
31 | +#include "sysemu/qtest.h" | |
30 | 32 | #include "cpu.h" |
31 | 33 | |
32 | 34 | /* |
@@ -191,8 +193,14 @@ static void rx62n_realize(DeviceState *dev, Error **errp) | ||
191 | 193 | memory_region_init_rom(&s->c_flash, NULL, "codeflash", |
192 | 194 | RX62N_CFLASH_SIZE, errp); |
193 | 195 | memory_region_add_subregion(s->sysmem, RX62N_CFLASH_BASE, &s->c_flash); |
196 | + | |
194 | 197 | if (!s->kernel) { |
195 | - rom_add_file_fixed(bios_name, RX62N_CFLASH_BASE, 0); | |
198 | + if (bios_name) { | |
199 | + rom_add_file_fixed(bios_name, RX62N_CFLASH_BASE, 0); | |
200 | + } else if (!qtest_enabled()) { | |
201 | + error_report("No bios or kernel specified"); | |
202 | + exit(1); | |
203 | + } | |
196 | 204 | } |
197 | 205 | |
198 | 206 | /* Initialize CPU */ |