virDomainAudioDefParseXML: Don't ignore return value of virDomainAudio*Parse()

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-05-19 16:10:07 +02:00 committed by Michal Privoznik
parent e663717cb1
commit 5ad6db604a
1 changed files with 30 additions and 20 deletions

View File

@ -13155,17 +13155,21 @@ virDomainAudioDefParseXML(virDomainXMLOption *xmlopt G_GNUC_UNUSED,
break; break;
case VIR_DOMAIN_AUDIO_TYPE_COREAUDIO: case VIR_DOMAIN_AUDIO_TYPE_COREAUDIO:
if (inputNode) if (inputNode &&
virDomainAudioCoreAudioParse(&def->backend.coreaudio.input, inputNode); virDomainAudioCoreAudioParse(&def->backend.coreaudio.input, inputNode) < 0)
if (outputNode) goto error;
virDomainAudioCoreAudioParse(&def->backend.coreaudio.output, outputNode); if (outputNode &&
virDomainAudioCoreAudioParse(&def->backend.coreaudio.output, outputNode) < 0)
goto error;
break; break;
case VIR_DOMAIN_AUDIO_TYPE_JACK: case VIR_DOMAIN_AUDIO_TYPE_JACK:
if (inputNode) if (inputNode &&
virDomainAudioJackParse(&def->backend.jack.input, inputNode); virDomainAudioJackParse(&def->backend.jack.input, inputNode) < 0)
if (outputNode) goto error;
virDomainAudioJackParse(&def->backend.jack.output, outputNode); if (outputNode &&
virDomainAudioJackParse(&def->backend.jack.output, outputNode) < 0)
goto error;
break; break;
case VIR_DOMAIN_AUDIO_TYPE_OSS: { case VIR_DOMAIN_AUDIO_TYPE_OSS: {
@ -13193,20 +13197,24 @@ virDomainAudioDefParseXML(virDomainXMLOption *xmlopt G_GNUC_UNUSED,
def->backend.oss.dspPolicySet = true; def->backend.oss.dspPolicySet = true;
} }
if (inputNode) if (inputNode &&
virDomainAudioOSSParse(&def->backend.oss.input, inputNode); virDomainAudioOSSParse(&def->backend.oss.input, inputNode) < 0)
if (outputNode) goto error;
virDomainAudioOSSParse(&def->backend.oss.output, outputNode); if (outputNode &&
virDomainAudioOSSParse(&def->backend.oss.output, outputNode) < 0)
goto error;
break; break;
} }
case VIR_DOMAIN_AUDIO_TYPE_PULSEAUDIO: case VIR_DOMAIN_AUDIO_TYPE_PULSEAUDIO:
def->backend.pulseaudio.serverName = virXMLPropString(node, "serverName"); def->backend.pulseaudio.serverName = virXMLPropString(node, "serverName");
if (inputNode) if (inputNode &&
virDomainAudioPulseAudioParse(&def->backend.pulseaudio.input, inputNode); virDomainAudioPulseAudioParse(&def->backend.pulseaudio.input, inputNode) < 0)
if (outputNode) goto error;
virDomainAudioPulseAudioParse(&def->backend.pulseaudio.output, outputNode); if (outputNode &&
virDomainAudioPulseAudioParse(&def->backend.pulseaudio.output, outputNode) < 0)
goto error;
break; break;
case VIR_DOMAIN_AUDIO_TYPE_SDL: { case VIR_DOMAIN_AUDIO_TYPE_SDL: {
@ -13214,10 +13222,12 @@ virDomainAudioDefParseXML(virDomainXMLOption *xmlopt G_GNUC_UNUSED,
VIR_XML_PROP_NONZERO, &def->backend.sdl.driver) < 0) VIR_XML_PROP_NONZERO, &def->backend.sdl.driver) < 0)
goto error; goto error;
if (inputNode) if (inputNode &&
virDomainAudioSDLParse(&def->backend.sdl.input, inputNode); virDomainAudioSDLParse(&def->backend.sdl.input, inputNode) < 0)
if (outputNode) goto error;
virDomainAudioSDLParse(&def->backend.sdl.output, outputNode); if (outputNode &&
virDomainAudioSDLParse(&def->backend.sdl.output, outputNode) < 0)
goto error;
break; break;
} }