Revision 292444cb

b/qemu-options.hx
1965 1965
@item -writeconfig @var{file}
1966 1966
Write device configuration to @var{file}.
1967 1967
ETEXI
1968
DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig,
1969
    "-nodefconfig\n"
1970
    "                do not load default config files at startup\n")
1971
STEXI
1972
@item -nodefconfig
1973
Normally QEMU loads a configuration file from @var{sysconfdir}/qemu.conf and
1974
@var{sysconfdir}/target-@var{ARCH}.conf on startup.  The @code{-nodefconfig}
1975
option will prevent QEMU from loading these configuration files at startup.
1976
ETEXI
1968 1977

  
1969 1978
HXCOMM This is the last statement. Insert new options before this line!
1970 1979
STEXI
b/vl.c
4730 4730
#endif
4731 4731
    CPUState *env;
4732 4732
    int show_vnc_port = 0;
4733
    int defconfig = 1;
4733 4734

  
4734 4735
    init_clocks();
4735 4736

  
......
4789 4790
    tb_size = 0;
4790 4791
    autostart= 1;
4791 4792

  
4793
    /* first pass of option parsing */
4794
    optind = 1;
4795
    while (optind < argc) {
4796
        if (argv[optind][0] != '-') {
4797
            /* disk image */
4798
            continue;
4799
        } else {
4800
            const QEMUOption *popt;
4801

  
4802
            popt = lookup_opt(argc, argv, &optarg, &optind);
4803
            switch (popt->index) {
4804
            case QEMU_OPTION_nodefconfig:
4805
                defconfig=0;
4806
                break;
4807
            }
4808
        }
4809
    }
4810

  
4811
    if (defconfig) {
4812
        FILE *fp;
4813
        fp = fopen(CONFIG_QEMU_CONFDIR "/qemu.conf", "r");
4814
        if (fp) {
4815
            if (qemu_config_parse(fp) != 0) {
4816
                exit(1);
4817
            }
4818
            fclose(fp);
4819
        }
4820

  
4821
        fp = fopen(CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf", "r");
4822
        if (fp) {
4823
            if (qemu_config_parse(fp) != 0) {
4824
                exit(1);
4825
            }
4826
            fclose(fp);
4827
        }
4828
    }
4829

  
4830
    /* second pass of option parsing */
4792 4831
    optind = 1;
4793 4832
    for(;;) {
4794 4833
        if (optind >= argc)

Also available in: Unified diff