MCPcopy Create free account
hub / github.com/apache/mesos / foreach

Function foreach

src/linux/cgroups.cpp:194–209  ·  view source on GitHub ↗

Make sure all subsystems are enabled and not busy.

Source from the content-addressed store, hash-verified

192
193 // Make sure all subsystems are enabled and not busy.
194 foreach (const string& subsystem, strings::tokenize(subsystems, ",")) {
195 Try<bool> result = enabled(subsystem);
196 if (result.isError()) {
197 return Error(result.error());
198 } else if (!result.get()) {
199 return Error("'" + subsystem + "' is not enabled by the kernel");
200 }
201
202 result = busy(subsystem);
203 if (result.isError()) {
204 return Error(result.error());
205 } else if (result.get()) {
206 return Error(
207 "'" + subsystem + "' is already attached to another hierarchy");
208 }
209 }
210
211 // Create the directory for the hierarchy.
212 Try<Nothing> mkdir = os::mkdir(hierarchy);

Callers

nothing calls this directly

Calls 15

busyFunction · 0.85
mountedFunction · 0.85
PathClass · 0.85
cloneCpusetCpusMemsFunction · 0.85
ErrnoErrorClass · 0.85
strsignalFunction · 0.85
insertMethod · 0.80
hasOptionMethod · 0.80
dirnameMethod · 0.80
enabledFunction · 0.70
removeFunction · 0.70
killFunction · 0.70

Tested by

no test coverage detected