From nobody Sun Nov 24 08:45:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1723796876; cv=none; d=zohomail.com; s=zohoarc; b=EVYDIFxR5XHirSWbVCSdKRsex1EBt3Ae6QUg+ay4OHkclIWAgZzjlbGjmfVNn6t656+XSLxcpcTsGAFMlDOYUaw/HV1qMHrfoz8Sa1G20AJfj9bTTJnqJDrBSTckfxhqhXXS1fQgEGE4rPu5nH65Kzp7Xke/qBjpmqYhMJ9xRgs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723796876; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=+IWT7pxnlLUTlii37LM3H6gg4EVA5ocoR4blPekNbmA=; b=OcvnDzC+jCuh/9JVt0ifPmVV7yWWQoXoi8Bm+yrblqebi6uvwa6sQRCm5OciNFD/3DIrWyTwtN67nkBUzcYH7K5LhFziw6/qG6DFWZeBQy5Bdtcx7+k4s9ANsQE+1Wis70/LRsFb7bhf09MczCmLyyIak3PPr4BUxmZE1jgyAGY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1723796874958729.1823364311699; Fri, 16 Aug 2024 01:27:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sesJD-0005FG-Vz; Fri, 16 Aug 2024 04:27:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sesJB-0004wd-IC for qemu-devel@nongnu.org; Fri, 16 Aug 2024 04:27:41 -0400 Received: from shasxm06.verisilicon.com ([101.89.135.45] helo=shasxm03.verisilicon.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1sesJ8-0004xY-GF for qemu-devel@nongnu.org; Fri, 16 Aug 2024 04:27:41 -0400 Received: from SHASXM03.verisilicon.com ([fe80::938:4dda:a2f9:38aa]) by SHASXM06.verisilicon.com ([::1]) with mapi id 14.03.0408.000; Fri, 16 Aug 2024 16:06:30 +0800 Content-Language: zh-CN Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; d=Verisilicon.com; s=default; c=simple/simple; t=1723795591; h=from:subject:to:date:message-id; bh=L8u3xfXdZg/VI0gNJmr+RntnPvuZAVg5bCED35F+jAQ=; b=D2DlmsFo9HBglDxazXcfQUOgnU/bCMt0bR37auckxteWbgRCH2aDNxk1nY29UMxSr7R4XnCOhD/ nd5O+Iq6tlyCN9eYf1yp2m2ahkrNk04jNW2jiEuFx8LL6nHNpOf2LuivhtbxaAbm00bFSx/7eIFpV w2d8OqH7SoMUhq6iyfk= To: "pbonzini@redhat.com" , "berrange@redhat.com" , "eduardo@habkost.net" CC: "qemu-devel@nongnu.org" , Lu Gao Subject: [PATCH] hmp: display qdev canonical path in 'info qtree' Thread-Topic: [PATCH] hmp: display qdev canonical path in 'info qtree' Thread-Index: AdrvszNLLzNpDGTOSbeF9bVsGvwcXQ== Date: Fri, 16 Aug 2024 08:06:30 +0000 Message-ID: <4C23C17B8E87E74E906A25A3254A03F401F8166AE7@SHASXM03.verisilicon.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.10.166.182] MIME-Version: 1.0 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=101.89.135.45; envelope-from=Jianxian.Wen@verisilicon.com; helo=shasxm03.verisilicon.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Jianxian Wen From: Jianxian Wen via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1723796878320116600 Content-Type: text/plain; charset="utf-8" It is difficult to identify a specific instance when there are multiple instances of the same type in the output of 'info qom-tree'. However, in 'info qtree', we can find the specific instance using the DeviceState->id or mmio info. To facilitate locating instances in the output of the 'info qom-tree', the canonical path is added to the output of the 'info qtree'. Signed-off-by: Jianxian Wen Signed-off-by: Lu Gao --- system/qdev-monitor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index 6af6ef7d66..22a2e2fae8 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -785,6 +785,7 @@ static void qdev_print(Monitor *mon, DeviceState *dev, = int indent) ObjectClass *class; NamedGPIOList *ngl; NamedClockList *ncl; + g_autofree char *qom_path =3D object_get_canonical_path(OBJECT(dev)); =20 QLIST_FOREACH(ngl, &dev->gpios, node) { if (ngl->num_in) { @@ -809,6 +810,7 @@ static void qdev_print(Monitor *mon, DeviceState *dev, = int indent) class =3D object_class_get_parent(class); } while (class !=3D object_class_by_name(TYPE_DEVICE)); bus_print_dev(dev->parent_bus, mon, dev, indent); + qdev_printf("qom-path %s\n", qom_path); } =20 static void qbus_print(Monitor *mon, BusState *bus, int indent, bool detai= ls) --=20 2.17.1