qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Alex Williamson" <alex.williamson@redhat.com>,
	"Fam Zheng" <famz@redhat.com>, "Wei Huang" <wei@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 03/31] cpus hw target: Use warn_report() & friends to report warnings
Date: Tue, 9 Oct 2018 09:25:53 +1100	[thread overview]
Message-ID: <20181008222553.GZ7004@umbus.fritz.box> (raw)
In-Reply-To: <20181008173125.19678-4-armbru@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 8099 bytes --]

On Mon, Oct 08, 2018 at 07:30:57PM +0200, Markus Armbruster wrote:
> Calling error_report() in a function that takes an Error ** argument
> is suspicious.  Convert a few that are actually warnings to
> warn_report().
> 
> While there, split a warning consisting of multiple sentences to
> conform to conventions spelled out in warn_report()'s contract.
> 
> Cc: Alex Bennée <alex.bennee@linaro.org>
> Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> Cc: Alex Williamson <alex.williamson@redhat.com>
> Cc: Fam Zheng <famz@redhat.com>
> Cc: Wei Huang <wei@redhat.com>
> Cc: David Gibson <david@gibson.dropbear.id.au>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

ppc part
Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  cpus.c                          |  8 ++++----
>  hw/display/cg3.c                |  2 +-
>  hw/display/tcx.c                |  2 +-
>  hw/misc/ivshmem.c               |  4 ++--
>  hw/net/virtio-net.c             |  8 ++++----
>  hw/virtio/virtio-pci.c          |  4 ++--
>  target/i386/cpu.c               | 17 +++++++++--------
>  target/ppc/translate_init.inc.c |  4 ++--
>  8 files changed, 25 insertions(+), 24 deletions(-)
> 
> diff --git a/cpus.c b/cpus.c
> index 361678e459..7804071872 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -211,12 +211,12 @@ void qemu_tcg_configure(QemuOpts *opts, Error **errp)
>                  error_setg(errp, "No MTTCG when icount is enabled");
>              } else {
>  #ifndef TARGET_SUPPORTS_MTTCG
> -                error_report("Guest not yet converted to MTTCG - "
> -                             "you may get unexpected results");
> +                warn_report("Guest not yet converted to MTTCG - "
> +                            "you may get unexpected results");
>  #endif
>                  if (!check_tcg_memory_orders_compatible()) {
> -                    error_report("Guest expects a stronger memory ordering "
> -                                 "than the host provides");
> +                    warn_report("Guest expects a stronger memory ordering "
> +                                "than the host provides");
>                      error_printf("This may cause strange/hard to debug errors\n");
>                  }
>                  mttcg_enabled = true;
> diff --git a/hw/display/cg3.c b/hw/display/cg3.c
> index 1c199ab369..e50d97e48c 100644
> --- a/hw/display/cg3.c
> +++ b/hw/display/cg3.c
> @@ -307,7 +307,7 @@ static void cg3_realizefn(DeviceState *dev, Error **errp)
>          ret = load_image_mr(fcode_filename, &s->rom);
>          g_free(fcode_filename);
>          if (ret < 0 || ret > FCODE_MAX_ROM_SIZE) {
> -            error_report("cg3: could not load prom '%s'", CG3_ROM_FILE);
> +            warn_report("cg3: could not load prom '%s'", CG3_ROM_FILE);
>          }
>      }
>  
> diff --git a/hw/display/tcx.c b/hw/display/tcx.c
> index b2786ee8d0..66f2459226 100644
> --- a/hw/display/tcx.c
> +++ b/hw/display/tcx.c
> @@ -823,7 +823,7 @@ static void tcx_realizefn(DeviceState *dev, Error **errp)
>          ret = load_image_mr(fcode_filename, &s->rom);
>          g_free(fcode_filename);
>          if (ret < 0 || ret > FCODE_MAX_ROM_SIZE) {
> -            error_report("tcx: could not load prom '%s'", TCX_ROM_FILE);
> +            warn_report("tcx: could not load prom '%s'", TCX_ROM_FILE);
>          }
>      }
>  
> diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
> index 6febbabcaa..4794518b2c 100644
> --- a/hw/misc/ivshmem.c
> +++ b/hw/misc/ivshmem.c
> @@ -1292,8 +1292,8 @@ static void ivshmem_realize(PCIDevice *dev, Error **errp)
>      IVShmemState *s = IVSHMEM_COMMON(dev);
>  
>      if (!qtest_enabled()) {
> -        error_report("ivshmem is deprecated, please use ivshmem-plain"
> -                     " or ivshmem-doorbell instead");
> +        warn_report("ivshmem is deprecated, please use ivshmem-plain"
> +                    " or ivshmem-doorbell instead");
>      }
>  
>      if (qemu_chr_fe_backend_connected(&s->server_chr) + !!s->shmobj != 1) {
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 4bdd5b8532..385b1a03e9 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -2020,10 +2020,10 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
>  
>      if (n->net_conf.tx && strcmp(n->net_conf.tx, "timer")
>                         && strcmp(n->net_conf.tx, "bh")) {
> -        error_report("virtio-net: "
> -                     "Unknown option tx=%s, valid options: \"timer\" \"bh\"",
> -                     n->net_conf.tx);
> -        error_report("Defaulting to \"bh\"");
> +        warn_report("virtio-net: "
> +                    "Unknown option tx=%s, valid options: \"timer\" \"bh\"",
> +                    n->net_conf.tx);
> +        error_printf("Defaulting to \"bh\"");
>      }
>  
>      n->net_conf.tx_queue_size = MIN(virtio_net_max_tx_queue_size(n),
> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> index 3a01fe90f0..a954799267 100644
> --- a/hw/virtio/virtio-pci.c
> +++ b/hw/virtio/virtio-pci.c
> @@ -1683,8 +1683,8 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)
>          if (err) {
>              /* Notice when a system that supports MSIx can't initialize it */
>              if (err != -ENOTSUP) {
> -                error_report("unable to init msix vectors to %" PRIu32,
> -                             proxy->nvectors);
> +                warn_report("unable to init msix vectors to %" PRIu32,
> +                            proxy->nvectors);
>              }
>              proxy->nvectors = 0;
>          }
> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> index c88876dfe3..9d4217afba 100644
> --- a/target/i386/cpu.c
> +++ b/target/i386/cpu.c
> @@ -5123,14 +5123,15 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
>       * NOTE: the following code has to follow qemu_init_vcpu(). Otherwise
>       * cs->nr_threads hasn't be populated yet and the checking is incorrect.
>       */
> -     if (IS_AMD_CPU(env) &&
> -         !(env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_TOPOEXT) &&
> -         cs->nr_threads > 1 && !ht_warned) {
> -            error_report("This family of AMD CPU doesn't support "
> -                         "hyperthreading(%d). Please configure -smp "
> -                         "options properly or try enabling topoext feature.",
> -                         cs->nr_threads);
> -        ht_warned = true;
> +    if (IS_AMD_CPU(env) &&
> +        !(env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_TOPOEXT) &&
> +        cs->nr_threads > 1 && !ht_warned) {
> +            warn_report("This family of AMD CPU doesn't support "
> +                        "hyperthreading(%d)",
> +                        cs->nr_threads);
> +            error_printf("Please configure -smp options properly"
> +                         " or try enabling topoext feature.\n");
> +            ht_warned = true;
>      }
>  
>      x86_cpu_apic_realize(cpu, &local_err);
> diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c
> index 263e63cb03..ee9432eb15 100644
> --- a/target/ppc/translate_init.inc.c
> +++ b/target/ppc/translate_init.inc.c
> @@ -8381,8 +8381,8 @@ static void getset_compat_deprecated(Object *obj, Visitor *v, const char *name,
>      QNull *null = NULL;
>  
>      if (!qtest_enabled()) {
> -        error_report("CPU 'compat' property is deprecated and has no effect; "
> -                     "use max-cpu-compat machine property instead");
> +        warn_report("CPU 'compat' property is deprecated and has no effect; "
> +                    "use max-cpu-compat machine property instead");
>      }
>      visit_type_null(v, name, &null, NULL);
>      qobject_unref(null);

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-10-09  0:56 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-08 17:30 [Qemu-devel] [PATCH 00/31] Replace some unwise uses of error_report() & friends Markus Armbruster
2018-10-08 17:30 ` [Qemu-devel] [PATCH 01/31] Use error_fatal to simplify obvious fatal errors (again) Markus Armbruster
2018-10-08 20:32   ` Eric Blake
2018-10-11 17:25     ` Markus Armbruster
2018-10-08 22:25   ` David Gibson
2018-10-08 17:30 ` [Qemu-devel] [PATCH 02/31] block: Use warn_report() & friends to report warnings Markus Armbruster
2018-10-08 20:35   ` Eric Blake
2018-10-08 17:30 ` [Qemu-devel] [PATCH 03/31] cpus hw target: " Markus Armbruster
2018-10-08 22:25   ` David Gibson [this message]
2018-10-09  9:56   ` Alex Bennée
2018-10-08 17:30 ` [Qemu-devel] [PATCH 04/31] vfio: " Markus Armbruster
2018-10-08 19:04   ` Alex Williamson
2018-10-08 17:30 ` [Qemu-devel] [PATCH 05/31] vfio: Clean up error reporting after previous commit Markus Armbruster
2018-10-08 19:04   ` Alex Williamson
2018-10-08 17:31 ` [Qemu-devel] [PATCH 06/31] char: Use error_printf() to print help and such Markus Armbruster
2018-10-09  6:09   ` Philippe Mathieu-Daudé
2018-10-08 17:31 ` [Qemu-devel] [PATCH 07/31] 9pfs: Fix CLI parsing crash on error Markus Armbruster
2018-10-09  7:38   ` Greg Kurz
2018-10-08 17:31 ` [Qemu-devel] [PATCH 08/31] pc: Fix machine property nvdimm-persistence error handling Markus Armbruster
2018-10-09  9:15   ` Marc-André Lureau
2018-10-08 17:31 ` [Qemu-devel] [PATCH 09/31] ioapic: Fix error handling in realize() Markus Armbruster
2018-10-09  3:24   ` Peter Xu
2018-10-09  9:18   ` Marc-André Lureau
2018-10-08 17:31 ` [Qemu-devel] [PATCH 10/31] smbios: Clean up error handling in smbios_add() Markus Armbruster
2018-10-09  9:25   ` Marc-André Lureau
2018-10-09 17:02   ` Paolo Bonzini
2018-10-08 17:31 ` [Qemu-devel] [PATCH 11/31] migration: Fix !replay_can_snapshot() error handling Markus Armbruster
2018-10-09  9:27   ` Marc-André Lureau
2018-10-08 17:31 ` [Qemu-devel] [PATCH 12/31] l2tpv3: Improve -netdev/netdev_add/-net/... error reporting Markus Armbruster
2018-10-09  9:32   ` Marc-André Lureau
2018-10-11 17:35     ` Markus Armbruster
2018-10-08 17:31 ` [Qemu-devel] [PATCH 13/31] net/socket: Fix invalid socket type error handling Markus Armbruster
2018-10-09  9:47   ` Marc-André Lureau
2018-10-08 17:31 ` [Qemu-devel] [PATCH 14/31] numa: Fix QMP command set-numa-node " Markus Armbruster
2018-10-08 18:03   ` Eduardo Habkost
2018-10-11 17:38     ` Markus Armbruster
2018-10-12 14:35   ` Igor Mammedov
2018-10-13 16:33     ` Markus Armbruster
2018-10-08 17:31 ` [Qemu-devel] [PATCH 15/31] xen/pt: Fix incomplete conversion to realize() Markus Armbruster
2018-10-10 13:31   ` Anthony PERARD
2018-10-08 17:31 ` [Qemu-devel] [PATCH 16/31] seccomp: Clean up error reporting in parse_sandbox() Markus Armbruster
2018-10-09  9:53   ` Marc-André Lureau
2018-10-11 17:40     ` Markus Armbruster
2018-10-10 12:39   ` Eduardo Otubo
2018-10-08 17:31 ` [Qemu-devel] [PATCH 17/31] vl: Clean up error reporting in parse_add_fd() Markus Armbruster
2018-10-09 10:11   ` Marc-André Lureau
2018-10-08 17:31 ` [Qemu-devel] [PATCH 18/31] qom: Clean up error reporting in user_creatable_add_opts_foreach() Markus Armbruster
2018-10-08 20:43   ` Eric Blake
2018-10-09 11:11   ` Marc-André Lureau
2018-10-09 13:25   ` Daniel P. Berrangé
2018-10-08 17:31 ` [Qemu-devel] [PATCH 19/31] vl: Clean up error reporting in parse_add_fd() Markus Armbruster
2018-10-09  6:07   ` Philippe Mathieu-Daudé
2018-10-09 11:13   ` Marc-André Lureau
2018-10-11 17:43     ` Markus Armbruster
2018-10-08 17:31 ` [Qemu-devel] [PATCH 20/31] vl: Clean up error reporting in machine_set_property() Markus Armbruster
2018-10-09  6:02   ` Philippe Mathieu-Daudé
2018-10-09 11:18   ` Marc-André Lureau
2018-10-08 17:31 ` [Qemu-devel] [PATCH 21/31] vl: Clean up error reporting in mon_init_func() Markus Armbruster
2018-10-09  6:02   ` Philippe Mathieu-Daudé
2018-10-09 11:21   ` Marc-André Lureau
2018-10-08 17:31 ` [Qemu-devel] [PATCH 22/31] vl: Clean up error reporting in parse_fw_cfg() Markus Armbruster
2018-10-09 11:25   ` Marc-André Lureau
2018-10-08 17:31 ` [Qemu-devel] [PATCH 23/31] vl: Clean up error reporting in device_init_func() Markus Armbruster
2018-10-09  6:05   ` Philippe Mathieu-Daudé
2018-10-08 17:31 ` [Qemu-devel] [PATCH 24/31] vl: Clean up error reporting in vnc_init_func() Markus Armbruster
2018-10-09 11:35   ` Marc-André Lureau
2018-10-11 17:48   ` Markus Armbruster
2018-10-08 17:31 ` [Qemu-devel] [PATCH 25/31] numa: Clean up error reporting in parse_numa() Markus Armbruster
2018-10-08 18:01   ` Eduardo Habkost
2018-10-08 17:31 ` [Qemu-devel] [PATCH 26/31] tpm: Clean up error reporting in tpm_init_tpmdev() Markus Armbruster
2018-10-09 10:57   ` Philippe Mathieu-Daudé
2018-10-09 11:38   ` Marc-André Lureau
2018-10-10 19:00   ` Stefan Berger
2018-10-08 17:31 ` [Qemu-devel] [PATCH 27/31] spice: Clean up error reporting in add_channel() Markus Armbruster
2018-10-09 11:46   ` Marc-André Lureau
2018-10-08 17:31 ` [Qemu-devel] [PATCH 28/31] fsdev: Clean up error reporting in qemu_fsdev_add() Markus Armbruster
2018-10-08 20:46   ` Eric Blake
2018-10-11 17:51     ` Markus Armbruster
2018-10-09  7:45   ` Greg Kurz
2018-10-08 17:31 ` [Qemu-devel] [PATCH 29/31] vl: Assert drive_new() does not fail in default_drive() Markus Armbruster
2018-10-08 20:48   ` Eric Blake
2018-10-08 21:08   ` Max Reitz
2018-10-08 17:31 ` [Qemu-devel] [PATCH 30/31] blockdev: Convert drive_new() to Error Markus Armbruster
2018-10-08 20:48   ` Eric Blake
2018-10-08 21:22   ` Max Reitz
2018-10-12  5:44     ` Markus Armbruster
2018-10-12 12:28       ` Max Reitz
2018-10-12 14:50         ` Kevin Wolf
2018-10-08 17:31 ` [Qemu-devel] [PATCH 31/31] vl: Simplify call of parse_name() Markus Armbruster
2018-10-09  6:06   ` Philippe Mathieu-Daudé

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=20181008222553.GZ7004@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=alex.bennee@linaro.org \
    --cc=alex.williamson@redhat.com \
    --cc=armbru@redhat.com \
    --cc=famz@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=qemu-devel@nongnu.org \
    --cc=wei@redhat.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).