summary refs log tree commit diff stats
path: root/python/qemu
diff options
context:
space:
mode:
Diffstat (limited to 'python/qemu')
-rw-r--r--python/qemu/qmp.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py
index d911999da1..96456f7aa0 100644
--- a/python/qemu/qmp.py
+++ b/python/qemu/qmp.py
@@ -169,10 +169,11 @@ class QEMUMonitorProtocol:
         try:
             self.__json_read()
         except OSError as err:
-            if err.errno == errno.EAGAIN:
-                # No data available
-                pass
-        self.__sock.setblocking(True)
+            # EAGAIN: No data available; not critical
+            if err.errno != errno.EAGAIN:
+                raise
+        finally:
+            self.__sock.setblocking(True)
 
         # Wait for new events, if needed.
         # if wait is 0.0, this means "no wait" and is also implicitly false.