The kernel version is 5.15.0-46-lowlatency and the container runs Ubuntu 20.04.
In case of an Ubuntu 20.04 host hotplugging works as expected, but on a 22.04 host the device only shows up in the container when it already has been present on container start.
However, if I replace the symlink in the source setting with the actual device file /dev/input/jsX on the host, hotplugging also works correctly with the Ubuntu 22.04 host. This is not a solution in my case since I need the udev rule to disambiguate between multiple different devices.
Both the 22.04 and 20.04 machine run exactly the same kernel version, lxd configurations and lxd versions. I have tried various lxd 5.x versions with the same result.
This is where the event handler for the hotplug events is defined for the unix devices:
I wonder if the e.Path variable from the event is the DEVNAME rather than the symlink target, which would explain why it doesn’t match, or perhaps there is no event being delivered for the symlink somehow.
The actual hotplug events are generated using fsnotify or fanotify watchers on /dev.
@monstermunchkin are you aware of any limitations around watching for symlinks in this implementation?