[PATCH] build: use correct limit for unsigned long long

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

 



Reported by Jason Helfman as a build-breaker on FreeBSD.

* src/conf/domain_conf.c (virDomainFSDefParseXML): Use POSIX
spelling.
* src/openvz/openvz_conf.c (openvzReadFSConf): Likewise.
---

Pushing under the build-breaker rule.

 src/conf/domain_conf.c   |    8 +++-----
 src/openvz/openvz_conf.c |    4 ++--
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 4086dac..3fb90db 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -4248,14 +4248,12 @@ virDomainFSDefParseXML(xmlNodePtr node,

     if (virDomainParseScaledValue("./space_hard_limit[1]", ctxt,
                                   &def->space_hard_limit, 1,
-                                  ULONG_LONG_MAX,
-                                  false) < 0)
+                                  ULLONG_MAX, false) < 0)
         goto error;

     if (virDomainParseScaledValue("./space_soft_limit[1]", ctxt,
                                   &def->space_soft_limit, 1,
-                                  ULONG_LONG_MAX,
-                                  false) < 0)
+                                  ULLONG_MAX, false) < 0)
         goto error;

     cur = node->children;
@@ -4335,7 +4333,7 @@ virDomainFSDefParseXML(xmlNodePtr node,
         }
         if (unit &&
             virScaleInteger(&def->usage, unit,
-                            1024, ULONG_LONG_MAX) < 0)
+                            1024, ULLONG_MAX) < 0)
             goto error;
     }

diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index bb61b13..ad27d37 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -455,8 +455,8 @@ openvzReadFSConf(virDomainDefPtr def,
             goto error;
         } else {
             /* Ensure that we can multiply by 1024 without overflowing. */
-            if (barrier > ULONG_LONG_MAX / 1024 ||
-                limit > ULONG_LONG_MAX / 1024 ) {
+            if (barrier > ULLONG_MAX / 1024 ||
+                limit > ULLONG_MAX / 1024 ) {
                 virReportSystemError(VIR_ERR_OVERFLOW,
                                      _("%s"),
                                      "Unable to parse quota");
-- 
1.7.10.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[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]