1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

utils: remove cards from createCard

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
This commit is contained in:
Niklas Eiling 2024-02-26 11:38:10 +01:00 committed by Niklas Eiling
parent a3209aa344
commit d24a323e5c
2 changed files with 6 additions and 7 deletions

View file

@ -18,8 +18,7 @@ std::shared_ptr<fpga::Card>
setupFpgaCard(const std::string &configFile, const std::string &fpgaName);
std::shared_ptr<fpga::Card>
createCard(json_t *config, std::list<std::shared_ptr<fpga::Card>> &cards,
std::filesystem::path &searchPath,
createCard(json_t *config, std::filesystem::path &searchPath,
std::shared_ptr<kernel::vfio::Container> vfioContainer,
std::string card_name = "anonymous Card");
int createCards(json_t *config, std::list<std::shared_ptr<fpga::Card>> &cards,

View file

@ -226,8 +226,7 @@ void fpga::setupColorHandling()
}
std::shared_ptr<fpga::Card>
fpga::createCard(json_t *config, std::list<std::shared_ptr<fpga::Card>> &cards,
std::filesystem::path &searchPath,
fpga::createCard(json_t *config, std::filesystem::path &searchPath,
std::shared_ptr<kernel::vfio::Container> vfioContainer,
std::string card_name) {
auto configDir = std::filesystem::path().parent_path();
@ -246,7 +245,6 @@ fpga::createCard(json_t *config, std::list<std::shared_ptr<fpga::Card>> &cards,
auto card = fpga::PCIeCardFactory::make(config, std::string(card_name),
vfioContainer, searchPath);
if (card) {
cards.push_back(card);
return card;
}
return nullptr;
@ -275,9 +273,11 @@ int fpga::createCards(json_t *config,
const char *card_name;
json_t *json_card;
std::shared_ptr<fpga::Card> card;
json_object_foreach(fpgas, card_name, json_card) {
if (createCard(json_card, cards, searchPath, vfioContainer, card_name) !=
nullptr) {
card = createCard(json_card, searchPath, vfioContainer, card_name);
if (card != nullptr) {
cards.push_back(card);
numFpgas++;
}
}