[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/55] python: add __repr__ to ConsoleSocket to aid debugging
From: |
Paolo Bonzini |
Subject: |
[PULL 04/55] python: add __repr__ to ConsoleSocket to aid debugging |
Date: |
Mon, 21 Dec 2020 15:43:56 +0100 |
From: Alex Bennée <alex.bennee@linaro.org>
While attempting to debug some console weirdness I thought it would be
worth making it easier to see what it had inside.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Message-Id: <20201210190417.31673-6-alex.bennee@linaro.org>
---
python/qemu/console_socket.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py
index f060d79e06..ac21130e44 100644
--- a/python/qemu/console_socket.py
+++ b/python/qemu/console_socket.py
@@ -45,6 +45,13 @@ class ConsoleSocket(socket.socket):
if drain:
self._drain_thread = self._thread_start()
+ def __repr__(self) -> str:
+ s = super().__repr__()
+ s = s.rstrip(">")
+ s = "%s, logfile=%s, drain_thread=%s>" % (s, self._logfile,
+ self._drain_thread)
+ return s
+
def _drain_fn(self) -> None:
"""Drains the socket and runs while the socket is open."""
while self._open:
--
2.29.2
- [PULL 00/55] Misc patches for 2020-12-21, Paolo Bonzini, 2020/12/21
- [PULL 01/55] gitlab: include aarch64-softmmu and ppc64-softmmu cross-system-build, Paolo Bonzini, 2020/12/21
- [PULL 02/55] configure: move gettext detection to meson.build, Paolo Bonzini, 2020/12/21
- [PULL 04/55] python: add __repr__ to ConsoleSocket to aid debugging,
Paolo Bonzini <=
- [PULL 03/55] configure: add --without-default-features, Paolo Bonzini, 2020/12/21
- [PULL 05/55] gitlab: move --without-default-devices build from Travis, Paolo Bonzini, 2020/12/21
- [PULL 10/55] tests: update for rename of CentOS8 PowerTools repo, Paolo Bonzini, 2020/12/21
- [PULL 06/55] gitlab: add --without-default-features build, Paolo Bonzini, 2020/12/21
- [PULL 08/55] gitlab-CI: Test 32-bit builds with the fedora-i386-cross container, Paolo Bonzini, 2020/12/21
- [PULL 12/55] vl: initialize displays _after_ exiting preconfiguration, Paolo Bonzini, 2020/12/21
- [PULL 21/55] build-sys: fix -static linking of libvhost-user, Paolo Bonzini, 2020/12/21
- [PULL 24/55] trace: do not include TCG helper tracepoints in no-TCG builds, Paolo Bonzini, 2020/12/21
- [PULL 31/55] meson: cleanup Kconfig.host handling, Paolo Bonzini, 2020/12/21
- [PULL 38/55] curl: convert to meson, Paolo Bonzini, 2020/12/21