[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 30/52] migration/rdma: Delete inappropriate error_report() in
From: |
Zhijian Li (Fujitsu) |
Subject: |
Re: [PATCH 30/52] migration/rdma: Delete inappropriate error_report() in macro ERROR() |
Date: |
Mon, 25 Sep 2023 06:35:59 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 |
On 18/09/2023 22:41, Markus Armbruster wrote:
> Functions that use an Error **errp parameter to return errors should
> not also report them to the user, because reporting is the caller's
> job. When the caller does, the error is reported twice. When it
> doesn't (because it recovered from the error), there is no error to
> report, i.e. the report is bogus.
>
> Macro ERROR() violates this principle. Delete the error_report()
> there.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
And
Tested-by: Li Zhijian <lizhijian@fujitsu.com>
> ---
> migration/rdma.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/migration/rdma.c b/migration/rdma.c
> index d52de857c5..be31694d4f 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -40,12 +40,8 @@
> #include "options.h"
> #include <poll.h>
>
> -/*
> - * Print and error on both the Monitor and the Log file.
> - */
> #define ERROR(errp, fmt, ...) \
> do { \
> - fprintf(stderr, "RDMA ERROR: " fmt "\n", ## __VA_ARGS__); \
> if (errp && (*(errp) == NULL)) { \
> error_setg(errp, "RDMA ERROR: " fmt, ## __VA_ARGS__); \
> } \
- Re: [PATCH 06/52] migration/rdma: Clean up two more harmless signed vs. unsigned issues, (continued)
- [PATCH 34/52] migration/rdma: Convert qemu_rdma_exchange_recv() to Error, Markus Armbruster, 2023/09/18
- [PATCH 30/52] migration/rdma: Delete inappropriate error_report() in macro ERROR(), Markus Armbruster, 2023/09/18
- Re: [PATCH 30/52] migration/rdma: Delete inappropriate error_report() in macro ERROR(),
Zhijian Li (Fujitsu) <=
- [PATCH 14/52] migration/rdma: Use bool for two RDMAContext flags, Markus Armbruster, 2023/09/18
- [PATCH 09/52] migration/rdma: Put @errp parameter last, Markus Armbruster, 2023/09/18
- [PATCH 03/52] migration/rdma: Clean up rdma_delete_block()'s return type, Markus Armbruster, 2023/09/18
- [PATCH 40/52] migration/rdma: Convert qemu_rdma_write() to Error, Markus Armbruster, 2023/09/18