diff options
| author | Lennart Poettering <lennart@poettering.net> | 2018-05-07 21:47:15 +0200 |
|---|---|---|
| committer | Lennart Poettering <lennart@poettering.net> | 2018-05-17 20:48:54 +0200 |
| commit | d107bb7d63a641d003ad513c9d3b6306743a424e (patch) | |
| tree | 9b3cf6bf43fd3b4885fecf2d47880aa55c126ed7 /src/nspawn/nspawn-settings.h | |
| parent | 50ebcf6cb79f709cc08c8a797df128a4a79fc8fd (diff) | |
| download | systemd-d107bb7d63a641d003ad513c9d3b6306743a424e.tar.gz | |
nspawn: add a new --cpu-affinity= switch
Similar as the other options added before, this is primarily useful to
provide comprehensive OCI runtime compatbility, but might be useful
otherwise, too.
Diffstat (limited to 'src/nspawn/nspawn-settings.h')
| -rw-r--r-- | src/nspawn/nspawn-settings.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/nspawn/nspawn-settings.h b/src/nspawn/nspawn-settings.h index 7cf5be625b..c786bf8c86 100644 --- a/src/nspawn/nspawn-settings.h +++ b/src/nspawn/nspawn-settings.h @@ -7,6 +7,7 @@ Copyright 2015 Lennart Poettering ***/ +#include <sched.h> #include <stdio.h> #include "sd-id128.h" @@ -52,9 +53,10 @@ typedef enum SettingsMask { SETTING_HOSTNAME = UINT64_C(1) << 17, SETTING_NO_NEW_PRIVILEGES = UINT64_C(1) << 18, SETTING_OOM_SCORE_ADJUST = UINT64_C(1) << 19, - SETTING_RLIMIT_FIRST = UINT64_C(1) << 20, /* we define one bit per resource limit here */ - SETTING_RLIMIT_LAST = UINT64_C(1) << (20 + _RLIMIT_MAX - 1), - _SETTINGS_MASK_ALL = (UINT64_C(1) << (20 + _RLIMIT_MAX)) - 1 + SETTING_CPU_AFFINITY = UINT64_C(1) << 20, + SETTING_RLIMIT_FIRST = UINT64_C(1) << 21, /* we define one bit per resource limit here */ + SETTING_RLIMIT_LAST = UINT64_C(1) << (21 + _RLIMIT_MAX - 1), + _SETTINGS_MASK_ALL = (UINT64_C(1) << (21 + _RLIMIT_MAX)) - 1 } SettingsMask; typedef struct Settings { @@ -81,6 +83,8 @@ typedef struct Settings { int no_new_privileges; int oom_score_adjust; bool oom_score_adjust_set; + cpu_set_t *cpuset; + unsigned cpuset_ncpus; /* [Image] */ int read_only; @@ -127,3 +131,4 @@ int config_parse_private_users(const char *unit, const char *filename, unsigned int config_parse_syscall_filter(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); int config_parse_hostname(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); int config_parse_oom_score_adjust(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); +int config_parse_cpu_affinity(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); |
