mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
+4
-4
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user