(
&mut self,
state: &VfioCommonState,
msi_state: Option<MsiConfigState>,
msix_state: Option<MsixConfigState>,
)
| 1413 | } |
| 1414 | |
| 1415 | fn set_state( |
| 1416 | &mut self, |
| 1417 | state: &VfioCommonState, |
| 1418 | msi_state: Option<MsiConfigState>, |
| 1419 | msix_state: Option<MsixConfigState>, |
| 1420 | ) -> Result<(), VfioPciError> { |
| 1421 | if let (Some(intx), Some(interrupt_source_group)) = |
| 1422 | (&state.intx_state, self.legacy_interrupt_group.clone()) |
| 1423 | { |
| 1424 | self.interrupt.intx = Some(VfioIntx { |
| 1425 | interrupt_source_group, |
| 1426 | enabled: false, |
| 1427 | }); |
| 1428 | |
| 1429 | if intx.enabled { |
| 1430 | self.enable_intx()?; |
| 1431 | } |
| 1432 | } |
| 1433 | |
| 1434 | if let Some(msi) = &state.msi_state { |
| 1435 | self.initialize_msi(msi.cap.msg_ctl, msi.cap_offset, msi_state); |
| 1436 | } |
| 1437 | |
| 1438 | if let Some(msix) = &state.msix_state { |
| 1439 | self.initialize_msix(msix.cap, msix.cap_offset, msix.bdf.into(), msix_state); |
| 1440 | } |
| 1441 | |
| 1442 | Ok(()) |
| 1443 | } |
| 1444 | } |
| 1445 | |
| 1446 | impl Pausable for VfioCommon {} |
no test coverage detected