diff options
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 39 |
1 files changed, 39 insertions, 0 deletions
@@ -4730,6 +4730,7 @@ int main(int argc, char **argv, char **envp) #endif CPUState *env; int show_vnc_port = 0; + int defconfig = 1; init_clocks(); @@ -4789,6 +4790,44 @@ int main(int argc, char **argv, char **envp) tb_size = 0; autostart= 1; + /* first pass of option parsing */ + optind = 1; + while (optind < argc) { + if (argv[optind][0] != '-') { + /* disk image */ + continue; + } else { + const QEMUOption *popt; + + popt = lookup_opt(argc, argv, &optarg, &optind); + switch (popt->index) { + case QEMU_OPTION_nodefconfig: + defconfig=0; + break; + } + } + } + + if (defconfig) { + FILE *fp; + fp = fopen(CONFIG_QEMU_CONFDIR "/qemu.conf", "r"); + if (fp) { + if (qemu_config_parse(fp) != 0) { + exit(1); + } + fclose(fp); + } + + fp = fopen(CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf", "r"); + if (fp) { + if (qemu_config_parse(fp) != 0) { + exit(1); + } + fclose(fp); + } + } + + /* second pass of option parsing */ optind = 1; for(;;) { if (optind >= argc) |