[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?
- Re: [PATCH 15/52] migration/rdma: Ditch useless numeric error codes in error messages, (continued)
- [PATCH 41/52] migration/rdma: Convert qemu_rdma_post_send_control() to Error, Markus Armbruster, 2023/09/18
- [PATCH 17/52] migration/rdma: Replace dangerous macro CHECK_ERROR_STATE(), Markus Armbruster, 2023/09/18
- [PATCH 38/52] migration/rdma: Convert qemu_rdma_write_flush() to Error, Markus Armbruster, 2023/09/18
- [PATCH 51/52] migration/rdma: Use error_report() & friends instead of stderr, Markus Armbruster, 2023/09/18
- [PATCH 21/52] migration/rdma: Fix QEMUFileHooks method return values, Markus Armbruster, 2023/09/18
- [PATCH 16/52] migration/rdma: Fix io_writev(), io_readv() methods to obey contract, Markus Armbruster, 2023/09/18
- [PATCH 22/52] migration/rdma: Fix rdma_getaddrinfo() error checking, Markus Armbruster, 2023/09/18
- [PATCH 45/52] migration/rdma: Silence qemu_rdma_connect(), Markus Armbruster, 2023/09/18