X-Git-Url: https://repo.jachan.dev/qemu.git/blobdiff_plain/cfe6c547690b06fbce54a6d0f7b05dd7f18e36ea..HEAD:/scripts/render_block_graph.py diff --git a/scripts/render_block_graph.py b/scripts/render_block_graph.py index ed7e581b4f..8f731a5cfe 100755 --- a/scripts/render_block_graph.py +++ b/scripts/render_block_graph.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Render Qemu Block Graph # @@ -23,14 +23,16 @@ import sys import subprocess import json from graphviz import Digraph -from qemu import MonitorResponseError + +sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'python')) +from qemu.qmp import QMPError +from qemu.qmp.legacy import QEMUMonitorProtocol def perm(arr): s = 'w' if 'write' in arr else '_' s += 'r' if 'consistent-read' in arr else '_' s += 'u' if 'write-unchanged' in arr else '_' - s += 'g' if 'graph-mod' in arr else '_' s += 's' if 'resize' in arr else '_' return s @@ -100,7 +102,7 @@ class LibvirtGuest(): reply = json.loads(subprocess.check_output(ar)) if 'error' in reply: - raise MonitorResponseError(reply) + raise QMPError(reply) return reply['return']