All of lore.kernel.org
 help / color / mirror / Atom feed
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>

WARNING: multiple messages have this Message-ID (diff)
From: Cornelia Huck <cohuck@redhat.com>
To: Alistair Francis <alistair.francis@xilinx.com>
Cc: qemu-devel@nongnu.org, alistair23@gmail.com, armbru@redhat.com,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <rth@twiddle.net>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Michael Walle <michael@walle.cc>,
	Aurelien Jarno <aurelien@aurel32.net>,
	Yongbok Kim <yongbok.kim@imgtec.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Guan Xuetao <gxt@mprc.pku.edu.cn>,
	qemu-arm@nongnu.org, qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [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>

  reply	other threads:[~2017-10-04  7:41 UTC|newest]

Thread overview: 108+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-30  0:14 [Qemu-devel] [PATCH v2 00/47] Remove some of the fprintf(stderr, "* Alistair Francis
2017-09-30  0:14 ` [Qemu-arm] [PATCH v2 01/47] Replace all occurances of __FUNCTION__ with __func__ Alistair Francis
2017-09-30  0:14   ` Alistair Francis
2017-09-30  0:14   ` [Qemu-devel] " Alistair Francis
2017-10-02 14:11   ` [Qemu-arm] " Stefan Hajnoczi
2017-10-02 14:11     ` [Qemu-devel] " Stefan Hajnoczi
2017-10-02 14:11   ` Stefan Hajnoczi
2017-09-30  0:15 ` [Qemu-devel] [PATCH v2 02/47] Fixes after renaming __FUNCTION__ to __func__ Alistair Francis
2017-09-30  6:31   ` Thomas Huth
2017-10-02 14:00   ` Eric Blake
2017-09-30  0:15 ` [Qemu-devel] [PATCH v2 03/47] audio: Replace AUDIO_FUNC with __func__ Alistair Francis
2017-09-30  6:35   ` Thomas Huth
2017-10-02 14:08   ` Eric Blake
2017-09-30  0:15 ` [Qemu-devel] [PATCH v2 04/47] tests: Replace fprintf(stderr, "*\n" with error_report() Alistair Francis
2017-09-30  0:15 ` [Qemu-arm] [PATCH v2 05/47] hw/arm: " Alistair Francis
2017-09-30  0:15   ` [Qemu-devel] " Alistair Francis
2017-09-30  2:46   ` [Qemu-arm] " Philippe Mathieu-Daudé
2017-09-30  2:46     ` [Qemu-devel] " Philippe Mathieu-Daudé
2017-10-16 11:41   ` [Qemu-arm] [Qemu-devel] " Thomas Huth
2017-10-16 11:41     ` Thomas Huth
2017-09-30  0:15 ` [Qemu-devel] [PATCH v2 06/47] hw/block: " Alistair Francis
2017-09-30  0:15 ` [Qemu-devel] [PATCH v2 07/47] hw/bt: " Alistair Francis
2017-10-01 14:06   ` Thomas Huth
2017-10-17 18:32     ` Alistair Francis
2017-09-30  0:15 ` [Qemu-devel] [PATCH v2 08/47] hw/char: " Alistair Francis
2017-10-01 14:09   ` Thomas Huth
2017-09-30  0:15 ` [Qemu-devel] [PATCH v2 09/47] hw/core: " Alistair Francis
2017-10-01  1:56   ` Philippe Mathieu-Daudé
2017-10-01 14:11   ` Thomas Huth
2017-09-30  0:15 ` [Qemu-devel] [PATCH v2 10/47] hw/cris: " Alistair Francis
2017-10-01 14:13   ` Thomas Huth
2017-10-16 11:42     ` Thomas Huth
2017-09-30  0:15 ` [Qemu-devel] [PATCH v2 11/47] hw/display: " Alistair Francis
2017-09-30  0:15 ` [Qemu-devel] [PATCH v2 12/47] hw/dma: " Alistair Francis
2017-10-01  1:55   ` Philippe Mathieu-Daudé
2017-09-30  0:15 ` [Qemu-devel] [PATCH v2 13/47] hw/gpio: " Alistair Francis
2017-09-30  0:15 ` [Qemu-devel] [PATCH v2 14/47] hw/i2c: " Alistair Francis
2017-10-01  1:52   ` Philippe Mathieu-Daudé
2017-09-30  0:15 ` [Qemu-devel] [PATCH v2 16/47] hw/ide: " Alistair Francis
2017-09-30  0:15 ` [Qemu-devel] [PATCH v2 17/47] hw/input: " Alistair Francis
2017-10-16 11:43   ` Thomas Huth
2017-09-30  0:15 ` [Qemu-devel] [PATCH v2 18/47] hw/intc: " Alistair Francis
2017-10-04  7:34   ` Cornelia Huck
2017-09-30  0:15 ` [Qemu-devel] [PATCH v2 19/47] hw/ipmi: " Alistair Francis
2017-10-01  1:50   ` Philippe Mathieu-Daudé
2017-09-30  0:16 ` [Qemu-devel] [PATCH v2 20/47] hw/isa: " Alistair Francis
2017-10-01  1:48   ` Philippe Mathieu-Daudé
2017-09-30  0:16 ` [Qemu-devel] [PATCH v2 21/47] hw/lm32: " Alistair Francis
2017-10-01  1:48   ` Philippe Mathieu-Daudé
2017-10-16 11:45   ` Thomas Huth
2017-09-30  0:16 ` [Qemu-devel] [PATCH v2 22/47] hw/m68k: " Alistair Francis
2017-09-30  6:42   ` Thomas Huth
2017-10-16 11:25   ` Thomas Huth
2017-09-30  0:16 ` [Qemu-devel] [PATCH v2 23/47] hw/microblaze: " Alistair Francis
2017-09-30  2:43   ` Philippe Mathieu-Daudé
2017-09-30  0:16 ` [Qemu-devel] [PATCH v2 24/47] hw/mips: " Alistair Francis
2017-09-30  2:36   ` Philippe Mathieu-Daudé
2017-10-16 11:46   ` Thomas Huth
2017-09-30  0:16 ` [Qemu-devel] [PATCH v2 25/47] hw/misc: " Alistair Francis
2017-10-01  1:47   ` Philippe Mathieu-Daudé
2017-09-30  0:16 ` [Qemu-devel] [PATCH v2 26/47] hw/moxie: " Alistair Francis
2017-10-01  1:46   ` Philippe Mathieu-Daudé
2017-10-16 11:47   ` Thomas Huth
2017-09-30  0:16 ` [Qemu-devel] [PATCH v2 27/47] hw/net: " Alistair Francis
2017-10-01  1:46   ` Philippe Mathieu-Daudé
2017-09-30  0:16 ` [Qemu-devel] [PATCH v2 28/47] hw/nios2: " Alistair Francis
2017-09-30  2:39   ` Philippe Mathieu-Daudé
2017-09-30  0:16 ` [Qemu-devel] [PATCH v2 29/47] hw/nvram: " Alistair Francis
2017-09-30  6:50   ` Thomas Huth
2017-09-30  0:16 ` [Qemu-devel] [PATCH v2 30/47] hw/openrisc: " Alistair Francis
2017-09-30 19:05   ` Stafford Horne
2017-10-16 11:50   ` Thomas Huth
2017-09-30  0:16 ` [Qemu-devel] [PATCH v2 31/47] hw/pci*: " Alistair Francis
2017-10-01  1:43   ` Philippe Mathieu-Daudé
2017-10-01  8:11   ` Marcel Apfelbaum
2017-10-02 18:15     ` Alistair Francis
2017-09-30  0:16 ` [Qemu-devel] [PATCH v2 32/47] hw/ppc: " Alistair Francis
2017-10-04  6:11   ` David Gibson
2017-10-16 11:53   ` Thomas Huth
2017-09-30  0:16 ` [Qemu-devel] [PATCH v2 33/47] hw/s390x: " Alistair Francis
2017-10-16 11:55   ` Thomas Huth
2017-09-30  0:16 ` [Qemu-devel] [PATCH v2 34/47] hw/scsi: " Alistair Francis
2017-09-30  0:16 ` [Qemu-devel] [PATCH v2 35/47] hw/sd: " Alistair Francis
2017-10-01  1:41   ` Philippe Mathieu-Daudé
2017-09-30  0:16 ` [Qemu-devel] [PATCH v2 36/47] hw/sh4: " Alistair Francis
2017-10-16 11:56   ` Thomas Huth
2017-09-30  0:16 ` [Qemu-devel] [PATCH v2 37/47] hw/sparc*: " Alistair Francis
2017-09-30  2:40   ` Philippe Mathieu-Daudé
2017-09-30  0:16 ` [Qemu-devel] [PATCH v2 38/47] hw/ssi: " Alistair Francis
2017-10-01  1:38   ` Philippe Mathieu-Daudé
2017-09-30  0:17 ` [Qemu-devel] [PATCH v2 39/47] hw/timer: " Alistair Francis
2017-10-01  1:37   ` Philippe Mathieu-Daudé
2017-09-30  0:17 ` [Qemu-devel] [PATCH v2 40/47] hw/usb: " Alistair Francis
2017-10-01  1:36   ` Philippe Mathieu-Daudé
2017-10-01 14:16     ` Thomas Huth
2017-09-30  0:17 ` [Qemu-devel] [PATCH v2 41/47] hw/watchdog: " Alistair Francis
2017-09-30  0:17 ` [Qemu-devel] [PATCH v2 42/47] hw/xen*: " Alistair Francis
2017-10-10 15:13   ` Anthony PERARD
2017-09-30  0:17 ` [Qemu-devel] [PATCH v2 43/47] util: " Alistair Francis
2017-09-30  2:43   ` Philippe Mathieu-Daudé
2017-09-30  0:17 ` [Qemu-devel] [PATCH v2 44/47] ui: " Alistair Francis
2017-09-30  0:17 ` [Qemu-devel] [PATCH v2 45/47] tcg: " Alistair Francis
2017-09-30  0:17 ` [Qemu-devel] [PATCH v2 46/47] target: Use qemu_log() instead of fprintf(stderr, ...) Alistair Francis
2017-09-30  0:17 ` [Qemu-arm] [PATCH v2 47/47] target: Replace fprintf(stderr, "*\n" with error_report() Alistair Francis
2017-09-30  0:17   ` [Qemu-devel] " Alistair Francis
2017-10-04  7:41   ` Cornelia Huck [this message]
2017-10-04  7:41     ` Cornelia Huck
     [not found] ` <ade26715c9bde1fe921959823de08da582fce58f.1506730372.git.alistair.francis@xilinx.com>
2017-10-10 14:51   ` [Qemu-devel] [PATCH v2 15/47] hw/i386: " Anthony PERARD

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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.