blkio: Add support for customized-attributes

Customized attributes are useful for customized kernels

Signed-off-by: Tim Zhang <tim@hyper.sh>
This commit is contained in:
Tim Zhang
2022-09-23 17:43:17 +08:00
parent bd31dc0e7d
commit ed49cf77e2
2 changed files with 16 additions and 1 deletions
+9
View File
@@ -613,6 +613,15 @@ pub struct BlkIoResources {
pub throttle_write_bps_device: Vec<BlkIoDeviceThrottleResource>,
/// Throttled write IO operations per second can be provided for each device.
pub throttle_write_iops_device: Vec<BlkIoDeviceThrottleResource>,
/// Customized key-value attributes
/// # Usage:
/// ```
/// let resource = &mut cgroups_rs::Resources::default();
/// resource.blkio.attrs.insert("io.cost.weight".to_string(), "10".to_string());
/// // apply here
/// ```
pub attrs: HashMap<String, String>,
}
/// The resource limits and constraints that will be set on the control group.