qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: "Alex Bennée" <alex.bennee@linaro.org>, qemu-devel@nongnu.org
Cc: Eduardo Habkost <ehabkost@redhat.com>, Cleber Rosa <crosa@redhat.com>
Subject: Re: [RFC PATCH] python: add __repr__ to ConsoleSocket to aid debugging
Date: Mon, 7 Dec 2020 16:02:22 -0500	[thread overview]
Message-ID: <092ecec7-d4a3-f345-7619-dab4c9a43f69@redhat.com> (raw)
In-Reply-To: <20201207200737.5090-1-alex.bennee@linaro.org>

On 12/7/20 3:07 PM, Alex Bennée wrote:
> 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>
> ---
>   python/qemu/console_socket.py | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py
> index f060d79e06..77966d1fe9 100644
> --- a/python/qemu/console_socket.py
> +++ b/python/qemu/console_socket.py
> @@ -45,6 +45,14 @@ class ConsoleSocket(socket.socket):
>           if drain:
>               self._drain_thread = self._thread_start()
>   
> +    def __repr__(self):

def __repr__(self) -> str:

> +        s = super(ConsoleSocket, self).__repr__()

Use python3-style super(): super().__repr__()

> +        s = s.rstrip(">")
> +        s += ", logfile=%s" % (self._logfile)
> +        s += ", drain_thread=%s" % (self._drain_thread)
> +        s += ">"
> +        return s
> +

Reviewed-by: John Snow <jsnow@redhat.com>

feel free to take this through your testing tree.

--js



  reply	other threads:[~2020-12-07 21:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-07 20:07 [RFC PATCH] python: add __repr__ to ConsoleSocket to aid debugging Alex Bennée
2020-12-07 21:02 ` John Snow [this message]
2020-12-07 21:35 ` Willian Rampazzo
2020-12-07 22:14   ` Philippe Mathieu-Daudé
2020-12-07 23:14     ` Willian Rampazzo
2020-12-08 15:09   ` John Snow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=092ecec7-d4a3-f345-7619-dab4c9a43f69@redhat.com \
    --to=jsnow@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=crosa@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).