Maor Lipchuk has uploaded a new change for review.

Change subject: core: Enhance for loop at import VM.
......................................................................

core: Enhance for loop at import VM.

The for loop in the import VM commands iterates over the volumes of
the image, besides the last one.
this behaviour is not logic and error prone, all volumes of the image
should be set with the same disk id

Change-Id: Ieea897d1350355e28f379bec5a5ab5d3d06231fe
Signed-off-by: Maor Lipchuk <mlipc...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/54/17154/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java
index 9ac6e8f..16d0180 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java
@@ -849,8 +849,8 @@
         newDiskIdForDisk.put(newGuidForDisk, DiskImage.copyOf(disk));
         disk.setId(newGuidForDisk);
         disk.setImageId(Guid.newGuid());
-        for (int i = 0; i < diskList.size() - 1; i++) {
-             diskList.get(i).setId(disk.getId());
+        for (DiskImage diskImage : diskList) {
+            diskImage.setId(disk.getId());
         }
     }
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieea897d1350355e28f379bec5a5ab5d3d06231fe
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to