vmm: Create MemoryManager from restore data

Extending the MemoryManager::new() function to be able to create a
MemoryManager from data that have been previously stored instead of
always creating everything from scratch.

This change brings real added value as it allows a VM to be restored
respecting the proper memory layout instead of hoping the regions will
be created the way they were before.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2021-10-05 15:14:01 +02:00
committed by Bo Chen
parent 5b177b205b
commit 6a55768d94
2 changed files with 167 additions and 111 deletions

View File

@@ -750,6 +750,7 @@ impl Vm {
phys_bits,
#[cfg(feature = "tdx")]
tdx_enabled,
None,
)
.map_err(Error::MemoryManager)?;
@@ -866,6 +867,7 @@ impl Vm {
phys_bits,
#[cfg(feature = "tdx")]
false,
None,
)
.map_err(Error::MemoryManager)?;