Sergey Gotliv has posted comments on this change.

Change subject: engine: Removes not used image groups after snapshot removal
......................................................................


Patch Set 2:

(4 comments)

....................................................
Commit Message
Line 3: AuthorDate: 2013-08-26 15:35:03 +0300
Line 4: Commit:     Sergey Gotliv <sgot...@redhat.com>
Line 5: CommitDate: 2013-09-01 15:34:39 +0300
Line 6: 
Line 7: engine: Removes not used image groups after snapshot removal
Done
Line 8: 
Line 9: Change-Id: I07928bc8ff4225055586b96e47d3787d741a95b4
Line 10: Bug-Url: https://bugzilla.redhat.com/987994


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestoreAllSnapshotsCommand.java
Line 158:             }
Line 159:         }
Line 160:     }
Line 161: 
Line 162:     private void removeNotUsedImageGroups() {
I will change it to "removeUnusedImages".
Line 163:         Set<Guid> imageGroupIdsUsedByActiveSnapshot = new HashSet<>();
Line 164:         for (DiskImage diskImage : getImagesList()) {
Line 165:             imageGroupIdsUsedByActiveSnapshot.add(diskImage.getId());
Line 166:         }


Line 170:             List<DiskImage> snapshotDiskImages = 
getDiskImageDao().getAllSnapshotsForVmSnapshot(snapshotToRemove);
Line 171:             imageGroupsToRemove.addAll(snapshotDiskImages);
Line 172:         }
Line 173: 
Line 174:         Set<Guid> removeInProcessImageGroupsIds = new HashSet<>();
Done
Line 175:         for (DiskImage diskImage : imageGroupsToRemove) {
Line 176:             if 
(imageGroupIdsUsedByActiveSnapshot.contains(diskImage.getId()) ||
Line 177:                     
removeInProcessImageGroupsIds.contains(diskImage.getId())) {
Line 178:                 continue;


Line 177:                     
removeInProcessImageGroupsIds.contains(diskImage.getId())) {
Line 178:                 continue;
Line 179:             }
Line 180: 
Line 181:             // This command responsible to delete the entire image 
group
I am removing that comment. I think and hope renaming, as you suggested in the 
previous comments will do the job.
Line 182:             VdcReturnValueBase retValue = 
runAsyncTask(VdcActionType.RemoveImage,
Line 183:                     new 
RemoveImageParameters(diskImage.getImageId()));
Line 184: 
Line 185:             if (retValue.getSucceeded()) {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I07928bc8ff4225055586b96e47d3787d741a95b4
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sergey Gotliv <sgot...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: Sergey Gotliv <sgot...@redhat.com>
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