Arik Hadas has uploaded a new change for review.

Change subject: core: fix single sign on for all guests
......................................................................

core: fix single sign on for all guests

This patch fix a problem that caused single-sign-on capability not to
work for some guests: vdsm sends the name of the guest agent application
in the applications list. the engine expects to receive RHEV-Agent as
the guest agent application name, but that's true only for guest agent
running on Windows and in d/s version.

This solution is:
1. set all the possible names for the guest agent application, on all
operating systems, in the configuration so that the engine will look for
all of them (instead of only RHEV-Agent).
2. set the relevant names of the guest agent application in u/s, in
ovirt's engine configuration.

Change-Id: If256ddda586eb53af0ca55d6b97dd98e10139d8a
Bug-Url: https://bugzilla.redhat.com/922398
Signed-off-by: Arik Hadas <aha...@redhat.com>
---
M backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmHandler.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
3 files changed, 13 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/67/13667/1

diff --git a/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql 
b/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql
index 42500eb..ea6fe0f 100644
--- a/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql
+++ b/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql
@@ -43,7 +43,7 @@
 select fn_db_add_config_value('AdvancedNFSOptionsEnabled','true','3.1');
 select fn_db_add_config_value('AdvancedNFSOptionsEnabled','true','3.2');
 select fn_db_add_config_value('AdvancedNFSOptionsEnabled','true','3.3');
-select fn_db_add_config_value('AgentAppName','RHEV-Agent','general');
+select 
fn_db_add_config_value('AgentAppName','ovirt-guest-agent-common,ovirt-guest-agent','general');
 select 
fn_db_add_config_value('AllowClusterWithVirtGlusterEnabled','true','general');
 select fn_db_add_config_value('AllowDuplicateMacAddresses','false','general');
 select fn_db_add_config_value('ApplicationMode','255','general');
@@ -602,6 +602,7 @@
 select fn_db_update_config_value('VmGracefulShutdownMessage','System 
Administrator has initiated shutdown of this Virtual Machine. Virtual Machine 
is shutting down.','general');
 select 
fn_db_update_config_value('DisconnectPoolOnReconstruct','0,2,3','general');
 select fn_db_update_config_value('SupportBridgesReportByVDSM','false','3.1');
+select 
fn_db_update_config_value('AgentAppName','ovirt-guest-agent-common,ovirt-guest-agent','general');
 
 
 
------------------------------------------------------------------------------------
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmHandler.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmHandler.java
index d9d0d72..8135389 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmHandler.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmHandler.java
@@ -303,21 +303,20 @@
         if (vm.getAppList() != null) {
             final String[] parts = vm.getAppList().split("[,]", -1);
             if (parts != null && parts.length != 0) {
-                final String agentAppName = Config.<String> 
GetValue(ConfigValues.AgentAppName);
+                final List<String> possibleAgentAppNames = 
Config.<List<String>> GetValue(ConfigValues.AgentAppName);
                 final Map<String, String> spiceDriversInGuest =
                         Config.<Map<String, String>> 
GetValue(ConfigValues.SpiceDriverNameInGuest);
                 final String spiceDriverInGuest =
                         
spiceDriversInGuest.get(ObjectUtils.toString(vm.getOs().getOsType()).toLowerCase());
 
                 for (final String part : parts) {
-                    if (StringUtils.containsIgnoreCase(part, agentAppName)) {
-                        vm.setGuestAgentVersion(GetApplicationVersion(part,
-                                agentAppName));
-                    }
-                    if (StringUtils.containsIgnoreCase(part,
-                            spiceDriverInGuest)) {
-                        vm.setSpiceDriverVersion(GetApplicationVersion(part,
-                                spiceDriverInGuest));
+                    for (String agentName : possibleAgentAppNames) {
+                        if (StringUtils.containsIgnoreCase(part, agentName)) {
+                            
vm.setGuestAgentVersion(GetApplicationVersion(part, agentName));
+                        }
+                        if (StringUtils.containsIgnoreCase(part, 
spiceDriverInGuest)) {
+                            
vm.setSpiceDriverVersion(GetApplicationVersion(part, spiceDriverInGuest));
+                        }
                     }
                 }
             }
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
index 467b9ab..83ff99e 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
@@ -380,8 +380,9 @@
     
@DefaultValueAttribute("1:pentium3:vmx:pentium3;2:intel-qemu64-nx:vmx,sse2:qemu64,-nx,+sse2;3:intel-qemu64:vmx,sse2,nx:qemu64,+sse2;2:amd-qemu64-nx:svm,sse2:qemu64,-nx,+sse2;3:amd-qemu64:svm,sse2,nx:qemu64,+sse2")
     ServerCPUList(130),
     @Reloadable
-    @TypeConverterAttribute(String.class)
-    @DefaultValueAttribute("RHEV-Agent")
+    @TypeConverterAttribute(java.util.List.class)
+    @DefaultValueAttribute("ovirt-guest-agent-common,ovirt-guest-agent")
+    @OptionBehaviourAttribute(behaviour = 
OptionBehaviour.CommaSeparatedStringArray)
     AgentAppName(132),
     @Reloadable
     @TypeConverterAttribute(Map.class)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If256ddda586eb53af0ca55d6b97dd98e10139d8a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <aha...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to