mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vm-migration: add MemoryMigrationContext::empty_finalized() helper
This is helpful in the following to properly aggregate statistics for local migrations. On-behalf-of: SAP philipp.schuster@sap.com Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
This commit is contained in:
committed by
Rob Bradford
parent
94f78e5a96
commit
6a3024c13d
@@ -286,6 +286,15 @@ impl MemoryMigrationContext {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns an empty finalized block.
|
||||
///
|
||||
/// This can be used if no memory was transferred (e.g., local migration).
|
||||
pub fn empty_finalized() -> Self {
|
||||
let mut this = Self::new();
|
||||
this.finalize();
|
||||
this
|
||||
}
|
||||
|
||||
/// Updates the metrics right before the transfer over the wire.
|
||||
///
|
||||
/// Supposed to be called once per precopy memory iteration.
|
||||
|
||||
Reference in New Issue
Block a user