Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx> --- src/conf/domain_conf.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 17b8cab707..976bdb0172 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -13970,23 +13970,15 @@ virDomainAudioDefParseXML(virDomainXMLOptionPtr xmlopt G_GNUC_UNUSED, break; case VIR_DOMAIN_AUDIO_TYPE_OSS: { - g_autofree char *tryMMap = virXMLPropString(node, "tryMMap"); - g_autofree char *exclusive = virXMLPropString(node, "exclusive"); g_autofree char *dspPolicy = virXMLPropString(node, "dspPolicy"); - if (tryMMap && ((def->backend.oss.tryMMap = - virTristateBoolTypeFromString(tryMMap)) <= 0)) { - virReportError(VIR_ERR_XML_ERROR, - _("unknown 'tryMMap' value '%s'"), tryMMap); + if (virXMLPropTristateBool(node, "tryMMap", false, + &def->backend.oss.tryMMap) < 0) goto error; - } - if (exclusive && ((def->backend.oss.exclusive = - virTristateBoolTypeFromString(exclusive)) <= 0)) { - virReportError(VIR_ERR_XML_ERROR, - _("unknown 'exclusive' value '%s'"), exclusive); + if (virXMLPropTristateBool(node, "exclusive", false, + &def->backend.oss.exclusive) < 0) goto error; - } if (dspPolicy) { if (virStrToLong_i(dspPolicy, NULL, 10, -- 2.26.2