diff --git a/common/include/villas/kernel/devices/pci_device.hpp b/common/include/villas/kernel/devices/pci_device.hpp index 292b0cd31..b62595202 100644 --- a/common/include/villas/kernel/devices/pci_device.hpp +++ b/common/include/villas/kernel/devices/pci_device.hpp @@ -78,6 +78,7 @@ public: std::optional iommu_group() const override; std::string name() const override; std::filesystem::path override_path() const override; + std::filesystem::path path() const override; // Bind a new LKM to the PCI device bool attachDriver(const std::string &driver) const; diff --git a/common/lib/kernel/devices/pci_device.cpp b/common/lib/kernel/devices/pci_device.cpp index 3f6850621..358796f42 100644 --- a/common/lib/kernel/devices/pci_device.cpp +++ b/common/lib/kernel/devices/pci_device.cpp @@ -469,6 +469,17 @@ std::string PciDevice::name() const { return std::string(sysfs); } + +// TODO: test +std::filesystem::path PciDevice::path() const { + char sysfs[1024]; + + snprintf(sysfs, sizeof(sysfs), "%04x:%02x:%02x.%x", slot.domain, slot.bus, + slot.device, slot.function); + + return sysfs; +}; + // TODO: test std::filesystem::path PciDevice::override_path() const {