From patchwork Thu Aug 23 15:46:52 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: 10574303 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 13B711579 for ; Thu, 23 Aug 2018 15:48:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02BDC2BE94 for ; Thu, 23 Aug 2018 15:48:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA97D2BE9B; Thu, 23 Aug 2018 15:48:30 +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 2B92A2C39A for ; Thu, 23 Aug 2018 15:48:29 +0000 (UTC) Received: from localhost ([::1]:37370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsrqW-000443-T8 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 23 Aug 2018 11:48:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsrp9-0002jp-Sm 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-0007SK-LP for qemu-devel@nongnu.org; Thu, 23 Aug 2018 11:47:03 -0400 Received: from relay.sw.ru ([185.231.240.75]:51382) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fsrp6-0007Qb-B3; 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-5P; Thu, 23 Aug 2018 18:46:56 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Thu, 23 Aug 2018 18:46:52 +0300 Message-Id: <20180823154655.40188-1-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.18.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH v3 0/3] block nodes graph visualization 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 Hi all! On the way of backup schemes development (and in general any complicated developments in Qemu block layer) it would be good to have an ability to print out graph of block nodes with their permissions. Just look at attached picture. v3: again, major rework, after long discussion with Max: - start creating graph looping through blk's and block jobs, don't use opaque - don't export pointers, generate ids instead (graphical representation didn't significantly changed, you can look at the picture, attached to v2 cover-letter) v2: major rework: Identifying non-bds nodes by their description was a bad idea, descriptions are not guaranteed to be different for different nodes. So, the only way is use pointer to identify them. And to be unique, let's use pointers to identify all the nodes in the graph. As additional benefit, we have pointers for each node, which is good for debugging (imagine a gdb session). Vladimir Sementsov-Ogievskiy (3): qapi: add x-debug-query-block-graph scripts: add render_block_graph function for QEMUMachine not-for-commit: example of new command usage for debugging 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 ++ scripts/render_block_graph.py | 120 ++++++++++++++++++++++++++++++ tests/qemu-iotests/222 | 2 + 8 files changed, 355 insertions(+) create mode 100755 scripts/render_block_graph.py