diff --git a/common/include/villas/kernel/devices/pci_device.hpp b/common/include/villas/kernel/devices/pci_device.hpp index 36f16fba9..292b0cd31 100644 --- a/common/include/villas/kernel/devices/pci_device.hpp +++ b/common/include/villas/kernel/devices/pci_device.hpp @@ -61,6 +61,9 @@ struct Region { }; class PciDevice : public Device { +private: + static constexpr char OVERRIDE_DEFAULT[] = "driver_override"; + public: PciDevice(Id i, Slot s) : id(i), slot(s), log(Log::get("kernel:pci")) {} @@ -74,6 +77,7 @@ public: std::optional> driver() const override; std::optional iommu_group() const override; std::string name() const override; + std::filesystem::path override_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 277e6b708..3f6850621 100644 --- a/common/lib/kernel/devices/pci_device.cpp +++ b/common/lib/kernel/devices/pci_device.cpp @@ -468,4 +468,9 @@ std::string PciDevice::name() const { slot.device, slot.function); return std::string(sysfs); -} \ No newline at end of file +} +// TODO: test +std::filesystem::path PciDevice::override_path() const { + + return this->path() / OVERRIDE_DEFAULT; +}