Skip to content

Commit a595511

Browse files
adjust to new interface
Signed-off-by: Pascal Bauer <[email protected]>
1 parent e585d73 commit a595511

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

common/lib/kernel/vfio_container.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ std::shared_ptr<Device> Container::attachDevice(devices::PciDevice &pdev) {
197197
throw RuntimeError("Failed to load kernel driver: vfio_pci");
198198

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

217217
// Get IOMMU group of device
218-
int index = isIommuEnabled() ? pdev.getIommuGroup() : 0;
218+
int index = isIommuEnabled() ? pdev.iommu_group().value() : 0;
219219
if (index < 0) {
220220
ret = kernel::getCmdlineParam("intel_iommu", iommu_state,
221221
sizeof(iommu_state));

0 commit comments

Comments
 (0)