mirror of
				https://github.com/kata-containers/kata-containers.git
				synced 2025-10-31 09:26:52 +00:00 
			
		
		
		
	dragonball: fix clippy warning for aarch64
Added aarch64 check. Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
This commit is contained in:
		| @@ -795,13 +795,14 @@ impl DeviceManager { | ||||
|     fn allocate_mmio_device_resource( | ||||
|         &self, | ||||
|     ) -> std::result::Result<DeviceResources, StartMicroVmError> { | ||||
|         let mut requests = Vec::new(); | ||||
|         requests.push(ResourceConstraint::MmioAddress { | ||||
|         let requests = vec![ | ||||
|             ResourceConstraint::MmioAddress { | ||||
|                 range: None, | ||||
|                 align: MMIO_DEFAULT_CFG_SIZE, | ||||
|                 size: MMIO_DEFAULT_CFG_SIZE, | ||||
|         }); | ||||
|         requests.push(ResourceConstraint::LegacyIrq { irq: None }); | ||||
|             }, | ||||
|             ResourceConstraint::LegacyIrq { irq: None }, | ||||
|         ]; | ||||
|  | ||||
|         self.res_manager | ||||
|             .allocate_device_resources(&requests, false) | ||||
|   | ||||
| @@ -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<VcpuFd>, | ||||
|   | ||||
| @@ -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(); | ||||
|   | ||||
| @@ -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) | ||||
|   | ||||
| @@ -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<T: DeviceInfoForFDT + Clone + Debug, M: GuestMemory>( | ||||
|     guest_mem: &M, | ||||
|     cmdline: &str, | ||||
| @@ -58,8 +59,9 @@ fn configure_system<T: DeviceInfoForFDT + Clone + Debug, M: GuestMemory>( | ||||
| #[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<dyn GICDevice> { | ||||
|         &self.irqchip_handle.as_ref().unwrap() | ||||
|         self.irqchip_handle.as_ref().unwrap() | ||||
|     } | ||||
|  | ||||
|     /// Creates the irq chip in-kernel device model. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user