nvazquez commented on a change in pull request #3553: [WIP] [DO NOT MERGE] CloudStack Backup & Recovery Framework URL: https://github.com/apache/cloudstack/pull/3553#discussion_r357927586
########## File path: engine/schema/src/main/java/com/cloud/storage/dao/DiskOfferingDaoImpl.java ########## @@ -132,6 +143,38 @@ public DiskOfferingVO persistDeafultDiskOffering(DiskOfferingVO offering) { } } + protected long getClosestDiskSizeInGB(long sizeInBytes) { + if (sizeInBytes < 0) { + throw new CloudRuntimeException("Disk size should be greater than 0 bytes, received: " + sizeInBytes + " bytes"); + } + long div = sizeInBytes / GB_UNIT_BYTES; + long rest = sizeInBytes % GB_UNIT_BYTES; + return rest == 0L ? div : div + 1; Review comment: Can't this be simplified using Math.ceil()? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services