From e9b6c0699b24f9f15aa26f9a959f3b3237ab1672 Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Thu, 14 Nov 2013 12:33:02 +0000 Subject: [PATCH] CP-6137: Work in Console tab for vGPU (PR-1675) # HG changeset patch # User Mihaela Stoica # Date 1384254998 0 # Tue Nov 12 11:16:38 2013 +0000 # Node ID 6b3fc3d7a54e58e92ecfe714d19c8dc26b7a0565 # Parent 2cc90cb50e7ff2566f9d0833ad17735922d3f0c9 - Only close the inactive VNC consoles (not RDP) after an interval Signed-off-by: Konstantina Chremmou --- XenAdmin/ConsoleView/VNCTabView.cs | 4 ++++ XenAdmin/ConsoleView/VNCView.cs | 5 +++++ XenAdmin/Controls/ConsolePanel.cs | 10 +++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/XenAdmin/ConsoleView/VNCTabView.cs b/XenAdmin/ConsoleView/VNCTabView.cs index 758aa8621..338498ae2 100644 --- a/XenAdmin/ConsoleView/VNCTabView.cs +++ b/XenAdmin/ConsoleView/VNCTabView.cs @@ -1367,5 +1367,9 @@ namespace XenAdmin.ConsoleView vncScreen.Source.HasGPUPassthrough && vncScreen.Source.power_state == vm_power_state.Running; } + internal bool IsVNC + { + get { return vncScreen.UseVNC; } + } } } diff --git a/XenAdmin/ConsoleView/VNCView.cs b/XenAdmin/ConsoleView/VNCView.cs index 910efb73b..7295c3bda 100644 --- a/XenAdmin/ConsoleView/VNCView.cs +++ b/XenAdmin/ConsoleView/VNCView.cs @@ -259,5 +259,10 @@ namespace XenAdmin.ConsoleView { vncTabView.setupCD(); } + + internal bool IsVNC + { + get { return vncTabView.IsVNC; } + } } } diff --git a/XenAdmin/Controls/ConsolePanel.cs b/XenAdmin/Controls/ConsolePanel.cs index 9b1fe811f..5605fe456 100644 --- a/XenAdmin/Controls/ConsolePanel.cs +++ b/XenAdmin/Controls/ConsolePanel.cs @@ -316,6 +316,14 @@ namespace XenAdmin.Controls activeVMConsoles.Remove(source); } + public void closeVNCForSource(VM source, bool vncOnly) + { + if (!vncViews.ContainsKey(source) || vncViews[source] == null + || (vncOnly && !vncViews[source].IsVNC)) + return; + closeVNCForSource(source); + } + public bool isVNCPausedForSource(VM source) { Program.AssertOnEventThread(); @@ -445,7 +453,7 @@ namespace XenAdmin.Controls try { log.DebugFormat("ConsolePanel: closeVNCForSource({0}) in delegate", vm.Name); - closeVNCForSource(vm); + closeVNCForSource(vm, true); } catch (Exception exception) {