qemu_conf: split out virQEMUDriverConfigLoadNographicsEntry

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:23:06 +01:00
parent da3dc5a382
commit 53680aa379

View File

@ -423,6 +423,14 @@ virQEMUDriverConfigHugeTLBFSInit(virHugeTLBFSPtr hugetlbfs,
} }
static int
virQEMUDriverConfigLoadNographicsEntry(virQEMUDriverConfigPtr cfg,
virConfPtr conf)
{
return virConfGetValueBool(conf, "nographics_allow_host_audio", &cfg->nogfxAllowHostAudio);
}
static int static int
virQEMUDriverConfigLoadSPICEEntry(virQEMUDriverConfigPtr cfg, virQEMUDriverConfigLoadSPICEEntry(virQEMUDriverConfigPtr cfg,
virConfPtr conf) virConfPtr conf)
@ -1013,7 +1021,8 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
goto cleanup; goto cleanup;
if (virConfGetValueBool(conf, "vnc_allow_host_audio", &cfg->vncAllowHostAudio) < 0) if (virConfGetValueBool(conf, "vnc_allow_host_audio", &cfg->vncAllowHostAudio) < 0)
goto cleanup; goto cleanup;
if (virConfGetValueBool(conf, "nographics_allow_host_audio", &cfg->nogfxAllowHostAudio) < 0)
if (virQEMUDriverConfigLoadNographicsEntry(cfg, conf) < 0)
goto cleanup; goto cleanup;
if (virQEMUDriverConfigLoadSPICEEntry(cfg, conf) < 0) if (virQEMUDriverConfigLoadSPICEEntry(cfg, conf) < 0)