* [Qemu-devel] [PATCH for-2.1 1/2] module: Simplify module_load()
2014-07-15 14:04 [Qemu-devel] [PATCH for-2.1 0/2] Module cleanups Andreas Färber
@ 2014-07-15 14:04 ` Andreas Färber
2014-07-15 14:04 ` [Qemu-devel] [PATCH for-2.1 2/2] module: Don't complain when a module is absent Andreas Färber
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Andreas Färber @ 2014-07-15 14:04 UTC (permalink / raw)
To: qemu-devel
Cc: peter.maydell, famz, mjt, brogers, pbonzini, Andreas Färber
The file path is not used for error reporting, so we can free it
directly after use.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
util/module.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/util/module.c b/util/module.c
index 214effb..9fd3030 100644
--- a/util/module.c
+++ b/util/module.c
@@ -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++) {
--
1.8.4.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH for-2.1 2/2] module: Don't complain when a module is absent
2014-07-15 14:04 [Qemu-devel] [PATCH for-2.1 0/2] Module cleanups Andreas Färber
2014-07-15 14:04 ` [Qemu-devel] [PATCH for-2.1 1/2] module: Simplify module_load() Andreas Färber
@ 2014-07-15 14:04 ` Andreas Färber
2014-07-15 15:39 ` [Qemu-devel] [PATCH for-2.1 0/2] Module cleanups Fam Zheng
2014-07-15 17:57 ` Peter Maydell
3 siblings, 0 replies; 6+ messages in thread
From: Andreas Färber @ 2014-07-15 14:04 UTC (permalink / raw)
To: qemu-devel
Cc: peter.maydell, famz, mjt, brogers, pbonzini, Andreas Färber
The 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.
Cc: Fam Zheng <famz@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
util/module.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/util/module.c b/util/module.c
index 9fd3030..4bd4a94 100644
--- a/util/module.c
+++ b/util/module.c
@@ -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++) {
--
1.8.4.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.1 0/2] Module cleanups
2014-07-15 14:04 [Qemu-devel] [PATCH for-2.1 0/2] Module cleanups Andreas Färber
2014-07-15 14:04 ` [Qemu-devel] [PATCH for-2.1 1/2] module: Simplify module_load() Andreas Färber
2014-07-15 14:04 ` [Qemu-devel] [PATCH for-2.1 2/2] module: Don't complain when a module is absent Andreas Färber
@ 2014-07-15 15:39 ` Fam Zheng
2014-07-15 15:45 ` Paolo Bonzini
2014-07-15 17:57 ` Peter Maydell
3 siblings, 1 reply; 6+ messages in thread
From: Fam Zheng @ 2014-07-15 15:39 UTC (permalink / raw)
To: Andreas Färber; +Cc: peter.maydell, pbonzini, mjt, qemu-devel, brogers
On Tue, 07/15 16:04, Andreas Färber wrote:
> 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(-)
Both patches look good to me.
Reviewed-by: Fam Zheng <famz@redhat.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.1 0/2] Module cleanups
2014-07-15 15:39 ` [Qemu-devel] [PATCH for-2.1 0/2] Module cleanups Fam Zheng
@ 2014-07-15 15:45 ` Paolo Bonzini
0 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2014-07-15 15:45 UTC (permalink / raw)
To: Fam Zheng, Andreas Färber; +Cc: peter.maydell, mjt, qemu-devel, brogers
Il 15/07/2014 17:39, Fam Zheng ha scritto:
> On Tue, 07/15 16:04, Andreas Färber wrote:
>> 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(-)
>
> Both patches look good to me.
>
> Reviewed-by: Fam Zheng <famz@redhat.com>
>
Thanks, queued for -rc3.
Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.1 0/2] Module cleanups
2014-07-15 14:04 [Qemu-devel] [PATCH for-2.1 0/2] Module cleanups Andreas Färber
` (2 preceding siblings ...)
2014-07-15 15:39 ` [Qemu-devel] [PATCH for-2.1 0/2] Module cleanups Fam Zheng
@ 2014-07-15 17:57 ` Peter Maydell
3 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2014-07-15 17:57 UTC (permalink / raw)
To: Andreas Färber
Cc: Michael Tokarev, Paolo Bonzini, Fam Zheng, QEMU Developers,
Bruce Rogers
On 15 July 2014 15:04, Andreas Färber <afaerber@suse.de> wrote:
> 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(-)
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
^ permalink raw reply [flat|nested] 6+ messages in thread