Fix lxd
, so that it works with lxcfs
#89540
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for this change
Currently, because of two separate bugs,
lxd
doesn't detectlxcfs
at all.It means that when you set a limit (e.g.
lxc config set test limits.cpu 1
), it does get enforced, but the container still sees all the resources from the host machine (e.g. if you runlxc exec test htop
, you'll see all the cores).It's a minor thing, but a bit annoying one - especially since many applications adjust their behavior to stuff from
/proc
, expecting it to reflect the actual state of affairs.Seizing the day, I've also changed
lxd
to properly supportnftables
- thanks to this, it doesn't unnecessarily depend oniptables
whenconfig.networking.nftables.enable
is enabled.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)