diff --git a/vmm/src/lib.rs b/vmm/src/lib.rs index 3e2f14cec..f86607527 100644 --- a/vmm/src/lib.rs +++ b/vmm/src/lib.rs @@ -1133,7 +1133,7 @@ impl Vmm { info!("Migration complete"); Ok(()) } { - // Stop logging dirty pages and keep the source VM paused unpon successful migration + // Stop logging dirty pages and shutdown the source VM paused unpon successful migration Ok(()) => { // Let every Migratable object know about the migration being complete vm.complete_migration()?; @@ -1141,6 +1141,14 @@ impl Vmm { // Stop logging dirty pages vm.stop_dirty_log()?; + // Shutdown the VM after the migration succeeded + self.exit_evt.write(1).map_err(|e| { + MigratableError::MigrateSend(anyhow!( + "Failed shutting down the VM after migration: {:?}", + e + )) + })?; + Ok(()) } // Ensure the source VM continue to run upon unsuccessful migration