Commit 8b7ed968 authored by Alain Takoudjou's avatar Alain Takoudjou

wait a bit if qemu proces is not started

parent 9834518d
......@@ -75,9 +75,16 @@ def getInitialQemuResourceDict(pid_file):
raise ValueError("%r is empty or doesn't contain a valid pid number: %s" % (
pid_file, str(e)))
wait_count = 5
while wait_count > 0:
try:
process = psutil.Process(pid)
break
except psutil.NoSuchProcess:
print "Qemu process is not started yet..."
wait_count -= 1
time.sleep(0.5)
else:
raise ValueError('No process with pid %s' % pid)
if not process.name().startswith('qemu-system'):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment