Merge "libmodprobe: add strict bool argument to LoadListedModules"

This commit is contained in:
Mark Salyzyn 2019-11-01 21:52:26 +00:00 committed by Gerrit Code Review
commit 552bbdde38
2 changed files with 6 additions and 4 deletions

View file

@ -26,7 +26,7 @@ class Modprobe {
public:
Modprobe(const std::vector<std::string>&);
bool LoadListedModules();
bool LoadListedModules(bool strict = true);
bool LoadWithAliases(const std::string& module_name, bool strict,
const std::string& parameters = "");
bool Remove(const std::string& module_name);

View file

@ -360,13 +360,15 @@ bool Modprobe::LoadWithAliases(const std::string& module_name, bool strict,
return true;
}
bool Modprobe::LoadListedModules() {
bool Modprobe::LoadListedModules(bool strict) {
auto ret = true;
for (const auto& module : module_load_) {
if (!LoadWithAliases(module, true)) {
return false;
ret = false;
if (strict) break;
}
}
return true;
return ret;
}
bool Modprobe::Remove(const std::string& module_name) {