From fe304b02f01aec6f2f1b20b6ae0ae07f9b9f0b9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Wed, 24 Feb 2021 13:05:01 +0000 Subject: [PATCH] conf: don't force existance of audio child elements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Daniel P. Berrangé --- 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 2ed6ac33a4..756459eacb 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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 " - "and 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; }