Thunderbolt: better handle chain authorization of devices
Thunderbolt devices have to be authorized in a specific order: parents need to be authorized before their children. We do this correctly in the bolt daemon and also in the gnome-shell we take care of this. But if, for whatever reason, you end up with a list of devices that are not authorized in the control-center panel and you want want to authorize a specific device but the parent is not authorized we currently will just report an error. I got an bug report per email about it:
So basically we do something like:
- Forget all devices (BTW, it would be useful to have such command)
- Plug in chain of 6 devices
- Observe from the TBT setting panel and authorize them as needed
Sometimes there are failures but then if I check the sysfs the device is not authorized.
I'm thinking is bolt/GNOME missing the fact that you need to authorize devices in strict topological order? In other words the parent device needs to be authorized before the child.
I am not entirely sure how to deal with it, especially UI wise? An info-bar with a message? I dialog with the parents and ask if you wan to authorize them too? Maybe we could show the devices in a listbox in the device dialog above the buttons, and have text/icon indicate that they are not authorize and will be if the current one is authorized? @jimmac please help! :D