]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: don't force existance of audio child elements
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 24 Feb 2021 13:05:01 +0000 (13:05 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 9 Mar 2021 22:58:00 +0000 (22:58 +0000)
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.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/conf/domain_conf.c

index 2ed6ac33a458b2ec233a6e14df5e8fdc65496774..756459eacbc6237af6bd0ec0254b487fdfc32805 100644 (file)
@@ -13914,15 +13914,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;
     }