mirror of https://git.48k.eu/ogclient
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.more_events
parent
32b73c50b1
commit
3c055d198d
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue