qemu_conf: split out virQEMUDriverConfigLoadMemoryEntry

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>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Ján Tomko 2019-01-15 10:10:36 +01:00
parent d447293893
commit 6427aca725
1 changed files with 9 additions and 1 deletions

View File

@ -423,6 +423,14 @@ virQEMUDriverConfigHugeTLBFSInit(virHugeTLBFSPtr hugetlbfs,
}
static int
virQEMUDriverConfigLoadMemoryEntry(virQEMUDriverConfigPtr cfg,
virConfPtr conf)
{
return virConfGetValueString(conf, "memory_backing_dir", &cfg->memoryBackingDir);
}
static int
virQEMUDriverConfigLoadSWTPMEntry(virQEMUDriverConfigPtr cfg,
virConfPtr conf)
@ -892,7 +900,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)