Split out parts of the config parsing code to make
the parent function easier to read.
Signed-off-by: Ján Tomko <jtomko(a)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 325e5ccfd5..7fdfed7db1 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -423,6 +423,16 @@ virQEMUDriverConfigHugeTLBFSInit(virHugeTLBFSPtr hugetlbfs,
}
+static int
+virQEMUDriverConfigLoadMemoryEntry(virQEMUDriverConfigPtr cfg,
+ virConfPtr conf)
+{
+ if (virConfGetValueString(conf, "memory_backing_dir",
&cfg->memoryBackingDir) < 0)
+ return -1;
+
+ return 0;
+}
+
static int
virQEMUDriverConfigLoadSWTPMEntry(virQEMUDriverConfigPtr cfg,
virConfPtr conf)
@@ -891,7 +901,7 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
}
}
- if (virConfGetValueString(conf, "memory_backing_dir",
&cfg->memoryBackingDir) < 0)
+ if (virQEMUDriverConfigLoadMemoryEntry(cfg, conf) < 0)
goto cleanup;
if (virQEMUDriverConfigLoadSWTPMEntry(cfg, conf) < 0)
--
2.20.1