vl: Move -config_path handling into main

This commit is contained in:
Matt Borgerson 2022-03-22 16:36:17 -07:00 committed by mborgerson
parent 6e1969001e
commit 2d5471c5be
2 changed files with 11 additions and 10 deletions

View File

@ -2794,16 +2794,6 @@ void qemu_init(int argc, char **argv, char **envp)
// reporting. This should be replaced eventually, but is "good enough" for
// now.
//
for (int i = 1; i < argc; i++) {
if (argv[i] && strcmp(argv[i], "-config_path") == 0) {
argv[i] = NULL;
if (i < argc - 1 && argv[i+1]) {
xemu_settings_set_path(argv[i+1]);
argv[i+1] = NULL;
}
break;
}
}
int first_boot = xemu_settings_did_fail_to_load();
int fake_argc = 32 + argc;

View File

@ -1522,6 +1522,17 @@ int main(int argc, char **argv)
gArgc = argc;
gArgv = argv;
for (int i = 1; i < argc; i++) {
if (argv[i] && strcmp(argv[i], "-config_path") == 0) {
argv[i] = NULL;
if (i < argc - 1 && argv[i+1]) {
xemu_settings_set_path(argv[i+1]);
argv[i+1] = NULL;
}
break;
}
}
xemu_settings_load();
atexit(xemu_settings_save);