summaryrefslogtreecommitdiffstats
path: root/include/qemu/osdep.h
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2014-02-10 14:48:51 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2014-02-20 13:12:54 +0100
commit10f5bff622cad71645e22c027b77ac31e51008ef (patch)
tree350ebef38d05121c3b438ef43145c59a0ff7da81 /include/qemu/osdep.h
parent46eef33b89e936ca793e13c4aeea1414e97e8dbb (diff)
downloadhqemu-10f5bff622cad71645e22c027b77ac31e51008ef.zip
hqemu-10f5bff622cad71645e22c027b77ac31e51008ef.tar.gz
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>
Diffstat (limited to 'include/qemu/osdep.h')
-rw-r--r--include/qemu/osdep.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index eac7172..ffb2966 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -215,6 +215,15 @@ bool fips_get_state(void);
*/
char *qemu_get_local_state_pathname(const char *relative_pathname);
+/* Find program directory, and save it for later usage with
+ * qemu_get_exec_dir().
+ * Try OS specific API first, if not working, parse from argv0. */
+void qemu_init_exec_dir(const char *argv0);
+
+/* Get the saved exec dir.
+ * Caller needs to release the returned string by g_free() */
+char *qemu_get_exec_dir(void);
+
/**
* qemu_getauxval:
* @type: the auxiliary vector key to lookup
OpenPOWER on IntegriCloud