vmm: Add postcopy support to receive-migration

Plumb the SocketUffdMemorySource into the receiving side of live
migration. When memory_mode=postcopy is requested, the destination
brings up a dedicated fault connection, registers userfaultfd on the
restored memory regions, and serves guest pages on demand over that
connection while the VM resumes early.

Signed-off-by: Sebastien Boeuf <sboeuf@meta.com>
Assisted-by: Claude:claude-opus-4-7
This commit is contained in:
Sebastien Boeuf
2026-06-23 08:56:25 -07:00
parent 282d1c989d
commit 48ba1f1417
5 changed files with 258 additions and 55 deletions
-3
View File
@@ -278,15 +278,12 @@ impl UffdMemorySource for FileUffdMemorySource {
}
/// Memory source that provides pages content over a socket.
// Wired into the receive-migration path in the next commit.
#[allow(dead_code)]
pub(crate) struct SocketUffdMemorySource {
stream: SocketStream,
shared_backing: bool,
buf: Vec<u8>,
}
#[allow(dead_code)]
impl SocketUffdMemorySource {
pub fn new(stream: SocketStream, shared_backing: bool) -> Self {
Self {