Skip to content
Merged
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
16 changes: 16 additions & 0 deletions vmm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,7 @@ impl MigrationWorker {
/// Perform the migration and communicate with the [`Vmm`] thread.
fn run(mut self) -> MigrationThreadOut {
debug!("migration thread is starting");
event!("vm", "migration-started");

let res = Vmm::send_migration(
&mut self.vm,
Expand All @@ -884,6 +885,7 @@ impl MigrationWorker {
self.check_migration_evt.write(1).unwrap();

debug!("migration thread is finished");
event!("vm", "migration-finished");
MigrationThreadOut {
vm: self.vm,
migration_res: res,
Expand Down Expand Up @@ -2653,6 +2655,14 @@ impl Vmm {
s.iteration_duration = s.iteration_start_time.elapsed();
log_migration_progress(s, vm);

// Enables management software (e.g., libvirt) to easily track forward progress.
event!(
"vm",
"migration-memory-iteration",
"id",
format!("{}", s.iteration)
);

// Increment iteration counter
s.iteration += 1;

Expand Down Expand Up @@ -3165,6 +3175,7 @@ impl Vmm {
}
Err(MigratableError::Cancelled) => {
error!("Migration cancelled");
event!("vm", "migration-cancelled");
try_resume_vm(vm);

// Update migration progress snapshot
Expand All @@ -3177,6 +3188,7 @@ impl Vmm {
}
Err(e) => {
error!("Migration failed: {e}");
event!("vm", "migration-failed");
try_resume_vm(vm);

// Update migration progress snapshot
Expand Down Expand Up @@ -4128,6 +4140,8 @@ impl RequestHandler for Vmm {
MigratableError::MigrateReceive(e)
})?;

event!("vm", "migration-receive-started");

let mut state = ReceiveMigrationState::Established;

let res: result::Result<ReceiveMigrationState, MigratableError> = loop {
Expand Down Expand Up @@ -4164,6 +4178,7 @@ impl RequestHandler for Vmm {
};

if matches!(res, Err(_) | Ok(ReceiveMigrationState::Aborted)) {
event!("vm", "migration-receive-failed");
self.vm = MaybeVmOwnership::None;
self.vm_config = None;
match res {
Expand All @@ -4176,6 +4191,7 @@ impl RequestHandler for Vmm {
}
}

event!("vm", "migration-receive-finished");
Ok(())
}

Expand Down
Loading