Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions vmm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4349,26 +4349,24 @@ impl RequestHandler for Vmm {
}

// When spawning the thread fails, the VM keeps running normally.
let migration_worker = match MigrationWorker::spawn(
let migration_worker = MigrationWorker::spawn(
vm,
self.check_migration_evt.try_clone().unwrap(),
send_data_migration,
self.postponed_lifecycle_event.clone(),
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
self.hypervisor.clone(),
) {
Ok(worker) => worker,
Err((vm, e)) => {
self.vm = MaybeVmOwnership::Vmm(vm);
)
.map_err(|(vm, e)| {
self.vm = MaybeVmOwnership::Vmm(vm);

let mut lock = MIGRATION_PROGRESS_SNAPSHOT.lock().unwrap();
lock.as_mut()
.expect("live migration should be ongoing")
.mark_as_failed(&e);
let mut lock = MIGRATION_PROGRESS_SNAPSHOT.lock().unwrap();
lock.as_mut()
.expect("live migration should be ongoing")
.mark_as_failed(&e);

return Err(e);
}
};
e
})?;
let old = self.migration_thread_handle.replace(migration_worker);
// If this fails, we messed up the thread lifecycle management.
debug_assert!(old.is_none());
Expand Down
Loading