From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zvh83-0004iA-3Y for qemu-devel@nongnu.org; Mon, 09 Nov 2015 02:44:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zvh82-0006iX-8B for qemu-devel@nongnu.org; Mon, 09 Nov 2015 02:44:39 -0500 From: Markus Armbruster References: <1446909925-12201-1-git-send-email-drjones@redhat.com> Date: Mon, 09 Nov 2015 08:44:30 +0100 In-Reply-To: (Peter Maydell's message of "Sat, 7 Nov 2015 16:56:47 +0000") Message-ID: <87twovpqg1.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] hw/arm/virt: error_report cleanups List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Andrew Jones , qemu-arm@nongnu.org, QEMU Developers Peter Maydell writes: > On 7 November 2015 at 15:25, Andrew Jones wrote: >> Signed-off-by: Andrew Jones >> --- >> hw/arm/virt.c | 10 +++++----- >> 1 file changed, 5 insertions(+), 5 deletions(-) >> >> diff --git a/hw/arm/virt.c b/hw/arm/virt.c >> index 77d9267599b7e..9c6792cea16f6 100644 >> --- a/hw/arm/virt.c >> +++ b/hw/arm/virt.c >> @@ -941,8 +941,8 @@ static void machvirt_init(MachineState *machine) >> if (!gic_version) { >> gic_version = kvm_arm_vgic_probe(); >> if (!gic_version) { >> - error_report("Unable to determine GIC version supported by host\n" >> - "Probably KVM acceleration is not supported\n"); >> + error_report("Unable to determine GIC version supported by host"); >> + error_printf("KVM acceleration is probably not supported\n"); >> exit(1); >> } >> } >> @@ -990,7 +990,7 @@ static void machvirt_init(MachineState *machine) >> char *cpuopts = g_strdup(cpustr[1]); >> >> if (!oc) { >> - fprintf(stderr, "Unable to find CPU definition\n"); >> + error_report("Unable to find CPU definition"); >> exit(1); >> } >> cpuobj = object_new(object_class_get_name(oc)); >> @@ -1126,8 +1126,8 @@ static void virt_set_gic_version(Object *obj, const char *value, Error **errp) >> } else if (!strcmp(value, "host")) { >> vms->gic_version = 0; /* Will probe later */ >> } else { >> - error_report("Invalid gic-version option value\n" >> - "Allowed values are: 3, 2, host\n"); >> + error_report("Invalid gic-version option value"); >> + error_printf("Allowed gic-version values are: 3, 2, host\n"); >> exit(1); >> } > > Would it be better just to have a single error_report > for these without the newlines, eg > > error_report("Unable to determine GIC version supported by host. " > "KVM acceleration is probably not supported."); > > ? For consistency, error messages should be a phrase, not a full sentence, let alone a paraphraph. You can of course turn any parapgraph into a phrase by stringing together its parts with semicolons, but that's cheating :) Reviewed-by: Markus Armbruster