Yair Zaslavsky has posted comments on this change.

Change subject: DO NOT SUBMIT api: Adding support for clone vm from snapshot
......................................................................


Patch Set 24: (5 inline comments)

....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmsResource.java
Line 97:         if (vm.isSetSnapshots() && 
!getSnapshotId(vm.getSnapshots()).equals(Guid.Empty.toString())) {
If i remove the check for snapshotId ==  Guid.Empty this means that backend 
will be able to receive such snapshotId. This fine by me (by passing an empty 
GUID, backend will fail on snapshot does not exist can do action).
The code you suggested is included in getSnapshotId.

I will fix like this
vm.isSetSnapshots() && !vm.getSnapshots() != null && 
!vm.getSnapshots().getSnapshots().isEmpty()

Line 113:                 getMapFromDisks(vm.getDisks());
Done

Line 134:     private void mapDisks(Disks from, Collection<DiskImage> to) {
correct. it will be removed.

Line 171:                 DiskImage diskImage = DiskMapper.map(disk, null);
1. Done
2. It's more complex than that, REST-API should send backend only the merged 
DIskImages (as you stated about the merging) for the images that were passed by 
the API-Caller. For example: Let's say the configuration has 6 images, but the 
user provided only two Disks in API - there should be a merge between the data 
of these two disks, and the matching data in the configuration, and only these 
two disk images will be sent. The reason for that is that at backend, for 
images that are not provided by client side, we have a different treatment (we 
"merge" them with another source of information - with information from the 
ancestral image).

Line 181:         Guid sourceSnapshotId = 
Guid.createGuidFromString(snapshots.getSnapshots().get(0).getId());
Done

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie8b8285cfe193a1d501c28af042021f4649bc299
Gerrit-PatchSet: 24
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: [email protected]
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to