qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 51/52] migration/rdma: Use error_report() & friends instead o


From: Markus Armbruster
Subject: Re: [PATCH 51/52] migration/rdma: Use error_report() & friends instead of stderr
Date: Wed, 27 Sep 2023 14:16:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

"Zhijian Li (Fujitsu)" <lizhijian@fujitsu.com> writes:

> On 18/09/2023 22:42, Markus Armbruster wrote:
>>           if (local->nb_blocks != nb_dest_blocks) {
>> -            fprintf(stderr, "ram blocks mismatch (Number of blocks %d vs 
>> %d) "
>> -                    "Your QEMU command line parameters are probably "
>> -                    "not identical on both the source and destination.",
>> -                    local->nb_blocks, nb_dest_blocks);
>> +            error_report("ram blocks mismatch (Number of blocks %d vs %d)",
>> +                         local->nb_blocks, nb_dest_blocks);
>> +            error_printf("Your QEMU command line parameters are probably "
>> +                         "not identical on both the source and 
>> destination.");
>
>
> Why is this one handled specifically? It seems like it would be fine with 
> error_report().

Error message before the patch:

    ram blocks mismatch (Number of blocks %d vs %d) Your QEMU command line 
parameters are probably not identical on both the source and destination.

Afterwards:

    <ERROR-MSG-PREFIX>ram blocks mismatch (Number of blocks %d vs %d)
    Your QEMU command line parameters are probably not identical on both the 
source and destination.

where <ERROR-MSG-PREFIX> shows current time (if enabled), guest name (if
enabled), program name (unless in monitor context), and "location" (if
we have one).

The first line is the error message.  It's consists of our common error
message prefix and a single phrase without trailing punctuation.

The second line is a hint.  Repeating the error message prefix there
is unnecessary.  Not repeating it there makes it more obvious that it's
not an error of its own, merely additional information.

Splitting the old message into error message and hint makes the error
message conform to the "single phrase" convention.

Makes sense?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]