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

Method initialize_legacy_interrupt

pci/src/vfio.rs:1157–1176  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

1155 }
1156
1157 fn initialize_legacy_interrupt(&mut self) -> Result<(), VfioPciError> {
1158 if let Some(irq_info) = self.vfio_wrapper.get_irq_info(VFIO_PCI_INTX_IRQ_INDEX)
1159 && irq_info.count == 0
1160 {
1161 // A count of 0 means the INTx IRQ is not supported, therefore
1162 // it shouldn't be initialized.
1163 return Ok(());
1164 }
1165
1166 if let Some(interrupt_source_group) = self.legacy_interrupt_group.clone() {
1167 self.interrupt.intx = Some(VfioIntx {
1168 interrupt_source_group,
1169 enabled: false,
1170 });
1171
1172 self.enable_intx()?;
1173 }
1174
1175 Ok(())
1176 }
1177
1178 fn update_msi_capabilities(&mut self, offset: u64, data: &[u8]) -> Result<(), VfioPciError> {
1179 match self.interrupt.update_msi(offset, data) {

Callers 1

newMethod · 0.80

Calls 3

enable_intxMethod · 0.80
get_irq_infoMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected