migration/rdma.c has
/*
* 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__); \
} \
} while (0)
This is problematic. The point of error_setg() & friends is detectin
errors from handling them. error.h:
* - Separation of concerns: the function is responsible for detecting
* errors and failing cleanly; handling the error is its caller's
* job. [...]
Reporting the error to stderr violates this principle. Consequences
include
* When the caller reports the error to stderr, it gets reported there
twice, possibly in slightly different form.
* When the caller recovers from the error cleanly without reporting it,
it is reported to stderr anyway, even though it is not actually an
error.
Mind if I kill the macro?