All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-trivial] [PATCH for-1.4 v2 1/6] error: Clean up error strings with embedded newlines
Date: Fri, 8 Feb 2013 15:41:54 -0200	[thread overview]
Message-ID: <20130208154154.7bf7ab79@redhat.com> (raw)
In-Reply-To: <1360340232-4670-2-git-send-email-armbru@redhat.com>

On Fri,  8 Feb 2013 17:17:07 +0100
Markus Armbruster <armbru@redhat.com> wrote:

> The arguments of error_report() should yield a short error string
> without newlines.
> 
> A few places try to print additional help after the error message by
> embedding newlines in the error string.  That's nice, but let's do it
> the right way.
> 
> Since I'm touching these lines anyway, drop a stray preposition and
> some tabs.  We don't use tabs for similar messages elsewhere.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  hw/kvm/pci-assign.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/hw/kvm/pci-assign.c b/hw/kvm/pci-assign.c
> index 896cfe8..da64b5b 100644
> --- a/hw/kvm/pci-assign.c
> +++ b/hw/kvm/pci-assign.c
> @@ -936,8 +936,8 @@ retry:
>              /* Retry with host-side MSI. There might be an IRQ conflict and
>               * either the kernel or the device doesn't support sharing. */
>              error_report("Host-side INTx sharing not supported, "
> -                         "using MSI instead.\n"
> -                         "Some devices do not to work properly in this mode.");
> +                         "using MSI instead");
> +            error_printf("Some devices do not work properly in this mode.\n");

This is fixing command-line, right?

I honestly don't know which is less worse, the current code or having
to call two different functions in the correct order to report an
error :(

I'd say the best solution for this would be to propagate errors, but this
will loose LOC support.

>              dev->features |= ASSIGNED_DEVICE_PREFER_MSI_MASK;
>              goto retry;
>          }
> @@ -1903,10 +1903,10 @@ static void assigned_dev_load_option_rom(AssignedDevice *dev)
>      memset(ptr, 0xff, st.st_size);
>  
>      if (!fread(ptr, 1, st.st_size, fp)) {
> -        error_report("pci-assign: Cannot read from host %s\n"
> -                     "\tDevice option ROM contents are probably invalid "
> -                     "(check dmesg).\n\tSkip option ROM probe with rombar=0, "
> -                     "or load from file with romfile=", rom_file);
> +        error_report("pci-assign: Cannot read from host %s", rom_file);
> +        error_printf("Device option ROM contents are probably invalid "
> +                     "(check dmesg).\nSkip option ROM probe with rombar=0, "
> +                     "or load from file with romfile=\n");
>          memory_region_destroy(&dev->dev.rom);
>          goto close_rom;
>      }



  reply	other threads:[~2013-02-08 17:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-08 16:17 [Qemu-trivial] [PATCH for-1.4 v2 0/6] Error reporting fixes Markus Armbruster
2013-02-08 16:17 ` [Qemu-trivial] [PATCH for-1.4 v2 1/6] error: Clean up error strings with embedded newlines Markus Armbruster
2013-02-08 17:41   ` Luiz Capitulino [this message]
2013-02-08 18:56     ` Markus Armbruster
2013-02-08 19:13       ` Luiz Capitulino
2013-02-08 19:48         ` Markus Armbruster
2013-02-13 19:28           ` Luiz Capitulino
2013-02-08 16:17 ` [Qemu-trivial] [PATCH for-1.4 v2 2/6] error: Clean up abuse of error_report() for help Markus Armbruster
2013-02-08 16:17 ` [Qemu-trivial] [PATCH for-1.4 v2 3/6] error: Strip trailing '\n' from error string arguments (again) Markus Armbruster
2013-02-08 17:45   ` Luiz Capitulino
2013-02-08 16:17 ` [Qemu-trivial] [PATCH for-1.4 v2 4/6] qemu-option: Disable two helpful messages that got broken recently Markus Armbruster
2013-02-08 17:53   ` Luiz Capitulino
2013-02-08 18:58     ` Markus Armbruster
2013-02-08 19:16       ` Luiz Capitulino
2013-02-08 19:34         ` Markus Armbruster
2013-02-13 19:20           ` Luiz Capitulino
2013-02-08 16:17 ` [Qemu-trivial] [PATCH for-1.4 v2 5/6] vl: Drop redundant "parse error" reports Markus Armbruster
2013-02-08 17:54   ` Luiz Capitulino
2013-02-08 16:17 ` [Qemu-trivial] [PATCH for-1.4 v2 6/6] vl: Exit unsuccessfully on option argument syntax error Markus Armbruster
2013-02-08 18:00   ` Luiz Capitulino
2013-02-08 18:30     ` Markus Armbruster
2013-02-08 18:59 ` [Qemu-trivial] [PATCH for-1.4 v2 0/6] Error reporting fixes Markus Armbruster
2013-02-08 19:16   ` Luiz Capitulino

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=20130208154154.7bf7ab79@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=armbru@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

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

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