mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-27 18:03:50 +03:00
util: fix a integer boundary error
A value which is equal to a integer maximum such as LLONG_MAX is a valid integer value. The patch fix the following error: 1, virsh memtune vm --swap-hard-limit -1 2, virsh start vm In debug mode, it shows error like: virScaleInteger:1813 : numerical overflow:\ value too large: 9007199254740991KiB
This commit is contained in:
parent
7fc4864a3a
commit
b38a040a29
@ -1809,7 +1809,7 @@ virScaleInteger(unsigned long long *value, const char *suffix,
|
||||
}
|
||||
}
|
||||
|
||||
if (*value && *value >= (limit / scale)) {
|
||||
if (*value && *value > (limit / scale)) {
|
||||
virReportError(VIR_ERR_OVERFLOW, _("value too large: %llu%s"),
|
||||
*value, suffix);
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user