Arik Hadas has posted comments on this change.

Change subject: core: Reorganize SD space validations in AddVm
......................................................................


Patch Set 2: Code-Review+1

(1 comment)

minor comment

http://gerrit.ovirt.org/#/c/26733/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java:

Line 334:      * Check if destination storage has enough space
Line 335:      * @return
Line 336:      */
Line 337:     protected boolean validateSpaceRequirements() {
Line 338:         for (Map.Entry<Guid, List<DiskImage>> sdImageEntry : 
storageToDisksMap.entrySet()) {
it is more efficient to iterate over the map that way, but as long as we don't 
need the 'value', only the 'key', how about iterating over the set of keys 
instead (to make the code more simple)?
Line 339:             StorageDomain destStorageDomain = 
destStorages.get(sdImageEntry.getKey());
Line 340:             StorageDomainValidator storageDomainValidator = 
createStorageDomainValidator(destStorageDomain);
Line 341:             if (!validateDomainsThreshold(storageDomainValidator) ||
Line 342:                 !validateFreeSpace(storageDomainValidator, 
destStorageDomain)) {


-- 
To view, visit http://gerrit.ovirt.org/26733
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I482709d7edb0333a6aa7b9ab723eea7f4c5a00d3
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Vered Volansky <vvola...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Tal Nisan <tni...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to