1 Star 0 Fork 46

jake/src-openEuler-iSulad

forked from src-openEuler/iSulad 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0031-cgroup-v2-does-not-support-isulad-setting-cpu_rt-opt.patch 2.05 KB
一键复制 编辑 原始数据 按行查看 历史
jake 提交于 2024-04-02 11:50 . upgrade from upstream
From 8e11a1eea62cb8061f1613379ff83bd9a721fa50 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Wed, 31 Jan 2024 18:10:46 +0800
Subject: [PATCH 31/43] cgroup v2 does not support isulad setting cpu_rt
options
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
src/cmd/isulad/isulad_commands.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/src/cmd/isulad/isulad_commands.c b/src/cmd/isulad/isulad_commands.c
index 5fb55689..619e36d1 100644
--- a/src/cmd/isulad/isulad_commands.c
+++ b/src/cmd/isulad/isulad_commands.c
@@ -34,6 +34,7 @@
#include "utils_verify.h"
#include "opt_ulimit.h"
#include "opt_log.h"
+#include "sysinfo.h"
const char isulad_desc[] = "GLOBAL OPTIONS:";
const char isulad_usage[] = "[global options]";
@@ -411,6 +412,33 @@ out:
return ret;
}
+static int check_args_cpu_rt(const struct service_arguments *args)
+{
+ int ret = 0;
+ __isula_auto_sysinfo_t sysinfo_t *sysinfo = NULL;
+
+ sysinfo = get_sys_info(true);
+ if (sysinfo == NULL) {
+ COMMAND_ERROR("Failed to get system info");
+ ERROR("Failed to get system info");
+ return -1;
+ }
+
+ if (!(sysinfo->cgcpuinfo.cpu_rt_period) && args->json_confs->cpu_rt_period != 0) {
+ COMMAND_ERROR("Invalid --cpu-rt-period: Your kernel does not support cgroup rt period");
+ ERROR("Invalid --cpu-rt-period: Your kernel does not support cgroup rt period");
+ return -1;
+ }
+
+ if (!(sysinfo->cgcpuinfo.cpu_rt_runtime) && args->json_confs->cpu_rt_runtime != 0) {
+ COMMAND_ERROR("Invalid --cpu-rt-runtime: Your kernel does not support cgroup rt runtime");
+ ERROR("Invalid --cpu-rt-runtime: Your kernel does not support cgroup rt runtime");
+ return -1;
+ }
+
+ return ret;
+}
+
int check_args(struct service_arguments *args)
{
int ret = 0;
@@ -471,6 +499,10 @@ int check_args(struct service_arguments *args)
goto out;
}
+ if (check_args_cpu_rt(args) != 0) {
+ ret = -1;
+ goto out;
+ }
out:
return ret;
}
--
2.34.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jikai11/src-openEuler-iSulad.git
git@gitee.com:jikai11/src-openEuler-iSulad.git
jikai11
src-openEuler-iSulad
src-openEuler-iSulad
master

搜索帮助