All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: peter.maydell@linearo.org
Cc: agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	"Cédric Le Goater" <clg@kaod.org>,
	"David Gibson" <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PULL 55/66] hw/ppc: use error_report instead of fprintf
Date: Tue,  6 Sep 2016 13:40:42 +1000	[thread overview]
Message-ID: <1473133253-17598-56-git-send-email-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <1473133253-17598-1-git-send-email-david@gibson.dropbear.id.au>

From: Cédric Le Goater <clg@kaod.org>

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/ppc/spapr.c       | 12 ++++++------
 hw/ppc/spapr_drc.c   |  8 ++++----
 hw/ppc/spapr_iommu.c |  4 ++--
 hw/ppc/spapr_rtas.c  | 13 +++++++------
 hw/ppc/spapr_vio.c   |  3 ++-
 include/hw/ppc/fdt.h |  8 +++++---
 6 files changed, 26 insertions(+), 22 deletions(-)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 79d136d..7ec2751 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -647,13 +647,13 @@ static void spapr_populate_cpu_dt(CPUState *cs, void *fdt, int offset,
         _FDT((fdt_setprop_cell(fdt, offset, "d-cache-size",
                                pcc->l1_dcache_size)));
     } else {
-        fprintf(stderr, "Warning: Unknown L1 dcache size for cpu\n");
+        error_report("Warning: Unknown L1 dcache size for cpu");
     }
     if (pcc->l1_icache_size) {
         _FDT((fdt_setprop_cell(fdt, offset, "i-cache-size",
                                pcc->l1_icache_size)));
     } else {
-        fprintf(stderr, "Warning: Unknown L1 icache size for cpu\n");
+        error_report("Warning: Unknown L1 icache size for cpu");
     }
 
     _FDT((fdt_setprop_cell(fdt, offset, "timebase-frequency", tbfreq)));
@@ -945,20 +945,20 @@ static void spapr_finalize_fdt(sPAPRMachineState *spapr,
 
     ret = spapr_populate_memory(spapr, fdt);
     if (ret < 0) {
-        fprintf(stderr, "couldn't setup memory nodes in fdt\n");
+        error_report("couldn't setup memory nodes in fdt");
         exit(1);
     }
 
     ret = spapr_populate_vdevice(spapr->vio_bus, fdt);
     if (ret < 0) {
-        fprintf(stderr, "couldn't setup vio devices in fdt\n");
+        error_report("couldn't setup vio devices in fdt");
         exit(1);
     }
 
     if (object_resolve_path_type("", TYPE_SPAPR_RNG, NULL)) {
         ret = spapr_rng_populate_dt(fdt);
         if (ret < 0) {
-            fprintf(stderr, "could not set up rng device in the fdt\n");
+            error_report("could not set up rng device in the fdt");
             exit(1);
         }
     }
@@ -974,7 +974,7 @@ static void spapr_finalize_fdt(sPAPRMachineState *spapr,
     /* RTAS */
     ret = spapr_rtas_device_tree_setup(fdt, rtas_addr, rtas_size);
     if (ret < 0) {
-        fprintf(stderr, "Couldn't set up RTAS device tree properties\n");
+        error_report("Couldn't set up RTAS device tree properties");
     }
 
     /* cpus */
diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
index 26a0679..4b1a943 100644
--- a/hw/ppc/spapr_drc.c
+++ b/hw/ppc/spapr_drc.c
@@ -816,7 +816,7 @@ int spapr_drc_populate_dt(void *fdt, int fdt_offset, Object *owner,
                       drc_indexes->data,
                       drc_indexes->len * sizeof(uint32_t));
     if (ret) {
-        fprintf(stderr, "Couldn't create ibm,drc-indexes property\n");
+        error_report("Couldn't create ibm,drc-indexes property");
         goto out;
     }
 
@@ -824,21 +824,21 @@ int spapr_drc_populate_dt(void *fdt, int fdt_offset, Object *owner,
                       drc_power_domains->data,
                       drc_power_domains->len * sizeof(uint32_t));
     if (ret) {
-        fprintf(stderr, "Couldn't finalize ibm,drc-power-domains property\n");
+        error_report("Couldn't finalize ibm,drc-power-domains property");
         goto out;
     }
 
     ret = fdt_setprop(fdt, fdt_offset, "ibm,drc-names",
                       drc_names->str, drc_names->len);
     if (ret) {
-        fprintf(stderr, "Couldn't finalize ibm,drc-names property\n");
+        error_report("Couldn't finalize ibm,drc-names property");
         goto out;
     }
 
     ret = fdt_setprop(fdt, fdt_offset, "ibm,drc-types",
                       drc_types->str, drc_types->len);
     if (ret) {
-        fprintf(stderr, "Couldn't finalize ibm,drc-types property\n");
+        error_report("Couldn't finalize ibm,drc-types property");
         goto out;
     }
 
diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c
index 6bc4d4d..f20b0b8 100644
--- a/hw/ppc/spapr_iommu.c
+++ b/hw/ppc/spapr_iommu.c
@@ -310,8 +310,8 @@ sPAPRTCETable *spapr_tce_new_table(DeviceState *owner, uint32_t liobn)
     char tmp[32];
 
     if (spapr_tce_find_by_liobn(liobn)) {
-        fprintf(stderr, "Attempted to create TCE table with duplicate"
-                " LIOBN 0x%x\n", liobn);
+        error_report("Attempted to create TCE table with duplicate"
+                " LIOBN 0x%x", liobn);
         return NULL;
     }
 
diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
index dc058e5..27b5ad4 100644
--- a/hw/ppc/spapr_rtas.c
+++ b/hw/ppc/spapr_rtas.c
@@ -27,6 +27,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "qemu/log.h"
+#include "qemu/error-report.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/char.h"
 #include "hw/qdev.h"
@@ -716,7 +717,7 @@ int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr,
 
     ret = fdt_add_mem_rsv(fdt, rtas_addr, rtas_size);
     if (ret < 0) {
-        fprintf(stderr, "Couldn't add RTAS reserve entry: %s\n",
+        error_report("Couldn't add RTAS reserve entry: %s",
                 fdt_strerror(ret));
         return ret;
     }
@@ -724,7 +725,7 @@ int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr,
     ret = qemu_fdt_setprop_cell(fdt, "/rtas", "linux,rtas-base",
                                 rtas_addr);
     if (ret < 0) {
-        fprintf(stderr, "Couldn't add linux,rtas-base property: %s\n",
+        error_report("Couldn't add linux,rtas-base property: %s",
                 fdt_strerror(ret));
         return ret;
     }
@@ -732,7 +733,7 @@ int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr,
     ret = qemu_fdt_setprop_cell(fdt, "/rtas", "linux,rtas-entry",
                                 rtas_addr);
     if (ret < 0) {
-        fprintf(stderr, "Couldn't add linux,rtas-entry property: %s\n",
+        error_report("Couldn't add linux,rtas-entry property: %s",
                 fdt_strerror(ret));
         return ret;
     }
@@ -740,7 +741,7 @@ int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr,
     ret = qemu_fdt_setprop_cell(fdt, "/rtas", "rtas-size",
                                 rtas_size);
     if (ret < 0) {
-        fprintf(stderr, "Couldn't add rtas-size property: %s\n",
+        error_report("Couldn't add rtas-size property: %s",
                 fdt_strerror(ret));
         return ret;
     }
@@ -755,7 +756,7 @@ int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr,
         ret = qemu_fdt_setprop_cell(fdt, "/rtas", call->name,
                                     i + RTAS_TOKEN_BASE);
         if (ret < 0) {
-            fprintf(stderr, "Couldn't add rtas token for %s: %s\n",
+            error_report("Couldn't add rtas token for %s: %s",
                     call->name, fdt_strerror(ret));
             return ret;
         }
@@ -770,7 +771,7 @@ int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr,
     ret = qemu_fdt_setprop(fdt, "/rtas", "ibm,lrdr-capacity", lrdr_capacity,
                      sizeof(lrdr_capacity));
     if (ret < 0) {
-        fprintf(stderr, "Couldn't add ibm,lrdr-capacity rtas property\n");
+        error_report("Couldn't add ibm,lrdr-capacity rtas property");
         return ret;
     }
 
diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c
index f93244d..497028f 100644
--- a/hw/ppc/spapr_vio.c
+++ b/hw/ppc/spapr_vio.c
@@ -20,6 +20,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/error-report.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "qemu/log.h"
@@ -276,7 +277,7 @@ int spapr_vio_send_crq(VIOsPAPRDevice *dev, uint8_t *crq)
     uint8_t byte;
 
     if (!dev->crq.qsize) {
-        fprintf(stderr, "spapr_vio_send_creq on uninitialized queue\n");
+        error_report("spapr_vio_send_creq on uninitialized queue");
         return -1;
     }
 
diff --git a/include/hw/ppc/fdt.h b/include/hw/ppc/fdt.h
index fff3e1b..2e5c61a 100644
--- a/include/hw/ppc/fdt.h
+++ b/include/hw/ppc/fdt.h
@@ -10,11 +10,13 @@
 #ifndef PPC_FDT_H
 #define PPC_FDT_H
 
-#define _FDT(exp)                               \
-    do { \
+#include "qemu/error-report.h"
+
+#define _FDT(exp)                                                  \
+    do {                                                           \
         int ret = (exp);                                           \
         if (ret < 0) {                                             \
-            fprintf(stderr, "qemu: error creating device tree: %s: %s\n", \
+            error_report("error creating device tree: %s: %s",   \
                     #exp, fdt_strerror(ret));                      \
             exit(1);                                               \
         }                                                          \
-- 
2.7.4

  parent reply	other threads:[~2016-09-06  3:39 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06  3:39 [Qemu-devel] [PULL 00/66] ppc-for-2.8 queue 20160906 David Gibson
2016-09-06  3:39 ` [Qemu-devel] [PULL 01/66] xics_kvm: drop extra checking of kernel_xics_fd David Gibson
2016-09-06  3:39 ` [Qemu-devel] [PULL 02/66] hw/ppc: include fdt helper routine in a common file David Gibson
2016-09-06  3:39 ` [Qemu-devel] [PULL 03/66] target-ppc: Introduce Power9 family David Gibson
2016-09-06  3:39 ` [Qemu-devel] [PULL 04/66] target-ppc: Introduce POWER ISA 3.0 flag David Gibson
2016-09-06  3:39 ` [Qemu-devel] [PULL 05/66] target-ppc: adding addpcis instruction David Gibson
2016-09-06  3:39 ` [Qemu-devel] [PULL 06/66] target-ppc: add cmprb instruction David Gibson
2016-09-06  3:39 ` [Qemu-devel] [PULL 07/66] target-ppc: add modulo word operations David Gibson
2016-09-06  3:39 ` [Qemu-devel] [PULL 08/66] target-ppc: add modulo dword operations David Gibson
2016-09-06  3:39 ` [Qemu-devel] [PULL 09/66] target-ppc: add cnttzd[.] instruction David Gibson
2016-09-06  3:39 ` [Qemu-devel] [PULL 10/66] target-ppc: add cnttzw[.] instruction David Gibson
2016-09-06  3:39 ` [Qemu-devel] [PULL 11/66] target-ppc: add cmpeqb instruction David Gibson
2016-09-06  3:39 ` [Qemu-devel] [PULL 12/66] target-ppc: add setb instruction David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 13/66] target-ppc: add maddld instruction David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 14/66] target-ppc: add maddhd and maddhdu instruction David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 15/66] target-ppc: introduce opc4 for Expanded Opcode David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 16/66] ppc: Provide basic raise_exception_* functions David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 17/66] ppc: Move classic fp ops out of translate.c David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 18/66] ppc: Move embedded spe " David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 19/66] ppc: Move DFP " David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 20/66] ppc: Move VMX " David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 21/66] ppc: Move VSX " David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 22/66] ppc: Rename fload_invalid_op_excp to float_invalid_op_excp David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 23/66] ppc: Make float_invalid_op_excp() pass the return address David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 24/66] ppc: Make float_check_status() " David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 25/66] ppc: Don't update the NIP in floating point generated code David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 26/66] ppc: FP exceptions are always precise David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 27/66] ppc: Don't update NIP in lswi/lswx/stswi/stswx David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 28/66] ppc: Don't update NIP in lmw/stmw/icbi David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 29/66] ppc: Make tlb_fill() use new exception helper David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 30/66] ppc: Rework NIP updates vs. exception generation David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 31/66] ppc: Fix source NIP on SLB related interrupts David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 32/66] ppc: Don't update NIP in DCR access routines David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 33/66] ppc: Don't update NIP in facility unavailable interrupts David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 34/66] ppc: Don't update NIP BookE 2.06 tlbwe David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 35/66] ppc: Don't update NIP on conditional trap instructions David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 36/66] ppc: Don't update NIP if not taking alignment exceptions David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 37/66] ppc: Don't update NIP in dcbz and lscbx David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 38/66] ppc: Make alignment exceptions suck less David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 39/66] ppc: Handle unconditional (always/never) traps at translation time David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 40/66] ppc: Speed up dcbz David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 41/66] ppc: Fix CFAR updates David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 42/66] ppc: Don't set access_type on all load/stores on hash64 David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 43/66] ppc: Use a helper to generate "LE unsupported" alignment interrupts David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 44/66] ppc: load/store multiple and string insns don't do LE David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 45/66] ppc: Speed up load/store multiple David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 46/66] target-ppc: implement branch-less divw[o][.] David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 47/66] target-ppc: implement branch-less divd[o][.] David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 48/66] target-ppc: add dtstsfi[q] instructions David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 49/66] target-ppc: add vabsdu[b, h, w] instructions David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 50/66] target-ppc: add vcmpnez[b, h, w][.] instructions David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 51/66] target-ppc: add vslv instruction David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 52/66] target-ppc: add vsrv instruction David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 53/66] target-ppc: add extswsli[.] instruction David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 54/66] ppc: Rename #include'd .c files to .inc.c David Gibson
2016-09-06  3:40 ` David Gibson [this message]
2016-09-06  3:40 ` [Qemu-devel] [PULL 56/66] hw/ppc: add a ppc_create_page_sizes_prop() helper routine David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 57/66] ppc: Fix macio ESCC legacy mapping David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 58/66] ppc: Fix catching some segfaults in user mode David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 59/66] ppc: Stop dumping state on all exceptions in linux-user David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 60/66] ppc: Don't generate dead code on unconditional branches David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 61/66] ppc: Improve flags for helpers loading/writing the time facilities David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 62/66] ppc: Improve the exception helpers flags David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 63/66] ppc: Improve a few more helper flags David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 64/66] spapr: implement H_CHANGE_LOGICAL_LAN_MAC h_call David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 65/66] tests: Resort check-qtest entries in Makefile.include David Gibson
2016-09-06  3:40 ` [Qemu-devel] [PULL 66/66] tests: Check serial output of firmware boot of some machines David Gibson
2016-09-06  5:14 ` [Qemu-devel] [PULL 00/66] ppc-for-2.8 queue 20160906 no-reply
2016-09-06 14:04 ` Peter Maydell
2016-09-06 19:35   ` Thomas Huth
2016-09-06 20:23     ` Paolo Bonzini
2016-09-06 20:55       ` Thomas Huth
2016-09-06 21:26         ` Thomas Huth
2016-09-07  1:13           ` David Gibson
2016-09-06 21:09   ` Thomas Huth
2016-09-06 21:52     ` Benjamin Herrenschmidt
2016-09-07  2:26       ` Benjamin Herrenschmidt
2016-09-06  3:42 David Gibson
2016-09-06  3:43 ` [Qemu-devel] [PULL 55/66] hw/ppc: use error_report instead of fprintf David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1473133253-17598-56-git-send-email-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=clg@kaod.org \
    --cc=peter.maydell@linearo.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.