Maor Lipchuk has posted comments on this change.

Change subject: core: throw canDo if no space for stateless VM snapshots 
(#852647)
......................................................................


Patch Set 3: (2 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmRunHandler.java
Line 192:         Integer minSnapshotSize = Config.<Integer> 
GetValue(ConfigValues.InitStorageSparseSizeInGB);
Line 193:         for (storage_domains domain : map.keySet()) {
Line 194:             if (!StorageDomainSpaceChecker.hasSpaceForRequest(domain,
Line 195:                     minSnapshotSize * map.get(domain))) {
Line 196:                 log.error("not enough space to create snapshot on 
domain {0}" + domain.getId());
You should use here errorFormat instead error and "...{0}",domain.getId" 
instead "{0}" + domain.getId()"
Line 197:                 return false;
Line 198:             }
Line 199:         }
Line 200:         return true;


Line 207:      * @return
Line 208:      */
Line 209:     public Map<storage_domains, Integer> 
mapStorageDomainsToNumOfDisks(VM vm) {
Line 210:         Map<storage_domains, Integer> map = new 
HashMap<storage_domains, Integer>();
Line 211:         for (Disk disk : getPluggedDisks(vm)) {
Consider using ImagesHandler.filterImageDisks with the disks.
Line 212: 
Line 213:             if (disk.isAllowSnapshot()) {
Line 214:                 for (storage_domains domain : 
getStorageDomainDAO().getAllStorageDomainsByImageId(((DiskImage) 
disk).getImageId())) {
Line 215:                     map.put(domain, map.containsKey(domain) ? 
Integer.valueOf(map.get(domain) + 1) : Integer.valueOf(1));


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie15cce8ded9172f37be28fd8b3d7b299628ee43e
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Roy Golan <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to