vmm: Merge Vm::new_from_snapshot with Vm::new

Given the recent factorization that happened in vm.rs, we're now able to
merge Vm::new_from_snapshot with Vm::new.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2022-12-01 11:13:08 +01:00
parent 1c36065754
commit e8c6d83f3f
2 changed files with 48 additions and 78 deletions
+13 -4
View File
@@ -584,6 +584,9 @@ impl Vmm {
None,
None,
None,
None,
None,
None,
)?;
self.vm = Some(vm);
@@ -667,18 +670,21 @@ impl Vmm {
.try_clone()
.map_err(VmError::EventFdClone)?;
let vm = Vm::new_from_snapshot(
&snapshot,
let vm = Vm::new(
vm_config,
exit_evt,
reset_evt,
#[cfg(feature = "guest_debug")]
debug_evt,
Some(source_url),
restore_cfg.prefault,
&self.seccomp_action,
self.hypervisor.clone(),
activate_evt,
None,
None,
None,
Some(snapshot.clone()),
Some(source_url),
Some(restore_cfg.prefault),
)?;
self.vm = Some(vm);
@@ -756,6 +762,9 @@ impl Vmm {
serial_pty,
console_pty,
console_resize_pipe,
None,
None,
None,
)?;
// And we boot it