After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 773224 - enumerator: Ensure client subsystems are implicitly matched
enumerator: Ensure client subsystems are implicitly matched
Status: RESOLVED FIXED
Product: libgudev
Classification: Other
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: libgudev Maintainers
libgudev Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-10-19 14:05 UTC by Ray Strode [halfline]
Modified: 2016-11-02 17:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
enumerator: Ensure client subsystems are implicitly matched (6.67 KB, patch)
2016-10-19 14:05 UTC, Ray Strode [halfline]
committed Details | Review
tests: Add test suite (7.72 KB, patch)
2016-11-02 17:34 UTC, Bastien Nocera
committed Details | Review
tests: Preload umockdev before running tests (912 bytes, patch)
2016-11-02 17:34 UTC, Bastien Nocera
committed Details | Review

Description Ray Strode [halfline] 2016-10-19 14:05:49 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.
Comment 1 Ray Strode [halfline] 2016-10-19 14:05:52 UTC
Created attachment 338034 [details] [review]
enumerator: Ensure client subsystems are implicitly matched
Comment 2 Ray Strode [halfline] 2016-10-19 14:06:46 UTC
I think this is probably fine, but I haven't tried it yet.  Will test it after I finish up bug 771442
Comment 3 Ray Strode [halfline] 2016-10-20 19:55:37 UTC
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.
Comment 4 Bastien Nocera 2016-11-02 17:34:01 UTC
Created attachment 338975 [details] [review]
tests: Add test suite

With the first test for a GUdevEnumerator bug.
Comment 5 Bastien Nocera 2016-11-02 17:34:06 UTC
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.
Comment 6 Bastien Nocera 2016-11-02 17:37:01 UTC
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