Sergey Gotliv has posted comments on this change.
Change subject: core: Verifying storage space for AddDiskCommand
......................................................................
Patch Set 6: Code-Review+1
(3 comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/StorageDomainValidator.java
Line 85: double totalSizeForDisks = 0.0;
Line 86:
Line 87: for (DiskImage diskImage : diskImages) {
Line 88: double sizeForDisk = diskImage.getSize(); //This is disk
capacity
Line 89:
If you think that disk capacity is better describes this variable so name it
diskCapacity, but this comment here is obvious.
Line 90: if (diskImage.getVolumeFormat() == VolumeFormat.COW) {
Line 91: if (storageDomain.getStorageType().isFileDomain()) {
Line 92: sizeForDisk = EMPTY_QCOW_HEADER_SIZE;
Line 93: } else {
Line 106: return hasSpaceForNewDisks(Collections.singleton(diskImage));
Line 107: }
Line 108:
Line 109: private ValidationResult validateRequiredSpace(double
availableSize, double sizeToCompare) {
Line 110: if (availableSize >= sizeToCompare) {
I would rename sizeToCompare to requiredSize, I think that:
(double available, double required) will be even better.
Line 111: return ValidationResult.VALID;
Line 112: }
Line 113:
Line 114: return new
ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN,
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/DiskImage.java
Line 279:
Line 280: @JsonIgnore
Line 281: public double getActualDiskWithSnapshotsSizeInBytes() {
Line 282: return getActualDiskWithSnapshotsSize() * 1024L * 1024L *
1024L;
Line 283: }
Please, use SizeConverter.BYTES_IN_GB
Line 284:
Line 285: /**
Line 286: * This method is created for SOAP serialization of primitives
that are read only but sent by the client. The setter
Line 287: * implementation is empty and the field is not being changed.
--
To view, visit http://gerrit.ovirt.org/15377
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I1a33502683ec77fba09efffba1438beb552082f7
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Vered Volansky <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: Vered Volansky <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches