pci: Store MSI interrupt manager in VfioCommon

Extend VfioCommon structure to own the MSI interrupt manager. This will
be useful for implementing the restore code path.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2022-04-22 11:08:29 +02:00
parent f767e97fa5
commit eb6daa2fc3
3 changed files with 18 additions and 29 deletions

View File

@@ -66,7 +66,7 @@ impl VfioUserPciDevice {
id: String,
vm: &Arc<dyn hypervisor::Vm>,
client: Arc<Mutex<Client>>,
msi_interrupt_manager: &Arc<dyn InterruptManager<GroupConfig = MsiIrqGroupConfig>>,
msi_interrupt_manager: Arc<dyn InterruptManager<GroupConfig = MsiIrqGroupConfig>>,
legacy_interrupt_group: Option<Arc<dyn InterruptSourceGroup>>,
bdf: PciBdf,
) -> Result<Self, VfioUserPciDeviceError> {
@@ -104,9 +104,10 @@ impl VfioUserPciDevice {
msi: None,
msix: None,
},
msi_interrupt_manager,
};
common.parse_capabilities(msi_interrupt_manager, &vfio_wrapper, bdf);
common.parse_capabilities(&vfio_wrapper, bdf);
common
.initialize_legacy_interrupt(legacy_interrupt_group, &vfio_wrapper)
.map_err(VfioUserPciDeviceError::InitializeLegacyInterrupts)?;