* [PATCH 1/1] modules: load modules from /var/run/qemu/<version> directory firstly
@ 2023-01-23 18:48 Siddhi Katage
2023-01-24 7:55 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 5+ messages in thread
From: Siddhi Katage @ 2023-01-23 18:48 UTC (permalink / raw)
To: qemu-devel
Cc: joe.jin, dongli.zhang, siddhi.katage, christian.ehrhardt,
berrange, pbonzini
From: Siddhi Katage <siddhi.katage@oracle.com>
An old running QEMU will try to load modules with new build-id first,this
will fail as expected ,then QEMU will fallback to load the old modules that
matches its build-id from /var/run/qemu/<version> directory .
Make /var/run/qemu/<version> directory as first search path to load modules.
Fixes: bd83c861c0 ("modules: load modules from versioned /var/run dir")
Signed-off-by: Siddhi Katage <siddhi.katage@oracle.com>
---
util/module.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/util/module.c b/util/module.c
index 620412e..c4f6c57 100644
--- a/util/module.c
+++ b/util/module.c
@@ -194,6 +194,12 @@ bool module_load_one(const char *prefix, const char *lib_name)
exec_dir = qemu_get_exec_dir();
search_dir = getenv("QEMU_MODULE_DIR");
+#ifdef CONFIG_MODULE_UPGRADES
+ version_dir = g_strcanon(g_strdup(QEMU_PKGVERSION),
+ G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "+-.~",
+ '_');
+ dirs[n_dirs++] = g_strdup_printf("/var/run/qemu/%s", version_dir);
+#endif
if (search_dir != NULL) {
dirs[n_dirs++] = g_strdup_printf("%s", search_dir);
}
@@ -201,12 +207,6 @@ bool module_load_one(const char *prefix, const char *lib_name)
dirs[n_dirs++] = g_strdup_printf("%s/..", exec_dir ? : "");
dirs[n_dirs++] = g_strdup_printf("%s", exec_dir ? : "");
-#ifdef CONFIG_MODULE_UPGRADES
- version_dir = g_strcanon(g_strdup(QEMU_PKGVERSION),
- G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "+-.~",
- '_');
- dirs[n_dirs++] = g_strdup_printf("/var/run/qemu/%s", version_dir);
-#endif
assert(n_dirs <= ARRAY_SIZE(dirs));
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] modules: load modules from /var/run/qemu/<version> directory firstly
2023-01-23 18:48 Siddhi Katage
@ 2023-01-24 7:55 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-01-24 7:55 UTC (permalink / raw)
To: Siddhi Katage, qemu-devel
Cc: joe.jin, dongli.zhang, christian.ehrhardt, berrange, pbonzini
On 23/1/23 19:48, Siddhi Katage wrote:
> From: Siddhi Katage <siddhi.katage@oracle.com>
>
> An old running QEMU will try to load modules with new build-id first,this
> will fail as expected ,then QEMU will fallback to load the old modules that
> matches its build-id from /var/run/qemu/<version> directory .
> Make /var/run/qemu/<version> directory as first search path to load modules.
>
> Fixes: bd83c861c0 ("modules: load modules from versioned /var/run dir")
> Signed-off-by: Siddhi Katage <siddhi.katage@oracle.com>
> ---
> util/module.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/1] modules: load modules from /var/run/qemu/<version> directory firstly
@ 2023-01-24 18:39 Siddhi Katage
2023-01-25 0:21 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 5+ messages in thread
From: Siddhi Katage @ 2023-01-24 18:39 UTC (permalink / raw)
To: qemu-devel
Cc: joe.jin, dongli.zhang, siddhi.katage, christian.ehrhardt,
berrange, pbonzini, philmd
From: Siddhi Katage <siddhi.katage@oracle.com>
An old running QEMU will try to load modules with new build-id first, this
will fail as expected, then QEMU will fallback to load the old modules that
matches its build-id from /var/run/qemu/<version> directory.
Make /var/run/qemu/<version> directory as first search path to load modules.
Fixes: bd83c861c0 ("modules: load modules from versioned /var/run dir")
Signed-off-by: Siddhi Katage <siddhi.katage@oracle.com>
---
util/module.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/util/module.c b/util/module.c
index 32e2631..b723d65 100644
--- a/util/module.c
+++ b/util/module.c
@@ -233,17 +233,17 @@ int module_load(const char *prefix, const char *name, Error **errp)
g_hash_table_add(loaded_modules, module_name);
search_dir = getenv("QEMU_MODULE_DIR");
- if (search_dir != NULL) {
- dirs[n_dirs++] = g_strdup_printf("%s", search_dir);
- }
- dirs[n_dirs++] = get_relocated_path(CONFIG_QEMU_MODDIR);
-
#ifdef CONFIG_MODULE_UPGRADES
version_dir = g_strcanon(g_strdup(QEMU_PKGVERSION),
G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "+-.~",
'_');
dirs[n_dirs++] = g_strdup_printf("/var/run/qemu/%s", version_dir);
#endif
+ if (search_dir != NULL) {
+ dirs[n_dirs++] = g_strdup_printf("%s", search_dir);
+ }
+ dirs[n_dirs++] = get_relocated_path(CONFIG_QEMU_MODDIR);
+
assert(n_dirs <= ARRAY_SIZE(dirs));
/* end of resources managed by the out: label */
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] modules: load modules from /var/run/qemu/<version> directory firstly
2023-01-24 18:39 [PATCH 1/1] modules: load modules from /var/run/qemu/<version> directory firstly Siddhi Katage
@ 2023-01-25 0:21 ` Philippe Mathieu-Daudé
2023-02-28 5:18 ` [External] : " Siddhi Katage
0 siblings, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-01-25 0:21 UTC (permalink / raw)
To: Siddhi Katage, qemu-devel
Cc: joe.jin, dongli.zhang, christian.ehrhardt, berrange, pbonzini
On 24/1/23 19:39, Siddhi Katage wrote:
> From: Siddhi Katage <siddhi.katage@oracle.com>
>
> An old running QEMU will try to load modules with new build-id first, this
> will fail as expected, then QEMU will fallback to load the old modules that
You corrected the comma/space typo :)
> matches its build-id from /var/run/qemu/<version> directory.
> Make /var/run/qemu/<version> directory as first search path to load modules.
>
> Fixes: bd83c861c0 ("modules: load modules from versioned /var/run dir")
> Signed-off-by: Siddhi Katage <siddhi.katage@oracle.com>
> ---
> util/module.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [External] : Re: [PATCH 1/1] modules: load modules from /var/run/qemu/<version> directory firstly
2023-01-25 0:21 ` Philippe Mathieu-Daudé
@ 2023-02-28 5:18 ` Siddhi Katage
0 siblings, 0 replies; 5+ messages in thread
From: Siddhi Katage @ 2023-02-28 5:18 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel@nongnu.org
Cc: Joe Jin, Dongli Zhang, christian.ehrhardt@canonical.com,
berrange@redhat.com, pbonzini@redhat.com
Hi ,
Can I know when this patch will be integrated to upstream?
Thank you,
Siddhi Katage
-----Original Message-----
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Sent: Wednesday, January 25, 2023 5:52 AM
To: Siddhi Katage <siddhi.katage@oracle.com>; qemu-devel@nongnu.org
Cc: Joe Jin <joe.jin@oracle.com>; Dongli Zhang <dongli.zhang@oracle.com>; christian.ehrhardt@canonical.com; berrange@redhat.com; pbonzini@redhat.com
Subject: [External] : Re: [PATCH 1/1] modules: load modules from /var/run/qemu/<version> directory firstly
On 24/1/23 19:39, Siddhi Katage wrote:
> From: Siddhi Katage <siddhi.katage@oracle.com>
>
> An old running QEMU will try to load modules with new build-id first,
> this will fail as expected, then QEMU will fallback to load the old
> modules that
You corrected the comma/space typo :)
> matches its build-id from /var/run/qemu/<version> directory.
> Make /var/run/qemu/<version> directory as first search path to load modules.
>
> Fixes: bd83c861c0 ("modules: load modules from versioned /var/run
> dir")
> Signed-off-by: Siddhi Katage <siddhi.katage@oracle.com>
> ---
> util/module.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-02-28 5:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-24 18:39 [PATCH 1/1] modules: load modules from /var/run/qemu/<version> directory firstly Siddhi Katage
2023-01-25 0:21 ` Philippe Mathieu-Daudé
2023-02-28 5:18 ` [External] : " Siddhi Katage
-- strict thread matches above, loose matches on Subject: below --
2023-01-23 18:48 Siddhi Katage
2023-01-24 7:55 ` Philippe Mathieu-Daudé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).