Revision f29a5614

b/arch_init.c
114 114

  
115 115
static struct defconfig_file {
116 116
    const char *filename;
117
    /* Indicates it is an user config file (disabled by -no-user-config) */
118
    bool userconfig;
117 119
} default_config_files[] = {
118
    { CONFIG_QEMU_CONFDIR "/qemu.conf" },
119
    { CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf" },
120
    { CONFIG_QEMU_CONFDIR "/qemu.conf",                   true },
121
    { CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf", true },
120 122
    { NULL }, /* end of list */
121 123
};
122 124

  
123 125

  
124
int qemu_read_default_config_files(void)
126
int qemu_read_default_config_files(bool userconfig)
125 127
{
126 128
    int ret;
127 129
    struct defconfig_file *f;
128 130

  
129 131
    for (f = default_config_files; f->filename; f++) {
132
        if (!userconfig && f->userconfig) {
133
            continue;
134
        }
130 135
        ret = qemu_read_config_file(f->filename);
131 136
        if (ret < 0 && ret != -ENOENT) {
132 137
            return ret;
b/qemu-config.h
18 18

  
19 19
/* Read default Qemu config files
20 20
 */
21
int qemu_read_default_config_files(void);
21
int qemu_read_default_config_files(bool userconfig);
22 22

  
23 23
#endif /* QEMU_CONFIG_H */
b/qemu-options.hx
2685 2685
STEXI
2686 2686
@item -nodefconfig
2687 2687
@findex -nodefconfig
2688
Normally QEMU loads a configuration file from @var{sysconfdir}/qemu.conf and
2689
@var{sysconfdir}/target-@var{ARCH}.conf on startup.  The @code{-nodefconfig}
2690
option will prevent QEMU from loading these configuration files at startup.
2688
Normally QEMU loads configuration files from @var{sysconfdir} and @var{datadir} at startup.
2689
The @code{-nodefconfig} option will prevent QEMU from loading any of those config files.
2690
ETEXI
2691
DEF("no-user-config", 0, QEMU_OPTION_nouserconfig,
2692
    "-no-user-config\n"
2693
    "                do not load user-provided config files at startup\n",
2694
    QEMU_ARCH_ALL)
2695
STEXI
2696
@item -no-user-config
2697
@findex -no-user-config
2698
The @code{-no-user-config} option makes QEMU not load any of the user-provided
2699
config files on @var{sysconfdir}, but won't make it skip the QEMU-provided config
2700
files from @var{datadir}.
2691 2701
ETEXI
2692 2702
DEF("trace", HAS_ARG, QEMU_OPTION_trace,
2693 2703
    "-trace [events=<file>][,file=<file>]\n"
b/vl.c
2284 2284
    int show_vnc_port = 0;
2285 2285
#endif
2286 2286
    bool defconfig = true;
2287
    bool userconfig = true;
2287 2288
    const char *log_mask = NULL;
2288 2289
    const char *log_file = NULL;
2289 2290
    GMemVTable mem_trace = {
......
2352 2353
            case QEMU_OPTION_nodefconfig:
2353 2354
                defconfig = false;
2354 2355
                break;
2356
            case QEMU_OPTION_nouserconfig:
2357
                userconfig = false;
2358
                break;
2355 2359
            }
2356 2360
        }
2357 2361
    }
2358 2362

  
2359 2363
    if (defconfig) {
2360 2364
        int ret;
2361
        ret = qemu_read_default_config_files();
2365
        ret = qemu_read_default_config_files(userconfig);
2362 2366
        if (ret < 0) {
2363 2367
            exit(1);
2364 2368
        }

Also available in: Unified diff