Unix-char device hotplugging does not work on Ubuntu 22.04 if source device is a symlink

I have a setup where I forward a joystick input device to a container as unix-char. The device is defined as follows in the container configuration:

  mode: "0666"
  path: /dev/input/js0
  required: "false"
  source: /dev/jsWirelessController
  type: unix-char

The source device file is a symlink created by a udev rule on the host:

ACTION=="add", ENV{ID_BUS}=="bluetooth", ENV{DEVNAME}=="/dev/input/js[0-9]*", SYMLINK="jsWirelessController"

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.

How can I debug this further?

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?