aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2023-09-21 14:13:06 +0200
committerMarkus Armbruster <armbru@redhat.com>2023-09-29 08:13:57 +0200
commitbbde656263d80429b51017b077d9b4064ba13b01 (patch)
treea6720b6713124da5b7716fbf3f5628a56fb04264
parent36e9aab3c569d4c9ad780473596e18479838d1aa (diff)
downloadqemu-bbde656263d80429b51017b077d9b4064ba13b01.zip
qemu-bbde656263d80429b51017b077d9b4064ba13b01.tar.gz
qemu-bbde656263d80429b51017b077d9b4064ba13b01.tar.bz2
migration/rdma: Fix save_page method to fail on polling error
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> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Li Zhijian <lizhijian@fujitsu.com> Message-ID: <20230921121312.1301864-2-armbru@redhat.com>
-rw-r--r--migration/rdma.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/migration/rdma.c b/migration/rdma.c
index a2a3db3..3915d1d 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -3282,7 +3282,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;
@@ -3297,7 +3298,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;