mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
conf: Simplify error paths in storage source component parsers
virDomainDiskSourcePrivateDataParse and virDomainDiskSourcePRParse don't need the 'cleanup' label any more thanks to VIR_XPATH_NODE_AUTORESTORE. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
3145285a06
commit
bdc76386d3
@ -9028,7 +9028,6 @@ virDomainDiskSourcePrivateDataParse(xmlNodePtr node,
|
||||
virDomainXMLOptionPtr xmlopt)
|
||||
{
|
||||
VIR_XPATH_NODE_AUTORESTORE(ctxt);
|
||||
int ret = -1;
|
||||
|
||||
if (!(flags & VIR_DOMAIN_DEF_PARSE_STATUS) ||
|
||||
!xmlopt || !xmlopt->privateData.storageParse)
|
||||
@ -9036,18 +9035,13 @@ virDomainDiskSourcePrivateDataParse(xmlNodePtr node,
|
||||
|
||||
ctxt->node = node;
|
||||
|
||||
if (!(ctxt->node = virXPathNode("./privateData", ctxt))) {
|
||||
ret = 0;
|
||||
goto cleanup;
|
||||
}
|
||||
if (!(ctxt->node = virXPathNode("./privateData", ctxt)))
|
||||
return 0;
|
||||
|
||||
if (xmlopt->privateData.storageParse(ctxt, src) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -9057,21 +9051,16 @@ virDomainDiskSourcePRParse(xmlNodePtr node,
|
||||
virStoragePRDefPtr *pr)
|
||||
{
|
||||
VIR_XPATH_NODE_AUTORESTORE(ctxt);
|
||||
int ret = -1;
|
||||
|
||||
ctxt->node = node;
|
||||
|
||||
if (!(ctxt->node = virXPathNode("./reservations", ctxt))) {
|
||||
ret = 0;
|
||||
goto cleanup;
|
||||
}
|
||||
if (!(ctxt->node = virXPathNode("./reservations", ctxt)))
|
||||
return 0;
|
||||
|
||||
if (!(*pr = virStoragePRDefParseXML(ctxt)))
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user