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 Aug 30, 2024
1 parent 9026915 commit 5afc947
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 5afc947

Please sign in to comment.