Vered Volansky has posted comments on this change.

Change subject: core: Fix AddVm faulty storage allocation checks
......................................................................


Patch Set 3:

(1 comment)

http://gerrit.ovirt.org/#/c/26734/3/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmAndCloneImageCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmAndCloneImageCommand.java:

Line 303:         for (DiskImage diskImage : disksList) {
Line 304:             List<DiskImage> snapshots = 
getAllImageSnapshots(diskImage);
Line 305:             diskImage.getSnapshots().addAll(snapshots);
Line 306:         }
Line 307:         return 
validate(storageDomainValidator.hasSpaceForClonedDisks(disksList));
> Something is weird here.. I thought that when disk is cloned its snapshots 
The snapshots are collapsed, but when validating I don't know to which size. I 
know the absolute maximum is the sum of snapshots sizes, and for that I need to 
take them all into consideration. I also know it can't be more than the disk's 
capacity/virtual size. StorageDomainValidator takes this into consideration and 
takes the minimum between the two in hasSpaceForClonedDisks().
Checking only the actual size is the bug this patch is trying to fix (917682), 
using the uniform hasSpaceForClonedDisks, that was previously written in order 
to be embedded throughout the system.
Line 308:     }
Line 309: 
Line 310:     protected List<DiskImage> getAllImageSnapshots(DiskImage 
diskImage) {
Line 311:         return 
ImagesHandler.getAllImageSnapshots(diskImage.getImageId(), 
diskImage.getImageTemplateId());


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iff4ad246934b3b94f21ae602067033347c913780
Gerrit-PatchSet: 3
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: Vered Volansky <vvola...@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