From patchwork Thu Dec 10 17:23:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 555220 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BA2DF1400DE for ; Fri, 11 Dec 2015 04:24:38 +1100 (AEDT) Received: from localhost ([::1]:43339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a74xI-0001E4-Ia for incoming@patchwork.ozlabs.org; Thu, 10 Dec 2015 12:24:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37263) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a74wi-0000Kg-21 for qemu-devel@nongnu.org; Thu, 10 Dec 2015 12:24:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a74we-0000SH-Nk for qemu-devel@nongnu.org; Thu, 10 Dec 2015 12:23:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a74we-0000Ry-IQ for qemu-devel@nongnu.org; Thu, 10 Dec 2015 12:23:56 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 97766263B; Thu, 10 Dec 2015 17:23:55 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-204-39.brq.redhat.com [10.40.204.39]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBAHNr4n008095 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 10 Dec 2015 12:23:55 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C5C0F3001851; Thu, 10 Dec 2015 18:23:52 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 10 Dec 2015 18:23:50 +0100 Message-Id: <1449768232-22924-3-git-send-email-armbru@redhat.com> In-Reply-To: <1449768232-22924-1-git-send-email-armbru@redhat.com> References: <1449768232-22924-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Pavel Fedin , Laszlo Ersek Subject: [Qemu-devel] [PATCH 2/4] error: Clean up errors with embedded newlines (again), part 1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 back. Offenders tracked down with the Coccinelle semantic patch from commit 312fd5f. Cc: Laszlo Ersek Cc: Pavel Fedin Signed-off-by: Markus Armbruster Reviewed-by: Laszlo Ersek --- 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(); } }