summaryrefslogtreecommitdiffstats
path: root/qemu-nbd.c
diff options
context:
space:
mode:
authorFam Zheng2014-02-10 07:48:51 +0100
committerPaolo Bonzini2014-02-20 13:12:54 +0100
commit10f5bff622cad71645e22c027b77ac31e51008ef (patch)
tree350ebef38d05121c3b438ef43145c59a0ff7da81 /qemu-nbd.c
parentFix QEMU build on OpenBSD on x86 archs (diff)
downloadqemu-10f5bff622cad71645e22c027b77ac31e51008ef.tar.gz
qemu-10f5bff622cad71645e22c027b77ac31e51008ef.tar.xz
qemu-10f5bff622cad71645e22c027b77ac31e51008ef.zip
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 'qemu-nbd.c')
-rw-r--r--qemu-nbd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 136e8c9c05..2dc75aa27f 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -376,6 +376,7 @@ int main(int argc, char **argv)
memset(&sa_sigterm, 0, sizeof(sa_sigterm));
sa_sigterm.sa_handler = termsig_handler;
sigaction(SIGTERM, &sa_sigterm, NULL);
+ qemu_init_exec_dir(argv[0]);
while ((ch = getopt_long(argc, argv, sopt, lopt, &opt_ind)) != -1) {
switch (ch) {