vmm: Move Vm to the new restore design

Now the entire codebase has been moved to the new restore design, we can
complete the work by creating a dedicated restore() function for the Vm
object and get rid of the method restore() from the Snapshottable trait.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2022-12-01 16:52:04 +01:00
committed by Bo Chen
parent 3888f57600
commit d0c53a5357
3 changed files with 34 additions and 45 deletions
+4 -4
View File
@@ -682,7 +682,7 @@ impl Vmm {
None,
None,
None,
Some(snapshot.clone()),
Some(snapshot),
Some(source_url),
Some(restore_cfg.prefault),
)?;
@@ -690,7 +690,7 @@ impl Vmm {
// Now we can restore the rest of the VM.
if let Some(ref mut vm) = self.vm {
vm.restore(snapshot).map_err(VmError::Restore)
vm.restore()
} else {
Err(VmError::VmNotCreated)
}
@@ -1272,9 +1272,9 @@ impl Vmm {
})?;
// Create VM
vm.restore(snapshot).map_err(|e| {
vm.restore().map_err(|e| {
Response::error().write_to(socket).ok();
e
MigratableError::MigrateReceive(anyhow!("Failed restoring the Vm: {}", e))
})?;
self.vm = Some(vm);