[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 58/65] migration/rdma: Downgrade qemu_rdma_cleanup() errors to war
From: |
Juan Quintela |
Subject: |
[PULL 58/65] migration/rdma: Downgrade qemu_rdma_cleanup() errors to warnings |
Date: |
Wed, 11 Oct 2023 11:21:56 +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.
qemu_rdma_source_init(), qemu_rdma_connect(),
rdma_start_incoming_migration(), and rdma_start_outgoing_migration()
violate this principle: they call error_report() via
qemu_rdma_cleanup().
Moreover, qemu_rdma_cleanup() can't fail. It is called on error
paths, and QIOChannel close and finalization. Are the conditions it
reports really errors? I doubt it.
Downgrade qemu_rdma_cleanup()'s errors to warnings.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20230928132019.2544702-52-armbru@redhat.com>
---
migration/rdma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/migration/rdma.c b/migration/rdma.c
index 025523bf70..9d5b3b76eb 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -2375,9 +2375,9 @@ static void qemu_rdma_cleanup(RDMAContext *rdma)
.type = RDMA_CONTROL_ERROR,
.repeat = 1,
};
- error_report("Early error. Sending error.");
+ warn_report("Early error. Sending error.");
if (qemu_rdma_post_send_control(rdma, NULL, &head, &err) < 0) {
- error_report_err(err);
+ warn_report_err(err);
}
}
--
2.41.0
- [PULL 49/65] migration/rdma: Convert qemu_rdma_post_send_control() to Error, (continued)
- [PULL 49/65] migration/rdma: Convert qemu_rdma_post_send_control() to Error, Juan Quintela, 2023/10/11
- [PULL 45/65] migration/rdma: Convert qemu_rdma_reg_whole_ram_blocks() to Error, Juan Quintela, 2023/10/11
- [PULL 50/65] migration/rdma: Convert qemu_rdma_post_recv_control() to Error, Juan Quintela, 2023/10/11
- [PULL 51/65] migration/rdma: Convert qemu_rdma_alloc_pd_cq() to Error, Juan Quintela, 2023/10/11
- [PULL 53/65] migration/rdma: Silence qemu_rdma_connect(), Juan Quintela, 2023/10/11
- [PULL 52/65] migration/rdma: Silence qemu_rdma_resolve_host(), Juan Quintela, 2023/10/11
- [PULL 55/65] migration/rdma: Don't report received completion events as error, Juan Quintela, 2023/10/11
- [PULL 54/65] migration/rdma: Silence qemu_rdma_reg_control(), Juan Quintela, 2023/10/11
- [PULL 57/65] migration/rdma: Silence qemu_rdma_register_and_get_keys(), Juan Quintela, 2023/10/11
- [PULL 56/65] migration/rdma: Silence qemu_rdma_block_for_wrid(), Juan Quintela, 2023/10/11
- [PULL 58/65] migration/rdma: Downgrade qemu_rdma_cleanup() errors to warnings,
Juan Quintela <=
- [PULL 59/65] migration/rdma: Use error_report() & friends instead of stderr, Juan Quintela, 2023/10/11
- [PULL 62/65] migration: Introduce migrate_has_error(), Juan Quintela, 2023/10/11
- [PULL 64/65] migration: Remember num of ramblocks to sync during recovery, Juan Quintela, 2023/10/11
- [PULL 61/65] migration: Display error in query-migrate irrelevant of status, Juan Quintela, 2023/10/11
- [PULL 60/65] migration/rdma: Replace flawed device detail dump by tracing, Juan Quintela, 2023/10/11
- [PULL 63/65] qemufile: Always return a verbose error, Juan Quintela, 2023/10/11
- [PULL 65/65] migration: Add migration_rp_wait|kick(), Juan Quintela, 2023/10/11
- Re: [PULL 00/65] Migration 20231011 patches, Stefan Hajnoczi, 2023/10/11