Search $bindir/../share/qemu for datadir
This restores the behavior that was removed by 6dd2dace.
diff --git a/os-posix.c b/os-posix.c
index 3cd52e1..3befc0e 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -89,6 +89,7 @@
{
g_autofree char *exec_dir = NULL;
g_autofree char *dir = NULL;
+ g_autofree char *share_dir = NULL;
exec_dir = qemu_get_exec_dir();
g_return_val_if_fail(exec_dir != NULL, NULL);
@@ -98,6 +99,11 @@
return g_steal_pointer(&dir);
}
+ share_dir = g_build_filename(exec_dir, "..", "share", "qemu", NULL);
+ if (g_file_test(share_dir, G_FILE_TEST_IS_DIR)) {
+ return g_steal_pointer(&share_dir);
+ }
+
return g_strdup(CONFIG_QEMU_DATADIR);
}