summary refs log tree commit diff stats
path: root/python/qemu/qmp/legacy.py
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2022-05-03 14:07:10 -0400
committerJohn Snow <jsnow@redhat.com>2025-09-15 14:36:01 -0400
commit1e343714bfc06cc982e68a290f3809117d6dfcd0 (patch)
treed1d3e5b50871a9da19f048c0b83e2027f0aa0541 /python/qemu/qmp/legacy.py
parentcb0e43804038e47bbaf0179ce67df678ec13a392 (diff)
downloadfocaccia-qemu-1e343714bfc06cc982e68a290f3809117d6dfcd0.tar.gz
focaccia-qemu-1e343714bfc06cc982e68a290f3809117d6dfcd0.zip
python: backport 'kick event queue on legacy event_pull()'
This corrects an oversight in qmp-shell operation where new events will
not accumulate in the event queue when pressing "enter" with an empty
command buffer, so no new events show up.

Reported-by: Jag Raman <jag.raman@oracle.com>
Signed-off-by: John Snow <jsnow@redhat.com>
cherry picked from commit python-qemu-qmp@0443582d16cf9efd52b2c41a7b5be7af42c856cd
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'python/qemu/qmp/legacy.py')
-rw-r--r--python/qemu/qmp/legacy.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/python/qemu/qmp/legacy.py b/python/qemu/qmp/legacy.py
index 22a2b5616e..c8d0a29b56 100644
--- a/python/qemu/qmp/legacy.py
+++ b/python/qemu/qmp/legacy.py
@@ -231,6 +231,9 @@ class QEMUMonitorProtocol:
 
         :return: The first available QMP event, or None.
         """
+        # Kick the event loop to allow events to accumulate
+        self._sync(asyncio.sleep(0))
+
         if not wait:
             # wait is False/0: "do not wait, do not except."
             if self._qmp.events.empty():