mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: support migration of paused VMs
This extends migration to also support paused VMs, preserving the paused state on the destination. Changes: - Add CompletePaused protocol command that finalizes migration without resuming the VM on the destination - Skip the pause step during migration if the VM is already paused - On migration failure, only restore the running state if the VM was originally running (not paused) Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com>
This commit is contained in:
committed by
Rob Bradford
parent
e2b9fa261b
commit
23fc9ca258
@@ -103,6 +103,7 @@ use crate::bitpos_iterator::BitposIteratorExt;
|
||||
/// Configured --> Configured: Memory
|
||||
/// Configured --> StateReceived: State
|
||||
/// StateReceived --> Completed: Complete
|
||||
/// StateReceived --> Completed: CompletePaused
|
||||
/// ```
|
||||
///
|
||||
/// [live-migration protocol]: super::protocol
|
||||
@@ -115,10 +116,14 @@ pub enum Command {
|
||||
Config,
|
||||
State,
|
||||
Memory,
|
||||
/// Finalizes the migration and resumes the VM on the guest.
|
||||
/// Finalizes the migration and resumes the VM on the destination.
|
||||
/// Sent when the source VM was running at migration time.
|
||||
Complete,
|
||||
Abandon,
|
||||
MemoryFd,
|
||||
/// Finalizes the migration without resuming the VM on the destination.
|
||||
/// Sent when the source VM was paused at migration time.
|
||||
CompletePaused,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
@@ -161,10 +166,16 @@ impl Request {
|
||||
Self::new(Command::MemoryFd, length)
|
||||
}
|
||||
|
||||
/// Finalizes the migration and resumes the VM on the destination.
|
||||
pub fn complete() -> Self {
|
||||
Self::new(Command::Complete, 0)
|
||||
}
|
||||
|
||||
/// Finalizes the migration without resuming the VM on the destination.
|
||||
pub fn complete_paused() -> Self {
|
||||
Self::new(Command::CompletePaused, 0)
|
||||
}
|
||||
|
||||
pub fn abandon() -> Self {
|
||||
Self::new(Command::Abandon, 0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user