Module cleanups
cover Module cleanups
Hello,
This mini-series resolves an error message emitted when a module is absent. It was prompted by a downstream user bug report about the new message.
Proposing this for rc2 as Peter would like to keep the rc3 delta low.
Regards,
Andreas
Andreas Färber (2):
module: Simplify module_load()
module: Don't complain when a module is absent
util/module.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
Signature · 1 line
1.8.4.5
PATCH 1/2 module: Simplify module_load()
The file path is not used for error reporting, so we can free it directly after use.
--- util/module.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
util/module.c +2 -4
@@ -202,18 +202,16 @@ static void module_load(module_init_type type)for (i =0 ; i <ARRAY_SIZE (dirs); i++) { fname =g_strdup_printf ("%s/%s%s" , dirs[i], *mp,HOST_DSOSUF ); ret =module_load_file (fname); +g_free (fname); + fname =NULL ;/* Try loading until loaded a module file */ if (!ret) {break ; } -g_free (fname); - fname =NULL ; }if (ret == -ENOENT ) {fprintf (stderr,"Can't find module: %s\n" , *mp); } - -g_free (fname); }for (i =0 ; i <ARRAY_SIZE (dirs); i++) {
Signature · 1 line
1.8.4.5
PATCH 2/2 module: Don't complain when a module is absent
In reply to Andreas FärberThe current implementation depends on a configure-time generated list of block modules. When any of them is absent, module_load() emits a warning.
This is suboptimal because extracting code to modules was mainly done to allow separate packaging of modules with intrusive dependencies. Absence of optional packages then leads to absence of modules and an error message, which users may recognize as new and report as error.
--- util/module.c | 3 --- 1 file changed, 3 deletions(-)
util/module.c +0 -3
@@ -209,9 +209,6 @@ static void module_load(module_init_type type)break ; } } -if (ret == -ENOENT ) { -fprintf (stderr,"Can't find module: %s\n" , *mp); - } }for (i =0 ; i <ARRAY_SIZE (dirs); i++) {
Signature · 1 line
1.8.4.5
Quoted 10 lines · Andreas Färber
Hello,
This mini-series resolves an error message emitted when a module is absent. It was prompted by a downstream user bug report about the new message.
Proposing this for rc2 as Peter would like to keep the rc3 delta low.
Regards,
Andreas
Quoted 6 lines
Andreas Färber (2):
module: Simplifymodule_load()
module: Don't complain when a module is absentutil/module.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
Both patches look good to me.
Il 15/07/2014 17:39, Fam Zheng ha scritto:
Quoted 15 lines · Andreas Färber
Quoted 14 lines
Hello,
This mini-series resolves an error message emitted when a module is absent. It was prompted by a downstream user bug report about the new message.
Proposing this for rc2 as Peter would like to keep the rc3 delta low.
Regards,
AndreasAndreas Färber (2):
module: Simplifymodule_load()
module: Don't complain when a module is absent
Quoted 7 lines
Quoted 2 lines
util/module.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)Both patches look good to me.
Reviewed-by Fam Zheng <[email protected]>
Thanks, queued for -rc3.
Paolo
Quoted 8 lines · Andreas Färber
This mini-series resolves an error message emitted when a module is absent. It was prompted by a downstream user bug report about the new message.
Proposing this for rc2 as Peter would like to keep the rc3 delta low.
Regards,
Andreas
Quoted 6 lines
Andreas Färber (2):
module: Simplifymodule_load()
module: Don't complain when a module is absentutil/module.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
I hadn't realized the changes were this minor; it's missed the rc2 boat but 9 lines of change are no problem for rc3.
thanks
-- PMM