mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-03-20 07:58:55 +00:00
vmm: Shutdown VM after migration succeeded
In case the migration succeeds, the destination VM will be correctly running, with potential vhost-user backends attached to it. We can't let the source VM trying to reconnect to the same backends, which is why it's safer to shutdown the source VM. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
c85aa6dfae
commit
db444715fd
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user