aboutsummaryrefslogtreecommitdiff
path: root/QMP/qmp.py
diff options
context:
space:
mode:
Diffstat (limited to 'QMP/qmp.py')
-rw-r--r--QMP/qmp.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/QMP/qmp.py b/QMP/qmp.py
index c7dbea076d..36ecc1dfae 100644
--- a/QMP/qmp.py
+++ b/QMP/qmp.py
@@ -128,6 +128,12 @@ class QEMUMonitorProtocol:
qmp_cmd['id'] = id
return self.cmd_obj(qmp_cmd)
+ def command(self, cmd, **kwds):
+ ret = self.cmd(cmd, kwds)
+ if ret.has_key('error'):
+ raise Exception(ret['error']['desc'])
+ return ret['return']
+
def get_events(self, wait=False):
"""
Get a list of available QMP events.