Skip to content

Commit a1b5313

Browse files
committed
actual-use
1 parent bfbcb20 commit a1b5313

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

vmm/src/lib.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ impl From<u64> for EpollDispatch {
282282
}
283283

284284
// TODO make this a member of Vmm?
285-
static MIGRATION_PROGRESS_SNAPSHOT: Mutex<Option<MigrationProgressAndStatus>> = Mutex::new(None);
285+
static MIGRATION_PROGRESS_SNAPSHOT: Mutex<Option<MigrationProgress>> = Mutex::new(None);
286286

287287
enum SocketStream {
288288
Unix(UnixStream),
@@ -2115,7 +2115,7 @@ impl Vmm {
21152115
lock.as_mut()
21162116
.expect("live migration should be ongoing")
21172117
.update_ongoing_migration_state(
2118-
MigrationPhase::MemoryPrecopy,
2118+
OngoingMigrationPhase::MemoryPrecopy,
21192119
Some(MemoryTransmissionInfo {
21202120
memory_iteration: s.iteration,
21212121
memory_transmission_bps: s.mb_per_sec as u64 * 1024 * 1024,
@@ -2248,13 +2248,13 @@ impl Vmm {
22482248
let mut lock = MIGRATION_PROGRESS_SNAPSHOT.lock().unwrap();
22492249
if let Some(snapshot) = lock.as_ref() {
22502250
match snapshot.state {
2251-
MigrationProgressState::Ongoing { .. } => {
2251+
MigrationState::Ongoing { .. } => {
22522252
// if this fails, we made a programming error in our state handling
22532253
panic!("migration already ongoing");
22542254
}
2255-
MigrationProgressState::Cancelled { .. } => {}
2256-
MigrationProgressState::Failed { .. } => {}
2257-
MigrationProgressState::Finished { .. } => {}
2255+
MigrationState::Cancelled { .. } => {}
2256+
MigrationState::Failed { .. } => {}
2257+
MigrationState::Finished { .. } => {}
22582258
}
22592259
}
22602260
let transportation_mode = if send_data_migration.local {
@@ -2265,7 +2265,7 @@ impl Vmm {
22652265
tls: send_data_migration.tls_dir.is_some(),
22662266
}
22672267
};
2268-
lock.replace(MigrationProgressAndStatus::new(
2268+
lock.replace(MigrationProgress::new(
22692269
transportation_mode,
22702270
Duration::from_millis(send_data_migration.downtime),
22712271
));
@@ -2318,7 +2318,11 @@ impl Vmm {
23182318
let mut lock = MIGRATION_PROGRESS_SNAPSHOT.lock().unwrap();
23192319
lock.as_mut()
23202320
.expect("live migration should be ongoing")
2321-
.update_ongoing_migration_state(MigrationPhase::MemoryFds, None, None);
2321+
.update_ongoing_migration_state(
2322+
OngoingMigrationPhase::MemoryFds,
2323+
None,
2324+
None,
2325+
);
23222326

23232327
// Proceed with sending memory file descriptors over UNIX socket
23242328
vm.send_memory_fds(unix_socket)?;
@@ -2366,7 +2370,7 @@ impl Vmm {
23662370
let mut lock = MIGRATION_PROGRESS_SNAPSHOT.lock().unwrap();
23672371
lock.as_mut()
23682372
.expect("live migration should be ongoing")
2369-
.update_ongoing_migration_state(MigrationPhase::Completing, None, None);
2373+
.update_ongoing_migration_state(OngoingMigrationPhase::Completing, None, None);
23702374
}
23712375
}
23722376

@@ -3571,7 +3575,7 @@ impl RequestHandler for Vmm {
35713575
Ok(())
35723576
}
35733577

3574-
fn vm_migration_progress(&mut self) -> Option<MigrationProgressAndStatus> {
3578+
fn vm_migration_progress(&mut self) -> Option<MigrationProgress> {
35753579
let lock = MIGRATION_PROGRESS_SNAPSHOT.lock().unwrap();
35763580
lock.clone()
35773581
}

0 commit comments

Comments
 (0)