Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
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 c341091c99..0b5d8e5164 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -13969,23 +13969,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