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 | |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 12 | Index: qemu-5.1.0/os-posix.c |
| 13 | =================================================================== |
| 14 | --- qemu-5.1.0.orig/os-posix.c |
| 15 | +++ qemu-5.1.0/os-posix.c |
Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 16 | @@ -82,8 +82,9 @@ void os_setup_signal_handling(void) |
| 17 | |
| 18 | /* |
| 19 | * Find a likely location for support files using the location of the binary. |
| 20 | + * Typically, this would be "$bindir/../share/qemu". |
| 21 | * When running from the build tree this will be "$bindir/../pc-bios". |
| 22 | - * Otherwise, this is CONFIG_QEMU_DATADIR. |
| 23 | + * Otherwise, this is CONFIG_QEMU_DATADIR as constructed by configure. |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 24 | * |
| 25 | * The caller must use g_free() to free the returned data when it is |
| 26 | * no longer required. |
| 27 | @@ -96,6 +97,12 @@ char *os_find_datadir(void) |
Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 28 | exec_dir = qemu_get_exec_dir(); |
| 29 | g_return_val_if_fail(exec_dir != NULL, NULL); |
| 30 | |
| 31 | + dir = g_build_filename(exec_dir, "..", "share", "qemu", NULL); |
| 32 | + if (g_file_test(dir, G_FILE_TEST_IS_DIR)) { |
| 33 | + return g_steal_pointer(&dir); |
| 34 | + } |
| 35 | + g_free(dir); /* no autofree this time */ |
| 36 | + |
| 37 | dir = g_build_filename(exec_dir, "..", "pc-bios", NULL); |
| 38 | if (g_file_test(dir, G_FILE_TEST_IS_DIR)) { |
| 39 | return g_steal_pointer(&dir); |