summaryrefslogtreecommitdiffstats
path: root/src/ogRest.py
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-05-14 17:28:50 +0200
committerRoberto Hueso Gómez <rhueso@soleta.eu>2020-05-14 17:28:50 +0200
commit3c055d198d64aabdf2b1fd2a5da3e308577e6082 (patch)
treed239d53ca35ad60e6106372da0dfa208845a57ce /src/ogRest.py
parent32b73c50b1f0ecc64f33f2b99f60c3da6329f12a (diff)
Wait before polling QMP for host poweroff
This patch waits before polling qemu with QMP so that it has time to be ready for requests. It also increases wait time in case the host machine is slow.
Diffstat (limited to 'src/ogRest.py')
-rw-r--r--src/ogRest.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ogRest.py b/src/ogRest.py
index 3f76053..64558a2 100644
--- a/src/ogRest.py
+++ b/src/ogRest.py
@@ -98,15 +98,15 @@ class ogThread():
ogRest.state = ThreadState.IDLE
def check_vm_state_loop(ogRest):
- POLLING_WAIT_TIME = 3
+ POLLING_WAIT_TIME = 12
while True:
+ time.sleep(POLLING_WAIT_TIME)
state = ogRest.operations.check_vm_state()
installed_os = ogRest.operations.get_installed_os()
if state == OgVM.State.STOPPED and \
ogRest.state == ThreadState.IDLE and \
len(installed_os) > 0:
ogRest.operations.poweroff_host()
- time.sleep(POLLING_WAIT_TIME)
def poweroff(ogRest):
time.sleep(2)