-
Notifications
You must be signed in to change notification settings - Fork 59
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
Fully remove USB children when the parent USB device is removed #238
Fully remove USB children when the parent USB device is removed #238
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This also needs some unit tests, to make sure that the remove events happen, and in the expected order.
Please let me know if/when it starts to overwhelm you, then I can take over.
@martinpitt: Do these code changes look better? |
@bobhenz-jabil sorry for the late response, it's holiday season here. The changes look good, thanks! They still need to grow some unit tests. If you want to add them, please do, otherwise I'll work on them. But first I need to unbreak the build on Fedora, the new gcc broke vala/glib hard. I've already spent several hours on a "proper" solution, but I suppose I'll go with a quick hack for now. |
I just fixed the last remaining build issue (#239), and took the liberty to rebase your branch, so that the tests can run again. Note that this is still blocked by adding unit tests for the remove event and child removal. |
@martinpitt : My apologies for the lengthy delay. I have finally gotten around to adding the following commits to this PR:
I have also rebased on the latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've been meaning to add tests, but there's always something more urgent coming in between, I'm sorry!
This is now not far from landing any more, just needs some cleanups. Please also squash the unit test commits into the corresponding feature commits. I also suggest to move the "Test that add_device automatically creates an "add" uevent" commit first, as that already works on current main.
I'm happy to do that myself too if you don't have time or are fed up with this 😉
@bobhenz-jabil please ignore the debian-testing failures. It's a meson regression: mesonbuild/meson#13461 |
To mirror the behavior of add_device (which generates an "add" uevent when a device is added), now generate a "remove" uevent when a device is removed.
Although the directory structure for children was being removed when the parent device was removed, `remove_device()` was not actually being called on for the children. This meant that (for example) uevents were not being generated for children when the parent was removed which is different behavior than on actual hardware.
@martinpitt : Fixed-up the PR per your suggestions (I believe). Let me know if I missed anything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, many thanks! 🌟
Suggested fix for #237