Patchwork [6/8] qmp: Fix python helper /wrt long return strings

login
register
mail settings
Submitter Jan Kiszka
Date May 14, 2010, 1:20 p.m.
Message ID <cbdfbca0a5780c19d867fbf813e58eeed0f0c80d.1273843151.git.jan.kiszka@siemens.com>
Download mbox | patch
Permalink /patch/52612/
State New
Headers show

Comments

Jan Kiszka - May 14, 2010, 1:20 p.m.
Remove the arbitrary limitation of 1024 characters per return string and
read complete lines instead. Required for device_show.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 QMP/qmp.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/QMP/qmp.py b/QMP/qmp.py
index d9da603..b8f1741 100644
--- a/QMP/qmp.py
+++ b/QMP/qmp.py
@@ -63,7 +63,7 @@  class QEMUMonitorProtocol:
 
     def __json_read(self):
         try:
-            return json.loads(self.sock.recv(1024))
+            return json.loads(self.sock.makefile().readline())
         except ValueError:
             return