[xenmgr] Add idle shutdown specific call#197
Conversation
|
Related to OpenXT/xctools#74 and OpenXT/idl#45 |
| hostShutdown = (hostWhenIdleDoWithState HostShuttingDown $ executePmAction ActionShutdown) >> return () | ||
|
|
||
| hostShutdownIdle :: XM () | ||
| hostShutdownIdle = executePmAction ActionIdleShutdown >> return () |
There was a problem hiding this comment.
Above and below, the actions are prefixed with hostWhenIdleDoWithState. Is that intentional? I can see it being intentional since when ShutdownIdle is called, we don't want to wait on something else.
There was a problem hiding this comment.
Is that intentional?
Should be "Is not using hostWhenIdleDoWithState intentional?"
There was a problem hiding this comment.
The HostIdle xenmgr-ism is only set when going into host S3 (execute_ ActionSleep on line 345). hostWhenIdleDoWithState just does the action if the Host State is host-idle, updates the state, then immediately sets the state back to host-idle.
My guess the history here was some automatic Sleep request after being idle, but the current Idle system is now managed in the input part of Glass and xcpmd. We don't key off HostState for anything in this stack, so I'm not using the hostWhenIdleDoWithState method.
jandryuk
left a comment
There was a problem hiding this comment.
I built locally and an hostShutdownIdle worked - but it did not have to trigger the poweroff -ff
|
I pushed the physical power button on a machine. A Fedora VM decided to go to sleep, so the UI is spinning on Shutdown Down the Fedora VM. I added a shutdown idle rule to xcpmd to see And it keeps running. That was 20 minutes ago and the timeout has triggered multiple times. So something seems wrong with the |
|
hmmm. I'll look into this, might not get to it today though. |
36cccac to
755fc21
Compare
I rebased my branch and built on top of master-custom-73 (that post-xen4.16 merge build). I set the idle timeout to 1 minute and enabled idle shutdown, restarted xcpmd. Booted an HVM guest to network and killed its stubdom. After a minute I got the expected call and logs to xenmgr, and then 4 more times since the idle timeout was 1 minute long. Finally after 5 minutes you can see the log from the Did you ever see the message in your case? |
No The problem is roughly that a regular shutdown is in progress and hung. When the idle shutdown happens:
|
|
Ohhhhh that makes way more sense. Ok I'll come up with a fix for that. |
755fc21 to
6d915a5
Compare
|
Extra logic now basically allows the idle shutdown operation to always proceed no matter what PM action is in progress, other than itself (since we don't want it spawning more |
jandryuk
left a comment
There was a problem hiding this comment.
Looks good - thanks for fixing. The current log messages are awkward - I made some suggestions. What do you think about those?
6d915a5 to
71fcfd9
Compare
|
Thanks. I plan to merge the idle shutdown stuff tomorrow. |
Implement a separate function for handling the idle shutdown case. When the system has been idle for the specified idle period and no user input has been detected, shutdown the platform. Start a 5 minute timer that will force the host off if has not completed the shutdown process. If the idle timer feature is enabled, then the expected behavior is that the host will be shutdown. This commit ensures that the host will reach the off state in the event of a stuck guest VM or otherwise non- responding process when handling an idle shutdown within a reasonable amount of time. Signed-off-by: Chris Rogers <rogersc@ainfosec.com>
71fcfd9 to
53e9ad4
Compare
Implement a separate function for handling the idle shutdown
case. When the system has been idle for the specified idle period
and no user input has been detected, shutdown the platform. Start
a 5 minute timer that will force the host off if has not completed
the shutdown process.
If the idle timer feature is enabled, then the expected behavior is
that the host will be shutdown. This commit ensures that the host will
reach the off state in the event of a stuck guest VM or otherwise non-
responding process when handling an idle shutdown within a reasonable
amount of time.
Signed-off-by: Chris Rogers rogersc@ainfosec.com