Skip to content

Commit a538221

Browse files
dagrhJuan Quintela
authored andcommitted
migration/rdma: Fix return-path case
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 <dgilbert@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Li Zhijian <lizhijian@fujitsu.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
1 parent a5d35dc commit a538221

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

migration/rdma.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3373,7 +3373,8 @@ static int qemu_rdma_accept(RDMAContext *rdma)
33733373
* initialize the RDMAContext for return path for postcopy after first
33743374
* connection request reached.
33753375
*/
3376-
if (migrate_postcopy() && !rdma->is_return_path) {
3376+
if ((migrate_postcopy() || migrate_use_return_path())
3377+
&& !rdma->is_return_path) {
33773378
rdma_return_path = qemu_rdma_data_init(rdma->host_port, NULL);
33783379
if (rdma_return_path == NULL) {
33793380
rdma_ack_cm_event(cm_event);
@@ -3455,7 +3456,8 @@ static int qemu_rdma_accept(RDMAContext *rdma)
34553456
}
34563457

34573458
/* Accept the second connection request for return path */
3458-
if (migrate_postcopy() && !rdma->is_return_path) {
3459+
if ((migrate_postcopy() || migrate_use_return_path())
3460+
&& !rdma->is_return_path) {
34593461
qemu_set_fd_handler(rdma->channel->fd, rdma_accept_incoming_migration,
34603462
NULL,
34613463
(void *)(intptr_t)rdma->return_path);
@@ -4192,7 +4194,7 @@ void rdma_start_outgoing_migration(void *opaque,
41924194
}
41934195

41944196
/* RDMA postcopy need a separate queue pair for return path */
4195-
if (migrate_postcopy()) {
4197+
if (migrate_postcopy() || migrate_use_return_path()) {
41964198
rdma_return_path = qemu_rdma_data_init(host_port, errp);
41974199

41984200
if (rdma_return_path == NULL) {

0 commit comments

Comments
 (0)