-
Notifications
You must be signed in to change notification settings - Fork 60
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
remove_device does not trigger "remove" uevent #237
Comments
You are right, it should trigger a remove uevent, for symmetry and also to better model what happens on a real system. I suppose nobody complained so far as that's a lot less common than adding 😁 I'll try to work on this over the weekend, but if you want to give it a try, please do! |
I might be able to look at it next week, I think the difficulty will be in generating uevents for the children but I need to understand the code better to understand how to do that. |
Just to state what I see as the difficulties here (I might be wrong on some of this):
Therefore, I have a design proposal: @martinpitt: Does this sound like a good approach? |
Not quite I think: Some directories in /sys are devices, and some are just "organizational groupings". For example, /sys/block/ is not a device, but /sys/block/loop0 is. I think a good indicator of this is the presence/absence of an
Apparently so, yes. I tested this with The existing |
Great! I will try to come up with a branch that implements this using the |
Actually I was able to get some time to work on this today (#238). I am not familiar with .vala so please excuse any non-valaic ways of doing things. The following does seem to work though (under the minimal testing I ran). |
This was fixed in #238 |
First of all... this package is awesome for testing!
I would like to request an enhancement though...
While
add_device()
triggers an "add" uevent. Currentlyremove_device()
doesn't trigger a "remove" uevent. I find that I have to first calltestbed.uevent(syspath, "remove")
then calltestbed.remove_device(syspath)
. This doesn't feel quite right to me since I don't have to do that when I'm adding a device.In addition, the comment for
remove_device()
says "Note that this will also remove all child devices". So it would be really nice if a "remove" uevent was generated for the children as well when a device is removed. (Similar to what happens on hardware.)Again, I appreciate your work here. Thank you.
The text was updated successfully, but these errors were encountered: