mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-02 11:35:46 +00:00
vmm: Notify Migratable objects about migration being complete
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
f65538b08f
commit
5a83ebce64
@ -4188,6 +4188,15 @@ impl Migratable for DeviceManager {
|
|||||||
}
|
}
|
||||||
Ok(MemoryRangeTable::new_from_tables(tables))
|
Ok(MemoryRangeTable::new_from_tables(tables))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn complete_migration(&mut self) -> std::result::Result<(), MigratableError> {
|
||||||
|
for (_, device_node) in self.device_tree.lock().unwrap().iter() {
|
||||||
|
if let Some(migratable) = &device_node.migratable {
|
||||||
|
migratable.lock().unwrap().complete_migration()?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const PCIU_FIELD_OFFSET: u64 = 0;
|
const PCIU_FIELD_OFFSET: u64 = 0;
|
||||||
|
@ -1135,6 +1135,9 @@ impl Vmm {
|
|||||||
} {
|
} {
|
||||||
// Stop logging dirty pages and keep the source VM paused unpon successful migration
|
// Stop logging dirty pages and keep the source VM paused unpon successful migration
|
||||||
Ok(()) => {
|
Ok(()) => {
|
||||||
|
// Let every Migratable object know about the migration being complete
|
||||||
|
vm.complete_migration()?;
|
||||||
|
|
||||||
// Stop logging dirty pages
|
// Stop logging dirty pages
|
||||||
vm.stop_dirty_log()?;
|
vm.stop_dirty_log()?;
|
||||||
|
|
||||||
|
@ -2547,6 +2547,11 @@ impl Migratable for Vm {
|
|||||||
self.device_manager.lock().unwrap().dirty_log()?,
|
self.device_manager.lock().unwrap().dirty_log()?,
|
||||||
]))
|
]))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn complete_migration(&mut self) -> std::result::Result<(), MigratableError> {
|
||||||
|
self.memory_manager.lock().unwrap().complete_migration()?;
|
||||||
|
self.device_manager.lock().unwrap().complete_migration()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
|
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
|
||||||
|
Loading…
Reference in New Issue
Block a user