Maor Lipchuk has posted comments on this change.
Change subject: engine: Illegal images should be skipped when validating
duplicates
......................................................................
Patch Set 5:
(3 comments)
....................................................
Commit Message
Line 5: CommitDate: 2013-09-20 23:42:53 +0300
Line 6:
Line 7: engine: Illegal images should be skipped when validating duplicates
Line 8:
Line 9: Before starting to import VM from Template Engine validates that
Is it "import vm from template" or maybe it should be "import a VM or a
Template"?
Line 10: template images don't exist on the storage, if at least one of them
Line 11: exists its probably would be better to clone VM instead of import, just
Line 12: to prevent potential data loss. Engine assumes that its database
Line 13: correctly represents the storage so this validation is done against
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyTemplateCommand.java
Line 366: return true;
Line 367: }
Line 368:
Line 369: protected boolean validateNoDuplicateDiskImages(List<DiskImage>
diskImages) {
Line 370: List<String> existingLegalDisksAliases = new
ArrayList<String>();
U can use diamond in the ArrayList
Line 371: List<DiskImage> disksFromDB =
ImagesHandler.getDisksFromDB(diskImages);
Line 372:
Line 373: if (disksFromDB.isEmpty()) {
Line 374: return true;
Line 369: protected boolean validateNoDuplicateDiskImages(List<DiskImage>
diskImages) {
Line 370: List<String> existingLegalDisksAliases = new
ArrayList<String>();
Line 371: List<DiskImage> disksFromDB =
ImagesHandler.getDisksFromDB(diskImages);
Line 372:
Line 373: if (disksFromDB.isEmpty()) {
I think this condition is redundant, if the VM has no disks then we already
return true
Line 374: return true;
Line 375: }
Line 376:
Line 377: for (DiskImage disk : disksFromDB) {
--
To view, visit http://gerrit.ovirt.org/19246
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I7b43e4b4e8e04dfb644a33ea9ce2a474987c5e3c
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches