From 795a866e2b96a3cf6ce8943bd77e43013caf46e9 Mon Sep 17 00:00:00 2001 From: Jason Andryuk Date: Mon, 24 Oct 2022 13:28:01 -0400 Subject: [PATCH 1/2] xenmgr: Remove idle time polling xenmgr is polling com.citrix.xenclient.input the "idle time" every 30 seconds. vGlass just returns 0 for this. There is a separate idle signal and xcpmd can use that to implement shutdown. Just remove this now unused code from xenmgr. A side effect of this removal is that xenmgr will no longer print errors from the failed DBus calls in console mode (runlevel 3). Signed-off-by: Jason Andryuk --- xenmgr/Main.hs | 9 +-------- xenmgr/XenMgr/Connect/InputDaemon.hs | 8 -------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/xenmgr/Main.hs b/xenmgr/Main.hs index b7a4edf7..a33a6021 100644 --- a/xenmgr/Main.hs +++ b/xenmgr/Main.hs @@ -233,20 +233,13 @@ periodics xm_context rpccontext = -- The list of actions we run periodically actions = [ - (30000, checkStorage),(30000, void $ rpc rpccontext (hostMonitorIdleness xm_context) )-- every 30 secs checks amount of free space on storage partition and idle time of host + (30000, checkStorage)-- every 30 secs checks amount of free space on storage partition ] checkStorage = do rpc rpccontext hostCheckFreeStorage return () -hostMonitorIdleness :: XmContext -> Rpc () -hostMonitorIdleness xm_context = do - idle_time <- fromIntegral <$> inputGetIdleTime - idle_time_threshold <- appIdleTimeThreshold - when (idle_time_threshold /= 0 && idle_time >= idle_time_threshold ) $ - runXM xm_context hostSleep - exposeStuff :: XM () exposeStuff = do testingCtx <- liftIO $ testingCreateContext diff --git a/xenmgr/XenMgr/Connect/InputDaemon.hs b/xenmgr/XenMgr/Connect/InputDaemon.hs index 64fa9fe5..18589aa1 100644 --- a/xenmgr/XenMgr/Connect/InputDaemon.hs +++ b/xenmgr/XenMgr/Connect/InputDaemon.hs @@ -24,7 +24,6 @@ module XenMgr.Connect.InputDaemon ( , inputAuthSetContextFlags , inputOnSignal , inputGetFocusedDomainID - , inputGetIdleTime , inputSwitchFocus , inputLock , inputUpdateSeamlessMouseSettings @@ -85,10 +84,3 @@ inputDaemon = Proxy inputDaemonObj $ fromString "com.citrix.xenclient.input" where inputDaemonObj = RemoteObject (fromString "com.citrix.xenclient.input") (fromString "/") - -inputGetIdleTime :: Rpc (Int32) -inputGetIdleTime = call comCitrixXenclientInputGetIdleTime - - - - From 641bf5b68b76ff630ac85bfd9d69133164aea3cb Mon Sep 17 00:00:00 2001 From: Jason Andryuk Date: Mon, 24 Oct 2022 13:46:37 -0400 Subject: [PATCH 2/2] xenmgr: Remove config.ui idle-time-threshold property xenmgr no longer acts on the idle time, xcpmd is supposed to handle that. This is no longer used and can be removed. However, the the UI still queries this. Make it just return 0 and drop writes. Later on the UI can remove the use and this can be removed here and from the IDL. Signed-off-by: Jason Andryuk --- xenmgr/XenMgr/Config.hs | 11 ----------- xenmgr/XenMgr/Expose/XenmgrObject.hs | 4 ++-- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/xenmgr/XenMgr/Config.hs b/xenmgr/XenMgr/Config.hs index 8afe5dcd..228c7597 100644 --- a/xenmgr/XenMgr/Config.hs +++ b/xenmgr/XenMgr/Config.hs @@ -27,7 +27,6 @@ module XenMgr.Config , appSvmAutoStartDelay , appOverwriteServiceVmSettings , appXcDiagTimeout - , appIdleTimeThreshold , appArgoHostsFile , appMultiGpuPt , appSeamlessTrafficDefault @@ -43,7 +42,6 @@ module XenMgr.Config , appSetSvmAutoStartDelay , appSetOverwriteServiceVmSettings , appSetXcDiagTimeout - , appSetIdleTimeThreshold , appSetArgoHostsFile , appSetPlatformCryptoKeyDirs , appConfigurableSaveChangesAcrossReboots @@ -169,15 +167,6 @@ appXcDiagTimeout = appSetXcDiagTimeout :: Int -> Rpc () appSetXcDiagTimeout to = dbWrite "/xenmgr/xc-diag-timeout" to --- defaults to 0s -appIdleTimeThreshold :: Rpc Int -appIdleTimeThreshold = - dbMaybeRead "/xenmgr/idle-time-threshold" >>= return . fromMaybe 0 - -appSetIdleTimeThreshold :: Int -> Rpc () -appSetIdleTimeThreshold to = dbWrite "/xenmgr/idle-time-threshold" to - - -- Should we be updating /etc/hosts with argo addresses. defaults to true appArgoHostsFile :: Rpc Bool appArgoHostsFile = dbMaybeRead "/xenmgr/argo-hosts-file" >>= return . fromMaybe True diff --git a/xenmgr/XenMgr/Expose/XenmgrObject.hs b/xenmgr/XenMgr/Expose/XenmgrObject.hs index 2aa07b9f..6ed410f4 100644 --- a/xenmgr/XenMgr/Expose/XenmgrObject.hs +++ b/xenmgr/XenMgr/Expose/XenmgrObject.hs @@ -100,8 +100,8 @@ implementation xm testingCtx = , comCitrixXenclientXenmgrConfigGetBypassSha1sumChecks = appBypassSha1SumChecks , comCitrixXenclientXenmgrConfigGetXcDiagTimeout = fromIntegral <$> appXcDiagTimeout , comCitrixXenclientXenmgrConfigSetXcDiagTimeout = \t -> appSetXcDiagTimeout (fromIntegral t) >> cc - , comCitrixXenclientXenmgrConfigUiGetIdleTimeThreshold = fromIntegral <$> appIdleTimeThreshold - , comCitrixXenclientXenmgrConfigUiSetIdleTimeThreshold = \t -> appSetIdleTimeThreshold (fromIntegral t) >> cc + , comCitrixXenclientXenmgrConfigUiGetIdleTimeThreshold = return 0 + , comCitrixXenclientXenmgrConfigUiSetIdleTimeThreshold = \t -> return () >> cc , comCitrixXenclientXenmgrConfigGetPlatformCryptoKeyDirs = appGetPlatformCryptoKeyDirs , comCitrixXenclientXenmgrConfigSetPlatformCryptoKeyDirs = \v -> appSetPlatformCryptoKeyDirs v >> cc , comCitrixXenclientXenmgrConfigGetGuestOnlyNetworking = appGetGuestOnlyNetworking