From nobody Sun Sep 7 23:35:48 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1756477526; cv=none; d=zohomail.com; s=zohoarc; b=jo80DmbNwxiWe3AxZ5TBEYSiGiuV5BKmQGPNgaPMudhXuO1+slgA9rksbIMJC9TnelqLu2s+kq8QDTsO4VPEjJ5XvEDYpgcqzIy5rOa6vCU5WvZKv02/nMqyYRdxePcgS0Ybf8VKf1/F1qWySPw2H0BqwBVKnvuhybHFNXQI9Sg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756477526; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=IyxmhnHVHoED7k0bq5+TFuVKNtAKX+gyrTaZz7RNhMQ=; b=GuxYR4Wb4ZhWzlgLRo42gaxG2TbRhGbX70+Lv+YnAAIoTJhAeGu2txZ98Cm+q0M3S1V06uccV/FrDcPn1GeeeD4N00v6jzjUexVY5/2UIVTERZE1qX8d38zWPecc67DOPy+BhowGX9dM3iuF4sIF+nLxwULCJ2AKUKoorR91mYY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1756477526445818.3673024708872; Fri, 29 Aug 2025 07:25:26 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 7F39A44218; Fri, 29 Aug 2025 10:25:25 -0400 (EDT) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 876B7441B7; Fri, 29 Aug 2025 10:20:02 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id B106B440C0; Fri, 29 Aug 2025 10:19:43 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 61AC044036 for ; Fri, 29 Aug 2025 10:19:39 -0400 (EDT) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-672-2_VW_IHYNymuoWOWazVvvA-1; Fri, 29 Aug 2025 10:19:37 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7F4781800561 for ; Fri, 29 Aug 2025 14:19:36 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.44.22.3]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9D38D1956095 for ; Fri, 29 Aug 2025 14:19:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1756477179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IyxmhnHVHoED7k0bq5+TFuVKNtAKX+gyrTaZz7RNhMQ=; b=aJybzFjIm++3o7md5FIyAmLhT91DjLVI2kwkO/cerGHTcYKvQ6+t6yu9i0R4w+i8aN/iGe NBnMuhQFf8p01zMXIE62Rm6GSJAeOqAkio1lI8j7XLQX+WaGDZkA5MhmGoHyPUNvV/JgQv 43gbRvo2moXch4FuzG3XWBWuD1GwOHg= X-MC-Unique: 2_VW_IHYNymuoWOWazVvvA-1 X-Mimecast-MFC-AGG-ID: 2_VW_IHYNymuoWOWazVvvA_1756477176 To: devel@lists.libvirt.org Subject: [PATCH 1/8] scripts: qemu-replies-tool: Convert the QMP conversation to list of dicts Date: Fri, 29 Aug 2025 16:19:25 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 5Wp3rM1L_5iPi-l5pcfiaWIrP2hh0fL4tL0ng0X-hTA_1756477176 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 5MNPPNU4JUIWIDZKMPUGP4PBJ6KBRPZV X-Message-ID-Hash: 5MNPPNU4JUIWIDZKMPUGP4PBJ6KBRPZV X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1756477527129116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Currently the conversation was a list of tuples. Since upcoming patches will want to store some additional flags with the processed commands convert it to a list of dicts, so that we can name the individual fields. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- scripts/qemu-replies-tool.py | 54 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/scripts/qemu-replies-tool.py b/scripts/qemu-replies-tool.py index 6d474a83f2..4ec06ee95d 100755 --- a/scripts/qemu-replies-tool.py +++ b/scripts/qemu-replies-tool.py @@ -36,13 +36,13 @@ def qemu_replies_load(filename): if command is None: command =3D json.loads(jsonstr) else: - conv.append((command, json.loads(jsonstr))) + conv.append({'cmd': command, 'rep': json.loads(jso= nstr)}) command =3D None jsonstr =3D '' if command is not None and jsonstr !=3D '': - conv.append((command, json.loads(jsonstr))) + conv.append({'cmd': command, 'rep': json.loads(jsonstr)}) command =3D None jsonstr =3D '' @@ -67,14 +67,14 @@ def qemu_replies_compare_or_replace(filename, conv, reg= enerate_on_error): seq =3D 9999 # poison the initial counter state # possibly fix mis-ordererd 'id' fields - for (cmd, rep) in conv: + for c in conv: # 'qmp_capabilities' command restarts the numbering sequence - if cmd['execute'] =3D=3D 'qmp_capabilities': + if c['cmd']['execute'] =3D=3D 'qmp_capabilities': seq =3D 1 newid =3D 'libvirt-%d' % seq - cmd['id'] =3D newid - rep['id'] =3D newid + c['cmd']['id'] =3D newid + c['rep']['id'] =3D newid seq +=3D 1 @@ -82,7 +82,7 @@ def qemu_replies_compare_or_replace(filename, conv, regen= erate_on_error): if len(actual) !=3D 0: actual +=3D '\n\n' - actual +=3D json.dumps(cmd, indent=3D2) + '\n\n' + json.dumps(rep,= indent=3D2) + actual +=3D json.dumps(c['cmd'], indent=3D2) + '\n\n' + json.dumps= (c['rep'], indent=3D2) expect =3D '' actual +=3D '\n' @@ -114,9 +114,9 @@ def modify_replies(conv): version =3D None # filled with a dictionary with 'major', 'minor', '= micro' keys # find version of current qemu for later use - for (cmd, rep) in conv: - if cmd['execute'] =3D=3D 'query-version': - version =3D rep['return']['qemu'] + for c in conv: + if c['cmd']['execute'] =3D=3D 'query-version': + version =3D c['rep']['return']['qemu'] break if version is None: @@ -126,9 +126,9 @@ def modify_replies(conv): # Find index of a command, in this case we're looking for the last # invocation of given command for i in range(len(conv)): - (cmd, rep) =3D conv[i] + c =3D conv[i] - if cmd['execute'] =3D=3D 'device-list-properties': + if c['cmd']['execute'] =3D=3D 'device-list-properties': idx =3D i if idx =3D=3D -1: @@ -161,9 +161,9 @@ def modify_replies(conv): # insert command into the QMP conversation based on version of qemu if version['major'] >=3D 8 and version['minor'] > 0: - conv.insert(idx, (cmd, reply)) + conv.insert(idx, {'cmd': cmd, 'rep': reply}) else: - conv.insert(idx, (cmd, reply_unsupp)) + conv.insert(idx, {'cmd': cmd, 'rep': reply_unsupp}) # Validates that 'entry' (an member of the QMP schema): @@ -389,9 +389,9 @@ def dump_qmp_probe_strings(schemalist): def dump_qom_list_types(conv): types =3D [] - for (cmd, rep) in conv: - if cmd['execute'] =3D=3D 'qom-list-types': - for qomtype in rep['return']: + for c in conv: + if c['cmd']['execute'] =3D=3D 'qom-list-types': + for qomtype in c['rep']['return']: # validate known fields: # 'parent' is ignored below as it causes output churn for k in qomtype: @@ -411,20 +411,20 @@ def dump_qom_list_types(conv): def dump_device_list_properties(conv): devices =3D [] - for (cmd, rep) in conv: - if cmd['execute'] =3D=3D 'device-list-properties': - if 'return' in rep: - for arg in rep['return']: + for c in conv: + if c['cmd']['execute'] =3D=3D 'device-list-properties': + if 'return' in c['rep']: + for arg in c['rep']['return']: for k in arg: if k not in ['name', 'type', 'description', 'defau= lt-value']: - raise Exception("Unhandled 'device-list-proper= ties' typename '%s' field '%s'" % (cmd['arguments']['typename'], k)) + raise Exception("Unhandled 'device-list-proper= ties' typename '%s' field '%s'" % (c['cmd']['arguments']['typename'], k)) if 'default-value' in arg: defval =3D ' (%s)' % str(arg['default-value']) else: defval =3D '' - devices.append('%s %s %s%s' % (cmd['arguments']['typen= ame'], + devices.append('%s %s %s%s' % (c['cmd']['arguments']['= typename'], arg['name'], arg['type'], defval)) @@ -441,12 +441,12 @@ def process_one(filename, args): modify_replies(conv) - for (cmd, rep) in conv: - if cmd['execute'] =3D=3D 'query-qmp-schema': - validate_qmp_schema(rep['return']) + for c in conv: + if c['cmd']['execute'] =3D=3D 'query-qmp-schema': + validate_qmp_schema(c['rep']['return']) if args.dump_all or args.dump_qmp_query_strings: - dump_qmp_probe_strings(rep['return']) + dump_qmp_probe_strings(c['rep']['return']) dumped =3D True if args.dump_all or args.dump_qom_list_types: --=20 2.51.0 From nobody Sun Sep 7 23:35:48 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1756477986; cv=none; d=zohomail.com; s=zohoarc; b=HV6YXjOU0OPWueWWXkGGUH3IOhk5SsT1g1REF0Jm024U/zezLXXShJJJ4V+VgT7+w+g22kelgPwAvPKe+xn5/0LSRjvQLkViVjdzFnxc+4TppLxrQNE8sQ7t6Rh8NVlMLTRSoz85zegVqa3W4fkmNPxfkAVO/eWkYHEEsC5PEMs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756477986; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=R7O3rrt/4TbrvnwST5P0x3oy7lmV4CbAHkczfcfoW3I=; b=R8vyus6KMjbbgQwxV46S7itPXn+0uQFg2p7Oq0U1t2MJaarmrJqYx5UYcV0HJpP0G42hDbs5XP+W05TrdSZD2+4XwHxiMVONpVRE7DbPFe4bzzxkQE+clN/Nc7JB89t2lqBJHSfukytE2v2YgPNzFGPei7j0/A1bROHQPtefAIM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1756477986726912.9810611935961; Fri, 29 Aug 2025 07:33:06 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 1142644255; Fri, 29 Aug 2025 10:33:06 -0400 (EDT) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 1354944341; Fri, 29 Aug 2025 10:20:21 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 9FEB144194; Fri, 29 Aug 2025 10:19:48 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 393034411F for ; Fri, 29 Aug 2025 10:19:46 -0400 (EDT) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-615-wTZfU1dKNzGcnu1n6SbREA-1; Fri, 29 Aug 2025 10:19:38 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A6752180035C for ; Fri, 29 Aug 2025 14:19:37 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.44.22.3]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E072A1956095 for ; Fri, 29 Aug 2025 14:19:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1756477185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R7O3rrt/4TbrvnwST5P0x3oy7lmV4CbAHkczfcfoW3I=; b=LTZZCtK9zf09icn/oKJALOr/jARWr4j+V4Q1joulWZXu7P2o+wi1cSllkBOuXB2CBYQqjh EgDG6x9382g9SbfWBEH3mEnm/ITyY+hCiZ5LuAPej0fRR3pSFrCXqqTNGMj2YdD+Ix6d8W 2qOg3uKDKsegrfE49tIwdUvnvU1zSCM= X-MC-Unique: wTZfU1dKNzGcnu1n6SbREA-1 X-Mimecast-MFC-AGG-ID: wTZfU1dKNzGcnu1n6SbREA_1756477177 To: devel@lists.libvirt.org Subject: [PATCH 2/8] scripts: qemu-replies-tool: Drop specific invocation of marginally useful dump modes Date: Fri, 29 Aug 2025 16:19:26 +0200 Message-ID: <1870334d2160f070196921db40bc16c0cf52611a.1756477095.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: J0_0u8O9Y1CNvbztHUtwD-F0VyKDtFjSa6IEdF4lECc_1756477177 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: XZZTXZCFBYKM7HNINF4S5VU4CXBO7MEL X-Message-ID-Hash: XZZTXZCFBYKM7HNINF4S5VU4CXBO7MEL X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1756477990465124100 Content-Type: text/plain; charset="utf-8" From: Peter Krempa While '--dump-qmp-query-strings' is useful by itself because it's a simple way to generate the QMP schema query strings for libvirt, the other modes aren't useful besides comparing two .replies files by the dumped output. Remove specific options for '--dump-qom-list-types' and '--dump-device-list-properties', so that upcoming additions which will be useful only for comparisons aren't forced to add these options. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- scripts/qemu-replies-tool.py | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/scripts/qemu-replies-tool.py b/scripts/qemu-replies-tool.py index 4ec06ee95d..b5e4ae46ca 100755 --- a/scripts/qemu-replies-tool.py +++ b/scripts/qemu-replies-tool.py @@ -449,11 +449,8 @@ def process_one(filename, args): dump_qmp_probe_strings(c['rep']['return']) dumped =3D True - if args.dump_all or args.dump_qom_list_types: + if args.dump_all: dump_qom_list_types(conv) - dumped =3D True - - if args.dump_all or args.dump_device_list_properties: dump_device_list_properties(conv) dumped =3D True @@ -492,7 +489,8 @@ In 'dump' mode if '-dump-all' or one of the specific '-= dump-*' flags (below) is selected the script outputs information gathered from the given '.repli= es' file. The data is also usable for comparing two '.replies' files in a "dif= fable" fashion as many of the query commands may change ordering or naming without -functional impact on libvirt. +functional impact on libvirt. The following specific dump options are usef= ul +on it's own: --dump-qmp-query-strings @@ -501,16 +499,6 @@ functional impact on libvirt. virQEMUCapsQMPSchemaQueries. It's useful to find specific query string without having to piece the information together from 'query-qmp-schem= a' - --dump-qom-list-types - - Dumps all types returned by 'qom-list-types' in a stable order with the - 'parent' property dropped as it's not relevant for libvirt. - - --dump-device-list-properties - - Dumps all properties of all devices queried by libvirt in stable order - along with types and default values. - The tool can be also used to programmaticaly modify the '.replies' file by editing the 'modify_replies' method directly in the source, or for re-formatting and re-numbering the '.replies' file to conform with the req= uired @@ -541,12 +529,6 @@ parser.add_argument('--dump-all', action=3D'store_true= ', parser.add_argument('--dump-qmp-query-strings', action=3D'store_true', help=3D'dump QMP schema in form of query strings used = to probe capabilities') -parser.add_argument('--dump-qom-list-types', action=3D'store_true', - help=3D'dump data from qom-list-types in a stable orde= r') - -parser.add_argument('--dump-device-list-properties', action=3D'store_true', - help=3D'dump all devices and their properties') - args =3D parser.parse_args() files =3D [] --=20 2.51.0 From nobody Sun Sep 7 23:35:48 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1756477678; cv=none; d=zohomail.com; s=zohoarc; b=JUJZan/f5yrS1s//qCepKNcWAmx0GSdteL7bF2iVK9zQVe4UU90XHqk9mw1RerjjLtyqpNrNlXozvutnoVEp24kc0qwrR/yK7Df8IMTVg7C6hf8RG1RgpOIemTGikVHdZa9wJpSFH3S/XFf1Q9c57qCLot5sCXCfM324CYE/ZZM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756477678; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=mWqBiRZE8CbYEoYTZlknZ8KsVL0vniD6tQGH7EoUEcw=; b=INP6d7ktItjlp5RGvsm5HxhjCRojp6DZqDhITPokTlFBo9oZaame6O+zLTTkrOazm/g8eI/VpIhAgM8LpF6ESWjzl4dwtDtzh/QtGcYpjjZS1kHDCkBPwbcCSnRupwniWe0RINvyocrgsHhQ0L/hlgOEdcV8CF7LgveFUBfFb20= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1756477678822310.6913034982023; Fri, 29 Aug 2025 07:27:58 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id ED8C244159; Fri, 29 Aug 2025 10:27:57 -0400 (EDT) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id AB0744426B; Fri, 29 Aug 2025 10:20:08 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 83DE844183; Fri, 29 Aug 2025 10:19:47 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 91F284411C for ; Fri, 29 Aug 2025 10:19:41 -0400 (EDT) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-215-5z8lXmLnM0GljYLJVxT_Sg-1; Fri, 29 Aug 2025 10:19:39 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E45AF19560A6 for ; Fri, 29 Aug 2025 14:19:38 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.44.22.3]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2B1211956095 for ; Fri, 29 Aug 2025 14:19:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1756477181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mWqBiRZE8CbYEoYTZlknZ8KsVL0vniD6tQGH7EoUEcw=; b=UrVMsh/NBIcX6HzjsTJM0wG0qAPauxZN0uLL5p22oO8d3xgOHKYl9N1yY9rSIMN4mFnTag u81tqUcwIb8M6v2V8D8w7XNaJk3HYgzwDmW6m0fx2ZrSLljZL5xE7pNssEUnU4My43L1pK 1NpJ3vrghh+YcuJh1BdPTIWIC2tVT9g= X-MC-Unique: 5z8lXmLnM0GljYLJVxT_Sg-1 X-Mimecast-MFC-AGG-ID: 5z8lXmLnM0GljYLJVxT_Sg_1756477179 To: devel@lists.libvirt.org Subject: [PATCH 3/8] scripts: qemu-replies-tool: Dump machine types in --dump-all Date: Fri, 29 Aug 2025 16:19:27 +0200 Message-ID: <6888f9ebc155a992fd128752afbbc53dafcd165c.1756477095.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: --_-NFME5h-wO13jgTTh3S2BKNQMjJC9zMGGtIOtQvM_1756477179 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: M43FLP3CSNI6LGRDHWZXQEIE2PVAFT5E X-Message-ID-Hash: M43FLP3CSNI6LGRDHWZXQEIE2PVAFT5E X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1756477681621116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Dumps the supported machine types and their deprecation state in stable human-sort order. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- scripts/qemu-replies-tool.py | 57 ++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/scripts/qemu-replies-tool.py b/scripts/qemu-replies-tool.py index b5e4ae46ca..211c448482 100755 --- a/scripts/qemu-replies-tool.py +++ b/scripts/qemu-replies-tool.py @@ -10,6 +10,7 @@ import argparse import json import os import sys +import re class qrtException(Exception): @@ -434,6 +435,61 @@ def dump_device_list_properties(conv): print('(dev) ' + d) +# Sort helper for version string e.g. '11.0', '1.2' etc. Tolerates empty v= ersion. +def machine_type_sorter(item): + key =3D item[0] + + if key =3D=3D '': + return [0] + + return list(map(int, key.split('.'))) + + +def dump_machine_types(conv): + machines =3D dict() + aliases =3D [] + + for c in conv: + if c['cmd']['execute'] =3D=3D 'query-machines': + for machine in c['rep']['return']: + deprecated =3D False + name =3D machine['name'] + version =3D '' + match =3D re.fullmatch(r'(.+)-(\d+\.\d+)', name) + + if match is not None: + name =3D match.group(1) + version =3D match.group(2) + + if 'deprecated' in machine: + deprecated =3D machine['deprecated'] + + if 'alias' in machine: + aliases.append('%s -> %s' % (machine['alias'], machine= ['name'])) + + if name not in machines: + machines[name] =3D {} + + machines[name][version] =3D deprecated + break + + for (machine, versions) in sorted(machines.items()): + for (version, deprecated) in sorted(versions.items(), key=3Dmachin= e_type_sorter): + d =3D '' + if deprecated: + d =3D ' (deprecated)' + + if len(version) > 0: + version =3D '-' + version + + print('(machine) %s%s%s' % (machine, version, d)) + + aliases.sort() + + for a in aliases: + print('(machine alias) ' + a) + + def process_one(filename, args): try: conv =3D qemu_replies_load(filename) @@ -452,6 +508,7 @@ def process_one(filename, args): if args.dump_all: dump_qom_list_types(conv) dump_device_list_properties(conv) + dump_machine_types(conv) dumped =3D True if dumped: --=20 2.51.0 From nobody Sun Sep 7 23:35:48 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1756477780; cv=none; d=zohomail.com; s=zohoarc; b=K80RPozpd65zpLU85FY65EMzQZHJp6gsapIkrtV6gLeu45tkXs+gz2Yb5kVXgdei+/M1cs2YoguSup86+zylwY4ORveV4NJfMQSvtaibgUWuScp9WmGHbPqMx7AREudFw+5hXF9A35yOiIl5uQ0BNdr5p/DZeE04WIVVTlvgoFg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756477780; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=DhbciPA2WlWjYnuyHC0BKEXtxTcP2H2blOojG4u2J+c=; b=Tg5cdYi9osiMPvTCel3UTXYvtipctvXdN6hw9BBGVACuaRK+iO5mIMjDtN4WYFMBWj7YDQ1/lw1ReS8TC92tm41JtMGYfLSMO66Vbcvf0z7M68W17Xa3F/bz2JrEh+mLNHocUiV9pvCgmqSeaPA3kcVNEexv89MBOcs9t3/tP8U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1756477780638906.6948835385149; Fri, 29 Aug 2025 07:29:40 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id BA0A443FEC; Fri, 29 Aug 2025 10:29:39 -0400 (EDT) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 1A47F442BF; Fri, 29 Aug 2025 10:20:14 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 4B33144193; Fri, 29 Aug 2025 10:19:48 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 2E75544123 for ; Fri, 29 Aug 2025 10:19:43 -0400 (EDT) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-142-TpWlOb7NPhK9GnJgUUkaxw-1; Fri, 29 Aug 2025 10:19:41 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 33024180036E for ; Fri, 29 Aug 2025 14:19:40 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.44.22.3]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6DB7F1956095 for ; Fri, 29 Aug 2025 14:19:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1756477182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DhbciPA2WlWjYnuyHC0BKEXtxTcP2H2blOojG4u2J+c=; b=XBVJh6dML/W45MZGP8UZkzE3viKM+N38fpsZNo3hxKSpDTHAC5xWtaaPWENI/zKlEZTykY BSzn9eKCEMgKbLo1rnZtXW3L1cPL+UoKuhZaqcIGoDkzXj7dIIcTAghAw5ngMg2qZcfZvJ NNI7lqng/4hfmYY3z31gK8qW4v5PAC4= X-MC-Unique: TpWlOb7NPhK9GnJgUUkaxw-1 X-Mimecast-MFC-AGG-ID: TpWlOb7NPhK9GnJgUUkaxw_1756477180 To: devel@lists.libvirt.org Subject: [PATCH 4/8] scripts: qemu-replies-tool: List also data from 'qom-list-properties' Date: Fri, 29 Aug 2025 16:19:28 +0200 Message-ID: <3858ad8eda060c63620ccf65f345b08d45e87651.1756477095.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: VfkAPP70pKS9bS5MZFRmudHTlBe9L8FsphkTzbYhZLM_1756477180 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: AWKAJCXXNPHZR6756O77EGC35BN7SDOL X-Message-ID-Hash: AWKAJCXXNPHZR6756O77EGC35BN7SDOL X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1756477784695124100 Content-Type: text/plain; charset="utf-8" From: Peter Krempa In addition to 'device-list-properties' libvirt probes also some properties of qom types. Since the format is identical make the dumping function for 'device-list-properties' universal and make it accept also 'qom-list-types'. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- scripts/qemu-replies-tool.py | 50 +++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/scripts/qemu-replies-tool.py b/scripts/qemu-replies-tool.py index 211c448482..77d96f625d 100755 --- a/scripts/qemu-replies-tool.py +++ b/scripts/qemu-replies-tool.py @@ -409,30 +409,40 @@ def dump_qom_list_types(conv): print('(qom) ' + t) -def dump_device_list_properties(conv): - devices =3D [] +def dump_device_and_object_properties(conv): + ent =3D [] for c in conv: + prefix =3D None + if c['cmd']['execute'] =3D=3D 'device-list-properties': - if 'return' in c['rep']: - for arg in c['rep']['return']: - for k in arg: - if k not in ['name', 'type', 'description', 'defau= lt-value']: - raise Exception("Unhandled 'device-list-proper= ties' typename '%s' field '%s'" % (c['cmd']['arguments']['typename'], k)) - - if 'default-value' in arg: - defval =3D ' (%s)' % str(arg['default-value']) - else: - defval =3D '' + prefix =3D '(dev-prop)' + + if c['cmd']['execute'] =3D=3D 'qom-list-properties': + prefix =3D '(qom-prop)' + + if prefix is None or 'return' not in c['rep']: + continue + + for arg in c['rep']['return']: + for k in arg: + if k not in ['name', 'type', 'description', 'default-value= ']: + raise Exception("Unhandled 'device-list-properties'/'q= om-list-properties' typename '%s' field '%s'" % (c['cmd']['arguments']['typ= ename'], k)) + + if 'default-value' in arg: + defval =3D ' (%s)' % str(arg['default-value']) + else: + defval =3D '' - devices.append('%s %s %s%s' % (c['cmd']['arguments']['= typename'], - arg['name'], - arg['type'], - defval)) - devices.sort() + ent.append('%s %s %s %s%s' % (prefix, + c['cmd']['arguments']['t= ypename'], + arg['name'], + arg['type'], + defval)) + ent.sort() - for d in devices: - print('(dev) ' + d) + for e in ent: + print(e) # Sort helper for version string e.g. '11.0', '1.2' etc. Tolerates empty v= ersion. @@ -507,7 +517,7 @@ def process_one(filename, args): if args.dump_all: dump_qom_list_types(conv) - dump_device_list_properties(conv) + dump_device_and_object_properties(conv) dump_machine_types(conv) dumped =3D True --=20 2.51.0 From nobody Sun Sep 7 23:35:48 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1756477902; cv=none; d=zohomail.com; s=zohoarc; b=eLlv8kmeqF0t9HWLmyTOY5JcGidxEOqOsN00pl+qDStAz/wbasP8hGJmBnsf23SEHIQhQjN/MfdGCob1aAMbT602k8FSYLGPsXluoTVYusIx2Zs4tGT8LbJOyNhHfX6MZaPIBtBqC9dCikrPgKvDnf7vTj6HywF8Uv+nvUUCX8w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756477902; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=BvLjaiiCeOc1c9gOFzN2b3iBwvq9HnyRr+4gSgFqaZw=; b=kFmZxClzl9/r8T3pNpsImgJDjjlY9dNhUo0q7y2oKceiiOcD74gHNmflkdTnlYMgMYyZb2gz0TWFjma8b+3Qly9BLp6dDmg6AqKXF+kTG1QXkJKzGXgrNxa4KGP5Z4I7mxM1UXAkZS95wLL/09T64DQloswZnZF+NHDbwtEhtqU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1756477902091912.1114336563189; Fri, 29 Aug 2025 07:31:42 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 393B444154; Fri, 29 Aug 2025 10:31:41 -0400 (EDT) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 872B844304; Fri, 29 Aug 2025 10:20:17 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 60C4B44119; Fri, 29 Aug 2025 10:19:48 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 85F28440C0 for ; Fri, 29 Aug 2025 10:19:44 -0400 (EDT) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-93-fy-I41aiNjW8_X2JgCCw3Q-1; Fri, 29 Aug 2025 10:19:42 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7642F18003FC for ; Fri, 29 Aug 2025 14:19:41 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.44.22.3]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B16291956095 for ; Fri, 29 Aug 2025 14:19:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1756477184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BvLjaiiCeOc1c9gOFzN2b3iBwvq9HnyRr+4gSgFqaZw=; b=AoBsbpZRB1XZqFgvLDkn+K7PZqJ5HUfYSbetctzknR6VkjJduy+17WR00g3twkqz8XWf98 3FumdT38BppbTmsc0z1VBMLrst3BgQDWrzX0vkWuDZlj+NEMZ8Xw032m1qg9Hvd9FE4ta3 AEO3D0OgeP/I0wPN3So3WS2Ol2EKnPo= X-MC-Unique: fy-I41aiNjW8_X2JgCCw3Q-1 X-Mimecast-MFC-AGG-ID: fy-I41aiNjW8_X2JgCCw3Q_1756477181 To: devel@lists.libvirt.org Subject: [PATCH 5/8] scripts: qemu-replies-tool: Prefix output with filename when dumping data for multiple files Date: Fri, 29 Aug 2025 16:19:29 +0200 Message-ID: <4a31a21864d30b3ec769e1e4f9c0360e2d4c42c3.1756477095.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: zaQ3DviMCdHr03d4mNlGIMgPlvGtePyV2KUtXe7khXY_1756477181 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: LO66X2DHBG6YYVEY5SF323WJKTSKW3KQ X-Message-ID-Hash: LO66X2DHBG6YYVEY5SF323WJKTSKW3KQ X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1756477905489116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa The --dump-* mode can be used together with --repliesdir which iterates over all '.replies' files in the directory. Make this useful by outputing the filename so the user can associate the data with the file it was dumped from. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- scripts/qemu-replies-tool.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/scripts/qemu-replies-tool.py b/scripts/qemu-replies-tool.py index 77d96f625d..8e48268456 100755 --- a/scripts/qemu-replies-tool.py +++ b/scripts/qemu-replies-tool.py @@ -371,7 +371,7 @@ def dump_qmp_probe_strings_iter(name, cur, trace, schem= a): dump_qmp_probe_strings_iter(var['type'], cur, trace, schema) -def dump_qmp_probe_strings(schemalist): +def dump_qmp_probe_strings(schemalist, dumpprefix): schemadict =3D {} toplevel =3D [] @@ -384,10 +384,10 @@ def dump_qmp_probe_strings(schemalist): toplevel.sort() for c in toplevel: - dump_qmp_probe_strings_iter(c, '(qmp) ' + c, [], schemadict) + dump_qmp_probe_strings_iter(c, dumpprefix + '(qmp) ' + c, [], sche= madict) -def dump_qom_list_types(conv): +def dump_qom_list_types(conv, dumpprefix): types =3D [] for c in conv: @@ -406,10 +406,10 @@ def dump_qom_list_types(conv): types.sort() for t in types: - print('(qom) ' + t) + print(dumpprefix + '(qom) ' + t) -def dump_device_and_object_properties(conv): +def dump_device_and_object_properties(conv, dumpprefix): ent =3D [] for c in conv: @@ -442,7 +442,7 @@ def dump_device_and_object_properties(conv): ent.sort() for e in ent: - print(e) + print(dumpprefix + e) # Sort helper for version string e.g. '11.0', '1.2' etc. Tolerates empty v= ersion. @@ -455,7 +455,7 @@ def machine_type_sorter(item): return list(map(int, key.split('.'))) -def dump_machine_types(conv): +def dump_machine_types(conv, dumpprefix): machines =3D dict() aliases =3D [] @@ -497,13 +497,17 @@ def dump_machine_types(conv): aliases.sort() for a in aliases: - print('(machine alias) ' + a) + print(dumpprefix + '(machine alias) ' + a) def process_one(filename, args): try: conv =3D qemu_replies_load(filename) dumped =3D False + dumpprefix =3D '' + + if args.repliesdir: + dumpprefix =3D filename + ': ' modify_replies(conv) @@ -512,13 +516,13 @@ def process_one(filename, args): validate_qmp_schema(c['rep']['return']) if args.dump_all or args.dump_qmp_query_strings: - dump_qmp_probe_strings(c['rep']['return']) + dump_qmp_probe_strings(c['rep']['return'], dumpprefix) dumped =3D True if args.dump_all: - dump_qom_list_types(conv) - dump_device_and_object_properties(conv) - dump_machine_types(conv) + dump_qom_list_types(conv, dumpprefix) + dump_device_and_object_properties(conv, dumpprefix) + dump_machine_types(conv, dumpprefix) dumped =3D True if dumped: --=20 2.51.0 From nobody Sun Sep 7 23:35:48 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1756478083; cv=none; d=zohomail.com; s=zohoarc; b=ipmhF3wpRYdgn0ahXpJ/4nbJwoPTW4zESCS0By4X3N07lOXRVKQPgOsNzGeYnubs0zEnMLwCEKRtIFLgSXGIDT+PKRAzwuQDyJYfct9X3QK0azRvOZFPdSYjjZtfCDVPovuYFgoZ62vywnpY25gFR6uqtkEAFV0avcTMedn2M+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756478083; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=OnwoXEBWCxElm4BQIuNSNX/NpEFYzG94GKy541kH2Gg=; b=KMObI4wkxEaru8zbKD0C59WjdBIdfsXtc4WDsqcc9qGnvAfVXVVTZV3GIbccT+hqDPA1U68twqQ3yXj0JVdyZNTTSHR/SADhP8iLUptfThfEo1GGRdpQj4MbGJ7F0NDTqB8fUs6qVz6lpaMQh6wc0newIhJkj+RG3SDAGaFUdZs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1756478083212446.67842986799064; Fri, 29 Aug 2025 07:34:43 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 9980E4413A; Fri, 29 Aug 2025 10:34:42 -0400 (EDT) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 2ADDD4438A; Fri, 29 Aug 2025 10:20:24 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 3708E441A3; Fri, 29 Aug 2025 10:19:49 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 54F474411E for ; Fri, 29 Aug 2025 10:19:45 -0400 (EDT) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-297-5Oe4QSShPTmqMqzYTXUV3g-1; Fri, 29 Aug 2025 10:19:43 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B5FBA1800297 for ; Fri, 29 Aug 2025 14:19:42 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.44.22.3]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EC70919560AB for ; Fri, 29 Aug 2025 14:19:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1756477185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OnwoXEBWCxElm4BQIuNSNX/NpEFYzG94GKy541kH2Gg=; b=PPI8AaFiGSeL+kRcl7WpZ245LBOdHXXgn4SAVOq0HXd9qeD7tNpekthDZJk4Dyfdyl0CGD MX5ML1AUoArpXfh9+pVfZAVoqOovl1flBSlb5gq3bEgTCk9v8fOg7WhpK0ekJOU4RNM2f9 adSXq2EfAgWTJJoIzLlBurf0b0uyDTw= X-MC-Unique: 5Oe4QSShPTmqMqzYTXUV3g-1 X-Mimecast-MFC-AGG-ID: 5Oe4QSShPTmqMqzYTXUV3g_1756477182 To: devel@lists.libvirt.org Subject: [PATCH 6/8] scripts: qemu-replies-tool: Dump data from query-version/query-target/query-kvm Date: Fri, 29 Aug 2025 16:19:30 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 9SZ4SqOqagtc_0IYK-IjKLVffoTqBgxjjtvYIH1r-Hg_1756477182 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: WHKZJC5JH7XDU4LO7W7QJA2CKBIHMHTL X-Message-ID-Hash: WHKZJC5JH7XDU4LO7W7QJA2CKBIHMHTL X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1756478085694124100 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Process few other simple commands. While this output doesn't change places it's useful to see it when comparing the dumps of two .replies files. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- scripts/qemu-replies-tool.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/qemu-replies-tool.py b/scripts/qemu-replies-tool.py index 8e48268456..7cda1d57ad 100755 --- a/scripts/qemu-replies-tool.py +++ b/scripts/qemu-replies-tool.py @@ -500,6 +500,24 @@ def dump_machine_types(conv, dumpprefix): print(dumpprefix + '(machine alias) ' + a) +def dump_other(conv, dumpprefix): + for c in conv: + if c['cmd']['execute'] =3D=3D 'query-version': + print('%s(version) %s.%s.%s %s' % (dumpprefix, + c['rep']['return']['qemu'][= 'major'], + c['rep']['return']['qemu'][= 'minor'], + c['rep']['return']['qemu'][= 'micro'], + c['rep']['return']['package= '])) + + if c['cmd']['execute'] =3D=3D 'query-target': + print('%s(target) %s' % (dumpprefix, c['rep']['return']['arch'= ])) + + if c['cmd']['execute'] =3D=3D 'query-kvm': + print('%s(kvm) present:%s enabled:%s' % (dumpprefix, + c['rep']['return']['p= resent'], + c['rep']['return']['e= nabled'])) + + def process_one(filename, args): try: conv =3D qemu_replies_load(filename) @@ -520,6 +538,7 @@ def process_one(filename, args): dumped =3D True if args.dump_all: + dump_other(conv, dumpprefix) dump_qom_list_types(conv, dumpprefix) dump_device_and_object_properties(conv, dumpprefix) dump_machine_types(conv, dumpprefix) --=20 2.51.0 From nobody Sun Sep 7 23:35:48 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1756478200; cv=none; d=zohomail.com; s=zohoarc; b=bqXQoxZAn3+PMXlOfaxHzsx7cbz5a419OBomRjwthvveW0QNHsxx3kzTRwQcc8HpjnUezAvpmGbCd6tvh250OEcu8YSmZw+Bp+iFxjNJN0hu2unPajmuy6xyx8nbVFEZPKLacGNUdq1ZrDLElstd3nLt5vhZpRETAUl4XOlx5Lc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756478200; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=kr6QyBNg4hFgQ8mhZ9FTdqBBh1JVkzgQS3d7Yej3MG0=; b=QVS5q1JYHn8nBkxlnS7jbmmBb9TRP8dbZ8fClkIghLve/rdCnbZphCQSzcrGurxompB/riEf1pk9F54f7CQY3D+gjUVGZ/iBYGhjFwrCyBiCPLsDrXCY5ZNS3uMsNJYoreSH213dn7qRtaHy1m7fHV5EGeuYPnQpLiMVkMoyjmc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1756478200910780.6030576827861; Fri, 29 Aug 2025 07:36:40 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id E536E442A8; Fri, 29 Aug 2025 10:36:39 -0400 (EDT) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id DA139443CA; Fri, 29 Aug 2025 10:20:26 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 186694412A; Fri, 29 Aug 2025 10:19:52 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 91CC64412E for ; Fri, 29 Aug 2025 10:19:46 -0400 (EDT) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-444-3Fvz8gUXPCCNiIt5LorRjw-1; Fri, 29 Aug 2025 10:19:44 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F1C561956089 for ; Fri, 29 Aug 2025 14:19:43 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.44.22.3]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 350071956095 for ; Fri, 29 Aug 2025 14:19:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1756477186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kr6QyBNg4hFgQ8mhZ9FTdqBBh1JVkzgQS3d7Yej3MG0=; b=FLIqQSg/8qvRkIg+0RTsFcdsg+PL44v8uTstlk00bqSp+iTmTwE0wyOZr4W+1YsBsf6B1U +NGslOYpExu+KP6zDFToCBD8c6gfHmrPwWRgXM1gP+2pa0tzU2L2oH2n5gVOGhB5b7WnFb orVPDI+wdU+iTAxXIZEg9hohnOxLv/A= X-MC-Unique: 3Fvz8gUXPCCNiIt5LorRjw-1 X-Mimecast-MFC-AGG-ID: 3Fvz8gUXPCCNiIt5LorRjw_1756477184 To: devel@lists.libvirt.org Subject: [PATCH 7/8] scripts: qemu-replies-tool: Add stable dump of 'query-command-line-options' Date: Fri, 29 Aug 2025 16:19:31 +0200 Message-ID: <34cd8660ce44bf65d4ab15f75a295c5b3ac7db24.1756477095.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: TkLW952MBI20G3w98xm_MUsPC36yeKxEltloOfVUODA_1756477184 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: U3DUE7SOP3G7ZTHU7GEBHTLZ5XUFT33D X-Message-ID-Hash: U3DUE7SOP3G7ZTHU7GEBHTLZ5XUFT33D X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1756478202727116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa While 'query-command-line-options' is usually fairly stable (for comparing between two .replies files) it's simpler to compare it in the dumped variant. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- scripts/qemu-replies-tool.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/qemu-replies-tool.py b/scripts/qemu-replies-tool.py index 7cda1d57ad..e5a1b2fb3e 100755 --- a/scripts/qemu-replies-tool.py +++ b/scripts/qemu-replies-tool.py @@ -500,6 +500,19 @@ def dump_machine_types(conv, dumpprefix): print(dumpprefix + '(machine alias) ' + a) +def dump_command_line_options(c, dumpprefix): + optpar =3D [] + + for opt in c['rep']['return']: + for par in opt['parameters']: + optpar.append('%s %s' % (opt['option'], par['name'])) + + optpar.sort() + + for o in optpar: + print(dumpprefix + '(cl-opt) ' + o) + + def dump_other(conv, dumpprefix): for c in conv: if c['cmd']['execute'] =3D=3D 'query-version': @@ -517,6 +530,9 @@ def dump_other(conv, dumpprefix): c['rep']['return']['p= resent'], c['rep']['return']['e= nabled'])) + if c['cmd']['execute'] =3D=3D 'query-command-line-options': + dump_command_line_options(c, dumpprefix) + def process_one(filename, args): try: --=20 2.51.0 From nobody Sun Sep 7 23:35:48 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1756478308; cv=none; d=zohomail.com; s=zohoarc; b=ChbosOUiLIqOEcS6Lkt5aHEjbpS797fUrvIw1iftz58xCTHNA5jy6xI+l7ceJ8VOGFKOlietNQbALZJuyY9rYM511Yr6wFGCsWP1UFD/kbPSotjwf63tP2UxXoxPhrVQl1fuBuilyWfPTFRB9yCG/Isk7DX8nauGgy1zye3V0Uk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756478308; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=YvU3FAD6GZejL21nzY9DaNjr0nfG5KY4+IfGCJPXsS0=; b=joTjO0iP1endKnsPy93+DBI5o79F6KkvvUIm1CNIMYp6BnZUK8koCOzISfHKjqsylccX95bz5sjbGV019S0FQt9sECu4ph0kySJjLi5767+TzB4zlp/fNkn+lIvin83iyj2dO9GQwRDXa6pTTsB0qf/QfHYIRLOOxNx5M7cY9Vo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1756478308036547.5785356945731; Fri, 29 Aug 2025 07:38:28 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 744ED44154; Fri, 29 Aug 2025 10:38:27 -0400 (EDT) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 378B44440A; Fri, 29 Aug 2025 10:20:30 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 511EE44120; Fri, 29 Aug 2025 10:19:57 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id AAD704418C for ; Fri, 29 Aug 2025 10:19:47 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-401-pHjkaAAEOaS1pYFpfZWeTw-1; Fri, 29 Aug 2025 10:19:46 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3D48B1800378 for ; Fri, 29 Aug 2025 14:19:45 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.44.22.3]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 788551956095 for ; Fri, 29 Aug 2025 14:19:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1756477187; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YvU3FAD6GZejL21nzY9DaNjr0nfG5KY4+IfGCJPXsS0=; b=fG0DPbhGkGrRnxqiCUvPAX946NOOBlms5POS+Wvjp1G9TndiJ/4WMgdOQEmIaJpHnOdgq4 ddaZ0IKDjixheLM9r1wl786DM1eXh4GGQ/kHMOkHfpm2VWsd+LdeuwQvpiacitdhfuIG98 S8ocfTJaffhOnb8WnFIVmL5DYXPDxCw= X-MC-Unique: pHjkaAAEOaS1pYFpfZWeTw-1 X-Mimecast-MFC-AGG-ID: pHjkaAAEOaS1pYFpfZWeTw_1756477185 To: devel@lists.libvirt.org Subject: [PATCH 8/8] scripts: qemu-replies-tool: Add option to dump JSON commands that weren't processed by --dump-all Date: Fri, 29 Aug 2025 16:19:32 +0200 Message-ID: <036f99f66f03df6017dc897692e202c61e05c762.1756477095.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: m9zJmEFDfPiwYJeovut2Y9UYoDjOjY1is2eKNKBavW8_1756477185 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: KSX73ESTE3QDXXSNJAGGBJKF6TZK4HB7 X-Message-ID-Hash: KSX73ESTE3QDXXSNJAGGBJKF6TZK4HB7 X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1756478309124124100 Content-Type: text/plain; charset="utf-8" From: Peter Krempa This is useful for checking that the script still covers everything when using it to compare two .replies files. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- scripts/qemu-replies-tool.py | 59 ++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/scripts/qemu-replies-tool.py b/scripts/qemu-replies-tool.py index e5a1b2fb3e..cf99ecd1f3 100755 --- a/scripts/qemu-replies-tool.py +++ b/scripts/qemu-replies-tool.py @@ -401,6 +401,8 @@ def dump_qom_list_types(conv, dumpprefix): types.append(qomtype['name']) + c['processed'] =3D True + break types.sort() @@ -421,7 +423,12 @@ def dump_device_and_object_properties(conv, dumpprefix= ): if c['cmd']['execute'] =3D=3D 'qom-list-properties': prefix =3D '(qom-prop)' - if prefix is None or 'return' not in c['rep']: + if prefix is None: + continue + + c['processed'] =3D True + + if 'return' not in c['rep']: continue for arg in c['rep']['return']: @@ -458,9 +465,16 @@ def machine_type_sorter(item): def dump_machine_types(conv, dumpprefix): machines =3D dict() aliases =3D [] + dumped_kvm =3D False for c in conv: if c['cmd']['execute'] =3D=3D 'query-machines': + + c['processed'] =3D True + + if dumped_kvm: + continue + for machine in c['rep']['return']: deprecated =3D False name =3D machine['name'] @@ -481,7 +495,9 @@ def dump_machine_types(conv, dumpprefix): machines[name] =3D {} machines[name][version] =3D deprecated - break + + # Dump only the machines for the first occurence of 'query= -machines' + dumped_kvm =3D True for (machine, versions) in sorted(machines.items()): for (version, deprecated) in sorted(versions.items(), key=3Dmachin= e_type_sorter): @@ -521,17 +537,47 @@ def dump_other(conv, dumpprefix): c['rep']['return']['qemu'][= 'minor'], c['rep']['return']['qemu'][= 'micro'], c['rep']['return']['package= '])) + c['processed'] =3D True if c['cmd']['execute'] =3D=3D 'query-target': print('%s(target) %s' % (dumpprefix, c['rep']['return']['arch'= ])) + c['processed'] =3D True if c['cmd']['execute'] =3D=3D 'query-kvm': print('%s(kvm) present:%s enabled:%s' % (dumpprefix, c['rep']['return']['p= resent'], c['rep']['return']['e= nabled'])) + c['processed'] =3D True if c['cmd']['execute'] =3D=3D 'query-command-line-options': dump_command_line_options(c, dumpprefix) + c['processed'] =3D True + + +# dumps the parts of the .replies file which are not handled by the variou= s dump_ +# helpers +def dump_unprocessed(conv): + actual =3D '' + + for c in conv: + if 'processed' in c and c['processed'] is True: + continue + + # skip stuf not making sense to be processed: + # 'qmp_capabilities' - startup of QMP, no interesting data + # 'query-cpu-model-expansion' - too host dependant, nothing releva= nt + if c['cmd']['execute'] in ['qmp_capabilities', 'query-cpu-model-ex= pansion']: + continue + + # skip commands not having successful return + if 'return' not in c['rep']: + continue + + actual +=3D json.dumps(c['cmd'], indent=3D2) + '\n\n' + json.dumps= (c['rep'], indent=3D2) + + if actual !=3D '': + for line in actual.split('\n'): + print('(unprocessed) ' + line) def process_one(filename, args): @@ -551,6 +597,7 @@ def process_one(filename, args): if args.dump_all or args.dump_qmp_query_strings: dump_qmp_probe_strings(c['rep']['return'], dumpprefix) + c['processed'] =3D True dumped =3D True if args.dump_all: @@ -560,6 +607,10 @@ def process_one(filename, args): dump_machine_types(conv, dumpprefix) dumped =3D True + if args.dump_unprocessed: + dump_unprocessed(conv) + dumped =3D True + if dumped: return True @@ -635,6 +686,10 @@ parser.add_argument('--dump-all', action=3D'store_true= ', parser.add_argument('--dump-qmp-query-strings', action=3D'store_true', help=3D'dump QMP schema in form of query strings used = to probe capabilities') + +parser.add_argument('--dump-unprocessed', action=3D'store_true', + help=3D'dump JSON of commands unprocessed by any of th= e --dump-* options') + args =3D parser.parse_args() files =3D [] --=20 2.51.0