diff --git a/devices/src/gic.rs b/devices/src/gic.rs index eb04ff189..09623362a 100644 --- a/devices/src/gic.rs +++ b/devices/src/gic.rs @@ -47,8 +47,7 @@ impl Gic { impl InterruptController for Gic { fn enable(&self) -> Result<()> { - &self - .interrupt_source_group + self.interrupt_source_group .enable() .map_err(Error::EnableInterrupt)?; Ok(()) diff --git a/hypervisor/src/kvm/mod.rs b/hypervisor/src/kvm/mod.rs index 36e5ca743..f06a5046b 100644 --- a/hypervisor/src/kvm/mod.rs +++ b/hypervisor/src/kvm/mod.rs @@ -949,6 +949,7 @@ impl cpu::Vcpu for KvmVcpu { #[allow(unused_variables)] #[cfg(target_arch = "aarch64")] fn set_state(&self, state: &CpuState) -> cpu::Result<()> { + warn!("CPU state was not restored"); Ok(()) } } diff --git a/vm-allocator/src/gsi.rs b/vm-allocator/src/gsi.rs index f650506c8..ed01bbfd4 100644 --- a/vm-allocator/src/gsi.rs +++ b/vm-allocator/src/gsi.rs @@ -2,8 +2,6 @@ // // SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause -#[cfg(target_arch = "aarch64")] -use arch; #[cfg(target_arch = "x86_64")] use std::collections::btree_map::BTreeMap; use std::result; @@ -65,6 +63,7 @@ impl GsiAllocator { } #[cfg(target_arch = "aarch64")] + #[allow(clippy::new_without_default)] /// New GSI allocator pub fn new() -> Self { GsiAllocator { diff --git a/vmm/src/cpu.rs b/vmm/src/cpu.rs index fe4c52723..b29f8d68b 100644 --- a/vmm/src/cpu.rs +++ b/vmm/src/cpu.rs @@ -981,12 +981,10 @@ impl CpuManager { #[cfg(target_arch = "aarch64")] pub fn get_mpidrs(&self) -> Vec { - let vcpu_mpidrs = self - .vcpus + self.vcpus .iter() .map(|cpu| cpu.lock().unwrap().get_mpidr()) - .collect(); - vcpu_mpidrs + .collect() } #[cfg(feature = "acpi")] diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index e507a90c5..8d6ed305d 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -1356,7 +1356,7 @@ impl DeviceManager { self.address_manager .mmio_bus - .insert(rtc_device.clone(), addr.0, MMIO_LEN) + .insert(rtc_device, addr.0, MMIO_LEN) .map_err(DeviceManagerError::BusError)?; self.id_to_dev_info.insert( diff --git a/vmm/src/memory_manager.rs b/vmm/src/memory_manager.rs index c1e547bd2..47dff18d7 100644 --- a/vmm/src/memory_manager.rs +++ b/vmm/src/memory_manager.rs @@ -604,6 +604,7 @@ impl MemoryManager { // If the next area is hotplugged RAM, the start address needs to be aligned // to 128MiB boundary, and a gap of 256MiB need to be set before it. // On x86_64, it must also start at the 64bit start. + #[allow(clippy::let_and_return)] fn start_addr(mem_end: GuestAddress, with_gap: bool) -> GuestAddress { let start_addr = if with_gap { GuestAddress((mem_end.0 + 1 + (256 << 20)) & !((128 << 20) - 1)) diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index 532ad03c6..764672942 100644 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -401,7 +401,7 @@ impl Vm { #[cfg(target_arch = "x86_64")] vm.enable_split_irq().unwrap(); let vm_snapshot = get_vm_snapshot(snapshot).map_err(Error::Restore)?; - let config = vm_snapshot.config.clone(); + let config = vm_snapshot.config; if let Some(state) = vm_snapshot.state { vm.set_state(&state) .map_err(|e| Error::Restore(MigratableError::Restore(e.into())))?; @@ -1576,7 +1576,7 @@ mod tests { &CString::new("console=tty0").unwrap(), vec![0], &dev_info, - &gic, + &*gic, &None, &None, )