Arik Hadas has uploaded a new change for review.

Change subject: userportal: show the correct VM's console type
......................................................................

userportal: show the correct VM's console type

The console type presented in VMs lists at the user-portal (basic +
extended) is based on the default display type defined for the VMs,
which is not always right because VM can be run in Run-Once mode
with a display type which is different from the default.

This patch ensure that the right console type is displayed for each VM
in the user portal by changing the way the console type is determined -
if the VM is running then we determine the console type according to the
actual display type (presented by the display type field in VmDynamic),
and according to the default display type, as before, only if the VM is
not running.

Change-Id: I312cfec646c276038669526140d75452bfed8267
Bug-Url: https://bugzilla.redhat.com/907776
Signed-off-by: Arik Hadas <[email protected]>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/IUserPortalListModel.java
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/48/12748/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/IUserPortalListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/IUserPortalListModel.java
index 93e7578..f5ca6bc 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/IUserPortalListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/IUserPortalListModel.java
@@ -230,7 +230,8 @@
     }
 
     protected ConsoleModel determineConsoleModelFromVm(VM vm, 
ArrayList<ConsoleModel> cachedModels) {
-        return vm.getDefaultDisplayType() == DisplayType.vnc ? 
cachedModels.get(VNC_INDEX) : cachedModels.get(SPICE_INDEX);
+        DisplayType vmDisplayType = vm.isRunningOrPaused() ? 
vm.getDisplayType() : vm.getDefaultDisplayType();
+        return cachedModels.get(vmDisplayType == DisplayType.vnc ? VNC_INDEX : 
SPICE_INDEX);
     }
 
     protected void updateDefaultSelectedConsoleProtocol(VM vm) {


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

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

Reply via email to