From: Laszlo Ersek <lersek@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: Pavel Fedin <p.fedin@samsung.com>
Subject: Re: [Qemu-devel] [PATCH 2/4] error: Clean up errors with embedded newlines (again), part 1
Date: Thu, 10 Dec 2015 18:36:39 +0100 [thread overview]
Message-ID: <5669B827.3090604@redhat.com> (raw)
In-Reply-To: <1449768232-22924-3-git-send-email-armbru@redhat.com>
On 12/10/15 18:23, Markus Armbruster 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. Commit 474c213 cleaned up some, but they keep comint
s/comint/coming/, you've been reading too many spy stories! :)
> back. Offenders tracked down with the Coccinelle semantic patch from
> commit 312fd5f.
My share of the blame is b86f46132 here... But you saw that patch! ;)
Anyway, this cleanup is consistent with your advice in
<http://thread.gmane.org/gmane.comp.emulators.qemu/374410/focus=374855>.
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Thanks!
Laszlo
>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Pavel Fedin <p.fedin@samsung.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> hw/i386/pc.c | 4 ++--
> kvm-all.c | 6 +++---
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 5e20e07..2c89ed1 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -418,8 +418,8 @@ static void pc_cmos_init_late(void *opaque)
>
> if (state.multiple) {
> error_report("warning: multiple floppy disk controllers with "
> - "iobase=0x3f0 have been found;\n"
> - "the one being picked for CMOS setup might not reflect "
> + "iobase=0x3f0 have been found");
> + error_printf("the one being picked for CMOS setup might not reflect "
> "your intent");
> }
> pc_cmos_init_floppy(s, state.floppy);
> diff --git a/kvm-all.c b/kvm-all.c
> index c648b81..9a7dd21 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -2020,9 +2020,9 @@ void kvm_device_access(int fd, int group, uint64_t attr,
> write ? KVM_SET_DEVICE_ATTR : KVM_GET_DEVICE_ATTR,
> &kvmattr);
> if (err < 0) {
> - error_report("KVM_%s_DEVICE_ATTR failed: %s\n"
> - "Group %d attr 0x%016" PRIx64, write ? "SET" : "GET",
> - strerror(-err), group, attr);
> + error_report("KVM_%s_DEVICE_ATTR failed: %s",
> + write ? "SET" : "GET", strerror(-err));
> + error_printf("Group %d attr 0x%016" PRIx64, group, attr);
> abort();
> }
> }
>
next prev parent reply other threads:[~2015-12-10 17:36 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-10 17:23 [Qemu-devel] [PATCH 0/4] Error reporting cleanups Markus Armbruster
2015-12-10 17:23 ` [Qemu-devel] [PATCH 1/4] error: Strip trailing '\n' from error string arguments (again) Markus Armbruster
2015-12-10 17:31 ` Dr. David Alan Gilbert
2015-12-10 18:16 ` Cornelia Huck
2015-12-11 9:01 ` Hailiang Zhang
2015-12-11 3:09 ` Bharata B Rao
2015-12-11 5:26 ` Fam Zheng
2015-12-10 17:23 ` [Qemu-devel] [PATCH 2/4] error: Clean up errors with embedded newlines (again), part 1 Markus Armbruster
2015-12-10 17:36 ` Laszlo Ersek [this message]
2015-12-14 9:27 ` Markus Armbruster
2015-12-10 17:23 ` [Qemu-devel] [PATCH 3/4] error: Clean up errors with embedded newlines (again), part 2 Markus Armbruster
2015-12-10 17:48 ` Laszlo Ersek
2015-12-14 9:42 ` Markus Armbruster
2015-12-15 2:03 ` Fam Zheng
2015-12-15 7:59 ` Markus Armbruster
2015-12-10 17:23 ` [Qemu-devel] [PATCH 4/4] hw/s390x: Rename local variables Error *l_err to just err Markus Armbruster
2015-12-10 18:18 ` Cornelia Huck
2015-12-11 8:07 ` David Hildenbrand
2015-12-14 9:59 ` Markus Armbruster
2015-12-14 10:15 ` Cornelia Huck
2015-12-14 10:28 ` David Hildenbrand
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=5669B827.3090604@redhat.com \
--to=lersek@redhat.com \
--cc=armbru@redhat.com \
--cc=p.fedin@samsung.com \
--cc=qemu-devel@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 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).