diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index 9a59a0e15..c10249713 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -1223,18 +1223,23 @@ impl DeviceManager { self.console_resize_pipe.clone() } + pub fn create_interrupt_controller( + &mut self, + ) -> DeviceManagerResult>> { + self.add_interrupt_controller() + } + pub fn create_devices( &mut self, console_info: Option, console_resize_pipe: Option>, original_termios_opt: Arc>>, + interrupt_controller: Arc>, ) -> DeviceManagerResult<()> { trace_scoped!("create_devices"); let mut virtio_devices: Vec = Vec::new(); - let interrupt_controller = self.add_interrupt_controller()?; - self.cpu_manager .lock() .unwrap() diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index a2df6fdf4..693066a5b 100644 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -651,10 +651,16 @@ impl Vm { ) .map_err(Error::DeviceManager)?; + let ic = device_manager + .lock() + .unwrap() + .create_interrupt_controller() + .map_err(Error::DeviceManager)?; + device_manager .lock() .unwrap() - .create_devices(console_info, console_resize_pipe, original_termios) + .create_devices(console_info, console_resize_pipe, original_termios, ic) .map_err(Error::DeviceManager)?; #[cfg(feature = "tdx")]