[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/65] migration/rdma: Ditch useless numeric error codes in error
|
From: |
Juan Quintela |
|
Subject: |
[PULL 24/65] migration/rdma: Ditch useless numeric error codes in error messages |
|
Date: |
Wed, 11 Oct 2023 11:21:22 +0200 |
From: Markus Armbruster <armbru@redhat.com>
Several error messages include numeric error codes returned by failed
functions:
* ibv_poll_cq() returns an unspecified negative value. Useless.
* rdma_accept and rdma_get_cm_event() return -1. Useless.
* qemu_rdma_poll() returns either -1 or an unspecified negative
value. Useless.
* qemu_rdma_block_for_wrid(), qemu_rdma_write_flush(),
qemu_rdma_exchange_send(), qemu_rdma_exchange_recv(),
qemu_rdma_write() return a negative value that may or may not be an
errno value. While reporting human-readable errno
information (which a number is not) can be useful, reporting an
error code that may or may not be an errno value is useless.
Drop these error codes from the error messages.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
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-18-armbru@redhat.com>
---
migration/rdma.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/migration/rdma.c b/migration/rdma.c
index 35b0129ae6..c4197c6437 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -1476,7 +1476,7 @@ static int qemu_rdma_poll(RDMAContext *rdma, struct
ibv_cq *cq,
}
if (ret < 0) {
- error_report("ibv_poll_cq return %d", ret);
+ error_report("ibv_poll_cq failed");
return ret;
}
@@ -2226,7 +2226,7 @@ retry:
ret = qemu_rdma_block_for_wrid(rdma, RDMA_WRID_RDMA_WRITE, NULL);
if (ret < 0) {
error_report("rdma migration: failed to make "
- "room in full send queue! %d", ret);
+ "room in full send queue!");
return ret;
}
@@ -2819,7 +2819,7 @@ static ssize_t qio_channel_rdma_writev(QIOChannel *ioc,
ret = qemu_rdma_write_flush(rdma);
if (ret < 0) {
rdma->error_state = ret;
- error_setg(errp, "qemu_rdma_write_flush returned %d", ret);
+ error_setg(errp, "qemu_rdma_write_flush failed");
return -1;
}
@@ -2839,7 +2839,7 @@ static ssize_t qio_channel_rdma_writev(QIOChannel *ioc,
if (ret < 0) {
rdma->error_state = ret;
- error_setg(errp, "qemu_rdma_exchange_send returned %d", ret);
+ error_setg(errp, "qemu_rdma_exchange_send failed");
return -1;
}
@@ -2929,7 +2929,7 @@ static ssize_t qio_channel_rdma_readv(QIOChannel *ioc,
if (ret < 0) {
rdma->error_state = ret;
- error_setg(errp, "qemu_rdma_exchange_recv returned %d", ret);
+ error_setg(errp, "qemu_rdma_exchange_recv failed");
return -1;
}
@@ -3271,7 +3271,7 @@ static int qemu_rdma_save_page(QEMUFile *f, ram_addr_t
block_offset,
*/
ret = qemu_rdma_write(rdma, block_offset, offset, size);
if (ret < 0) {
- error_report("rdma migration: write error! %d", ret);
+ error_report("rdma migration: write error");
goto err;
}
@@ -3287,7 +3287,7 @@ static int qemu_rdma_save_page(QEMUFile *f, ram_addr_t
block_offset,
ret = qemu_rdma_poll(rdma, rdma->recv_cq, &wr_id_in, NULL);
if (ret < 0) {
- error_report("rdma migration: polling error! %d", ret);
+ error_report("rdma migration: polling error");
goto err;
}
@@ -3303,7 +3303,7 @@ static int qemu_rdma_save_page(QEMUFile *f, ram_addr_t
block_offset,
ret = qemu_rdma_poll(rdma, rdma->send_cq, &wr_id_in, NULL);
if (ret < 0) {
- error_report("rdma migration: polling error! %d", ret);
+ error_report("rdma migration: polling error");
goto err;
}
@@ -3478,13 +3478,13 @@ static int qemu_rdma_accept(RDMAContext *rdma)
ret = rdma_accept(rdma->cm_id, &conn_param);
if (ret) {
- error_report("rdma_accept returns %d", ret);
+ error_report("rdma_accept failed");
goto err_rdma_dest_wait;
}
ret = rdma_get_cm_event(rdma->channel, &cm_event);
if (ret) {
- error_report("rdma_accept get_cm_event failed %d", ret);
+ error_report("rdma_accept get_cm_event failed");
goto err_rdma_dest_wait;
}
--
2.41.0
- [PULL 14/65] migration/rdma: Clean up two more harmless signed vs. unsigned issues, (continued)
- [PULL 14/65] migration/rdma: Clean up two more harmless signed vs. unsigned issues, Juan Quintela, 2023/10/11
- [PULL 15/65] migration/rdma: Give qio_channel_rdma_source_funcs internal linkage, Juan Quintela, 2023/10/11
- [PULL 16/65] migration/rdma: Fix qemu_rdma_accept() to return failure on errors, Juan Quintela, 2023/10/11
- [PULL 17/65] migration/rdma: Put @errp parameter last, Juan Quintela, 2023/10/11
- [PULL 18/65] migration/rdma: Eliminate error_propagate(), Juan Quintela, 2023/10/11
- [PULL 19/65] migration/rdma: Drop rdma_add_block() error handling, Juan Quintela, 2023/10/11
- [PULL 20/65] migration/rdma: Drop qemu_rdma_search_ram_block() error handling, Juan Quintela, 2023/10/11
- [PULL 21/65] migration/rdma: Make qemu_rdma_buffer_mergeable() return bool, Juan Quintela, 2023/10/11
- [PULL 28/65] migration/rdma: Fix qemu_get_cm_event_timeout() to always set error, Juan Quintela, 2023/10/11
- [PULL 23/65] migration/rdma: Fix or document problematic uses of errno, Juan Quintela, 2023/10/11
- [PULL 24/65] migration/rdma: Ditch useless numeric error codes in error messages,
Juan Quintela <=
- [PULL 31/65] migration/rdma: Fix rdma_getaddrinfo() error checking, Juan Quintela, 2023/10/11
- [PULL 34/65] migration/rdma: Replace int error_state by bool errored, Juan Quintela, 2023/10/11
- [PULL 33/65] migration/rdma: Dumb down remaining int error values to -1, Juan Quintela, 2023/10/11
- [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