summaryrefslogtreecommitdiffstats
path: root/softmmu
diff options
context:
space:
mode:
authorAkihiko Odaki2022-06-24 16:50:38 +0200
committerPaolo Bonzini2022-07-13 16:58:57 +0200
commit882084a04ae9bec00e510a2319feba1d1a653fb1 (patch)
treec6ecb1cc33085e0eb6bf47e4deb7530a9fe36602 /softmmu
parentcutils: Introduce bundle mechanism (diff)
downloadqemu-882084a04ae9bec00e510a2319feba1d1a653fb1.tar.gz
qemu-882084a04ae9bec00e510a2319feba1d1a653fb1.tar.xz
qemu-882084a04ae9bec00e510a2319feba1d1a653fb1.zip
datadir: Use bundle mechanism
softmmu/datadir.c had its own implementation to find files in the build tree, but now bundle mechanism provides the unified implementation which works for datadir and the other files. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20220624145039.49929-4-akihiko.odaki@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'softmmu')
-rw-r--r--softmmu/datadir.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/softmmu/datadir.c b/softmmu/datadir.c
index 160cac999a..697cffea93 100644
--- a/softmmu/datadir.c
+++ b/softmmu/datadir.c
@@ -83,26 +83,6 @@ void qemu_add_data_dir(char *path)
data_dir[data_dir_idx++] = path;
}
-/*
- * Find a likely location for support files using the location of the binary.
- * When running from the build tree this will be "$bindir/pc-bios".
- * Otherwise, this is CONFIG_QEMU_DATADIR (possibly relocated).
- *
- * The caller must use g_free() to free the returned data when it is
- * no longer required.
- */
-static char *find_datadir(void)
-{
- g_autofree char *dir = NULL;
-
- dir = g_build_filename(qemu_get_exec_dir(), "pc-bios", NULL);
- if (g_file_test(dir, G_FILE_TEST_IS_DIR)) {
- return g_steal_pointer(&dir);
- }
-
- return get_relocated_path(CONFIG_QEMU_DATADIR);
-}
-
void qemu_add_default_firmwarepath(void)
{
char **dirs;
@@ -116,7 +96,7 @@ void qemu_add_default_firmwarepath(void)
g_strfreev(dirs);
/* try to find datadir relative to the executable path */
- qemu_add_data_dir(find_datadir());
+ qemu_add_data_dir(get_relocated_path(CONFIG_QEMU_DATADIR));
}
void qemu_list_data_dirs(void)