diff --git a/src/dragonball/src/device_manager/mod.rs b/src/dragonball/src/device_manager/mod.rs index 75eaef6ac3..09689ca52c 100644 --- a/src/dragonball/src/device_manager/mod.rs +++ b/src/dragonball/src/device_manager/mod.rs @@ -795,13 +795,14 @@ impl DeviceManager { fn allocate_mmio_device_resource( &self, ) -> std::result::Result { - let mut requests = Vec::new(); - requests.push(ResourceConstraint::MmioAddress { - range: None, - align: MMIO_DEFAULT_CFG_SIZE, - size: MMIO_DEFAULT_CFG_SIZE, - }); - requests.push(ResourceConstraint::LegacyIrq { irq: None }); + let requests = vec![ + ResourceConstraint::MmioAddress { + range: None, + align: MMIO_DEFAULT_CFG_SIZE, + size: MMIO_DEFAULT_CFG_SIZE, + }, + ResourceConstraint::LegacyIrq { irq: None }, + ]; self.res_manager .allocate_device_resources(&requests, false) diff --git a/src/dragonball/src/vcpu/aarch64.rs b/src/dragonball/src/vcpu/aarch64.rs index 054a1f65d4..dc4b9c61a6 100644 --- a/src/dragonball/src/vcpu/aarch64.rs +++ b/src/dragonball/src/vcpu/aarch64.rs @@ -39,6 +39,7 @@ impl Vcpu { /// vcpu thread to vmm thread. /// * `create_ts` - A timestamp used by the vcpu to calculate its lifetime. /// * `support_immediate_exit` - whether kvm uses supports immediate_exit flag. + #[allow(clippy::too_many_arguments)] pub fn new_aarch64( id: u8, vcpu_fd: Arc, diff --git a/src/dragonball/src/vcpu/vcpu_impl.rs b/src/dragonball/src/vcpu/vcpu_impl.rs index 85f2888ced..ff3f9e44fe 100644 --- a/src/dragonball/src/vcpu/vcpu_impl.rs +++ b/src/dragonball/src/vcpu/vcpu_impl.rs @@ -851,7 +851,7 @@ pub mod tests { let kvm = Kvm::new().unwrap(); let vm = Arc::new(kvm.create_vm().unwrap()); - let kvm_context = KvmContext::new(Some(kvm.as_raw_fd())).unwrap(); + let _kvm_context = KvmContext::new(Some(kvm.as_raw_fd())).unwrap(); let vcpu_fd = Arc::new(vm.create_vcpu(0).unwrap()); let io_manager = IoManagerCached::new(Arc::new(ArcSwap::new(Arc::new(IoManager::new())))); let reset_event_fd = EventFd::new(libc::EFD_NONBLOCK).unwrap(); diff --git a/src/dragonball/src/vcpu/vcpu_manager.rs b/src/dragonball/src/vcpu/vcpu_manager.rs index f6f3e93ffa..51a790c4db 100644 --- a/src/dragonball/src/vcpu/vcpu_manager.rs +++ b/src/dragonball/src/vcpu/vcpu_manager.rs @@ -774,7 +774,7 @@ impl VcpuManager { self.reset_event_fd.as_ref().unwrap().try_clone().unwrap(), self.vcpu_state_event.try_clone().unwrap(), self.vcpu_state_sender.clone(), - request_ts.clone(), + request_ts, self.support_immediate_exit, ) .map_err(VcpuManagerError::Vcpu) diff --git a/src/dragonball/src/vm/aarch64.rs b/src/dragonball/src/vm/aarch64.rs index 8206920ce7..fddbf9516a 100644 --- a/src/dragonball/src/vm/aarch64.rs +++ b/src/dragonball/src/vm/aarch64.rs @@ -35,6 +35,7 @@ use crate::event_manager::EventManager; /// * `device_info` - A hashmap containing the attached devices for building FDT device nodes. /// * `gic_device` - The GIC device. /// * `initrd` - Information about an optional initrd. +#[allow(clippy::borrowed_box)] fn configure_system( guest_mem: &M, cmdline: &str, @@ -58,8 +59,9 @@ fn configure_system( #[cfg(target_arch = "aarch64")] impl Vm { /// Gets a reference to the irqchip of the VM + #[allow(clippy::borrowed_box)] pub fn get_irqchip(&self) -> &Box { - &self.irqchip_handle.as_ref().unwrap() + self.irqchip_handle.as_ref().unwrap() } /// Creates the irq chip in-kernel device model.