qemu_get_runtime_dir() is used to construct the path to module upgrades. Signed-off-by: Akihiko Odaki --- include/qemu/module.h | 2 +- util/module.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/qemu/module.h b/include/qemu/module.h index fccf017bf9e8..a22755c6f026 100644 --- a/include/qemu/module.h +++ b/include/qemu/module.h @@ -76,7 +76,7 @@ void module_call_init(module_init_type type); * directories searched are: * - getenv("QEMU_MODULE_DIR") * - get_relocated_path(CONFIG_QEMU_MODDIR); - * - /var/run/qemu/${version_dir} + * - ${qemu_get_runtime_dir()}/qemu/${version_dir} * * prefix: a subsystem prefix, or the empty string ("ui-", ..., "") * name: name of the module diff --git a/util/module.c b/util/module.c index 09dc43f51eb3..eff64fa7ab0a 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)); -- 2.54.0