Skip to content

Commit

Permalink
migration/rdma: Fix return-path case
Browse files Browse the repository at this point in the history
The RDMA code has return-path handling code, but it's only enabled
if postcopy is enabled; if the 'return-path' migration capability
is enabled, the return path is NOT setup but the core migration
code still tries to use it and breaks.

Enable the RDMA return path if either postcopy or the return-path
capability is enabled.

bz: https://bugzilla.redhat.com/show_bug.cgi?id=2063615

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
Reviewed-by: Juan Quintela <[email protected]>
Reviewed-by: Li Zhijian <[email protected]>
Signed-off-by: Juan Quintela <[email protected]>
  • Loading branch information
dagrh authored and Juan Quintela committed Mar 16, 2023
1 parent a5d35dc commit a538221
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions migration/rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -3373,7 +3373,8 @@ static int qemu_rdma_accept(RDMAContext *rdma)
* initialize the RDMAContext for return path for postcopy after first
* connection request reached.
*/
if (migrate_postcopy() && !rdma->is_return_path) {
if ((migrate_postcopy() || migrate_use_return_path())
&& !rdma->is_return_path) {
rdma_return_path = qemu_rdma_data_init(rdma->host_port, NULL);
if (rdma_return_path == NULL) {
rdma_ack_cm_event(cm_event);
Expand Down Expand Up @@ -3455,7 +3456,8 @@ static int qemu_rdma_accept(RDMAContext *rdma)
}

/* Accept the second connection request for return path */
if (migrate_postcopy() && !rdma->is_return_path) {
if ((migrate_postcopy() || migrate_use_return_path())
&& !rdma->is_return_path) {
qemu_set_fd_handler(rdma->channel->fd, rdma_accept_incoming_migration,
NULL,
(void *)(intptr_t)rdma->return_path);
Expand Down Expand Up @@ -4192,7 +4194,7 @@ void rdma_start_outgoing_migration(void *opaque,
}

/* RDMA postcopy need a separate queue pair for return path */
if (migrate_postcopy()) {
if (migrate_postcopy() || migrate_use_return_path()) {
rdma_return_path = qemu_rdma_data_init(host_port, errp);

if (rdma_return_path == NULL) {
Expand Down

0 comments on commit a538221

Please sign in to comment.