From 10f5bff622cad71645e22c027b77ac31e51008ef Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Mon, 10 Feb 2014 14:48:51 +0800 Subject: util: Split out exec_dir from os_find_datadir With this change, main() calls qemu_init_exec_dir and uses argv[0] to init exec_dir. The saved value can be retrieved with qemu_get_exec_dir later. It will be reused by module loading. Signed-off-by: Fam Zheng Signed-off-by: Paolo Bonzini --- vl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index 316de54101..c1df83d1b3 100644 --- a/vl.c +++ b/vl.c @@ -2827,6 +2827,7 @@ int main(int argc, char **argv, char **envp) atexit(qemu_run_exit_notifiers); error_set_progname(argv[0]); + qemu_init_exec_dir(argv[0]); g_mem_set_vtable(&mem_trace); if (!g_thread_supported()) { @@ -3855,7 +3856,7 @@ int main(int argc, char **argv, char **envp) /* If no data_dir is specified then try to find it relative to the executable path. */ if (data_dir_idx < ARRAY_SIZE(data_dir)) { - data_dir[data_dir_idx] = os_find_datadir(argv[0]); + data_dir[data_dir_idx] = os_find_datadir(); if (data_dir[data_dir_idx] != NULL) { data_dir_idx++; } -- cgit v1.2.1