qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] os_find_datadir:  search as in version 4.2
@ 2020-06-15 22:58 Joe Slater
  2020-06-16  9:19 ` Peter Maydell
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Joe Slater @ 2020-06-15 22:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: joe.slater, randy.macleod

Always look for ../share/qemu then ../pc-bios when looking for datadir.

Signed-off-by: Joe Slater <joe.slater@windriver.com>
---
 os-posix.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/os-posix.c b/os-posix.c
index 3cd52e1e70..f77da94bf6 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -82,8 +82,9 @@ void os_setup_signal_handling(void)
 
 /*
  * Find a likely location for support files using the location of the binary.
+ * Typically, this would be "$bindir/../share/qemu".
  * When running from the build tree this will be "$bindir/../pc-bios".
- * Otherwise, this is CONFIG_QEMU_DATADIR.
+ * Otherwise, this is CONFIG_QEMU_DATADIR as constructed by configure.
  */
 char *os_find_datadir(void)
 {
@@ -93,6 +94,12 @@ char *os_find_datadir(void)
     exec_dir = qemu_get_exec_dir();
     g_return_val_if_fail(exec_dir != NULL, NULL);
 
+    dir = g_build_filename(exec_dir, "..", "share", "qemu", NULL);
+    if (g_file_test(dir, G_FILE_TEST_IS_DIR)) {
+        return g_steal_pointer(&dir);
+    }
+    g_free(dir);  /* no autofree this time */
+
     dir = g_build_filename(exec_dir, "..", "pc-bios", NULL);
     if (g_file_test(dir, G_FILE_TEST_IS_DIR)) {
         return g_steal_pointer(&dir);
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-01-23 18:11 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-15 22:58 [PATCH 1/1] os_find_datadir: search as in version 4.2 Joe Slater
2020-06-16  9:19 ` Peter Maydell
2020-06-16 15:37   ` Slater, Joseph
2020-07-15 19:37   ` Peter Maydell
2020-07-15 19:57     ` Marc-André Lureau
2020-08-08  1:35       ` Brian Norris
2020-08-08 15:34         ` Peter Maydell
2020-08-10  7:29           ` Marc-André Lureau
2020-08-10 21:41             ` Brian Norris
2021-01-23  2:05               ` Brian Norris
2021-01-23 18:08                 ` Paolo Bonzini
2020-07-16 14:12 ` Marc-André Lureau
2020-08-10  7:33 ` Marc-André Lureau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).