All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Fam Zheng <famz@redhat.com>, Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-trivial] [Qemu-block] [PATCH] sheepdog: Fix error message if failed to load vmstate
Date: Tue, 02 Jun 2015 15:16:24 -0400	[thread overview]
Message-ID: <556E0108.1050003@redhat.com> (raw)
In-Reply-To: <20150602102637.GD22059@dhcp-14-238.nay.redhat.com>



On 06/02/2015 06:26 AM, Fam Zheng wrote:
> On Tue, 06/02 13:16, Michael Tokarev wrote:
>> 02.06.2015 12:32, Fam Zheng wrote:
>>>          if (ret < 0) {
>>> -            error_report("failed to save vmstate %s", strerror(errno));
>>> +            if (load) {
>>> +                error_report("failed to load vmstate %s", strerror(errno));
>>> +            } else {
>>> +                error_report("failed to save vmstate %s", strerror(errno));
>>> +            }
>>
>>  +            error_report("failed to %s vmstate: %s", load ? "load" : "save", strerror(errno));
> 
> The reason I didn't use a one-liner was, "git grep 'failed to load vmstate'"
> in the code base would just work, besides my eyes also like the readability.
> 

+1, Error messages should be kept on one line and intact where possible
and convenient. Greppable code is happy code.

>>
>> (note also the addition of ":")
> 
> Yes that applies to all error_report() in this file.
> 
>> (besides what Kevin said).
>>
>> Thanks,
> 
> Thanks,
> 
> Fam
> 


WARNING: multiple messages have this Message-ID (diff)
From: John Snow <jsnow@redhat.com>
To: Fam Zheng <famz@redhat.com>, Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] sheepdog: Fix error message if failed to load vmstate
Date: Tue, 02 Jun 2015 15:16:24 -0400	[thread overview]
Message-ID: <556E0108.1050003@redhat.com> (raw)
In-Reply-To: <20150602102637.GD22059@dhcp-14-238.nay.redhat.com>



On 06/02/2015 06:26 AM, Fam Zheng wrote:
> On Tue, 06/02 13:16, Michael Tokarev wrote:
>> 02.06.2015 12:32, Fam Zheng wrote:
>>>          if (ret < 0) {
>>> -            error_report("failed to save vmstate %s", strerror(errno));
>>> +            if (load) {
>>> +                error_report("failed to load vmstate %s", strerror(errno));
>>> +            } else {
>>> +                error_report("failed to save vmstate %s", strerror(errno));
>>> +            }
>>
>>  +            error_report("failed to %s vmstate: %s", load ? "load" : "save", strerror(errno));
> 
> The reason I didn't use a one-liner was, "git grep 'failed to load vmstate'"
> in the code base would just work, besides my eyes also like the readability.
> 

+1, Error messages should be kept on one line and intact where possible
and convenient. Greppable code is happy code.

>>
>> (note also the addition of ":")
> 
> Yes that applies to all error_report() in this file.
> 
>> (besides what Kevin said).
>>
>> Thanks,
> 
> Thanks,
> 
> Fam
> 

  reply	other threads:[~2015-06-02 19:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-02  9:32 [Qemu-trivial] [PATCH] sheepdog: Fix error message if failed to load vmstate Fam Zheng
2015-06-02  9:32 ` [Qemu-devel] " Fam Zheng
2015-06-02  9:45 ` [Qemu-trivial] " Kevin Wolf
2015-06-02  9:45   ` [Qemu-devel] " Kevin Wolf
2015-06-02 10:22   ` [Qemu-trivial] " Fam Zheng
2015-06-02 10:22     ` [Qemu-devel] " Fam Zheng
2015-06-02 10:16 ` [Qemu-trivial] " Michael Tokarev
2015-06-02 10:16   ` [Qemu-devel] " Michael Tokarev
2015-06-02 10:26   ` [Qemu-trivial] " Fam Zheng
2015-06-02 10:26     ` [Qemu-devel] " Fam Zheng
2015-06-02 19:16     ` John Snow [this message]
2015-06-02 19:16       ` [Qemu-devel] [Qemu-block] " John Snow

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=556E0108.1050003@redhat.com \
    --to=jsnow@redhat.com \
    --cc=famz@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@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 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.