GNOME Bugzilla – Bug 740651
[review] dcbw/modprobe-bgo740651: don't use system() to load bonding module and modprobe consolidation
Last modified: 2015-02-25 14:09:02 UTC
Created attachment 291412 [details] [review] 0001-platform-don-t-use-system-to-load-bonding-module.patch Fixes a compiler warning for unused assignment that we were trying and failing to previously shut up. But beyond that, system() kinda sucks for this stuff, so just use nm_utils_find_helper() instead.
Patch looks fine. There's also: src/ppp-manager/nm-ppp-manager.c 1106: ignored = system ("/sbin/modprobe ppp_generic"); and there are probably other places where we're currently depending on initscripts having loaded modules for us (bridging? ipoib?) that we may want to fix later. So maybe we should just have nm_utils_modprobe()?
LGTM I think nm_utils_modprobe() is too special. Instead I'd rather add a nm_utils_spawn_sync() which wrapps g_spawn_sync() but does all the stuff we want.
Created attachment 294147 [details] [review] utils: add nm_utils_modprobe()
Created attachment 294148 [details] [review] core: use nm_utils_modprobe()
The original patch does not unblock the signals. I think this is complicated enough, to justify a nm_utils_modprobe() function.
Comment on attachment 294147 [details] [review] utils: add nm_utils_modprobe() >+ /* construct the argument list */ If you just used a GPtrArray you could simplify the code by only having to loop once
The patches basically look good. Although it doesn't really actually matter if the signals get reset, since modprobe just runs and then exits immediately anyway.
I dropped my patch, and reworked Thomas' first patch for the comments about looping twice with varargs. Pushed as dcbw/modprobe-bgo740651, please review!
(In reply to comment #8) > I dropped my patch, and reworked Thomas' first patch for the comments about > looping twice with varargs. > > Pushed as dcbw/modprobe-bgo740651, please review! I cannot find the branch.
Sorry, now pushed.
lgtm
looks good from here too
Pushed to git master: 4ad6099b016317563c14648ca6f04fb9e320d032 32625f604bbc45659f16d721e92fb6add9fb1502