shix: Don't require firmware presence for qtest
Adopt error_report() while at it. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
b6e770ee50
commit
d32f7d2506
|
@ -1,6 +1,8 @@
|
||||||
#include "hw/hw.h"
|
#include "hw/hw.h"
|
||||||
#include "hw/sh4/sh.h"
|
#include "hw/sh4/sh.h"
|
||||||
#include "hw/loader.h"
|
#include "hw/loader.h"
|
||||||
|
#include "sysemu/qtest.h"
|
||||||
|
#include "qemu/error-report.h"
|
||||||
|
|
||||||
#define CE1 0x0100
|
#define CE1 0x0100
|
||||||
#define CE2 0x0200
|
#define CE2 0x0200
|
||||||
|
@ -36,10 +38,10 @@ static void init_dev(tc58128_dev * dev, const char *filename)
|
||||||
/* Load flash image skipping the first block */
|
/* Load flash image skipping the first block */
|
||||||
ret = load_image(filename, dev->flash_contents + 528 * 32);
|
ret = load_image(filename, dev->flash_contents + 528 * 32);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
fprintf(stderr, "ret=%d\n", ret);
|
if (!qtest_enabled()) {
|
||||||
fprintf(stderr, "qemu: could not load flash image %s\n",
|
error_report("Could not load flash image %s", filename);
|
||||||
filename);
|
exit(1);
|
||||||
exit(1);
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Build first block with number of blocks */
|
/* Build first block with number of blocks */
|
||||||
blocks = (ret + 528 * 32 - 1) / (528 * 32);
|
blocks = (ret + 528 * 32 - 1) / (528 * 32);
|
||||||
|
|
|
@ -30,9 +30,11 @@
|
||||||
#include "hw/hw.h"
|
#include "hw/hw.h"
|
||||||
#include "hw/sh4/sh.h"
|
#include "hw/sh4/sh.h"
|
||||||
#include "sysemu/sysemu.h"
|
#include "sysemu/sysemu.h"
|
||||||
|
#include "sysemu/qtest.h"
|
||||||
#include "hw/boards.h"
|
#include "hw/boards.h"
|
||||||
#include "hw/loader.h"
|
#include "hw/loader.h"
|
||||||
#include "exec/address-spaces.h"
|
#include "exec/address-spaces.h"
|
||||||
|
#include "qemu/error-report.h"
|
||||||
|
|
||||||
#define BIOS_FILENAME "shix_bios.bin"
|
#define BIOS_FILENAME "shix_bios.bin"
|
||||||
#define BIOS_ADDRESS 0xA0000000
|
#define BIOS_ADDRESS 0xA0000000
|
||||||
|
@ -72,10 +74,9 @@ static void shix_init(QEMUMachineInitArgs *args)
|
||||||
if (bios_name == NULL)
|
if (bios_name == NULL)
|
||||||
bios_name = BIOS_FILENAME;
|
bios_name = BIOS_FILENAME;
|
||||||
ret = load_image_targphys(bios_name, 0, 0x4000);
|
ret = load_image_targphys(bios_name, 0, 0x4000);
|
||||||
if (ret < 0) { /* Check bios size */
|
if (ret < 0 && !qtest_enabled()) {
|
||||||
fprintf(stderr, "qemu: could not load SHIX bios '%s'\n",
|
error_report("Could not load SHIX bios '%s'", bios_name);
|
||||||
bios_name);
|
exit(1);
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Register peripherals */
|
/* Register peripherals */
|
||||||
|
|
Loading…
Reference in New Issue