-
-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
incusd/forknet: Handle wifi detach #395
Conversation
Closes lxc#385 Signed-off-by: Stéphane Graber <[email protected]>
@mcondarelli this adds similar logic for detach as is used for attach. So the wifi device name will be restored in the container before the phy is moved back, dragging the interface with it. I'm also adding a check for whether the device even exists in the container's namespace. |
@stgraber I don't know if change already found its way in
At Container shutdown
I will retry tomorrow. |
Yeah, the log message has changed, it now tells you that the device can't be restored due to the renaming done by OpenWRT. |
@stgraber Sorry, I don't understand. I understood naming "as OpenWrt wants" (i.e.: message says: "container interface "phy0-ap0" couldn't be found", but interface is there. WAIT! Container interface name includes quotes? In any case there's another glitch: Apparently Container cannot access some of the Interface settings, I hit that wall with "reg" settings:
Now I have a meeting with my dentist, I'll be back later... |
Hmm, that makes me wonder if OpenWRT does anything funny on shutdown. Can you try |
It indeed seems OpenWrt does some "late renaming". Using The following excerpt is right after
I am asking advice to OpenWrt experts. Note: what is |
Nah, those warnings are basically normal on modern cgroup2 systems as cgroup2 just isn't quite at parity with cgroup1 on a few things. |
Anyways using a container with USB |
With the recent change I made, things seems to be working as expected here. The main issue is OpenWRT renaming interfaces on startup and shut down which prevents proper interface restoration. I don't know if there's some way to disable that behavior and then pass interfaces with the expected name right from the start, avoiding all those complications. |
I am not deep enough in the matter to make meaningful suggestions but I see some "rough edges" and I don't really understand where they come from.
My current plan is:
This should eradicate the problem at the expense of forfeiting OpenWrt AP handling. Other possibility is to go the VM way (which is also acceptable now I solved the |
For things not working with permission errors and the like, those would be potential kernel bugs. All Incus does is move the interface and phy over to the container and do the reverse on shutdown, anything that happens between those two, Incus has no control over. It's not too unusual to see those kind of issues, especially in areas that are not very commonly used in containers. The kernel developers may have put in capability checks that are not container aware, leading to such failures. Occasionally it's also done on purpose, if the feature would for example allow altering the device firmware or cause large amounts of memory/cpu to be used on the system. Basically anything that we wouldn't expect a normal user to be able to do is likely to be blocked by the kernel, at least until someone has a good hard look at it. |
About what was said on OpenWRT IRC, I'm aware of the fact that a phy can have many interfaces on top of it, but LXC and Incus don't have support for wireless phy as the main object that users interact with. Instead they rely on passing in network interface names, which would usually be one of the interfaces on the phy. In any case, the problem still remains, we need to be able to restore both the phy and all attaches interfaces to the host system. The tools that are used for that unfortunately all rely on interface names. If those names have changed, then there's nothing we can really do other than fail and let the user pick up the pieces :( |
Understood (actually: it's way over my head to be really able to really understand it, but I surely accept your word on it ;) ). Can you confirm I won't have this kind of problems with a VM? That should be really able to hand over a USB device to VM's kernel for full handling, right? |
Yeah, the VM case won't have this problem as it gets its own kernel with full permissions and just sees the adapter as a regular USB device. |
Closes #385