mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 20:45:18 +00:00
build: use correct limit for unsigned long long
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.
This commit is contained in:
parent
b1675bac67
commit
791d095235
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user