]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
python/aqmp: add greeting property to QMPClient
authorJohn Snow <jsnow@redhat.com>
Thu, 23 Sep 2021 00:49:22 +0000 (20:49 -0400)
committerJohn Snow <jsnow@redhat.com>
Tue, 12 Oct 2021 16:22:10 +0000 (12:22 -0400)
Expose the greeting as a read-only property of QMPClient so it can be
retrieved at-will.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20210923004938.3999963-2-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
python/qemu/aqmp/qmp_client.py

index 82e9dab124c5cc72e4ba40ab14050b7211aeaa83..d2ad7459f9f58a3f5acbe00a3deaec34263aa8fa 100644 (file)
@@ -224,6 +224,11 @@ class QMPClient(AsyncProtocol[Message], Events):
             'asyncio.Queue[QMPClient._PendingT]'
         ] = {}
 
+    @property
+    def greeting(self) -> Optional[Greeting]:
+        """The `Greeting` from the QMP server, if any."""
+        return self._greeting
+
     @upper_half
     async def _establish_session(self) -> None:
         """