Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions xenmgr/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 0 additions & 11 deletions xenmgr/XenMgr/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ module XenMgr.Config
, appSvmAutoStartDelay
, appOverwriteServiceVmSettings
, appXcDiagTimeout
, appIdleTimeThreshold
, appArgoHostsFile
, appMultiGpuPt
, appSeamlessTrafficDefault
Expand All @@ -43,7 +42,6 @@ module XenMgr.Config
, appSetSvmAutoStartDelay
, appSetOverwriteServiceVmSettings
, appSetXcDiagTimeout
, appSetIdleTimeThreshold
, appSetArgoHostsFile
, appSetPlatformCryptoKeyDirs
, appConfigurableSaveChangesAcrossReboots
Expand Down Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions xenmgr/XenMgr/Connect/InputDaemon.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ module XenMgr.Connect.InputDaemon (
, inputAuthSetContextFlags
, inputOnSignal
, inputGetFocusedDomainID
, inputGetIdleTime
, inputSwitchFocus
, inputLock
, inputUpdateSeamlessMouseSettings
Expand Down Expand Up @@ -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




4 changes: 2 additions & 2 deletions xenmgr/XenMgr/Expose/XenmgrObject.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down