Patchwork [PULL,02/15] Support settimeout in QEMUMonitorProtocol

login
register
mail settings
Submitter Luiz Capitulino
Date Sept. 27, 2012, 1:28 p.m.
Message ID <1348752509-1142-3-git-send-email-lcapitulino@redhat.com>
Download mbox | patch
Permalink /patch/187390/
State New
Headers show

Comments

Luiz Capitulino - Sept. 27, 2012, 1:28 p.m.
From: Ryota Ozaki <ozaki.ryota@gmail.com>

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>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 QMP/qmp.py | 5 +++++
 1 file changed, 5 insertions(+)

Patch

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)