Do not log warning at qemu exit on windows if it's normal

Fix #777
This commit is contained in:
Julien Duponchelle 2016-11-16 13:06:43 +01:00
parent ecfa89cba8
commit 928d9f13f4
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8
2 changed files with 13 additions and 2 deletions

View File

@ -333,7 +333,17 @@ class BaseNode:
"""
if not self._wrap_console:
return
remaining_trial = 60
while True:
try:
(reader, writer) = yield from asyncio.open_connection(host="127.0.0.1", port=self._internal_console_port)
break
except (OSError, ConnectionRefusedError) as e:
print(self._internal_console_port)
if remaining_trial <= 0:
raise e
yield from asyncio.sleep(0.1)
remaining_trial -= 1
yield from AsyncioTelnetServer.write_client_intro(writer, echo=True)
server = AsyncioTelnetServer(reader=reader, writer=writer, binary=True, echo=True)
self._wrapper_telnet_server = yield from asyncio.start_server(server.run, self._manager.port_manager.console_host, self.console)

View File

@ -922,7 +922,8 @@ class QemuVM(BaseNode):
self.status = "stopped"
self._hw_virtualization = False
self._process = None
if returncode != 0:
# A return code of 1 seem fine on Windows
if returncode != 0 and (returncode != 1 or not sys.platform.startswith("win")):
self.project.emit("log.error", {"message": "QEMU process has stopped, return code: {}\n{}".format(returncode, self.read_stdout())})
@asyncio.coroutine