diff --git a/hypervisor/src/kvm/mod.rs b/hypervisor/src/kvm/mod.rs index 5ca653e54..2dd04eb0c 100644 --- a/hypervisor/src/kvm/mod.rs +++ b/hypervisor/src/kvm/mod.rs @@ -342,7 +342,7 @@ impl vm::Vm for KvmVm { /// /// Set the VM state /// - fn set_state(&self, _state: &VmState) -> vm::Result<()> { + fn set_state(&self, _state: VmState) -> vm::Result<()> { Ok(()) } } diff --git a/hypervisor/src/vm.rs b/hypervisor/src/vm.rs index ab5412006..6d5d5de16 100644 --- a/hypervisor/src/vm.rs +++ b/hypervisor/src/vm.rs @@ -183,5 +183,5 @@ pub trait Vm: Send + Sync { /// Get the Vm state. Return VM specific data fn state(&self) -> Result; /// Set the VM state - fn set_state(&self, state: &VmState) -> Result<()>; + fn set_state(&self, state: VmState) -> Result<()>; } diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index c577edfa2..0a40d0581 100644 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -537,7 +537,7 @@ impl Vm { let vm_snapshot = get_vm_snapshot(snapshot).map_err(Error::Restore)?; let config = vm_snapshot.config; if let Some(state) = vm_snapshot.state { - vm.set_state(&state) + vm.set_state(state) .map_err(|e| Error::Restore(MigratableError::Restore(e.into())))?; }