Make sure all subsystems are enabled and not busy.
| 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); |
nothing calls this directly
no test coverage detected