#[derive(Debug, Default, Clone, Eq, PartialEq)]
#[derive(Deserialize, Serialize)]
#[serde(default, deny_unknown_fields)]
pub struct GlobalCgroupConfiguration
{
#[serde(flatten)] pub root_cgroup_configuration: RootCgroupConfiguration,
}
impl GlobalCgroupConfiguration
{
pub fn configure(&self, sys_path: &SysPath, proc_path: &ProcPath, defaults: &DefaultHugePageSizes) -> Result<(), GlobalCgroupConfigurationError>
{
use self::GlobalCgroupConfigurationError::*;
let mounts = Mounts::parse(proc_path, ProcessIdentifierChoice::Current).map_err(CouldNotParseMounts)?;
let mount_point = mounts.mount_if_not_mounted::<CgroupMountPoint>(sys_path).map_err(CouldNotMount)?;
self.root_cgroup_configuration.configure(&mount_point, defaults).map_err(CouldNotChange)
}
}