1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

M #-: Deal with Address Range resize to 0

(cherry picked from commit e8f1a7641cf36831bf5426b1d2f17120ab893d2a)
This commit is contained in:
Ruben S. Montero 2021-08-31 19:05:04 +02:00
parent 50b1504a79
commit b3aeef43df
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -446,7 +446,18 @@ int AddressRange::update_attributes(
return -1;
}
if (allocated.upper_bound(new_size-1) != allocated.end())
std::map<unsigned int, long long>::iterator it;
if ( new_size == 0 )
{
it = allocated.find(0);
}
else
{
it = allocated.upper_bound(new_size - 1);
}
if (it != allocated.end())
{
error_msg = "New SIZE cannot be applied. There are used leases"
" that would fall outside the range.";