[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 56/65] migration/rdma: Silence qemu_rdma_block_for_wrid()
|
From: |
Juan Quintela |
|
Subject: |
[PULL 56/65] migration/rdma: Silence qemu_rdma_block_for_wrid() |
|
Date: |
Wed, 11 Oct 2023 11:21:54 +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_post_send_control(), qemu_rdma_exchange_get_response(), and
qemu_rdma_write_one() violate this principle: they call
error_report(), fprintf(stderr, ...), and perror() via
qemu_rdma_block_for_wrid(), qemu_rdma_poll(), and
qemu_rdma_wait_comp_channel(). I elected not to investigate how
callers handle the error, i.e. precise impact is not known.
Clean this up by dropping the error reporting from qemu_rdma_poll(),
qemu_rdma_wait_comp_channel(), and qemu_rdma_block_for_wrid(). I
believe the callers' error reports suffice. If they don't, we need to
convert to Error instead.
Bonus: resolves a FIXME about problematic use of errno.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-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-50-armbru@redhat.com>
---
migration/rdma.c | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/migration/rdma.c b/migration/rdma.c
index b5bb47108e..459dcb002e 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -1483,17 +1483,12 @@ static int qemu_rdma_poll(RDMAContext *rdma, struct
ibv_cq *cq,
}
if (ret < 0) {
- error_report("ibv_poll_cq failed");
return -1;
}
wr_id = wc.wr_id & RDMA_WRID_TYPE_MASK;
if (wc.status != IBV_WC_SUCCESS) {
- fprintf(stderr, "ibv_poll_cq wc.status=%d %s!\n",
- wc.status, ibv_wc_status_str(wc.status));
- fprintf(stderr, "ibv_poll_cq wrid=%" PRIu64 "!\n", wr_id);
-
return -1;
}
@@ -1577,16 +1572,12 @@ static int qemu_rdma_wait_comp_channel(RDMAContext
*rdma,
if (pfds[1].revents) {
ret = rdma_get_cm_event(rdma->channel, &cm_event);
if (ret < 0) {
- error_report("failed to get cm event while wait "
- "completion channel");
return -1;
}
if (cm_event->event == RDMA_CM_EVENT_DISCONNECTED ||
cm_event->event == RDMA_CM_EVENT_DEVICE_REMOVAL) {
rdma_ack_cm_event(cm_event);
- error_report("receive cm event while wait comp
channel,"
- "cm event is %d", cm_event->event);
return -1;
}
rdma_ack_cm_event(cm_event);
@@ -1599,7 +1590,6 @@ static int qemu_rdma_wait_comp_channel(RDMAContext *rdma,
default: /* Error of some type -
* I don't trust errno from qemu_poll_ns
*/
- error_report("%s: poll failed", __func__);
return -1;
}
@@ -1683,12 +1673,6 @@ static int qemu_rdma_block_for_wrid(RDMAContext *rdma,
ret = ibv_get_cq_event(ch, &cq, &cq_ctx);
if (ret < 0) {
- /*
- * FIXME perror() is problematic, because ibv_reg_mr() is
- * not documented to set errno. Will go away later in
- * this series.
- */
- perror("ibv_get_cq_event");
goto err_block_for_wrid;
}
--
2.41.0
- [PULL 47/65] migration/rdma: Convert qemu_rdma_write_one() to Error, (continued)
- [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
- [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 <=
- [PULL 58/65] migration/rdma: Downgrade qemu_rdma_cleanup() errors to warnings, Juan Quintela, 2023/10/11
- [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