summaryrefslogtreecommitdiff
path: root/0075-bugfix-for-setting-cpu-rt-to-a-negative-value-when-e.patch
blob: 7ea77a42d61287b2e4c111c56fc2248ae73efa84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From bd18051dade97d4f75346cb67beea551a38ca13e Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Tue, 23 Apr 2024 20:52:04 +0800
Subject: [PATCH 75/75] bugfix for setting cpu-rt to a negative value when env
 not supports cpu-rt

Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
 src/daemon/modules/spec/verify.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/daemon/modules/spec/verify.c b/src/daemon/modules/spec/verify.c
index 617b7f23..57e16ef9 100644
--- a/src/daemon/modules/spec/verify.c
+++ b/src/daemon/modules/spec/verify.c
@@ -381,14 +381,14 @@ static int verify_cpu_realtime(const sysinfo_t *sysinfo, int64_t realtime_period
 {
     int ret = 0;
 
-    if (realtime_period > 0 && !(sysinfo->cgcpuinfo.cpu_rt_period)) {
+    if (realtime_period != 0 && !(sysinfo->cgcpuinfo.cpu_rt_period)) {
         ERROR("Invalid --cpu-rt-period: Your kernel does not support cgroup rt period");
         isulad_set_error_message("Invalid --cpu-rt-period: Your kernel does not support cgroup rt period");
         ret = -1;
         goto out;
     }
 
-    if (realtime_runtime > 0 && !(sysinfo->cgcpuinfo.cpu_rt_runtime)) {
+    if (realtime_runtime != 0 && !(sysinfo->cgcpuinfo.cpu_rt_runtime)) {
         ERROR("Invalid --cpu-rt-runtime: Your kernel does not support cgroup rt runtime");
         isulad_set_error_message("Invalid --cpu-rt-period: Your kernel does not support cgroup rt runtime");
         ret = -1;
-- 
2.25.1