!208 upgrade from upstream

Merge pull request !208 from zhangxiaoyu/master
This commit is contained in:
haozi007 2023-02-21 08:03:29 +00:00 committed by Gitee
commit 1a60e9b05a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 136 additions and 1 deletions

View File

@ -0,0 +1,51 @@
From 9bd736bc14da91bfc6ca8bf38f05218e5703adf5 Mon Sep 17 00:00:00 2001
From: "ilya.kuksenok" <ilya.kuksenok@huawei.com>
Date: Tue, 7 Feb 2023 13:51:44 +0300
Subject: [PATCH 2/4] add unified and memory_swap_limit_in_bytes into
host-config
---
.gitignore | 2 ++
src/json/schema/host-config.json | 8 +++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index 0995486..973ceef 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
*.pyc
build
.vscode
+.idea
+cmake-build-debug
diff --git a/src/json/schema/host-config.json b/src/json/schema/host-config.json
index c308558..0367a76 100644
--- a/src/json/schema/host-config.json
+++ b/src/json/schema/host-config.json
@@ -139,9 +139,15 @@
"Memory": {
"type": "int64"
},
+ "Unified": {
+ "$ref": "defs.json#/definitions/mapStringString"
+ },
"OomScoreAdj": {
"type": "integer"
},
+ "MemorySwapLimitInBytes":{
+ "type": "int64"
+ },
"BlkioWeight": {
"type": "uint16"
},
@@ -292,4 +298,4 @@
"type": "string"
}
}
-}
\ No newline at end of file
+}
--
2.25.1

View File

@ -0,0 +1,35 @@
From d332dbb9050510f91445625b56952fd533ec530a Mon Sep 17 00:00:00 2001
From: songbuhuang <544824346@qq.com>
Date: Wed, 8 Feb 2023 10:53:25 +0800
Subject: [PATCH 3/4] fix update cpu-rt period failed
Signed-off-by: songbuhuang <544824346@qq.com>
---
src/lcrcontainer_execute.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/lcrcontainer_execute.c b/src/lcrcontainer_execute.c
index 3f5860f..ff4685b 100644
--- a/src/lcrcontainer_execute.c
+++ b/src/lcrcontainer_execute.c
@@ -360,13 +360,14 @@ static bool update_resources_cpu_v1(struct lxc_container *c, const struct lcr_cg
goto err_out;
}
- if (update_resources_cpu_rt_period(c, cr) != 0) {
- goto err_out;
- }
if (update_resources_cpu_rt_runtime(c, cr) != 0) {
goto err_out;
}
+ if (update_resources_cpu_rt_period(c, cr) != 0) {
+ goto err_out;
+ }
+
ret = true;
err_out:
return ret;
--
2.25.1

View File

@ -0,0 +1,40 @@
From 4df2c0f530bfa62b98e22ea87a01fa567cf01ef3 Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Date: Thu, 9 Feb 2023 10:18:01 +0800
Subject: [PATCH 4/4] fix writing config line with wrong length
Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
---
src/lcrcontainer_extend.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/lcrcontainer_extend.c b/src/lcrcontainer_extend.c
index f6d1465..fb43b22 100644
--- a/src/lcrcontainer_extend.c
+++ b/src/lcrcontainer_extend.c
@@ -841,7 +841,6 @@ static int lcr_spec_write_config(FILE *fp, const struct lcr_list *lcr_conf)
}
nret = snprintf(line, len, "%s = %s", item->name, item->value);
-
if (nret < 0 || (size_t)nret >= len) {
ERROR("Sprintf failed");
goto cleanup;
@@ -853,11 +852,10 @@ static int lcr_spec_write_config(FILE *fp, const struct lcr_list *lcr_conf)
goto cleanup;
}
- nret = strlen(line_encode);
-
- line_encode[nret] = '\n';
+ len = strlen(line_encode);
+ line_encode[len] = '\n';
- if (fwrite(line_encode, 1, len, fp) != len) {
+ if (fwrite(line_encode, 1, len + 1, fp) != len + 1) {
ERROR("Write file failed: %s", strerror(errno));
goto cleanup;
}
--
2.25.1

View File

@ -1,5 +1,5 @@
%global _version 2.1.1 %global _version 2.1.1
%global _release 2 %global _release 3
%global _inner_name isula_libutils %global _inner_name isula_libutils
Name: lcr Name: lcr
@ -13,6 +13,9 @@ License: LGPLv2.1+
BuildRoot: %{_tmppath}/lcr-%{version} BuildRoot: %{_tmppath}/lcr-%{version}
Patch0001: 0001-add-libisula.pc.patch Patch0001: 0001-add-libisula.pc.patch
Patch0002: 0002-add-unified-and-memory_swap_limit_in_bytes-into-host.patch
Patch0003: 0003-fix-update-cpu-rt-period-failed.patch
Patch0004: 0004-fix-writing-config-line-with-wrong-length.patch
%define lxcver_lower 4.0.3-2022102400 %define lxcver_lower 4.0.3-2022102400
%define lxcver_upper 4.0.3-2022102500 %define lxcver_upper 4.0.3-2022102500
@ -126,6 +129,12 @@ rm -rf %{buildroot}
%{_includedir}/%{_inner_name}/*.h %{_includedir}/%{_inner_name}/*.h
%changelog %changelog
* Tue Feb 21 2023 zhangxiaoyu<zhangxiaoyu58@huawei.com> - 2.1.1-3
- Type:enhancement
- CVE:NA
- SUG:NA
- DESC:upgrade from upstream
* Tue Feb 07 2023 zhangxiaoyu<zhangxiaoyu58@huawei.com> - 2.1.1-2 * Tue Feb 07 2023 zhangxiaoyu<zhangxiaoyu58@huawei.com> - 2.1.1-2
- Type:enhancement - Type:enhancement
- CVE:NA - CVE:NA