From nobody Thu May 2 02:16:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 151794794573885.31728795780532; Tue, 6 Feb 2018 12:12:25 -0800 (PST) Received: from localhost ([::1]:55387 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9bM-0006Eo-Q5 for importer@patchew.org; Tue, 06 Feb 2018 15:12:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9GZ-00032o-VT for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej9GW-0003s8-LJ for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:55 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33138 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej9GW-0003rk-Fl for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:52 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 15B0240201A0 for ; Tue, 6 Feb 2018 19:50:49 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-148.ams2.redhat.com [10.36.116.148]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E57772166BDA for ; Tue, 6 Feb 2018 19:50:45 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id B9A861138646; Tue, 6 Feb 2018 20:50:44 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 6 Feb 2018 20:50:31 +0100 Message-Id: <20180206195044.8347-2-armbru@redhat.com> In-Reply-To: <20180206195044.8347-1-armbru@redhat.com> References: <20180206195044.8347-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 06 Feb 2018 19:50:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 06 Feb 2018 19:50:49 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 01/14] error: Improve documentation of error_append_hint() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Suggested-by: Halil Pasic Signed-off-by: Markus Armbruster Message-Id: <1502359588-29451-1-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake Reviewed-by: Halil Pasic --- include/qapi/error.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/qapi/error.h b/include/qapi/error.h index 341b229066..c2115a6a4a 100644 --- a/include/qapi/error.h +++ b/include/qapi/error.h @@ -230,6 +230,12 @@ void error_prepend(Error **errp, const char *fmt, ...) =20 /* * Append a printf-style human-readable explanation to an existing error. + * If the error is later reported to a human user with + * error_report_err() or warn_report_err(), the hints will be shown, + * too. If it's reported via QMP, the hints will be ignored. + * Intended use is adding helpful hints on the human user interface, + * e.g. a list of valid values. It's not for clarifying a confusing + * error message. * @errp may be NULL, but not &error_fatal or &error_abort. * Trivially the case if you call it only after error_setg() or * error_propagate(). @@ -267,11 +273,13 @@ void error_free_or_abort(Error **errp); =20 /* * Convenience function to warn_report() and free @err. + * The report includes hints added with error_append_hint(). */ void warn_report_err(Error *err); =20 /* * Convenience function to error_report() and free @err. + * The report includes hints added with error_append_hint(). */ void error_report_err(Error *err); =20 --=20 2.13.6 From nobody Thu May 2 02:16:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517949767389733.1179560147428; Tue, 6 Feb 2018 12:42:47 -0800 (PST) Received: from localhost ([::1]:59149 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejA4k-0003Ey-GM for importer@patchew.org; Tue, 06 Feb 2018 15:42:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9Gh-0003ER-SS for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:51:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej9Ge-00043Q-EZ for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:51:03 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58044 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej9Ge-00042F-3u for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:51:00 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6F303EAE98; Tue, 6 Feb 2018 19:50:51 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-148.ams2.redhat.com [10.36.116.148]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E543F111DCE5; Tue, 6 Feb 2018 19:50:45 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id BE1371138648; Tue, 6 Feb 2018 20:50:44 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 6 Feb 2018 20:50:32 +0100 Message-Id: <20180206195044.8347-3-armbru@redhat.com> In-Reply-To: <20180206195044.8347-1-armbru@redhat.com> References: <20180206195044.8347-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 06 Feb 2018 19:50:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 06 Feb 2018 19:50:51 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 02/14] audio: Replace AUDIO_FUNC with __func__ X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann , Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Apparently we don't use __MSC_VER as a compiler anymore and we always require a C99 compiler (which means we always have __func__) so we don't need a special AUDIO_FUNC macro. We can just replace AUDIO_FUNC with __func__ instead. Checkpatch failures were manually fixed. Signed-off-by: Alistair Francis Cc: Gerd Hoffmann Reviewed-by: Thomas Huth Reviewed-by: Eric Blake Reviewed-by: Gerd Hoffmann Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20180203084315.20497-2-armbru@redhat.com> --- audio/alsaaudio.c | 4 ++-- audio/audio.c | 40 ++++++++++++++++++------------------ audio/audio_int.h | 6 ------ audio/audio_pt_int.c | 28 ++++++++++++------------- audio/audio_template.h | 26 +++++++++++------------ audio/dsoundaudio.c | 2 +- audio/mixeng.c | 2 +- audio/ossaudio.c | 10 ++++----- audio/paaudio.c | 56 +++++++++++++++++++++++++---------------------= ---- audio/sdlaudio.c | 2 +- audio/wavaudio.c | 2 +- 11 files changed, 85 insertions(+), 93 deletions(-) diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c index 3652a7b5fa..92a96f8b2b 100644 --- a/audio/alsaaudio.c +++ b/audio/alsaaudio.c @@ -823,7 +823,7 @@ static int alsa_init_out(HWVoiceOut *hw, struct audsett= ings *as, audio_pcm_init_info (&hw->info, &obt_as); hw->samples =3D obt.samples; =20 - alsa->pcm_buf =3D audio_calloc (AUDIO_FUNC, obt.samples, 1 << hw->info= .shift); + alsa->pcm_buf =3D audio_calloc(__func__, obt.samples, 1 << hw->info.sh= ift); if (!alsa->pcm_buf) { dolog ("Could not allocate DAC buffer (%d samples, each %d bytes)\= n", hw->samples, 1 << hw->info.shift); @@ -934,7 +934,7 @@ static int alsa_init_in(HWVoiceIn *hw, struct audsettin= gs *as, void *drv_opaque) audio_pcm_init_info (&hw->info, &obt_as); hw->samples =3D obt.samples; =20 - alsa->pcm_buf =3D audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info= .shift); + alsa->pcm_buf =3D audio_calloc(__func__, hw->samples, 1 << hw->info.sh= ift); if (!alsa->pcm_buf) { dolog ("Could not allocate ADC buffer (%d samples, each %d bytes)\= n", hw->samples, 1 << hw->info.shift); diff --git a/audio/audio.c b/audio/audio.c index beafed209b..7658d2af66 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -424,12 +424,12 @@ static void audio_process_options (const char *prefix, const char qemu_prefix[] =3D "QEMU_"; size_t preflen, optlen; =20 - if (audio_bug (AUDIO_FUNC, !prefix)) { + if (audio_bug(__func__, !prefix)) { dolog ("prefix =3D NULL\n"); return; } =20 - if (audio_bug (AUDIO_FUNC, !opt)) { + if (audio_bug(__func__, !opt)) { dolog ("opt =3D NULL\n"); return; } @@ -792,7 +792,7 @@ static int audio_attach_capture (HWVoiceOut *hw) SWVoiceOut *sw; HWVoiceOut *hw_cap =3D &cap->hw; =20 - sc =3D audio_calloc (AUDIO_FUNC, 1, sizeof (*sc)); + sc =3D audio_calloc(__func__, 1, sizeof(*sc)); if (!sc) { dolog ("Could not allocate soft capture voice (%zu bytes)\n", sizeof (*sc)); @@ -848,7 +848,7 @@ static int audio_pcm_hw_find_min_in (HWVoiceIn *hw) int audio_pcm_hw_get_live_in (HWVoiceIn *hw) { int live =3D hw->total_samples_captured - audio_pcm_hw_find_min_in (hw= ); - if (audio_bug (AUDIO_FUNC, live < 0 || live > hw->samples)) { + if (audio_bug(__func__, live < 0 || live > hw->samples)) { dolog ("live=3D%d hw->samples=3D%d\n", live, hw->samples); return 0; } @@ -886,7 +886,7 @@ static int audio_pcm_sw_get_rpos_in (SWVoiceIn *sw) int live =3D hw->total_samples_captured - sw->total_hw_samples_acquire= d; int rpos; =20 - if (audio_bug (AUDIO_FUNC, live < 0 || live > hw->samples)) { + if (audio_bug(__func__, live < 0 || live > hw->samples)) { dolog ("live=3D%d hw->samples=3D%d\n", live, hw->samples); return 0; } @@ -909,7 +909,7 @@ int audio_pcm_sw_read (SWVoiceIn *sw, void *buf, int si= ze) rpos =3D audio_pcm_sw_get_rpos_in (sw) % hw->samples; =20 live =3D hw->total_samples_captured - sw->total_hw_samples_acquired; - if (audio_bug (AUDIO_FUNC, live < 0 || live > hw->samples)) { + if (audio_bug(__func__, live < 0 || live > hw->samples)) { dolog ("live_in=3D%d hw->samples=3D%d\n", live, hw->samples); return 0; } @@ -935,7 +935,7 @@ int audio_pcm_sw_read (SWVoiceIn *sw, void *buf, int si= ze) } osamp =3D swlim; =20 - if (audio_bug (AUDIO_FUNC, osamp < 0)) { + if (audio_bug(__func__, osamp < 0)) { dolog ("osamp=3D%d\n", osamp); return 0; } @@ -990,7 +990,7 @@ static int audio_pcm_hw_get_live_out (HWVoiceOut *hw, i= nt *nb_live) if (nb_live1) { int live =3D smin; =20 - if (audio_bug (AUDIO_FUNC, live < 0 || live > hw->samples)) { + if (audio_bug(__func__, live < 0 || live > hw->samples)) { dolog ("live=3D%d hw->samples=3D%d\n", live, hw->samples); return 0; } @@ -1014,7 +1014,7 @@ int audio_pcm_sw_write (SWVoiceOut *sw, void *buf, in= t size) hwsamples =3D sw->hw->samples; =20 live =3D sw->total_hw_samples_mixed; - if (audio_bug (AUDIO_FUNC, live < 0 || live > hwsamples)){ + if (audio_bug(__func__, live < 0 || live > hwsamples)) { dolog ("live=3D%d hw->samples=3D%d\n", live, hwsamples); return 0; } @@ -1263,7 +1263,7 @@ static int audio_get_avail (SWVoiceIn *sw) } =20 live =3D sw->hw->total_samples_captured - sw->total_hw_samples_acquire= d; - if (audio_bug (AUDIO_FUNC, live < 0 || live > sw->hw->samples)) { + if (audio_bug(__func__, live < 0 || live > sw->hw->samples)) { dolog ("live=3D%d sw->hw->samples=3D%d\n", live, sw->hw->samples); return 0; } @@ -1287,7 +1287,7 @@ static int audio_get_free (SWVoiceOut *sw) =20 live =3D sw->total_hw_samples_mixed; =20 - if (audio_bug (AUDIO_FUNC, live < 0 || live > sw->hw->samples)) { + if (audio_bug(__func__, live < 0 || live > sw->hw->samples)) { dolog ("live=3D%d sw->hw->samples=3D%d\n", live, sw->hw->samples); return 0; } @@ -1354,7 +1354,7 @@ static void audio_run_out (AudioState *s) live =3D 0; } =20 - if (audio_bug (AUDIO_FUNC, live < 0 || live > hw->samples)) { + if (audio_bug(__func__, live < 0 || live > hw->samples)) { dolog ("live=3D%d hw->samples=3D%d\n", live, hw->samples); continue; } @@ -1389,7 +1389,7 @@ static void audio_run_out (AudioState *s) prev_rpos =3D hw->rpos; played =3D hw->pcm_ops->run_out (hw, live); replay_audio_out(&played); - if (audio_bug (AUDIO_FUNC, hw->rpos >=3D hw->samples)) { + if (audio_bug(__func__, hw->rpos >=3D hw->samples)) { dolog ("hw->rpos=3D%d hw->samples=3D%d played=3D%d\n", hw->rpos, hw->samples, played); hw->rpos =3D 0; @@ -1410,7 +1410,7 @@ static void audio_run_out (AudioState *s) continue; } =20 - if (audio_bug (AUDIO_FUNC, played > sw->total_hw_samples_mixed= )) { + if (audio_bug(__func__, played > sw->total_hw_samples_mixed)) { dolog ("played=3D%d sw->total_hw_samples_mixed=3D%d\n", played, sw->total_hw_samples_mixed); played =3D sw->total_hw_samples_mixed; @@ -1513,7 +1513,7 @@ static void audio_run_capture (AudioState *s) continue; } =20 - if (audio_bug (AUDIO_FUNC, captured > sw->total_hw_samples_mix= ed)) { + if (audio_bug(__func__, captured > sw->total_hw_samples_mixed)= ) { dolog ("captured=3D%d sw->total_hw_samples_mixed=3D%d\n", captured, sw->total_hw_samples_mixed); captured =3D sw->total_hw_samples_mixed; @@ -1924,7 +1924,7 @@ CaptureVoiceOut *AUD_add_capture ( goto err0; } =20 - cb =3D audio_calloc (AUDIO_FUNC, 1, sizeof (*cb)); + cb =3D audio_calloc(__func__, 1, sizeof(*cb)); if (!cb) { dolog ("Could not allocate capture callback information, size %zu\= n", sizeof (*cb)); @@ -1942,7 +1942,7 @@ CaptureVoiceOut *AUD_add_capture ( HWVoiceOut *hw; CaptureVoiceOut *cap; =20 - cap =3D audio_calloc (AUDIO_FUNC, 1, sizeof (*cap)); + cap =3D audio_calloc(__func__, 1, sizeof(*cap)); if (!cap) { dolog ("Could not allocate capture voice, size %zu\n", sizeof (*cap)); @@ -1955,8 +1955,8 @@ CaptureVoiceOut *AUD_add_capture ( =20 /* XXX find a more elegant way */ hw->samples =3D 4096 * 4; - hw->mix_buf =3D audio_calloc (AUDIO_FUNC, hw->samples, - sizeof (struct st_sample)); + hw->mix_buf =3D audio_calloc(__func__, hw->samples, + sizeof(struct st_sample)); if (!hw->mix_buf) { dolog ("Could not allocate capture mix buffer (%d samples)\n", hw->samples); @@ -1965,7 +1965,7 @@ CaptureVoiceOut *AUD_add_capture ( =20 audio_pcm_init_info (&hw->info, as); =20 - cap->buf =3D audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.= shift); + cap->buf =3D audio_calloc(__func__, hw->samples, 1 << hw->info.shi= ft); if (!cap->buf) { dolog ("Could not allocate capture buffer " "(%d samples, each %d bytes)\n", diff --git a/audio/audio_int.h b/audio/audio_int.h index 5bcb1c60e1..5b25da0a37 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -252,10 +252,4 @@ static inline int audio_ring_dist (int dst, int src, i= nt len) #define AUDIO_STRINGIFY_(n) #n #define AUDIO_STRINGIFY(n) AUDIO_STRINGIFY_(n) =20 -#if defined _MSC_VER || defined __GNUC__ -#define AUDIO_FUNC __FUNCTION__ -#else -#define AUDIO_FUNC __FILE__ ":" AUDIO_STRINGIFY (__LINE__) -#endif - #endif /* QEMU_AUDIO_INT_H */ diff --git a/audio/audio_pt_int.c b/audio/audio_pt_int.c index 21ff9c5803..3fe56d8514 100644 --- a/audio/audio_pt_int.c +++ b/audio/audio_pt_int.c @@ -31,7 +31,7 @@ int audio_pt_init (struct audio_pt *p, void *(*func) (voi= d *), =20 err =3D sigfillset (&set); if (err) { - logerr (p, errno, "%s(%s): sigfillset failed", cap, AUDIO_FUNC); + logerr(p, errno, "%s(%s): sigfillset failed", cap, __func__); return -1; } =20 @@ -57,8 +57,8 @@ int audio_pt_init (struct audio_pt *p, void *(*func) (voi= d *), =20 err2 =3D pthread_sigmask (SIG_SETMASK, &old_set, NULL); if (err2) { - logerr (p, err2, "%s(%s): pthread_sigmask (restore) failed", - cap, AUDIO_FUNC); + logerr(p, err2, "%s(%s): pthread_sigmask (restore) failed", + cap, __func__); /* We have failed to restore original signal mask, all bets are of= f, so terminate the process */ exit (EXIT_FAILURE); @@ -74,17 +74,17 @@ int audio_pt_init (struct audio_pt *p, void *(*func) (v= oid *), err2: err2 =3D pthread_cond_destroy (&p->cond); if (err2) { - logerr (p, err2, "%s(%s): pthread_cond_destroy failed", cap, AUDIO= _FUNC); + logerr(p, err2, "%s(%s): pthread_cond_destroy failed", cap, __func= __); } =20 err1: err2 =3D pthread_mutex_destroy (&p->mutex); if (err2) { - logerr (p, err2, "%s(%s): pthread_mutex_destroy failed", cap, AUDI= O_FUNC); + logerr(p, err2, "%s(%s): pthread_mutex_destroy failed", cap, __fun= c__); } =20 err0: - logerr (p, err, "%s(%s): %s failed", cap, AUDIO_FUNC, efunc); + logerr(p, err, "%s(%s): %s failed", cap, __func__, efunc); return -1; } =20 @@ -94,13 +94,13 @@ int audio_pt_fini (struct audio_pt *p, const char *cap) =20 err =3D pthread_cond_destroy (&p->cond); if (err) { - logerr (p, err, "%s(%s): pthread_cond_destroy failed", cap, AUDIO_= FUNC); + logerr(p, err, "%s(%s): pthread_cond_destroy failed", cap, __func_= _); ret =3D -1; } =20 err =3D pthread_mutex_destroy (&p->mutex); if (err) { - logerr (p, err, "%s(%s): pthread_mutex_destroy failed", cap, AUDIO= _FUNC); + logerr(p, err, "%s(%s): pthread_mutex_destroy failed", cap, __func= __); ret =3D -1; } return ret; @@ -112,7 +112,7 @@ int audio_pt_lock (struct audio_pt *p, const char *cap) =20 err =3D pthread_mutex_lock (&p->mutex); if (err) { - logerr (p, err, "%s(%s): pthread_mutex_lock failed", cap, AUDIO_FU= NC); + logerr(p, err, "%s(%s): pthread_mutex_lock failed", cap, __func__); return -1; } return 0; @@ -124,7 +124,7 @@ int audio_pt_unlock (struct audio_pt *p, const char *ca= p) =20 err =3D pthread_mutex_unlock (&p->mutex); if (err) { - logerr (p, err, "%s(%s): pthread_mutex_unlock failed", cap, AUDIO_= FUNC); + logerr(p, err, "%s(%s): pthread_mutex_unlock failed", cap, __func_= _); return -1; } return 0; @@ -136,7 +136,7 @@ int audio_pt_wait (struct audio_pt *p, const char *cap) =20 err =3D pthread_cond_wait (&p->cond, &p->mutex); if (err) { - logerr (p, err, "%s(%s): pthread_cond_wait failed", cap, AUDIO_FUN= C); + logerr(p, err, "%s(%s): pthread_cond_wait failed", cap, __func__); return -1; } return 0; @@ -148,12 +148,12 @@ int audio_pt_unlock_and_signal (struct audio_pt *p, c= onst char *cap) =20 err =3D pthread_mutex_unlock (&p->mutex); if (err) { - logerr (p, err, "%s(%s): pthread_mutex_unlock failed", cap, AUDIO_= FUNC); + logerr(p, err, "%s(%s): pthread_mutex_unlock failed", cap, __func_= _); return -1; } err =3D pthread_cond_signal (&p->cond); if (err) { - logerr (p, err, "%s(%s): pthread_cond_signal failed", cap, AUDIO_F= UNC); + logerr(p, err, "%s(%s): pthread_cond_signal failed", cap, __func__= ); return -1; } return 0; @@ -166,7 +166,7 @@ int audio_pt_join (struct audio_pt *p, void **arg, cons= t char *cap) =20 err =3D pthread_join (p->thread, &ret); if (err) { - logerr (p, err, "%s(%s): pthread_join failed", cap, AUDIO_FUNC); + logerr(p, err, "%s(%s): pthread_join failed", cap, __func__); return -1; } *arg =3D ret; diff --git a/audio/audio_template.h b/audio/audio_template.h index 99b27b285e..7de227d2d1 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -57,13 +57,13 @@ static void glue (audio_init_nb_voices_, TYPE) (struct = audio_driver *drv) glue (s->nb_hw_voices_, TYPE) =3D max_voices; } =20 - if (audio_bug (AUDIO_FUNC, !voice_size && max_voices)) { + if (audio_bug(__func__, !voice_size && max_voices)) { dolog ("drv=3D`%s' voice_size=3D0 max_voices=3D%d\n", drv->name, max_voices); glue (s->nb_hw_voices_, TYPE) =3D 0; } =20 - if (audio_bug (AUDIO_FUNC, voice_size && !max_voices)) { + if (audio_bug(__func__, voice_size && !max_voices)) { dolog ("drv=3D`%s' voice_size=3D%d max_voices=3D0\n", drv->name, voice_size); } @@ -77,7 +77,7 @@ static void glue (audio_pcm_hw_free_resources_, TYPE) (HW= *hw) =20 static int glue (audio_pcm_hw_alloc_resources_, TYPE) (HW *hw) { - HWBUF =3D audio_calloc (AUDIO_FUNC, hw->samples, sizeof (struct st_sam= ple)); + HWBUF =3D audio_calloc(__func__, hw->samples, sizeof(struct st_sample)= ); if (!HWBUF) { dolog ("Could not allocate " NAME " buffer (%d samples)\n", hw->samples); @@ -105,7 +105,7 @@ static int glue (audio_pcm_sw_alloc_resources_, TYPE) (= SW *sw) =20 samples =3D ((int64_t) sw->hw->samples << 32) / sw->ratio; =20 - sw->buf =3D audio_calloc (AUDIO_FUNC, samples, sizeof (struct st_sampl= e)); + sw->buf =3D audio_calloc(__func__, samples, sizeof(struct st_sample)); if (!sw->buf) { dolog ("Could not allocate buffer for `%s' (%d samples)\n", SW_NAME (sw), samples); @@ -238,17 +238,17 @@ static HW *glue (audio_pcm_hw_add_new_, TYPE) (struct= audsettings *as) return NULL; } =20 - if (audio_bug (AUDIO_FUNC, !drv)) { + if (audio_bug(__func__, !drv)) { dolog ("No host audio driver\n"); return NULL; } =20 - if (audio_bug (AUDIO_FUNC, !drv->pcm_ops)) { + if (audio_bug(__func__, !drv->pcm_ops)) { dolog ("Host audio driver without pcm_ops\n"); return NULL; } =20 - hw =3D audio_calloc (AUDIO_FUNC, 1, glue (drv->voice_size_, TYPE)); + hw =3D audio_calloc(__func__, 1, glue(drv->voice_size_, TYPE)); if (!hw) { dolog ("Can not allocate voice `%s' size %d\n", drv->name, glue (drv->voice_size_, TYPE)); @@ -266,7 +266,7 @@ static HW *glue (audio_pcm_hw_add_new_, TYPE) (struct a= udsettings *as) goto err0; } =20 - if (audio_bug (AUDIO_FUNC, hw->samples <=3D 0)) { + if (audio_bug(__func__, hw->samples <=3D 0)) { dolog ("hw->samples=3D%d\n", hw->samples); goto err1; } @@ -339,7 +339,7 @@ static SW *glue (audio_pcm_create_voice_pair_, TYPE) ( hw_as =3D *as; } =20 - sw =3D audio_calloc (AUDIO_FUNC, 1, sizeof (*sw)); + sw =3D audio_calloc(__func__, 1, sizeof(*sw)); if (!sw) { dolog ("Could not allocate soft voice `%s' (%zu bytes)\n", sw_name ? sw_name : "unknown", sizeof (*sw)); @@ -379,7 +379,7 @@ static void glue (audio_close_, TYPE) (SW *sw) void glue (AUD_close_, TYPE) (QEMUSoundCard *card, SW *sw) { if (sw) { - if (audio_bug (AUDIO_FUNC, !card)) { + if (audio_bug(__func__, !card)) { dolog ("card=3D%p\n", card); return; } @@ -399,7 +399,7 @@ SW *glue (AUD_open_, TYPE) ( { AudioState *s =3D &glob_audio_state; =20 - if (audio_bug (AUDIO_FUNC, !card || !name || !callback_fn || !as)) { + if (audio_bug(__func__, !card || !name || !callback_fn || !as)) { dolog ("card=3D%p name=3D%p callback_fn=3D%p as=3D%p\n", card, name, callback_fn, as); goto fail; @@ -408,12 +408,12 @@ SW *glue (AUD_open_, TYPE) ( ldebug ("open %s, freq %d, nchannels %d, fmt %d\n", name, as->freq, as->nchannels, as->fmt); =20 - if (audio_bug (AUDIO_FUNC, audio_validate_settings (as))) { + if (audio_bug(__func__, audio_validate_settings(as))) { audio_print_settings (as); goto fail; } =20 - if (audio_bug (AUDIO_FUNC, !s->drv)) { + if (audio_bug(__func__, !s->drv)) { dolog ("Can not open `%s' (no host audio driver)\n", name); goto fail; } diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index 516846eb80..bc39cb9b4d 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -543,7 +543,7 @@ static int dsound_run_out (HWVoiceOut *hw, int live) } } =20 - if (audio_bug (AUDIO_FUNC, len < 0 || len > bufsize)) { + if (audio_bug(__func__, len < 0 || len > bufsize)) { dolog ("len=3D%d bufsize=3D%d old_pos=3D%ld ppos=3D%ld\n", len, bufsize, old_pos, ppos); return 0; diff --git a/audio/mixeng.c b/audio/mixeng.c index 0bf9b5360f..2ab22df2aa 100644 --- a/audio/mixeng.c +++ b/audio/mixeng.c @@ -344,7 +344,7 @@ struct rate { */ void *st_rate_start (int inrate, int outrate) { - struct rate *rate =3D audio_calloc (AUDIO_FUNC, 1, sizeof (*rate)); + struct rate *rate =3D audio_calloc(__func__, 1, sizeof(*rate)); =20 if (!rate) { dolog ("Could not allocate resampler (%zu bytes)\n", sizeof (*rate= )); diff --git a/audio/ossaudio.c b/audio/ossaudio.c index 0edd7ea5fe..a0428881c2 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -582,11 +582,9 @@ static int oss_init_out(HWVoiceOut *hw, struct audsett= ings *as, } =20 if (!oss->mmapped) { - oss->pcm_buf =3D audio_calloc ( - AUDIO_FUNC, - hw->samples, - 1 << hw->info.shift - ); + oss->pcm_buf =3D audio_calloc(__func__, + hw->samples, + 1 << hw->info.shift); if (!oss->pcm_buf) { dolog ( "Could not allocate DAC buffer (%d samples, each %d bytes)= \n", @@ -705,7 +703,7 @@ static int oss_init_in(HWVoiceIn *hw, struct audsetting= s *as, void *drv_opaque) } =20 hw->samples =3D (obt.nfrags * obt.fragsize) >> hw->info.shift; - oss->pcm_buf =3D audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.= shift); + oss->pcm_buf =3D audio_calloc(__func__, hw->samples, 1 << hw->info.shi= ft); if (!oss->pcm_buf) { dolog ("Could not allocate ADC buffer (%d samples, each %d bytes)\= n", hw->samples, 1 << hw->info.shift); diff --git a/audio/paaudio.c b/audio/paaudio.c index 2a35e6f82c..aa0a7477d3 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -206,7 +206,7 @@ static void *qpa_thread_out (void *arg) PAVoiceOut *pa =3D arg; HWVoiceOut *hw =3D &pa->hw; =20 - if (audio_pt_lock (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_lock(&pa->pt, __func__)) { return NULL; } =20 @@ -222,7 +222,7 @@ static void *qpa_thread_out (void *arg) break; } =20 - if (audio_pt_wait (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_wait(&pa->pt, __func__)) { goto exit; } } @@ -230,7 +230,7 @@ static void *qpa_thread_out (void *arg) decr =3D to_mix =3D audio_MIN (pa->live, pa->g->conf.samples >> 2); rpos =3D pa->rpos; =20 - if (audio_pt_unlock (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_unlock(&pa->pt, __func__)) { return NULL; } =20 @@ -251,7 +251,7 @@ static void *qpa_thread_out (void *arg) to_mix -=3D chunk; } =20 - if (audio_pt_lock (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_lock(&pa->pt, __func__)) { return NULL; } =20 @@ -261,7 +261,7 @@ static void *qpa_thread_out (void *arg) } =20 exit: - audio_pt_unlock (&pa->pt, AUDIO_FUNC); + audio_pt_unlock(&pa->pt, __func__); return NULL; } =20 @@ -270,7 +270,7 @@ static int qpa_run_out (HWVoiceOut *hw, int live) int decr; PAVoiceOut *pa =3D (PAVoiceOut *) hw; =20 - if (audio_pt_lock (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_lock(&pa->pt, __func__)) { return 0; } =20 @@ -279,10 +279,10 @@ static int qpa_run_out (HWVoiceOut *hw, int live) pa->live =3D live - decr; hw->rpos =3D pa->rpos; if (pa->live > 0) { - audio_pt_unlock_and_signal (&pa->pt, AUDIO_FUNC); + audio_pt_unlock_and_signal(&pa->pt, __func__); } else { - audio_pt_unlock (&pa->pt, AUDIO_FUNC); + audio_pt_unlock(&pa->pt, __func__); } return decr; } @@ -298,7 +298,7 @@ static void *qpa_thread_in (void *arg) PAVoiceIn *pa =3D arg; HWVoiceIn *hw =3D &pa->hw; =20 - if (audio_pt_lock (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_lock(&pa->pt, __func__)) { return NULL; } =20 @@ -314,7 +314,7 @@ static void *qpa_thread_in (void *arg) break; } =20 - if (audio_pt_wait (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_wait(&pa->pt, __func__)) { goto exit; } } @@ -322,7 +322,7 @@ static void *qpa_thread_in (void *arg) incr =3D to_grab =3D audio_MIN (pa->dead, pa->g->conf.samples >> 2= ); wpos =3D pa->wpos; =20 - if (audio_pt_unlock (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_unlock(&pa->pt, __func__)) { return NULL; } =20 @@ -342,7 +342,7 @@ static void *qpa_thread_in (void *arg) to_grab -=3D chunk; } =20 - if (audio_pt_lock (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_lock(&pa->pt, __func__)) { return NULL; } =20 @@ -352,7 +352,7 @@ static void *qpa_thread_in (void *arg) } =20 exit: - audio_pt_unlock (&pa->pt, AUDIO_FUNC); + audio_pt_unlock(&pa->pt, __func__); return NULL; } =20 @@ -361,7 +361,7 @@ static int qpa_run_in (HWVoiceIn *hw) int live, incr, dead; PAVoiceIn *pa =3D (PAVoiceIn *) hw; =20 - if (audio_pt_lock (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_lock(&pa->pt, __func__)) { return 0; } =20 @@ -372,10 +372,10 @@ static int qpa_run_in (HWVoiceIn *hw) pa->dead =3D dead - incr; hw->wpos =3D pa->wpos; if (pa->dead > 0) { - audio_pt_unlock_and_signal (&pa->pt, AUDIO_FUNC); + audio_pt_unlock_and_signal(&pa->pt, __func__); } else { - audio_pt_unlock (&pa->pt, AUDIO_FUNC); + audio_pt_unlock(&pa->pt, __func__); } return incr; } @@ -579,7 +579,7 @@ static int qpa_init_out(HWVoiceOut *hw, struct audsetti= ngs *as, =20 audio_pcm_init_info (&hw->info, &obt_as); hw->samples =3D g->conf.samples; - pa->pcm_buf =3D audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.s= hift); + pa->pcm_buf =3D audio_calloc(__func__, hw->samples, 1 << hw->info.shif= t); pa->rpos =3D hw->rpos; if (!pa->pcm_buf) { dolog ("Could not allocate buffer (%d bytes)\n", @@ -587,7 +587,7 @@ static int qpa_init_out(HWVoiceOut *hw, struct audsetti= ngs *as, goto fail2; } =20 - if (audio_pt_init (&pa->pt, qpa_thread_out, hw, AUDIO_CAP, AUDIO_FUNC)= ) { + if (audio_pt_init(&pa->pt, qpa_thread_out, hw, AUDIO_CAP, __func__)) { goto fail3; } =20 @@ -636,7 +636,7 @@ static int qpa_init_in(HWVoiceIn *hw, struct audsetting= s *as, void *drv_opaque) =20 audio_pcm_init_info (&hw->info, &obt_as); hw->samples =3D g->conf.samples; - pa->pcm_buf =3D audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.s= hift); + pa->pcm_buf =3D audio_calloc(__func__, hw->samples, 1 << hw->info.shif= t); pa->wpos =3D hw->wpos; if (!pa->pcm_buf) { dolog ("Could not allocate buffer (%d bytes)\n", @@ -644,7 +644,7 @@ static int qpa_init_in(HWVoiceIn *hw, struct audsetting= s *as, void *drv_opaque) goto fail2; } =20 - if (audio_pt_init (&pa->pt, qpa_thread_in, hw, AUDIO_CAP, AUDIO_FUNC))= { + if (audio_pt_init(&pa->pt, qpa_thread_in, hw, AUDIO_CAP, __func__)) { goto fail3; } =20 @@ -667,17 +667,17 @@ static void qpa_fini_out (HWVoiceOut *hw) void *ret; PAVoiceOut *pa =3D (PAVoiceOut *) hw; =20 - audio_pt_lock (&pa->pt, AUDIO_FUNC); + audio_pt_lock(&pa->pt, __func__); pa->done =3D 1; - audio_pt_unlock_and_signal (&pa->pt, AUDIO_FUNC); - audio_pt_join (&pa->pt, &ret, AUDIO_FUNC); + audio_pt_unlock_and_signal(&pa->pt, __func__); + audio_pt_join(&pa->pt, &ret, __func__); =20 if (pa->stream) { pa_stream_unref (pa->stream); pa->stream =3D NULL; } =20 - audio_pt_fini (&pa->pt, AUDIO_FUNC); + audio_pt_fini(&pa->pt, __func__); g_free (pa->pcm_buf); pa->pcm_buf =3D NULL; } @@ -687,17 +687,17 @@ static void qpa_fini_in (HWVoiceIn *hw) void *ret; PAVoiceIn *pa =3D (PAVoiceIn *) hw; =20 - audio_pt_lock (&pa->pt, AUDIO_FUNC); + audio_pt_lock(&pa->pt, __func__); pa->done =3D 1; - audio_pt_unlock_and_signal (&pa->pt, AUDIO_FUNC); - audio_pt_join (&pa->pt, &ret, AUDIO_FUNC); + audio_pt_unlock_and_signal(&pa->pt, __func__); + audio_pt_join(&pa->pt, &ret, __func__); =20 if (pa->stream) { pa_stream_unref (pa->stream); pa->stream =3D NULL; } =20 - audio_pt_fini (&pa->pt, AUDIO_FUNC); + audio_pt_fini(&pa->pt, __func__); g_free (pa->pcm_buf); pa->pcm_buf =3D NULL; } diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index e8d91d22af..e92135bd2f 100644 --- a/audio/sdlaudio.c +++ b/audio/sdlaudio.c @@ -277,7 +277,7 @@ static void sdl_callback (void *opaque, Uint8 *buf, int= len) return; } =20 - if (audio_bug (AUDIO_FUNC, sdl->live < 0 || sdl->live > hw->sample= s)) { + if (audio_bug(__func__, sdl->live < 0 || sdl->live > hw->samples))= { dolog ("sdl->live=3D%d hw->samples=3D%d\n", sdl->live, hw->samples); return; diff --git a/audio/wavaudio.c b/audio/wavaudio.c index 341eec3121..068a595732 100644 --- a/audio/wavaudio.c +++ b/audio/wavaudio.c @@ -139,7 +139,7 @@ static int wav_init_out(HWVoiceOut *hw, struct audsetti= ngs *as, audio_pcm_init_info (&hw->info, &wav_as); =20 hw->samples =3D 1024; - wav->pcm_buf =3D audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.= shift); + wav->pcm_buf =3D audio_calloc(__func__, hw->samples, 1 << hw->info.shi= ft); if (!wav->pcm_buf) { dolog ("Could not allocate buffer (%d bytes)\n", hw->samples << hw->info.shift); --=20 2.13.6 From nobody Thu May 2 02:16:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517949388421684.5750806101206; Tue, 6 Feb 2018 12:36:28 -0800 (PST) Received: from localhost ([::1]:59043 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9yc-0005zG-MJ for importer@patchew.org; Tue, 06 Feb 2018 15:36:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9Gg-0003DO-OO for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:51:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej9Ge-00042r-91 for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:51:02 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35238 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej9GW-0003ri-IB; Tue, 06 Feb 2018 14:50:52 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 578358182D04; Tue, 6 Feb 2018 19:50:49 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-148.ams2.redhat.com [10.36.116.148]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E54522166BB6; Tue, 6 Feb 2018 19:50:45 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C14AC113864A; Tue, 6 Feb 2018 20:50:44 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 6 Feb 2018 20:50:33 +0100 Message-Id: <20180206195044.8347-4-armbru@redhat.com> In-Reply-To: <20180206195044.8347-1-armbru@redhat.com> References: <20180206195044.8347-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 06 Feb 2018 19:50:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 06 Feb 2018 19:50:49 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 03/14] hw/arm: Replace fprintf(stderr, "*\n" with error_report() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org, Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_= report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_re= port("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report= ("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("= \1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1= "\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\= 2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2)= ;|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|= Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig= }' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}'= \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. The 'qemu: ' prefix was manually removed from the hw/arm/boot.c file. Signed-off-by: Alistair Francis Cc: qemu-arm@nongnu.org Conversions that aren't followed by exit() dropped, because they might be inappropriate. Also trim trailing punctuation from error messages. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20180203084315.20497-3-armbru@redhat.com> --- hw/arm/armv7m.c | 2 +- hw/arm/boot.c | 16 ++++++++-------- hw/arm/gumstix.c | 13 +++++++------ hw/arm/mainstone.c | 7 ++++--- hw/arm/musicpal.c | 2 +- hw/arm/omap1.c | 5 +++-- hw/arm/omap2.c | 3 ++- hw/arm/omap_sx1.c | 2 +- hw/arm/pxa2xx.c | 7 ++++--- hw/arm/vexpress.c | 8 ++++---- hw/arm/z2.c | 6 +++--- 11 files changed, 38 insertions(+), 33 deletions(-) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index bb2dfc942b..56770a7048 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -278,7 +278,7 @@ void armv7m_load_kernel(ARMCPU *cpu, const char *kernel= _filename, int mem_size) #endif =20 if (!kernel_filename && !qtest_enabled()) { - fprintf(stderr, "Guest image must be specified (using -kernel)\n"); + error_report("Guest image must be specified (using -kernel)"); exit(1); } =20 diff --git a/hw/arm/boot.c b/hw/arm/boot.c index c2720c8046..bb244ec359 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -8,6 +8,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include #include "hw/hw.h" @@ -690,7 +691,7 @@ static void load_image_to_fw_cfg(FWCfgState *fw_cfg, ui= nt16_t size_key, gsize length; =20 if (!g_file_get_contents(image_name, &contents, &length, NULL)) { - fprintf(stderr, "failed to load \"%s\"\n", image_name); + error_report("failed to load \"%s\"", image_name); exit(1); } size =3D length; @@ -956,8 +957,7 @@ static void arm_load_kernel_notify(Notifier *notifier, = void *data) is_linux =3D 1; } if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - info->kernel_filename); + error_report("could not load kernel '%s'", info->kernel_filename); exit(1); } info->entry =3D entry; @@ -976,8 +976,8 @@ static void arm_load_kernel_notify(Notifier *notifier, = void *data) info->initrd_start); } if (initrd_size < 0) { - fprintf(stderr, "qemu: could not load initrd '%s'\n", - info->initrd_filename); + error_report("could not load initrd '%s'", + info->initrd_filename); exit(1); } } else { @@ -1021,9 +1021,9 @@ static void arm_load_kernel_notify(Notifier *notifier= , void *data) } else { fixupcontext[FIXUP_ARGPTR] =3D info->loader_start + KERNEL_ARG= S_ADDR; if (info->ram_size >=3D (1ULL << 32)) { - fprintf(stderr, "qemu: RAM size must be less than 4GB to b= oot" - " Linux kernel using ATAGS (try passing a device t= ree" - " using -dtb)\n"); + error_report("RAM size must be less than 4GB to boot" + " Linux kernel using ATAGS (try passing a dev= ice tree" + " using -dtb)"); exit(1); } } diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c index bba9e9f57a..ea2a3c532d 100644 --- a/hw/arm/gumstix.c +++ b/hw/arm/gumstix.c @@ -35,6 +35,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/arm/pxa.h" #include "net/net.h" @@ -62,8 +63,8 @@ static void connex_init(MachineState *machine) =20 dinfo =3D drive_get(IF_PFLASH, 0, 0); if (!dinfo && !qtest_enabled()) { - fprintf(stderr, "A flash image must be given with the " - "'pflash' parameter\n"); + error_report("A flash image must be given with the " + "'pflash' parameter"); exit(1); } =20 @@ -76,7 +77,7 @@ static void connex_init(MachineState *machine) dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, sector_len, connex_rom / sector_len, 2, 0, 0, 0, 0, be)) { - fprintf(stderr, "qemu: Error registering flash memory.\n"); + error_report("Error registering flash memory"); exit(1); } =20 @@ -99,8 +100,8 @@ static void verdex_init(MachineState *machine) =20 dinfo =3D drive_get(IF_PFLASH, 0, 0); if (!dinfo && !qtest_enabled()) { - fprintf(stderr, "A flash image must be given with the " - "'pflash' parameter\n"); + error_report("A flash image must be given with the " + "'pflash' parameter"); exit(1); } =20 @@ -113,7 +114,7 @@ static void verdex_init(MachineState *machine) dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, sector_len, verdex_rom / sector_len, 2, 0, 0, 0, 0, be)) { - fprintf(stderr, "qemu: Error registering flash memory.\n"); + error_report("Error registering flash memory"); exit(1); } =20 diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c index d07972a966..4215c025fc 100644 --- a/hw/arm/mainstone.c +++ b/hw/arm/mainstone.c @@ -12,6 +12,7 @@ * GNU GPL, version 2 or (at your option) any later version. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "hw/hw.h" #include "hw/arm/pxa.h" @@ -143,8 +144,8 @@ static void mainstone_common_init(MemoryRegion *address= _space_mem, if (qtest_enabled()) { break; } - fprintf(stderr, "Two flash images must be given with the " - "'pflash' parameter\n"); + error_report("Two flash images must be given with the " + "'pflash' parameter"); exit(1); } =20 @@ -154,7 +155,7 @@ static void mainstone_common_init(MemoryRegion *address= _space_mem, blk_by_legacy_dinfo(dinfo), sector_len, MAINSTONE_FLASH / sector_le= n, 4, 0, 0, 0, 0, be)) { - fprintf(stderr, "qemu: Error registering flash memory.\n"); + error_report("Error registering flash memory"); exit(1); } } diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index 4172caf5db..38d7322a19 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -1627,7 +1627,7 @@ static void musicpal_init(MachineState *machine) flash_size =3D blk_getlength(blk); if (flash_size !=3D 8*1024*1024 && flash_size !=3D 16*1024*1024 && flash_size !=3D 32*1024*1024) { - fprintf(stderr, "Invalid flash image size\n"); + error_report("Invalid flash image size"); exit(1); } =20 diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index 92e58f09c8..b3a23a83d1 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -18,6 +18,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -2313,7 +2314,7 @@ void omap_uwire_attach(struct omap_uwire_s *s, uWireSlave *slave, int chipselect) { if (chipselect < 0 || chipselect > 3) { - fprintf(stderr, "%s: Bad chipselect %i\n", __func__, chipselect); + error_report("%s: Bad chipselect %i", __func__, chipselect); exit(-1); } =20 @@ -3987,7 +3988,7 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegio= n *system_memory, =20 dinfo =3D drive_get(IF_SD, 0, 0); if (!dinfo) { - fprintf(stderr, "qemu: missing SecureDigital device\n"); + error_report("missing SecureDigital device"); exit(1); } s->mmc =3D omap_mmc_init(0xfffb7800, system_memory, diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c index b53878b8b9..647b119ba9 100644 --- a/hw/arm/omap2.c +++ b/hw/arm/omap2.c @@ -19,6 +19,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -2486,7 +2487,7 @@ struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegi= on *sysmem, =20 dinfo =3D drive_get(IF_SD, 0, 0); if (!dinfo) { - fprintf(stderr, "qemu: missing SecureDigital device\n"); + error_report("missing SecureDigital device"); exit(1); } s->mmc =3D omap2_mmc_init(omap_l4tao(s->l4, 9), diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c index 9a14270795..eccc19c77b 100644 --- a/hw/arm/omap_sx1.c +++ b/hw/arm/omap_sx1.c @@ -194,7 +194,7 @@ static void sx1_init(MachineState *machine, const int v= ersion) } =20 if (!machine->kernel_filename && !fl_idx && !qtest_enabled()) { - fprintf(stderr, "Kernel or Flash image must be specified\n"); + error_report("Kernel or Flash image must be specified"); exit(1); } =20 diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index db860c238e..5805a2c858 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -8,6 +8,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -2062,7 +2063,7 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space, s =3D g_new0(PXA2xxState, 1); =20 if (strncmp(cpu_type, "pxa27", 5)) { - fprintf(stderr, "Machine requires a PXA27x processor.\n"); + error_report("Machine requires a PXA27x processor"); exit(1); } =20 @@ -2095,7 +2096,7 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space, =20 dinfo =3D drive_get(IF_SD, 0, 0); if (!dinfo) { - fprintf(stderr, "qemu: missing SecureDigital device\n"); + error_report("missing SecureDigital device"); exit(1); } s->mmc =3D pxa2xx_mmci_init(address_space, 0x41100000, @@ -2220,7 +2221,7 @@ PXA2xxState *pxa255_init(MemoryRegion *address_space,= unsigned int sdram_size) =20 dinfo =3D drive_get(IF_SD, 0, 0); if (!dinfo) { - fprintf(stderr, "qemu: missing SecureDigital device\n"); + error_report("missing SecureDigital device"); exit(1); } s->mmc =3D pxa2xx_mmci_init(address_space, 0x41100000, diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index efb5a29475..dc5928ae1a 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -266,7 +266,7 @@ static void a9_daughterboard_init(const VexpressMachine= State *vms, =20 if (ram_size > 0x40000000) { /* 1GB is the maximum the address space permits */ - fprintf(stderr, "vexpress-a9: cannot model more than 1GB RAM\n"); + error_report("vexpress-a9: cannot model more than 1GB RAM"); exit(1); } =20 @@ -355,7 +355,7 @@ static void a15_daughterboard_init(const VexpressMachin= eState *vms, */ uint64_t rsz =3D ram_size; if (rsz > (30ULL * 1024 * 1024 * 1024)) { - fprintf(stderr, "vexpress-a15: cannot model more than 30GB RAM= \n"); + error_report("vexpress-a15: cannot model more than 30GB RAM"); exit(1); } } @@ -640,7 +640,7 @@ static void vexpress_common_init(MachineState *machine) pflash0 =3D ve_pflash_cfi01_register(map[VE_NORFLASH0], "vexpress.flas= h0", dinfo); if (!pflash0) { - fprintf(stderr, "vexpress: error registering flash 0.\n"); + error_report("vexpress: error registering flash 0"); exit(1); } =20 @@ -655,7 +655,7 @@ static void vexpress_common_init(MachineState *machine) dinfo =3D drive_get_next(IF_PFLASH); if (!ve_pflash_cfi01_register(map[VE_NORFLASH1], "vexpress.flash1", dinfo)) { - fprintf(stderr, "vexpress: error registering flash 1.\n"); + error_report("vexpress: error registering flash 1"); exit(1); } =20 diff --git a/hw/arm/z2.c b/hw/arm/z2.c index 300e933c82..730a5392e9 100644 --- a/hw/arm/z2.c +++ b/hw/arm/z2.c @@ -320,8 +320,8 @@ static void z2_init(MachineState *machine) #endif dinfo =3D drive_get(IF_PFLASH, 0, 0); if (!dinfo && !qtest_enabled()) { - fprintf(stderr, "Flash image must be given with the " - "'pflash' parameter\n"); + error_report("Flash image must be given with the " + "'pflash' parameter"); exit(1); } =20 @@ -330,7 +330,7 @@ static void z2_init(MachineState *machine) dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, sector_len, Z2_FLASH_SIZE / sector_len, 4, 0, 0, 0, 0, be)) { - fprintf(stderr, "qemu: Error registering flash memory.\n"); + error_report("Error registering flash memory"); exit(1); } =20 --=20 2.13.6 From nobody Thu May 2 02:16:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517948991168485.1949068662808; Tue, 6 Feb 2018 12:29:51 -0800 (PST) Received: from localhost ([::1]:57741 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9sD-0006Ki-8a for importer@patchew.org; Tue, 06 Feb 2018 15:29:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9Ga-00032s-0u for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej9GW-0003t6-Tz for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:55 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58038 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej9GW-0003rc-Ig for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:52 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3D36AEAE83; Tue, 6 Feb 2018 19:50:49 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-148.ams2.redhat.com [10.36.116.148]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E546A111DCE7; Tue, 6 Feb 2018 19:50:45 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C723C113864E; Tue, 6 Feb 2018 20:50:44 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 6 Feb 2018 20:50:34 +0100 Message-Id: <20180206195044.8347-5-armbru@redhat.com> In-Reply-To: <20180206195044.8347-1-armbru@redhat.com> References: <20180206195044.8347-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 06 Feb 2018 19:50:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 06 Feb 2018 19:50:49 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 04/14] hw/dma: Replace fprintf(stderr, "*\n" with error_report() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_= report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_re= port("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report= ("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("= \1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1= "\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\= 2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2)= ;|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|= Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig= }' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}'= \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Conversions that aren't followed by exit() dropped, because they might be inappropriate. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20180203084315.20497-4-armbru@redhat.com> Reviewed-by: Thomas Huth --- hw/dma/soc_dma.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c index 9bb499bf9c..45516241c6 100644 --- a/hw/dma/soc_dma.c +++ b/hw/dma/soc_dma.c @@ -18,6 +18,7 @@ * with this program; if not, see . */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "qemu/timer.h" #include "hw/arm/soc_dma.h" @@ -270,11 +271,11 @@ void soc_dma_port_add_fifo(struct soc_dma_s *soc, hwa= ddr virt_base, if (entry->type =3D=3D soc_dma_port_mem) { if (entry->addr <=3D virt_base && entry->addr + entry->u.mem.size > virt_base) { - fprintf(stderr, "%s: FIFO at %"PRIx64 - " collides with RAM region at %"PRIx64 - "-%"PRIx64 "\n", __func__, - virt_base, entry->addr, - (entry->addr + entry->u.mem.size)); + error_report("%s: FIFO at %"PRIx64 + " collides with RAM region at %"PRIx64 + "-%"PRIx64, __func__, + virt_base, entry->addr, + (entry->addr + entry->u.mem.size)); exit(-1); } =20 @@ -284,9 +285,9 @@ void soc_dma_port_add_fifo(struct soc_dma_s *soc, hwadd= r virt_base, while (entry < dma->memmap + dma->memmap_size && entry->addr <=3D virt_base) { if (entry->addr =3D=3D virt_base && entry->u.fifo.out =3D= =3D out) { - fprintf(stderr, "%s: FIFO at %"PRIx64 - " collides FIFO at %"PRIx64 "\n", - __func__, virt_base, entry->addr); + error_report("%s: FIFO at %"PRIx64 + " collides FIFO at %"PRIx64, + __func__, virt_base, entry->addr); exit(-1); } =20 @@ -321,11 +322,11 @@ void soc_dma_port_add_mem(struct soc_dma_s *soc, uint= 8_t *phys_base, if ((entry->addr >=3D virt_base && entry->addr < virt_base + s= ize) || (entry->addr <=3D virt_base && entry->addr + entry->u.mem.size > virt_base))= { - fprintf(stderr, "%s: RAM at %"PRIx64 "-%"PRIx64 - " collides with RAM region at %"PRIx64 - "-%"PRIx64 "\n", __func__, - virt_base, virt_base + size, - entry->addr, entry->addr + entry->u.mem.si= ze); + error_report("%s: RAM at %"PRIx64 "-%"PRIx64 + " collides with RAM region at %"PRIx64 + "-%"PRIx64, __func__, + virt_base, virt_base + size, + entry->addr, entry->addr + entry->u.mem.size); exit(-1); } =20 @@ -334,11 +335,10 @@ void soc_dma_port_add_mem(struct soc_dma_s *soc, uint= 8_t *phys_base, } else { if (entry->addr >=3D virt_base && entry->addr < virt_base + size) { - fprintf(stderr, "%s: RAM at %"PRIx64 "-%"PRIx64 - " collides with FIFO at %"PRIx64 - "\n", __func__, - virt_base, virt_base + size, - entry->addr); + error_report("%s: RAM at %"PRIx64 "-%"PRIx64 + " collides with FIFO at %"PRIx64, + __func__, virt_base, virt_base + size, + entry->addr); exit(-1); } =20 --=20 2.13.6 From nobody Thu May 2 02:16:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517948342794372.9512011029316; Tue, 6 Feb 2018 12:19:02 -0800 (PST) Received: from localhost ([::1]:56135 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9hl-00047q-SC for importer@patchew.org; Tue, 06 Feb 2018 15:19:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9Ga-000332-2A for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej9GW-0003t0-TN for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:55 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58042 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej9GW-0003ra-II for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:52 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 76252EAE95; Tue, 6 Feb 2018 19:50:50 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-148.ams2.redhat.com [10.36.116.148]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 03505946A0; Tue, 6 Feb 2018 19:50:50 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id CC5A8113864F; Tue, 6 Feb 2018 20:50:44 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 6 Feb 2018 20:50:35 +0100 Message-Id: <20180206195044.8347-6-armbru@redhat.com> In-Reply-To: <20180206195044.8347-1-armbru@redhat.com> References: <20180206195044.8347-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 06 Feb 2018 19:50:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 06 Feb 2018 19:50:50 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 05/14] hw/lm32: Replace fprintf(stderr, "*\n" with error_report() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Walle , Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_= report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_re= port("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report= ("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("= \1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1= "\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\= 2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2)= ;|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|= Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig= }' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}'= \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Michael Walle Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael Walle Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20180203084315.20497-5-armbru@redhat.com> --- hw/lm32/lm32_boards.c | 7 +++---- hw/lm32/milkymist.c | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c index 002d638edd..527bcc229c 100644 --- a/hw/lm32/lm32_boards.c +++ b/hw/lm32/lm32_boards.c @@ -18,6 +18,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "cpu.h" #include "hw/sysbus.h" @@ -148,8 +149,7 @@ static void lm32_evr_init(MachineState *machine) } =20 if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } } @@ -242,8 +242,7 @@ static void lm32_uclinux_init(MachineState *machine) } =20 if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } } diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c index d4e765f2eb..85d64fe58d 100644 --- a/hw/lm32/milkymist.c +++ b/hw/lm32/milkymist.c @@ -18,6 +18,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "cpu.h" #include "hw/sysbus.h" @@ -145,8 +146,7 @@ milkymist_init(MachineState *machine) =20 /* if no kernel is given no valid bios rom is a fatal error */ if (!kernel_filename && !dinfo && !bios_filename && !qtest_enabled()) { - fprintf(stderr, "qemu: could not load Milkymist One bios '%s'\n", - bios_name); + error_report("could not load Milkymist One bios '%s'", bios_name); exit(1); } g_free(bios_filename); @@ -184,8 +184,7 @@ milkymist_init(MachineState *machine) } =20 if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } } --=20 2.13.6 From nobody Thu May 2 02:16:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517948539540903.9816046314802; Tue, 6 Feb 2018 12:22:19 -0800 (PST) Received: from localhost ([::1]:56845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9kw-0007aO-LZ for importer@patchew.org; Tue, 06 Feb 2018 15:22:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9Ga-00032z-1l for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej9GW-0003sq-S4 for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:55 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50526 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej9GW-0003rf-IE for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:52 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9363640363BB; Tue, 6 Feb 2018 19:50:50 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-148.ams2.redhat.com [10.36.116.148]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 28FDB2024CA2; Tue, 6 Feb 2018 19:50:50 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D21811138650; Tue, 6 Feb 2018 20:50:44 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 6 Feb 2018 20:50:36 +0100 Message-Id: <20180206195044.8347-7-armbru@redhat.com> In-Reply-To: <20180206195044.8347-1-armbru@redhat.com> References: <20180206195044.8347-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 06 Feb 2018 19:50:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 06 Feb 2018 19:50:50 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 06/14] hw/mips: Replace fprintf(stderr, "*\n" with error_report() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yongbok Kim , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Paul Burton , Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_= report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_re= port("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report= ("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("= \1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1= "\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\= 2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2)= ;|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|= Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig= }' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}'= \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Paul Burton Cc: Aurelien Jarno Cc: Yongbok Kim Cc: "Herv=C3=A9 Poussineau" Conversions that aren't followed by exit() dropped, because they might be inappropriate. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20180203084315.20497-6-armbru@redhat.com> --- hw/mips/mips_fulong2e.c | 13 ++++++------- hw/mips/mips_jazz.c | 4 ++-- hw/mips/mips_malta.c | 16 +++++++--------- hw/mips/mips_mipssim.c | 11 +++++------ hw/mips/mips_r4k.c | 16 +++++++--------- 5 files changed, 27 insertions(+), 33 deletions(-) diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index 725e25a134..f68c625666 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -120,7 +120,7 @@ static int64_t load_kernel (CPUMIPSState *env) (uint64_t *)&kernel_low, (uint64_t *)&kernel_hi= gh, 0, EM_MIPS, 1, 0); if (kernel_size < 0) { - error_report("qemu: could not load kernel '%s': %s", + error_report("could not load kernel '%s': %s", loaderparams.kernel_filename, load_elf_strerror(kernel_size)); exit(1); @@ -134,17 +134,16 @@ static int64_t load_kernel (CPUMIPSState *env) if (initrd_size > 0) { initrd_offset =3D (kernel_high + ~INITRD_PAGE_MASK) & INITRD_P= AGE_MASK; if (initrd_offset + initrd_size > ram_size) { - fprintf(stderr, - "qemu: memory too small for initial ram disk '%s'\= n", - loaderparams.initrd_filename); + error_report("memory too small for initial ram disk '%s'", + loaderparams.initrd_filename); exit(1); } initrd_size =3D load_image_targphys(loaderparams.initrd_filena= me, initrd_offset, ram_size - initrd_offs= et); } if (initrd_size =3D=3D (target_ulong) -1) { - fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", - loaderparams.initrd_filename); + error_report("could not load initial ram disk '%s'", + loaderparams.initrd_filename); exit(1); } } @@ -338,7 +337,7 @@ static void mips_fulong2e_init(MachineState *machine) =20 isa_bus =3D vt82c686b_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 0)); if (!isa_bus) { - fprintf(stderr, "vt82c686b_init error\n"); + error_report("vt82c686b_init error"); exit(1); } =20 diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c index 0d2c0683ba..596f3c210e 100644 --- a/hw/mips/mips_jazz.c +++ b/hw/mips/mips_jazz.c @@ -268,10 +268,10 @@ static void mips_jazz_init(MachineState *machine, sysbus_connect_irq(sysbus, 0, qdev_get_gpio_in(rc4030, 4)); break; } else if (is_help_option(nd->model)) { - fprintf(stderr, "qemu: Supported NICs: dp83932\n"); + error_report("Supported NICs: dp83932"); exit(1); } else { - fprintf(stderr, "qemu: Unsupported NIC: %s\n", nd->model); + error_report("Unsupported NIC: %s", nd->model); exit(1); } } diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 37f19428d6..7ca8ba2086 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -812,7 +812,7 @@ static int64_t load_kernel (void) NULL, (uint64_t *)&kernel_entry, NULL, (uint64_t *)&kernel_high, big_endian, EM_MIPS, = 1, 0); if (kernel_size < 0) { - error_report("qemu: could not load kernel '%s': %s", + error_report("could not load kernel '%s': %s", loaderparams.kernel_filename, load_elf_strerror(kernel_size)); exit(1); @@ -846,9 +846,8 @@ static int64_t load_kernel (void) initrd_offset =3D (loaderparams.ram_low_size - initrd_size - 1= 31072 - ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK; if (kernel_high >=3D initrd_offset) { - fprintf(stderr, - "qemu: memory too small for initial ram disk '%s'\= n", - loaderparams.initrd_filename); + error_report("memory too small for initial ram disk '%s'", + loaderparams.initrd_filename); exit(1); } initrd_size =3D load_image_targphys(loaderparams.initrd_filena= me, @@ -856,8 +855,8 @@ static int64_t load_kernel (void) ram_size - initrd_offset); } if (initrd_size =3D=3D (target_ulong) -1) { - fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", - loaderparams.initrd_filename); + error_report("could not load initial ram disk '%s'", + loaderparams.initrd_filename); exit(1); } } @@ -1034,9 +1033,8 @@ void mips_malta_init(MachineState *machine) =20 /* allocate RAM */ if (ram_size > (2048u << 20)) { - fprintf(stderr, - "qemu: Too much memory for this machine: %d MB, maximum 20= 48 MB\n", - ((unsigned int)ram_size / (1 << 20))); + error_report("Too much memory for this machine: %dMB, maximum 2048= MB", + ((unsigned int)ram_size / (1 << 20))); exit(1); } =20 diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c index e5d3654586..e0ba5efc84 100644 --- a/hw/mips/mips_mipssim.c +++ b/hw/mips/mips_mipssim.c @@ -78,7 +78,7 @@ static int64_t load_kernel(void) if ((entry & ~0x7fffffffULL) =3D=3D 0x80000000) entry =3D (int32_t)entry; } else { - error_report("qemu: could not load kernel '%s': %s", + error_report("could not load kernel '%s': %s", loaderparams.kernel_filename, load_elf_strerror(kernel_size)); exit(1); @@ -92,17 +92,16 @@ static int64_t load_kernel(void) if (initrd_size > 0) { initrd_offset =3D (kernel_high + ~INITRD_PAGE_MASK) & INITRD_P= AGE_MASK; if (initrd_offset + initrd_size > loaderparams.ram_size) { - fprintf(stderr, - "qemu: memory too small for initial ram disk '%s'\= n", - loaderparams.initrd_filename); + error_report("memory too small for initial ram disk '%s'", + loaderparams.initrd_filename); exit(1); } initrd_size =3D load_image_targphys(loaderparams.initrd_filena= me, initrd_offset, loaderparams.ram_size - initrd_offset); } if (initrd_size =3D=3D (target_ulong) -1) { - fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", - loaderparams.initrd_filename); + error_report("could not load initial ram disk '%s'", + loaderparams.initrd_filename); exit(1); } } diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c index 244bd41813..830ee7732c 100644 --- a/hw/mips/mips_r4k.c +++ b/hw/mips/mips_r4k.c @@ -98,7 +98,7 @@ static int64_t load_kernel(void) if ((entry & ~0x7fffffffULL) =3D=3D 0x80000000) entry =3D (int32_t)entry; } else { - error_report("qemu: could not load kernel '%s': %s", + error_report("could not load kernel '%s': %s", loaderparams.kernel_filename, load_elf_strerror(kernel_size)); exit(1); @@ -112,9 +112,8 @@ static int64_t load_kernel(void) if (initrd_size > 0) { initrd_offset =3D (kernel_high + ~INITRD_PAGE_MASK) & INITRD_P= AGE_MASK; if (initrd_offset + initrd_size > ram_size) { - fprintf(stderr, - "qemu: memory too small for initial ram disk '%s'\= n", - loaderparams.initrd_filename); + error_report("memory too small for initial ram disk '%s'", + loaderparams.initrd_filename); exit(1); } initrd_size =3D load_image_targphys(loaderparams.initrd_filena= me, @@ -122,8 +121,8 @@ static int64_t load_kernel(void) ram_size - initrd_offset); } if (initrd_size =3D=3D (target_ulong) -1) { - fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", - loaderparams.initrd_filename); + error_report("could not load initial ram disk '%s'", + loaderparams.initrd_filename); exit(1); } } @@ -196,9 +195,8 @@ void mips_r4k_init(MachineState *machine) =20 /* allocate RAM */ if (ram_size > (256 << 20)) { - fprintf(stderr, - "qemu: Too much memory for this machine: %d MB, maximum 25= 6 MB\n", - ((unsigned int)ram_size / (1 << 20))); + error_report("Too much memory for this machine: %dMB, maximum 256M= B", + ((unsigned int)ram_size / (1 << 20))); exit(1); } memory_region_allocate_system_memory(ram, NULL, "mips_r4k.ram", ram_si= ze); --=20 2.13.6 From nobody Thu May 2 02:16:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517949380418267.85843879810693; Tue, 6 Feb 2018 12:36:20 -0800 (PST) Received: from localhost ([::1]:59042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9yU-0005sF-QT for importer@patchew.org; Tue, 06 Feb 2018 15:36:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9Ga-000336-4F for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej9GW-0003sX-Qj for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:55 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33140 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej9GW-0003rY-HB for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:52 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6CE1B40201A2; Tue, 6 Feb 2018 19:50:50 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-148.ams2.redhat.com [10.36.116.148]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2CF982024CA5; Tue, 6 Feb 2018 19:50:50 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D5E731138651; Tue, 6 Feb 2018 20:50:44 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 6 Feb 2018 20:50:37 +0100 Message-Id: <20180206195044.8347-8-armbru@redhat.com> In-Reply-To: <20180206195044.8347-1-armbru@redhat.com> References: <20180206195044.8347-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 06 Feb 2018 19:50:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 06 Feb 2018 19:50:50 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 07/14] hw/moxie: Replace fprintf(stderr, "*\n" with error_report() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anthony Green , Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_= report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_re= port("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report= ("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("= \1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1= "\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\= 2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2)= ;|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|= Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig= }' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}'= \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Anthony Green Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20180203084315.20497-7-armbru@redhat.com> --- hw/moxie/moxiesim.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/moxie/moxiesim.c b/hw/moxie/moxiesim.c index 6c200becab..0bbf770795 100644 --- a/hw/moxie/moxiesim.c +++ b/hw/moxie/moxiesim.c @@ -63,8 +63,8 @@ static void load_kernel(MoxieCPU *cpu, LoaderParams *load= er_params) 0, 0); =20 if (kernel_size <=3D 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - loader_params->kernel_filename); + error_report("could not load kernel '%s'", + loader_params->kernel_filename); exit(1); } =20 @@ -77,9 +77,8 @@ static void load_kernel(MoxieCPU *cpu, LoaderParams *load= er_params) initrd_offset =3D (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK; if (initrd_offset + initrd_size > loader_params->ram_size) { - fprintf(stderr, - "qemu: memory too small for initial ram disk '%s'\= n", - loader_params->initrd_filename); + error_report("memory too small for initial ram disk '%s'", + loader_params->initrd_filename); exit(1); } initrd_size =3D load_image_targphys(loader_params->initrd_file= name, @@ -87,8 +86,8 @@ static void load_kernel(MoxieCPU *cpu, LoaderParams *load= er_params) ram_size); } if (initrd_size =3D=3D (target_ulong)-1) { - fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", - loader_params->initrd_filename); + error_report("could not load initial ram disk '%s'", + loader_params->initrd_filename); exit(1); } } --=20 2.13.6 From nobody Thu May 2 02:16:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15179492125741.88538688445567; Tue, 6 Feb 2018 12:33:32 -0800 (PST) Received: from localhost ([::1]:58745 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9vi-0002Cn-SY for importer@patchew.org; Tue, 06 Feb 2018 15:33:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9Ga-000333-2M for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej9GW-0003si-RD for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:56 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58040 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej9GW-0003rZ-HH for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:52 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 44E80EAE8B; Tue, 6 Feb 2018 19:50:50 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-148.ams2.redhat.com [10.36.116.148]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 20BA4111E3E9; Tue, 6 Feb 2018 19:50:50 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id DB0011138656; Tue, 6 Feb 2018 20:50:44 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 6 Feb 2018 20:50:38 +0100 Message-Id: <20180206195044.8347-9-armbru@redhat.com> In-Reply-To: <20180206195044.8347-1-armbru@redhat.com> References: <20180206195044.8347-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 06 Feb 2018 19:50:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 06 Feb 2018 19:50:50 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 08/14] hw/openrisc: Replace fprintf(stderr, "*\n" with error_report() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stafford Horne , Jia Liu , Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_= report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_re= port("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report= ("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("= \1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1= "\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\= 2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2)= ;|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|= Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig= }' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}'= \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Jia Liu Cc: Stafford Horne Acked-by: Stafford Horne Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20180203084315.20497-8-armbru@redhat.com> --- hw/openrisc/openrisc_sim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/openrisc/openrisc_sim.c b/hw/openrisc/openrisc_sim.c index e9558f1ca4..c755f11efd 100644 --- a/hw/openrisc/openrisc_sim.c +++ b/hw/openrisc/openrisc_sim.c @@ -19,6 +19,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -114,8 +115,7 @@ static void openrisc_load_kernel(ram_addr_t ram_size, } =20 if (kernel_size < 0) { - fprintf(stderr, "QEMU: couldn't load the kernel '%s'\n", - kernel_filename); + error_report("couldn't load the kernel '%s'", kernel_filename); exit(1); } boot_info.bootstrap_pc =3D entry; --=20 2.13.6 From nobody Thu May 2 02:16:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 151794796579822.131137870965745; Tue, 6 Feb 2018 12:12:45 -0800 (PST) Received: from localhost ([::1]:55388 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9bg-0006Vv-Uj for importer@patchew.org; Tue, 06 Feb 2018 15:12:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9Ga-000330-1y for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej9GW-0003t5-US for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:56 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50524 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej9GW-0003re-Hn for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:52 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 74A6D40363AD; Tue, 6 Feb 2018 19:50:50 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-148.ams2.redhat.com [10.36.116.148]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 28D402166BB6; Tue, 6 Feb 2018 19:50:50 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id DFA7E1138657; Tue, 6 Feb 2018 20:50:44 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 6 Feb 2018 20:50:39 +0100 Message-Id: <20180206195044.8347-10-armbru@redhat.com> In-Reply-To: <20180206195044.8347-1-armbru@redhat.com> References: <20180206195044.8347-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 06 Feb 2018 19:50:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 06 Feb 2018 19:50:50 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 09/14] hw/pci*: Replace fprintf(stderr, "*\n" with error_report() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marcel Apfelbaum , "Michael S. Tsirkin" , Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_= report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_re= port("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report= ("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("= \1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1= "\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\= 2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2)= ;|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|= Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig= }' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}'= \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. A trailing '.' was removed in hw/pci/pci.c Signed-off-by: Alistair Francis Cc: "Michael S. Tsirkin" Cc: Marcel Apfelbaum Conversions that aren't followed by exit() dropped, because they might be inappropriate. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20180203084315.20497-9-armbru@redhat.com> --- hw/pci-host/bonito.c | 6 +++--- hw/pci/pci.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index 0d8cacb884..2d25e9bf7c 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -38,7 +38,7 @@ */ =20 #include "qemu/osdep.h" - +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/pci/pci.h" #include "hw/i386/pc.h" @@ -449,8 +449,8 @@ static uint32_t bonito_sbridge_pciaddr(void *opaque, hw= addr addr) regno =3D (cfgaddr & BONITO_PCICONF_REG_MASK) >> BONITO_PCICONF_REG_OF= FSET; =20 if (idsel =3D=3D 0) { - fprintf(stderr, "error in bonito pci config address " TARGET_FMT_p= lx - ",pcimap_cfg=3D%x\n", addr, s->regs[BONITO_PCIMAP_CFG]); + error_report("error in bonito pci config address " TARGET_FMT_plx + ",pcimap_cfg=3D%x", addr, s->regs[BONITO_PCIMAP_CFG]); exit(1); } pciaddr =3D PCI_ADDR(pci_bus_num(phb->bus), devno, funno, regno); diff --git a/hw/pci/pci.c b/hw/pci/pci.c index e8f9fc1c27..fc25cdecba 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1115,8 +1115,8 @@ void pci_register_bar(PCIDevice *pci_dev, int region_= num, assert(region_num >=3D 0); assert(region_num < PCI_NUM_REGIONS); if (size & (size-1)) { - fprintf(stderr, "ERROR: PCI region size must be pow2 " - "type=3D0x%x, size=3D0x%"FMT_PCIBUS"\n", type, size); + error_report("ERROR: PCI region size must be pow2 " + "type=3D0x%x, size=3D0x%"FMT_PCIBUS"", type, size); exit(1); } =20 --=20 2.13.6 From nobody Thu May 2 02:16:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 151794871592479.03609691424651; Tue, 6 Feb 2018 12:25:15 -0800 (PST) Received: from localhost ([::1]:57148 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9nm-0001ob-0w for importer@patchew.org; Tue, 06 Feb 2018 15:25:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9Ga-00032r-0x for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej9GW-0003t8-Up for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:55 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35240 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej9GW-0003rm-IU; Tue, 06 Feb 2018 14:50:52 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C44E8182D05; Tue, 6 Feb 2018 19:50:50 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-148.ams2.redhat.com [10.36.116.148]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2B495111E3EB; Tue, 6 Feb 2018 19:50:50 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E2F0B1138659; Tue, 6 Feb 2018 20:50:44 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 6 Feb 2018 20:50:40 +0100 Message-Id: <20180206195044.8347-11-armbru@redhat.com> In-Reply-To: <20180206195044.8347-1-armbru@redhat.com> References: <20180206195044.8347-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 06 Feb 2018 19:50:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 06 Feb 2018 19:50:50 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 10/14] hw/ppc: Replace fprintf(stderr, "*\n" with error_report() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_= report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_re= port("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report= ("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("= \1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1= "\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\= 2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2)= ;|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|= Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig= }' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}'= \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines were then manually tweaked to pass checkpatch and some curly braces were added to match QEMU style. Signed-off-by: Alistair Francis Cc: qemu-ppc@nongnu.org Conversions that aren't followed by exit() dropped, because they might be inappropriate. Also trim trailing punctuation from error messages. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20180203084315.20497-10-armbru@redhat.com> --- hw/ppc/e500.c | 16 ++++++++-------- hw/ppc/mac_newworld.c | 2 +- hw/ppc/mac_oldworld.c | 2 +- hw/ppc/ppc405_boards.c | 15 ++++++--------- hw/ppc/ppc440_bamboo.c | 16 ++++++++-------- hw/ppc/prep.c | 4 ++-- hw/ppc/virtex_ml507.c | 4 ++-- 7 files changed, 28 insertions(+), 31 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index c4fe06ea2a..343bba93ce 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -811,8 +811,8 @@ void ppce500_init(MachineState *machine, PPCE500Params = *params) cs =3D CPU(cpu); =20 if (env->mmu_model !=3D POWERPC_MMU_BOOKE206) { - fprintf(stderr, "MMU model %i not supported by this machine.\n= ", - env->mmu_model); + error_report("MMU model %i not supported by this machine", + env->mmu_model); exit(1); } =20 @@ -959,8 +959,8 @@ void ppce500_init(MachineState *machine, PPCE500Params = *params) cur_base, ram_size - cur_base); if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - machine->kernel_filename); + error_report("could not load kernel '%s'", + machine->kernel_filename); exit(1); } =20 @@ -974,8 +974,8 @@ void ppce500_init(MachineState *machine, PPCE500Params = *params) ram_size - initrd_base); =20 if (initrd_size < 0) { - fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", - machine->initrd_filename); + error_report("could not load initial ram disk '%s'", + machine->initrd_filename); exit(1); } =20 @@ -1016,7 +1016,7 @@ void ppce500_init(MachineState *machine, PPCE500Param= s *params) kernel_size =3D load_uimage(filename, &bios_entry, &loadaddr, NULL, NULL, NULL); if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load firmware '%s'\n", filena= me); + error_report("could not load firmware '%s'", filename); exit(1); } } @@ -1029,7 +1029,7 @@ void ppce500_init(MachineState *machine, PPCE500Param= s *params) initrd_base, initrd_size, kernel_base, kernel_size); if (dt_size < 0) { - fprintf(stderr, "couldn't load device tree\n"); + error_report("couldn't load device tree"); exit(1); } assert(dt_size < DTB_MAX_SIZE); diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 3fa7c429d5..b832417a56 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -270,7 +270,7 @@ static void ppc_core99_init(MachineState *machine) } } if (ppc_boot_device =3D=3D '\0') { - fprintf(stderr, "No valid boot device for Mac99 machine\n"); + error_report("No valid boot device for Mac99 machine"); exit(1); } } diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 010ea36bf2..d1f4546613 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -218,7 +218,7 @@ static void ppc_heathrow_init(MachineState *machine) #endif } if (ppc_boot_device =3D=3D '\0') { - fprintf(stderr, "No valid boot device for G3 Beige machine\n"); + error_report("No valid boot device for G3 Beige machine"); exit(1); } } diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c index 6f7f2ee168..0b658931ee 100644 --- a/hw/ppc/ppc405_boards.c +++ b/hw/ppc/ppc405_boards.c @@ -331,8 +331,7 @@ static void ref405ep_init(MachineState *machine) kernel_size =3D load_image_targphys(kernel_filename, kernel_base, ram_size - kernel_base); if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } printf("Load kernel size %ld at " TARGET_FMT_lx, @@ -343,8 +342,8 @@ static void ref405ep_init(MachineState *machine) initrd_size =3D load_image_targphys(initrd_filename, initrd_ba= se, ram_size - initrd_base); if (initrd_size < 0) { - fprintf(stderr, "qemu: could not load initial ram disk '%s= '\n", - initrd_filename); + error_report("could not load initial ram disk '%s'", + initrd_filename); exit(1); } } else { @@ -621,8 +620,7 @@ static void taihu_405ep_init(MachineState *machine) kernel_size =3D load_image_targphys(kernel_filename, kernel_base, ram_size - kernel_base); if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } /* load initrd */ @@ -631,9 +629,8 @@ static void taihu_405ep_init(MachineState *machine) initrd_size =3D load_image_targphys(initrd_filename, initrd_ba= se, ram_size - initrd_base); if (initrd_size < 0) { - fprintf(stderr, - "qemu: could not load initial ram disk '%s'\n", - initrd_filename); + error_report("could not load initial ram disk '%s'", + initrd_filename); exit(1); } } else { diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c index a299206fd4..8641986a71 100644 --- a/hw/ppc/ppc440_bamboo.c +++ b/hw/ppc/ppc440_bamboo.c @@ -12,6 +12,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "qemu/error-report.h" #include "net/net.h" @@ -188,8 +189,8 @@ static void bamboo_init(MachineState *machine) env =3D &cpu->env; =20 if (env->mmu_model !=3D POWERPC_MMU_BOOKE) { - fprintf(stderr, "MMU model %i not supported by this machine.\n", - env->mmu_model); + error_report("MMU model %i not supported by this machine", + env->mmu_model); exit(1); } =20 @@ -229,7 +230,7 @@ static void bamboo_init(MachineState *machine) NULL); pcibus =3D (PCIBus *)qdev_get_child_bus(dev, "pci.0"); if (!pcibus) { - fprintf(stderr, "couldn't create PCI controller!\n"); + error_report("couldn't create PCI controller"); exit(1); } =20 @@ -270,8 +271,7 @@ static void bamboo_init(MachineState *machine) } /* XXX try again as binary */ if (success < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } } @@ -282,8 +282,8 @@ static void bamboo_init(MachineState *machine) ram_size - RAMDISK_ADDR); =20 if (initrd_size < 0) { - fprintf(stderr, "qemu: could not load ram disk '%s' at %x\n", - initrd_filename, RAMDISK_ADDR); + error_report("could not load ram disk '%s' at %x", + initrd_filename, RAMDISK_ADDR); exit(1); } } @@ -292,7 +292,7 @@ static void bamboo_init(MachineState *machine) if (kernel_filename) { if (bamboo_load_device_tree(FDT_ADDR, ram_size, RAMDISK_ADDR, initrd_size, kernel_cmdline) < 0) { - fprintf(stderr, "couldn't load device tree\n"); + error_report("couldn't load device tree"); exit(1); } } diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index af08ac319a..096d4d4cfb 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -574,7 +574,7 @@ static void ppc_prep_init(MachineState *machine) } } if (ppc_boot_device =3D=3D '\0') { - fprintf(stderr, "No valid boot device for Mac99 machine\n"); + error_report("No valid boot device for Mac99 machine"); exit(1); } } @@ -595,7 +595,7 @@ static void ppc_prep_init(MachineState *machine) qdev_init_nofail(dev); pci_bus =3D (PCIBus *)qdev_get_child_bus(dev, "pci.0"); if (pci_bus =3D=3D NULL) { - fprintf(stderr, "Couldn't create PCI host controller.\n"); + error_report("Couldn't create PCI host controller"); exit(1); } sysctrl->contiguous_map_irq =3D qdev_get_gpio_in(dev, 0); diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c index 9fe7655074..485d9affb2 100644 --- a/hw/ppc/virtex_ml507.c +++ b/hw/ppc/virtex_ml507.c @@ -223,8 +223,8 @@ static void virtex_init(MachineState *machine) env =3D &cpu->env; =20 if (env->mmu_model !=3D POWERPC_MMU_BOOKE) { - fprintf(stderr, "MMU model %i not supported by this machine.\n", - env->mmu_model); + error_report("MMU model %i not supported by this machine", + env->mmu_model); exit(1); } =20 --=20 2.13.6 From nobody Thu May 2 02:16:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517949209925220.85225953124223; Tue, 6 Feb 2018 12:33:29 -0800 (PST) Received: from localhost ([::1]:58709 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9vc-000239-24 for importer@patchew.org; Tue, 06 Feb 2018 15:33:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9Ga-00032q-0D for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej9GW-0003sK-Nv for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:55 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50522 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej9GW-0003rX-I4 for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:50:52 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 66D26402B030; Tue, 6 Feb 2018 19:50:50 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-148.ams2.redhat.com [10.36.116.148]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4366D946A6; Tue, 6 Feb 2018 19:50:50 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E80F9113865A; Tue, 6 Feb 2018 20:50:44 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 6 Feb 2018 20:50:41 +0100 Message-Id: <20180206195044.8347-12-armbru@redhat.com> In-Reply-To: <20180206195044.8347-1-armbru@redhat.com> References: <20180206195044.8347-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 06 Feb 2018 19:50:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 06 Feb 2018 19:50:50 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 11/14] hw/sd: Replace fprintf(stderr, "*\n" with DPRINTF() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Signed-off-by: Alistair Francis [Most of original patch dropped, commit message replaced to match what's left] Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20180203084315.20497-11-armbru@redhat.com> Reviewed-by: Thomas Huth --- hw/sd/sd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 35347a5bbc..73e405a04f 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1564,9 +1564,10 @@ send_response: if (rsplen) { int i; DPRINTF("Response:"); - for (i =3D 0; i < rsplen; i++) - fprintf(stderr, " %02x", response[i]); - fprintf(stderr, " state %d\n", sd->state); + for (i =3D 0; i < rsplen; i++) { + DPRINTF(" %02x", response[i]); + } + DPRINTF(" state %d\n", sd->state); } else { DPRINTF("No response %d\n", sd->state); } --=20 2.13.6 From nobody Thu May 2 02:16:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517949569419327.8574976381184; Tue, 6 Feb 2018 12:39:29 -0800 (PST) Received: from localhost ([::1]:59067 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejA1Y-0000BN-J4 for importer@patchew.org; Tue, 06 Feb 2018 15:39:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9Gf-0003CT-VG for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:51:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej9Ge-00043H-Dl for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:51:02 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40146 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej9Ge-00042E-4I for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:51:00 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B102140FB62B; Tue, 6 Feb 2018 19:50:50 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-148.ams2.redhat.com [10.36.116.148]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 50E612166BDA; Tue, 6 Feb 2018 19:50:50 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id ECDAE1138662; Tue, 6 Feb 2018 20:50:44 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 6 Feb 2018 20:50:42 +0100 Message-Id: <20180206195044.8347-13-armbru@redhat.com> In-Reply-To: <20180206195044.8347-1-armbru@redhat.com> References: <20180206195044.8347-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 06 Feb 2018 19:50:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 06 Feb 2018 19:50:50 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 12/14] hw/sparc*: Replace fprintf(stderr, "*\n" with error_report() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Cave-Ayland , Artyom Tarasenko , Fabien Chouteau , Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_= report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_re= port("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report= ("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("= \1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1= "\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\= 2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2)= ;|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|= Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig= }' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}'= \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Fabien Chouteau Cc: Mark Cave-Ayland Cc: Artyom Tarasenko Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Mark Cave-Ayland Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20180203084315.20497-12-armbru@redhat.com> --- hw/sparc/leon3.c | 16 +++++++--------- hw/sparc/sun4m.c | 16 +++++++--------- hw/sparc64/niagara.c | 4 ++-- hw/sparc64/sun4u.c | 10 +++++----- 4 files changed, 21 insertions(+), 25 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index 8c66d5af24..bba3aa3dee 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -139,9 +140,8 @@ static void leon3_generic_hw_init(MachineState *machine) =20 /* Allocate RAM */ if ((uint64_t)ram_size > (1UL << 30)) { - fprintf(stderr, - "qemu: Too much memory for this machine: %d, maximum 1G\n", - (unsigned int)(ram_size / (1024 * 1024))); + error_report("Too much memory for this machine: %d, maximum 1G", + (unsigned int)(ram_size / (1024 * 1024))); exit(1); } =20 @@ -167,19 +167,18 @@ static void leon3_generic_hw_init(MachineState *machi= ne) } =20 if (bios_size > prom_size) { - fprintf(stderr, "qemu: could not load prom '%s': file too big\n", - filename); + error_report("could not load prom '%s': file too big", filename); exit(1); } =20 if (bios_size > 0) { ret =3D load_image_targphys(filename, 0x00000000, bios_size); if (ret < 0 || ret > prom_size) { - fprintf(stderr, "qemu: could not load prom '%s'\n", filename); + error_report("could not load prom '%s'", filename); exit(1); } } else if (kernel_filename =3D=3D NULL && !qtest_enabled()) { - fprintf(stderr, "Can't read bios image %s\n", filename); + error_report("Can't read bios image %s", filename); exit(1); } g_free(filename); @@ -192,8 +191,7 @@ static void leon3_generic_hw_init(MachineState *machine) kernel_size =3D load_elf(kernel_filename, NULL, NULL, &entry, NULL= , NULL, 1 /* big endian */, EM_SPARC, 0, 0); if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } if (bios_size <=3D 0) { diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index dd0038095b..f9892e38c3 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -259,8 +259,7 @@ static unsigned long sun4m_load_kernel(const char *kern= el_filename, KERNEL_LOAD_ADDR, RAM_size - KERNEL_LOAD_ADDR); if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } =20 @@ -271,8 +270,8 @@ static unsigned long sun4m_load_kernel(const char *kern= el_filename, INITRD_LOAD_ADDR, RAM_size - INITRD_LOAD_ADDR); if (initrd_size < 0) { - fprintf(stderr, "qemu: could not load initial ram disk '%s= '\n", - initrd_filename); + error_report("could not load initial ram disk '%s'", + initrd_filename); exit(1); } } @@ -680,7 +679,7 @@ static void prom_init(hwaddr addr, const char *bios_nam= e) ret =3D -1; } if (ret < 0 || ret > PROM_SIZE_MAX) { - fprintf(stderr, "qemu: could not load prom '%s'\n", bios_name); + error_report("could not load prom '%s'", bios_name); exit(1); } } @@ -746,10 +745,9 @@ static void ram_init(hwaddr addr, ram_addr_t RAM_size, =20 /* allocate RAM */ if ((uint64_t)RAM_size > max_mem) { - fprintf(stderr, - "qemu: Too much memory for this machine: %d, maximum %d\n", - (unsigned int)(RAM_size / (1024 * 1024)), - (unsigned int)(max_mem / (1024 * 1024))); + error_report("Too much memory for this machine: %d, maximum %d", + (unsigned int)(RAM_size / (1024 * 1024)), + (unsigned int)(max_mem / (1024 * 1024))); exit(1); } dev =3D qdev_create(NULL, "memory"); diff --git a/hw/sparc64/niagara.c b/hw/sparc64/niagara.c index 7a723326c5..996ce2ada0 100644 --- a/hw/sparc64/niagara.c +++ b/hw/sparc64/niagara.c @@ -152,8 +152,8 @@ static void niagara_init(MachineState *machine) dinfo->is_default =3D 1; rom_add_file_fixed(blk_bs(blk)->filename, NIAGARA_VDISK_BASE, = -1); } else { - fprintf(stderr, "qemu: could not load ram disk '%s'\n", - blk_bs(blk)->filename); + error_report("could not load ram disk '%s'", + blk_bs(blk)->filename); exit(1); } } diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index a23cb26b0d..da28ab9413 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -168,8 +169,7 @@ static uint64_t sun4u_load_kernel(const char *kernel_fi= lename, RAM_size - KERNEL_LOAD_ADDR); } if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } /* load initrd above kernel */ @@ -181,8 +181,8 @@ static uint64_t sun4u_load_kernel(const char *kernel_fi= lename, *initrd_addr, RAM_size - *initrd_addr); if ((int)*initrd_size < 0) { - fprintf(stderr, "qemu: could not load initial ram disk '%s= '\n", - initrd_filename); + error_report("could not load initial ram disk '%s'", + initrd_filename); exit(1); } } @@ -422,7 +422,7 @@ static void prom_init(hwaddr addr, const char *bios_nam= e) ret =3D -1; } if (ret < 0 || ret > PROM_SIZE_MAX) { - fprintf(stderr, "qemu: could not load prom '%s'\n", bios_name); + error_report("could not load prom '%s'", bios_name); exit(1); } } --=20 2.13.6 From nobody Thu May 2 02:16:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517948932534705.8984038893666; Tue, 6 Feb 2018 12:28:52 -0800 (PST) Received: from localhost ([::1]:57444 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9rB-00059r-HZ for importer@patchew.org; Tue, 06 Feb 2018 15:28:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56568) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9Gg-0003Cc-3y for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:51:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej9Ge-000438-BI for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:51:02 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35244 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej9Ge-00042D-3x for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:51:00 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B9B328182D17; Tue, 6 Feb 2018 19:50:51 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-148.ams2.redhat.com [10.36.116.148]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 73280946A8; Tue, 6 Feb 2018 19:50:51 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id F02C11138663; Tue, 6 Feb 2018 20:50:44 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 6 Feb 2018 20:50:43 +0100 Message-Id: <20180206195044.8347-14-armbru@redhat.com> In-Reply-To: <20180206195044.8347-1-armbru@redhat.com> References: <20180206195044.8347-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 06 Feb 2018 19:50:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 06 Feb 2018 19:50:51 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 13/14] hw/xen*: Replace fprintf(stderr, "*\n" with error_report() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anthony Perard , Stefano Stabellini , Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_= report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_re= port("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report= ("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("= \1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1= "\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\= 2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2)= ;|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|= Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig= }' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}'= \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. xen_pt_log() was left with an fprintf(stderr, Signed-off-by: Alistair Francis Cc: Stefano Stabellini Cc: Anthony Perard Conversions that aren't followed by exit() dropped, because they might be inappropriate. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20180203084315.20497-13-armbru@redhat.com> --- hw/xen/xen-common.c | 5 +++-- hw/xenpv/xen_machine_pv.c | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/xen/xen-common.c b/hw/xen/xen-common.c index 632a938dcc..afa1e3f404 100644 --- a/hw/xen/xen-common.c +++ b/hw/xen/xen-common.c @@ -9,6 +9,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/xen/xen_backend.h" #include "qmp-commands.h" #include "chardev/char.h" @@ -96,13 +97,13 @@ static void xenstore_record_dm_state(struct xs_handle *= xs, const char *state) char path[50]; =20 if (xs =3D=3D NULL) { - fprintf(stderr, "xenstore connection not initialized\n"); + error_report("xenstore connection not initialized"); exit(1); } =20 snprintf(path, sizeof (path), "device-model/%u/state", xen_domid); if (!xs_write(xs, XBT_NULL, path, state, strlen(state))) { - fprintf(stderr, "error recording dm state\n"); + error_report("error recording dm state"); exit(1); } } diff --git a/hw/xenpv/xen_machine_pv.c b/hw/xenpv/xen_machine_pv.c index 69a52a9f93..44d67b87c4 100644 --- a/hw/xenpv/xen_machine_pv.c +++ b/hw/xenpv/xen_machine_pv.c @@ -23,6 +23,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/boards.h" #include "hw/xen/xen_backend.h" @@ -36,7 +37,7 @@ static void xen_init_pv(MachineState *machine) =20 /* Initialize backend core & drivers */ if (xen_be_init() !=3D 0) { - fprintf(stderr, "%s: xen backend core setup failed\n", __func__); + error_report("%s: xen backend core setup failed", __func__); exit(1); } =20 @@ -51,18 +52,18 @@ static void xen_init_pv(MachineState *machine) const char *initrd_filename =3D machine->initrd_filename; if (xen_domain_build_pv(kernel_filename, initrd_filename, kernel_cmdline) < 0) { - fprintf(stderr, "xen pv domain creation failed\n"); + error_report("xen pv domain creation failed"); exit(1); } break; } #endif case XEN_EMULATE: - fprintf(stderr, "xen emulation not implemented (yet)\n"); + error_report("xen emulation not implemented (yet)"); exit(1); break; default: - fprintf(stderr, "unhandled xen_mode %d\n", xen_mode); + error_report("unhandled xen_mode %d", xen_mode); exit(1); break; } --=20 2.13.6 From nobody Thu May 2 02:16:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517949567525188.04412518655658; Tue, 6 Feb 2018 12:39:27 -0800 (PST) Received: from localhost ([::1]:59066 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejA1Q-0008Vg-Ct for importer@patchew.org; Tue, 06 Feb 2018 15:39:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9Gf-0003CO-TI for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:51:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej9Ge-00042y-A7 for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:51:01 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50532 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej9Ge-00042C-35 for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:51:00 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CEF3B4040073; Tue, 6 Feb 2018 19:50:51 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-148.ams2.redhat.com [10.36.116.148]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3DF4F2024CA2; Tue, 6 Feb 2018 19:50:51 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 014941138664; Tue, 6 Feb 2018 20:50:45 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 6 Feb 2018 20:50:44 +0100 Message-Id: <20180206195044.8347-15-armbru@redhat.com> In-Reply-To: <20180206195044.8347-1-armbru@redhat.com> References: <20180206195044.8347-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 06 Feb 2018 19:50:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 06 Feb 2018 19:50:51 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 14/14] tcg: Replace fprintf(stderr, "*\n" with error_report() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , Peter Crosthwaite , Stefan Weil , Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_= report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_re= port("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report= ("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("= \1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1= "\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\= 2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2)= ;|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|= Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig= }' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}'= \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Signed-off-by: Alistair Francis Cc: Paolo Bonzini Cc: Peter Crosthwaite Cc: Richard Henderson Cc: Stefan Weil Conversions that aren't followed by exit() dropped, because they might be inappropriate. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20180203084315.20497-14-armbru@redhat.com> Reviewed-by: Thomas Huth --- cpus.c | 10 +++++----- exec.c | 6 +++--- vl.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cpus.c b/cpus.c index 2cb0af9b22..5d3a165960 100644 --- a/cpus.c +++ b/cpus.c @@ -259,7 +259,7 @@ int64_t cpu_get_icount_raw(void) =20 if (cpu && cpu->running) { if (!cpu->can_do_io) { - fprintf(stderr, "Bad icount read\n"); + error_report("Bad icount read"); exit(1); } /* Take into account what has run */ @@ -1181,7 +1181,7 @@ static void *qemu_kvm_cpu_thread_fn(void *arg) =20 r =3D kvm_init_vcpu(cpu); if (r < 0) { - fprintf(stderr, "kvm_init_vcpu failed: %s\n", strerror(-r)); + error_report("kvm_init_vcpu failed: %s", strerror(-r)); exit(1); } =20 @@ -1211,7 +1211,7 @@ static void *qemu_kvm_cpu_thread_fn(void *arg) static void *qemu_dummy_cpu_thread_fn(void *arg) { #ifdef _WIN32 - fprintf(stderr, "qtest is not supported under Windows\n"); + error_report("qtest is not supported under Windows"); exit(1); #else CPUState *cpu =3D arg; @@ -1631,8 +1631,8 @@ static void qemu_cpu_kick_thread(CPUState *cpu) #else /* _WIN32 */ if (!qemu_cpu_is_self(cpu)) { if (!QueueUserAPC(dummy_apc_func, cpu->hThread, 0)) { - fprintf(stderr, "%s: QueueUserAPC failed with error %lu\n", - __func__, GetLastError()); + error_report("%s: QueueUserAPC failed with error %lu", __func_= _, + GetLastError()); exit(1); } } diff --git a/exec.c b/exec.c index 629a508385..e8d7b335b6 100644 --- a/exec.c +++ b/exec.c @@ -2216,9 +2216,9 @@ void qemu_ram_remap(ram_addr_t addr, ram_addr_t lengt= h) flags, -1, 0); } if (area !=3D vaddr) { - fprintf(stderr, "Could not remap addr: " - RAM_ADDR_FMT "@" RAM_ADDR_FMT "\n", - length, addr); + error_report("Could not remap addr: " + RAM_ADDR_FMT "@" RAM_ADDR_FMT "", + length, addr); exit(1); } memory_try_enable_merging(vaddr, length); diff --git a/vl.c b/vl.c index e517a8d995..32db91da1e 100644 --- a/vl.c +++ b/vl.c @@ -2172,7 +2172,7 @@ static DisplayType select_display(const char *p) display_opengl =3D 1; display =3D DT_EGL; #else - fprintf(stderr, "egl support is disabled\n"); + error_report("egl support is disabled"); exit(1); #endif } else if (strstart(p, "curses", &opts)) { --=20 2.13.6