[lxc/lxc] 23d07c: use 2 sysfs instances for sys:mixed

0 views
Skip to first unread message

Wolfgang Bumiller

unread,
Dec 6, 2021, 5:24:24 AM12/6/21
to lxc-...@lists.linuxcontainers.org
Branch: refs/heads/stable-4.0
Home: https://github.com/lxc/lxc
Commit: 23d07c315715ebee17424bd47215fed41d6d9761
https://github.com/lxc/lxc/commit/23d07c315715ebee17424bd47215fed41d6d9761
Author: Wolfgang Bumiller <w.bum...@proxmox.com>
Date: 2021-12-06 (Mon, 06 Dec 2021)

Changed paths:
M src/lxc/conf.c

Log Message:
-----------
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.bum...@proxmox.com>


Reply all
Reply to author
Forward
0 new messages