Vitor de Lima has uploaded a new change for review.

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=1075102
Signed-off-by: Vitor de Lima <[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/17/25617/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 25bc3a8..cd9d4c6 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
@@ -294,6 +294,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/25617
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.4
Gerrit-Owner: Vitor de Lima <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to