From patchwork Thu Aug 23 15:46:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 10574305 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7339613B6 for ; Thu, 23 Aug 2018 15:48:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F5222C39A for ; Thu, 23 Aug 2018 15:48:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51E622C39C; Thu, 23 Aug 2018 15:48:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A19B12BE9B for ; Thu, 23 Aug 2018 15:48:34 +0000 (UTC) Received: from localhost ([::1]:37372 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsrqb-00049j-T3 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 23 Aug 2018 11:48:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsrp9-0002jo-SY for qemu-devel@nongnu.org; Thu, 23 Aug 2018 11:47:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsrp6-0007Sa-W6 for qemu-devel@nongnu.org; Thu, 23 Aug 2018 11:47:03 -0400 Received: from relay.sw.ru ([185.231.240.75]:51384) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fsrp6-0007Qc-Ln; Thu, 23 Aug 2018 11:47:00 -0400 Received: from [10.28.8.145] (helo=kvm.sw.ru) by relay.sw.ru with esmtp (Exim 4.90_1) (envelope-from ) id 1fsrp2-0005sK-PA; Thu, 23 Aug 2018 18:46:57 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Thu, 23 Aug 2018 18:46:53 +0300 Message-Id: <20180823154655.40188-2-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180823154655.40188-1-vsementsov@virtuozzo.com> References: <20180823154655.40188-1-vsementsov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH v3 1/3] qapi: add x-debug-query-block-graph X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, famz@redhat.com, ehabkost@redhat.com, jsnow@redhat.com, armbru@redhat.com, mreitz@redhat.com, pbonzini@redhat.com, stefanha@redhat.com, crosa@redhat.com, den@openvz.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add a new command, returning block nodes (and their users) graph. Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 91 +++++++++++++++++++++++ include/block/block.h | 1 + include/sysemu/block-backend.h | 2 + block.c | 129 +++++++++++++++++++++++++++++++++ block/block-backend.c | 5 ++ blockdev.c | 5 ++ 6 files changed, 233 insertions(+) diff --git a/qapi/block-core.json b/qapi/block-core.json index 4c7a37afdc..34cdc595d7 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1629,6 +1629,97 @@ ## { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] } +## +# @BlockGraphNodeType: +# +# Since: 3.1 +## +{ 'enum': 'BlockGraphNodeType', + 'data': [ 'blk', 'job', 'bds' ] } + +## +# @BlockGraphNode: +# +# Since: 3.1 +## +{ 'struct': 'BlockGraphNode', + 'data': { 'id': 'uint64', 'type': 'BlockGraphNodeType', 'name': 'str' } } + +## +# @BlockPermission: +# +# Enum of base block permissions. +# +# @consistent-read: A user that has the "permission" of consistent reads is +# guaranteed that their view of the contents of the block +# device is complete and self-consistent, representing the +# contents of a disk at a specific point. +# For most block devices (including their backing files) this +# is true, but the property cannot be maintained in a few +# situations like for intermediate nodes of a commit block +# job. +# +# @write: This permission is required to change the visible disk contents. +# +# @write-unchanged: This permission (which is weaker than BLK_PERM_WRITE) is +# both enough and required for writes to the block node when +# the caller promises that the visible disk content doesn't +# change. +# As the BLK_PERM_WRITE permission is strictly stronger, +# either is sufficient to perform an unchanging write. +# +# @resize: This permission is required to change the size of a block node. +# +# @graph-mod: This permission is required to change the node that this +# BdrvChild points to. +# +# Since: 3.1 +## + { 'enum': 'BlockPermission', + 'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize', + 'graph-mod' ] } +## +# @BlockGraphEdge: +# +# Block Graph edge description for x-debug-query-block-graph. +# +# @parent: parent id +# +# @child: child id +# +# @name: name of the relation (examples are 'file' and 'backing') +# +# @perm: granted permissions for the parent operating on the child +# +# @shared-perm: permissions that can still be granted to other users of the +# child while it is still attached this parent +# +# Since: 3.1 +## +{ 'struct': 'BlockGraphEdge', + 'data': { 'parent': 'uint64', 'child': 'uint64', + 'name': 'str', 'perm': [ 'BlockPermission' ], + 'shared-perm': [ 'BlockPermission' ] } } + +## +# @BlockGraph: +# +# Block Graph - list of nodes and list of edges. +# +# Since: 3.1 +## +{ 'struct': 'BlockGraph', + 'data': { 'nodes': ['BlockGraphNode'], 'edges': ['BlockGraphEdge'] } } + +## +# @x-debug-query-block-graph: +# +# Get the block graph. +# +# Since: 3.1 +## +{ 'command': 'x-debug-query-block-graph', 'returns': 'BlockGraph' } + ## # @drive-mirror: # diff --git a/include/block/block.h b/include/block/block.h index 4e0871aaf9..6f2ccad040 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -448,6 +448,7 @@ void bdrv_eject(BlockDriverState *bs, bool eject_flag); const char *bdrv_get_format_name(BlockDriverState *bs); BlockDriverState *bdrv_find_node(const char *node_name); BlockDeviceInfoList *bdrv_named_nodes_list(Error **errp); +BlockGraph *bdrv_get_block_graph(Error **errp); BlockDriverState *bdrv_lookup_bs(const char *device, const char *node_name, Error **errp); diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index 830d873f24..32ca5c1b12 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -237,4 +237,6 @@ int coroutine_fn blk_co_copy_range(BlockBackend *blk_in, int64_t off_in, int bytes, BdrvRequestFlags read_flags, BdrvRequestFlags write_flags); +const BdrvChild *blk_root(BlockBackend *blk); + #endif diff --git a/block.c b/block.c index 6161dbe3eb..588f5a2648 100644 --- a/block.c +++ b/block.c @@ -4003,6 +4003,135 @@ BlockDeviceInfoList *bdrv_named_nodes_list(Error **errp) return list; } +#define QAPI_LIST_ADD(list, element) do { \ + typeof(list) _tmp = g_new(typeof(*(list)), 1); \ + _tmp->value = (element); \ + _tmp->next = (list); \ + list = _tmp; \ +} while (0) + +typedef struct BlockGraphConstructor { + BlockGraph *graph; + GHashTable *hash; +} BlockGraphConstructor; + +static BlockGraphConstructor *graph_new(void) +{ + BlockGraphConstructor *gr = g_new(BlockGraphConstructor, 1); + + gr->graph = g_new0(BlockGraph, 1); + gr->hash = g_hash_table_new(NULL, NULL); + + return gr; +} + +static BlockGraph *graph_finalize(BlockGraphConstructor *gr) +{ + g_hash_table_destroy(gr->hash); + + return gr->graph; +} + +static uint64_t graph_node_num(BlockGraphConstructor *gr, void *node) +{ + uint64_t ret = (uint64_t)g_hash_table_lookup(gr->hash, node); + + if (ret > 0) { + return ret; + } + + ret = g_hash_table_size(gr->hash) + 1; + g_hash_table_insert(gr->hash, node, (void *)ret); + + return ret; +} + +static void graph_add_node(BlockGraphConstructor *gr, void *node, + BlockGraphNodeType type, const char *name) +{ + BlockGraphNode *n; + + n = g_new0(BlockGraphNode, 1); + + n->id = graph_node_num(gr, node); + n->type = type; + n->name = g_strdup(name); + + QAPI_LIST_ADD(gr->graph->nodes, n); +} + +static void graph_add_edge(BlockGraphConstructor *gr, void *parent, + const BdrvChild *child) +{ + typedef struct { + unsigned int flag; + BlockPermission num; + } PermissionMap; + + static PermissionMap permissions[] = { + { BLK_PERM_CONSISTENT_READ, BLOCK_PERMISSION_CONSISTENT_READ }, + { BLK_PERM_WRITE, BLOCK_PERMISSION_WRITE }, + { BLK_PERM_WRITE_UNCHANGED, BLOCK_PERMISSION_WRITE_UNCHANGED }, + { BLK_PERM_RESIZE, BLOCK_PERMISSION_RESIZE }, + { BLK_PERM_GRAPH_MOD, BLOCK_PERMISSION_GRAPH_MOD }, + { 0, 0 } + }; + PermissionMap *p; + BlockGraphEdge *edge; + + edge = g_new0(BlockGraphEdge, 1); + + edge->parent = graph_node_num(gr, parent); + edge->child = graph_node_num(gr, child->bs); + edge->name = g_strdup(child->name); + + for (p = permissions; p->flag; p++) { + if (p->flag & child->perm) { + QAPI_LIST_ADD(edge->perm, p->num); + } + if (p->flag & child->shared_perm) { + QAPI_LIST_ADD(edge->shared_perm, p->num); + } + } + + QAPI_LIST_ADD(gr->graph->edges, edge); +} + + +BlockGraph *bdrv_get_block_graph(Error **errp) +{ + BlockBackend *blk; + BlockJob *job; + BlockDriverState *bs; + BdrvChild *child; + BlockGraphConstructor *gr = graph_new(); + + for (blk = blk_all_next(NULL); blk; blk = blk_all_next(blk)) { + graph_add_node(gr, blk, BLOCK_GRAPH_NODE_TYPE_BLK, blk_name(blk)); + if (blk_root(blk)) { + graph_add_edge(gr, blk, blk_root(blk)); + } + } + + for (job = block_job_next(NULL); job; job = block_job_next(job)) { + GSList *el; + + graph_add_node(gr, job, BLOCK_GRAPH_NODE_TYPE_JOB, job->job.id); + for (el = job->nodes; el; el = el->next) { + graph_add_edge(gr, job, (BdrvChild *)el->data); + } + } + + QTAILQ_FOREACH(bs, &graph_bdrv_states, node_list) { + graph_add_node(gr, bs, BLOCK_GRAPH_NODE_TYPE_BDS, bs->node_name); + QLIST_FOREACH(child, &bs->children, next) { + graph_add_edge(gr, bs, child); + } + } + + return graph_finalize(gr); +} + BlockDriverState *bdrv_lookup_bs(const char *device, const char *node_name, Error **errp) diff --git a/block/block-backend.c b/block/block-backend.c index fa120630be..f3704fe87d 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -2234,3 +2234,8 @@ int coroutine_fn blk_co_copy_range(BlockBackend *blk_in, int64_t off_in, blk_out->root, off_out, bytes, read_flags, write_flags); } + +const BdrvChild *blk_root(BlockBackend *blk) +{ + return blk->root; +} diff --git a/blockdev.c b/blockdev.c index 72f5347df5..3b98ce7571 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3485,6 +3485,11 @@ BlockDeviceInfoList *qmp_query_named_block_nodes(Error **errp) return bdrv_named_nodes_list(errp); } +BlockGraph *qmp_x_debug_query_block_graph(Error **errp) +{ + return bdrv_get_block_graph(errp); +} + BlockJob *do_blockdev_backup(BlockdevBackup *backup, JobTxn *txn, Error **errp) { From patchwork Thu Aug 23 15:46:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 10574309 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2A9411390 for ; Thu, 23 Aug 2018 15:50:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 112B72C3D8 for ; Thu, 23 Aug 2018 15:50:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 056D52C3F2; Thu, 23 Aug 2018 15:50:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 656E92C40A for ; Thu, 23 Aug 2018 15:50:47 +0000 (UTC) Received: from localhost ([::1]:37390 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsrsk-0007VB-Hi for patchwork-qemu-devel@patchwork.kernel.org; Thu, 23 Aug 2018 11:50:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsrp9-0002jn-SX for qemu-devel@nongnu.org; Thu, 23 Aug 2018 11:47:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsrp6-0007SU-Tf for qemu-devel@nongnu.org; Thu, 23 Aug 2018 11:47:03 -0400 Received: from relay.sw.ru ([185.231.240.75]:51386) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fsrp6-0007RE-J4; Thu, 23 Aug 2018 11:47:00 -0400 Received: from [10.28.8.145] (helo=kvm.sw.ru) by relay.sw.ru with esmtp (Exim 4.90_1) (envelope-from ) id 1fsrp3-0005sK-Ev; Thu, 23 Aug 2018 18:46:57 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Thu, 23 Aug 2018 18:46:54 +0300 Message-Id: <20180823154655.40188-3-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180823154655.40188-1-vsementsov@virtuozzo.com> References: <20180823154655.40188-1-vsementsov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH v3 2/3] scripts: add render_block_graph function for QEMUMachine X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, famz@redhat.com, ehabkost@redhat.com, jsnow@redhat.com, armbru@redhat.com, mreitz@redhat.com, pbonzini@redhat.com, stefanha@redhat.com, crosa@redhat.com, den@openvz.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Render block nodes graph with help of graphviz. This new function is for debugging, so there is no sense to put it into qemu.py as a method of QEMUMachine. Let's instead put it separately. Signed-off-by: Vladimir Sementsov-Ogievskiy Acked-by: Eduardo Habkost Reviewed-by: Max Reitz --- scripts/render_block_graph.py | 120 ++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100755 scripts/render_block_graph.py diff --git a/scripts/render_block_graph.py b/scripts/render_block_graph.py new file mode 100755 index 0000000000..382cc769ef --- /dev/null +++ b/scripts/render_block_graph.py @@ -0,0 +1,120 @@ +#!/usr/bin/env python +# +# Render Qemu Block Graph +# +# Copyright (c) 2018 Virtuozzo International GmbH. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +import os +import sys +import subprocess +import json +from graphviz import Digraph +from qemu import MonitorResponseError + + +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 + + +def render_block_graph(qmp, filename, format='png'): + ''' + Render graph in text (dot) representation into "@filename" and + representation in @format into "@filename.@format" + ''' + + bds_nodes = qmp.command('query-named-block-nodes') + bds_nodes = {n['node-name']: n for n in bds_nodes} + + job_nodes = qmp.command('query-block-jobs') + job_nodes = {n['device']: n for n in job_nodes} + + block_graph = qmp.command('x-debug-query-block-graph') + + graph = Digraph(comment='Block Nodes Graph') + graph.format = format + graph.node('permission symbols:\l' + ' w - Write\l' + ' r - consistent-Read\l' + ' u - write - Unchanged\l' + ' g - Graph-mod\l' + ' s - reSize\l' + 'edge label scheme:\l' + ' \l' + ' \l' + ' \l', shape='none') + + for n in block_graph['nodes']: + if n['type'] == 'bds': + info = bds_nodes[n['name']] + label = n['name'] + ' [' + info['drv'] + ']' + if info['drv'] == 'file': + label += '\n' + os.path.basename(info['file']) + shape = 'ellipse' + elif n['type'] == 'job': + info = job_nodes[n['name']] + label = info['type'] + ' job (' + n['name'] + ')' + shape = 'box' + else: + assert n['type'] == 'blk' + label = n['name'] if n['name'] else 'unnamed blk' + shape = 'box' + + graph.node(str(n['id']), label, shape=shape) + + for e in block_graph['edges']: + label = '%s\l%s\l%s\l' % (e['name'], perm(e['perm']), + perm(e['shared-perm'])) + graph.edge(str(e['parent']), str(e['child']), label=label) + + graph.render(filename) + + +class LibvirtGuest(): + def __init__(self, name): + self.name = name + + def command(self, cmd): + # only supports qmp commands without parameters + m = {'execute': cmd} + ar = ['virsh', 'qemu-monitor-command', self.name, json.dumps(m)] + + reply = json.loads(subprocess.check_output(ar)) + + if 'error' in reply: + raise MonitorResponseError(reply) + + return reply['return'] + + +if __name__ == '__main__': + obj = sys.argv[1] + out = sys.argv[2] + + if os.path.exists(obj): + # assume unix socket + qmp = QEMUMonitorProtocol(obj) + qmp.connect() + else: + # assume libvirt guest name + qmp = LibvirtGuest(obj) + + render_block_graph(qmp, out) From patchwork Thu Aug 23 15:46:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 10574307 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 847331390 for ; Thu, 23 Aug 2018 15:48:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 73C382BE9B for ; Thu, 23 Aug 2018 15:48:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 684782C3A7; Thu, 23 Aug 2018 15:48:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 28B122C397 for ; Thu, 23 Aug 2018 15:48:35 +0000 (UTC) Received: from localhost ([::1]:37371 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsrqc-00049E-ER for patchwork-qemu-devel@patchwork.kernel.org; Thu, 23 Aug 2018 11:48:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsrp9-0002jm-SX for qemu-devel@nongnu.org; Thu, 23 Aug 2018 11:47:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsrp6-0007SE-KY for qemu-devel@nongnu.org; Thu, 23 Aug 2018 11:47:03 -0400 Received: from relay.sw.ru ([185.231.240.75]:51390) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fsrp6-0007RV-Az; Thu, 23 Aug 2018 11:47:00 -0400 Received: from [10.28.8.145] (helo=kvm.sw.ru) by relay.sw.ru with esmtp (Exim 4.90_1) (envelope-from ) id 1fsrp4-0005sK-36; Thu, 23 Aug 2018 18:46:58 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Thu, 23 Aug 2018 18:46:55 +0300 Message-Id: <20180823154655.40188-4-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180823154655.40188-1-vsementsov@virtuozzo.com> References: <20180823154655.40188-1-vsementsov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH v3 3/3] not-for-commit: example of new command usage for debugging X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, famz@redhat.com, ehabkost@redhat.com, jsnow@redhat.com, armbru@redhat.com, mreitz@redhat.com, pbonzini@redhat.com, stefanha@redhat.com, crosa@redhat.com, den@openvz.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/222 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qemu-iotests/222 b/tests/qemu-iotests/222 index 0ead56d574..91d88aa5c0 100644 --- a/tests/qemu-iotests/222 +++ b/tests/qemu-iotests/222 @@ -137,6 +137,8 @@ with iotests.FilePath('base.img') as base_img_path, \ log('--- Cleanup ---') log('') + from render_block_graph import render_block_graph + render_block_graph(vm, '/tmp/out.dot') log(vm.qmp('block-job-cancel', device=src_node)) log(vm.event_wait('BLOCK_JOB_CANCELLED'), filters=[iotests.filter_qmp_event])