[libvirt PATCH 22/38] domain_conf: Use virXMLProp(OnOff|YesNo) 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 | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 6559c3d2f8..fe35a3960e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14025,23 +14025,13 @@ 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 (virXMLPropYesNo(node, "tryMMap", &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 (virXMLPropYesNo(node, "exclusive", &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