Frank Kobzik has uploaded a new change for review.

Change subject: engine: Fix spice secure channels treatment
......................................................................

engine: Fix spice secure channels treatment

This patch enables using secure channels in SPICE .vv file ('Native'
SPICE invocation).

Also the deprecated channel names (prefixed by 's') are corrected in the
database.

Change-Id: I6eadb0b1bae92ec6d49fc5459e4cec68c8ec2e49
Signed-off-by: Frantisek Kobzik <[email protected]>
---
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceNativeImpl.java
A packaging/dbscripts/upgrade/03_04_0200_rename_deprecated_spice_channels.sql
2 files changed, 26 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/92/22292/1

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceNativeImpl.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceNativeImpl.java
index b7ca3b1..0ceee69 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceNativeImpl.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceNativeImpl.java
@@ -77,9 +77,19 @@
             configBuilder.append("\nproxy=").append(getSpiceProxy()); 
//$NON-NLS-1$
         }
 
+        if (!StringHelper.isNullOrEmpty(getSslChanels())) {
+            
configBuilder.append("\nsecure-channels=").append(formatSecureChannels(getSslChanels()));
 //$NON-NLS-1$
+        }
+
         ConsoleModel.makeConsoleConfigRequest("console.vv", 
"application/x-virt-viewer; charset=UTF-8", configBuilder.toString()); 
//$NON-NLS-1$ $NON-NLS-2$
     }
 
+    private static String formatSecureChannels(String sslChanels) {
+        return (sslChanels == null)
+                ? "" //$NON-NLS-1$
+                : sslChanels.replace(',', ';');
+    }
+
     @Override
     public void install() {
     }
diff --git 
a/packaging/dbscripts/upgrade/03_04_0200_rename_deprecated_spice_channels.sql 
b/packaging/dbscripts/upgrade/03_04_0200_rename_deprecated_spice_channels.sql
new file mode 100644
index 0000000..4bd3b01
--- /dev/null
+++ 
b/packaging/dbscripts/upgrade/03_04_0200_rename_deprecated_spice_channels.sql
@@ -0,0 +1,16 @@
+-- replaces deprecated channels (prefixed by 's') by their correct names
+update vdc_options set option_value =
+    
replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(
+            option_value, 'ssmartcard', 'smartcard'),
+        'susbredir', 'usbredir'),
+        'smain', 'main'),
+        'sdisplay','display'),
+        'sinputs', 'inputs'),
+        'scursor', 'cursor'),
+        'splayback', 'playback'),
+        'srecord', 'record'),
+        'stunnel', 'tunnel'),
+        'ssmartcard', 'smartcard'),
+        'susbredir', 'usbredir'),
+        'sport', 'port')
+    where option_name='SpiceSecureChannels';


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

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

Reply via email to