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:
Philipp Schuster
2026-04-09 10:42:55 +02:00
committed by Rob Bradford
parent 94f78e5a96
commit 6a3024c13d

View File

@@ -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.