[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-block] [PATCH] sheepdog: Fix error message if fai
From: |
John Snow |
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 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
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
>