MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / new

Method new

devices/src/aia.rs:43–65  ·  view source on GitHub ↗
(
        vcpu_count: u32,
        interrupt_manager: Arc<dyn InterruptManager<GroupConfig = MsiIrqGroupConfig>>,
        vm: Arc<dyn hypervisor::Vm>,
    )

Source from the content-addressed store, hash-verified

41impl 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,

Callers

nothing calls this directly

Calls 3

create_groupMethod · 0.80
create_vaiaMethod · 0.80
enableMethod · 0.45

Tested by

no test coverage detected