From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7594-0003WO-Dw for qemu-devel@nongnu.org; Thu, 10 Dec 2015 12:36:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a7590-0005Qq-62 for qemu-devel@nongnu.org; Thu, 10 Dec 2015 12:36:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7590-0005Qm-0r for qemu-devel@nongnu.org; Thu, 10 Dec 2015 12:36:42 -0500 References: <1449768232-22924-1-git-send-email-armbru@redhat.com> <1449768232-22924-3-git-send-email-armbru@redhat.com> From: Laszlo Ersek Message-ID: <5669B827.3090604@redhat.com> Date: Thu, 10 Dec 2015 18:36:39 +0100 MIME-Version: 1.0 In-Reply-To: <1449768232-22924-3-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/4] error: Clean up errors with embedded newlines (again), part 1 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: Pavel Fedin 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 . Reviewed-by: Laszlo Ersek Thanks! Laszlo > > Cc: Laszlo Ersek > Cc: Pavel Fedin > Signed-off-by: Markus Armbruster > --- > 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(); > } > } >