aboutsummaryrefslogtreecommitdiff
path: root/hw/block
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-08-04 17:51:15 +0200
committerAndreas Färber <afaerber@suse.de>2013-11-05 17:47:29 +0100
commitd32f7d2506f1dab996e977e478f19baff5d47b51 (patch)
treed56eab2e17252b0ec79a6684612478d3d649104d /hw/block
parentb6e770ee505771a6f3c3ffbf05719c149e069e3d (diff)
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>
Diffstat (limited to 'hw/block')
-rw-r--r--hw/block/tc58128.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/hw/block/tc58128.c b/hw/block/tc58128.c
index a3929d444f..728f1c3b68 100644
--- a/hw/block/tc58128.c
+++ b/hw/block/tc58128.c
@@ -1,6 +1,8 @@
#include "hw/hw.h"
#include "hw/sh4/sh.h"
#include "hw/loader.h"
+#include "sysemu/qtest.h"
+#include "qemu/error-report.h"
#define CE1 0x0100
#define CE2 0x0200
@@ -36,10 +38,10 @@ static void init_dev(tc58128_dev * dev, const char *filename)
/* Load flash image skipping the first block */
ret = load_image(filename, dev->flash_contents + 528 * 32);
if (ret < 0) {
- fprintf(stderr, "ret=%d\n", ret);
- fprintf(stderr, "qemu: could not load flash image %s\n",
- filename);
- exit(1);
+ if (!qtest_enabled()) {
+ error_report("Could not load flash image %s", filename);
+ exit(1);
+ }
} else {
/* Build first block with number of blocks */
blocks = (ret + 528 * 32 - 1) / (528 * 32);