Subject: use fixed data dir instead of determining it at runtime
From: Michael Tokarev <mjt@tls.msk.ru>
Debian-specific: yes

Since we install to a fixed location, use fixed data directory
instead of deriving it at runtime from executable path.
This way it is possible to move qemu binary to another directory
and it will still work.

--- a/os-posix.c
+++ b/os-posix.c
@@ -72,6 +72,7 @@ void os_setup_signal_handling(void)
     sigaction(SIGTERM, &act, NULL);
 }
 
+#if 0 /* we use a fixed configured data path */
 /* Find a likely location for support files using the location of the binary.
    For installed binaries this will be "$bindir/../share/qemu".  When
    running from the build tree this will be "$bindir/../pc-bios".  */
@@ -107,6 +108,7 @@ char *os_find_datadir(void)
 }
 #undef SHARE_SUFFIX
 #undef BUILD_SUFFIX
+#endif
 
 void os_set_proc_name(const char *s)
 {
--- a/vl.c
+++ b/vl.c
@@ -3051,7 +3051,7 @@ int main(int argc, char **argv, char **e
     Error *main_loop_err = NULL;
     Error *err = NULL;
     bool list_data_dirs = false;
-    char *dir, **dirs;
+    char **dirs;
     typedef struct BlockdevOptions_queue {
         BlockdevOptions *bdo;
         Location loc;
@@ -4170,11 +4170,6 @@ int main(int argc, char **argv, char **e
     }
     g_strfreev(dirs);
 
-    /* try to find datadir relative to the executable path */
-    dir = os_find_datadir();
-    qemu_add_data_dir(dir);
-    g_free(dir);
-
     /* add the datadir specified when building */
     qemu_add_data_dir(CONFIG_QEMU_DATADIR);
 
