[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 38/65] migration/rdma: Delete inappropriate error_report() in macr
From: |
Juan Quintela |
Subject: |
[PULL 38/65] migration/rdma: Delete inappropriate error_report() in macro ERROR() |
Date: |
Wed, 11 Oct 2023 11:21:36 +0200 |
From: Markus Armbruster <armbru@redhat.com>
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>
Tested-by: Li Zhijian <lizhijian@fujitsu.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20230928132019.2544702-32-armbru@redhat.com>
---
migration/rdma.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/migration/rdma.c b/migration/rdma.c
index 00e3c430f4..6c0e6cda2c 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__); \
} \
--
2.41.0
- [PULL 22/65] migration/rdma: Use bool for two RDMAContext flags, (continued)
- [PULL 22/65] migration/rdma: Use bool for two RDMAContext flags, Juan Quintela, 2023/10/11
- [PULL 25/65] migration/rdma: Fix io_writev(), io_readv() methods to obey contract, Juan Quintela, 2023/10/11
- [PULL 29/65] migration/rdma: Drop dead qemu_rdma_data_init() code for !@host_port, Juan Quintela, 2023/10/11
- [PULL 30/65] migration/rdma: Fix QEMUFileHooks method return values, Juan Quintela, 2023/10/11
- [PULL 26/65] migration/rdma: Replace dangerous macro CHECK_ERROR_STATE(), Juan Quintela, 2023/10/11
- [PULL 32/65] migration/rdma: Return -1 instead of negative errno code, Juan Quintela, 2023/10/11
- [PULL 27/65] migration/rdma: Fix qemu_rdma_broken_ipv6_kernel() to set error, Juan Quintela, 2023/10/11
- [PULL 37/65] migration/rdma: Plug a memory leak and improve a message, Juan Quintela, 2023/10/11
- [PULL 36/65] migration/rdma: Check negative error values the same way everywhere, Juan Quintela, 2023/10/11
- [PULL 35/65] migration/rdma: Drop superfluous assignments to @ret, Juan Quintela, 2023/10/11
- [PULL 38/65] migration/rdma: Delete inappropriate error_report() in macro ERROR(),
Juan Quintela <=
- [PULL 41/65] migration/rdma: Drop "@errp is clear" guards around error_setg(), Juan Quintela, 2023/10/11
- [PULL 43/65] migration/rdma: Convert qemu_rdma_exchange_send() to Error, Juan Quintela, 2023/10/11
- [PULL 39/65] migration/rdma: Retire macro ERROR(), Juan Quintela, 2023/10/11
- [PULL 44/65] migration/rdma: Convert qemu_rdma_exchange_get_response() to Error, Juan Quintela, 2023/10/11
- [PULL 40/65] migration/rdma: Fix error handling around rdma_getaddrinfo(), Juan Quintela, 2023/10/11
- [PULL 42/65] migration/rdma: Convert qemu_rdma_exchange_recv() to Error, Juan Quintela, 2023/10/11
- [PULL 46/65] migration/rdma: Convert qemu_rdma_write_flush() to Error, Juan Quintela, 2023/10/11
- [PULL 48/65] migration/rdma: Convert qemu_rdma_write() to Error, Juan Quintela, 2023/10/11
- [PULL 47/65] migration/rdma: Convert qemu_rdma_write_one() to Error, Juan Quintela, 2023/10/11
- [PULL 49/65] migration/rdma: Convert qemu_rdma_post_send_control() to Error, Juan Quintela, 2023/10/11