Maor Lipchuk has posted comments on this change.

Change subject: core: Add snapshot validation for empty guid.
......................................................................


Patch Set 2: (1 inline comment)

I see what you are saying, although I'm not sure how this will affect other 
operations (for example, how will you know which snapshot id to assign for each 
image if the VM has many snapshots)
Also this is a bug caused by virt-v2v, we might encounter other bugs but we 
can't protect all the scenarios that could happened.

for now, this fix improves and prevent the VM to be corrupted when previewing a 
snapshot and also importing it.
another patch might be considered, but I prefer not to block this fix because 
of that, since it will be too risky IMHO.

The virt-v2v bug was fixed.

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateCommand.java
Line 116:                 getVmTemplate().setImages(images);
Line 117:                 ensureDomainMap(getParameters().getImages(), 
getParameters().getDestDomainId());
Line 118:                 Map<Guid, DiskImage> imageMap = new HashMap<Guid, 
DiskImage>();
Line 119:                 for (DiskImage image : images) {
Line 120:                     if (Guid.Empty.equals(image.getVmSnapshotId())) {
because images could not be empty, the vm snapshot id here is the active 
snapshot and not the snapshot itself
Line 121:                         retVal = 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CORRUPTED_VM_SNAPSHOT_ID);
Line 122:                         break;
Line 123:                     }
Line 124: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I19bc2982adecca198f8dc38ca011f4528dd58db9
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Cheryn Tan <cheryn...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Liron Ar <lara...@redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: Tal Nisan <tni...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to