[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 10/23] qemu_conf: split out virQEMUDriverConfigLoadLogEntry



Split out parts of the config parsing code to make
the parent function easier to read.

Signed-off-by: Ján Tomko <jtomko redhat com>
---
 src/qemu/qemu_conf.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 29f948346d..b7d258f17a 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -423,6 +423,16 @@ virQEMUDriverConfigHugeTLBFSInit(virHugeTLBFSPtr hugetlbfs,
 }
 
 
+static int
+virQEMUDriverConfigLoadLogEntry(virQEMUDriverConfigPtr cfg,
+                                virConfPtr conf)
+{
+    if (virConfGetValueBool(conf, "log_timestamp", &cfg->logTimestamp) < 0)
+        return -1;
+
+    return 0;
+}
+
 static int
 virQEMUDriverConfigLoadNVRAMEntry(virQEMUDriverConfigPtr cfg,
                                   virConfPtr conf)
@@ -934,7 +944,7 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
         goto cleanup;
     }
 
-    if (virConfGetValueBool(conf, "log_timestamp", &cfg->logTimestamp) < 0)
+    if (virQEMUDriverConfigLoadLogEntry(cfg, conf) < 0)
         goto cleanup;
 
     if (virQEMUDriverConfigLoadNVRAMEntry(cfg, conf) < 0)
-- 
2.20.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]