mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: memory: Extend new() to support external backing files
Whenever a MemoryManager is restored from a snapshot, the memory regions associated with it might need to directly back the mapped memory for increased performances. If that's the case, a list of external regions is provided and the MemoryManager should simply ignore what's coming from the MemoryConfig. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -360,8 +360,9 @@ impl Vm {
|
||||
vmm_path: PathBuf,
|
||||
) -> Result<Self> {
|
||||
let (kvm, fd) = Vm::kvm_new()?;
|
||||
let memory_manager = MemoryManager::new(fd.clone(), &config.lock().unwrap().memory.clone())
|
||||
.map_err(Error::MemoryManager)?;
|
||||
let memory_manager =
|
||||
MemoryManager::new(fd.clone(), &config.lock().unwrap().memory.clone(), None)
|
||||
.map_err(Error::MemoryManager)?;
|
||||
|
||||
Vm::new_from_memory_manager(
|
||||
config,
|
||||
|
||||
Reference in New Issue
Block a user