All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Andrew Jones <drjones@redhat.com>
Cc: "Lluís Vilanova" <vilanova@ac.upc.edu>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] vl.c: Replace fprintf(stderr) with error_report()
Date: Tue, 27 Oct 2015 10:53:10 +0100	[thread overview]
Message-ID: <87wpu8d4e1.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <20151027073038.GA3927@hawk.localdomain> (Andrew Jones's message of "Tue, 27 Oct 2015 08:30:38 +0100")

Andrew Jones <drjones@redhat.com> writes:

> On Mon, Oct 26, 2015 at 03:13:43PM -0200, Eduardo Habkost wrote:
>> This replaces most fprintf(stderr) calls on vl.c with error_report().
>> 
>> The trailing newlines, "qemu:" and "error:" message prefixes were
>> removed.
>> 
>> The only remaining fprintf(stderr) calls are the ones at
>> qemu_kill_report(), because the error mesage is split in multiple
>> fprintf() calls.
>> 
>> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
>> ---
>> Not sure if this is appropriate post soft-freeze, but if we are going to apply
>> the max-cpus patch from Drew before 2.5.0, we could simply change all the
>> fprintf() calls in a single step.
>
> In addition to Markus' and Eric's comments, I think we should
>
> 1. make sure the first word's case is correct. Lowercase for phrases,
>    uppercase for sentences and proper nouns.
> 2. make sure the 'warning' prefix is consistent in all uses. This should
>    be a QEMU-wide change. Maybe we need an error_report_warn variant?
> 3. make sure past tense is used in phrases like "failed to do..."
> 4. only break the line if necessary. Some of the lines are broken even
>    though they could fit in 80 char. Probably the opposite exists too,
>    i.e. some are > 80.
>   
> I've tried to point out a few of the cases below that inspired me to
> to write these suggestions.

These rules all make sense to me.

Cleaning up existing error messages to conform to them is a lot of grunt
work.  Patches welcome.

In theory, making new error messages conform is a matter of patch
review.  In practice, I'm afraid it'll take written guidelines and at
least a local scarcity of bad examples to make patch review work even
moderately well there.

We discussed written guidelines in the "Coding style for errors" thread.
We need someone to synthesize it into a patch.

  reply	other threads:[~2015-10-27  9:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-26 17:13 [Qemu-devel] [PATCH] vl.c: Replace fprintf(stderr) with error_report() Eduardo Habkost
2015-10-26 17:43 ` Markus Armbruster
2015-10-26 18:03   ` Eduardo Habkost
2015-10-26 18:21   ` Eduardo Habkost
2015-10-28 18:12     ` Eduardo Habkost
2015-10-29  6:15       ` Markus Armbruster
2015-10-26 19:10 ` Eric Blake
2015-10-27 17:08   ` Eduardo Habkost
2015-10-27  7:30 ` Andrew Jones
2015-10-27  9:53   ` Markus Armbruster [this message]
2015-10-27 19:25   ` Eduardo Habkost
2015-10-27 19:36     ` Laszlo Ersek
2015-10-28 13:58       ` Andrew Jones
2015-10-28 15:27         ` Laszlo Ersek

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=87wpu8d4e1.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=drjones@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vilanova@ac.upc.edu \
    /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.