hypervisor, vmm: fix clippy warnings

Signed-off-by: Praveen Paladugu <prapal@microsoft.com>
This commit is contained in:
Praveen Paladugu 2020-09-24 21:15:13 +00:00 committed by Rob Bradford
parent 6ebeaa9246
commit 4b32252028
3 changed files with 3 additions and 3 deletions

View File

@ -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(())
}
}

View File

@ -183,5 +183,5 @@ pub trait Vm: Send + Sync {
/// Get the Vm state. Return VM specific data
fn state(&self) -> Result<VmState>;
/// Set the VM state
fn set_state(&self, state: &VmState) -> Result<()>;
fn set_state(&self, state: VmState) -> Result<()>;
}

View File

@ -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())))?;
}