Skip to content

Commit baa41af

Browse files
zhijianli88Fabiano Rosas
authored andcommitted
migration: Prioritize RDMA in ram_save_target_page()
Address an error in RDMA-based migration by ensuring RDMA is prioritized when saving pages in `ram_save_target_page()`. Previously, the RDMA protocol's page-saving step was placed after other protocols due to a refactoring in commit bc38dc2. This led to migration failures characterized by unknown control messages and state loading errors destination: (qemu) qemu-system-x86_64: Unknown control message QEMU FILE qemu-system-x86_64: error while loading state section id 1(ram) qemu-system-x86_64: load of migration failed: Operation not permitted source: (qemu) qemu-system-x86_64: RDMA is in an error state waiting migration to abort! qemu-system-x86_64: failed to save SaveStateEntry with id(name): 1(ram): -1 qemu-system-x86_64: rdma migration: recv polling control error! qemu-system-x86_64: warning: Early error. Sending error. qemu-system-x86_64: warning: rdma migration: send polling control error RDMA migration implemented its own protocol/method to send pages to destination side, hand over to RDMA first to prevent pages being saved by other protocol. Fixes: bc38dc2 ("migration: refactor ram_save_target_page functions") Reviewed-by: Peter Xu <[email protected]> Signed-off-by: Li Zhijian <[email protected]> Message-ID: <[email protected]> Signed-off-by: Fabiano Rosas <[email protected]>
1 parent 094a3db commit baa41af

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

migration/ram.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1964,6 +1964,11 @@ static int ram_save_target_page(RAMState *rs, PageSearchStatus *pss)
19641964
ram_addr_t offset = ((ram_addr_t)pss->page) << TARGET_PAGE_BITS;
19651965
int res;
19661966

1967+
/* Hand over to RDMA first */
1968+
if (control_save_page(pss, offset, &res)) {
1969+
return res;
1970+
}
1971+
19671972
if (!migrate_multifd()
19681973
|| migrate_zero_page_detection() == ZERO_PAGE_DETECTION_LEGACY) {
19691974
if (save_zero_page(rs, pss, offset)) {
@@ -1976,10 +1981,6 @@ static int ram_save_target_page(RAMState *rs, PageSearchStatus *pss)
19761981
return ram_save_multifd_page(block, offset);
19771982
}
19781983

1979-
if (control_save_page(pss, offset, &res)) {
1980-
return res;
1981-
}
1982-
19831984
return ram_save_page(rs, pss);
19841985
}
19851986

0 commit comments

Comments
 (0)