[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 5/8] python: add __repr__ to ConsoleSocket to aid debugging
From: |
Alex Bennée |
Subject: |
[PATCH v2 5/8] python: add __repr__ to ConsoleSocket to aid debugging |
Date: |
Thu, 10 Dec 2020 19:04:14 +0000 |
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>
---
v2
- make more pythonic
---
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.20.1
- Re: [PATCH v2 3/8] configure: move gettext detection to meson.build, (continued)
- [PATCH v2 4/8] configure: add --without-default-features, Alex Bennée, 2020/12/10
- [PATCH v2 2/8] gitlab: include aarch64-softmmu and ppc64-softmmu cross-system-build, Alex Bennée, 2020/12/10
- [PATCH v2 1/8] configure: include moxie-softmmu in deprecated_targets_list, Alex Bennée, 2020/12/10
- [PATCH v2 5/8] python: add __repr__ to ConsoleSocket to aid debugging,
Alex Bennée <=
- [PATCH v2 6/8] gitlab: move --without-default-devices build from Travis, Alex Bennée, 2020/12/10
- [PATCH v2 7/8] gitlab: add --without-default-features build, Alex Bennée, 2020/12/10
- [PATCH v2 8/8] tests/tcg: build tests with -Werror, Alex Bennée, 2020/12/10