Tomas Jelinek has uploaded a new change for review.

Change subject: core: respect user preference on payload, smartcard and watchdog
......................................................................

core: respect user preference on payload, smartcard and watchdog

The payload, smardcard and watchdog were copied from the instance type if it
was selected all the time. Since this properties are no longer the "marked"
ones, we need to respect the user preference on them.

Change-Id: I1bc56e7b9f6e91431acb9345b4d87e9bfe145ee9
Bug-Url: https://bugzilla.redhat.com/1149663
Signed-off-by: Tomas Jelinek <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java
1 file changed, 6 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/62/35262/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java
index 710820c..c5d9e3e 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java
@@ -826,11 +826,9 @@
                     public Void runInTransaction() {
                         copyVmDevices();
                         addDiskPermissions();
-                        if (getInstanceType() == null) {
-                            addVmPayload();
-                            updateSmartCardDevices();
-                            addVmWatchdog();
-                        }
+                        addVmPayload();
+                        updateSmartCardDevices();
+                        addVmWatchdog();
                         setActionReturnValue(getVm().getId());
                         setSucceeded(true);
                         return null;
@@ -843,9 +841,10 @@
     }
 
     private void updateSmartCardDevices() {
-        // if vm smartcard settings is different from template's
+        // if vm smartcard settings is different from device source's
         // add or remove the smartcard according to user request
-        if (getVm().isSmartcardEnabled() != 
getVmTemplate().isSmartcardEnabled()) {
+        boolean smartcardOnDeviceSource = getInstanceTypeId() != null ? 
getInstanceType().isSmartcardEnabled() : getVmTemplate().isSmartcardEnabled();
+        if (getVm().isSmartcardEnabled() != smartcardOnDeviceSource) {
             VmDeviceUtils.updateSmartcardDevice(getVm().getId(), 
getVm().isSmartcardEnabled());
         }
     }


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1bc56e7b9f6e91431acb9345b4d87e9bfe145ee9
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Tomas Jelinek <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to