Dynamic major/minor numbers in cgroup policy

Hello,

when changing cgroup policy with lxc.cgroup.devices.allow in the config file, is it possible to specify major/minor numbers dynamically with bash? Something like this:

lxc.cgroup.devices.allow = c 241:"get_minor_number /dev/mydev" rwm

No. LXC is pretty bare bone for that kind of stuff.
LXD supports pretty much what you’re saying here by letting you pass the host path which it will then look at and mimic.

The good thing is that except for block devices, the major/minor is usually pretty stable.