Martin Peřina has uploaded a new change for review.

Change subject: core: Fixes device type for spicevmc device
......................................................................

core: Fixes device type for spicevmc device

Reverts device type for spicevmc device from CHANNEL back to REDIR.

Change-Id: Ib68926ef6c7a09dac7a1a98fa13c30e18f1c72e4
Bug-Url: https://bugzilla.redhat.com/984586
Signed-off-by: Martin Perina <[email protected]>
---
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/businessentities/VmDeviceGeneralType.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/VmDeviceCommonUtils.java
M 
backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/customprop/DevicePropertiesUtilsTest.java
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
5 files changed, 12 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/68/17268/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 c2dc05f..9a31344 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
@@ -8,6 +8,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+
 import org.apache.commons.lang.StringUtils;
 import org.ovirt.engine.core.bll.VmHandler;
 import org.ovirt.engine.core.bll.network.VmInterfaceManager;
@@ -830,7 +831,7 @@
     private static void addUsbSlots(VmBase vm, int numOfSlots) {
         for (int index = 1; index <= numOfSlots; index++) {
             VmDeviceUtils.addManagedDevice(new VmDeviceId(Guid.newGuid(), 
vm.getId()),
-                    VmDeviceGeneralType.CHANNEL,
+                    VmDeviceGeneralType.REDIR,
                     VmDeviceType.SPICEVMC,
                     getUsbSlotSpecParams(),
                     true,
@@ -884,7 +885,7 @@
     }
 
     private static List<VmDevice> getUsbRedirectDevices(VmBase vm) {
-        List<VmDevice> list = 
dao.getVmDeviceByVmIdTypeAndDevice(vm.getId(),VmDeviceGeneralType.CHANNEL, 
VmDeviceType.SPICEVMC.getName());
+        List<VmDevice> list = 
dao.getVmDeviceByVmIdTypeAndDevice(vm.getId(),VmDeviceGeneralType.REDIR, 
VmDeviceType.SPICEVMC.getName());
 
         return list;
     }
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmDeviceGeneralType.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmDeviceGeneralType.java
index 0afa012..ec43b88 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmDeviceGeneralType.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmDeviceGeneralType.java
@@ -37,9 +37,9 @@
     BALLOON,
 
     /**
-     * A host-guest communication channel
+     * USB device redirection
      */
-    CHANNEL,
+    REDIR,
 
     /**
      * A console device
@@ -142,7 +142,7 @@
 
             case REDIR:
             case SPICEVMC:
-                type = CHANNEL;
+                type = REDIR;
                 break;
 
             case SMARTCARD:
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 206f7bd..461a2eb 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
@@ -281,7 +281,7 @@
     public static boolean isSpecialDevice(String device, VmDeviceGeneralType 
type) {
         return (VmDeviceGeneralType.SOUND == type || 
VmDeviceType.USB.getName().equals(device)
                 || (VmDeviceType.SMARTCARD.getName().equals(device) && 
VmDeviceGeneralType.SMARTCARD == type)
-                || (VmDeviceType.SPICEVMC.getName().equals(device) && 
VmDeviceGeneralType.CHANNEL == type)
+                || (VmDeviceType.SPICEVMC.getName().equals(device) && 
VmDeviceGeneralType.REDIR == type)
                 || (VmDeviceType.MEMBALLOON.getName().equals(device) && 
VmDeviceGeneralType.BALLOON == type))
                 || (VmDeviceType.WATCHDOG.getName().equals(device) && 
VmDeviceGeneralType.WATCHDOG == type);
     }
diff --git 
a/backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/customprop/DevicePropertiesUtilsTest.java
 
b/backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/customprop/DevicePropertiesUtilsTest.java
index a1a365c..4fb8f09 100644
--- 
a/backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/customprop/DevicePropertiesUtilsTest.java
+++ 
b/backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/customprop/DevicePropertiesUtilsTest.java
@@ -189,7 +189,7 @@
                 + "{type=sound;prop={volume=[0-9]{1,2}}};"
                 + "{type=controller;prop={hotplug=^(true|false)$}};"
                 + "{type=balloon;prop={max_size=[0-9]{1,15})}};"
-                + "{type=channel;prop={auth_type=^(plain|md5|kerberos)$)}};"
+                + "{type=redir;prop={auth_type=^(plain|md5|kerberos)$)}};"
                 + "{type=console;prop={type=^(text|vnc)$}};"
                 + "{type=smartcard;prop={version=([1-9]{1}).([0-9]{1})}}";
         DevicePropertiesUtils utils = DevicePropertiesUtils.getInstance();
@@ -299,7 +299,7 @@
                 + "{type=sound;prop={volume=[0-9]{1,2}}};"
                 + "{type=controller;prop={hotplug=^(true|false)$}};"
                 + "{type=balloon;prop={max_size=[0-9]{1,15}}};"
-                + "{type=channel;prop={auth_type=^(plain|md5|kerberos)$}};"
+                + "{type=redir;prop={auth_type=^(plain|md5|kerberos)$}};"
                 + "{type=console;prop={type=^(text|vnc)$;prop=\\{\\}}};"
                 + 
"{type=smartcard;prop={spec_chars=[\\@\\#\\$\\%\\^\\&\\*\\(\\)\\{\\}\\:\\<\\>\\,\\.\\?\\[\\]]?}}";
 
@@ -343,8 +343,8 @@
         validatePropertyMap(devProp, 1);
         validatePropertyPattern(devProp, "max_size", "[0-9]{1,15}");
 
-        // test channel properties
-        devProp = utils.getDeviceProperties(Version.v3_3, 
VmDeviceGeneralType.CHANNEL);
+        // test redir properties
+        devProp = utils.getDeviceProperties(Version.v3_3, 
VmDeviceGeneralType.REDIR);
         validatePropertyMap(devProp, 1);
         validatePropertyPattern(devProp, "auth_type", 
"^(plain|md5|kerberos)$");
 
diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
index 13e38ae..6063817 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
@@ -643,7 +643,7 @@
                 DbFacade.getInstance()
                         .getVmDeviceDao()
                         .getVmDeviceByVmIdTypeAndDevice(vm.getId(),
-                                VmDeviceGeneralType.CHANNEL,
+                                VmDeviceGeneralType.REDIR,
                                 VmDeviceType.SPICEVMC.getName());
         for (VmDevice vmDevice : vmDevices) {
             Map struct = new HashMap();


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib68926ef6c7a09dac7a1a98fa13c30e18f1c72e4
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Peřina <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to