vmware: use hotPlugMemoryIncrementSize only for valid value (#4348)

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
Abhishek Kumar 2020-10-14 16:05:57 +05:30 committed by GitHub
parent 40724e66e8
commit 5b419b90d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1634,7 +1634,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
}
// Check increment is multiple of increment size
long reminder = requestedMaxMemoryInMb % hotaddIncrementSizeInMb;
long reminder = hotaddIncrementSizeInMb > 0 ? requestedMaxMemoryInMb % hotaddIncrementSizeInMb : 0;
if (reminder != 0) {
requestedMaxMemoryInMb = requestedMaxMemoryInMb + hotaddIncrementSizeInMb - reminder;
}