]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
4 years agomacro: add swap helper
Christian Brauner [Thu, 18 Feb 2021 10:23:30 +0000 (11:23 +0100)] 
macro: add swap helper

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocommands: replace bpf program on update
Christian Brauner [Thu, 18 Feb 2021 09:43:10 +0000 (10:43 +0100)] 
commands: replace bpf program on update

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocommands: improve bpf device program management
Christian Brauner [Thu, 18 Feb 2021 09:41:52 +0000 (10:41 +0100)] 
commands: improve bpf device program management

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: improve bpf device program management
Christian Brauner [Thu, 18 Feb 2021 09:39:39 +0000 (10:39 +0100)] 
cgroups: improve bpf device program management

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agobpf: add helpers for better bpf device program management
Christian Brauner [Thu, 18 Feb 2021 09:39:14 +0000 (10:39 +0100)] 
bpf: add helpers for better bpf device program management

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: improve bpf device program handling
Christian Brauner [Thu, 18 Feb 2021 09:24:10 +0000 (10:24 +0100)] 
cgroups: improve bpf device program handling

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: make device cgroups semantics clearer
Christian Brauner [Thu, 18 Feb 2021 09:23:29 +0000 (10:23 +0100)] 
cgroups: make device cgroups semantics clearer

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agobpf: enable helpers to let caller replace existing bpf programs
Christian Brauner [Thu, 18 Feb 2021 09:19:27 +0000 (10:19 +0100)] 
bpf: enable helpers to let caller replace existing bpf programs

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agobpf: align struct initialization
Christian Brauner [Thu, 18 Feb 2021 09:18:56 +0000 (10:18 +0100)] 
bpf: align struct initialization

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agobpf: use return macros
Christian Brauner [Thu, 18 Feb 2021 09:17:21 +0000 (10:17 +0100)] 
bpf: use return macros

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: introduce lxc_bpf_devices_rule_t type
Christian Brauner [Thu, 18 Feb 2021 09:15:39 +0000 (10:15 +0100)] 
conf: introduce lxc_bpf_devices_rule_t type

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agobpf: use cgroup fd directly instead of paths
Christian Brauner [Wed, 17 Feb 2021 23:51:14 +0000 (00:51 +0100)] 
bpf: use cgroup fd directly instead of paths

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: kill monitor_full_path
Christian Brauner [Wed, 17 Feb 2021 23:38:47 +0000 (00:38 +0100)] 
cgroups: kill monitor_full_path

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: free correct path
Christian Brauner [Wed, 17 Feb 2021 23:35:22 +0000 (00:35 +0100)] 
cgroups: free correct path

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoutils: fix print_r() debugging helper
Christian Brauner [Wed, 17 Feb 2021 21:54:44 +0000 (22:54 +0100)] 
utils: fix print_r() debugging helper

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: fix error values
Christian Brauner [Wed, 17 Feb 2021 21:48:40 +0000 (22:48 +0100)] 
cgroups: fix error values

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: don't overwrite type
Christian Brauner [Wed, 17 Feb 2021 17:49:20 +0000 (18:49 +0100)] 
cgroups: don't overwrite type

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: make it extremely obvious that we're transitioning from a flag to a type
Christian Brauner [Wed, 17 Feb 2021 15:59:40 +0000 (16:59 +0100)] 
cgroups: make it extremely obvious that we're transitioning from a flag to a type

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3680 from brauner/2021-02-17/cgroups_2
Stéphane Graber [Wed, 17 Feb 2021 17:30:57 +0000 (12:30 -0500)] 
Merge pull request #3680 from brauner/2021-02-17/cgroups_2

cgroups: fourth batch of cgroup fixes

4 years agocgroups: create controller directories if missing 3680/head
Christian Brauner [Wed, 17 Feb 2021 15:40:48 +0000 (16:40 +0100)] 
cgroups: create controller directories if missing

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: use non-flag based checking now that we switched all codepaths over
Christian Brauner [Wed, 17 Feb 2021 15:28:42 +0000 (16:28 +0100)] 
cgroups: use non-flag based checking now that we switched all codepaths over

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: use brackets to clarify check semantics
Christian Brauner [Wed, 17 Feb 2021 15:24:50 +0000 (16:24 +0100)] 
conf: use brackets to clarify check semantics

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: validate that only a single cgroup mount type is set
Christian Brauner [Wed, 17 Feb 2021 15:23:51 +0000 (16:23 +0100)] 
cgroups: validate that only a single cgroup mount type is set

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: prevent cgroup mount type overwrite
Christian Brauner [Wed, 17 Feb 2021 15:23:20 +0000 (16:23 +0100)] 
cgroups: prevent cgroup mount type overwrite

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: ensure that cgroup_root is initialized in legacy codepaths
Christian Brauner [Wed, 17 Feb 2021 15:29:56 +0000 (16:29 +0100)] 
cgroups: ensure that cgroup_root is initialized in legacy codepaths

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: distinguish between tmpfs and unified based cgroup layouts file descriptors
Christian Brauner [Wed, 17 Feb 2021 14:29:14 +0000 (15:29 +0100)] 
cgroups: distinguish between tmpfs and unified based cgroup layouts file descriptors

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: log intermediate cleanup
Christian Brauner [Wed, 17 Feb 2021 14:24:23 +0000 (15:24 +0100)] 
cgroups: log intermediate cleanup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3679 from brauner/2021-02-17/cgroups
Stéphane Graber [Wed, 17 Feb 2021 13:59:13 +0000 (08:59 -0500)] 
Merge pull request #3679 from brauner/2021-02-17/cgroups

cgroups: third batch of cgroup fixes

4 years agocgroups: prevent NULL pointer deref 3679/head
Christian Brauner [Wed, 17 Feb 2021 13:36:10 +0000 (14:36 +0100)] 
cgroups: prevent NULL pointer deref

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: simplify mount opening
Christian Brauner [Wed, 17 Feb 2021 09:45:35 +0000 (10:45 +0100)] 
cgroups: simplify mount opening

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: ensure we prune the limit dir
Christian Brauner [Wed, 17 Feb 2021 09:35:58 +0000 (10:35 +0100)] 
cgroups: ensure we prune the limit dir

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: ensure we don't remove cgroups we didn't create
Christian Brauner [Wed, 17 Feb 2021 09:30:30 +0000 (10:30 +0100)] 
cgroups: ensure we don't remove cgroups we didn't create

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: don't move pivot cgroup under the monitor's cgroup
Christian Brauner [Wed, 17 Feb 2021 09:08:27 +0000 (10:08 +0100)] 
cgroups: don't move pivot cgroup under the monitor's cgroup

Otherwise we will never be able to destroy the monitor's cgroup.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: don't rely on absolute path
Christian Brauner [Wed, 17 Feb 2021 09:06:29 +0000 (10:06 +0100)] 
cgroups: don't rely on absolute path

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: be stricter when creating payloads
Christian Brauner [Wed, 17 Feb 2021 09:04:58 +0000 (10:04 +0100)] 
cgroups: be stricter when creating payloads

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: rework cgroup tree creation
Christian Brauner [Wed, 17 Feb 2021 09:03:42 +0000 (10:03 +0100)] 
cgroups: rework cgroup tree creation

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: ensure leaf cgroup is correctly pruned on creation failure
Christian Brauner [Wed, 17 Feb 2021 08:28:46 +0000 (09:28 +0100)] 
cgroups: ensure leaf cgroup is correctly pruned on creation failure

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: rework cgroup tree removal on creation failure
Christian Brauner [Wed, 17 Feb 2021 08:14:33 +0000 (09:14 +0100)] 
cgroups: rework cgroup tree removal on creation failure

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: remove obsolote check
Christian Brauner [Wed, 17 Feb 2021 08:06:37 +0000 (09:06 +0100)] 
cgroups: remove obsolote check

In the new layout we don't need to do this.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: reorder function arguments
Christian Brauner [Wed, 17 Feb 2021 08:04:03 +0000 (09:04 +0100)] 
cgroups: reorder function arguments

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3678 from brauner/2021-02-17/unified_controller_delegation
Stéphane Graber [Wed, 17 Feb 2021 01:27:03 +0000 (20:27 -0500)] 
Merge pull request #3678 from brauner/2021-02-17/unified_controller_delegation

cgroups: rework unified cgroup controller delegation

4 years agostart: delegate than move into the target cgroup 3678/head
Christian Brauner [Wed, 17 Feb 2021 00:43:51 +0000 (01:43 +0100)] 
start: delegate than move into the target cgroup

This is a way more sensible model.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: rework unified controller delegation
Christian Brauner [Wed, 17 Feb 2021 00:20:00 +0000 (01:20 +0100)] 
cgroups: rework unified controller delegation

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: check correct variable
Christian Brauner [Wed, 17 Feb 2021 00:10:27 +0000 (01:10 +0100)] 
cgroups: check correct variable

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: s/openat()/open_at()/g
Christian Brauner [Wed, 17 Feb 2021 00:05:09 +0000 (01:05 +0100)] 
cgroups: s/openat()/open_at()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3677 from brauner/2021-02-17/cgroup_pruning
Stéphane Graber [Wed, 17 Feb 2021 00:16:38 +0000 (19:16 -0500)] 
Merge pull request #3677 from brauner/2021-02-17/cgroup_pruning

cgroups: fd-only cgroup tree pruning

4 years agoMerge pull request #3676 from brauner/2021-02-16/fixes
Stéphane Graber [Wed, 17 Feb 2021 00:16:23 +0000 (19:16 -0500)] 
Merge pull request #3676 from brauner/2021-02-16/fixes

cgroups: fixes

4 years agocgroups: remove obsolote cgroup_tree handling 3677/head
Christian Brauner [Tue, 16 Feb 2021 23:49:41 +0000 (00:49 +0100)] 
cgroups: remove obsolote cgroup_tree handling

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: fd-only cgroup tree pruning
Christian Brauner [Tue, 16 Feb 2021 22:05:23 +0000 (23:05 +0100)] 
cgroups: fd-only cgroup tree pruning

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agofile_utils: move dup_cloexec() to header
Christian Brauner [Tue, 16 Feb 2021 19:53:16 +0000 (20:53 +0100)] 
file_utils: move dup_cloexec() to header

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: prevent double-close 3676/head
Christian Brauner [Tue, 16 Feb 2021 22:18:45 +0000 (23:18 +0100)] 
cgroups: prevent double-close

Fixes: Coverity 1473183
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agonamespace: add missing \0 terminator
Christian Brauner [Tue, 16 Feb 2021 22:06:40 +0000 (23:06 +0100)] 
namespace: add missing \0 terminator

Link: https://launchpadlibrarian.net/523195972/buildlog_ubuntu-groovy-ppc64el.lxc_1%3A4.0.6+master~20210215-1740-0ubuntu1~groovy_BUILDING.txt.gz
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3675 from brauner/2021-02-16/fixes
Stéphane Graber [Tue, 16 Feb 2021 21:37:42 +0000 (16:37 -0500)] 
Merge pull request #3675 from brauner/2021-02-16/fixes

cgroups: second batch of cgroup fixes

4 years agocgroups: rework how hierarchies are added 3675/head
Christian Brauner [Tue, 16 Feb 2021 17:43:28 +0000 (18:43 +0100)] 
cgroups: rework how hierarchies are added

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: fix fd leaks
Christian Brauner [Tue, 16 Feb 2021 17:38:26 +0000 (18:38 +0100)] 
cgroups: fix fd leaks

They didn't really matter because we want to keep them around for as long as
the container lives anyway.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: allow "" base cgroup paths
Christian Brauner [Tue, 16 Feb 2021 16:56:31 +0000 (17:56 +0100)] 
cgroups: allow "" base cgroup paths

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agostring_utils: handle empty strings in must_make_path()
Christian Brauner [Tue, 16 Feb 2021 16:51:57 +0000 (17:51 +0100)] 
string_utils: handle empty strings in must_make_path()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: improve logging
Christian Brauner [Tue, 16 Feb 2021 16:47:27 +0000 (17:47 +0100)] 
cgroups: improve logging

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: rework legacy cpuset handling
Christian Brauner [Tue, 16 Feb 2021 16:08:15 +0000 (17:08 +0100)] 
cgroups: rework legacy cpuset handling

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: fd-based only cgroup creation
Christian Brauner [Tue, 16 Feb 2021 14:32:16 +0000 (15:32 +0100)] 
cgroups: fd-based only cgroup creation

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: stash fds for the controller mountpoint and base cgroup path
Christian Brauner [Tue, 16 Feb 2021 12:36:13 +0000 (13:36 +0100)] 
cgroups: stash fds for the controller mountpoint and base cgroup path

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: fail when no cgroup hierarchies are found
Christian Brauner [Tue, 16 Feb 2021 12:28:48 +0000 (13:28 +0100)] 
cgroups: fail when no cgroup hierarchies are found

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: rework base cgroup parsing
Christian Brauner [Tue, 16 Feb 2021 12:25:26 +0000 (13:25 +0100)] 
cgroups: rework base cgroup parsing

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: rework add_hierarchy()
Christian Brauner [Tue, 16 Feb 2021 10:46:36 +0000 (11:46 +0100)] 
cgroups: rework add_hierarchy()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: better document stashed file descriptors
Christian Brauner [Tue, 16 Feb 2021 10:35:43 +0000 (11:35 +0100)] 
cgroups: better document stashed file descriptors

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: stash host's cgroupfs file descriptor
Christian Brauner [Tue, 16 Feb 2021 10:22:56 +0000 (11:22 +0100)] 
cgroups: stash host's cgroupfs file descriptor

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: s/cg_init()/__cgroup_init()/g
Christian Brauner [Tue, 16 Feb 2021 09:55:38 +0000 (10:55 +0100)] 
cgroups: s/cg_init()/__cgroup_init()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3674 from brauner/2021-02-15/nesting
Stéphane Graber [Mon, 15 Feb 2021 17:56:52 +0000 (12:56 -0500)] 
Merge pull request #3674 from brauner/2021-02-15/nesting

cgroups: tighten cgroup config items

4 years agoconfile: forbid absolute paths in config items that modify the cgroup layout 3674/head
Christian Brauner [Mon, 15 Feb 2021 16:02:55 +0000 (17:02 +0100)] 
confile: forbid absolute paths in config items that modify the cgroup layout

This is not a safety measure but merely is supposed to raise awareness that
these paths are always relative to the cgroup root as determined by
lxc.cgroup.relative.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconfile: forbid walking upwards for confile items that modify cgroup layout
Christian Brauner [Mon, 15 Feb 2021 15:49:09 +0000 (16:49 +0100)] 
confile: forbid walking upwards for confile items that modify cgroup layout

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconfile_utils: normalize paths in config items
Christian Brauner [Mon, 15 Feb 2021 16:53:58 +0000 (17:53 +0100)] 
confile_utils: normalize paths in config items

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconfile: use set_config_path_item() for most cgroup layout modifiers
Christian Brauner [Mon, 15 Feb 2021 15:36:39 +0000 (16:36 +0100)] 
confile: use set_config_path_item() for most cgroup layout modifiers

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3673 from brauner/2021-02-15/nesting
Stéphane Graber [Mon, 15 Feb 2021 17:08:01 +0000 (12:08 -0500)] 
Merge pull request #3673 from brauner/2021-02-15/nesting

cgroups: first batch of cgroup mounting fixes

4 years agocgroupfs: rework cgroup2 mounting 3673/head
Christian Brauner [Mon, 15 Feb 2021 14:07:02 +0000 (15:07 +0100)] 
cgroupfs: rework cgroup2 mounting

We now explicitly refuse to mount cgroups on pure unified layouts when the
container is not running in a separate cgroup namespace. This is not a
regression since we simply always failed before anyway. I will likely fix this
very soon though. But there are bigger fish to fry currently.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: log early return
Christian Brauner [Mon, 15 Feb 2021 12:58:10 +0000 (13:58 +0100)] 
cgroups: log early return

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: s/__cg_mount_direct()/__cgroupfs_mount()/g
Christian Brauner [Mon, 15 Feb 2021 12:54:51 +0000 (13:54 +0100)] 
cgroups: s/__cg_mount_direct()/__cgroupfs_mount()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: strip LXC_AUTO_CGROUP_MIXED and LXC_AUTO_CGROUP_FULL_MIXED when cgroup names...
Christian Brauner [Mon, 15 Feb 2021 12:54:10 +0000 (13:54 +0100)] 
cgroups: strip LXC_AUTO_CGROUP_MIXED and LXC_AUTO_CGROUP_FULL_MIXED when cgroup namespaces are supported and used

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: fix flag checking in legacy mount paths
Christian Brauner [Mon, 15 Feb 2021 12:45:45 +0000 (13:45 +0100)] 
cgroups: fix flag checking in legacy mount paths

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: s/cg_mount_cgroup_full()/cgroupfs_bind_mount()/g
Christian Brauner [Mon, 15 Feb 2021 12:44:24 +0000 (13:44 +0100)] 
cgroups: s/cg_mount_cgroup_full()/cgroupfs_bind_mount()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: s/cg_mount_in_cgroup_namespace()/cgroupfs_mount()/g
Christian Brauner [Mon, 15 Feb 2021 12:42:40 +0000 (13:42 +0100)] 
cgroups: s/cg_mount_in_cgroup_namespace()/cgroupfs_mount()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: remove wrong comment
Christian Brauner [Mon, 15 Feb 2021 12:41:02 +0000 (13:41 +0100)] 
conf: remove wrong comment

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: switch to flag-based checking
Christian Brauner [Mon, 15 Feb 2021 12:36:49 +0000 (13:36 +0100)] 
cgroups: switch to flag-based checking

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: don't strip LXC_AUTO_CGROUP_FORCE
Christian Brauner [Mon, 15 Feb 2021 12:25:00 +0000 (13:25 +0100)] 
cgroups: don't strip LXC_AUTO_CGROUP_FORCE

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: make clear that a flag argument is passed to cgroup mount functions
Christian Brauner [Mon, 15 Feb 2021 12:23:51 +0000 (13:23 +0100)] 
cgroups: make clear that a flag argument is passed to cgroup mount functions

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoutils: add development helper to quickly dump a directories contents
Christian Brauner [Mon, 15 Feb 2021 11:29:47 +0000 (12:29 +0100)] 
utils: add development helper to quickly dump a directories contents

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: improve cgroup mounting
Christian Brauner [Mon, 15 Feb 2021 11:23:36 +0000 (12:23 +0100)] 
cgroups: improve cgroup mounting

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: verify that we are actually running in cgroup namespace
Christian Brauner [Mon, 15 Feb 2021 11:05:20 +0000 (12:05 +0100)] 
cgroups: verify that we are actually running in cgroup namespace

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: pass handler to cgroup mount() method
Christian Brauner [Mon, 15 Feb 2021 10:57:31 +0000 (11:57 +0100)] 
cgroups: pass handler to cgroup mount() method

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: don't pass conf separately to lxc_mount_auto_mounts()
Christian Brauner [Mon, 15 Feb 2021 10:55:33 +0000 (11:55 +0100)] 
conf: don't pass conf separately to lxc_mount_auto_mounts()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: move cgns_supported() to cgroup utilities
Christian Brauner [Mon, 15 Feb 2021 10:47:53 +0000 (11:47 +0100)] 
cgroups: move cgns_supported() to cgroup utilities

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3672 from brauner/2021-02-14/fixes
Stéphane Graber [Sun, 14 Feb 2021 20:38:58 +0000 (15:38 -0500)] 
Merge pull request #3672 from brauner/2021-02-14/fixes

start: small fixes

4 years agostart: fix comment about time namespace preservation 3672/head
Christian Brauner [Sun, 14 Feb 2021 19:45:22 +0000 (20:45 +0100)] 
start: fix comment about time namespace preservation

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agostart: improve comment in lxc_spawn()
Christian Brauner [Sun, 14 Feb 2021 19:44:57 +0000 (20:44 +0100)] 
start: improve comment in lxc_spawn()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agostart: improve comments
Christian Brauner [Sun, 14 Feb 2021 19:44:18 +0000 (20:44 +0100)] 
start: improve comments

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agostart: improve namespace preservation
Christian Brauner [Sun, 14 Feb 2021 19:41:50 +0000 (20:41 +0100)] 
start: improve namespace preservation

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agostart: fix error handling and improve comment
Christian Brauner [Sun, 14 Feb 2021 19:36:25 +0000 (20:36 +0100)] 
start: fix error handling and improve comment

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3671 from brauner/2021-02-14/namespace_hooks
Stéphane Graber [Sun, 14 Feb 2021 15:55:54 +0000 (10:55 -0500)] 
Merge pull request #3671 from brauner/2021-02-14/namespace_hooks

hooks: rework exposing namespace information

4 years agonetwork: expose namespace fd paths to network hooks 3671/head
Christian Brauner [Sun, 14 Feb 2021 13:07:44 +0000 (14:07 +0100)] 
network: expose namespace fd paths to network hooks

Closes: #3667
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agostart: rework namespace preservation and path creation for hooks
Christian Brauner [Sun, 14 Feb 2021 13:03:07 +0000 (14:03 +0100)] 
start: rework namespace preservation and path creation for hooks

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3670 from brauner/2021-02-13/fixes
Stéphane Graber [Sun, 14 Feb 2021 00:02:22 +0000 (19:02 -0500)] 
Merge pull request #3670 from brauner/2021-02-13/fixes

tree-wide: convert to strequal() and strnequal()