From 49523a5076d77bf96327971d9e3c6bcdec9b2bbc Mon Sep 17 00:00:00 2001 From: Niklas Eiling Date: Mon, 26 Feb 2024 18:42:02 +0100 Subject: [PATCH] fpga: remove std::filesystem and properly retrieve searchPath from configPath Signed-off-by: Niklas Eiling --- include/villas/node.hpp | 3 +-- lib/nodes/fpga.cpp | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/villas/node.hpp b/include/villas/node.hpp index b6746b9c8..adfa7480e 100644 --- a/include/villas/node.hpp +++ b/include/villas/node.hpp @@ -7,7 +7,6 @@ #pragma once -#include #include #include #include @@ -66,7 +65,7 @@ public: PathSourceList sources; // A list of path sources which reference this node. PathDestinationList destinations; // A list of path destinations which reference this node. - std::filesystem::path configPath; + std::string configPath; #ifdef __linux__ int fwmark; // Socket mark for netem, routing and filtering diff --git a/lib/nodes/fpga.cpp b/lib/nodes/fpga.cpp index 1b1f36660..30b9b0efe 100644 --- a/lib/nodes/fpga.cpp +++ b/lib/nodes/fpga.cpp @@ -122,7 +122,7 @@ int FpgaNode::parse(json_t *json) { } else { cardName = "anonymous Card"; } - auto searchPath = configPath.parent_path(); + auto searchPath = configPath.substr(0, configPath.rfind("/")); card = createCard(jsonCard, searchPath, vfioContainer, cardName); if (card == nullptr) { throw ConfigError(jsonCard, "node-config-fpga", "Failed to create card"); @@ -249,7 +249,8 @@ int FpgaNodeFactory::start(SuperNode *sn) { } if (cards.empty()) { - std::string searchPath = sn->getConfigPath() + "/.."; + auto searchPath = + sn->getConfigPath().substr(0, sn->getConfigPath().rfind("/")); createCards(sn->getConfig(), cards, searchPath); }