[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/7] migration/rdma: Fix save_page method to fail on polling erro
From: |
Markus Armbruster |
Subject: |
[PATCH 1/7] migration/rdma: Fix save_page method to fail on polling error |
Date: |
Thu, 31 Aug 2023 15:25:40 +0200 |
qemu_rdma_save_page() reports polling error with error_report(), then
succeeds anyway. This is because the variable holding the polling
status *shadows* the variable the function returns. The latter
remains zero.
Broken since day one, and duplicated more recently.
Fixes: 2da776db4846 (rdma: core logic)
Fixes: b390afd8c50b (migration/rdma: Fix out of order wrid)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
migration/rdma.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/migration/rdma.c b/migration/rdma.c
index ca430d319d..b2e869aced 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -3281,7 +3281,8 @@ static size_t qemu_rdma_save_page(QEMUFile *f,
*/
while (1) {
uint64_t wr_id, wr_id_in;
- int ret = qemu_rdma_poll(rdma, rdma->recv_cq, &wr_id_in, NULL);
+ ret = qemu_rdma_poll(rdma, rdma->recv_cq, &wr_id_in, NULL);
+
if (ret < 0) {
error_report("rdma migration: polling error! %d", ret);
goto err;
@@ -3296,7 +3297,8 @@ static size_t qemu_rdma_save_page(QEMUFile *f,
while (1) {
uint64_t wr_id, wr_id_in;
- int ret = qemu_rdma_poll(rdma, rdma->send_cq, &wr_id_in, NULL);
+ ret = qemu_rdma_poll(rdma, rdma->send_cq, &wr_id_in, NULL);
+
if (ret < 0) {
error_report("rdma migration: polling error! %d", ret);
goto err;
--
2.41.0
- [PATCH 0/7] Steps towards enabling -Wshadow=local, Markus Armbruster, 2023/08/31
- [PATCH 5/7] block/vdi: Clean up local variable shadowing, Markus Armbruster, 2023/08/31
- [PATCH 4/7] block/dirty-bitmap: Clean up local variable shadowing, Markus Armbruster, 2023/08/31
- [PATCH 3/7] ui: Clean up local variable shadowing, Markus Armbruster, 2023/08/31
- [PATCH 1/7] migration/rdma: Fix save_page method to fail on polling error,
Markus Armbruster <=
- [PATCH 2/7] migration: Clean up local variable shadowing, Markus Armbruster, 2023/08/31
- [PATCH 6/7] block: Clean up local variable shadowing, Markus Armbruster, 2023/08/31
- [PATCH 7/7] qobject atomics osdep: Make a few macros more hygienic, Markus Armbruster, 2023/08/31