mirror of
https://github.com/kata-containers/cgroups-rs.git
synced 2026-08-05 02:13:23 +00:00
Systemd manager takes cgroups path in the format of "parent:scope_prefix:name" to create and manipulate cgroups through systemd. It does value conversions for resources defined in the Linux resources from the OCI spec, such as CPU quota, period, etc. Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
29 lines
723 B
Rust
29 lines
723 B
Rust
// Copyright (c) 2025 Ant Group
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0 or MIT
|
|
//
|
|
|
|
use crate::fs::error::Error as CgroupfsError;
|
|
use crate::systemd::dbus::error::Error as SystemdDbusError;
|
|
use crate::systemd::error::Error as SystemdCgroupError;
|
|
|
|
pub type Result<T> = std::result::Result<T, Error>;
|
|
|
|
#[derive(thiserror::Error, Debug)]
|
|
pub enum Error {
|
|
#[error("invalid argument")]
|
|
InvalidArgument,
|
|
|
|
#[error("invalid linux resource")]
|
|
InvalidLinuxResource,
|
|
|
|
#[error("cgroupfs error: {0}")]
|
|
Cgroupfs(#[from] CgroupfsError),
|
|
|
|
#[error("systemd cgroup error: {0}")]
|
|
SystemdCgroup(#[from] SystemdCgroupError),
|
|
|
|
#[error("systemd dbus error: {0}")]
|
|
SystemdDbus(#[from] SystemdDbusError),
|
|
}
|