mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
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>
This commit is contained in:
parent
2012453ddd
commit
e3a23b4803
3 changed files with 21 additions and 18 deletions
|
@ -25,7 +25,10 @@ import json
|
|||
from graphviz import Digraph
|
||||
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'python'))
|
||||
from qemu.machine import MonitorResponseError
|
||||
from qemu.qmp import (
|
||||
QEMUMonitorProtocol,
|
||||
QMPResponseError,
|
||||
)
|
||||
|
||||
|
||||
def perm(arr):
|
||||
|
@ -102,7 +105,7 @@ class LibvirtGuest():
|
|||
reply = json.loads(subprocess.check_output(ar))
|
||||
|
||||
if 'error' in reply:
|
||||
raise MonitorResponseError(reply)
|
||||
raise QMPResponseError(reply)
|
||||
|
||||
return reply['return']
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue