GNOME Bugzilla – Bug 773224
enumerator: Ensure client subsystems are implicitly matched
Last modified: 2016-11-02 17:37:14 UTC
g_udev_client_new takes an optional list of subsystems (and device types) to filter the udev event stream on. These subsystems aren't automatically matched for device enumeration, though, which is unexpected. This commit changes gudevenumerator to get its udev_enumerate object from gudevclient with the appropriate subsystem and device matches already set up.
Created attachment 338034 [details] [review] enumerator: Ensure client subsystems are implicitly matched
I think this is probably fine, but I haven't tried it yet. Will test it after I finish up bug 771442
just to follow up, this seems to work okay. If I remove the explicit add_match_subsystem call from bug 771442 (and the related patches that shore up matching logic), and install libgudev with this patch, I get the correct number of connectors. If I take this patch out, then I get extra connectors.
Created attachment 338975 [details] [review] tests: Add test suite With the first test for a GUdevEnumerator bug.
Created attachment 338976 [details] [review] tests: Preload umockdev before running tests Otherwise it's as if we were outside the test environment, which we don't want to be.
Attachment 338034 [details] pushed as 7cf0fde - enumerator: Ensure client subsystems are implicitly matched Attachment 338975 [details] pushed as 0a942cc - tests: Add test suite Attachment 338976 [details] pushed as 177ea07 - tests: Preload umockdev before running tests