[2/3] Support settimeout in QEMUMonitorProtocol

Submitted by Ryota OZAKI on Sept. 14, 2012, 12:44 p.m.

Details

Message ID 1347626662-3701-3-git-send-email-ozaki.ryota@gmail.com
State New
Headers show

Commit Message

Ryota OZAKI Sept. 14, 2012, 12:44 p.m.
This method is used in the following qemu-ga-client script
to implement non-blocking operations.

Signed-off-by: Ryota Ozaki <ozaki.ryota@gmail.com>
---
 QMP/qmp.py | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/QMP/qmp.py b/QMP/qmp.py
index 5a573e1..33c7d36 100644
--- a/QMP/qmp.py
+++ b/QMP/qmp.py
@@ -162,3 +162,8 @@  class QEMUMonitorProtocol:
     def close(self):
         self.__sock.close()
         self.__sockfile.close()
+
+    timeout = socket.timeout
+
+    def settimeout(self, timeout):
+        self.__sock.settimeout(timeout)