mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
virNetworkDHCPLeaseTimeDefParseXML: Output error when 'expiry' can't be parsed
virStrToLong_ul doesn't report it's own error. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1918674 Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
parent
d51ad0008d
commit
196ebfc240
@ -418,8 +418,11 @@ virNetworkDHCPLeaseTimeDefParseXML(virNetworkDHCPLeaseTimeDefPtr *lease,
|
|||||||
if (!(expirystr = virXMLPropString(node, "expiry")))
|
if (!(expirystr = virXMLPropString(node, "expiry")))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (virStrToLong_ul(expirystr, NULL, 10, &expiry) < 0)
|
if (virStrToLong_ul(expirystr, NULL, 10, &expiry) < 0) {
|
||||||
|
virReportError(VIR_ERR_XML_ERROR,
|
||||||
|
_("failed to parse expiry value '%s'"), expirystr);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if ((unitstr = virXMLPropString(node, "unit"))) {
|
if ((unitstr = virXMLPropString(node, "unit"))) {
|
||||||
if ((unit = virNetworkDHCPLeaseTimeUnitTypeFromString(unitstr)) < 0) {
|
if ((unit = virNetworkDHCPLeaseTimeUnitTypeFromString(unitstr)) < 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user