From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VO6J7-0002wY-E3 for qemu-devel@nongnu.org; Mon, 23 Sep 2013 09:36:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VO6J0-0006TJ-4v for qemu-devel@nongnu.org; Mon, 23 Sep 2013 09:36:09 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35283 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VO6Iz-0006Ss-Si for qemu-devel@nongnu.org; Mon, 23 Sep 2013 09:36:02 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 23 Sep 2013 15:35:50 +0200 Message-Id: <1379943352-1979-17-git-send-email-afaerber@suse.de> In-Reply-To: <1379943352-1979-1-git-send-email-afaerber@suse.de> References: <1379943352-1979-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v3 16/18] shix: Don't require firmware presence for qtest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Aurelien Jarno , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Stefan Hajnoczi Adopt error_report() while at it. Reviewed-by: Stefan Hajnoczi Reviewed-by: Aurelien Jarno Signed-off-by: Andreas F=C3=A4rber --- hw/block/tc58128.c | 10 ++++++---- hw/sh4/shix.c | 9 +++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/hw/block/tc58128.c b/hw/block/tc58128.c index a3929d4..728f1c3 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" =20 #define CE1 0x0100 #define CE2 0x0200 @@ -36,10 +38,10 @@ static void init_dev(tc58128_dev * dev, const char *f= ilename) /* Load flash image skipping the first block */ ret =3D load_image(filename, dev->flash_contents + 528 * 32); if (ret < 0) { - fprintf(stderr, "ret=3D%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 =3D (ret + 528 * 32 - 1) / (528 * 32); diff --git a/hw/sh4/shix.c b/hw/sh4/shix.c index f008b98..904a966 100644 --- a/hw/sh4/shix.c +++ b/hw/sh4/shix.c @@ -30,9 +30,11 @@ #include "hw/hw.h" #include "hw/sh4/sh.h" #include "sysemu/sysemu.h" +#include "sysemu/qtest.h" #include "hw/boards.h" #include "hw/loader.h" #include "exec/address-spaces.h" +#include "qemu/error-report.h" =20 #define BIOS_FILENAME "shix_bios.bin" #define BIOS_ADDRESS 0xA0000000 @@ -72,10 +74,9 @@ static void shix_init(QEMUMachineInitArgs *args) if (bios_name =3D=3D NULL) bios_name =3D BIOS_FILENAME; ret =3D load_image_targphys(bios_name, 0, 0x4000); - if (ret < 0) { /* Check bios size */ - fprintf(stderr, "qemu: could not load SHIX bios '%s'\n", - bios_name); - exit(1); + if (ret < 0 && !qtest_enabled()) { + error_report("Could not load SHIX bios '%s'", bios_name); + exit(1); } =20 /* Register peripherals */ --=20 1.8.1.4