]> git.proxmox.com Git - qemu.git/commitdiff
move list of default config files to an array
authorEduardo Habkost <ehabkost@redhat.com>
Wed, 2 May 2012 16:07:27 +0000 (13:07 -0300)
committerAnthony Liguori <aliguori@us.ibm.com>
Thu, 10 May 2012 17:37:56 +0000 (12:37 -0500)
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>
arch_init.c

index 152cbbbb63487069a60f07b771ea7f8f4e7d7459..62332e9ff071c7c8f5c17d6006b30b7e94d458de 100644 (file)
@@ -112,20 +112,27 @@ const uint32_t arch_type = QEMU_ARCH;
 #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 ret;
-    
-    ret = qemu_read_config_file(CONFIG_QEMU_CONFDIR "/qemu.conf");
-    if (ret < 0 && ret != -ENOENT) {
-        return ret;
-    }
+    struct defconfig_file *f;
 
-    ret = qemu_read_config_file(CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf");
-    if (ret < 0 && ret != -ENOENT) {
-        return ret;
+    for (f = default_config_files; f->filename; f++) {
+        ret = qemu_read_config_file(f->filename);
+        if (ret < 0 && ret != -ENOENT) {
+            return ret;
+        }
     }
-
+    
     return 0;
 }