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:
parent
50b1504a79
commit
b3aeef43df
@ -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.";
|
||||
|
Loading…
x
Reference in New Issue
Block a user