diff options
author | John Snow | 2020-07-10 07:22:07 +0200 |
---|---|---|
committer | Philippe Mathieu-Daudé | 2020-07-14 22:22:22 +0200 |
commit | e3a23b4803a3939c7e24e8946880f5ef369ef781 (patch) | |
tree | 8bb2ed6d555453586ef513915dc210f132f2cd1a /python/qemu/machine.py | |
parent | iotests.py: use qemu.qmp type aliases (diff) | |
download | qemu-e3a23b4803a3939c7e24e8946880f5ef369ef781.tar.gz qemu-e3a23b4803a3939c7e24e8946880f5ef369ef781.tar.xz qemu-e3a23b4803a3939c7e24e8946880f5ef369ef781.zip |
python/qmp.py: re-absorb MonitorResponseError
When I initially split this out, I considered this more of a machine
error than a QMP protocol error, but I think that's misguided.
Move this back to qmp.py and name it QMPResponseError. Convert
qmp.command() to use this exception type.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20200710052220.3306-4-jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'python/qemu/machine.py')
-rw-r--r-- | python/qemu/machine.py | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 69055189bd..80c4d4a8b6 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -56,19 +56,6 @@ class AbnormalShutdown(QEMUMachineError): """ -class MonitorResponseError(qmp.QMPError): - """ - Represents erroneous QMP monitor reply - """ - def __init__(self, reply): - try: - desc = reply["error"]["desc"] - except KeyError: - desc = reply - super().__init__(desc) - self.reply = reply - - class QEMUMachine: """ A QEMU VM @@ -533,7 +520,7 @@ class QEMUMachine: if reply is None: raise qmp.QMPError("Monitor is closed") if "error" in reply: - raise MonitorResponseError(reply) + raise qmp.QMPResponseError(reply) return reply["return"] def get_qmp_event(self, wait=False): |