From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43751) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz6sK-00032u-PZ for qemu-devel@nongnu.org; Mon, 23 Jun 2014 12:13:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wz6s6-0001jq-KC for qemu-devel@nongnu.org; Mon, 23 Jun 2014 12:13:44 -0400 Received: from mail-lb0-x232.google.com ([2a00:1450:4010:c04::232]:34791) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz6s6-0001jT-Cv for qemu-devel@nongnu.org; Mon, 23 Jun 2014 12:13:30 -0400 Received: by mail-lb0-f178.google.com with SMTP id 10so4831154lbg.37 for ; Mon, 23 Jun 2014 09:13:29 -0700 (PDT) From: Max Filippov Date: Mon, 23 Jun 2014 20:12:49 +0400 Message-Id: <1403539976-22581-3-git-send-email-jcmvbkbc@gmail.com> In-Reply-To: <1403539976-22581-1-git-send-email-jcmvbkbc@gmail.com> References: <1403539976-22581-1-git-send-email-jcmvbkbc@gmail.com> Subject: [Qemu-devel] [PATCH 2/9] hw/xtensa: replace fprintfs with error_report List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Max Filippov , Waldemar Brodkorb Signed-off-by: Max Filippov --- hw/xtensa/sim.c | 6 ++++-- hw/xtensa/xtfpga.c | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/hw/xtensa/sim.c b/hw/xtensa/sim.c index 89da43c..9642bf5 100644 --- a/hw/xtensa/sim.c +++ b/hw/xtensa/sim.c @@ -31,6 +31,7 @@ #include "elf.h" #include "exec/memory.h" #include "exec/address-spaces.h" +#include "qemu/error-report.h" static uint64_t translate_phys_addr(void *opaque, uint64_t addr) { @@ -63,8 +64,9 @@ static void xtensa_sim_init(MachineState *machine) for (n = 0; n < smp_cpus; n++) { cpu = cpu_xtensa_init(cpu_model); if (cpu == NULL) { - fprintf(stderr, "Unable to find CPU definition\n"); - exit(1); + error_report("unable to find CPU definition '%s'\n", + cpu_model); + exit(EXIT_FAILURE); } env = &cpu->env; diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index 0b8a2ed..75bc479 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw/xtensa/xtfpga.c @@ -37,6 +37,7 @@ #include "hw/block/flash.h" #include "sysemu/blockdev.h" #include "sysemu/char.h" +#include "qemu/error-report.h" #include "bootparam.h" typedef struct LxBoardDesc { @@ -185,8 +186,9 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine) for (n = 0; n < smp_cpus; n++) { cpu = cpu_xtensa_init(cpu_model); if (cpu == NULL) { - fprintf(stderr, "Unable to find CPU definition\n"); - exit(1); + error_report("unable to find CPU definition '%s'\n", + cpu_model); + exit(EXIT_FAILURE); } env = &cpu->env; @@ -227,8 +229,8 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine) board->flash_size / board->flash_sector_size, 4, 0x0000, 0x0000, 0x0000, 0x0000, be); if (flash == NULL) { - fprintf(stderr, "Unable to mount pflash\n"); - exit(1); + error_report("unable to mount pflash\n"); + exit(EXIT_FAILURE); } } -- 1.8.1.4