From: Cornelia Huck <cohuck@redhat.com>
To: Alistair Francis <alistair.francis@xilinx.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
qemu-devel@nongnu.org, armbru@redhat.com,
Christian Borntraeger <borntraeger@de.ibm.com>,
Michael Walle <michael@walle.cc>,
qemu-arm@nongnu.org, qemu-ppc@nongnu.org,
Paolo Bonzini <pbonzini@redhat.com>,
Yongbok Kim <yongbok.kim@imgtec.com>,
alistair23@gmail.com, Guan Xuetao <gxt@mprc.pku.edu.cn>,
Aurelien Jarno <aurelien@aurel32.net>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-arm] [PATCH v2 47/47] target: Replace fprintf(stderr, "*\n" with error_report()
Date: Wed, 4 Oct 2017 09:41:16 +0200 [thread overview]
Message-ID: <20171004094116.7537e74e.cohuck@redhat.com> (raw)
In-Reply-To: <d64ca97ec0058b24002c387264654b4b322ad7a1.1506730372.git.alistair.francis@xilinx.com>
On Fri, 29 Sep 2017 17:17:26 -0700
Alistair Francis <alistair.francis@xilinx.com> wrote:
> 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.
> diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
> index ebb75cafaa..6f7ebd1c98 100644
> --- a/target/s390x/kvm.c
> +++ b/target/s390x/kvm.c
> @@ -967,13 +967,13 @@ static void inject_vcpu_irq_legacy(CPUState *cs, struct kvm_s390_irq *irq)
>
> r = s390_kvm_irq_to_interrupt(irq, &kvmint);
> if (r < 0) {
> - fprintf(stderr, "%s called with bogus interrupt\n", __func__);
> + error_report("%s called with bogus interrupt", __func__);
> exit(1);
> }
>
> r = kvm_vcpu_ioctl(cs, KVM_S390_INTERRUPT, &kvmint);
> if (r < 0) {
> - fprintf(stderr, "KVM failed to inject interrupt\n");
> + error_report("KVM failed to inject interrupt");
> exit(1);
> }
> }
> @@ -1002,13 +1002,13 @@ static void __kvm_s390_floating_interrupt(struct kvm_s390_irq *irq)
>
> r = s390_kvm_irq_to_interrupt(irq, &kvmint);
> if (r < 0) {
> - fprintf(stderr, "%s called with bogus interrupt\n", __func__);
> + error_report("%s called with bogus interrupt", __func__);
> exit(1);
> }
>
> r = kvm_vm_ioctl(kvm_state, KVM_S390_INTERRUPT, &kvmint);
> if (r < 0) {
> - fprintf(stderr, "KVM failed to inject interrupt\n");
> + error_report("KVM failed to inject interrupt");
> exit(1);
> }
> }
> @@ -1116,14 +1116,14 @@ static int handle_b2(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1)
> break;
> case PRIV_B2_TSCH:
> /* We should only get tsch via KVM_EXIT_S390_TSCH. */
> - fprintf(stderr, "Spurious tsch intercept\n");
> + error_report("Spurious tsch intercept");
> break;
> case PRIV_B2_CHSC:
> ioinst_handle_chsc(cpu, run->s390_sieic.ipb);
> break;
> case PRIV_B2_TPI:
> /* This should have been handled by kvm already. */
> - fprintf(stderr, "Spurious tpi intercept\n");
> + error_report("Spurious tpi intercept");
> break;
> case PRIV_B2_SCHM:
> ioinst_handle_schm(cpu, env->regs[1], env->regs[2],
> @@ -2050,15 +2050,15 @@ static int handle_intercept(S390CPU *cpu)
> }
> break;
> case ICPT_SOFT_INTERCEPT:
> - fprintf(stderr, "KVM unimplemented icpt SOFT\n");
> + error_report("KVM unimplemented icpt SOFT");
> exit(1);
> break;
> case ICPT_IO:
> - fprintf(stderr, "KVM unimplemented icpt IO\n");
> + error_report("KVM unimplemented icpt IO");
> exit(1);
> break;
> default:
> - fprintf(stderr, "Unknown intercept code: %d\n", icpt_code);
> + error_report("Unknown intercept code: %d", icpt_code);
> exit(1);
> break;
> }
> @@ -2215,7 +2215,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run)
> ret = kvm_arch_handle_debug_exit(cpu);
> break;
> default:
> - fprintf(stderr, "Unknown KVM exit: %d\n", run->exit_reason);
> + error_report("Unknown KVM exit: %d", run->exit_reason);
> break;
> }
> qemu_mutex_unlock_iothread();
> diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c
> index 293fc8428a..395872af45 100644
> --- a/target/s390x/misc_helper.c
> +++ b/target/s390x/misc_helper.c
> @@ -354,7 +354,7 @@ uint32_t HELPER(sigp)(CPUS390XState *env, uint64_t order_code, uint32_t r1,
> #endif
> default:
> /* unknown sigp */
> - fprintf(stderr, "XXX unknown sigp: 0x%" PRIx64 "\n", order_code);
> + error_report("XXX unknown sigp: 0x%" PRIx64 "", order_code);
> cc = SIGP_CC_NOT_OPERATIONAL;
> }
>
There might be some clashes with David's patches (haven't checked), but
that depends on what goes in first anyway. So, for the s390x parts:
Acked-by: Cornelia Huck <cohuck@redhat.com>
prev parent reply other threads:[~2017-10-04 7:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1506730372.git.alistair.francis@xilinx.com>
2017-09-30 0:14 ` [Qemu-arm] [PATCH v2 01/47] Replace all occurances of __FUNCTION__ with __func__ Alistair Francis
2017-10-02 14:11 ` Stefan Hajnoczi
2017-09-30 0:15 ` [Qemu-arm] [PATCH v2 05/47] hw/arm: Replace fprintf(stderr, "*\n" with error_report() Alistair Francis
2017-09-30 2:46 ` Philippe Mathieu-Daudé
2017-10-16 11:41 ` [Qemu-arm] [Qemu-devel] " Thomas Huth
2017-09-30 0:17 ` [Qemu-arm] [PATCH v2 47/47] target: " Alistair Francis
2017-10-04 7:41 ` Cornelia Huck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171004094116.7537e74e.cohuck@redhat.com \
--to=cohuck@redhat.com \
--cc=alistair.francis@xilinx.com \
--cc=alistair23@gmail.com \
--cc=armbru@redhat.com \
--cc=aurelien@aurel32.net \
--cc=borntraeger@de.ibm.com \
--cc=ehabkost@redhat.com \
--cc=gxt@mprc.pku.edu.cn \
--cc=michael@walle.cc \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=rth@twiddle.net \
--cc=yongbok.kim@imgtec.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).