1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

Fix QEMU link detection flaky on last port. Fixes #1666

This commit is contained in:
grossmj 2019-10-15 23:42:42 +08:00
parent f5c02368e6
commit df9b40c1dc

View File

@ -1173,8 +1173,12 @@ class QemuVM(BaseNode):
for command in commands: for command in commands:
log.info("Execute QEMU monitor command: {}".format(command)) log.info("Execute QEMU monitor command: {}".format(command))
try: try:
writer.write(command.encode('ascii') + b"\n") cmd_byte = command.encode('ascii')
await asyncio.wait_for(reader.readline(), timeout=3) # echo of the command writer.write(cmd_byte + b"\n")
while True:
line = await asyncio.wait_for(reader.readline(), timeout=3) # echo of the command
if not line or cmd_byte in line:
break
except asyncio.TimeoutError: except asyncio.TimeoutError:
log.warning("Missing echo of command '{}'".format(command)) log.warning("Missing echo of command '{}'".format(command))
except OSError as e: except OSError as e: