From nobody Tue Sep 9 13:52:39 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 --- 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