Skip to content

Commit

Permalink
adjust to new interface
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Bauer <[email protected]>
  • Loading branch information
IgnoreWarnings committed Sep 25, 2024
1 parent ba09a00 commit bf0a110
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/lib/kernel/vfio_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ std::shared_ptr<Device> Container::attachDevice(devices::PciDevice &pdev) {
throw RuntimeError("Failed to load kernel driver: vfio_pci");

// Bind PCI card to vfio-pci driver if not already bound
if (pdev.getDriver() != kernelDriver) {
if ( !(pdev.driver().has_value()) || pdev.driver().value()->name() != kernelDriver) {
log->debug("Bind PCI card to kernel driver '{}'", kernelDriver);
pdev.attachDriver(kernelDriver);
}
Expand All @@ -215,7 +215,7 @@ std::shared_ptr<Device> Container::attachDevice(devices::PciDevice &pdev) {
}

// Get IOMMU group of device
int index = isIommuEnabled() ? pdev.getIommuGroup() : 0;
int index = isIommuEnabled() ? pdev.iommu_group().value() : 0;
if (index < 0) {
ret = kernel::getCmdlineParam("intel_iommu", iommu_state,
sizeof(iommu_state));
Expand Down

0 comments on commit bf0a110

Please sign in to comment.