mirror of
https://github.com/kata-containers/cgroups-rs.git
synced 2026-08-05 02:13:23 +00:00
blkio: use BlkIoData for weight_device, too
Signed-off-by: Levente Kurusa <lkurusa@acm.org>
This commit is contained in:
@@ -252,7 +252,7 @@ pub struct BlkIo {
|
||||
/// The weight of this control group.
|
||||
pub weight: u64,
|
||||
/// Same as `weight`, but per-block-device.
|
||||
pub weight_device: String,
|
||||
pub weight_device: Vec<BlkIoData>,
|
||||
}
|
||||
|
||||
impl Controller for BlkIoController {
|
||||
@@ -510,9 +510,10 @@ impl BlkIoController {
|
||||
weight: self.open_path("blkio.weight", false).and_then(|file| {
|
||||
read_u64_from(file)
|
||||
}).unwrap_or(0u64),
|
||||
weight_device: self.open_path("blkio.weight_device", false).and_then(|file| {
|
||||
read_string_from(file)
|
||||
}).unwrap_or("".to_string()),
|
||||
weight_device: self.open_path("blkio.weight_device", false)
|
||||
.and_then(read_string_from)
|
||||
.and_then(parse_blkio_data)
|
||||
.unwrap_or(Vec::new()),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user