Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion vm-migration/src/progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,12 @@ pub struct MemoryTransmissionInfo {
Clone, Debug, PartialOrd, Ord, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize,
)]
pub enum MigrationStateOngoingPhase {
/// The migration starts. Handshake and transfer of VM config.
/// The migration process is initiated. No checks or connections are
/// established yet.
Starting,
/// The initial connection is established and the migration protocol
/// handshake succeeded.
Started,
/// Transfer of memory FDs.
///
/// Only used for local migrations.
Expand All @@ -96,6 +100,7 @@ impl Display for MigrationStateOngoingPhase {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Starting => write!(f, "starting"),
Self::Started => write!(f, "started"),
Self::MemoryFds => write!(f, "memory FDs"),
Self::MemoryPrecopy => write!(f, "memory (precopy)"),
Self::Completing => write!(f, "completing"),
Expand Down
10 changes: 10 additions & 0 deletions vmm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1897,6 +1897,16 @@ impl Vmm {
MigratableError::MigrateSend(anyhow!("Error starting migration (got bad response)")),
)?;

// Signal that the migration connection has been established. Management
// software can use this to distinguish short send/receive races from a
// real migration startup failure.
{

@phip1611 phip1611 Jul 2, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw @arctic-alpaca I know that this is rather poor design that we have to follow here - it comes from our "pragmatic" impl in the fork. Will (and must) be done much nicer when we upstream it

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand 😁

let mut lock = MIGRATION_PROGRESS_SNAPSHOT.lock().unwrap();
lock.as_mut()
.expect("live migration should be ongoing")
.update(MigrationStateOngoingPhase::Started, None, None, None);
}

return_if_cancelled_cb(&mut socket)?;

// Send config
Expand Down
Loading