mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-01 11:05:46 +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");
|
info!("Migration complete");
|
||||||
Ok(())
|
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(()) => {
|
Ok(()) => {
|
||||||
// Let every Migratable object know about the migration being complete
|
// Let every Migratable object know about the migration being complete
|
||||||
vm.complete_migration()?;
|
vm.complete_migration()?;
|
||||||
@ -1141,6 +1141,14 @@ impl Vmm {
|
|||||||
// Stop logging dirty pages
|
// Stop logging dirty pages
|
||||||
vm.stop_dirty_log()?;
|
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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
// Ensure the source VM continue to run upon unsuccessful migration
|
// Ensure the source VM continue to run upon unsuccessful migration
|
||||||
|
Loading…
Reference in New Issue
Block a user