move list of default config files to an array
More files will be added to the list, with additional attributes, later. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
c8262a4767
commit
756557de64
17
arch_init.c
17
arch_init.c
@ -112,18 +112,25 @@ const uint32_t arch_type = QEMU_ARCH;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
static struct defconfig_file {
|
||||||
|
const char *filename;
|
||||||
|
} default_config_files[] = {
|
||||||
|
{ CONFIG_QEMU_CONFDIR "/qemu.conf" },
|
||||||
|
{ CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf" },
|
||||||
|
{ NULL }, /* end of list */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
int qemu_read_default_config_files(void)
|
int qemu_read_default_config_files(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
struct defconfig_file *f;
|
||||||
|
|
||||||
ret = qemu_read_config_file(CONFIG_QEMU_CONFDIR "/qemu.conf");
|
for (f = default_config_files; f->filename; f++) {
|
||||||
|
ret = qemu_read_config_file(f->filename);
|
||||||
if (ret < 0 && ret != -ENOENT) {
|
if (ret < 0 && ret != -ENOENT) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = qemu_read_config_file(CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf");
|
|
||||||
if (ret < 0 && ret != -ENOENT) {
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user