vl: relocate paths to data directories

As an additional advantage, the logic is now unified between
POSIX and Win32 systems.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini
2020-08-18 11:57:56 +02:00
parent 63c4db4c2e
commit ea1edcd7da
6 changed files with 32 additions and 47 deletions

View File

@ -80,26 +80,6 @@ void os_setup_signal_handling(void)
sigaction(SIGTERM, &act, NULL);
}
/*
* 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.
*
* The caller must use g_free() to free the returned data when it is
* no longer required.
*/
char *os_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 g_strdup(CONFIG_QEMU_DATADIR);
}
void os_set_proc_name(const char *s)
{
#if defined(PR_SET_NAME)