(
vcpu_count: u32,
interrupt_manager: Arc<dyn InterruptManager<GroupConfig = MsiIrqGroupConfig>>,
vm: Arc<dyn hypervisor::Vm>,
)
| 41 | impl Aia { |
| 42 | #[allow(clippy::needless_pass_by_value)] |
| 43 | pub fn new( |
| 44 | vcpu_count: u32, |
| 45 | interrupt_manager: Arc<dyn InterruptManager<GroupConfig = MsiIrqGroupConfig>>, |
| 46 | vm: Arc<dyn hypervisor::Vm>, |
| 47 | ) -> Result<Aia> { |
| 48 | let interrupt_source_group = interrupt_manager |
| 49 | .create_group(MsiIrqGroupConfig { |
| 50 | base: IRQ_LEGACY_BASE as InterruptIndex, |
| 51 | count: IRQ_LEGACY_COUNT as InterruptIndex, |
| 52 | }) |
| 53 | .map_err(Error::CreateInterruptSourceGroup)?; |
| 54 | |
| 55 | let config = Aia::create_default_config(vcpu_count as u64); |
| 56 | let vaia = vm.create_vaia(&config).map_err(Error::CreateAia)?; |
| 57 | |
| 58 | let aia = Aia { |
| 59 | interrupt_source_group, |
| 60 | vaia, |
| 61 | }; |
| 62 | aia.enable()?; |
| 63 | |
| 64 | Ok(aia) |
| 65 | } |
| 66 | |
| 67 | pub fn restore_vaia( |
| 68 | &mut self, |
nothing calls this directly
no test coverage detected