]> git.ipfire.org Git - thirdparty/lxc.git/commit
use 2 sysfs instances for sys:mixed
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 3 Dec 2021 08:13:11 +0000 (09:13 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 6 Dec 2021 10:24:02 +0000 (11:24 +0100)
commit23d07c315715ebee17424bd47215fed41d6d9761
tree0b7695b9de87c5a20042094b156f98cb1a56c1b5
parent0dd3258bddc1eb55fe2d4f4bbe8bf629cdff87eb
use 2 sysfs instances for sys:mixed

In order to facilitate this, the default mount list's
'destination' may now be NULL to mean that the source should
be unmounted instead.

Here's what we need to do:

1) Ensure the first sysfs mount point is writable.
2) Mount a read-only sysfs on /sys
3) Bind devices/virtual/net *writably* into /sys

We use /proc/sys as a staging directory for the first sysfs
mount in read-write mode, then mount /sys r/o. Afterwards we
bind the r/w devices/virtual/net and unmount the staging
/proc/sys mount point.

The staging directory would not be required with the new
mount API, but this way we can support the old API and keep
the general workflow in the `default_mounts`.

Once we drop support for the old mount API, the
default_mounts table could just get a subdirectory field to
mount subdirectories directly.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/lxc/conf.c