diff options
author | Anthony Liguori | 2012-02-20 23:28:29 +0100 |
---|---|---|
committer | Anthony Liguori | 2012-02-22 19:18:26 +0100 |
commit | 9f68f7fb12723a42791c4fa800678cf889b76280 (patch) | |
tree | 9be1a537aaec84dd731b6dda009e83962f1ccbe2 | |
parent | Makefile: Add dependency to fix linux-user-only build (diff) | |
download | qemu-9f68f7fb12723a42791c4fa800678cf889b76280.tar.gz qemu-9f68f7fb12723a42791c4fa800678cf889b76280.tar.xz qemu-9f68f7fb12723a42791c4fa800678cf889b76280.zip |
qmp: make qmp.py easier to use
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | QMP/qmp.py | 6 |
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. |