Re: [PATCH] virNetworkDHCPLeaseTimeDefParseXML: Output error when 'expiry' can't be parsed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/21/21 11:40 AM, Peter Krempa wrote:
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@xxxxxxxxxx>


Reviewed-by: Laine Stump <laine@xxxxxxxxxx>

---
  src/conf/network_conf.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 4f1115e103..ff7a56f4f4 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -418,8 +418,11 @@ virNetworkDHCPLeaseTimeDefParseXML(virNetworkDHCPLeaseTimeDefPtr *lease,
      if (!(expirystr = virXMLPropString(node, "expiry")))
          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;
+    }

      if ((unitstr = virXMLPropString(node, "unit"))) {
          if ((unit = virNetworkDHCPLeaseTimeUnitTypeFromString(unitstr)) < 0) {





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux