aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2023-09-28 15:19:35 +0200
committerJuan Quintela <quintela@redhat.com>2023-10-11 11:17:03 +0200
commit9a6afb11705b5bd6332289d226fae783ffcc0e1d (patch)
tree4573b5ad1490283efda0f1e0aac01689cfba8178 /migration
parent36cc822d857ddf151a32a9f6fe851209ef4f089d (diff)
downloadqemu-9a6afb11705b5bd6332289d226fae783ffcc0e1d.zip
qemu-9a6afb11705b5bd6332289d226fae783ffcc0e1d.tar.gz
qemu-9a6afb11705b5bd6332289d226fae783ffcc0e1d.tar.bz2
migration/rdma: Fix qemu_rdma_accept() to return failure on errors
qemu_rdma_accept() returns 0 in some cases even when it didn't complete its job due to errors. Impact is not obvious. I figure the caller will soon fail again with a misleading error message. Fix it to return -1 on any failure. 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-10-armbru@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/rdma.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/migration/rdma.c b/migration/rdma.c
index 1159f99..8fd1b31 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -3360,6 +3360,7 @@ static int qemu_rdma_accept(RDMAContext *rdma)
if (cm_event->event != RDMA_CM_EVENT_CONNECT_REQUEST) {
rdma_ack_cm_event(cm_event);
+ ret = -1;
goto err_rdma_dest_wait;
}
@@ -3372,6 +3373,7 @@ static int qemu_rdma_accept(RDMAContext *rdma)
rdma_return_path = qemu_rdma_data_init(rdma->host_port, NULL);
if (rdma_return_path == NULL) {
rdma_ack_cm_event(cm_event);
+ ret = -1;
goto err_rdma_dest_wait;
}
@@ -3383,10 +3385,11 @@ static int qemu_rdma_accept(RDMAContext *rdma)
network_to_caps(&cap);
if (cap.version < 1 || cap.version > RDMA_CONTROL_VERSION_CURRENT) {
- error_report("Unknown source RDMA version: %d, bailing...",
- cap.version);
- rdma_ack_cm_event(cm_event);
- goto err_rdma_dest_wait;
+ error_report("Unknown source RDMA version: %d, bailing...",
+ cap.version);
+ rdma_ack_cm_event(cm_event);
+ ret = -1;
+ goto err_rdma_dest_wait;
}
/*
@@ -3416,9 +3419,10 @@ static int qemu_rdma_accept(RDMAContext *rdma)
if (!rdma->verbs) {
rdma->verbs = verbs;
} else if (rdma->verbs != verbs) {
- error_report("ibv context not matching %p, %p!", rdma->verbs,
- verbs);
- goto err_rdma_dest_wait;
+ error_report("ibv context not matching %p, %p!", rdma->verbs,
+ verbs);
+ ret = -1;
+ goto err_rdma_dest_wait;
}
qemu_rdma_dump_id("dest_init", verbs);
@@ -3475,6 +3479,7 @@ static int qemu_rdma_accept(RDMAContext *rdma)
if (cm_event->event != RDMA_CM_EVENT_ESTABLISHED) {
error_report("rdma_accept not event established");
rdma_ack_cm_event(cm_event);
+ ret = -1;
goto err_rdma_dest_wait;
}