Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 1 | qemu: search for datadir as in version 4.2 |
| 2 | |
| 3 | os_find_datadir() was changed after the 4.2 release. We need to check for |
| 4 | ../share/qemu relative to the executable because that is where the runqemu |
| 5 | configuration assumes it will be. |
| 6 | |
| 7 | Upstream-Status: Submitted [qemu-devel@nongnu.org] |
| 8 | |
| 9 | Signed-off-by: Joe Slater <joe.slater@windriver.com> |
| 10 | |
| 11 | |
| 12 | --- a/os-posix.c |
| 13 | +++ b/os-posix.c |
| 14 | @@ -82,8 +82,9 @@ void os_setup_signal_handling(void) |
| 15 | |
| 16 | /* |
| 17 | * Find a likely location for support files using the location of the binary. |
| 18 | + * Typically, this would be "$bindir/../share/qemu". |
| 19 | * When running from the build tree this will be "$bindir/../pc-bios". |
| 20 | - * Otherwise, this is CONFIG_QEMU_DATADIR. |
| 21 | + * Otherwise, this is CONFIG_QEMU_DATADIR as constructed by configure. |
| 22 | */ |
| 23 | char *os_find_datadir(void) |
| 24 | { |
| 25 | @@ -93,6 +94,12 @@ char *os_find_datadir(void) |
| 26 | exec_dir = qemu_get_exec_dir(); |
| 27 | g_return_val_if_fail(exec_dir != NULL, NULL); |
| 28 | |
| 29 | + dir = g_build_filename(exec_dir, "..", "share", "qemu", NULL); |
| 30 | + if (g_file_test(dir, G_FILE_TEST_IS_DIR)) { |
| 31 | + return g_steal_pointer(&dir); |
| 32 | + } |
| 33 | + g_free(dir); /* no autofree this time */ |
| 34 | + |
| 35 | dir = g_build_filename(exec_dir, "..", "pc-bios", NULL); |
| 36 | if (g_file_test(dir, G_FILE_TEST_IS_DIR)) { |
| 37 | return g_steal_pointer(&dir); |