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 <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Fam Zheng 2014-02-10 14:48:51 +08:00 committed by Paolo Bonzini
parent 46eef33b89
commit 10f5bff622
10 changed files with 108 additions and 56 deletions

View file

@ -2719,6 +2719,7 @@ int main(int argc, char **argv)
#endif
error_set_progname(argv[0]);
qemu_init_exec_dir(argv[0]);
qemu_init_main_loop();
bdrv_init();