/* Return true if the controller @entry is found in the null-terminated list of
* hierarchies @hlist.
*/
-static bool controller_found(struct hierarchy **hlist, char *entry)
+static bool controller_available(struct hierarchy **hlist, char *entry)
{
if (!hlist)
return false;
return false;
}
-/* Return true if all of the controllers which we require have been found. The
- * required list is freezer and anything in lxc.cgroup.use.
- */
-__lxc_unused static bool all_controllers_found(struct cgroup_ops *ops)
+static bool controllers_available(struct cgroup_ops *ops)
{
struct hierarchy **hlist;
hlist = ops->hierarchies;
for (char **cur = ops->cgroup_use; cur && *cur; cur++)
- if (!controller_found(hlist, *cur))
- return log_error(false, "No %s controller mountpoint found", *cur);
+ if (!controller_available(hlist, *cur))
+ return log_error(false, "The %s controller found", *cur);
return true;
}
}
}
+ if (!controllers_available(ops))
+ return syserrno_set(-ENOENT, "One or more requested controllers unavailable or not delegated");
+
return 0;
}