mirror of
https://github.com/kata-containers/cgroups-rs.git
synced 2026-08-05 02:13:23 +00:00
Make methods to_controller and controller_name of Subsystem public
We need these functions to detect whether subsystem path exists. Signed-off-by: Tim Zhang <tim@hyper.sh>
This commit is contained in:
@@ -619,7 +619,7 @@ impl Subsystem {
|
||||
}
|
||||
}
|
||||
|
||||
fn to_controller(&self) -> &dyn Controller {
|
||||
pub fn to_controller(&self) -> &dyn Controller {
|
||||
match self {
|
||||
Subsystem::Pid(cont) => cont,
|
||||
Subsystem::Mem(cont) => cont,
|
||||
@@ -638,7 +638,7 @@ impl Subsystem {
|
||||
}
|
||||
}
|
||||
|
||||
fn controller_name(&self) -> String {
|
||||
pub fn controller_name(&self) -> String {
|
||||
self.to_controller().control_type().to_string()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user