summaryrefslogtreecommitdiffstats
path: root/QMP
authorJan Kiszka <[email protected]>2010-06-15 22:38:46 (GMT)
committer Luiz Capitulino <[email protected]>2010-07-01 17:27:13 (GMT)
commitbbafc7a8798bc9ed1380e75033544e0614d344c7 (patch) (side-by-side diff)
tree1c52f19c932b940d4d6606c73458c098054a4517 /QMP
parent8d7e84571bd3f44c106ed12cb316b1ca30915fc7 (diff)
downloadqemu-kvm-bbafc7a8798bc9ed1380e75033544e0614d344c7.zip
qemu-kvm-bbafc7a8798bc9ed1380e75033544e0614d344c7.tar.gz
qemu-kvm-bbafc7a8798bc9ed1380e75033544e0614d344c7.tar.bz2
QMP: Fix python helper /wrt long return strings
Remove the arbitrary limitation of 1024 characters per return string and read complete lines instead. Required for device_show. Signed-off-by: Jan Kiszka <[email protected]> Signed-off-by: Luiz Capitulino <[email protected]>
Diffstat (limited to 'QMP') (more/less context) (ignore whitespace changes)
-rw-r--r--QMP/qmp.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/QMP/qmp.py b/QMP/qmp.py
index d9da603..4062f84 100644
--- a/QMP/qmp.py
+++ b/QMP/qmp.py
@@ -63,10 +63,14 @@ class QEMUMonitorProtocol:
def __json_read(self):
try:
- return json.loads(self.sock.recv(1024))
+ while True:
+ line = json.loads(self.sockfile.readline())
+ if not 'event' in line:
+ return line
except ValueError:
return
def __init__(self, filename):
self.filename = filename
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+ self.sockfile = self.sock.makefile()