qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Siddhi Katage <siddhi.katage@oracle.com>
To: qemu-devel@nongnu.org
Cc: joe.jin@oracle.com, dongli.zhang@oracle.com,
	siddhi.katage@oracle.com, christian.ehrhardt@canonical.com,
	berrange@redhat.com, pbonzini@redhat.com
Subject: [PATCH 1/1] modules: load modules from /var/run/qemu/<version> directory firstly
Date: Mon, 23 Jan 2023 18:48:13 +0000	[thread overview]
Message-ID: <1674499693-9863-1-git-send-email-siddhi.katage@oracle.com> (raw)

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



             reply	other threads:[~2023-01-23 20:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23 18:48 Siddhi Katage [this message]
2023-01-24  7:55 ` [PATCH 1/1] modules: load modules from /var/run/qemu/<version> directory firstly Philippe Mathieu-Daudé
2023-01-24 17:44   ` [External] : " Siddhi Katage
  -- strict thread matches above, loose matches on Subject: below --
2023-01-24 18:39 Siddhi Katage
2023-01-25  0:21 ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1674499693-9863-1-git-send-email-siddhi.katage@oracle.com \
    --to=siddhi.katage@oracle.com \
    --cc=berrange@redhat.com \
    --cc=christian.ehrhardt@canonical.com \
    --cc=dongli.zhang@oracle.com \
    --cc=joe.jin@oracle.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).