[libvirt PATCH v3 35/51] domain_conf: Use virXMLPropTristateXXX in virDomainAudioDefParseXML

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux