Omer Frenkel has uploaded a new change for review.

Change subject: core: fix sound device check when adding devices from ovf 
(#1004066)
......................................................................

core: fix sound device check when adding devices from ovf (#1004066)

When creating vm from ovf, there is a check to add sound device to the
vm if it doesn't exist and needed.
the existence check was wrong as it used 'device' compared with 'type'.

this patch fix the check to use the correct fields (type).

Change-Id: I117c18f95db1ed672f6d0a8c4ff5c003d3fb6d4a
Signed-off-by: Omer Frenkel <[email protected]>
Bug-Url: https://bugzilla.redhat.com/1004066
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/VmDeviceCommonUtils.java
2 files changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/77/19677/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 0274c65..535aee8 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
@@ -769,7 +769,7 @@
             if (vmDevice.getDevice().equals(VmDeviceType.CDROM.getName())){
                 hasCD = true;
             }
-            if (vmDevice.getDevice().equals(VmDeviceType.SOUND.getName())){
+            if (VmDeviceCommonUtils.isSound(vmDevice)) {
                 hasSoundCard = true;
             }
             vmDeviceToAdd.add(vmDevice);
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/VmDeviceCommonUtils.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/VmDeviceCommonUtils.java
index c766b9f..8622f40 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/VmDeviceCommonUtils.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/VmDeviceCommonUtils.java
@@ -38,6 +38,10 @@
                 && device.getDevice().equals(VmDeviceType.CDROM.getName());
     }
 
+    public static boolean isSound(VmDevice device) {
+        return device.getType() == VmDeviceGeneralType.SOUND;
+    }
+
     /**
      * updates given devices boot order
      *


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

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

Reply via email to