mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Add "prefault" option when restoring
Now that the restore path uses RestoreConfig structure, we add a new parameter called "prefault" to it. This will give the user the ability to populate the pages corresponding to the mapped regions backed by the snapshotted memory files. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -388,6 +388,7 @@ impl Vm {
|
||||
reset_evt: EventFd,
|
||||
vmm_path: PathBuf,
|
||||
source_url: &str,
|
||||
prefault: bool,
|
||||
) -> Result<Self> {
|
||||
let (kvm, fd) = Vm::kvm_new()?;
|
||||
let config = vm_config_from_snapshot(snapshot).map_err(Error::Restore)?;
|
||||
@@ -400,6 +401,7 @@ impl Vm {
|
||||
fd.clone(),
|
||||
&config.lock().unwrap().memory.clone(),
|
||||
source_url,
|
||||
prefault,
|
||||
)
|
||||
.map_err(Error::MemoryManager)?
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user