From 1718f238d1ee3c40496a36d6e4dc88ad21a04896 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 28 Sep 2023 15:19:57 +0200 Subject: [PATCH] migration/rdma: Delete inappropriate error_report() in macro ERROR() 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 Reviewed-by: Li Zhijian Tested-by: Li Zhijian Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela 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 -/* - * 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__); \ } \