mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-28 18:54:37 +01:00
transform the rpc protocol spec to oci spec. Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
50 lines
1.4 KiB
Rust
50 lines
1.4 KiB
Rust
// Copyright (c) 2019 Ant Financial
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
use crate::errors::*;
|
|
// use crate::configs::{FreezerState, Config};
|
|
use oci::LinuxResources;
|
|
use protocols::agent::CgroupStats;
|
|
use std::collections::HashMap;
|
|
|
|
pub mod fs;
|
|
pub mod systemd;
|
|
|
|
pub type FreezerState = &'static str;
|
|
|
|
pub trait Manager {
|
|
fn apply(&self, _pid: i32) -> Result<()> {
|
|
Err(ErrorKind::ErrorCode("not supported!".to_string()).into())
|
|
}
|
|
|
|
fn get_pids(&self) -> Result<Vec<i32>> {
|
|
Err(ErrorKind::ErrorCode("not supported!".to_string()).into())
|
|
}
|
|
|
|
fn get_all_pids(&self) -> Result<Vec<i32>> {
|
|
Err(ErrorKind::ErrorCode("not supported!".to_string()).into())
|
|
}
|
|
|
|
fn get_stats(&self) -> Result<CgroupStats> {
|
|
Err(ErrorKind::ErrorCode("not supported!".to_string()).into())
|
|
}
|
|
|
|
fn freeze(&self, _state: FreezerState) -> Result<()> {
|
|
Err(ErrorKind::ErrorCode("not supported!".to_string()).into())
|
|
}
|
|
|
|
fn destroy(&mut self) -> Result<()> {
|
|
Err(ErrorKind::ErrorCode("not supported!".to_string()).into())
|
|
}
|
|
|
|
fn get_paths(&self) -> Result<HashMap<String, String>> {
|
|
Err(ErrorKind::ErrorCode("not supported!".to_string()).into())
|
|
}
|
|
|
|
fn set(&self, _container: &LinuxResources, _update: bool) -> Result<()> {
|
|
Err(ErrorKind::ErrorCode("not supported!".to_string()).into())
|
|
}
|
|
}
|