anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

Blame SOURCES/0343-pid1-fix-the-names-of-AllowedCPUs-and-AllowedMemoryN.patch

4d52c6
From 061330ee69c102b0acecec6bccacfd7080a8c378 Mon Sep 17 00:00:00 2001
4d52c6
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
4d52c6
Date: Sun, 24 Nov 2019 14:14:43 +0100
4d52c6
Subject: [PATCH] pid1: fix the names of AllowedCPUs= and AllowedMemoryNodes=
4d52c6
4d52c6
The original PR was submitted with CPUSetCpus and CPUSetMems, which was later
4d52c6
changed to AllowedCPUs and AllowedMemmoryNodes everywhere (including the parser
4d52c6
used by systemd-run), but not in the parser for unit files.
4d52c6
4d52c6
Since we already released -rc1, let's keep support for the old names. I think
4d52c6
we can remove it in a release or two if anyone remembers to do that.
4d52c6
4d52c6
Fixes #14126. Follow-up for 047f5d63d7a1ab75073f8485e2f9b550d25b0772.
4d52c6
4d52c6
(cherry picked from commit 0b8d3075872a05e0449906d24421ce192f50c29f)
4d52c6
4d52c6
Related: #1824129
4d52c6
---
4d52c6
 src/core/load-fragment-gperf.gperf.m4 | 4 ++--
4d52c6
 src/core/load-fragment.c              | 4 ++--
4d52c6
 src/core/load-fragment.h              | 4 ++--
4d52c6
 3 files changed, 6 insertions(+), 6 deletions(-)
4d52c6
4d52c6
diff --git a/src/core/load-fragment-gperf.gperf.m4 b/src/core/load-fragment-gperf.gperf.m4
4d52c6
index ebb44df487..161c5a2c82 100644
4d52c6
--- a/src/core/load-fragment-gperf.gperf.m4
4d52c6
+++ b/src/core/load-fragment-gperf.gperf.m4
4d52c6
@@ -161,14 +161,14 @@ $1.KillSignal,                   config_parse_signal,                0,
4d52c6
 )m4_dnl
4d52c6
 m4_define(`CGROUP_CONTEXT_CONFIG_ITEMS',
4d52c6
 `$1.Slice,                       config_parse_unit_slice,            0,                             0
4d52c6
+$1.AllowedCPUs,                  config_parse_allowed_cpus,          0,                             offsetof($1, cgroup_context)
4d52c6
+$1.AllowedMemoryNodes,           config_parse_allowed_mems,          0,                             offsetof($1, cgroup_context)
4d52c6
 $1.CPUAccounting,                config_parse_bool,                  0,                             offsetof($1, cgroup_context.cpu_accounting)
4d52c6
 $1.CPUWeight,                    config_parse_cg_weight,             0,                             offsetof($1, cgroup_context.cpu_weight)
4d52c6
 $1.StartupCPUWeight,             config_parse_cg_weight,             0,                             offsetof($1, cgroup_context.startup_cpu_weight)
4d52c6
 $1.CPUShares,                    config_parse_cpu_shares,            0,                             offsetof($1, cgroup_context.cpu_shares)
4d52c6
 $1.StartupCPUShares,             config_parse_cpu_shares,            0,                             offsetof($1, cgroup_context.startup_cpu_shares)
4d52c6
 $1.CPUQuota,                     config_parse_cpu_quota,             0,                             offsetof($1, cgroup_context)
4d52c6
-$1.CPUSetCpus,                   config_parse_cpuset_cpus,           0,                             offsetof($1, cgroup_context)
4d52c6
-$1.CPUSetMems,                   config_parse_cpuset_mems,           0,                             offsetof($1, cgroup_context)
4d52c6
 $1.MemoryAccounting,             config_parse_bool,                  0,                             offsetof($1, cgroup_context.memory_accounting)
4d52c6
 $1.MemoryLow,                    config_parse_memory_limit,          0,                             offsetof($1, cgroup_context)
4d52c6
 $1.MemoryHigh,                   config_parse_memory_limit,          0,                             offsetof($1, cgroup_context)
4d52c6
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
4d52c6
index 6debf82401..2082166afb 100644
4d52c6
--- a/src/core/load-fragment.c
4d52c6
+++ b/src/core/load-fragment.c
4d52c6
@@ -3011,7 +3011,7 @@ int config_parse_cpu_quota(
4d52c6
         return 0;
4d52c6
 }
4d52c6
 
4d52c6
-int config_parse_cpuset_cpus(
4d52c6
+int config_parse_allowed_cpus(
4d52c6
                 const char *unit,
4d52c6
                 const char *filename,
4d52c6
                 unsigned line,
4d52c6
@@ -3030,7 +3030,7 @@ int config_parse_cpuset_cpus(
4d52c6
         return 0;
4d52c6
 }
4d52c6
 
4d52c6
-int config_parse_cpuset_mems(
4d52c6
+int config_parse_allowed_mems(
4d52c6
                 const char *unit,
4d52c6
                 const char *filename,
4d52c6
                 unsigned line,
4d52c6
diff --git a/src/core/load-fragment.h b/src/core/load-fragment.h
4d52c6
index 6612e1fb32..424fa478a7 100644
4d52c6
--- a/src/core/load-fragment.h
4d52c6
+++ b/src/core/load-fragment.h
4d52c6
@@ -86,8 +86,8 @@ CONFIG_PARSER_PROTOTYPE(config_parse_set_status);
4d52c6
 CONFIG_PARSER_PROTOTYPE(config_parse_namespace_path_strv);
4d52c6
 CONFIG_PARSER_PROTOTYPE(config_parse_temporary_filesystems);
4d52c6
 CONFIG_PARSER_PROTOTYPE(config_parse_cpu_quota);
4d52c6
-CONFIG_PARSER_PROTOTYPE(config_parse_cpuset_cpus);
4d52c6
-CONFIG_PARSER_PROTOTYPE(config_parse_cpuset_mems);
4d52c6
+CONFIG_PARSER_PROTOTYPE(config_parse_allowed_cpus);
4d52c6
+CONFIG_PARSER_PROTOTYPE(config_parse_allowed_mems);
4d52c6
 CONFIG_PARSER_PROTOTYPE(config_parse_protect_home);
4d52c6
 CONFIG_PARSER_PROTOTYPE(config_parse_protect_system);
4d52c6
 CONFIG_PARSER_PROTOTYPE(config_parse_bus_name);