[libvirt PATCH 03/18] conf: don't force existance of audio child elements

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

 



The attributes on the elements are optional, so we should not force the
elements themselves to be present, especially since we omit them when
formating the XML thus breaking round-tripping.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d30ca627aa..b6c50f54e5 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -13904,15 +13904,10 @@ virDomainAudioDefParseXML(virDomainXMLOptionPtr xmlopt G_GNUC_UNUSED,
         inputDevNode = virXPathNode("./input", ctxt);
         outputDevNode = virXPathNode("./output", ctxt);
 
-        if (!inputDevNode || !outputDevNode) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("Audio type OSS requires to have <input> "
-                             "and <output> specified"));
-            goto error;
-        }
-
-        def->backend.oss.inputDev = virXMLPropString(inputDevNode, "dev");
-        def->backend.oss.outputDev = virXMLPropString(outputDevNode, "dev");
+        if (inputDevNode)
+            def->backend.oss.inputDev = virXMLPropString(inputDevNode, "dev");
+        if (outputDevNode)
+            def->backend.oss.outputDev = virXMLPropString(outputDevNode, "dev");
         break;
     }
 
-- 
2.29.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