[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 07/20] python/machine.py: Add _qmp access shim

From: John Snow
Subject: Re: [PATCH 07/20] python/machine.py: Add _qmp access shim
Date: Wed, 7 Oct 2020 14:21:50 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

On 10/7/20 5:53 AM, Kevin Wolf wrote:
Am 07.10.2020 um 01:58 hat John Snow geschrieben:
Like many other Optional[] types, it's not always a given that this
object will be set. Wrap it in a type-shim that raises a meaningful
error and will always return a concrete type.

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

@@ -515,11 +515,13 @@ def set_qmp_monitor(self, enabled=True):
                          line. Default is True.
          @note: call this function before launch().
-        if enabled:
-            self._qmp_set = True
-        else:
-            self._qmp_set = False
-            self._qmp = None
+        self._qmp_set = enabled

This change seems unrelated to wrapping the connection in a property.
Intuitively, it makes sense that the connection of a running instance
doesn't go away just because I disable QMP in the command line for the
next launch.

If this is the reasoning behind the change, maybe mention it in the
commit message.

With this:
Reviewed-by: Kevin Wolf <kwolf@redhat.com>

Oh, yes. That's what happened here -- and it got folded in here specifically to make that access check consistent.

I'll update the commit message.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]