-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
lxcfs: per instance configuration #638
base: main
Are you sure you want to change the base?
Conversation
5fb27e4
to
791cd14
Compare
ab6ec5e
to
7d47c99
Compare
e2b98ef
to
78f2fd3
Compare
I did a first pass on this, basically looking at the various commits and what's being modified. For now, a few things I think that should be done:
|
Let's reduce code duplication by using macro for this. Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Let's allocate pidns_hash_table memory dynamically and hold pointers to it from a new lxcfs_data structure. Previously, pidns_hash_table was a statically allocated in liblxcfs, which means that it won't survive across liblxcfs reloads. Let's introduce a versionized lxcfs_data structure to keep persistent data that should survive reloads. Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
It's necessary as we want to be able to easily extend it and use live reloads update mechanism. This change does not break compatibility, because struct pidns_store lifetime is limited to liblxcfs lifetime. But we'll make pidns_store lifetime bigger that's why we need to start versionizing it. Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Let's add keep_on_reload field to struct pidns_store. The idea behind it is that if this flag is set to true, then pidns_store entry won't be considered as a cache item which can be dropped. But instead, it will be kept across liblxcfs reloads and droped only if a pid namespace it refers die. Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
…pear Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
This bitmask can be used to represent a per-instance (technically, per pid namespace) features configuration (toggle-like). Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Like we have "cgroup", "sys", "proc" subtrees, let's introduce the "lxcfs" subtree which will contain LXCFS filesystem-related data and will be used as an interface to interact and configure LXCFS in runtime. Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
78f2fd3
to
b4a17e3
Compare
Looks like some good stuff. Will take some time to review, though. Would be cool if there was an easy way on github to say "patch 1/N is approved and separate, merge it". Perhaps conceptually the thing to do here (I'm not asking you to change it, just thinking...) would be to create a github project, have an issue for each independent change in this pr, and a pr for each issue. I say this because if you just made this N PRs, i'd possibly be less likely to look at the earlier ones. Anyway, thanks, I intend to take a close look. |
This adds ability to set per-container configuration parameters (boolean).
This can be very useful in some workloads if system administrator (or container administrator) want's to have some specific LXCFS configuration in some instances, while having defaults on the other ones.
Change is forward compatible and LXCFS can be updated with live reload. Nothing will crash. Obviously, to make new configuration sub-tree accessible full daemon reload is required.