diff mbox series

[v4,5/7] module: Use qemu_get_runtime_dir()

Message ID 20240716-run-v4-5-5f7a29631168@daynix.com
State New
Headers show
Series util: Introduce qemu_get_runtime_dir() | expand

Commit Message

Akihiko Odaki July 16, 2024, 7:27 a.m. UTC
qemu_get_runtime_dir() is used to construct the path to module upgrades.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20230921075425.16738-7-akihiko.odaki@daynix.com>
---
 util/module.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/util/module.c b/util/module.c
index 32e263163c75..580658edf486 100644
--- a/util/module.c
+++ b/util/module.c
@@ -242,7 +242,8 @@  int module_load(const char *prefix, const char *name, Error **errp)
     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);
+    g_autofree char *run = qemu_get_runtime_dir();
+    dirs[n_dirs++] = g_build_filename(run, "qemu", version_dir, NULL);
 #endif
     assert(n_dirs <= ARRAY_SIZE(dirs));