Maor Lipchuk has posted comments on this change.

Change subject: core: Introduce restore all cinder snapshots command.
......................................................................


Patch Set 3:

(3 comments)

I moved the RestoreFromCinderSnapshot to another patch

https://gerrit.ovirt.org/#/c/42338/3/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/RestoreFromCinderSnapshotCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/RestoreFromCinderSnapshotCommand.java:

Line 55:         case REGULAR:
Line 56:             List<DiskImage> cinderSnapshots = 
getDiskImageDao().getAllSnapshotsForParent(getParameters().getImageId());
Line 57:             for (DiskImage descendantSnapshot : cinderSnapshots) {
Line 58:                 Snapshot snap = 
getSnapshotDao().get(descendantSnapshot.getVmSnapshotId());
Line 59:                 // Find snapshots which relies on the snapshot and 
needs to be removed.
> 1. move comment to line 57
done, and also extract the method
Line 60:                 if (snap.getType() == SnapshotType.REGULAR) {
Line 61:                     CinderDisk lastParentToRemove =
Line 62:                             (CinderDisk) 
ImagesHandler.getSnapshotLeaf(descendantSnapshot.getImageId());
Line 63:                     if (lastParentToRemove != null) {


Line 62:                             (CinderDisk) 
ImagesHandler.getSnapshotLeaf(descendantSnapshot.getImageId());
Line 63:                     if (lastParentToRemove != null) {
Line 64:                         
getParameters().setCinderDiskToBeRemoved(lastParentToRemove);
Line 65:                         
getParameters().setDestinationImageId(lastParentToRemove.getImageId());
Line 66:                         
getCinderBroker().deleteVolumeUnknownType(lastParentToRemove);
> to make it clearer, maybe change this method to 'deleteVolumeByClassificati
Done, in a sepereate patch
Line 67:                         if 
(!cinderSnapshot.getImageId().equals(lastParentToRemove.getImageId())) {
Line 68:                             getParameters().setRemoveParent(true);
Line 69:                         }
Line 70:                     }


Line 94:                 new SubjectEntity(VdcObjectType.Storage, 
cinderDisk.getStorageIds().get(0)));
Line 95:         try {
Line 96:             return future.get();
Line 97:         } catch (InterruptedException | ExecutionException e) {
Line 98:             e.printStackTrace();
> add log..
Done
Line 99:         }
Line 100:         return null;
Line 101:     }
Line 102: 


-- 
To view, visit https://gerrit.ovirt.org/42338
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3189bd1c586957800eb5784877cd605ae9f847fc
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to