From b5a8fe5e8a9d8a5751dd5506026bc30a14010443 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Wed, 2 May 2012 13:07:25 -0300 Subject: move code to read default config files to a separate function (v2) Function added to arch_init.c because it depends on arch-specific settings. Changes v1 -> v2: - Move qemu_read_default_config_file() prototype to qemu-config.h Signed-off-by: Eduardo Habkost Signed-off-by: Anthony Liguori --- arch_init.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'arch_init.c') diff --git a/arch_init.c b/arch_init.c index 9a35aeea30..4008115e35 100644 --- a/arch_init.c +++ b/arch_init.c @@ -112,6 +112,24 @@ const uint32_t arch_type = QEMU_ARCH; #define ALL_EQ(v1, v2) ((v1) == (v2)) #endif + +int qemu_read_default_config_files(void) +{ + int ret; + + ret = qemu_read_config_file(CONFIG_QEMU_CONFDIR "/qemu.conf"); + if (ret < 0 && ret != -ENOENT) { + return ret; + } + + ret = qemu_read_config_file(arch_config_name); + if (ret < 0 && ret != -ENOENT) { + return ret; + } + + return 0; +} + static int is_dup_page(uint8_t *page) { VECTYPE *p = (VECTYPE *)page; -- cgit v1.2.3