Hello Vitor de Lima,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/33885

to review the following change.

Change subject: core, engine: Avoid creating the CD device multiple times
......................................................................

core, engine: Avoid creating the CD device multiple times

When there are more than one device attached to the blank template, the
AddVmCommand creates multiple CD devices which conflict with each other.
This change fixes this issue, but still assumes that the blank template
has at least one device attached to it.

Change-Id: Iff3c5a34dd0fe6cfb6b4ab3bc77d34c4c0b57939
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1149637
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1075102
Signed-off-by: Vitor de Lima <[email protected]>
Signed-off-by: Omer Frenkel <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/85/33885/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java
index c2b280e..6e2c1ab 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java
@@ -297,6 +297,8 @@
                 if (addCD) {
                     setCdPath(specParams, "", isoPath);
                     addManagedDevice(new VmDeviceId(Guid.newGuid(), dstId) , 
VmDeviceGeneralType.DISK, VmDeviceType.CDROM, specParams, true, true, null);
+                    hasAlreadyCD = true;
+                    addCD = false;
                 }
                 // updating USB slots
                 updateUSBSlots(null, vmBase);


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff3c5a34dd0fe6cfb6b4ab3bc77d34c4c0b57939
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Vitor de Lima <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to