3) Once the TUI is connected and running, press 'Esc' to exit the app. This should result
in the following exception.
--------------------------------------------------------------------------------------------------------------------------------------------
Transitioning from 'Runstate.IDLE' to 'Runstate.CONNECTING'.
Connecting to ('localhost', 1234) ...
Connected.
Awaiting greeting ...
Response: {
"QMP": {
.......... Skipping
}
}
Negotiating capabilities ...
Request: {
"execute": "qmp_capabilities",
.......... Skipping
}
}
Response: {
"return": {}
}
Transitioning from 'Runstate.CONNECTING' to 'Runstate.RUNNING'.
Transitioning from 'Runstate.RUNNING' to 'Runstate.DISCONNECTING'.
Scheduling disconnect.
Draining the outbound queue ...
Flushing the StreamWriter ...
Cancelling writer task ...
Task.Writer: cancelled.
Task.Writer: exiting.
Cancelling reader task ...
Task.Reader: cancelled.
Task.Reader: exiting.
Closing StreamWriter.
Waiting for StreamWriter to close ...
QMP Disconnected.
Transitioning from 'Runstate.DISCONNECTING' to 'Runstate.IDLE'.
_kill_app: Connection lost
Connection lost
| Traceback (most recent call last):
| File "/home/niteesh/development/qemu/python/qemu/aqmp/aqmp_tui.py", line 246, in run
| main_loop.run()
| File "/home/niteesh/development/qemu/python/.venv/lib/python3.6/site-packages/urwid/main_loop.py", line 287, in run
| self._run()
| File "/home/niteesh/development/qemu/python/.venv/lib/python3.6/site-packages/urwid/main_loop.py", line 385, in _run
| self.event_loop.run()
| File "/home/niteesh/development/qemu/python/.venv/lib/python3.6/site-packages/urwid/main_loop.py", line 1494, in run
| reraise(*exc_info)
| File "/home/niteesh/development/qemu/python/.venv/lib/python3.6/site-packages/urwid/compat.py", line 58, in reraise
| raise value
| File "/home/niteesh/development/qemu/python/qemu/aqmp/aqmp_tui.py", line 206, in _kill_app
| raise err
| File "/home/niteesh/development/qemu/python/qemu/aqmp/aqmp_tui.py", line 201, in _kill_app
| await self.disconnect()
| File "/home/niteesh/development/qemu/python/qemu/aqmp/protocol.py", line 303, in disconnect
| await self._wait_disconnect()
| File "/home/niteesh/development/qemu/python/qemu/aqmp/protocol.py", line 573, in _wait_disconnect
| await self._dc_task
| File "/home/niteesh/development/qemu/python/qemu/aqmp/qmp_client.py", line 316, in _bh_disconnect
| await super()._bh_disconnect()
| File "/home/niteesh/development/qemu/python/qemu/aqmp/protocol.py", line 644, in _bh_disconnect
| await wait_closed(self._writer)
| File "/home/niteesh/development/qemu/python/qemu/aqmp/util.py", line 137, in wait_closed
| await flush(writer)
| File "/home/niteesh/development/qemu/python/qemu/aqmp/util.py", line 49, in flush
| await writer.drain()
| File "/usr/lib/python3.6/asyncio/streams.py", line 339, in drain
| yield from self._protocol._drain_helper()
| File "/usr/lib/python3.6/asyncio/streams.py", line 210, in _drain_helper
| raise ConnectionResetError('Connection lost')
| ConnectionResetError: Connection lost
--------------------------------------------------------------------------------------------------------------------------------------------