From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493787; cv=none; d=zohomail.com; s=zohoarc; b=ZVtMDPsFIlKIdgp9KmNZHknsFnSQJfbiPRCwFQirH0VW9VZqYgVuJtzkTcQ7bdaSMNJP+tprPZAlgATnDhWNIZYGltjGen3snEFpG55TQSftPHrpaA4oi4wqOqzXIO0+wqqD0rBHypPKAJcrsDT9OfeQfGfkG84UotMjongQQjI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493787; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SL1ZQMFYVZqYTtNaimBSrRx03AL2YY9TcP8iYzzQRMU=; b=HsQOs3s1gWwvqb221TNP7m/8ka1ib8xDw+6f0wVNSmRd8Px6YHG+YjWOLTjPQZJth1R8C7D3DqciCAm7Eu3tXQB/i1XI9bGYtqVczInR1cPgbJw9r6tUlGt4XR7qOC/wmphdwTBj1zhhQH8cBz50MFOCkwHc/rzrKXJuh1ZVXZ8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493787098939.7656385277285; Tue, 20 Oct 2026 03:56:27 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455282.1668867 (Exim 4.92) (envelope-from ) id 1xJ7Vq-0001O6-Dn; Tue, 20 Oct 2026 10:56:10 +0000 Received: by outflank-mailman (output) from mailman id 1455282.1668867; Tue, 20 Oct 2026 10:56:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Vq-0001Mm-7M; Tue, 20 Oct 2026 10:56:10 +0000 Received: by outflank-mailman (input) for mailman id 1455282; Tue, 20 Oct 2026 10:46:25 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7MP-0007Fk-M1 for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:46:25 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7MO-00CudL-Vr for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:46:25 +0200 Received: from [10.42.69.3] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74668-8faa-0a2a0a5109dd-0a2a45039d92-48 for ; Tue, 20 Oct 2026 12:46:24 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad7467d-fae8-0a2a45030019-aa0a857cd20b-3 for ; Tue, 20 Oct 2026 12:46:22 +0200 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-298-icWL8dY1Mw2Sv8wMuI-1iw-1; Tue, 20 Oct 2026 10:46:17 +0000 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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 EFCAE1955EA1; Tue, 20 Oct 2026 10:46:10 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B862C7D6; Tue, 20 Oct 2026 10:46:03 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SL1ZQMFYVZqYTtNaimBSrRx03AL2YY9TcP8iYzzQRMU=; b=GoIOFSpMGUgIb+5RE1gq7qVkaoFM2udlkHQ4p1BfDua2UtQq22cDQJnBta8aRocX7Fq8dI O/mJAxMYzV7HSEsuzwWLPRggFGSscLplK2BC/5b2zktuGlTQYNABcKu5p/3LhWnIMXwPLJ Piiz3/37Rxk/AiLVYotflTe1GkiJcKg= X-MC-Unique: icWL8dY1Mw2Sv8wMuI-1iw-1 X-Mimecast-MFC-AGG-ID: icWL8dY1Mw2Sv8wMuI-1iw_1792493173 From: marcandre.lureau@redhat.com Date: Tue, 20 Oct 2026 14:45:18 +0400 Subject: [PATCH v7 01/65] qapi/schema: Rename .lookup_entity() and tighten return type MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-1-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2295; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=NMq+Yt1ZfEaiiiNISBhSiNYen4lYgrhVdbLzdVLcgfY=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZXTleuqEiJdOJBA42CH7+pe3OkqntERWYE8 KkGpCTR7GKJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGVwAKCRDa6OEJdZac 5eYXD/90lN2dF09F8Y8jULoa/Yv/HKP5x+nzYa1fz/PQiLU7rTNVeepj43nm7pjOPbzOWrqEQTu NGoiSEKMRcvP1/dL9lcMa2CMuoel6YAqIPu3c4B7fzk9RaLK8bST/AFHrsPamduiFcq5dCcGKaG ju0zoBbLNJoiwWpPC77UMf+Clab17oGrd3Z4UfxbvjwQFg/pdxCzvARoDcoMrPWROgcdkSOxy56 Z6gpyvJsS0JuLkUElGeGWPoEAgx1DSsdcQqYRRYzQ00USvXT8UPIPr1TxhQw1E5kvawYPNKsNKA 0ajGyDh/qGM8oz38HT0eipfUQxbk8tb7XPYDfOGFlTY+onpx7NVz31xrjXvctk3vjKZAkgcyqmg RB1fck+uzzyRqd14eL/FGI9vQkNgZQQPerW76Mv0nw/WnkXLfVaC2b632vq1GWpP0HYNbveno4Y RCPyzB+PhVOAVSC08/A9hkdBN+7OmaKswbhyW0DLGJhdtmeqMfxvW9buz3UlCDtJKSO63qUb2no tAMywgLV/anwoy+3qbtqNT4ZANXeoYjryX7nYBKXePcjhoApDzPCtpb9mbVcci4eJ+HXy1wiqY5 7Q/ftdsMrLQ6OjJ/QgY7rouCvnwhQKViJteuaYK5NDjHS3qbduGhwOfg4VUfD42iQhmNxKSpseU mBGYatJXPQ/kgYg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-MFC-PROC-ID: 45G7gB1gHxDeotBxi67OEpXnN8hVmUENjXOZytJDf9I_1792493173 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-33051d/1792493182-75A814E9-22980722/0/0 X-purgate-type: clean X-purgate-size: 2344 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493788357158500 From: Markus Armbruster Commit 060b5a9323 (qapi: Dumb down QAPISchema.lookup_entity()) accidentally relaxed QAPISchema.lookup_entity()'s return type to QAPISchemaEntity. Tighten it back to QAPISchemaDefinition, and rename the method to .lookup_defn(). Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau --- docs/sphinx/qapidoc.py | 2 +- scripts/qapi/schema.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py index 54a32e45f7ed..31d09ed6343e 100644 --- a/docs/sphinx/qapidoc.py +++ b/docs/sphinx/qapidoc.py @@ -512,7 +512,7 @@ def transmogrify(self, schema: QAPISchema) -> nodes.Ele= ment: modules.add(module_source) =20 if doc.symbol: - ent =3D schema.lookup_entity(doc.symbol) + ent =3D schema.lookup_defn(doc.symbol) assert isinstance(ent, QAPISchemaDefinition) vis.visit_entity(ent) else: diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py index 8d88b40de2e1..9c9e257a8fd5 100644 --- a/scripts/qapi/schema.py +++ b/scripts/qapi/schema.py @@ -1184,11 +1184,11 @@ def _def_definition(self, defn: QAPISchemaDefinitio= n) -> None: defn.info, "%s is already defined" % other_defn.describe()) self._entity_dict[defn.name] =3D defn =20 - def lookup_entity(self, name: str) -> Optional[QAPISchemaEntity]: + def lookup_defn(self, name: str) -> Optional[QAPISchemaDefinition]: return self._entity_dict.get(name) =20 def lookup_type(self, name: str) -> Optional[QAPISchemaType]: - typ =3D self.lookup_entity(name) + typ =3D self.lookup_defn(name) if isinstance(typ, QAPISchemaType): return typ return None @@ -1324,7 +1324,7 @@ def _make_implicit_object_type( return None # See also QAPISchemaObjectTypeMember.describe() name =3D 'q_obj_%s-%s' % (name, role) - typ =3D self.lookup_entity(name) + typ =3D self.lookup_defn(name) if typ: assert isinstance(typ, QAPISchemaObjectType) # The implicit object type has multiple users. This can --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493370; cv=none; d=zohomail.com; s=zohoarc; b=d9/VoYUID6SmrcPicphte/9Y0wSkRFdpbXBhGd4azywA7Qr6tCeJVOBFO1UM2THQccpX4g4u5k2eZ1NVI0qsLu7iSb9XJ0PnHgPlT8h4IoXn1C47gzgm2YCc6xaTEXG5nX9h+4EskwEwaz1ibnryh69W09HZTdQAbYXoLvLvixM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493370; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Wrkputc8/RPpD4nnWHNw9T7RRAU4Kg2aM4nuyIGGs8E=; b=kpL3N56VUQ624sBOJUuBZyQ2ow29wF8wxIyEav5cSDPsMNFOJzLzLtUB1LWopzwmz1vAMafKkSnT0xOau6IKo+6rS58J5jX+HiNz1I2OHUMvX7mbRYULft6MacxHMVefaiSGc3p0EVdbZ0M+JBpO+2jYcVm8W2Zz4m/osGpevz8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179249337050167.48792794269627; Tue, 20 Oct 2026 03:49:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7Ml-0000iK-Vt; Tue, 20 Oct 2026 06:46:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7MU-0000WL-CL for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:46:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7MR-00057B-Oh for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:46:30 -0400 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-349-AZuVlQ_mNCWlMBKmGs5kWg-1; Tue, 20 Oct 2026 10:46:23 +0000 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 73F281800D85; Tue, 20 Oct 2026 10:46:18 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9D8411956088; Tue, 20 Oct 2026 10:46:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493187; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Wrkputc8/RPpD4nnWHNw9T7RRAU4Kg2aM4nuyIGGs8E=; b=P2KwWbnS9ygGzQ/ZLqIaSEASARp1ANhH7OH8vh9SkqbCeKGzLAOjyDqcjuuzp56faazgvM eVmAUmPzTC4TVEhpvQOPAJ9X0YS6JelQZjBH9HP2Uas5A0/IsLtPfgKkGvQOsX/wNJ5DZv 4s4hwEOGelFhvZpAi4BkPo99bXszpBM= X-MC-Unique: AZuVlQ_mNCWlMBKmGs5kWg-1 X-Mimecast-MFC-AGG-ID: AZuVlQ_mNCWlMBKmGs5kWg_1792493179 From: marcandre.lureau@redhat.com Date: Tue, 20 Oct 2026 14:45:19 +0400 Subject: [PATCH v7 02/65] qapi: Ease access to introspection names MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-2-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=7889; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=a2pApAt20adFheRFMFL0JhfgD1DBySkAUQki6ne7iLY=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZX47T8N7MhCWr0sH+GZry8k5SuXuUXyZs9e X4b68TesAyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGVwAKCRDa6OEJdZac 5auAD/4/Ie/cSClFbfq3pLk5G4chwRGPx/IkNYssN2QhE7SuensGeO9N3hAkiwjTWMQUa4RmIV3 Ih/ody0cyQZ7ebEGwThhPd/0tDx7xTVJYKJlWKSTE5TWfQGUlgdud9VFnpmx8tSWLwXoFzA3/Hi z84mm5HxX4k1UOcwbKkeDY6EkPEVuH8/N0fn/A7MiLmcS+vrSdBq2tiEnHZ2QEopsTjy7Fg+8Dm trZ5cGqVMRvocoVM8CgiT6O62rCese/7CxN6AiIHPC523itkKI9FAhKp4RCjU92vE34Y4qb3OK7 4nLiR3tXfQKU/YeaXR1MILIVGMiK5nF1dai6meQh2g2gFR5CZaT6gar5YZXLqO6P5vbb/h9A5B1 XfERQ+8YYELHMZBHW9/k9O9lzRT4AaVsNM0NRp0v7q2tBK8LXDi/gCQ8p7fmH14kbbMpCNI05fK raCcLlKl6gYu52cO8zN9VqgDnMq9FRZW0+OUXJFULxZ30mbl8FV2VQh7yqS7Pjv7b0zNHWAunEZ wonP/p1G5r2Po5hwZOcexcv5WAK6BbCPlEQLoNz9USS4GnPaglfv0pEsF4RVBhsqmN/mm7S8mbt wlt5AqKpk3Y/XRH4EIFYc+5GuwKmie/wmHA0vfOmbqn2V9JRLHgrJL5pHEdbb6UDEt2kucPZXXU qlf+go84nzQ475Q== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493372570158500 From: Markus Armbruster query-qmp-schema masks type names, because they are not part of the external interface. Marc-Andr=C3=A9 Lureau would like to also use them with qom-list & friends. Trouble is the masked names are buried deep in QAPISchemaGenIntrospectVisitor. Lift them into schema.py: new QAPISchemaDefinition method introspection_name() returns a definition's name for use in introspection. This changes the masked names, which is fine. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi/introspect.py | 23 ++++------------------- scripts/qapi/schema.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 19 deletions(-) diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 7e28de2279ad..644461560c64 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -30,7 +30,6 @@ QAPISchemaAlternatives, QAPISchemaArrayType, QAPISchemaBranches, - QAPISchemaBuiltinType, QAPISchemaEntity, QAPISchemaEnumMember, QAPISchemaFeature, @@ -177,7 +176,6 @@ def __init__(self, prefix: str, unmask: bool): self._schema: Optional[QAPISchema] =3D None self._trees: List[Annotated[SchemaInfo]] =3D [] self._used_types: List[QAPISchemaType] =3D [] - self._name_map: Dict[str, str] =3D {} self._genc.add(mcgen(''' #include "qemu/osdep.h" #include "%(prefix)sqapi-introspect.h" @@ -208,18 +206,14 @@ def visit_end(self) -> None: self._schema =3D None self._trees =3D [] self._used_types =3D [] - self._name_map =3D {} =20 def visit_needed(self, entity: QAPISchemaEntity) -> bool: # Ignore types on first pass; visit_end() will pick up used types return not isinstance(entity, QAPISchemaType) =20 def _name(self, name: str) -> str: - if self._unmask: - return name - if name not in self._name_map: - self._name_map[name] =3D '%d' % len(self._name_map) - return self._name_map[name] + assert self._schema + return self._schema.definition_introspection_name(name, self._unma= sk) =20 def _use_type(self, typ: QAPISchemaType) -> str: assert self._schema is not None @@ -237,13 +231,6 @@ def _use_type(self, typ: QAPISchemaType) -> str: # Add type to work queue if new if typ not in self._used_types: self._used_types.append(typ) - # Clients should examine commands and events, not types. Hide - # type names as integers to reduce the temptation. Also, it - # saves a few characters on the wire. - if isinstance(typ, QAPISchemaBuiltinType): - return typ.name - if isinstance(typ, QAPISchemaArrayType): - return '[' + self._use_type(typ.element_type) + ']' return self._name(typ.name) =20 @staticmethod @@ -271,8 +258,7 @@ def _gen_tree(self, name: str, mtype: str, obj: Dict[st= r, object], # Output a comment to make it easy to map masked names # back to the source when reading the generated output. comment =3D f'"{self._name(name)}" =3D {name}' - name =3D self._name(name) - obj['name'] =3D name + obj['name'] =3D self._name(name) obj['meta-type'] =3D mtype if features: obj['features'] =3D self._gen_features(features) @@ -327,8 +313,7 @@ def visit_array_type(self, name: str, info: Optional[QA= PISourceInfo], ifcond: QAPISchemaIfCond, element_type: QAPISchemaType) -> None: element =3D self._use_type(element_type) - self._gen_tree('[' + element + ']', 'array', {'element-type': elem= ent}, - ifcond) + self._gen_tree(name, 'array', {'element-type': element}, ifcond) =20 def visit_object_type_flat(self, name: str, info: Optional[QAPISourceI= nfo], ifcond: QAPISchemaIfCond, diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py index 9c9e257a8fd5..11f3accec873 100644 --- a/scripts/qapi/schema.py +++ b/scripts/qapi/schema.py @@ -136,6 +136,13 @@ def __repr__(self) -> str: def c_name(self) -> str: return c_name(self.name) =20 + def set_ordinal(self, ordinal: int) -> None: + pass + + # pylint: disable=3Dunused-argument + def introspection_name(self, unmask: bool) -> str: + return self.name + def check(self, schema: QAPISchema) -> None: assert not self._checked super().check(schema) @@ -323,6 +330,17 @@ def visit(self, visitor: QAPISchemaVisitor) -> None: =20 =20 class QAPISchemaType(QAPISchemaDefinition, ABC): + def __init__( + self, + name: str, + info: Optional[QAPISourceInfo], + doc: Optional[QAPIDoc], + ifcond: Optional[QAPISchemaIfCond] =3D None, + features: Optional[List[QAPISchemaFeature]] =3D None, + ): + super().__init__(name, info, doc, ifcond, features) + self._masked_name: Optional[str] =3D None + # Return the C type for common use. # For the types we commonly box, this is a pointer type. @abstractmethod @@ -363,6 +381,17 @@ def need_has_if_optional(self) -> bool: # Except for arrays; see QAPISchemaArrayType.need_has_if_optional(= ). return not self.c_type().endswith(POINTER_SUFFIX) =20 + def set_ordinal(self, ordinal: int) -> None: + assert not self._masked_name + self._masked_name =3D str(ordinal) + + def introspection_name(self, unmask: bool) -> str: + # Type names are not part of the external interface. Hide + # them in introspection. Also saves a few characters on the + # wire. + assert self._masked_name + return self.name if unmask else self._masked_name + def check(self, schema: QAPISchema) -> None: super().check(schema) for feat in self.features: @@ -402,6 +431,11 @@ def json_type(self) -> str: def doc_type(self) -> str: return self.json_type() =20 + def introspection_name(self, unmask: bool): + if self.json_type() =3D=3D 'int': + return 'int' + return self.name + def visit(self, visitor: QAPISchemaVisitor) -> None: super().visit(visitor) visitor.visit_builtin_type(self.name, self.info, self.json_type()) @@ -503,6 +537,9 @@ def doc_type(self) -> Optional[str]: return None return 'array of ' + elt_doc_type =20 + def introspection_name(self, unmask: bool): + return '[' + self.element_type.introspection_name(unmask) + ']' + def visit(self, visitor: QAPISchemaVisitor) -> None: super().visit(visitor) visitor.visit_array_type(self.name, self.info, self.ifcond, @@ -1182,6 +1219,7 @@ def _def_definition(self, defn: QAPISchemaDefinition)= -> None: "'%s' is already defined\n%s" % (defn.name, where)) raise QAPISemError( defn.info, "%s is already defined" % other_defn.describe()) + defn.set_ordinal(len(self._entity_dict)) self._entity_dict[defn.name] =3D defn =20 def lookup_defn(self, name: str) -> Optional[QAPISchemaDefinition]: @@ -1208,6 +1246,11 @@ def resolve_type( info, "%s uses unknown type '%s'" % (what, name)) return typ =20 + def definition_introspection_name(self, name: str, unmask: bool) -> st= r: + defn =3D self.lookup_defn(name) + assert defn + return defn.introspection_name(unmask) + def _module_name(self, fname: str) -> str: if QAPISchemaModule.is_system_module(fname): return fname --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493405; cv=none; d=zohomail.com; s=zohoarc; b=bf4svyR92YDGPmtK8pZ3qH9w0qC+3a8WMbqIWxT/abRbpEZaQqTVb0zwXtRtLCrdsvAQjQGyTEBGyJO3eZbHQ6QncnLIlx1HBqQ231WX9tiOwu0gR7lK9ZkeNpPxMZ411qmXjtEPIByOAu+++RJDhorQv/gd7j406FN2DSWHtGY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493405; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Q7myRjnvJN1zs4/WFeao6QDd+ittV+0+bFc6WNm3+3s=; b=ht+31iRubiGq78P9ItPr+gwVNWJNWYgp3zGUFMRWIVBmglJ8L3cpKfmImCZQbLc2MydHUYOWYEdsx1L07i1//OQQVyUh+2/UBBrShM8JQ3JddWEvO1qdpIE4HPMzDdWWVeDxROi0sGPcSAUVkCFvFGXn/SEGqtAa/LsBN4XWBRE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792493405837126.05826290895857; Tue, 20 Oct 2026 03:50:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7Nk-0001bf-35; Tue, 20 Oct 2026 06:47:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Md-0000hj-4y for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:46:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Mb-000599-Hv for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:46:38 -0400 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-266-qJjFWL2MMmO8dr1kA-VMhA-1; Tue, 20 Oct 2026 10:46:31 +0000 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 9A622180133B; Tue, 20 Oct 2026 10:46:26 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 20B851800643; Tue, 20 Oct 2026 10:46:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q7myRjnvJN1zs4/WFeao6QDd+ittV+0+bFc6WNm3+3s=; b=OQjmLvnw8PY85Oi31TUdRFpRfeQ8N5RlYrMqTnBegyVSapWvrzorjPRwWzIqifKZdMENVL x0n5SHgdXZLA2jzU+/HmhJbYYTZszwiQknO4vwm6QI/JxVPxGcFXMpKdsn9qnt10HRXY2i cioawTo1oXLi8vtJWF5KKwsUyyU0qzc= X-MC-Unique: qJjFWL2MMmO8dr1kA-VMhA-1 X-Mimecast-MFC-AGG-ID: qJjFWL2MMmO8dr1kA-VMhA_1792493187 From: marcandre.lureau@redhat.com Date: Tue, 20 Oct 2026 14:45:20 +0400 Subject: [PATCH v7 03/65] qapi/introspect: Simplify masked name comment emission slighly MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-3-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1620; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=VT5u6B1qUaxaf9+tLnGedzovD3GH8labF6VNv1guiyM=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZXLImEUkMO1oHPQ87OflvNF4Yi2udXpYkVC bgHxuhfWBSJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGVwAKCRDa6OEJdZac 5apPEACW7/JRacnRcMdLuR2wffTHpKlhTnnNttkfa+uxqEFGpUBAVm+QmXcBWiHQepjJYrrnCLX kX+DqErqWmeiNvxzI6JiXnzTLZT+qJhJv8xsO/VJJDrfMn1ueuWzUrj+B6OuHiY8G6sKD5B22r2 /VsVx5S39hkt2iAucJYFWX/jCbXr/n7JLfXZhIxEj5BOvCvg5Yi0LL2TqlYsbb8popca2rYP1LR NPoU4LRf51hxD2ywaO+6y/j0N21xE0p2YkndRii6LnkybRIxrfS/5bnqGpLfMNBLgkT78iIM8lt NrBUIcQuB2ZB1X0yNDB2FHzKruZggB1WNpUshItWpvIpDoPoGH3skEwfR/V5fD0qfS/LZSqqyjB 4FJtdTuRRF4YsaCbLtQNFS8/+QQV4/Vdi5fyBJBJkUomWmIJ9Gmo13qCN7QZ48ATUiFB5yMjLX9 bstCXnov+XHxOtODxHO4PES/1tyzo8hAqxMSO7jC3lVaeZiXCYHaNmzZGZmg8rw+ACTin7LuEQX oFXd4FeQcXIRzEKbNbs3ma5jEAL5lKpL5YEur2r2ksx/zaX4Ck+aLw4T4c9LwKnL2l82ALZeysf UF3MM5kuOAz2l1KljOxTX1ENX/TZBM0eH+aQiWoC7ma7Ez/O5zz63gJTXWajtX6GQgtJcz+zO1R w+mtvxa/th+1OpQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493407206158501 From: Markus Armbruster Instead of emitting the comment for certain meta-types, simply emit it when introspection name and name differ. This additionally emits it for arrays, which is fine. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi/introspect.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 644461560c64..49d1ed2897e8 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -253,12 +253,12 @@ def _gen_tree(self, name: str, mtype: str, obj: Dict[= str, object], Will be omitted from the output if empty. """ comment: Optional[str] =3D None - if mtype not in ('command', 'event', 'builtin', 'array'): - if not self._unmask: - # Output a comment to make it easy to map masked names - # back to the source when reading the generated output. - comment =3D f'"{self._name(name)}" =3D {name}' - obj['name'] =3D self._name(name) + introspection_name =3D self._name(name) + if introspection_name !=3D name: + # Output a comment to make it easy to map masked names + # back to the source when reading the generated output. + comment =3D f'"{introspection_name}" =3D {name}' + obj['name'] =3D introspection_name obj['meta-type'] =3D mtype if features: obj['features'] =3D self._gen_features(features) --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493788; cv=none; d=zohomail.com; s=zohoarc; b=mAX9i07yT3AYk7GOhCk0t1stjhH3pefMjYKOz3uTfSRWAIOmFIoXmgwSlplQcVDHBn1+xvFhb0Y2JPBP6Wi5sX4gLszd707ZslfWY0NcMwB6PBWTLygxrsQmcDD1ZtywK0qq5rMrVxBhToVUOYRAbjp6QQwQPJvEePymy9mr3ZY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493788; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=W4iwz5jM7eZNLXaBc15ajfHMaIvbcteyV5+hzYG/iP8=; b=E3Guh1tYNHco4PL9ci4R+zLjyLHFhKyquDykSf2w83IoLwlX6s/et9K6o3iluvUemZXAOs5nR0Qz8alrhE7SrESLjWNv+N8mXV/eoFyQBl09N1FcCAtWgei6M87CJVT1ilo4Hc9j6FBFzaR3HIUf/pOYT4fy+33/CnRXnX6C8v4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493788104763.9806555232408; Tue, 20 Oct 2026 03:56:28 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455288.1668882 (Exim 4.92) (envelope-from ) id 1xJ7Vr-0001ai-EB; Tue, 20 Oct 2026 10:56:11 +0000 Received: by outflank-mailman (output) from mailman id 1455288.1668882; Tue, 20 Oct 2026 10:56:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Vr-0001YM-6A; Tue, 20 Oct 2026 10:56:11 +0000 Received: by outflank-mailman (input) for mailman id 1455288; Tue, 20 Oct 2026 10:46:44 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Mi-0007HN-CJ for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:46:44 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7Mh-002ESM-Oo for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:46:43 +0200 Received: from [10.42.69.9] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74680-bab6-0a2a0a5309dd-0a2a4509d282-44 for ; Tue, 20 Oct 2026 12:46:43 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad74692-be1a-0a2a45090019-aa0a857c4f3b-3 for ; Tue, 20 Oct 2026 12:46:43 +0200 Received: from mx-prod-mc-03.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-300-zY61osTGPTaA1pnSKnNHFQ-1; Tue, 20 Oct 2026 10:46:38 +0000 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5CC261955D69; Tue, 20 Oct 2026 10:46:33 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 14CBF30000E7; Tue, 20 Oct 2026 10:46:29 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W4iwz5jM7eZNLXaBc15ajfHMaIvbcteyV5+hzYG/iP8=; b=RYpTwtrgQV9LDr6PPPWCGIvUefmfFMfa4QnuHfFNKR6T1J7fKes+R3z0I8KtXFn2z8ykPI TZ7/jE9z0T4CMAosoU0dpsH8Uv9STFnF7A4I68YlGjP78SI/xiEZaifjpFv1LL4NUWuaQ4 F93txUTVYjzk5Hi8WiKhD6jhIZqNuKo= X-MC-Unique: zY61osTGPTaA1pnSKnNHFQ-1 X-Mimecast-MFC-AGG-ID: zY61osTGPTaA1pnSKnNHFQ_1792493194 From: marcandre.lureau@redhat.com Date: Tue, 20 Oct 2026 14:45:21 +0400 Subject: [PATCH v7 04/65] qapi/introspect: Don't elide types MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-4-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=5331; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=mh48JZUSGfIpAp1DsQ/GZxfBrxYDTkjYALDPFWkE2w0=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZXTj6BLvZgq0XBaDnDR415+cGHcMUxi/2dk ZicZ3/0CO+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGVwAKCRDa6OEJdZac 5cNFEACs0g3nYzOw9mcOrDPnlJXKJuNeci0n6VbAEXZsFCZ1u4JNtS1ifs+0pHvISJaoZta0my6 lvkGupWdwq079dv7nvmOoT5lGQxsx41FDbzeMAh2AqGRiaoTGIR34hQFf3sOLgmZraxp30Lt33v I9FftBFuBgNH1cHh44kywesPPVrmlfX1fGV1hURBsBolTEkpUT+VNW3Si1XrztZk2PXf1zupIB1 6v4kYskKQkdj6v95qbfwBDHaMsgyUWRuc4dE9BsDkCCULJcdcOw0jQy+xkShVjgbTzRG/spQtdm OJgHTTwkqlLpLSzKkiZiWk130rNvNbU9ZPZZ7pWrSjD87w4sUoVTVlLNx7btfbj6VpkVI/lsNHX eXEv52qGqAcZCZptkK8oP/CIE6nCQvMdxcZ31fqe3HxosbVA5tVjhnoeC/tQyiJZuiyExxkFiJ7 0ZbpjT/AIjGFffTJ3IYXzUgPfgdB1arCF3YD86a2cQEZgHpGQtJ675JNQAPfC7Gbgpu/znK2Txl QskafbOYE8+L5oukgyV+eYRWnqzZsRIXJeUrRhCXcOW2+NOIDZyh5yfQvEaIefITC4ILWuwtEEF F1kFYI7xr5ozlv5mmkOq6tEUPt+N9cLcy/vZVW0O4PEQCCt0FJuN5TvgfUPN9YjLObVm6vjQw9L JjRCn7EZx7/9Trw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-MFC-PROC-ID: cP31hDvhxy1B8F7cAdgBeAt6ETRKpUplzKQZrcplQQs_1792493194 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-bad1c0/1792493203-39EC6034-30D853B4/0/0 X-purgate-type: clean X-purgate-size: 5380 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493790335158500 From: Markus Armbruster query-qmp-schema elides types not reachable from commands and events. It currently emits 1251 out of 1385 definitions, and elides 134 types. Whether that's worthwhile is debatable. Marc-Andr=C3=A9 Lureau would like to make QOM introspection (qom-list & friends) refer to QAPI types. We additionally need types reachable from QOM properties. Unfortunately, the QAPI generator knows nothing about QOM properties. We could manually mark the QAPI types to elide, or the QAPI types not to elide even though they are not reachable from commands and events. Feels very much not worthwhile to me. We could conservatively approximate "reachable from QOM properties" by "available for use with QOM properties". These are the built-in and user-defined types, and their arrays. With that, we'd elide just 38 out of 1385 definitions. Too few to be worthwhile. Simply emit everything. Output of query-qmp-schema grows from 247KiB to 274KiB for me. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau --- docs/devel/qapi-code-gen.rst | 2 -- scripts/qapi/introspect.py | 31 ++++--------------------------- 2 files changed, 4 insertions(+), 29 deletions(-) diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst index b1cc5b5f0db1..77f08bb68cac 100644 --- a/docs/devel/qapi-code-gen.rst +++ b/docs/devel/qapi-code-gen.rst @@ -1250,8 +1250,6 @@ JSON array of strings. To examine a type, start with a command or event using it, then follow references by name. =20 -QAPI schema definitions not reachable that way are omitted. - The SchemaInfo for a command has meta-type "command", and variant members "arg-type", "ret-type" and "allow-oob". On the wire, the "arguments" member of a client's "execute" command must conform to the diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 49d1ed2897e8..15302ecf155a 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -28,9 +28,7 @@ from .schema import ( QAPISchema, QAPISchemaAlternatives, - QAPISchemaArrayType, QAPISchemaBranches, - QAPISchemaEntity, QAPISchemaEnumMember, QAPISchemaFeature, QAPISchemaIfCond, @@ -175,7 +173,6 @@ def __init__(self, prefix: str, unmask: bool): self._unmask =3D unmask self._schema: Optional[QAPISchema] =3D None self._trees: List[Annotated[SchemaInfo]] =3D [] - self._used_types: List[QAPISchemaType] =3D [] self._genc.add(mcgen(''' #include "qemu/osdep.h" #include "%(prefix)sqapi-introspect.h" @@ -187,10 +184,6 @@ def visit_begin(self, schema: QAPISchema) -> None: self._schema =3D schema =20 def visit_end(self) -> None: - # visit the types that are actually used - for typ in self._used_types: - typ.visit(self) - # generate C name =3D c_name(self._prefix, protect=3DFalse) + 'qmp_schema_qlit' self._genh.add(mcgen(''' #include "qobject/qlit.h" @@ -205,32 +198,12 @@ def visit_end(self) -> None: c_string=3D_tree_to_qlit(self._trees))) self._schema =3D None self._trees =3D [] - self._used_types =3D [] - - def visit_needed(self, entity: QAPISchemaEntity) -> bool: - # Ignore types on first pass; visit_end() will pick up used types - return not isinstance(entity, QAPISchemaType) =20 def _name(self, name: str) -> str: assert self._schema return self._schema.definition_introspection_name(name, self._unma= sk) =20 def _use_type(self, typ: QAPISchemaType) -> str: - assert self._schema is not None - - # Map the various integer types to plain int - if typ.json_type() =3D=3D 'int': - type_int =3D self._schema.lookup_type('int') - assert type_int - typ =3D type_int - elif (isinstance(typ, QAPISchemaArrayType) and - typ.element_type.json_type() =3D=3D 'int'): - type_intlist =3D self._schema.lookup_type('intList') - assert type_intlist - typ =3D type_intlist - # Add type to work queue if new - if typ not in self._used_types: - self._used_types.append(typ) return self._name(typ.name) =20 @staticmethod @@ -295,6 +268,8 @@ def _gen_variant(self, variant: QAPISchemaVariant =20 def visit_builtin_type(self, name: str, info: Optional[QAPISourceInfo], json_type: str) -> None: + if json_type =3D=3D 'int' and name !=3D 'int': + return self._gen_tree(name, 'builtin', {'json-type': json_type}) =20 def visit_enum_type(self, name: str, info: Optional[QAPISourceInfo], @@ -312,6 +287,8 @@ def visit_enum_type(self, name: str, info: Optional[QAP= ISourceInfo], def visit_array_type(self, name: str, info: Optional[QAPISourceInfo], ifcond: QAPISchemaIfCond, element_type: QAPISchemaType) -> None: + if element_type.json_type() =3D=3D 'int' and name !=3D 'intList': + return element =3D self._use_type(element_type) self._gen_tree(name, 'array', {'element-type': element}, ifcond) =20 --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493433; cv=none; d=zohomail.com; s=zohoarc; b=nb0bbzH8uTiko4qyn9PnubyEeFEWXb9Ty7Vy8hVetBZ2Qkh9jz6VIZsULsUJDYq6AqiQtxFLzqVy96UsH9zv8jIdkqDj2cY/6W9XCE/0bN39bkaaXXVUODqflgeU+EyNtC9q47CDb55nEgXftRXkkCEifQRK/uTUaTURJ+Sfxu8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493433; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xG2OGo4lx2YCSH10YJfMac8tHdMtlMp6mBUYGSWviZ4=; b=Qb1E3h699pnSVsEuxMbNt4NbA9FMWAu0hqrzA4DjuoCOuQf1cOZuCaxozuVbVL88i4oybarb1l0IeLS+d5z7El/IirQrzr9wULv4CZT9MSudbYU6iu2hS48wPsCfH4baWndoetG+4GryPt56a6RgA/pEaQJwV9+MUfZGihn9vTA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792493433617961.408335300306; Tue, 20 Oct 2026 03:50:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7Nn-0001z7-Kd; Tue, 20 Oct 2026 06:47:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Mq-0000sg-5r for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:46:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Mo-0005BN-09 for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:46:51 -0400 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-681-dv92ItMdM9G_nQvMyXZAiA-1; Tue, 20 Oct 2026 10:46:44 +0000 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 0CCE818005B9; Tue, 20 Oct 2026 10:46:40 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 26AF11800643; Tue, 20 Oct 2026 10:46:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xG2OGo4lx2YCSH10YJfMac8tHdMtlMp6mBUYGSWviZ4=; b=Wi/LmWHgVQr37I7HM3dRB37hrGFBOQn+POAjUGkCspzb/xs7B/45HyRdqnnjjAqGsoculR Fm0PDKk0n7c/JKrKi9uVpx6BgkLIqXQ90msn/Cyu4HP2SsrypUrJhjFP4XISBKYm9L7B+z ErL74X8unniWmR4TO8fyEFMpBsEj8f8= X-MC-Unique: dv92ItMdM9G_nQvMyXZAiA-1 X-Mimecast-MFC-AGG-ID: dv92ItMdM9G_nQvMyXZAiA_1792493201 From: marcandre.lureau@redhat.com Date: Tue, 20 Oct 2026 14:45:22 +0400 Subject: [PATCH v7 05/65] qapi: QAPISchemaVisitor.visit_needed() is now unused, drop MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-5-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1193; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=yBAs+PsGI+mRRHuSXNI42xoWI9p0TSDsh65vQW8BRrc=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZX3wnVoTG1DT7PkibN0fixZC+3g4HczKxre WlR6XwfjdSJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGVwAKCRDa6OEJdZac 5XW2D/45KfzoQQ844pW9wPBstfoA4zhpxgYbXZdFhd1B3tDYs+gd0ydHZpM8roMnIC6sUz2UZVw IXLD2jiHt7yLZuphP/QVxipCVGpGWDePAo2x1ibRtN36V7QF2kYhmxqri0MMwpjy6AJMTGCUuMB xpRJlv+RypwgdJZTss3IDeLAh6amwIn5KwnKxa+VhAa1TweG97haA2x1DkLDE1BBaEBWerNMIhY XkU4aw+JMmBUEmqAu5AXPH7DXgINM5RHn/JzyiI3T7yLfmL0zAUjrq4eWRwG1HVPMGONTO7JfNE 0o0E+ULXqwLnQTgbGmZcyCHeOER/LovvzMIKrdz4xytDwyhERlt04lMyYKta/VQamfyHHL2eqte BmWKR4GrxysyQvF6+XvxLYIUbvcW/GEmZ2K3JOVgeh6yRY/mnANaUpqMzl5nZ1WZij3x49QanrG auTI+YKu1G7+pXQipQNg7LGtWo8+sBXCM44evsO6d6zedjLoJkpGbTJ2q1EbcCLvk12mjFkkh4A KdfC5MVpqO+KN0XR8txFvJs/K3UkRZlxM97ff+6aW7nGxBCmH5iL8yB/dAH2yravcO9bYYO+LQC Gs61agHa3hpCya2FC5c0KTXMLzmROHlqfLGqWdmgsZLg8hrozGFp5ahu+m+OGcL5QZ746vJi74E ghKphqYO93tyqXA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493435714158500 From: Markus Armbruster Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi/schema.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py index 11f3accec873..9e2152fa419b 100644 --- a/scripts/qapi/schema.py +++ b/scripts/qapi/schema.py @@ -179,11 +179,6 @@ def visit_end(self) -> None: def visit_module(self, name: str) -> None: pass =20 - def visit_needed(self, entity: QAPISchemaEntity) -> bool: - # pylint: disable=3Dunused-argument - # Default to visiting everything - return True - def visit_include(self, name: str, info: Optional[QAPISourceInfo]) -> = None: pass =20 @@ -315,8 +310,7 @@ def add_entity(self, ent: QAPISchemaEntity) -> None: def visit(self, visitor: QAPISchemaVisitor) -> None: visitor.visit_module(self.name) for entity in self._entity_list: - if visitor.visit_needed(entity): - entity.visit(visitor) + entity.visit(visitor) =20 =20 class QAPISchemaInclude(QAPISchemaEntity): --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493830; cv=none; d=zohomail.com; s=zohoarc; b=jVfsmD58B8DD4SAt2C9Px74fbxMWEeOcwM+3ySDQddBdAXM3PDJfUcdyrxrffW3QBG55ySswWhRMhDXC5ZrciauDHYdMvxX0Vnt+VEv4sZCRUrQJDn96afvW/4UfR2mEKLdYGolH4qpX7AJVxb66SAUBq6rTrUpprpL6sYhDYfM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493830; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1Mnn0OKxBD8aP9I5qh8TLkmYe32toylT7CmahJ3BKVM=; b=GJTHshT/BsBxvpNIw35Mw0dTXoyKaQ9DLVMu00aroxfkr3TGiss3En6GzUnXT8CMEd/F0toPwZb1EZqbPRKvcArdSppP2e8DSrMpEmG687csG6ZZ0Ox+beN/L7b5C7GMHRhSCoHmSPnvpYQsAI6yx/98zJZlrCLuByuoCiDhimw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493830669603.6302351032747; Tue, 20 Oct 2026 03:57:10 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455332.1669090 (Exim 4.92) (envelope-from ) id 1xJ7WQ-0000ae-Qe; Tue, 20 Oct 2026 10:56:46 +0000 Received: by outflank-mailman (output) from mailman id 1455332.1669090; Tue, 20 Oct 2026 10:56:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7WP-0000Rd-9z; Tue, 20 Oct 2026 10:56:45 +0000 Received: by outflank-mailman (input) for mailman id 1455332; Tue, 20 Oct 2026 10:50:58 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Qo-00006f-MJ for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:50:58 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7Qo-004d40-3B for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:50:58 +0200 Received: from [10.42.69.11] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74790-8faa-0a2a0a5109dd-0a2a450be49e-8 for ; Tue, 20 Oct 2026 12:50:58 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad746a0-b7e8-0a2a450b0019-aa0a857cb4b9-3 for ; Tue, 20 Oct 2026 12:46:57 +0200 Received: from mx-prod-mc-03.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-66-08VlUpjQOgagH2hPOiBlKQ-1; Tue, 20 Oct 2026 06:46:51 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id ACB211956044; Tue, 20 Oct 2026 10:46:46 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8DCE25BC; Tue, 20 Oct 2026 10:46:42 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1Mnn0OKxBD8aP9I5qh8TLkmYe32toylT7CmahJ3BKVM=; b=aRlEL/EKjLDgdfRlni9gHnXSERJVF4eZKFHu9aBXnfOuM3xWX4PZsr+d3kWqML647r1KxO vGjgtQTugTAHHMwnqfVUXr2pXshbCWGyg8MfkiRdfrj4vT70rHotICYF+qtNOweKEH2/gv koMWV3El6LV25ip8ifmgDgmSAr+f1xY= X-MC-Unique: 08VlUpjQOgagH2hPOiBlKQ-1 X-Mimecast-MFC-AGG-ID: 08VlUpjQOgagH2hPOiBlKQ_1792493207 From: marcandre.lureau@redhat.com Date: Tue, 20 Oct 2026 14:45:23 +0400 Subject: [PATCH v7 06/65] qapi/introspect: Tweak integer type masking MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-6-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=3300; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=Xp7N7Cw12fT4B5RHyRwaz0UVvBY0Z8fxHr38SNSrB2w=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZY+HBluuWmLicnFhqmNZvedYN8EZPAWD5tz upmO1Ga58aJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWAAKCRDa6OEJdZac 5XzlD/9HEY5z6oC69wenr9Qv7msxCbEfY7YI+AvbI4TE33VpTsB5TXw0w5hoWWG2I7nT0pxMrC6 gjxcavbpLfNQuSlpsicTsD9FELzSz+6xM2MwthryKshrqOQ9eRIaSYzYj3XG7snmj5JTIp1NNtv uGyxTUY11F5thO0nh78pl5m3FnMgJ6J+bR4QZEixKMGDsWgdCBjFf35n+hs8Zq0TNqPPWdZM4WU 57QEO3MxpnUTcn8ZIAlxz7YffgWnpU+luA9bZzFqcMNqPeQ/+RHcjv3I6UUIkEAQsDNF+gvnDrJ 0A0Spg+6FzMovmlLnKdyDNOj6AaNgCwSBLwxZYMfMpx3I4QGmDOSrKcbVpOnh6MpSqeem9v3E/A s/LAha/LFAADBkXjPbHEKPDdUytOKctZ5gi0Ohky86vcCzQBcxOVOnk4PcWYQrzYFwj9TPpC2xi deGrYMAo64/fK+8aRp2ADj0fVj4WgnOQ5R5PVEbkxEjGkosB3xcpxKcWBrP+aSookP2fMF0jWZb lKHZmcLSlzz257XcK6F/9t5jcM17+nvcivFb2k3m2Zgtv47ZxI2g3D7m4GndVEQKFcBhq2PLDyJ 1YX7I6YK/eWF/FLjTA8Tfv5IJA62HbC6KqrK/8ewzPwZHbkgvIrqnvS4oQ6Mkv3S4l3TDiGWTv8 1WOmqtKMlpy+WEQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-MFC-PROC-ID: jI1_K7Azoyc5huIZJ8ORYOUgthqX3V6_MK4I88uhwE0_1792493207 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-42698a/1792493217-182F49EA-FE0A7697/0/0 X-purgate-type: clean X-purgate-size: 3349 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493830966158500 From: Markus Armbruster Since introspection maps all integer types to 'int', we need to skip all but one of them. Instead of filtering by hardcoded name, filter out duplicates. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi/introspect.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 15302ecf155a..dc6f70a6fe9e 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -172,7 +172,7 @@ def __init__(self, prefix: str, unmask: bool): ' * QAPI/QMP schema introspection', __doc__) self._unmask =3D unmask self._schema: Optional[QAPISchema] =3D None - self._trees: List[Annotated[SchemaInfo]] =3D [] + self._trees: Dict[str, Annotated[SchemaInfo]] =3D {} self._genc.add(mcgen(''' #include "qemu/osdep.h" #include "%(prefix)sqapi-introspect.h" @@ -191,13 +191,14 @@ def visit_end(self) -> None: extern const QLitObject %(c_name)s; ''', c_name=3Dc_name(name))) + trees =3D list(self._trees.values()) self._genc.add(mcgen(''' const QLitObject %(c_name)s =3D %(c_string)s; ''', c_name=3Dc_name(name), - c_string=3D_tree_to_qlit(self._trees))) + c_string=3D_tree_to_qlit(trees))) self._schema =3D None - self._trees =3D [] + self._trees =3D {} =20 def _name(self, name: str) -> str: assert self._schema @@ -235,7 +236,12 @@ def _gen_tree(self, name: str, mtype: str, obj: Dict[s= tr, object], obj['meta-type'] =3D mtype if features: obj['features'] =3D self._gen_features(features) - self._trees.append(Annotated(obj, ifcond, comment)) + if introspection_name in self._trees: + # Duplicates are possible because + # QAPISchemaBuiltinType.introspection_name() returns 'int' + # for all integer types. Ignore them. + return + self._trees[introspection_name] =3D Annotated(obj, ifcond, comment) =20 def _gen_enum_member(self, member: QAPISchemaEnumMember ) -> Annotated[SchemaInfoEnumMember]: @@ -268,8 +274,6 @@ def _gen_variant(self, variant: QAPISchemaVariant =20 def visit_builtin_type(self, name: str, info: Optional[QAPISourceInfo], json_type: str) -> None: - if json_type =3D=3D 'int' and name !=3D 'int': - return self._gen_tree(name, 'builtin', {'json-type': json_type}) =20 def visit_enum_type(self, name: str, info: Optional[QAPISourceInfo], @@ -287,8 +291,6 @@ def visit_enum_type(self, name: str, info: Optional[QAP= ISourceInfo], def visit_array_type(self, name: str, info: Optional[QAPISourceInfo], ifcond: QAPISchemaIfCond, element_type: QAPISchemaType) -> None: - if element_type.json_type() =3D=3D 'int' and name !=3D 'intList': - return element =3D self._use_type(element_type) self._gen_tree(name, 'array', {'element-type': element}, ifcond) =20 --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493855; cv=none; d=zohomail.com; s=zohoarc; b=UUOrpHE2j0QJhgx7cCW8Ml//vLTFGHLt3/CAlHqCzpG4ivSJ5qn5bLYMdV9gUexlbsHBLL2r48o8uDtg0ehcnclIUTQ5nn+AZXBBZ5/v0VKEBLSPMqcctqRo8Tc6xVnTiAUGJh48wfFoOET542GEp4pidbzjbVkcRmEsaqFNPvk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493855; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=T4Uxxm/AUYAlgWDMQDpSo2oDR3RYBjxEx/nUKW/pClc=; b=HnanQ4tLPJ5+yMqgZqPUVajqUMkdCoSlV9zpuKyhyhqyvtuoirr+k8lrly0QREDiV5OLKnvxigL3jPustRcFiOoVFtSi8psY/WOXWU5sTgUdbhEq4p7LJo8ciIkFVNDOInfilDQI13CPaEnRr/ZqmKFppeGuavp++v+r+9A+GGQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493855948485.11485806628184; Tue, 20 Oct 2026 03:57:35 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455355.1669188 (Exim 4.92) (envelope-from ) id 1xJ7Wq-0005u3-Jz; Tue, 20 Oct 2026 10:57:12 +0000 Received: by outflank-mailman (output) from mailman id 1455355.1669188; Tue, 20 Oct 2026 10:57:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Wp-0005l4-N4; Tue, 20 Oct 2026 10:57:11 +0000 Received: by outflank-mailman (input) for mailman id 1455355; Tue, 20 Oct 2026 10:51:11 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7R1-0000Cs-IX for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:11 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7R0-00CroT-VT for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:10 +0200 Received: from [10.42.69.4] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad7479d-2eae-0a2a0a5409dd-0a2a450480cc-4 for ; Tue, 20 Oct 2026 12:51:10 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad746ad-b57f-0a2a45040019-aa0a817c56bf-3 for ; Tue, 20 Oct 2026 12:47:10 +0200 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-379-Q9FEb42bMfer0z7ZaConTg-1; Tue, 20 Oct 2026 10:46:57 +0000 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 9809D1954B20; Tue, 20 Oct 2026 10:46:52 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2267C1800444; Tue, 20 Oct 2026 10:46:49 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T4Uxxm/AUYAlgWDMQDpSo2oDR3RYBjxEx/nUKW/pClc=; b=E2K2radMdsPv/z5GuiUEacMLRQoFsy5QmnWbthuXZ0n750dz3TFMAedfzKGMnNSRjpPgAW AnKvUmnIUzisbHGnH3jWfxQVBxyuiWFhyeUJsgV2At+pcHWUXzQQWBywC/LAibKbd99pRv ZTTW1RtdOKuzzARm6TKQYLirxhpIuh8= X-MC-Unique: Q9FEb42bMfer0z7ZaConTg-1 X-Mimecast-MFC-AGG-ID: Q9FEb42bMfer0z7ZaConTg_1792493213 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:24 +0400 Subject: [PATCH v7 07/65] qapi: add QAPITypeInfo struct definition MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-7-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1828; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=ncAoduk+W++XsQQC6jhXGd6nHnXr1eyWDznZbZI1kq8=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZYgCKdk47hapDm+FojdwVHdZciBcCELJvB+ Yw7agAaZi2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWAAKCRDa6OEJdZac 5T9oD/9GpeJFOttXk8RI55B118B4xUvL1oaf8Lo8kCm7RluwGbnLkgkEWk3zfL95zz4jtUJwnKQ LkI/5HSvCywgfyFPEHSeLsTL1fdJsoyRVHSZu5kn7dXrnfwQt03BqXsZoGPyzgJ4O6dtOX+WHQ/ p6v8cw5FjgYcyrcGkoZL25m8291Qj+cifHCodAv8D8Pwc/O0TMY9tcXyBGixECq8bhC05GlyiFL 1HahUKZPfY5wzXAb1ZpI5IG4ebak9SIACrEGavNNow/2pr7YKP9Dv4SiziC+P1lhVrmELQbxRok HGAL/k9Se+GdzyvbmuU0S5/R4GZNAkxqR3Zt8oy+8jyDYnlw8M9s/RPqgkS98TF1jpcFKlp/7EA YNW4QBcSGFwWOBrSYO2580wx+fB01GWAv5Oxz3vyKBSQyKgmF04H7rB9l2vKNMWnxKRzNqjbmXt 8EvxF5m5VzSm7Pv1Y7jp9cZ/hGY7hDy84syz2Amn5jd7IFzuDgcyRV5G0EZQisXAao1ed7uWeCA rdKBAJUAVv0WyiAVn5qgDoZcqgLGp/vBung/13PF3FFVyJdvO3llipzkXBwaLeKpimriCvSA0ag eO9DfBCSkrhnJUIyeTawq6BHzOMEOc9xWB+Mubdj/bUzMsWXWGu7MXSGR9kP+1Nkw0P1SbqEYCO SE+11f2XzLE52rQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-MFC-PROC-ID: 6b_Va5ds9oq5M8Iyga0PJdskdc_VHzxTuAwpCnJshyg_1792493213 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-ebf023/1792493230-C14D3B50-61B11E91/0/0 X-purgate-type: clean X-purgate-size: 1830 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493857429158500 Introduce a minimal struct that pairs a QAPI type's internal name with its "masked" introspection name. Generated constants of this type will let QOM property registration carry a reliable reference to the QAPI schema and possibly other associated data. The fields are populated in following commits. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/qapi/qapi-type-info.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/include/qapi/qapi-type-info.h b/include/qapi/qapi-type-info.h new file mode 100644 index 000000000000..6a6355568325 --- /dev/null +++ b/include/qapi/qapi-type-info.h @@ -0,0 +1,31 @@ +/* + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef QAPI_TYPE_INFO_H +#define QAPI_TYPE_INFO_H + +#include "qapi/util.h" + +/** + * QAPITypeInfo - QAPI type metadata + * + * @name: QAPI type name (e.g. "str", "OnOffAuto", "int32List"). + * QOM uses this as the property type string. + * @masked_name: Name of the type in the QAPI introspection schema, assign= ed by + * scripts/qapi code generator (e.g. "368"). + * @lookup: QEnumLookup for this type, or NULL for non-enum types. + * visit_type_enum(), qapi_enum_parse(), and qapi_enum_lookup() + * all rely on it. + * @list: The list-type counterpart, or NULL if none exists. + * str_type_info.list points to strList_type_info. qdev array + * properties follow this to find the list type for their element. + */ +typedef struct QAPITypeInfo { + const char *name; + const char *masked_name; + const QEnumLookup *lookup; + const struct QAPITypeInfo *list; +} QAPITypeInfo; + +#endif /* QAPI_TYPE_INFO_H */ --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493866; cv=none; d=zohomail.com; s=zohoarc; b=VFwwqisxZ3Iw7eglc3huIWJaDoo7TWTst0liBmrsboICFWNT+Ti4dqA4/DxPM3kbg98zrmjsDan6L86dYD3mZsK3e8mPK0Mde1M77soqy160SYlyMuyMzxHn1BrGuNsI6YD5Japp4F0m82Bps1n038h99Gbb6N9ypkXjWQp/jqE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493866; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ABGJlqhjTzuYRZnmPc116ozStZtH+NrxbC+tSxh9ams=; b=QJDhUD2aowc4c8u943jAz1/QjwkRIQ8GUwb2dqev+0NBLbNpVNNk2vE6E/VMoTkFPN+JDrVfmV87qN66mVEG/pTTI9U5qnlqp79ntoc7sw+f5atNiyEzOnXa24y6Hf9+/FuE6tc/gyDIVdEDN94GMwGSls0/bPRwJ8zh3/MqvZI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493866640423.04129488812066; Tue, 20 Oct 2026 03:57:46 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455350.1669174 (Exim 4.92) (envelope-from ) id 1xJ7Wn-0005DN-67; Tue, 20 Oct 2026 10:57:09 +0000 Received: by outflank-mailman (output) from mailman id 1455350.1669174; Tue, 20 Oct 2026 10:57:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Wm-0005BQ-0i; Tue, 20 Oct 2026 10:57:08 +0000 Received: by outflank-mailman (input) for mailman id 1455350; Tue, 20 Oct 2026 10:51:09 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Qz-0000Bm-47 for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:09 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7Qy-002FaV-HH for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:08 +0200 Received: from [10.42.69.2] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad7479b-bab6-0a2a0a5309dd-0a2a45029f70-2 for ; Tue, 20 Oct 2026 12:51:08 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad746ab-6ca4-0a2a45020019-aa0a817c731b-3 for ; Tue, 20 Oct 2026 12:47:08 +0200 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-225-c5deni3IOC2wghL_mDuwjA-1; Tue, 20 Oct 2026 10:47:02 +0000 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 E2CAE1800BD4; Tue, 20 Oct 2026 10:46:58 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 66E731956088; Tue, 20 Oct 2026 10:46:55 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ABGJlqhjTzuYRZnmPc116ozStZtH+NrxbC+tSxh9ams=; b=EixwMFHvTimPrYLZp7+w5IYqM2gBc2eRfW0oaQmhK0dKDRZN53jlO7IkGJRJ4yUyWklcKf MIGKbasrVncQMU+cfbUt4L092DG4znK85OhlnNFSPK0EREu1jRc5mg21JkA2F+DPct9qVo +D6/dHDgyMo2cNWpqGAYWZfIXpd26tQ= X-MC-Unique: c5deni3IOC2wghL_mDuwjA-1 X-Mimecast-MFC-AGG-ID: c5deni3IOC2wghL_mDuwjA_1792493219 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:25 +0400 Subject: [PATCH v7 08/65] qapi/gen: fix _module_basename for multi-dash 'what' parameters MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-8-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1135; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=OXQAJj92qnLHVy/ekT2tV/E7DqxlrqwyneXLdAaw748=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZYkpNZTiTu/0NKP25uG6QN+n4wrDZMxyVQO X1gFQ2YGniJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWAAKCRDa6OEJdZac 5Tm3EACDRom1wjYZ0S5SCUsfw8t+j56evvGukUBRwQKN2w3Du6uYAw4nS9RuGSZhu8Qnd+u5pMZ RR4HP3oxzkczsRTA8h9qgVMNqhnT0wlElBiABH9tCI3YJUEmCvZ6BcLxuFPzfBeyc9GxW13b1zO eFJpHhMeM/R3jK04zRuRqksv4/8kXnR6/wpqoTWxFKiLIHlDVBwA/CTfIs4nGprg3ZGZmRlb33o EmNs25MODVt3L329BQIU0WG7OwYkXsYoGUdf4ZEbcr9CZywiZ8S0Rvx9fyqeYkVfaSlmqy1IM8D gBphVT/878S1qnGZqgmJs2Mb/btw8aPl7PQPV5lHDeMKBfwNHCoePHXNHb7C36F9khg3w29QQGl cKkIx32v/w3/L0dR1CWVI+YkbZ7xfh8oZJabF87gg5+jzpgm0AhaVUIgHU33CwJpYm2u62IUU6O GUxREslEK8bfz4pPnfxyzQVd8JIjSZoz7J2ip2+0PYyI8mftsOWTAFnUU8jnITGf2UjSAGRfXtR DTXKPDqAwHdk7bX3rSvoybxG2RnFNFluw+yjjhDEyY/RhYpOJItxVCbcr+e3/wkbhBjbIiHOO14 e3pUpNugRf71Qh75I/eHU/GjXdHLvK/PibBXQ7ZxPFfUTuBYAVOQILNa2K4bAzoDOqwVFf9OOq/ UAbLSh+VqcTxYTw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-MFC-PROC-ID: ksMbsfJH8tUod-7x-2x2YGg-yDcjuqCuelOOCs_TgNM_1792493219 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-720697/1792493228-670B02AC-4CDBC78D/0/0 X-purgate-type: clean X-purgate-size: 1137 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493867613158500 The re.sub() call replaces every hyphen in 'what' with the system module infix. This produces broken filenames for multi-hyphen names (e.g. 'qapi-type-infos' becomes 'qapi-builtin-type-builtin-infos'). Add count=3D1 so only the first hyphen is replaced. Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi/gen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index 0c9b8db3b024..690187d4280d 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -300,7 +300,7 @@ def _module_basename(self, what: str, name: str) -> str: ret +=3D '-' + os.path.splitext(basename)[0] else: assert QAPISchemaModule.is_system_module(name) - ret +=3D re.sub(r'-', '-' + name[2:] + '-', what) + ret +=3D re.sub(r'-', '-' + name[2:] + '-', what, count=3D1) return ret =20 def _module_filename(self, what: str, name: str) -> str: --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493637; cv=none; d=zohomail.com; s=zohoarc; b=Tqy4tFn0YKlLnuR4s1oDogPQktR6iILQbheEfYtYmir2+hBy3PFAi3VuVQukULC+3UJZNh9i4lbRWB4Y2b1Erh1MXYqjSaxgaHNbnua9oz1djcUNr/PJk7ZVoUWaRGpdaBVzWeho139jmr+ooDb7OMoHFJZ9QPeNFiXVA0v+O7c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493637; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9fsJslKCeoRdmSlurWERnpkKgveOnsXmWR9P5zsycws=; b=CIaZNO1tQpXgV19LJSV+Otd8P6HFS+XnVkzEeMS4CTFZeRRjfEZgVVbQRvI1cAuxvoeVsd/6bBgQNAf/6XsWFw6W5gKJAAtepsqHGoxIGQh8SC2zAwpIVzLOgSiPDD9g0ypYGM/j+v3QDNQzdl8ISggVsDPe7gPssaqCKWbtsqA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792493637220698.5193520347219; Tue, 20 Oct 2026 03:53:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7O2-0002aM-P2; Tue, 20 Oct 2026 06:48:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7NH-0001BP-In for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:47:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7NB-0005FW-MC for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:47:17 -0400 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-413-CaChFFwCP4K-8MY9RuA87Q-1; Tue, 20 Oct 2026 10:47:08 +0000 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 4ECE719560BA; Tue, 20 Oct 2026 10:47:04 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6FCFD1800643; Tue, 20 Oct 2026 10:47:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9fsJslKCeoRdmSlurWERnpkKgveOnsXmWR9P5zsycws=; b=H69cYq6FuKpeO2ENt7EWyJq4cJDN4BNwP+POU9R4QeAhtq1+yBPt24jsOAydLC1+VujDQH MnPZlItPWrzoGxlDFNCN0OCcmhez9a9mKrcfgXO0wOvnaX18Gt5aCXA1kkiN4WqNtYe4ip 8TqXKEL0rgT+A92PqOcl8cIsYakVQNA= X-MC-Unique: CaChFFwCP4K-8MY9RuA87Q-1 X-Mimecast-MFC-AGG-ID: CaChFFwCP4K-8MY9RuA87Q_1792493224 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:26 +0400 Subject: [PATCH v7 09/65] qapi: add type-infos generator MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-9-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=11937; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=g11BDsqjD7nTY1JkXgXYml3RSI9xXvonR2GIve0ncmU=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZYJJsN/o3bE8+2FCYnBUPV5NJQM5Nv0DZ+W cs66TGPSluJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWAAKCRDa6OEJdZac 5X89D/9JRzqpQfKNC9gbQGRY59/nwxgGa32YPoyHyyoM0h2BvDmF7ZbinfNq2T9MVqshAYEoiFR xc7ljZ9NoGxlTuLVwS1aNl6HHnsmDhKb5jVgr5AoMWWz4rVqi+xj63l45jNUSseCUXeuy0bCkEg yZQBQUFEMFUZf304KtU3Njd18Egs4T0KuLqkFEEw5dkzWV3eZ/b5OhaCAKqoZedcvkQsZW7uvwI 6Ae0AjBOYIfxG3WN9Ij9DoZ8/I8X4ziwRqXr89st8Dtr0I2t6e9J2cXetf9OWT4OGfPwxsEliyT icKaxTcbiSyEP+QhBnS7Vz3hB/KApZDT+czUQX6T29+2H8KRyPs41CClGk1MQ4rUIz5QDTn98sZ SSY/ZdRafGBX/r+hQ8bLdy5WzBHNtnn5vjrxoOalrZQ3lkgmFSB+R3UMIxHTPRzij+vsVtmiGxw U5gv0Srb6iZ8qjMjcqiupzChnZtsLekIggh80TZwGRjdhyZdXY7Xn2FoW/Hn7QVfxpGn+9wEUQ3 bpdpQSG0xXFH+C38NmXfJ72C/QyZIu9PqL8R5H/iyqxdRJd92ojKG3qoIStS+8l19dNilIxa2YR eL1VActz/GY+9zR11F3R3dnsROQAhx1070vOdfVrv0WbKEHtXIw+k49jML+OTKNlgawyHNIFBDf bKqUQ5KwfG4PxOA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493639617158500 New QAPISchemaGenTypeInfoVisitor produces per-module qapi-type-infos-*.h/c files. Each file declares QAPITypeInfo constants pairing the QAPI type name with its masked introspection name. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- docs/devel/qapi-code-gen.rst | 92 ++++++++++++++++++++++++ meson.build | 1 + scripts/qapi/backend.py | 2 + scripts/qapi/type_infos.py | 163 +++++++++++++++++++++++++++++++++++++++= ++++ 4 files changed, 258 insertions(+) diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst index 77f08bb68cac..1cc5338a210a 100644 --- a/docs/devel/qapi-code-gen.rst +++ b/docs/devel/qapi-code-gen.rst @@ -1250,6 +1250,9 @@ JSON array of strings. To examine a type, start with a command or event using it, then follow references by name. =20 +.. TODO document QOM introspection (qom-list, qom-list-properties, + qom-get) and how it relates to QAPI type information. + The SchemaInfo for a command has meta-type "command", and variant members "arg-type", "ret-type" and "allow-oob". On the wire, the "arguments" member of a client's "execute" command must conform to the @@ -2099,3 +2102,92 @@ Example:: })); =20 [Uninteresting stuff omitted...] + + +Code generated for type information +----------------------------------- + +Type information is generated for user-defined types and their array +types. With option --builtins, it is also generated for the built-in +types. + +The following files are created: + + ``$(prefix)qapi-type-infos.c`` + A ``QAPITypeInfo`` instance for each type listed above, providing + a mapping between the QAPI type name and the masked name used by + introspection, along with optional enum lookup table and array + type pointers. + + ``$(prefix)qapi-type-infos.h`` + Declarations for the above type info instances + +Each ``QAPITypeInfo`` struct has the following fields: + +``name`` + The QAPI type name (e.g. ``"UserDefOne"``). + +``masked_name`` + The masked name used in ``query-qmp-schema`` output. + +``lookup`` + For enum types, a pointer to the corresponding ``QEnumLookup`` + table. ``NULL`` for non-enum types. + +``list`` + For types that have an array variant, a pointer to the array type's + ``QAPITypeInfo``. ``NULL`` when no array type exists. + +These type info instances are used by QOM property registration +functions (``object_property_add_qapi()``, +``object_class_property_add_qapi_enum()``, etc.) to associate each +property with its QAPI type. The ``qom-list`` and +``device-list-properties`` QMP commands then expose the ``qapi-type`` +field, giving management tools a formal type reference they can look +up in the introspection schema. + +Example:: + + $ cat qapi-generated/example-qapi-type-infos.h + [Uninteresting stuff omitted...] + + #ifndef EXAMPLE_QAPI_TYPE_INFOS_H + #define EXAMPLE_QAPI_TYPE_INFOS_H + + #include "qapi/qapi-builtin-type-infos.h" + + extern const QAPITypeInfo UserDefOne_type_info; + + extern const QAPITypeInfo UserDefOneList_type_info; + + #endif /* EXAMPLE_QAPI_TYPE_INFOS_H */ + $ cat qapi-generated/example-qapi-type-infos.c + [Uninteresting stuff omitted...] + + const QAPITypeInfo UserDefOne_type_info =3D { + .name =3D "UserDefOne", + .masked_name =3D "1", + .list =3D &UserDefOneList_type_info, + }; + + const QAPITypeInfo UserDefOneList_type_info =3D { + .name =3D "UserDefOneList", + .masked_name =3D "[1]", + }; + + [Uninteresting stuff omitted...] + +For a modular QAPI schema (see section `Include directives`_), code for +each sub-module SUBDIR/SUBMODULE.json is actually generated into :: + + SUBDIR/$(prefix)qapi-type-infos-SUBMODULE.h + SUBDIR/$(prefix)qapi-type-infos-SUBMODULE.c + +If qapi-gen.py is run with option --builtins, additional files are +created: + + ``qapi-builtin-type-infos.h`` + Type info instances for built-in types + + ``qapi-builtin-type-infos.c`` + Definitions for the above type info instances diff --git a/meson.build b/meson.build index bbef9d9c2932..e51fb7a37740 100644 --- a/meson.build +++ b/meson.build @@ -3510,6 +3510,7 @@ qapi_gen_depends =3D [ meson.current_source_dir() / '= scripts/qapi/__init__.py', meson.current_source_dir() / 'scripts/qapi/parser.py', meson.current_source_dir() / 'scripts/qapi/schema.py', meson.current_source_dir() / 'scripts/qapi/source.py', + meson.current_source_dir() / 'scripts/qapi/type_infos= .py', meson.current_source_dir() / 'scripts/qapi/types.py', meson.current_source_dir() / 'scripts/qapi/visit.py', meson.current_source_dir() / 'scripts/qapi-gen.py' diff --git a/scripts/qapi/backend.py b/scripts/qapi/backend.py index 49ae6ecdd33e..508ab2173539 100644 --- a/scripts/qapi/backend.py +++ b/scripts/qapi/backend.py @@ -8,6 +8,7 @@ from .features import gen_features from .introspect import gen_introspect from .schema import QAPISchema +from .type_infos import gen_type_infos from .types import gen_types from .visit import gen_visit =20 @@ -63,3 +64,4 @@ def generate(self, gen_commands(schema, output_dir, prefix, gen_tracing) gen_events(schema, output_dir, prefix) gen_introspect(schema, output_dir, prefix, unmask) + gen_type_infos(schema, output_dir, prefix, builtins, unmask) diff --git a/scripts/qapi/type_infos.py b/scripts/qapi/type_infos.py new file mode 100644 index 000000000000..b29e31d92640 --- /dev/null +++ b/scripts/qapi/type_infos.py @@ -0,0 +1,163 @@ +""" +QAPI type info generator + +SPDX-License-Identifier: GPL-2.0-or-later +""" + +from typing import List, Optional + +from .common import c_name, mcgen +from .gen import QAPISchemaModularCVisitor, ifcontext +from .schema import ( + QAPISchema, + QAPISchemaAlternatives, + QAPISchemaBranches, + QAPISchemaEnumMember, + QAPISchemaFeature, + QAPISchemaIfCond, + QAPISchemaObjectType, + QAPISchemaObjectTypeMember, + QAPISchemaType, +) +from .source import QAPISourceInfo + + +class QAPISchemaGenTypeInfoVisitor(QAPISchemaModularCVisitor): + + def __init__(self, prefix: str, unmask: bool): + super().__init__( + prefix, 'qapi-type-infos', + ' * Schema-defined QAPI type info', + ' * Built-in QAPI type info', __doc__) + self._unmask =3D unmask + self._schema: Optional[QAPISchema] =3D None + + def visit_begin(self, schema: QAPISchema) -> None: + super().visit_begin(schema) + self._schema =3D schema + + def _begin_builtin_module(self) -> None: + self._genc.preamble_add(mcgen(''' +#include "qemu/osdep.h" +#include "qapi/qapi-builtin-types.h" +#include "qapi/qapi-builtin-type-infos.h" +''')) + self._genh.preamble_add(mcgen(''' +#include "qapi/qapi-type-info.h" +''')) + + def _begin_user_module(self, name: str) -> None: + type_infos =3D self._module_basename('qapi-type-infos', name) + types =3D self._module_basename('qapi-types', name) + self._genc.preamble_add(mcgen(''' +#include "qemu/osdep.h" +#include "%(types)s.h" +#include "%(type_infos)s.h" +''', + types=3Dtypes, + type_infos=3Dtype_infos)) + self._genh.preamble_add(mcgen(''' +#include "qapi/qapi-builtin-type-infos.h" +''')) + + def _has_list(self, name: str) -> bool: + assert self._schema is not None + return self._schema.lookup_type(name + 'List') is not None + + def _masked_name(self, name: str) -> str: + assert self._schema is not None + return self._schema.definition_introspection_name(name, self._unma= sk) + + def _gen_type_info(self, name: str, + ifcond: Optional[QAPISchemaIfCond] =3D None, + with_lookup: bool =3D False, + with_list: bool =3D False) -> None: + c_id =3D c_name(name + '_type_info') + masked_name_str =3D '"%s"' % self._masked_name(name) + with ifcontext(ifcond or QAPISchemaIfCond(), + self._genh, self._genc): + self._genh.add(mcgen(''' + +extern const QAPITypeInfo %(c_id)s; +''', + c_id=3Dc_id)) + self._genc.add(mcgen(''' + +const QAPITypeInfo %(c_id)s =3D { + .name =3D "%(name)s", + .masked_name =3D %(masked_name)s, +''', + c_id=3Dc_id, name=3Dname, + masked_name=3Dmasked_name_str)) + if with_lookup: + self._genc.add(mcgen(''' + .lookup =3D &%(c_name)s_lookup, +''', + c_name=3Dc_name(name))) + if with_list: + self._genc.add(mcgen(''' + .list =3D &%(list_id)s, +''', + list_id=3Dc_name(name + 'List_type_in= fo'))) + self._genc.add(mcgen(''' +}; +''')) + + def visit_builtin_type(self, + name: str, + info: Optional[QAPISourceInfo], + json_type: str) -> None: + self._gen_type_info(name, with_list=3Dself._has_list(name)) + + def visit_enum_type(self, + name: str, + info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + features: List[QAPISchemaFeature], + members: List[QAPISchemaEnumMember], + prefix: Optional[str]) -> None: + self._gen_type_info(name, ifcond, + with_lookup=3DTrue, + with_list=3Dself._has_list(name)) + + def visit_array_type(self, + name: str, + info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + element_type: QAPISchemaType) -> None: + self._gen_type_info(name, ifcond) + + def visit_object_type(self, + name: str, + info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + features: List[QAPISchemaFeature], + base: Optional[QAPISchemaObjectType], + members: List[QAPISchemaObjectTypeMember], + branches: Optional[QAPISchemaBranches]) -> None: + assert self._schema is not None + typ =3D self._schema.lookup_type(name) + assert typ + if typ.is_implicit(): + return + self._gen_type_info(name, ifcond, + with_list=3Dself._has_list(name)) + + def visit_alternate_type(self, + name: str, + info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + features: List[QAPISchemaFeature], + alternatives: QAPISchemaAlternatives) -> None: + self._gen_type_info(name, ifcond, + with_list=3Dself._has_list(name)) + + +def gen_type_infos(schema: QAPISchema, + output_dir: str, + prefix: str, + opt_builtins: bool, + opt_unmask: bool) -> None: + vis =3D QAPISchemaGenTypeInfoVisitor(prefix, opt_unmask) + schema.visit(vis) + vis.write(output_dir, opt_builtins) --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493657; cv=none; d=zohomail.com; s=zohoarc; b=b/G3/1mmgEHxp3z8KNOYeS/V5W479dAlFj4I5l2r1heO2hSR72hje/yhFKmtNiAubIyAFPUrmDcR7b09EnGDclwnJVbGjacKSWdOlYdf9NFAKZ1l2MK6OFHGrgCMDJPprjC6xisGdF+UgRQefPsQ+bO6YQcNZvOD4XwuMW01ClY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493657; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=a0eKD3sUSsLDHL5Rbyj5qW1a5Bhls7mo+yQHcVi0dNs=; b=kfnpOSzFIeP8KQwh/Sp35T4Oe08CXe8rPGBiSeKJF25hE7gjiWMPhPMmwUwZj+h3Qd/rS+VYqwp23t2oSDOxDUX3ztP6twGCYIZ1WI4Rq1Zw/BzfB9dWh/NYmm98ZEko9t3yuWZYNmimv+vAejCOFSH0LKkv2smEcRnbmFQPxSs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792493657523992.2546538974157; Tue, 20 Oct 2026 03:54:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7O2-0002aV-PX; Tue, 20 Oct 2026 06:48:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7NO-0001Dw-1m for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:47:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7NL-0005HB-1E for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:47:24 -0400 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-91-PGvBjJmAP4aH1aJU5oYqmw-1; Tue, 20 Oct 2026 06:47:14 -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 5803E1800476; Tue, 20 Oct 2026 10:47:10 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B80D41956095; Tue, 20 Oct 2026 10:47:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=a0eKD3sUSsLDHL5Rbyj5qW1a5Bhls7mo+yQHcVi0dNs=; b=hpXEEkzDqYWG1ycO0KdvAMqN+hJIInrCAsqpcvKVKRNB3BdBWH9qyJhmTqof3APvqfa2eK VoOjvfFkO1f+TsyHA99vR3L7xXFB2JIUOiSEiHxOd4HZl83Y5DlWfzgFqGsPE9PBe22UuL qAjyz6wT09UtEG0EbZuDhNW6S9z9G10= X-MC-Unique: PGvBjJmAP4aH1aJU5oYqmw-1 X-Mimecast-MFC-AGG-ID: PGvBjJmAP4aH1aJU5oYqmw_1792493230 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:27 +0400 Subject: [PATCH v7 10/65] meson: add qapi-type-infos-*.c/h to build MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-10-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=4026; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=eVJytPz3KQHyW0Eei+IlbvI0CrYX88Ak+jznKk8pYYM=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZYJt0ke19J4ltackOupI0pq7CK76MV5JKhu L19h61q7CSJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWAAKCRDa6OEJdZac 5bh7D/9o800Zx8Ea1Xfpr7ACGgnyzV8jkcBlp8Hzb7ozpogEKFcTat3oDoryJJsQxlgzgJHhAf4 xQT98v3zkCaoHRIbB6dR0HYZBqyvICSDEA2z6dydBWQCfbIPdcVhiGF29ilFln4WSCVMEnObaFP jSBeBazjRdH0T5xfyjCgJrBQSq2TnF577fRbor2DDFXhnjiRkuCteCnjdCRACcbp4bKOu/8aTqC zvMFT7nTq00cMgLWk7O7y/3V/o+NEYmNBrudDZxN2ovKLglKgbEKGZt1CpNg1Us3yGbmp7C/ued 6j8TVzxJBorlnnqcRONbN8vEXcK6fO6P9qZR7nTYal7lYdU6r9TCQoY4kvvQW+uDqXgQEAWmhOi jZqDTnpIgJdgITBb5cP1iuDx4m8zCGYgw4FDJSEPYQuWHaFdqeNvNBw0pdC2xUr2TTibV+OLWUp XXsHgCRssrvOLRavHKOKXE7Escb305j2bbdur64seJPONvFdSWLWSuLMcyK8cwxzTEA9j2xa2Hg HoJL3z3i0vH4SqDy9prxpuF+J3j1IYnps0k+MK+mTLYI4e8iqke/uSs4PUmCOpQMq5J4Otq6DcH MJqQiQREJhxMnpMKZBd9vBvDhmvts3IVzg3hJvzD52nk7JW3EAtQdIwCfqF4JndhviB2CIPR+OA lCJIJFcJtrFbXpg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493657811158500 Add the per-module type-infos output files so they are compiled into the build. Reviewed-by: Kostiantyn Kostiuk Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- qapi/meson.build | 4 ++++ qga/meson.build | 2 ++ tests/include/meson.build | 2 ++ tests/meson.build | 6 ++++++ tests/qapi-schema/meson.build | 1 + 5 files changed, 15 insertions(+) diff --git a/qapi/meson.build b/qapi/meson.build index a46269b5a0c9..7477953492ad 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -79,6 +79,7 @@ endif =20 qapi_nonmodule_outputs =3D [ 'qapi-introspect.c', 'qapi-introspect.h', + 'qapi-type-infos.c', 'qapi-type-infos.h', 'qapi-types.c', 'qapi-types.h', 'qapi-visit.h', 'qapi-visit.c', 'qapi-commands.h', 'qapi-commands.c', @@ -88,6 +89,7 @@ qapi_nonmodule_outputs =3D [ ] =20 qapi_outputs =3D qapi_nonmodule_outputs + [ + 'qapi-builtin-type-infos.c', 'qapi-builtin-type-infos.h', 'qapi-builtin-types.c', 'qapi-builtin-visit.c', 'qapi-builtin-types.h', 'qapi-builtin-visit.h', ] @@ -96,6 +98,8 @@ qapi_inputs =3D [] foreach module : qapi_all_modules qapi_inputs +=3D [ files(module + '.json') ] qapi_module_outputs =3D [ + 'qapi-type-infos-@0@.c'.format(module), + 'qapi-type-infos-@0@.h'.format(module), 'qapi-types-@0@.c'.format(module), 'qapi-types-@0@.h'.format(module), 'qapi-visit-@0@.c'.format(module), diff --git a/qga/meson.build b/qga/meson.build index cfa2157efb23..79163b7d8e93 100644 --- a/qga/meson.build +++ b/qga/meson.build @@ -39,6 +39,8 @@ qga_qapi_outputs =3D [ 'qga-qapi-init-commands.h', 'qga-qapi-introspect.c', 'qga-qapi-introspect.h', + 'qga-qapi-type-infos.c', + 'qga-qapi-type-infos.h', 'qga-qapi-types.c', 'qga-qapi-types.h', 'qga-qapi-visit.c', diff --git a/tests/include/meson.build b/tests/include/meson.build index 8e8d1ec4e692..026480d96851 100644 --- a/tests/include/meson.build +++ b/tests/include/meson.build @@ -4,6 +4,8 @@ test_qapi_outputs_extra =3D [ 'test-qapi-commands-sub-module.h', 'test-qapi-events-sub-module.c', 'test-qapi-events-sub-module.h', + 'test-qapi-type-infos-sub-module.c', + 'test-qapi-type-infos-sub-module.h', 'test-qapi-types-sub-module.c', 'test-qapi-types-sub-module.h', 'test-qapi-visit-sub-module.c', diff --git a/tests/meson.build b/tests/meson.build index 5877d2f60b12..6769a1e7812f 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -2,6 +2,8 @@ subdir('bench') subdir('qemu-iotests') =20 test_qapi_outputs =3D [ + 'qapi-builtin-type-infos.c', + 'qapi-builtin-type-infos.h', 'qapi-builtin-types.c', 'qapi-builtin-types.h', 'qapi-builtin-visit.c', @@ -22,6 +24,10 @@ test_qapi_outputs =3D [ 'test-qapi-init-commands.h', 'test-qapi-introspect.c', 'test-qapi-introspect.h', + 'test-qapi-type-infos-sub-sub-module.c', + 'test-qapi-type-infos-sub-sub-module.h', + 'test-qapi-type-infos.c', + 'test-qapi-type-infos.h', 'test-qapi-types-sub-sub-module.c', 'test-qapi-types-sub-sub-module.h', 'test-qapi-types.c', diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build index debff633ac17..392b59d8dccd 100644 --- a/tests/qapi-schema/meson.build +++ b/tests/qapi-schema/meson.build @@ -231,6 +231,7 @@ custom_target('QAPI doc', 'doc-good-qapi-events.c', 'doc-good-qapi-events.h', 'doc-good-qapi-init-commands.c', 'doc-good-qapi-ini= t-commands.h', 'doc-good-qapi-introspect.c', 'doc-good-qapi-intros= pect.h', + 'doc-good-qapi-type-infos.c', 'doc-good-qapi-type-i= nfos.h', 'doc-good-qapi-types.c', 'doc-good-qapi-types.h', 'doc-good-qapi-visit.c', 'doc-good-qapi-visit.h' ], input: files('doc-good.json'), --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493408; cv=none; d=zohomail.com; s=zohoarc; b=av5ChB2NATk4JPIHlMuniJpeJHJAoS2BDraxw/jO6RTj1mNjFxrhHXmNvT3W/VO685Eg5/6rYzY96L9L7BDYUtJqb//9fN1QXfk4mmxy3ik1Rj8KELDYz3NTFtK8ivyO1Oq9VZxjqang3R8U1sx9VYTR6kMn4JHOgBG/dtbjZsY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493408; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=T3j8f+7qjazkHlU3ibuflAeMZnSK6eTgFQwyyu7+HY4=; b=Y6vZZ4F/e7Vnl7xZCLhhe3pow+7KIFBt9ZwpjLsB1OXSlynus9Y1YrzkiEuxvSUKi9xV44nMkKNnrf3+iB9sjhW1IY/QtiExmXz+dccTdrw+M043wW4Zh9xoDktSTwatGRdipfWlGi53waC/VfnBZfMhaV7vVhntOZsSJXEO7nA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179249340818749.74085111312877; Tue, 20 Oct 2026 03:50:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7Ow-0003Pc-FL; Tue, 20 Oct 2026 06:49:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7NT-0001Gz-2O for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:47:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7NL-0005HZ-En for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:47:27 -0400 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-261-ihbyk2kzMnWd3H-QsJ0KOQ-1; Tue, 20 Oct 2026 10:47:20 +0000 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 EFDAD18007F6; Tue, 20 Oct 2026 10:47:15 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AC08B1800586; Tue, 20 Oct 2026 10:47:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T3j8f+7qjazkHlU3ibuflAeMZnSK6eTgFQwyyu7+HY4=; b=H0tycvPgtOEtyRhCxwxJx7V2pFrMhOQwZLrEh5cml3kgeKqZYhvtwHBtUAHweCSxl5kyM+ Z8Xy8JCvcXUA1urarHoMObOWipPQS/oNLHAUEy9e+XBMvxFoNdCuowxrdy8jCJ/ZDRZ8a9 09CHxULSIkbXjojbm3HJN8cGORIQ/Yo= X-MC-Unique: ihbyk2kzMnWd3H-QsJ0KOQ-1 X-Mimecast-MFC-AGG-ID: ihbyk2kzMnWd3H-QsJ0KOQ_1792493236 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:28 +0400 Subject: [PATCH v7 11/65] qom: add qapi_type field to ObjectProperty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-11-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1530; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=2OIgxeWqZ6otP2YGCtYtdyJ3HEK4Fvyx/L7bWvHPHdk=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZYjp5Y+KqlnMbXKVbPp8oeCxnUXz1KL4/P8 K4p+GJF/R2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWAAKCRDa6OEJdZac 5TnHEACR1GhcDzcI8DmQKfHIpJvlmkNBtahkon1/NhI0x7islO7obbKLlwPWCy4wQP0LWmjiFde xdHBmPABE8w+GBhIOHh7SA0bED9tVk5Z/KKlUlLW05WmHAclgZP0w/6d5wvOkytAsYlsqG3VRxy pzheoaZub7M/f1Vel44KT2PyTTkmTa/qOXxEwlb0xyleSWHAWJ9YwJZGDMVgrIazoCrrCjuu3I7 iTedHPzNeu958dcqBAk2k83xJ9h7d8l/nOwWQBatA7434OZv4mQjeA8o1Ofgcbi65KOPJGxySd/ zpF8bho145/tHV1hb2kOE9AJZWK5EagdnYfGHXBmTDKlj+Th/DTIwXSf5tt/sZhF0vRDi1iPq/I LKCOU9KvJA+kSgItubIrwmplrAZNenxsHtooqhUGlhbPvcmEcxvBEYCswzXAevfatbwJoe7DFxw Q+8H0wl+PDfMBiyBB0MAjrQjDNAgi3DiW+nG2xFvGonrsvQbamKdlaKdTC0x/2QCSiZM65jfyJv qZtODKR7Ucan3Z0MVy9Ve7TFMgJLRkBuEHYeUxKnLwFChoZ5UPUii0h9F/SrqgDGCI5+Y7VLkFR PA/35B9aACGPcf7BnkarTv8euSmDQVmF5eXIH82cCmx+dLkD7Y0WERC0r9g9iDHW6Ux3KE0GVqX 9APAXx+LTkI4QMg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493409080158500 Add a const pointer to QAPITypeInfo in ObjectProperty. NULL for now, but future patches will add means to make it non-null. The QAPITypeInfo will then be used by QOM introspection to tie the property to a QAPI type. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster --- include/qom/object.h | 2 ++ qom/object.c | 1 + 2 files changed, 3 insertions(+) diff --git a/include/qom/object.h b/include/qom/object.h index 90c1a34e49aa..e9b380462ded 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -15,6 +15,7 @@ #define QEMU_OBJECT_H =20 #include "qapi/qapi-builtin-types.h" +#include "qapi/qapi-type-info.h" #include "qemu/module.h" =20 struct TypeImpl; @@ -91,6 +92,7 @@ struct ObjectProperty char *name; char *type; char *description; + const QAPITypeInfo *qapi_type; ObjectPropertyAccessor *get; ObjectPropertyAccessor *set; ObjectPropertyResolve *resolve; diff --git a/qom/object.c b/qom/object.c index 96498f3d001c..c34b47312f29 100644 --- a/qom/object.c +++ b/qom/object.c @@ -3171,6 +3171,7 @@ object_property_add_alias(Object *obj, const char *na= me, property_release_alias, prop); op->resolve =3D property_resolve_alias; + op->qapi_type =3D target_prop->qapi_type; if (target_prop->defval) { op->defval =3D qobject_ref(target_prop->defval); } --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493393; cv=none; d=zohomail.com; s=zohoarc; b=ADVpR21ws4TrVv80cuw3lHCjzUxDnN0L3/sfQ6ezELsJLzi+4A1gT3QkqEWbVtTCGVfsNei22KdXUiPTZtTpvVBUH5bchzwnvE1UFVmuQRDx4UvrNitz0mLZkuJe0gGC3JwzG6BC6PK7wSZRlxwBlWuthS/ihubcFk6Wl1OY47g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493393; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ECa+EP2+GWrANsxj0WvwUZJkCIlcvdWbNsc8NiwNlVo=; b=JltmCswqkIeuu8NGtpDdABPhYSYUkFp0RMWIzlwdxjOAi6j8KuhP0jSLcrZ2JVScb3sOZVh//SsMOXGgM8gHJl4fsINQhBpuZspDFFF2oin/K+rps2SkVEYDHBEDUbk72Vlim5znirK7SxQoE2fQZ0BH2MfBf5J5Mmx1SltSrFg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179249339300273.83674794838817; Tue, 20 Oct 2026 03:49:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7O1-0002Vt-3t; Tue, 20 Oct 2026 06:48:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7NW-0001HA-U3 for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:47:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7NT-0005Ih-Sl for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:47:33 -0400 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-330---ICFwzSMLyjVd2-rA4_dw-1; Tue, 20 Oct 2026 10:47:26 +0000 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 B08BA1955EA9; Tue, 20 Oct 2026 10:47:21 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7AA0630000E7; Tue, 20 Oct 2026 10:47:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ECa+EP2+GWrANsxj0WvwUZJkCIlcvdWbNsc8NiwNlVo=; b=g5CiGGuNvFD0rgfvjV/dslMMhS8N2Tk2sVawBzi7DbQM0fjPit4aIcWckuDIta3ksgelEp 5OmtJONQBOz7bKbSzEseUXQFsTZqVjjWpuE8swVjkr/CYFVvHU15f6ssTOzsWVUtWEZsJ8 ocTQ1UmmJF45kUNLVyBF1gpUAo+Z1T0= X-MC-Unique: --ICFwzSMLyjVd2-rA4_dw-1 X-Mimecast-MFC-AGG-ID: --ICFwzSMLyjVd2-rA4_dw_1792493241 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:29 +0400 Subject: [PATCH v7 12/65] qapi/qom: add qapi-type field to ObjectPropertyInfo MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-12-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1921; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=iKT89ERqmB5xJit6r3j8WUD6ClpE36oEYsgjEEvZ40o=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZYxccp5RLblnwypa/9MUPo5yHCT1xWIDSPC kA8/nPQHZWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWAAKCRDa6OEJdZac 5e/BD/9TtX0u6H+0rpG8WE+dl2QuQTNqc7I7UQsZIGnhPN3Al/XNQZiAz7mmC9G+NYbkf+JSdfB k5kprVrQhJ3Qwo46Eo+f3qr8ThczDGZA6O4hzHv5kxdvgp6qn1DaCqqyaCoKsR/z+iuGL2HmZsU mDSJqIH3dy3Hb40RluHg7V7GmVv4Rf6FguZ82m5gB7pbbTD2eXnx3z+CnMSeaAmfG4F8BZ0feAi ZZdOtwWw3zJcvLJE4/+UfOCPiGxw4cQtY+ATWlNBSjHmmNXNtzG8MlEvUPCJ2Sjn27mHRxuM7nO WQ6+yJh/lQ0Ghbdq95AVNza5NuB1EVwplpUXCjM1cH+Yy2DOAZFw8NZuDgRazKKFH/AOAYKwO7P fSFGOlRSGjjJuFA4w4sYrs+YXl2zcGOmUVTKNTX3yF2OhQx8UgAnNPV9I4poe0gXiUAgmElaUBX bAH8SeScvuf8ZDHbsiN/1WmUdBrI/V4+IxLJlZYGHkeyF8ysSL5DJ7MeUTFBeBmG5LI9nRNWyhj xgXX8aohw8Oq+7nyejaTJP4C9/B8IRO6jiFJRRUvMsMjnKfTeEn2904ZPwG2JU6Qdo5st5sHmK6 GVmZP2Uzs/39Pu485CCHNkrP67konhv+JXIwq2EN4q6gZq+7K1gfG51xtJ2MyHYyCc0BAAGTRD5 xkTzLUa6kbRI52Q== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493394856158500 Add an optional 'qapi-type' field to ObjectPropertyInfo and ObjectPropertyValue. When present, it contains the masked type name that can be looked up in query-qmp-schema output. Absent for properties without a QAPI type association. Always absent for now, populated in the following changes. Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- qapi/qom.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qapi/qom.json b/qapi/qom.json index 49f222796ab4..34be7768135c 100644 --- a/qapi/qom.json +++ b/qapi/qom.json @@ -35,6 +35,10 @@ # qdev device type name. Link properties form the device model # graph. # +# @qapi-type: the name of the property's type as it appears in the +# output of ``query-qmp-schema``. Absent if the type does not +# occur there. (since 11.2) +# # @description: if specified, the description of the property. # # @default-value: the default value, if any (since 5.0) @@ -44,6 +48,7 @@ { 'struct': 'ObjectPropertyInfo', 'data': { 'name': 'str', 'type': 'str', + '*qapi-type': 'str', '*description': 'str', '*default-value': 'any' } } =20 @@ -55,6 +60,10 @@ # @type: the type of the property, as described in # `ObjectPropertyInfo`. # +# @qapi-type: the name of the property's type as it appears in the +# output of ``query-qmp-schema``. Absent if the type does not +# occur there. (since 11.2) +# # @value: the value of the property. Absent when the property cannot # be read. # @@ -63,6 +72,7 @@ { 'struct': 'ObjectPropertyValue', 'data': { 'name': 'str', 'type': 'str', + '*qapi-type': 'str', '*value': 'any' } } =20 ## --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493551; cv=none; d=zohomail.com; s=zohoarc; b=YFMjloZyiNaZwijPLjms5+Enz9V29+tE9N7/U88e0bxGbnkD0mD/Uj+5skDVLVtkRWTP3dhJ6In8yCuu2ONJc4MR0lolWigdsCZ0LEeXEzrUYeq4k+dhCXVX9BTw9BLMbm4lK4q6tEqAY6DemxJtlGH9BekTKRcIXY9fn54yiqU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493551; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PVXTIIpNbgnr5AJ+/yIbBcdA8eA5b8YMHg0i2cYvT44=; b=IgJn/GC27akgGw1++mYq4vMogocytpSbFp9gsc+LpVy+nQ8T4Dtjebh2N+nhVJPnHIIb+qc7+b3SOLiqzcFZF90UTw9JdgEpqTeEJnbXpyZ09972o5REwdzD/Gb2W8qq5klxNZfhB4an9f1BBFEX5q05+yHCcqxfLj/RTUoVGec= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792493551709139.24249552211234; Tue, 20 Oct 2026 03:52:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7P1-0003fm-Cc; Tue, 20 Oct 2026 06:49:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Nb-0001KA-VE for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:47:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7NY-0005KV-UY for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:47:38 -0400 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-581-QIWQbiQEOjKXo9XLY2S_-Q-1; Tue, 20 Oct 2026 10:47:30 +0000 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 A06391800846; Tue, 20 Oct 2026 10:47:26 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 26A6630000E7; Tue, 20 Oct 2026 10:47:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PVXTIIpNbgnr5AJ+/yIbBcdA8eA5b8YMHg0i2cYvT44=; b=RzQUg07MqW98QoCKxPbqrn6sKDoA/BdbFp71AqahQmVMuqW6wA5Lj4rYXkOYtok5DLi0gM QSViR6pqjgikSObMsv6ElU8XNiIcNqHnIauVGqRfZkHFcraWE1GedRwbVcndk+BG1hFOD2 I+9L5vtby+Z+kfHIP8PE1VRrJ0T4jt8= X-MC-Unique: QIWQbiQEOjKXo9XLY2S_-Q-1 X-Mimecast-MFC-AGG-ID: QIWQbiQEOjKXo9XLY2S_-Q_1792493246 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:30 +0400 Subject: [PATCH v7 13/65] qom/qmp: populate qapi-type in QMP handlers MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-13-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=3535; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=i+4aNg1CWaC9FuQwQPBmrQeBSkYvF4PheLxhenOOFfo=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZYDWzReLBw3m81dGDIXbwzl9a7/x3QA+lLt YiL2TIXOxiJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWAAKCRDa6OEJdZac 5SUfD/wJNBGKtLromvCCVRWVjPvxR5grgFUIPYxITDg41xmOLrKqK6tkYNGmFOZFpRXvHXGYvRQ TdQmUahRaSDpeuJbFcaYT73xbCCqya8tVq8EmWAT5UeRvgtVrubv+XmDarrnryY02yLXvkIPllC xD258e/Sa+caea6AEZbydm8puSKag8kjyvK+G/zuYF1znKnI8eJxFrc3NH2jpHB6n9mLR5rzuys KpmuOkIz/+997QlgvghfOc9I5oUvG09YZbw98d4FxVxtx5ARqn/Vp/by4sa4tu2Tu0k6JWoMyR2 FLbIEl5NmPd/Vzzo8e0e2s7lkcsZEaa6+6GDVtgr3zcY0ceNHCAlZDAcuV2JumnHEjgGHaGDC3j m73n3AS2hBEShtU728GRRbYOuf5ZVmV0IHuJrD2XWVTkdWBtjjOKsTKqGgmguNhjUQn/iZ1XRs6 AwFiABH4kHoVozldkVrlbvXe7p5VFD4ze0fzu1PCDur+7/Ays4XczNXKWN1fQ5u2ZNLW5LYbfg+ ljEVnbaU+fg2V7agpnwf/IswI8Aw7S6ja3o33R2iu3N6LeX5VdqV5qtUy9mRVydHeEJii8A9+vl Yd8aU3wBZlxTyloC0tuExCV6B9nUqFz84SN6C4Bl11QPGw0u4G9nKK1ivmRDCOq3WPxaOAUae2j TUSTCHbBFtRj1ig== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493553767158500 Wire up the new qapi-type field in all four QMP handlers that return ObjectPropertyInfo or ObjectPropertyValue: qom-list, qom-list-get, device-list-properties, and qom-list-properties. When an ObjectProperty has a qapi_type set, the masked QAPI type name is copied into the response, allowing clients to cross-reference with query-qmp-schema. No property has it yet, the following changes will populate it. Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- qom/qom-qmp-cmds.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c index f17389c7305c..47bf3bf2937a 100644 --- a/qom/qom-qmp-cmds.c +++ b/qom/qom-qmp-cmds.c @@ -25,9 +25,23 @@ #include "qapi/qobject-input-visitor.h" #include "qapi/qobject-output-visitor.h" #include "qemu/cutils.h" +#include "qapi/qapi-type-info.h" #include "qom/object_interfaces.h" #include "qom/qom-qobject.h" =20 +static ObjectPropertyInfo *qom_property_info(ObjectProperty *prop) +{ + ObjectPropertyInfo *info =3D g_new0(ObjectPropertyInfo, 1); + + info->name =3D g_strdup(prop->name); + info->type =3D g_strdup(prop->type); + if (prop->qapi_type) { + assert(prop->qapi_type->masked_name); + info->qapi_type =3D g_strdup(prop->qapi_type->masked_name); + } + return info; +} + static Object *qom_resolve_path(const char *path, Error **errp) { bool ambiguous =3D false; @@ -58,12 +72,7 @@ ObjectPropertyInfoList *qmp_qom_list(const char *path, E= rror **errp) =20 object_property_iter_init(&iter, obj); while ((prop =3D object_property_iter_next(&iter))) { - ObjectPropertyInfo *value =3D g_new0(ObjectPropertyInfo, 1); - - QAPI_LIST_PREPEND(props, value); - - value->name =3D g_strdup(prop->name); - value->type =3D g_strdup(prop->type); + QAPI_LIST_PREPEND(props, qom_property_info(prop)); } =20 return props; @@ -78,6 +87,10 @@ static void qom_list_add_property_value(Object *obj, Obj= ectProperty *prop, =20 item->name =3D g_strdup(prop->name); item->type =3D g_strdup(prop->type); + if (prop->qapi_type) { + assert(prop->qapi_type->masked_name); + item->qapi_type =3D g_strdup(prop->qapi_type->masked_name); + } item->value =3D object_property_get_qobject(obj, prop->name, NULL); } =20 @@ -241,9 +254,7 @@ ObjectPropertyInfoList *qmp_device_list_properties(cons= t char *typename, continue; } =20 - info =3D g_new0(ObjectPropertyInfo, 1); - info->name =3D g_strdup(prop->name); - info->type =3D g_strdup(prop->type); + info =3D qom_property_info(prop); info->description =3D g_strdup(prop->description); info->default_value =3D qobject_ref(prop->defval); =20 @@ -284,11 +295,8 @@ ObjectPropertyInfoList *qmp_qom_list_properties(const = char *typename, object_property_iter_init(&iter, obj); } while ((prop =3D object_property_iter_next(&iter))) { - ObjectPropertyInfo *info; + ObjectPropertyInfo *info =3D qom_property_info(prop); =20 - info =3D g_malloc0(sizeof(*info)); - info->name =3D g_strdup(prop->name); - info->type =3D g_strdup(prop->type); info->description =3D g_strdup(prop->description); info->default_value =3D qobject_ref(prop->defval); =20 --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493644; cv=none; d=zohomail.com; s=zohoarc; b=J/l2luJw+y9QeC5aY1lb++dQx2w0/KJrQ0vJCDzgKVNR06/nL2pAYihXBUyVeQFE6obE7QGRj0qC0QLeWch/Il0/WeAVrm1ZzMjvfsvBIhE6NzgtVoxI7JoNKurDy1fn1dGi1BB3L9kJXiJHUgJanNup18HAqzN46qpXmHhJL/0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493644; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xIOxZR09tVRL3LoeQ2VRl9bxdzxaCKN+MMqdzDBpGyw=; b=Qmr/WBFmrCEs26p5ByYTTdlhFRWK9lcqAin1EQ5102KSWgnqk9iaUkg6S9CVdS3qVKK0JxMBU8nEU+W4kZaTghys50qwGQzSBTH4TQu53wX54shgZt5GYsfhbgAv/7YtCg96joMDZXcqocZqCPQapbDTKFkxVaCBDhlr7ho3c00= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792493644523210.69085658404617; Tue, 20 Oct 2026 03:54:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7Pe-0004os-67; Tue, 20 Oct 2026 06:49:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Ng-0001RW-24 for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:47:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Ne-0005MI-Cl for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:47:43 -0400 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-635-ofFqrjFmNVuI0_Rhk-bdPQ-1; Tue, 20 Oct 2026 10:47:36 +0000 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 C6E151955F2B; Tue, 20 Oct 2026 10:47:31 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B32B31956089; Tue, 20 Oct 2026 10:47:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xIOxZR09tVRL3LoeQ2VRl9bxdzxaCKN+MMqdzDBpGyw=; b=NNSJu2K4HLFYfva6DrkQZ4Qv7pOmGq9Hk2XHmrlBJ6OhCnC0waulI7M4TJHjqD5oKz2pw+ vQIq6vjpPkDFdlJNPafFQqnnNBHpoL1tm0Qq2/ddT9LHrW0r3C5/U4cf3+cXRAvOae6Hse iEIBE2iXH112+0gSR2e4nWLBf1d0ZJU= X-MC-Unique: ofFqrjFmNVuI0_Rhk-bdPQ-1 X-Mimecast-MFC-AGG-ID: ofFqrjFmNVuI0_Rhk-bdPQ_1792493252 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:31 +0400 Subject: [PATCH v7 14/65] qom/qmp: populate description & default-value in qom_property_info() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-14-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2485; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=uHhhGddxQUOPXHn3kN1zjJ5emGyO+zAsacCmEIp7fMU=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZYLHL/+jjl6D3jfhu6YY8r0v/h+oK3dZuqT ezvQZmL6dCJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWAAKCRDa6OEJdZac 5aAaD/48dANrC6kyut3XOROjrQRxjwUIv0i0xWNW1n7ucgCFOO9+fWLOIuRBmElFO8tK1LUW7VK /cncnMEOpfNGGxBqlK4/E7MLLWxcEJ5PONbxrrynUEl5/6iktSG9+p0FbZ+69Ig8sBSWsaKMfX/ TjixcX9RrpcR4kM6W9+KDi3doDCw2opXnVXJs1dfbDHber2cptUgcPZg2klCeonD69YCtbh4E9V frLj2F6fhDEwXovHE9dmaAYXrx4MUlWNnWXF7Ghho/OQ4AT803/e68yxS2d9vGvR6oW5buPzIu1 mlrM9vteISWAcBit+HYHv2uAYbAEKeadp5Ifyen2Y9sH0dNkfWUPOKHL3vno7uRTfS18hxD4e86 26PatMtqKUJup7iwHq5V9QigizN31NfbU5AoBe12vGQ+E4qUTFiii1meZ1Syaz0HEsBut5DlGZB jKTxA5YXNzKXzh2gMr+EtfsPvTLms/u/oHjnzmZgwDvCIzLlT/lSl87AwFbhpHDBguQjcfTQ0Mg K1VhLdp03W/CZAUX9UALGzwbqu8DJbYjRo9rTfwd+PDdexNm4+dmZiWa48aQpfFwu3KSXV4xnXK BbNdAPMgYnoyiVVLq2Hy2zHqhvba3qJkOIDNjbbdfwMBrbGOpIDzaSUIS939LVbTmE62eCGjZ/p HPrxdrpQOIPKiOQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493645613158500 Move description and default_value population from the individual QMP handlers into qom_property_info(), so all callers get them. This also adds description and default-value to qom-list responses, which previously only returned name and type. The handler doesn't care. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- qom/qom-qmp-cmds.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c index 47bf3bf2937a..84a295905148 100644 --- a/qom/qom-qmp-cmds.c +++ b/qom/qom-qmp-cmds.c @@ -35,6 +35,8 @@ static ObjectPropertyInfo *qom_property_info(ObjectProper= ty *prop) =20 info->name =3D g_strdup(prop->name); info->type =3D g_strdup(prop->type); + info->description =3D g_strdup(prop->description); + info->default_value =3D qobject_ref(prop->defval); if (prop->qapi_type) { assert(prop->qapi_type->masked_name); info->qapi_type =3D g_strdup(prop->qapi_type->masked_name); @@ -243,8 +245,6 @@ ObjectPropertyInfoList *qmp_device_list_properties(cons= t char *typename, =20 object_property_iter_init(&iter, obj); while ((prop =3D object_property_iter_next(&iter))) { - ObjectPropertyInfo *info; - /* Skip Object and DeviceState properties */ if (strcmp(prop->name, "type") =3D=3D 0 || strcmp(prop->name, "realized") =3D=3D 0 || @@ -254,11 +254,7 @@ ObjectPropertyInfoList *qmp_device_list_properties(con= st char *typename, continue; } =20 - info =3D qom_property_info(prop); - info->description =3D g_strdup(prop->description); - info->default_value =3D qobject_ref(prop->defval); - - QAPI_LIST_PREPEND(prop_list, info); + QAPI_LIST_PREPEND(prop_list, qom_property_info(prop)); } =20 object_unref(obj); @@ -295,12 +291,7 @@ ObjectPropertyInfoList *qmp_qom_list_properties(const = char *typename, object_property_iter_init(&iter, obj); } while ((prop =3D object_property_iter_next(&iter))) { - ObjectPropertyInfo *info =3D qom_property_info(prop); - - info->description =3D g_strdup(prop->description); - info->default_value =3D qobject_ref(prop->defval); - - QAPI_LIST_PREPEND(prop_list, info); + QAPI_LIST_PREPEND(prop_list, qom_property_info(prop)); } =20 object_unref(obj); --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493812; cv=none; d=zohomail.com; s=zohoarc; b=F/ImZovWMGHFo1fo0W8bV3VUjuFqlKewHI+aMQb1cP/IWUch8Qygi3MkykBdCD5ITHWrzcc9OIUBMlv1/WHGoTRFNM+t5hjaWkRwUCNtrBeEn67Eb64CHM8hfFiJeRBi+6nZ8lmS0nk0rA3EKI8SrEBhnK906DxtNLVvl2zQICI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493812; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+mUlmiLA0IUJrEFhhdtqFL7MoWyX2aJUgEr0fLN0OLI=; b=dggY4QMqezRAoKKjmCzSyGBTA7dSAlCWmsl68EouxofRjTDiMmhSN57U6ZlLhx1yR2UqKOOh9Jz1cwU+pdz4PcLz/RTSiAaNiz5Lcf+rwrZ9q5VYj6SYCg/SWKulzvElXS4BtSS3bvyM6zyJVO40hBQqtWs2mVTWlraHxhCrqdI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493812240646.113734970689; Tue, 20 Oct 2026 03:56:52 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455317.1669008 (Exim 4.92) (envelope-from ) id 1xJ7W8-0005DX-BG; Tue, 20 Oct 2026 10:56:28 +0000 Received: by outflank-mailman (output) from mailman id 1455317.1669008; Tue, 20 Oct 2026 10:56:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7W7-0005AO-17; Tue, 20 Oct 2026 10:56:27 +0000 Received: by outflank-mailman (input) for mailman id 1455317; Tue, 20 Oct 2026 10:50:47 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Qd-0008Uf-HD for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:50:47 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7Qc-00Crdk-UE for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:50:46 +0200 Received: from [10.42.69.7] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad7477c-2eae-0a2a0a5409dd-0a2a4507e786-16 for ; Tue, 20 Oct 2026 12:50:46 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad746d1-b4ea-0a2a45070019-aa0a857c7e31-3 for ; Tue, 20 Oct 2026 12:47:46 +0200 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-98-b50LkXhBNAOr4KDZgzOCJQ-1; Tue, 20 Oct 2026 06:47:41 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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 0944C1955F10; Tue, 20 Oct 2026 10:47:37 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2487E418; Tue, 20 Oct 2026 10:47:34 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+mUlmiLA0IUJrEFhhdtqFL7MoWyX2aJUgEr0fLN0OLI=; b=SS6C7+uEhqtNUXezaeMbtvhstrOQmCgu0s3y+3E+BtHv3tfr0kag5KFKHNhW3JBuYaaMH7 Z0y1/boFOo6SErFAGe6fIF0DeEZgXq7994YgT0jVxJTWqGW2UQzXaBnpBZ0xwyE3ennvma CgF8xSLirWR7345uZ+XW1dKTWwHGFUg= X-MC-Unique: b50LkXhBNAOr4KDZgzOCJQ-1 X-Mimecast-MFC-AGG-ID: b50LkXhBNAOr4KDZgzOCJQ_1792493257 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:32 +0400 Subject: [PATCH v7 15/65] qom: add object_property_set_default_enum() MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-15-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1741; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=bT9PbeYHomyeIGAcVfTDM+lJI5Y2hBOOffhp2f1n7bs=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZY3cZceXMTAsDTPVPQLUPiFXhCtfGOTuUzE ex7dEME5rOJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWAAKCRDa6OEJdZac 5YB4D/9GPjvfJ9QnS3NS7uzoH3zuMz6cgmZWUWiCGV7tsWnNbbIfmXnGwpWDwpNzL9cRsohPRiM Tt8mSTGA/sJmszkK+oQShJ63FCmfW5pbd7ruMCtTStlRVh8rCjUWyx0b9IGf9lj7a1sXuaMjRiZ RmIstsYrcvq9fJ0J5SM1RTodk1Qvgn2pQe7pG/U8OW8Myg6fto5tvml4IN5pYuE4YB/AteIWUfl cy3Y6JisAPLbkZWEjeehnRqpYjs8lJcEc0jd6jT5Ajm3DFQFLMkmckRPpjNofoDbeN1tQ7K0s98 vwayy8xoutwUgsV9wX6qCvRBLY1+DpxNBTHm+xV32yF2estcn1ixmHngJQMaNbWwx3sJ0FueH2i nHGW2/UH0XkgcegNOKOcSppusTIisYEHOeK2W37dK7A4gv7fgemaMBfKADWuc6jN/xKP4O2sAOs EPPKK+R1nyzBdIIsDWdYkhnmUpz08PjAX7t/9zIyQvJy6HeZMYEvqH92Dv9Aqm0tKTwJeHGv8Mx G+jFxLb6K1GFyZQ9S6izdwx5JWqfiEfKijUzBP4iLHpB4BirgMYkk/bqayFVYZSlxI7iVj9lGda LEl9RmhNncJu8lNAZW9bmWSGo4Vlr/rpl4jKvIuRbcz2N62kMeZEEXIRFPUNBGeJNDW8b+FYyQK eIre7G+lNeX5Okw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-MFC-PROC-ID: ZBBJlYuRB8K_9BoZJwGdjr0B2xJ0iydyhq8fqGlVnE4_1792493257 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-ef75cf/1792493266-3C212AE4-4F2B330F/0/0 X-purgate-type: clean X-purgate-size: 1743 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493812589158500 A simple helper to set the default enum value from the integer value. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/qom/object.h | 9 +++++++++ qom/object.c | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/include/qom/object.h b/include/qom/object.h index e9b380462ded..2a5723c555e9 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1260,6 +1260,15 @@ void object_property_set_default_bool(ObjectProperty= *prop, bool value); */ void object_property_set_default_str(ObjectProperty *prop, const char *val= ue); =20 +/** + * object_property_set_default_enum: + * @prop: the property to set + * @value: the value to be written to the property + * + * Set the property default value. + */ +void object_property_set_default_enum(ObjectProperty *prop, int value); + /** * object_property_set_default_list: * @prop: the property to set diff --git a/qom/object.c b/qom/object.c index c34b47312f29..1d09315b328b 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1719,6 +1719,15 @@ void object_property_set_default_str(ObjectProperty = *prop, const char *value) object_property_set_default(prop, QOBJECT(qstring_from_str(value))); } =20 +void object_property_set_default_enum(ObjectProperty *prop, int value) +{ + assert(prop && prop->qapi_type && prop->qapi_type->lookup); + + object_property_set_default(prop, QOBJECT(qstring_from_str( + qapi_enum_lookup(prop->qapi_type->lookup, value) + ))); +} + void object_property_set_default_list(ObjectProperty *prop) { object_property_set_default(prop, QOBJECT(qlist_new())); --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493826; cv=none; d=zohomail.com; s=zohoarc; b=XokHbR+X7jYtz/yfckpr1HEGTMgIE/KSVMSUyD39Sec61v3WEKatNyTlNI6E9+IHQ6ihiR22ndPCvQUfsV9BSaMt8jg9GGferhekH2QNG0mRtZ2aOvr+u76YNwYxJixF+jy4s13vpSKi6G1rHpTYnlKxlIGp/WoaIMAolSg+xNw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493826; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=w3CoU0QuGNI+p7I3jy6WGQ0mlfEWpp4sXXt2/m2QXAI=; b=VrIQINce+1JuxM37HIDp75HwVHro2UKpT2C0zrnazu5IXPxx2IKiXO6RkTcssMm9YMtuCv08STPhaYOuh9R2DLx/tRT+QMnc97Zi6/IfFuwIMXTMqLltMUcETEWoCTwk9djW7QZexvQvdBJf7NAykW8qpy5wS3yJvlbk8Jw9SDI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 179249382678714.333302233002883; Tue, 20 Oct 2026 03:57:06 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455338.1669099 (Exim 4.92) (envelope-from ) id 1xJ7WT-00013j-2I; Tue, 20 Oct 2026 10:56:49 +0000 Received: by outflank-mailman (output) from mailman id 1455338.1669099; Tue, 20 Oct 2026 10:56:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7WR-0000wz-MG; Tue, 20 Oct 2026 10:56:47 +0000 Received: by outflank-mailman (input) for mailman id 1455338; Tue, 20 Oct 2026 10:51:01 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Qq-00008C-W7 for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:01 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7Qq-004d40-Cd for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:00 +0200 Received: from [10.42.69.4] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad7478b-8faa-0a2a0a5109dd-0a2a4504bc34-40 for ; Tue, 20 Oct 2026 12:51:00 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad746de-b57f-0a2a45040019-aa0a857c5929-3 for ; Tue, 20 Oct 2026 12:47:59 +0200 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-378-qnN94N6QPK2vA93ceMbHjQ-1; Tue, 20 Oct 2026 10:47:46 +0000 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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 9161F1955F02; Tue, 20 Oct 2026 10:47:41 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 15EC75BC; Tue, 20 Oct 2026 10:47:39 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w3CoU0QuGNI+p7I3jy6WGQ0mlfEWpp4sXXt2/m2QXAI=; b=D+0o74KQQ/iAzz0i6BCX0iYkV8kwbgbBlC5SeZmlId+ZVB1an4olzwd2sx3Q6iqbAmARQN UPNXlPvjfx2/KNvgib4gZEpJxuSrul+pWwu1U2/WTo+ecqwPMsI55eSxu3/LNsYB9XTHKI HeSSg4nOjGNgaTWd0LT5yOMIJ9Gcfw4= X-MC-Unique: qnN94N6QPK2vA93ceMbHjQ-1 X-Mimecast-MFC-AGG-ID: qnN94N6QPK2vA93ceMbHjQ_1792493261 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:33 +0400 Subject: [PATCH v7 16/65] qom: add object_{class_}property_add_qapi MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-16-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=4847; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=Kq06N3iO6F8AhEf3w27s03u+jnvcQuJjGRRe4Zmd+Hw=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZYIBdWrkS5tz+9/UTddwYES8EXuUjGwwr7o DY/JyPpfPaJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWAAKCRDa6OEJdZac 5YwTEACxwwoxioLPKJmAISYmT8CzcjaWz6/mg9O/RdNTtr/Qe5SgKfnNgHmYpowIFXzfKxXxVk0 B1ORjczYVaJ2+0sEYatt98MR4cL6Hv6jxJmuNPVhuZm/dGP4xT8zjDnqPWrzyhuGDnRW314fM0G cs/+K/C+Nwe2hpLMybC8gw/whDhlPfHu8KTvLEBX5v7tKzgP6D7PedIBYWNwqFSmpuO0PlQuMHR vN33ahh98LvZbfbEhdgO2kdICQMa0DUZEF3ng3OASLe7+t8JVNn+KdmUEBihcL1bJKaAVpj30Xa akndT9MZhwYvZw095fcPoxfNhNpNXbRLhzvdGBMkE2j3b8DxfYnc+JFviLUfeaEL/RnpAHO/io7 w903ZGKDrm8kPlKsMwWsMLrWGdPLR5Kc5NsiK0+s+/lExqWl6WXGAKpJ1XWiI9SvSRFr+pT8sRG YQnTqX+5yjvMZjHUf8jZ5kJOLYZxU/73vOGIBhxLDvlVywwQz+b5C3azNqGdFSLYqf+PbAJiruh g7uaTSrEABrr0xm+UN5VZL/yxAJEyP0wzq4K8tg3ZRfb9EeYCKYxoaRTQnBz5hWjPVnJbnUqt4X lIR0HJed6Cwk5m/Qb1NAZshRIkE3JTkSJUbwmlB1M99oPiceyZi0qG1emOPy0nq/lenfk9B+FRX AIGs9zGqOul8NUQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-MFC-PROC-ID: TpKASW0VFf-FnefmHBsslcMz2r6KW0Xvst0dpP9wvGU_1792493261 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-ebf023/1792493279-C1CD7B50-9FABBD01/0/0 X-purgate-type: clean X-purgate-size: 4849 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493828918158500 Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/qom/object.h | 55 ++++++++++++++++++++++++++++++++++++++++++++++++= ++++ qom/object.c | 32 ++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) diff --git a/include/qom/object.h b/include/qom/object.h index 2a5723c555e9..eb61d8842b80 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -2027,6 +2027,61 @@ ObjectProperty *object_class_property_add_enum(Objec= tClass *klass, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)); =20 +/** + * object_property_add_qapi: + * @obj: the object to add a property to + * @name: the name of the property + * @qapi_type: QAPI type info descriptor + * @get: The getter to be called to read a property. If this is NULL, then + * the property cannot be read. + * @set: the setter to be called to write a property. If this is NULL, + * then the property cannot be written. + * @release: called when the property is removed from the object. This is + * meant to allow a property to free its opaque upon object + * destruction. This may be NULL. + * @opaque: an opaque pointer to pass to the callbacks for the property + * + * Add a property with a QAPI type association. The property type name + * is derived from @qapi_type->name. + * + * Returns: The newly added property on success, or %NULL on failure. + */ +ObjectProperty * +object_property_add_qapi(Object *obj, const char *name, + const QAPITypeInfo *qapi_type, + ObjectPropertyAccessor *get, + ObjectPropertyAccessor *set, + ObjectPropertyRelease *release, + void *opaque); + +/** + * object_class_property_add_qapi: + * @klass: the object class to add a property to + * @name: the name of the property + * @qapi_type: QAPI type info descriptor + * @get: The getter to be called to read a property. If this is NULL, then + * the property cannot be read. + * @set: the setter to be called to write a property. If this is NULL, + * then the property cannot be written. + * @release: called when the property is removed from the object. This is + * meant to allow a property to free its opaque upon object + * destruction. This may be NULL. + * @opaque: an opaque pointer to pass to the callbacks for the property + * + * Add a property with a QAPI type association. The property type name + * is derived from @qapi_type->name. + * + * Returns: The newly added property on success, or %NULL on failure. + */ +ObjectProperty * +object_class_property_add_qapi(ObjectClass *klass, + const char *name, + const QAPITypeInfo *qapi_type, + ObjectPropertyAccessor *get, + ObjectPropertyAccessor *set, + ObjectPropertyRelease *release, + void *opaque); + /** * object_property_add_tm: * @obj: the object to add a property to diff --git a/qom/object.c b/qom/object.c index 1d09315b328b..bebbfc43556d 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2609,6 +2609,38 @@ object_class_property_add_enum(ObjectClass *klass, c= onst char *name, prop); } =20 +ObjectProperty * +object_property_add_qapi(Object *obj, const char *name, + const QAPITypeInfo *qapi_type, + ObjectPropertyAccessor *get, + ObjectPropertyAccessor *set, + ObjectPropertyRelease *release, + void *opaque) +{ + ObjectProperty *prop; + + prop =3D object_property_add(obj, name, qapi_type->name, + get, set, release, opaque); + prop->qapi_type =3D qapi_type; + return prop; +} + +ObjectProperty * +object_class_property_add_qapi(ObjectClass *klass, const char *name, + const QAPITypeInfo *qapi_type, + ObjectPropertyAccessor *get, + ObjectPropertyAccessor *set, + ObjectPropertyRelease *release, + void *opaque) +{ + ObjectProperty *prop; + + prop =3D object_class_property_add(klass, name, qapi_type->name, + get, set, release, opaque); + prop->qapi_type =3D qapi_type; + return prop; +} + typedef struct TMProperty { void (*get)(Object *, struct tm *, Error **); } TMProperty; --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493824; cv=none; d=zohomail.com; s=zohoarc; b=HuIrW5R4Zl1fJ+3cAbW+MO91rMcvnlU2tpicPF9YhgJOeWTPZjDXyXe0lno7ad9gL+JaZa9JIKDbWyzcZtC9zfOR2YlgMxwQ3IBjcAV6vLXvBq0uj3q+zKHEJzptAg1LJVyKPTv63cYewJn6FNIQPlyVmB7UcUCHMKPgCdxgZI4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493824; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VkXUlwrEvWdaFT7ZgPzD9XegjPTV54S9i+Wt7fwK38w=; b=ei35nDOvm1HMKYIuxWrQb+8kEHXY8C19DHRGixmsjGUXmgn62v30W418cpjkv3UYRaREiaPIHNwl52R/lBwr9+fVGN5dNQsYi6ohMfa65slfvT2jqky195Dlb+q8b1oL9F2MoPxGP5u/JbPScOdxlEvpLuaTb+/IlTvCL+6+WmM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493824018867.6894933640739; Tue, 20 Oct 2026 03:57:04 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455330.1669072 (Exim 4.92) (envelope-from ) id 1xJ7WM-0008Es-Nf; Tue, 20 Oct 2026 10:56:42 +0000 Received: by outflank-mailman (output) from mailman id 1455330.1669072; Tue, 20 Oct 2026 10:56:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7WL-00086v-K9; Tue, 20 Oct 2026 10:56:41 +0000 Received: by outflank-mailman (input) for mailman id 1455330; Tue, 20 Oct 2026 10:50:57 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Qn-00006L-BX for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:50:57 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7Qm-002FUq-Oc for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:50:56 +0200 Received: from [10.42.69.6] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74783-bab6-0a2a0a5309dd-0a2a450695a8-30 for ; Tue, 20 Oct 2026 12:50:56 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad746db-195a-0a2a45060019-aa0a857cb563-3 for ; Tue, 20 Oct 2026 12:47:56 +0200 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-488-ofM9Jc0cNLCC9EhH-k12SQ-1; Tue, 20 Oct 2026 10:47:51 +0000 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 10F8B19560B6; Tue, 20 Oct 2026 10:47:47 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 05BB51800444; Tue, 20 Oct 2026 10:47:44 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VkXUlwrEvWdaFT7ZgPzD9XegjPTV54S9i+Wt7fwK38w=; b=ZWw7PUbEOSaQqQmEL9mhHmawW5Iwa9h9YaC6bsuOJ5dWycxOjK6gx0WcZjKRRDnaVWjB9Z Y+aFECiwRvoJEDfDySS9A0adBiCJKNl7u33a/XsZK20YezRVhIeVbdql9tRYM5v+2vxBrM E+9HNYnjVa+xml42KxxCUVWJnbIdnBs= X-MC-Unique: ofM9Jc0cNLCC9EhH-k12SQ-1 X-Mimecast-MFC-AGG-ID: ofM9Jc0cNLCC9EhH-k12SQ_1792493267 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:34 +0400 Subject: [PATCH v7 17/65] qom: add object_{class_}property_add_qapi_enum MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-17-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=7651; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=6wd/SoQY2q+EMLwTd/AeIQErpXbBILREXSh6bn43Lqo=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZZB/jExQFvbdi+wU3hKVxpaaPc1XbpmkIhP WMqxmJ0I1aJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWQAKCRDa6OEJdZac 5dBmD/9iljR90PsVPSEMouwGTqd5u0I3uFFVeGE6aj8If5dMfAJeES/9tbvs9mRjLcapLLGllYU TQNIPpVo9+5Q6yWoXDup+0bZugqArDJn+E+oR5GWaIn14K0W/lTsFVa1fdorL5FJzcZt9nLwPbs qBkK2X0Tow/JAOq9beFe0nqvt9e3h8csBkY2OzylCKV8xgUUa/N7/jUd9n3xMAaklrEguKhws7p RB2EmxgN94MyEQXZtZhqjVrWq/vsUKgCcwLJ7z6Xyu8ikQIh00qHstMPJONSLnW5X32860y2JUn RdI6UxJof0RAZu18Ge3d8Qgv+eKmoIfivMtXvHmI0YJtHLFqrI6rXfocRQLrZTDmpURYQ6U9u1U 9yB9eLpPbMa9W1bghYaq4IAEJtvVsjv1kKDYGVAIPSlYH4dCgI/2TzssabsosxuEN1Phkx1epKW nBgKSEf8pt2cQsFq4SKILCVz/lUAkaZIcqrcLdVjN41qVK33dbV9SETzfNzbcypT0qn3Uvh31bB cekeBayXn2khLf+x2Dyym0EbRSJPRvIWIuFiabEG6a8kpeAZgLkNy8ux2Hrid+xaEV/Q2NlRSrc gxaEBZ3gRSWWWvkLE9xRhqAlVrj2m9egPJPQhy1zP1+3Zkc94/+TwXdjvCND2ByqbflBsfGVWJ7 eokXUJapDD7zDZg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-MFC-PROC-ID: 4eVOH8WTLgbzo171EGIxVHHuw2VkEF--2ax94U-GSfg_1792493267 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-16d1c6/1792493276-FC60277B-0516E0D8/0/0 X-purgate-type: clean X-purgate-size: 7653 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493824783158500 Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/qom/object.h | 74 ++++++++++++++++++++++++++++++++++++++++++ qom/object.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++++= +--- 2 files changed, 159 insertions(+), 5 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index eb61d8842b80..e04be4caed57 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -2027,6 +2027,80 @@ ObjectProperty *object_class_property_add_enum(Objec= tClass *klass, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)); =20 +/** + * struct QapiEnumProp: Descriptor for a property backed by a QAPI enum ty= pe + * + * Binds a QOM object property to a QAPI enum, providing automatic + * string<->int conversion through QAPI visitors and optional + * default-value initialization during object instance init. + * + * Use the QAPI_ENUM_PROP() macro to construct instances inline. + * + * @name: property name exposed on the QOM object + * @description: human-readable description (shown in ``-device help``, et= c.) + * @default_value: initial enum value applied via @set during instance ini= t, + * or -1 (the QAPI_ENUM_PROP default) to skip initializati= on + * @qapi_type: pointer to the generated QAPITypeInfo for the enum + * (provides the string<->int lookup table) + * @get: getter that returns the current enum value as int, or -1 on error + * @set: setter that receives the enum value as int; %NULL for read-only p= rops + */ +typedef struct QapiEnumProp { + const char *name; + const char *description; + const int default_value; + const QAPITypeInfo *qapi_type; + int (*get)(Object *, Error **); + void (*set)(Object *, int, Error **); +} QapiEnumProp; + +#define QAPI_ENUM_PROP(...) ({ \ + static const QapiEnumProp _prop =3D { = \ + .default_value =3D -1, __VA_ARGS__ = \ + }; \ + &_prop; }) + +/** + * object_property_add_qapi_enum: + * @obj: the object to add a property to + * @prop: property descriptor + * + * Add an enum property with QAPI type association. + * + * Returns: The newly added property on success, or %NULL on failure. + */ +ObjectProperty * +object_property_add_qapi_enum(Object *obj, const QapiEnumProp *prop); + +/** + * object_class_property_add_qapi_enum: + * @klass: the class object to add a property to + * @prop: property descriptor + * + * Add an enum property with QAPI type association. + * + * Use the QAPI_ENUM_PROP() macro to construct the property descriptor + * inline. If .default_value is not set, the property is not initialized + * (default_value is -1). Otherwise, the setter is called with + * default_value during object instance init. + * + * Example:: + * + * object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + * .name =3D "policy", + * .description =3D "Set the NUMA policy", + * .default_value =3D HOST_MEM_POLICY_DEFAULT, + * .qapi_type =3D &HostMemPolicy_type_info, + * .get =3D my_get_policy, + * .set =3D my_set_policy, + * )); + * + * Returns: The newly added property on success, or %NULL on failure. + */ +ObjectProperty * +object_class_property_add_qapi_enum(ObjectClass *klass, + const QapiEnumProp *prop); + /** * object_property_add_qapi: * @obj: the object to add a property to diff --git a/qom/object.c b/qom/object.c index bebbfc43556d..cc113c0810e7 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1219,7 +1219,7 @@ static void object_class_foreach_tramp(gpointer key, = gpointer value, return; } =20 - if (data->implements_type &&=20 + if (data->implements_type && !object_class_dynamic_cast(k, data->implements_type)) { return; } @@ -1786,7 +1786,6 @@ int object_property_get_enum(Object *obj, const char = *name, char *str; int ret; ObjectProperty *prop =3D object_property_find_err(obj, name, errp); - EnumProperty *enumprop; =20 if (prop =3D=3D NULL) { return -1; @@ -1799,14 +1798,17 @@ int object_property_get_enum(Object *obj, const cha= r *name, return -1; } =20 - enumprop =3D prop->opaque; - str =3D object_property_get_str(obj, name, errp); if (!str) { return -1; } =20 - ret =3D qapi_enum_parse(enumprop->lookup, str, -1, errp); + if (prop->qapi_type) { + ret =3D qapi_enum_parse(prop->qapi_type->lookup, str, -1, errp); + } else { + EnumProperty *enumprop =3D prop->opaque; + ret =3D qapi_enum_parse(enumprop->lookup, str, -1, errp); + } g_free(str); =20 return ret; @@ -2609,6 +2611,84 @@ object_class_property_add_enum(ObjectClass *klass, c= onst char *name, prop); } =20 +static void get_qapi_enum(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + const QapiEnumProp *prop =3D opaque; + int value; + Error *err =3D NULL; + + value =3D prop->get(obj, &err); + assert(value >=3D 0 || err); + if (err) { + error_propagate(errp, err); + return; + } + + visit_type_enum(v, name, &value, prop->qapi_type->lookup, errp); +} + +static void set_qapi_enum(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + const QapiEnumProp *prop =3D opaque; + int value; + + if (!visit_type_enum(v, name, &value, prop->qapi_type->lookup, errp)) { + return; + } + prop->set(obj, value, errp); +} + +static void init_qapi_enum(Object *obj, ObjectProperty *prop) +{ + const QapiEnumProp *e =3D prop->opaque; + + if (e->set && e->default_value >=3D 0) { + e->set(obj, e->default_value, &error_abort); + } +} + +ObjectProperty * +object_property_add_qapi_enum(Object *obj, const QapiEnumProp *e) +{ + ObjectProperty *prop; + + assert(e && e->qapi_type && e->qapi_type->lookup); + + prop =3D object_property_add_qapi(obj, e->name, e->qapi_type, + e->get ? get_qapi_enum : NULL, + e->set ? set_qapi_enum : NULL, + NULL, + (void *)e); + prop->description =3D g_strdup(e->description); + if (e->default_value >=3D 0) { + prop->init =3D init_qapi_enum; + } + + return prop; +} + +ObjectProperty * +object_class_property_add_qapi_enum(ObjectClass *klass, const QapiEnumProp= *e) +{ + ObjectProperty *prop; + + assert(e && e->qapi_type && e->qapi_type->lookup); + + prop =3D object_class_property_add_qapi(klass, e->name, e->qapi_type, + e->get ? get_qapi_enum : NULL, + e->set ? set_qapi_enum : NULL, + NULL, + (void *)e); + prop->description =3D g_strdup(e->description); + if (e->default_value >=3D 0) { + prop->init =3D init_qapi_enum; + } + + return prop; +} + ObjectProperty * object_property_add_qapi(Object *obj, const char *name, const QAPITypeInfo *qapi_type, --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493835; cv=none; d=zohomail.com; s=zohoarc; b=JHiboPC+oWXpcyTA4aP1VDMWv+HMlWTJmBUhZM0+JXFj6nGikp4u9et4Metq1a82Gps7cL49JLNtPGRqP1LPW7cOqHv/pJo5ZPruHbnJbZlAs8egja0qrQfbGMl20Pj+XBeRJpKaiEl9eLmf0OhoEKzLoOiZ94qLduJTrZDl+mg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493835; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QCsJ6kicmUEQxvaxmAE24eNtz/CdTOeeNBSuCmDZMU8=; b=akFUaTeys1jJDqcPUaLhEuEphjQI+h0g/nXPKeXmtR5JrnKj1oeJyDGgJx6cqSP01KcOpXfVffGV98hI20eoYGXOdIM2P4mqeR3AfUVg40eHV8SZ48uASo3Zl2rQ6CG5myl+p0mq5JiyIZAWf6gzqGuI4GcDPs3Hxj8UvJ3ixSE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493835321738.481874234974; Tue, 20 Oct 2026 03:57:15 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455340.1669116 (Exim 4.92) (envelope-from ) id 1xJ7WW-0001tB-PF; Tue, 20 Oct 2026 10:56:52 +0000 Received: by outflank-mailman (output) from mailman id 1455340.1669116; Tue, 20 Oct 2026 10:56:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7WV-0001oh-Ax; Tue, 20 Oct 2026 10:56:51 +0000 Received: by outflank-mailman (input) for mailman id 1455340; Tue, 20 Oct 2026 10:51:03 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Qt-00009G-KK for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:03 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7Qt-00CrlS-17 for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:03 +0200 Received: from [10.42.69.4] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74795-2eae-0a2a0a5409dd-0a2a4504e546-20 for ; Tue, 20 Oct 2026 12:51:03 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad746e1-b57f-0a2a45040019-aa0a857c95db-3 for ; Tue, 20 Oct 2026 12:48:02 +0200 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-624-Yh3hFIQYORWMSyn7dgfYTg-1; Tue, 20 Oct 2026 10:47:56 +0000 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 64C7A1955EBF; Tue, 20 Oct 2026 10:47:52 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7DD3F1803A59; Tue, 20 Oct 2026 10:47:49 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QCsJ6kicmUEQxvaxmAE24eNtz/CdTOeeNBSuCmDZMU8=; b=FRnFS5+mMpfAa5h+Ky/2Ig9z6W4JQKW/c8vOfqJV7SHaaJa6MCTDVDw8wNU6TNgv48J//Y /mnA9HrMIr+lp8NkFsfburrw6fcOj4rr51GPlLhtrn2cTwSp3IwcRH7GET+M8W+NLElR26 ZhIWj2AWpE/nheQJndq7M6Zj118gnqw= X-MC-Unique: Yh3hFIQYORWMSyn7dgfYTg-1 X-Mimecast-MFC-AGG-ID: Yh3hFIQYORWMSyn7dgfYTg_1792493272 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:35 +0400 Subject: [PATCH v7 18/65] tests: update check-qom-proplist for QAPI-aware property registration MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-18-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=5424; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=PG77OxkKQyF3UcxTgSF0ItIIQR9h6IXM0cn9v6bEm2s=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZZx0j1p4X5AH6xbN8P7cVXiebxN4/NouqlD Bs0dZkcTS6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWQAKCRDa6OEJdZac 5btyD/sEpsN54WFVkoxy/MA7ND5ExbGYknt3DZedYvvU6rJFWigzxdRqfgu17q4W5zjE+AamjfL BupH4gTHx7+2HfkN3D1gTx/xFdM5Kl6ToEoiDKjNOo862W3jNyyg4ovmX4tTnGNMAz88AfPwhL+ 2ZWNFNzjipqIGY0qQX4Bx66aa2+YE4fY3hQ9iiu+WjFc6AbgnPg4TF4XhUyHF70who98clFVOMD yjczx/5tD0aUOR4P15K6+ixi33/auB4tE1Iwmnx/jgl1p3xCy28fffjfyI9wgZwkX2u2stbYLIn lDbgxSH1ReWWj7z4XdgyxwniV2xbBYeYJEkOtCV/y7/dK6+AM+a7Qnq3kI/dzYhJuvhq5wU+HGR RiM76TgllhaUHS8VdrKmAFY/LmMaDcf5u+dyeDe3ragYCi0YRneV87Q3JrrFqhWtzDyLlEBLQBg R2RYEWwbUq91SYc+sy3M2s1dxK/Auw8r9jDxBr9VPRZeaKJzAr1tPm6hnSzp+dkR4vgyuSdKfW2 xgnVBc5i1OBtTZMbay85wjtkAfGfPH5jqgFBr3+8p6u1r9UH55oNAmVqy1ev7FnV/EBA4FlmSyX 4Ic6VS1CTDmF2CzubrTp3nVMwtdHRxtTKiFnV+tWJm6wxUGQS0/zDlqzL+ypt2gHRnuRwgDXqHU doz9mjn/aUw3+xw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-MFC-PROC-ID: HGrlm3_L3fIgzhIY14LSxG0_sjx69Xo9rnYaU35XMmM_1792493272 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-ebf023/1792493282-C34C3B50-F7C8D11F/0/0 X-purgate-type: clean X-purgate-size: 5426 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493836973158500 Migrate the dummy object's string and enum properties from the legacy object_class_property_add_str/enum() helpers to the new QAPI-aware object_class_property_add_qapi/qapi_enum() registration. Add test cases verifying that the qapi_type metadata is correctly populated on properties registered through the new API, and that it remains NULL for properties using the old-style registration. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- tests/unit/check-qom-proplist.c | 93 ++++++++++++++++++++++++++++++++++---= ---- 1 file changed, 77 insertions(+), 16 deletions(-) diff --git a/tests/unit/check-qom-proplist.c b/tests/unit/check-qom-proplis= t.c index 89de92b7d91f..69155e720751 100644 --- a/tests/unit/check-qom-proplist.c +++ b/tests/unit/check-qom-proplist.c @@ -108,22 +108,21 @@ static int dummy_get_av(Object *obj, } =20 =20 -static void dummy_set_sv(Object *obj, - const char *value, - Error **errp) +static void dummy_set_sv(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DummyObject *dobj =3D DUMMY_OBJECT(obj); =20 - g_free(dobj->sv); - dobj->sv =3D g_strdup(value); + g_clear_pointer(&dobj->sv, g_free); + visit_type_str(v, name, &dobj->sv, errp); } =20 -static char *dummy_get_sv(Object *obj, - Error **errp) +static void dummy_get_sv(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DummyObject *dobj =3D DUMMY_OBJECT(obj); =20 - return g_strdup(dobj->sv); + visit_type_str(v, name, &dobj->sv, errp); } =20 =20 @@ -135,16 +134,28 @@ static void dummy_init(Object *obj) } =20 =20 +static const QAPITypeInfo dummy_animal_qapi_type_info =3D { + .name =3D "DummyAnimal", + .masked_name =3D "DummyAnimalSchema", + .lookup =3D &dummy_animal_map, +}; + +static const QAPITypeInfo dummy_str_qapi_type_info =3D { + .name =3D "str", + .masked_name =3D "StrSchema", +}; + static void dummy_class_init(ObjectClass *cls, const void *data) { - object_class_property_add_str(cls, "sv", - dummy_get_sv, - dummy_set_sv); - object_class_property_add_enum(cls, "av", - "DummyAnimal", - &dummy_animal_map, - dummy_get_av, - dummy_set_av); + object_class_property_add_qapi(cls, "sv", &dummy_str_qapi_type_info, + dummy_get_sv, dummy_set_sv, + NULL, NULL); + object_class_property_add_qapi_enum(cls, QAPI_ENUM_PROP( + .name =3D "av", + .qapi_type =3D &dummy_animal_qapi_type_info, + .get =3D dummy_get_av, + .set =3D dummy_set_av, + )); } =20 =20 @@ -703,6 +714,54 @@ static void test_qom_partial_path(void) object_unparent(cont1); } =20 +static void test_dummy_qapi_enum(void) +{ + ObjectProperty *prop; + Object *parent =3D object_get_objects_root(); + DummyObject *dobj =3D DUMMY_OBJECT( + object_new_with_props(TYPE_DUMMY, + parent, + "dummy0", + &error_abort, + "av", "platypus", + NULL)); + + g_assert(dobj->av =3D=3D DUMMY_PLATYPUS); + + prop =3D object_property_find(OBJECT(dobj), "av"); + g_assert(prop); + g_assert(prop->qapi_type =3D=3D &dummy_animal_qapi_type_info); + g_assert_cmpstr(prop->qapi_type->name, =3D=3D, "DummyAnimal"); + g_assert_cmpstr(prop->qapi_type->masked_name, =3D=3D, "DummyAnimalSche= ma"); + g_assert(prop->qapi_type->lookup =3D=3D &dummy_animal_map); + + object_unparent(OBJECT(dobj)); +} + +static void test_dummy_qapi_prop(void) +{ + ObjectProperty *prop; + Object *parent =3D object_get_objects_root(); + DummyObject *dobj =3D DUMMY_OBJECT( + object_new_with_props(TYPE_DUMMY, + parent, + "dummy0", + &error_abort, + "sv", "hello", + NULL)); + + g_assert_cmpstr(dobj->sv, =3D=3D, "hello"); + + prop =3D object_property_find(OBJECT(dobj), "sv"); + g_assert(prop); + g_assert(prop->qapi_type =3D=3D &dummy_str_qapi_type_info); + g_assert_cmpstr(prop->qapi_type->name, =3D=3D, "str"); + g_assert_cmpstr(prop->qapi_type->masked_name, =3D=3D, "StrSchema"); + g_assert(prop->qapi_type->lookup =3D=3D NULL); + + object_unparent(OBJECT(dobj)); +} + int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); @@ -727,6 +786,8 @@ int main(int argc, char **argv) g_test_add_func("/qom/proplist/iterator", test_dummy_iterator); g_test_add_func("/qom/proplist/class_iterator", test_dummy_class_itera= tor); g_test_add_func("/qom/proplist/delchild", test_dummy_delchild); + g_test_add_func("/qom/proplist/qapi_enum", test_dummy_qapi_enum); + g_test_add_func("/qom/proplist/qapi_prop", test_dummy_qapi_prop); g_test_add_func("/qom/resolve/partial", test_qom_partial_path); =20 return g_test_run(); --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493844; cv=none; d=zohomail.com; s=zohoarc; b=kSJt1UWvjbAdEYFpsJgNVP8yLziX3wK5CK3Hx7fWe5MUTzegWOFasD5e8wikDjQiiNvP33rKee7s/tcA0iFYk6KtrRz2rWanI9fSdfPNG2oc2ObEV1TORZ8XwOoSRFqxdBOqs6hs5iNsh52ttuSwCeOCYb7DpvIJYdrMUaGF+Eg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493844; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VhnuP9GUFWkUKVrWiyyQ4TwAPJA5jCWzmPwQlY7WHrg=; b=koT/NJn95525vf2B0cAM7FQrkpjAjE4qTEW4etZbcFOSOT4GoJwOxYHOQXBRokQNnWbsl0xl/62v5Gk8hXL4Phem6MlT7OZZstTzkVBW2x4g08WZVDtJRHv9E7rNKD60G/IWH99tOenZFdAUiaEqSnVlA7TwqcZcxOM1WUWFYn4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493844362290.96663801789884; Tue, 20 Oct 2026 03:57:24 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455347.1669142 (Exim 4.92) (envelope-from ) id 1xJ7Wd-0003Di-CB; Tue, 20 Oct 2026 10:56:59 +0000 Received: by outflank-mailman (output) from mailman id 1455347.1669142; Tue, 20 Oct 2026 10:56:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Wb-00036l-JW; Tue, 20 Oct 2026 10:56:57 +0000 Received: by outflank-mailman (input) for mailman id 1455347; Tue, 20 Oct 2026 10:51:07 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Qx-0000BP-CK for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:07 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7Qw-00EzG1-PJ for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:06 +0200 Received: from [10.42.69.3] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74794-e002-0a2a0a5209dd-0a2a4503a12e-14 for ; Tue, 20 Oct 2026 12:51:06 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad746e5-fae8-0a2a45030019-aa0a817c758b-3 for ; Tue, 20 Oct 2026 12:48:06 +0200 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-381-X4ttvQKTOGG9YvCqjtTwwQ-1; Tue, 20 Oct 2026 10:48:00 +0000 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 11DD51802573; Tue, 20 Oct 2026 10:47:57 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8CE561800444; Tue, 20 Oct 2026 10:47:54 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VhnuP9GUFWkUKVrWiyyQ4TwAPJA5jCWzmPwQlY7WHrg=; b=PTXGlegFAmkgtV0NZ7aXnCK1gEwRhg+ab68SmHpjKcYQId3wL1JEOF+4J2qJ1srH4SEmsW hterHCuHo/pzDNyVSdwLuDAWLKHwHGssrgmJoLE0aIyKQejufG4U772qV+XIBaULysEBml +7VBaA8K1Rfuef8vB8r1um+NwQhrf1s= X-MC-Unique: X4ttvQKTOGG9YvCqjtTwwQ-1 X-Mimecast-MFC-AGG-ID: X4ttvQKTOGG9YvCqjtTwwQ_1792493277 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:36 +0400 Subject: [PATCH v7 19/65] qom: convert QAPI enum properties to QAPI-aware registration MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-19-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=17948; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=6HmJUS8ti31K3a3a2qrKIDTAV1LxUYYBxrUY2iMoiRk=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZZPwxGnXSq4QWDKEGgMqYI/Z8qJ2n4E63t1 CAug9EBmVyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWQAKCRDa6OEJdZac 5RHYD/0VR6RzZzElo//CjihnI3BcxT2JM6duKVAvqwMTKrGjqQtVIr3yVB0WUDpv88WeJIFdg0g K44rtv1wBk3k27wWQHYXY7c7JCopqGlklnoCl86FeoYYYtNUsZPVs9q0ULFWIGI4Tqp9X1F3SN4 dbjLnZ1Ds0GY7fjQa/rXmv1xBN/ahVlo1NQKDWaeCSJwkAUBJwZiQQ736DUVGC/tvtwX84EN9Lj tzSSsfMTBvx8cfQd8cXEIO6dhfddIinGu4eywL3AK9pJrNpx6dC5Dnam87ouxnsCWLlA+6dFsLe 2Bdmci2g1kcW2nSWb7I9o9TCiM/vYwjLeUAqn7U/0L3UQ8bGN7FSEWEVuyu1zZ5cMJK9629XRc3 4Y/qFNn34AbWMmCBopkJp/i6yYUt2EfML+gU2n9Bk+HcR+bjmDaQQYN7HtB0Gtgy9+XmlJXrvMP bkXFMpwWuoCn1YI6Bva6xjA/IWMdU/ZWW3UtIEZPXG8WkIw38aJVQormQ3+2lWqXnL94+ZMpScV kW49h/CEZOyzQQD21DXh7geRV1HjhOnTlfIUNdehs+faDS+daQfvUFXcgFyCeq7y+3TDtO1xakH yHL8HFJRXqWCOyvHMBUDfw0xmYBnia9NugUUUqNrAEMaAvPgcg6yI34b2O1h2KaPpyFe5IVMSAA p5e/RxCRFKHbH2Q== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-MFC-PROC-ID: b9uo3j7HUeIf06YDh-Yju29OfqzwQ-7Ctm2pS2SsM3o_1792493277 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-33051d/1792493286-768FA4E9-7CA80C2E/0/0 X-purgate-type: clean X-purgate-size: 17950 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493845141158500 Convert all callers of object_class_property_add_enum() but one to use the new object_class_property_add_qapi_enum() with the QAPI_ENUM_PROP() macro, which provides type information via QAPITypeInfo instead of raw lookup tables and string type names. This enables QMP QOM introspection to report accurate QAPI type names for enum properties. Where a separate set_description call was used, the description is now embedded in the QAPI_ENUM_PROP initializer. Leave pc_i440fx_machine_options() for later, because enum PCSouthBridgeOption is a handmade QAPI-like enum instead of a real one. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- authz/list.c | 12 +++++++----- backends/hostmem.c | 14 ++++++++------ crypto/secret_common.c | 12 +++++++----- crypto/tlscreds.c | 12 +++++++----- hw/microblaze/petalogix_s3adsp1800_mmu.c | 19 +++++++++++-------- include/chardev/char.h | 8 -------- monitor/qmp.c | 12 +++++++----- net/filter.c | 10 +++++++--- target/i386/kvm/kvm.c | 30 +++++++++++++++++-----------= -- ui/console-vc.c | 8 +++++++- ui/dbus.c | 18 ++++++++++++++---- ui/input-linux.c | 11 +++++++---- 12 files changed, 99 insertions(+), 67 deletions(-) diff --git a/authz/list.c b/authz/list.c index 17aa0efd80e8..363b2ee12c98 100644 --- a/authz/list.c +++ b/authz/list.c @@ -22,6 +22,7 @@ #include "authz/list.h" #include "trace.h" #include "qom/object_interfaces.h" +#include "qapi/qapi-type-infos-authz.h" #include "qapi/qapi-visit-authz.h" #include "qemu/module.h" =20 @@ -120,11 +121,12 @@ qauthz_list_class_init(ObjectClass *oc, const void *d= ata) { QAuthZClass *authz =3D QAUTHZ_CLASS(oc); =20 - object_class_property_add_enum(oc, "policy", - "QAuthZListPolicy", - &QAuthZListPolicy_lookup, - qauthz_list_prop_get_policy, - qauthz_list_prop_set_policy); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "policy", + .qapi_type =3D &QAuthZListPolicy_type_info, + .get =3D qauthz_list_prop_get_policy, + .set =3D qauthz_list_prop_set_policy, + )); =20 object_class_property_add(oc, "rules", "QAuthZListRule", qauthz_list_prop_get_rules, diff --git a/backends/hostmem.c b/backends/hostmem.c index 8782c8b1ea98..edb8e6ab4502 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -16,6 +16,7 @@ #include "hw/core/boards.h" #include "qapi/error.h" #include "qapi/qapi-builtin-visit.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/visitor.h" #include "qemu/config-file.h" #include "qom/compat-properties.h" @@ -551,12 +552,13 @@ host_memory_backend_class_init(ObjectClass *oc, const= void *data) NULL, NULL); object_class_property_set_description(oc, "host-nodes", "Binds memory to the list of NUMA host nodes"); - object_class_property_add_enum(oc, "policy", "HostMemPolicy", - &HostMemPolicy_lookup, - host_memory_backend_get_policy, - host_memory_backend_set_policy); - object_class_property_set_description(oc, "policy", - "Set the NUMA policy"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "policy", + .description =3D "Set the NUMA policy", + .qapi_type =3D &HostMemPolicy_type_info, + .get =3D host_memory_backend_get_policy, + .set =3D host_memory_backend_set_policy, + )); object_class_property_add_bool(oc, "share", host_memory_backend_get_share, host_memory_backend_set_share); object_class_property_set_description(oc, "share", diff --git a/crypto/secret_common.c b/crypto/secret_common.c index a5ecb876aeba..381d23ecc8e0 100644 --- a/crypto/secret_common.c +++ b/crypto/secret_common.c @@ -22,6 +22,7 @@ #include "crypto/secret_common.h" #include "crypto/cipher.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-crypto.h" #include "qom/object_interfaces.h" #include "qemu/base64.h" #include "qemu/module.h" @@ -269,11 +270,12 @@ qcrypto_secret_class_init(ObjectClass *oc, const void= *data) =20 ucc->complete =3D qcrypto_secret_complete; =20 - object_class_property_add_enum(oc, "format", - "QCryptoSecretFormat", - &QCryptoSecretFormat_lookup, - qcrypto_secret_prop_get_format, - qcrypto_secret_prop_set_format); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "format", + .qapi_type =3D &QCryptoSecretFormat_type_info, + .get =3D qcrypto_secret_prop_get_format, + .set =3D qcrypto_secret_prop_set_format, + )); object_class_property_add_str(oc, "keyid", qcrypto_secret_prop_get_keyid, qcrypto_secret_prop_set_keyid); diff --git a/crypto/tlscreds.c b/crypto/tlscreds.c index fb09e295a65c..54859720bf74 100644 --- a/crypto/tlscreds.c +++ b/crypto/tlscreds.c @@ -20,6 +20,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-crypto.h" #include "qapi-types-crypto.h" #include "qemu/module.h" #include "qemu/error-report.h" @@ -221,11 +222,12 @@ qcrypto_tls_creds_class_init(ObjectClass *oc, const v= oid *data) object_class_property_add_str(oc, "dir", qcrypto_tls_creds_prop_get_dir, qcrypto_tls_creds_prop_set_dir); - object_class_property_add_enum(oc, "endpoint", - "QCryptoTLSCredsEndpoint", - &QCryptoTLSCredsEndpoint_lookup, - qcrypto_tls_creds_prop_get_endpoint, - qcrypto_tls_creds_prop_set_endpoint); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "endpoint", + .qapi_type =3D &QCryptoTLSCredsEndpoint_type_info, + .get =3D qcrypto_tls_creds_prop_get_endpoint, + .set =3D qcrypto_tls_creds_prop_set_endpoint, + )); object_class_property_add_str(oc, "priority", qcrypto_tls_creds_prop_get_priority, qcrypto_tls_creds_prop_set_priority); diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petal= ogix_s3adsp1800_mmu.c index c5f64319009b..9a8fcc667812 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -27,6 +27,7 @@ #include "qemu/target-info.h" #include "qemu/units.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "target/microblaze/cpu.h" #include "hw/core/sysbus.h" #include "net/net.h" @@ -174,14 +175,16 @@ static void petalogix_s3adsp1800_machine_class_init(O= bjectClass *oc, mc->init =3D petalogix_s3adsp1800_init; mc->is_default =3D true; =20 - prop =3D object_class_property_add_enum(oc, "endianness", "EndianMode", - &EndianMode_lookup, - machine_get_endianness, - machine_set_endianness); - object_property_set_default_str(prop, target_big_endian() ? "big" - : "little"); - object_class_property_set_description(oc, "endianness", - "Defines whether the machine runs in big or little endian mode= "); + prop =3D object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "endianness", + .description =3D + "Defines whether the machine runs in big or little endian mode= ", + .qapi_type =3D &EndianMode_type_info, + .get =3D machine_get_endianness, + .set =3D machine_set_endianness, + )); + object_property_set_default_enum(prop, + target_big_endian() ? ENDIAN_MODE_BIG : ENDIAN_MODE_LITTLE); } =20 static const TypeInfo petalogix_s3adsp1800_machine_types[] =3D { diff --git a/include/chardev/char.h b/include/chardev/char.h index 2616c19cc095..21bf85d197eb 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -352,12 +352,4 @@ static void set_encoding(Object *obj, int value, Error= **errp) \ cast_func(obj)->encoding =3D value; \ } =20 -static inline void chardev_vc_add_encoding_prop(ObjectClass *oc, - int (*get)(Object *, Error **), - void (*set)(Object *, int, Error **)) -{ - object_class_property_add_enum(oc, "encoding", "ChardevVCEncoding", - &ChardevVCEncoding_lookup, get, set); -} - #endif diff --git a/monitor/qmp.c b/monitor/qmp.c index eb44012643f6..c2849214d58b 100644 --- a/monitor/qmp.c +++ b/monitor/qmp.c @@ -30,6 +30,7 @@ #include "qapi/error.h" #include "qapi/qapi-commands-control.h" #include "qapi/qapi-commands-char.h" +#include "qapi/qapi-type-infos-qom.h" #include "qobject/qdict.h" #include "qobject/qjson.h" #include "qobject/qlist.h" @@ -133,11 +134,12 @@ static void monitor_qmp_class_init(ObjectClass *cls, = const void *data) object_class_property_add_bool(cls, "pretty", monitor_qmp_get_pretty, monitor_qmp_set_pretty); - object_class_property_add_enum(cls, "close-action", - "MonitorQMPCloseAction", - &MonitorQMPCloseAction_lookup, - monitor_qmp_get_close_action, - monitor_qmp_set_close_action); + object_class_property_add_qapi_enum(cls, QAPI_ENUM_PROP( + .name =3D "close-action", + .qapi_type =3D &MonitorQMPCloseAction_type_info, + .get =3D monitor_qmp_get_close_action, + .set =3D monitor_qmp_set_close_action, + )); =20 moncls->emit_event =3D monitor_qmp_emit_event; moncls->requires_iothread =3D monitor_qmp_requires_iothread; diff --git a/net/filter.c b/net/filter.c index 389f3b0bfefb..79883af22a54 100644 --- a/net/filter.c +++ b/net/filter.c @@ -8,6 +8,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qmp/qerror.h" #include "qemu/error-report.h" =20 @@ -342,9 +343,12 @@ static void netfilter_class_init(ObjectClass *oc, cons= t void *data) =20 object_class_property_add_str(oc, "netdev", netfilter_get_netdev_id, netfilter_set_n= etdev_id); - object_class_property_add_enum(oc, "queue", "NetFilterDirection", - &NetFilterDirection_lookup, - netfilter_get_direction, netfilter_set_= direction); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "queue", + .qapi_type =3D &NetFilterDirection_type_info, + .get =3D netfilter_get_direction, + .set =3D netfilter_set_direction, + )); object_class_property_add_str(oc, "status", netfilter_get_status, netfilter_set_stat= us); object_class_property_add_str(oc, "position", diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index da922f72d71e..f2e8dc8c156d 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -14,6 +14,8 @@ =20 #include "qemu/osdep.h" #include "qapi/qapi-events-run-state.h" +#include "qapi/qapi-type-infos-common.h" +#include "qapi/qapi-type-infos-run-state.h" #include "qapi/error.h" #include "qapi/visitor.h" #include @@ -7089,12 +7091,13 @@ static void kvm_arch_set_honor_guest_pat(Object *ob= j, int value, Error **errp) =20 void kvm_arch_accel_class_init(ObjectClass *oc) { - object_class_property_add_enum(oc, "notify-vmexit", "NotifyVMexitOptio= n", - &NotifyVmexitOption_lookup, - kvm_arch_get_notify_vmexit, - kvm_arch_set_notify_vmexit); - object_class_property_set_description(oc, "notify-vmexit", - "Enable notify VM exit"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "notify-vmexit", + .description =3D "Enable notify VM exit", + .qapi_type =3D &NotifyVmexitOption_type_info, + .get =3D kvm_arch_get_notify_vmexit, + .set =3D kvm_arch_set_notify_vmexit, + )); =20 object_class_property_add(oc, "notify-window", "uint32", kvm_arch_get_notify_window, @@ -7127,13 +7130,14 @@ void kvm_arch_accel_class_init(ObjectClass *oc) object_class_property_set_description(oc, "xen-evtchn-max-pirq", "Maximum number of Xen PIRQs"); =20 - object_class_property_add_enum(oc, "honor-guest-pat", "OnOffAuto", - &OnOffAuto_lookup, - kvm_arch_get_honor_guest_pat, - kvm_arch_set_honor_guest_pat); - object_class_property_set_description(oc, "honor-guest-pat", - "Disable KVM quirk that ignores = guest PAT " - "memory type settings (default: = auto)"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "honor-guest-pat", + .description =3D "Disable KVM quirk that ignores guest PAT " + "memory type settings (default: auto)", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D kvm_arch_get_honor_guest_pat, + .set =3D kvm_arch_set_honor_guest_pat, + )); } =20 void kvm_set_max_apic_id(uint32_t max_apic_id) diff --git a/ui/console-vc.c b/ui/console-vc.c index 99cc8f09c887..cca4790c993c 100644 --- a/ui/console-vc.c +++ b/ui/console-vc.c @@ -6,6 +6,7 @@ =20 #include "chardev/char.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-char.h" #include "qemu/option.h" #include "qemu/queue.h" #include "qom/compat-properties.h" @@ -326,7 +327,12 @@ static void char_vc_class_init(ObjectClass *oc, const = void *data) cc->supports_size_opts =3D true; cc->supports_encoding_opts =3D true; =20 - chardev_vc_add_encoding_prop(oc, get_encoding, set_encoding); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "encoding", + .qapi_type =3D &ChardevVCEncoding_type_info, + .get =3D get_encoding, + .set =3D set_encoding, + )); } =20 static void char_vc_init(Object *obj) diff --git a/ui/dbus.c b/ui/dbus.c index 7be0f8e26119..afc321514c68 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -38,6 +38,8 @@ #include "qemu/audio.h" #include "audio/audio_int.h" /* FIXME: use QOM dynamic cast instead of drv= ->name */ #include "qapi/error.h" +#include "qapi/qapi-type-infos-char.h" +#include "qapi/qapi-type-infos-ui.h" #include "trace.h" =20 #include "dbus.h" @@ -508,9 +510,12 @@ dbus_display_class_init(ObjectClass *oc, const void *d= ata) object_class_property_add_bool(oc, "p2p", get_dbus_p2p, set_dbus_p2p); object_class_property_add_str(oc, "addr", get_dbus_addr, set_dbus_addr= ); object_class_property_add_str(oc, "audiodev", get_audiodev, set_audiod= ev); - object_class_property_add_enum(oc, "gl-mode", - "DisplayGLMode", &DisplayGLMode_lookup, - get_gl_mode, set_gl_mode); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "gl-mode", + .qapi_type =3D &DisplayGLMode_type_info, + .get =3D get_gl_mode, + .set =3D set_gl_mode, + )); } =20 #define TYPE_CHARDEV_VC "chardev-vc" @@ -602,7 +607,12 @@ dbus_vc_class_init(ObjectClass *oc, const void *data) cc->chr_open =3D dbus_vc_open; cc->supports_encoding_opts =3D true; =20 - chardev_vc_add_encoding_prop(oc, get_encoding, set_encoding); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "encoding", + .qapi_type =3D &ChardevVCEncoding_type_info, + .get =3D get_encoding, + .set =3D set_encoding, + )); } =20 static void diff --git a/ui/input-linux.c b/ui/input-linux.c index f4eee1ffd7ec..715d1f589297 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -6,6 +6,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "qemu/config-file.h" #include "qemu/main-loop.h" #include "qemu/module.h" @@ -506,10 +507,12 @@ static void input_linux_class_init(ObjectClass *oc, c= onst void *data) object_class_property_add_bool(oc, "repeat", input_linux_get_repeat, input_linux_set_repeat); - object_class_property_add_enum(oc, "grab-toggle", "GrabToggleKeys", - &GrabToggleKeys_lookup, - input_linux_get_grab_toggle, - input_linux_set_grab_toggle); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "grab-toggle", + .qapi_type =3D &GrabToggleKeys_type_info, + .get =3D input_linux_get_grab_toggle, + .set =3D input_linux_set_grab_toggle, + )); } =20 static const TypeInfo input_linux_info =3D { --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493878; cv=none; d=zohomail.com; s=zohoarc; b=gQ/Jw6nwLg1dQh0H5xFgXYlbfRDmZQqQdpKWAtz3q3iZONi1C/7A595p+3bHDf+00b6bh/vowclXOC3PSpws3865dYxDc3ZrT4Sp5R+cASuTnkdb2+JS1qJszyTbDdU2ycgf8ftpujx00SV2dH8XtlYhUDEO0zmu/j2IEIK2Quo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493878; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Vp5ZhrZ42bWj3S549eW3vIVawiZYq0pfGezhyH5wDcg=; b=AEv8M3D6OBD05hPy/67K3pfx5MRzeEgI1lOFEzPmt8VxUNe3PJktlI5/oQb7btHkBCu0KejSPkhwxhUG8IqOtKPD8YQjLwbrbaHBq5uZEvu6Ad5t9/717wzQmeeCa1yqvSiZGcTKlvNvJB22wdPFaISyFeiT3o315/PSUgELyHI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493878703795.6438985397307; Tue, 20 Oct 2026 03:57:58 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455374.1669260 (Exim 4.92) (envelope-from ) id 1xJ7XA-0001FQ-41; Tue, 20 Oct 2026 10:57:32 +0000 Received: by outflank-mailman (output) from mailman id 1455374.1669260; Tue, 20 Oct 2026 10:57:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7X8-00014T-Bu; Tue, 20 Oct 2026 10:57:30 +0000 Received: by outflank-mailman (input) for mailman id 1455374; Tue, 20 Oct 2026 10:51:22 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7RB-0000In-W5 for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:22 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7RB-00EzNE-Cz for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:21 +0200 Received: from [10.42.69.3] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74794-e002-0a2a0a5209dd-0a2a4503a12e-48 for ; Tue, 20 Oct 2026 12:51:21 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad746f2-fae8-0a2a45030019-aa0a817c9a65-3 for ; Tue, 20 Oct 2026 12:48:20 +0200 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-541-JzE2Aw8dO7qEs2TC0tJQ1g-1; Tue, 20 Oct 2026 10:48:07 +0000 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 E3D2518005BC; Tue, 20 Oct 2026 10:48:02 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BA4BE1956041; Tue, 20 Oct 2026 10:47:59 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vp5ZhrZ42bWj3S549eW3vIVawiZYq0pfGezhyH5wDcg=; b=ZAhA9+43RVMEslwUFrbtTOAiQaFI/f43HoqvWbJo/AZaUIwagb98xdqyiNfa5JEz951IBo b/Wj8Q+lgjtuesiAJ97OMbkF4vOBATMz5D8WIvf9QoUicDOBUNeyuuZEWQWTib1t5NxF2A naNss/8OZESzbfMjhAt4lSm2MjKeZOE= X-MC-Unique: JzE2Aw8dO7qEs2TC0tJQ1g-1 X-Mimecast-MFC-AGG-ID: JzE2Aw8dO7qEs2TC0tJQ1g_1792493283 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:37 +0400 Subject: [PATCH v7 20/65] qom: convert struct properties to QAPI-aware registration MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-20-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=12148; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=eg+SxgTFJgIB4Yau2dF+w/HtN0glmjOwr1JI4WkR+8g=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZZQGFK/ZN3udAc6CNCpipD4AhiQQoJIGozU /UDWSaFQtOJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWQAKCRDa6OEJdZac 5RtTD/4kY/PNza23E86wJfF/fcJzESsEo8MEy/VqKsja5Oehs0XOVVUYFNHeM3Hoz1tn0t6gfEB gEdZ6/dJUGUJsPT0Dj0TYlXOOC8uD6Zvml9ph4IssmkkoEVdOYCBEEh67ckdRLA+NhNogviRDgz pCf2Zf7wUKqc1WkJF7sDNgP2H346XFj5MJrvHYj+nchuXlLLJoJ2p8HRttnZVit3Bdcc8EVPLeq AiHdKE812PiIqx1KWVmo/AZD0Lve7bA8x3s9o2bXTj/C5WfXxaruFK1SEfvzwTSqS+eDZQa+9fR 7myj8VpQE8yMn4VkxlzMrQIdY3RLVol5dLbJqyOXixRGS7tup1ZTrthFFukzQ+JCIscmo0IFAzV 5Si0D6bITCS6Tuut/xCbHDT8PSneeFZ0cWij9WWp5dAB/MsZaiDjGU6VMM1DQbYxVVuPSDXujjZ TWfeG0zqk2YrLWTnqGDFDYN8sWFPB7hVAyu+5Z0C6WsRhAW6yJvDeRVFo09jibHvtdFtdDs6rZl TpG4qpJJgjL9ZoJid62lKL1oqVwWecyUyjvka9DVriGfw5BrWPlNKx6/zMNe82tz/yXa4413sCM /wmN+rl/byVmDvaAb/tgK1r7TXAwbPeuTuY/7eZ/wdgx3JWRblmU8A4iQI4d152HVQpmQjZ/jgZ aNhHsQ21q2Xo4hw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-MFC-PROC-ID: lxppWjbBY4csTXOpecbn7V2J1uMVwv3REGMIRwz2LM8_1792493283 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-33051d/1792493301-7468B4E9-1EC9E842/0/0 X-purgate-type: clean X-purgate-size: 12150 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493879839158500 Convert all callers of object_property_add() and object_class_property_add() that register struct-typed properties with QAPI visitor-based getters/setters to use object_property_add_qapi() and object_class_property_add_qapi() instead. This replaces the manual string type name with a reference to the generated QAPITypeInfo constant, enabling QMP introspection to report accurate QAPI type information for struct properties. Existing getters/setters are preserved unchanged. The cxl-fmw property type is corrected from "CXLFixedMemoryWindow" (not a real QAPI type) to "CXLFixedMemoryWindowOptionsList", along with other mis-typed list properties. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- authz/list.c | 2 +- block/throttle-groups.c | 5 +++-- chardev/char-socket.c | 3 ++- hw/core/machine.c | 11 +++++++---- hw/cxl/cxl-host.c | 4 +++- hw/remote/vfio-user-obj.c | 5 +++-- hw/vfio-user/pci.c | 5 +++-- target/i386/cpu.c | 11 ++++++++--- target/i386/kvm/tdx.c | 4 +++- target/s390x/cpu-system.c | 4 +++- 10 files changed, 36 insertions(+), 18 deletions(-) diff --git a/authz/list.c b/authz/list.c index 363b2ee12c98..3efbe1fa1687 100644 --- a/authz/list.c +++ b/authz/list.c @@ -128,7 +128,7 @@ qauthz_list_class_init(ObjectClass *oc, const void *dat= a) .set =3D qauthz_list_prop_set_policy, )); =20 - object_class_property_add(oc, "rules", "QAuthZListRule", + object_class_property_add_qapi(oc, "rules", &QAuthZListRuleList_type_i= nfo, qauthz_list_prop_get_rules, qauthz_list_prop_set_rules, NULL, NULL); diff --git a/block/throttle-groups.c b/block/throttle-groups.c index 37814b84fe09..987867477acc 100644 --- a/block/throttle-groups.c +++ b/block/throttle-groups.c @@ -31,6 +31,7 @@ #include "qemu/thread.h" #include "system/qtest.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-block-core.h" #include "qapi/qapi-visit-block-core.h" #include "qom/object.h" #include "qom/object_interfaces.h" @@ -993,8 +994,8 @@ static void throttle_group_obj_class_init(ObjectClass *= klass, } =20 /* ThrottleLimits */ - object_class_property_add(klass, - "limits", "ThrottleLimits", + object_class_property_add_qapi(klass, + "limits", &ThrottleLimits_type_info, throttle_group_get_limits, throttle_group_set_limits, NULL, NULL); diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 81bac42a1587..8e0e5d4343aa 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -31,6 +31,7 @@ #include "qemu/option.h" #include "qapi/error.h" #include "qapi/clone-visitor.h" +#include "qapi/qapi-type-infos-sockets.h" #include "qapi/qapi-visit-sockets.h" #include "qemu/yank.h" #include "trace.h" @@ -1568,7 +1569,7 @@ static void char_socket_class_init(ObjectClass *oc, c= onst void *data) cc->chr_listener_cleanup =3D tcp_chr_listener_cleanup; cc->chr_get_filename =3D tcp_chr_get_filename; =20 - object_class_property_add(oc, "addr", "SocketAddress", + object_class_property_add_qapi(oc, "addr", &SocketAddress_type_info, char_socket_get_addr, NULL, NULL, NULL); =20 diff --git a/hw/core/machine.c b/hw/core/machine.c index d9ac4b419a36..94737e17e66f 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -18,6 +18,7 @@ #include "hw/core/loader.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-machine.h" #include "qapi/qapi-visit-machine.h" #include "qapi/qapi-commands-machine.h" #include "qemu/madvise.h" @@ -1118,19 +1119,20 @@ static void machine_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, "dumpdtb", "Dump current dtb to a file and quit"); =20 - object_class_property_add(oc, "boot", "BootConfiguration", + object_class_property_add_qapi(oc, "boot", &BootConfiguration_type_inf= o, machine_get_boot, machine_set_boot, NULL, NULL); object_class_property_set_description(oc, "boot", "Boot configuration"); =20 - object_class_property_add(oc, "smp", "SMPConfiguration", + object_class_property_add_qapi(oc, "smp", &SMPConfiguration_type_info, machine_get_smp, machine_set_smp, NULL, NULL); object_class_property_set_description(oc, "smp", "CPU topology"); =20 - object_class_property_add(oc, "smp-cache", "SmpCachePropertiesWrapper", + object_class_property_add_qapi(oc, "smp-cache", + &SmpCachePropertiesWrapper_type_info, machine_get_smp_cache, machine_set_smp_cache, NULL, NULL); object_class_property_set_description(oc, "smp-cache", "Cache properties list for SMP machine"); @@ -1212,7 +1214,8 @@ static void machine_class_init(ObjectClass *oc, const= void *data) "Set RAM backend" "Valid value is ID of hostmem ba= sed backend"); =20 - object_class_property_add(oc, "memory", "MemorySizeConfiguration", + object_class_property_add_qapi(oc, "memory", + &MemorySizeConfiguration_type_info, machine_get_mem, machine_set_mem, NULL, NULL); object_class_property_set_description(oc, "memory", diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index e279ce5fe3ae..8997bf1785c8 100644 --- a/hw/cxl/cxl-host.c +++ b/hw/cxl/cxl-host.c @@ -13,6 +13,7 @@ #include "system/qtest.h" #include "hw/core/boards.h" =20 +#include "qapi/qapi-type-infos-machine.h" #include "qapi/qapi-visit-machine.h" #include "hw/cxl/cxl.h" #include "hw/cxl/cxl_host.h" @@ -616,7 +617,8 @@ void cxl_machine_init(Object *obj, CXLState *state) "Set on/off to enable/disable " "CXL instantiation"); =20 - object_property_add(obj, "cxl-fmw", "CXLFixedMemoryWindow", + object_property_add_qapi(obj, "cxl-fmw", + &CXLFixedMemoryWindowOptionsList_type_info, machine_get_cfmw, machine_set_cfmw, NULL, state); object_property_set_description(obj, "cxl-fmw", diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c index a0498d218faf..7e6819f670b5 100644 --- a/hw/remote/vfio-user-obj.c +++ b/hw/remote/vfio-user-obj.c @@ -47,6 +47,7 @@ #include "hw/core/boards.h" #include "hw/remote/machine.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-sockets.h" #include "qapi/qapi-visit-sockets.h" #include "qapi/qapi-events-misc.h" #include "qemu/notify.h" @@ -931,8 +932,8 @@ static void vfu_object_class_init(ObjectClass *klass, c= onst void *data) =20 k->nr_devs =3D 0; =20 - object_class_property_add(klass, "socket", "SocketAddress", NULL, - vfu_object_set_socket, NULL, NULL); + object_class_property_add_qapi(klass, "socket", &SocketAddress_type_in= fo, + NULL, vfu_object_set_socket, NULL, NULL); object_class_property_set_description(klass, "socket", "SocketAddress " "(ex: type=3Dunix,path=3D/tmp/so= ck). " diff --git a/hw/vfio-user/pci.c b/hw/vfio-user/pci.c index 983e1d4ad470..f58c4a0f3965 100644 --- a/hw/vfio-user/pci.c +++ b/hw/vfio-user/pci.c @@ -8,6 +8,7 @@ =20 #include "qemu/osdep.h" #include +#include "qapi/qapi-type-infos-sockets.h" #include "qapi-visit-sockets.h" #include "qemu/error-report.h" =20 @@ -471,8 +472,8 @@ static void vfio_user_pci_class_init(ObjectClass *klass= , const void *data) device_class_set_legacy_reset(dc, vfio_user_pci_reset); device_class_set_props(dc, vfio_user_pci_properties); =20 - object_class_property_add(klass, "socket", "SocketAddress", NULL, - vfio_user_pci_set_socket, NULL, NULL); + object_class_property_add_qapi(klass, "socket", &SocketAddress_type_in= fo, + NULL, vfio_user_pci_set_socket, NULL, NULL); object_class_property_set_description(klass, "socket", "SocketAddress (UNIX sockets onl= y)"); =20 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 5da80ade70eb..4553ef0892a1 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -35,6 +35,8 @@ #include "sev.h" #include "qapi/error.h" #include "qemu/error-report.h" +#include "qapi/qapi-type-infos-machine.h" +#include "qapi/qapi-type-infos-run-state.h" #include "qapi/qapi-visit-machine.h" #include "standard-headers/asm-x86/kvm_para.h" #include "hw/core/qdev-properties.h" @@ -10540,10 +10542,12 @@ static void x86_cpu_initfn(Object *obj) =20 x86_cpu_init_default_topo(cpu); =20 - object_property_add(obj, "feature-words", "X86CPUFeatureWordInfo", + object_property_add_qapi(obj, "feature-words", + &X86CPUFeatureWordInfoList_type_info, x86_cpu_get_feature_words, NULL, NULL, (void *)env->features); - object_property_add(obj, "filtered-features", "X86CPUFeatureWordInfo", + object_property_add_qapi(obj, "filtered-features", + &X86CPUFeatureWordInfo_type_info, x86_cpu_get_feature_words, NULL, NULL, (void *)cpu->filtered_features); =20 @@ -11007,7 +11011,8 @@ static void x86_cpu_common_class_init(ObjectClass *= oc, const void *data) NULL, NULL); =20 #if !defined(CONFIG_USER_ONLY) - object_class_property_add(oc, "crash-information", "GuestPanicInformat= ion", + object_class_property_add_qapi(oc, "crash-information", + &GuestPanicInformation_type_info, x86_cpu_get_crash_info_qom, NULL, NULL, NULL= ); #endif =20 diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c index 8294dbde3aa8..81c5ba3a1b54 100644 --- a/target/i386/kvm/tdx.c +++ b/target/i386/kvm/tdx.c @@ -14,6 +14,7 @@ #include "qemu/base64.h" #include "qemu/mmap-alloc.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-sockets.h" #include "qapi/qapi-visit-sockets.h" #include "qom/object_interfaces.h" #include "crypto/hash.h" @@ -1586,7 +1587,8 @@ static void tdx_guest_init(Object *obj) tdx_guest_get_mrownerconfig, tdx_guest_set_mrownerconfig); =20 - object_property_add(obj, "quote-generation-socket", "SocketAddress", + object_property_add_qapi(obj, "quote-generation-socket", + &SocketAddress_type_info, tdx_guest_get_qgs, tdx_guest_set_qgs, NULL, NULL); diff --git a/target/s390x/cpu-system.c b/target/s390x/cpu-system.c index d963d9e940e1..30992ef654f4 100644 --- a/target/s390x/cpu-system.c +++ b/target/s390x/cpu-system.c @@ -30,6 +30,7 @@ #include "system/reset.h" #include "qemu/timer.h" #include "trace.h" +#include "qapi/qapi-type-infos-run-state.h" #include "qapi/qapi-visit-run-state.h" #include "system/hw_accel.h" =20 @@ -137,7 +138,8 @@ void s390_cpu_system_init(Object *obj) S390CPU *cpu =3D S390_CPU(obj); =20 cs->start_powered_off =3D true; - object_property_add(obj, "crash-information", "GuestPanicInformation", + object_property_add_qapi(obj, "crash-information", + &GuestPanicInformation_type_info, s390_cpu_get_crash_info_qom, NULL, NULL, NULL); cpu->env.tod_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_tod_timer, cpu); --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493879; cv=none; d=zohomail.com; s=zohoarc; b=RhzlTAqu0ZHraclUSZK6spYveGG2JX3pNLdAkJlN3Swjd5LuiHsqusjgp9FALWHpLKQCiAeiQE6uESlS4LWKyp7uMfo/d1gYqtBtHeH6hz+ylM8w46HOzyOTENCtWNhukdwhy42ZC89Ha1M7TPECg/CeGLCjwSks/zwDAhYEE0A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493879; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6lRxJze+aC9KBEtw6tohukWxBkXDlU7+bxwjduyrfYI=; b=U+7bfi+E8DlS1Lf5CFGX1BnEpIYcn9EtpiNfPPO4nYgzfYJdNxkHG1g95M1ZgIsh88TAyKHBmEvLD9LYlBi6QNZrlTyb8qawapZzxUJf3lUyiZvoNyixCe9z5M2EmfRce5S9peLsewPo7ptwjEHMLK4xecxgQBUAtcy2qzokuf8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493879899801.0121835104852; Tue, 20 Oct 2026 03:57:59 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455372.1669248 (Exim 4.92) (envelope-from ) id 1xJ7X6-0000OR-CK; Tue, 20 Oct 2026 10:57:28 +0000 Received: by outflank-mailman (output) from mailman id 1455372.1669248; Tue, 20 Oct 2026 10:57:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7X4-0000DQ-Eb; Tue, 20 Oct 2026 10:57:26 +0000 Received: by outflank-mailman (input) for mailman id 1455372; Tue, 20 Oct 2026 10:51:20 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7RA-0000IE-Qe for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:20 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7RA-00CroT-78 for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:20 +0200 Received: from [10.42.69.4] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad7479d-2eae-0a2a0a5409dd-0a2a450480cc-28 for ; Tue, 20 Oct 2026 12:51:20 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad746f2-b57f-0a2a45040019-aa0a857cab4d-3 for ; Tue, 20 Oct 2026 12:48:19 +0200 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-90-lr-fJuH1N7yjYLe80xUfpw-1; Tue, 20 Oct 2026 10:48:12 +0000 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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 4EE0619560AD; Tue, 20 Oct 2026 10:48:08 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 57984418; Tue, 20 Oct 2026 10:48:05 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6lRxJze+aC9KBEtw6tohukWxBkXDlU7+bxwjduyrfYI=; b=Kaj4KZgTulnr38Z/8Rj4H077L0+4B/alS0DE0BoZiJinx/3/Lqs3JIft1jtX1M/TeurSho IE5p9Y02SRurJ8596UUY5r2k2KzPtbMBZ2825+4jbthoxLttsbWpFVn/jPvZmvfZo4tTHj ArugwBtWK63g7QsV+0I2HJ3y+KnmgoM= X-MC-Unique: lr-fJuH1N7yjYLe80xUfpw-1 X-Mimecast-MFC-AGG-ID: lr-fJuH1N7yjYLe80xUfpw_1792493288 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:38 +0400 Subject: [PATCH v7 21/65] x86: convert OnOffAuto properties to QAPI-aware registration MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-21-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=6572; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=b7fcdLGC+2GPa3Wjcm0RtVCaYcyqYMRaEmGki/G6FxE=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZZL3Tdedh9aQxPbswLDhqZdFL2lbqwZPM3S vvP3WGv3QuJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWQAKCRDa6OEJdZac 5ZKBEACTX7yzzr/j4WtC3RVqTKIFFKTc4t5cKUo1/m5rQXWpVE294kwdKLk1lDmvrKiKRvWP4EQ IXceFiuouMslZldIx6rvaH8qSwjZojuOdcYtS9kFgfcaJK8VG1oplTpXBTZyB+FZ5/Gs3aBsMEB t5tdVvlWE3vGgNVKnRHihfelAI1rsOCfCvhEN3PVuOpYZHZKn030ec8DuqYmBLIN4JK4NxVlOEq I4l+7RRUjTn+UQESYBdkTzD/7kKYnGyn1sh0NdEggBXI+qh4XVF67TCIe6Ki74Wu524pvWiTdln a3Zk5ywcYwrxnmqPHXrSS1L0qdbKMXK4AQgM0zIudWEbOABj6LN4FDyS8jBaTa6vmZ+6wldFjwP ORPV5b4B47gEo08l0vCoYvWt7VU6AifaMjSwi+P+U/W7XfjYPyU6XXZsoqfCb+ZS2MhN4qE70/R geuTBaQWhAXFMMHFgunyJFt2hCIcqJ0Wwerw6vSBrR6qY7x8Q+Oq5HHVjKdjCf4wdFX8VTMobJX f2lLxWx1ceEwmSbW9y3AQIIpTNSfdZx9uwaDx+qUSVHWy4bCIARc+2wjb1w2wN7BzvcSjKSi51x /DLhpKPP5A6gaSOHyxMUXd4RmFQntMM0WO6mwAlY2oD0erBahJsrhVsPBr0wSYuH41Bmo80lsiA bEw6ebgS3xjIi8A== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-MFC-PROC-ID: MNXtcdEy5pgq6MSlFeSPSR4DuMYQjPRMzR-gHU3RLAM_1792493288 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-ebf023/1792493299-C0EDEB50-176E8B82/0/0 X-purgate-type: clean X-purgate-size: 6574 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493881892158500 Convert the smm, acpi, pit, and pic OnOffAuto properties from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/i386/x86.c | 104 +++++++++++++++++++++++++-----------------------------= ---- 1 file changed, 45 insertions(+), 59 deletions(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index f8ba3244e221..63f297a10532 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -24,7 +24,7 @@ #include "qemu/error-report.h" #include "qemu/units.h" #include "qapi/error.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qapi-visit-machine.h" #include "qapi/visitor.h" #include "system/qtest.h" @@ -188,21 +188,16 @@ bool x86_machine_is_smm_enabled(const X86MachineState= *x86ms) return false; } =20 -static void x86_machine_get_smm(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int x86_machine_get_smm(Object *obj, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - OnOffAuto smm =3D x86ms->smm; - - visit_type_OnOffAuto(v, name, &smm, errp); + return x86ms->smm; } =20 -static void x86_machine_set_smm(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void x86_machine_set_smm(Object *obj, int value, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &x86ms->smm, errp); + x86ms->smm =3D value; } =20 bool x86_machine_is_acpi_enabled(const X86MachineState *x86ms) @@ -213,55 +208,40 @@ bool x86_machine_is_acpi_enabled(const X86MachineStat= e *x86ms) return true; } =20 -static void x86_machine_get_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int x86_machine_get_acpi(Object *obj, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - OnOffAuto acpi =3D x86ms->acpi; - - visit_type_OnOffAuto(v, name, &acpi, errp); + return x86ms->acpi; } =20 -static void x86_machine_set_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void x86_machine_set_acpi(Object *obj, int value, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &x86ms->acpi, errp); + x86ms->acpi =3D value; } =20 -static void x86_machine_get_pit(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int x86_machine_get_pit(Object *obj, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - OnOffAuto pit =3D x86ms->pit; - - visit_type_OnOffAuto(v, name, &pit, errp); + return x86ms->pit; } =20 -static void x86_machine_set_pit(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void x86_machine_set_pit(Object *obj, int value, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &x86ms->pit, errp); + x86ms->pit =3D value; } =20 -static void x86_machine_get_pic(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int x86_machine_get_pic(Object *obj, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - OnOffAuto pic =3D x86ms->pic; - - visit_type_OnOffAuto(v, name, &pic, errp); + return x86ms->pic; } =20 -static void x86_machine_set_pic(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void x86_machine_set_pic(Object *obj, int value, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &x86ms->pic, errp); + x86ms->pic =3D value; } =20 static char *x86_machine_get_oem_id(Object *obj, Error **errp) @@ -391,31 +371,37 @@ static void x86_machine_class_init(ObjectClass *oc, c= onst void *data) mc->kvm_type =3D x86_kvm_type; nc->raise_nmi =3D x86_nmi; =20 - object_class_property_add(oc, X86_MACHINE_SMM, "OnOffAuto", - x86_machine_get_smm, x86_machine_set_smm, - NULL, NULL); - object_class_property_set_description(oc, X86_MACHINE_SMM, - "Enable SMM"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D X86_MACHINE_SMM, + .description =3D "Enable SMM", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D x86_machine_get_smm, + .set =3D x86_machine_set_smm, + )); =20 - object_class_property_add(oc, X86_MACHINE_ACPI, "OnOffAuto", - x86_machine_get_acpi, x86_machine_set_acpi, - NULL, NULL); - object_class_property_set_description(oc, X86_MACHINE_ACPI, - "Enable ACPI"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D X86_MACHINE_ACPI, + .description =3D "Enable ACPI", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D x86_machine_get_acpi, + .set =3D x86_machine_set_acpi, + )); =20 - object_class_property_add(oc, X86_MACHINE_PIT, "OnOffAuto", - x86_machine_get_pit, - x86_machine_set_pit, - NULL, NULL); - object_class_property_set_description(oc, X86_MACHINE_PIT, - "Enable i8254 PIT"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D X86_MACHINE_PIT, + .description =3D "Enable i8254 PIT", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D x86_machine_get_pit, + .set =3D x86_machine_set_pit, + )); =20 - object_class_property_add(oc, X86_MACHINE_PIC, "OnOffAuto", - x86_machine_get_pic, - x86_machine_set_pic, - NULL, NULL); - object_class_property_set_description(oc, X86_MACHINE_PIC, - "Enable i8259 PIC"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D X86_MACHINE_PIC, + .description =3D "Enable i8259 PIC", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D x86_machine_get_pic, + .set =3D x86_machine_set_pic, + )); =20 object_class_property_add_str(oc, X86_MACHINE_OEM_ID, x86_machine_get_oem_id, --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493655; cv=none; d=zohomail.com; s=zohoarc; b=Sxchs30zqk1W+Hl/P2VL5jbxTk2YORinpaLxxWRFJjcXLijg3O0AiYjCmkymHnVNQP3eUy19y33E8u+ZaNlpaASmo4Einr9TNiBjhJoupmueXtOLynrzJFVqg/spolrQCWmZT5FFYRe9QIjS2d7VZXbhhRREylRbK5xbEFhTExA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493655; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=v686T4nh/NM1oflx6vG+8Is5DSOwiopIdEkbzupk+MM=; b=XjJaby6zT2c0oQJ4uoeMMN/9G12BYIbiTe/IBweL+xul+kfMLh+NbvbnrP+hN8wUTXgZG5LTCVbRQeiNmhdGM3MvKBiQDfPSqb94QWAJyB1i1q9jlzBbYy/IWMBpE2ARf6Ow+HNtD95RO8RwVEtZfEKc8HfFoGUDk3yIUR30DpY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17924936553980.7840685640638867; Tue, 20 Oct 2026 03:54:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7Pw-0005lx-9E; Tue, 20 Oct 2026 06:50:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7OK-0002sO-GH for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:48:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7OI-0005Vo-G8 for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:48:24 -0400 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-691-UHV1rinTOJ-bbp-udAPWMg-1; Tue, 20 Oct 2026 10:48:17 +0000 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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 7010C1955F45; Tue, 20 Oct 2026 10:48:13 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CF5DA418; Tue, 20 Oct 2026 10:48:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v686T4nh/NM1oflx6vG+8Is5DSOwiopIdEkbzupk+MM=; b=ewyQoEfYiRFfZwqzSvjxpj/Ur+YQE2DOdR5+rsl0JUcqHPuhmx2KQxEILVklNH0Hi/4qwU hwABejnh1km+F60ZUGZfVVK+oNYq1C0lKNM4Hv8jShWOR1wvMDzOcN0sxKTnqONy3y3tn5 4jMXFzskIR3SVT1t3Ld2NFlNuIQDgpI= X-MC-Unique: UHV1rinTOJ-bbp-udAPWMg-1 X-Mimecast-MFC-AGG-ID: UHV1rinTOJ-bbp-udAPWMg_1792493293 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:39 +0400 Subject: [PATCH v7 22/65] microvm: convert OnOffAuto properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-22-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=5556; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=Me58f9fSeK/487LTdlmbScljyoJV9DEvmYyKKbHzwr8=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZZ3f4zIw9e9fAooGIYWl6vTVthCVQrX3AkP XVN/peDhQSJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWQAKCRDa6OEJdZac 5fnHD/9CAoB6HxmaaNMY3yvic/Ns1VSzlrGDD64+/ws7znbkXJRUTZsOARrXI1NAeSpDHhCFWE9 aZd/g/x4iqjEreGL3YZPfURomCbgx6ZL2TF6AlB55TgCTVe2XtDQj/SGRMvYlYCtnJe3WSvBZBn bny6tC2hWorruBkFGA9yBI4JdjJxyjim1tl/WHPghkn15F+IpLYBgDkEgq9qbfhj/fESSetVQsd VQZXlEfUCCztjvdJMJ6jQ1SXe0VGxUP7DZ7a9Vf02O93B4Opigh9XHf6vMHYabAMFIlN1mDwkN5 2vBVXdmcRf5b9i2TQmJlbvINqUpEpmL6PuTWsNEwkdlrdajGL23/Ah/EqGP5GubDFp5GKvUuv09 jziOpT7fKZL5DyiwQH4hIklap6S/uF2suc4dqlOXxwBfx22kMvSzUwB2XGLS5gczCvmza/9I8XI OcA43WSJrdXDy6E+kDt4DBuYIxX5W67D4waFpayENO54YxTxUAv3KMq6X6TXxElumjQ02BrlzCD DuOMlSu50VP3qJ9Y/LWPvABZIDvnuDAthAqtbNK8n2L9dYMrSLuXHBP4okOZgG2EU0Ao9AR5j5p fq9wzqn7yXllRZPlm4J9ZzPhMQtbmpGNzSaX1iz4/BgOytGx+cqURRn+3yGlIzcqzlrBQvF3sTb tU860q8EJkGq3cQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493655772158500 Convert the rtc, pcie, and ioapic2 OnOffAuto properties from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/i386/microvm.c | 80 +++++++++++++++++++++++----------------------------= ---- 1 file changed, 34 insertions(+), 46 deletions(-) diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index a49de3374979..1d1ca172bfbd 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -21,7 +21,7 @@ #include "qemu/units.h" #include "qapi/error.h" #include "qapi/visitor.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "system/system.h" #include "system/cpus.h" #include "system/numa.h" @@ -519,55 +519,40 @@ static void microvm_machine_reset(MachineState *machi= ne, ResetType type) } } =20 -static void microvm_machine_get_rtc(Object *obj, Visitor *v, const char *n= ame, - void *opaque, Error **errp) +static int microvm_machine_get_rtc(Object *obj, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - OnOffAuto rtc =3D mms->rtc; - - visit_type_OnOffAuto(v, name, &rtc, errp); + return mms->rtc; } =20 -static void microvm_machine_set_rtc(Object *obj, Visitor *v, const char *n= ame, - void *opaque, Error **errp) +static void microvm_machine_set_rtc(Object *obj, int value, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &mms->rtc, errp); + mms->rtc =3D value; } =20 -static void microvm_machine_get_pcie(Object *obj, Visitor *v, const char *= name, - void *opaque, Error **errp) +static int microvm_machine_get_pcie(Object *obj, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - OnOffAuto pcie =3D mms->pcie; - - visit_type_OnOffAuto(v, name, &pcie, errp); + return mms->pcie; } =20 -static void microvm_machine_set_pcie(Object *obj, Visitor *v, const char *= name, - void *opaque, Error **errp) +static void microvm_machine_set_pcie(Object *obj, int value, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &mms->pcie, errp); + mms->pcie =3D value; } =20 -static void microvm_machine_get_ioapic2(Object *obj, Visitor *v, const cha= r *name, - void *opaque, Error **errp) +static int microvm_machine_get_ioapic2(Object *obj, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - OnOffAuto ioapic2 =3D mms->ioapic2; - - visit_type_OnOffAuto(v, name, &ioapic2, errp); + return mms->ioapic2; } =20 -static void microvm_machine_set_ioapic2(Object *obj, Visitor *v, const cha= r *name, - void *opaque, Error **errp) +static void microvm_machine_set_ioapic2(Object *obj, int value, Error **er= rp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &mms->ioapic2, errp); + mms->ioapic2 =3D value; } =20 static bool microvm_machine_get_isa_serial(Object *obj, Error **errp) @@ -673,26 +658,29 @@ static void microvm_class_init(ObjectClass *oc, const= void *data) hc->unplug_request =3D microvm_device_unplug_request_cb; hc->unplug =3D microvm_device_unplug_cb; =20 - object_class_property_add(oc, MICROVM_MACHINE_RTC, "OnOffAuto", - microvm_machine_get_rtc, - microvm_machine_set_rtc, - NULL, NULL); - object_class_property_set_description(oc, MICROVM_MACHINE_RTC, - "Enable MC146818 RTC"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D MICROVM_MACHINE_RTC, + .description =3D "Enable MC146818 RTC", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D microvm_machine_get_rtc, + .set =3D microvm_machine_set_rtc, + )); =20 - object_class_property_add(oc, MICROVM_MACHINE_PCIE, "OnOffAuto", - microvm_machine_get_pcie, - microvm_machine_set_pcie, - NULL, NULL); - object_class_property_set_description(oc, MICROVM_MACHINE_PCIE, - "Enable PCIe"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D MICROVM_MACHINE_PCIE, + .description =3D "Enable PCIe", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D microvm_machine_get_pcie, + .set =3D microvm_machine_set_pcie, + )); =20 - object_class_property_add(oc, MICROVM_MACHINE_IOAPIC2, "OnOffAuto", - microvm_machine_get_ioapic2, - microvm_machine_set_ioapic2, - NULL, NULL); - object_class_property_set_description(oc, MICROVM_MACHINE_IOAPIC2, - "Enable second IO-APIC"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D MICROVM_MACHINE_IOAPIC2, + .description =3D "Enable second IO-APIC", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D microvm_machine_get_ioapic2, + .set =3D microvm_machine_set_ioapic2, + )); =20 object_class_property_add_bool(oc, MICROVM_MACHINE_ISA_SERIAL, microvm_machine_get_isa_serial, --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493649; cv=none; d=zohomail.com; s=zohoarc; b=i82elUqvG77IxnJTOJRzMt7c7gqDlWNmNWqX4fe0ysHSi6yc/np9/9AxULRizz0yKZpcunn31K/5l6PkuXrpxDXoJpya/unLyGpX+dt0kuRTLtYRo9x3+Av7IZ/hcxQYqRc8WlZARrUteHNPA/zS/V9X9BxxiAnHddtuhMMAFHI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493649; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eMqswUiLM19ojZ+xv5E964KFYfmL1usSS/p/S7HX9Dw=; b=AKYbm/44MadE5MjgDtRkOkkKwO1jVEtALfw/0Ar1D2iZezdOfCSHXGZ3AnwyNM457fbymkUPkcdG5fwZEEGf+XkVW21Xd3KF6HzHzlDpUYw1ftOVErmkXt6tdDMX8mxjbU0XuGBmAKP53lFkldxKXCVEaV+u4UpnBBU+itSuNrw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792493649430212.8733956542443; Tue, 20 Oct 2026 03:54:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7QC-0006lt-5F; Tue, 20 Oct 2026 06:50:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7OQ-0002wF-Vl for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:48:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7OP-0005XP-0P for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:48:30 -0400 Received: from mx-prod-mc-03.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-510-cVbzbvoGOKiXjaCIGIacxQ-1; Tue, 20 Oct 2026 10:48:22 +0000 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F35FD1956050; Tue, 20 Oct 2026 10:48:17 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7FEA65BC; Tue, 20 Oct 2026 10:48:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eMqswUiLM19ojZ+xv5E964KFYfmL1usSS/p/S7HX9Dw=; b=AqW9jVyEtnSWREvjB48VPTz3N+KfiJr3PIomHY7YEH+OlN8/JyC5ju+ASc5UJ6QicoNMx1 /fVmGSeRUVknGOLRI7qR+tKPk4CXc+nkNuaGutPDkptIibIfBWM0kNZ+rjaahXRbyr0PXI vvDSWOnRvyZ3x3kToA0dDjWEL9tuceY= X-MC-Unique: cVbzbvoGOKiXjaCIGIacxQ-1 X-Mimecast-MFC-AGG-ID: cVbzbvoGOKiXjaCIGIacxQ_1792493298 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:40 +0400 Subject: [PATCH v7 23/65] pc: convert OnOffAuto vmport property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-23-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2552; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=rT4IlVA3K6hhZkzIFOmf7AHwvtTZzfc1DRg/HWfKdY4=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZZM5/OPYpgkFOCrz7lC/8MWagOdQlNe9HMu Ryp6VHtccaJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWQAKCRDa6OEJdZac 5SEYD/9QUk3mMyoHypSwCfk0l9cp7LpdZdLAE2EvzjA5uGZIIAqBUxJDWAuzNGzj6S+fvUJlWdC EAhsGdZYLWEH7ASWHHvy7QL+I4sYO8Xg73A6bzHJwEOXw/X9WMYP92+xT4V4aCVSuSlgPw0vTW0 iDGOxiKxLpni8ZM7f9KyKZ7A07apImgWr/PvLmtbAQVMyGBFVMAlRVQNHiAVAYdPfO4SqPGDtEL FSBHcAGWwReG+sJQLCw41zKiUg19IRx+HFFvZizprongoFMpDaugaNynZ5796k7gt/kq32gooTW K1HtncPs4zo3o0RQhly74rTNpbStacdnJYfkbYDra1gDQX4eyKiFqN0SjV67VE/VvdnJQ8LJ+8E Io6ab5QTARFKwxykGzqjoPPlbjW5eZ6GbWMq2hOGAKs7EJU3OZb880jYHppuGtTKMeUpX/uuFJ5 eN4Qb9D4OSHbiB0FCPwmlld/4ccrph+UXo3QxiUbsq3bq2b/jfEoZkiNrexjwcvm0VgnTwhUzxZ 8vLXrwQhyrorPwXLyf2OJODHc3WMrHl2l0U2HAnthI2rPwYhMyYDc0jK0pwPULBUOsnDcOp0HmV s84v32DlNvvS1/ARhP+gJq6EJ073Rob14KhIt2ElZfOtp3GUn5BAYDx7P4sYVuaJp2x6H2r0frC taKgfMicnsq1l+w== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493651668158500 Convert the vmport OnOffAuto property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/i386/pc.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 2d8c87b0e34c..12de020adfbf 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -46,6 +46,7 @@ #include "kvm/kvm_i386.h" #include "kvm/tdx.h" #include "hw/xen/xen.h" +#include "qapi/qapi-type-infos-common.h" #include "qobject/qlist.h" #include "qemu/error-report.h" #include "hw/acpi/acpi.h" @@ -1417,21 +1418,16 @@ static const HotplugHandler *pc_get_hotplug_handler= (MachineState *machine, return NULL; } =20 -static void pc_machine_get_vmport(Object *obj, Visitor *v, const char *nam= e, - void *opaque, Error **errp) +static int pc_machine_get_vmport(Object *obj, Error **errp) { PCMachineState *pcms =3D PC_MACHINE(obj); - OnOffAuto vmport =3D pcms->vmport; - - visit_type_OnOffAuto(v, name, &vmport, errp); + return pcms->vmport; } =20 -static void pc_machine_set_vmport(Object *obj, Visitor *v, const char *nam= e, - void *opaque, Error **errp) +static void pc_machine_set_vmport(Object *obj, int value, Error **errp) { PCMachineState *pcms =3D PC_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &pcms->vmport, errp); + pcms->vmport =3D value; } =20 static bool pc_machine_get_fd_bootchk(Object *obj, Error **errp) @@ -1728,11 +1724,13 @@ static void pc_machine_class_init(ObjectClass *oc, = const void *data) object_class_property_set_description(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "Maximum ram below the 4G boundary (32bit boundary)"); =20 - object_class_property_add(oc, PC_MACHINE_VMPORT, "OnOffAuto", - pc_machine_get_vmport, pc_machine_set_vmport, - NULL, NULL); - object_class_property_set_description(oc, PC_MACHINE_VMPORT, - "Enable vmport (pc & q35)"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D PC_MACHINE_VMPORT, + .description =3D "Enable vmport (pc & q35)", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D pc_machine_get_vmport, + .set =3D pc_machine_set_vmport, + )); =20 object_class_property_add_bool(oc, PC_MACHINE_SMBUS, pc_machine_get_smbus, pc_machine_set_smbus); --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493798; cv=none; d=zohomail.com; s=zohoarc; b=Dyb8n3BCpVlqWAoF/XiIQYs7IXOFyoBQbY/mH24Zwn9mdmOzZJRzXah+odfRx9lnMD+sPr/jJyoS3A5BscAgYR4bQERuGstCh7JKxRQqtTc32tsbezpVLfEoXxmKmcDOeo2J2A3t90Wk28wFaHfgmbxV1rtNyK3RdG+j6gudgtk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493798; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=oguRv2squZzE4kLuZbCGfVuSLth7nwetzOZz6ya/vQM=; b=TjfZaPyNqznonCcqD3wEQu5BIVgN73bKIj/5Dt5oAnVzET8m7llUvWAGV7SDXyikygdDs548Pu8cdZtraCIWfDO+RIOehBqr2DHqaUy17F9ZacXOEqochvgpMfMzTo659Qj8xt+NRaQeT517d299+FeW1T+HeBWJ4oJIZ2JDdeM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493798529264.8506708510589; Tue, 20 Oct 2026 03:56:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455306.1668963 (Exim 4.92) (envelope-from ) id 1xJ7Vz-0003bA-EX; Tue, 20 Oct 2026 10:56:19 +0000 Received: by outflank-mailman (output) from mailman id 1455306.1668963; Tue, 20 Oct 2026 10:56:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Vy-0003VG-JM; Tue, 20 Oct 2026 10:56:18 +0000 Received: by outflank-mailman (input) for mailman id 1455306; Tue, 20 Oct 2026 10:50:39 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7QV-0008RM-92 for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:50:39 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7QU-004cyI-Lz for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:50:38 +0200 Received: from [10.42.69.11] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74765-8faa-0a2a0a5109dd-0a2a450b8d4a-34 for ; Tue, 20 Oct 2026 12:50:38 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad74704-b7e8-0a2a450b0019-aa0a817ced0b-3 for ; Tue, 20 Oct 2026 12:48:38 +0200 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-29-uBDd0-1GMx-Pw1Kl9QVEug-1; Tue, 20 Oct 2026 06:48:27 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 0BFD51955DCB; Tue, 20 Oct 2026 10:48:23 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 811011800257; Tue, 20 Oct 2026 10:48:20 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oguRv2squZzE4kLuZbCGfVuSLth7nwetzOZz6ya/vQM=; b=ZE+oPup0eNqt85KXkWK0XNRSdRWPZDTjwjJ0B2dNVzEo9yU68sjnvJRKWu38HF7Go5Xi3I WDkodvsp/Lup8IRhRQAxaaY4RoUoCbCIapzlNSX5HMXfERPg7l3F4BAN4gHttXAg5aojFC nd7psqf3OEzphq7jjk9pO1cKsj1R3CY= X-MC-Unique: uBDd0-1GMx-Pw1Kl9QVEug-1 X-Mimecast-MFC-AGG-ID: uBDd0-1GMx-Pw1Kl9QVEug_1792493303 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:41 +0400 Subject: [PATCH v7 24/65] arm/virt: convert OnOffAuto acpi property to QAPI-aware registration MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-24-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2443; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=WJV9rbWGfyoHPVy5l0gOvkb5+YjNc4EgQxym05N/4z0=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZZD2w11mplFmU1C3uOjRIrgiEXmssGFGVqF U+VXCQyIhmJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWQAKCRDa6OEJdZac 5VV9D/4yHO7gBqYrWIgKINlgaqxweu9J3zPt0Q96BUDUTYP82Ji46aRrDnTKFU/lmiVpB0fAB4e XJamdIf6GysZPW/ts5RuPqmpRgUOHkFyl3w6WSrVcFZiUziA7H7//SozvNb0ksb52BEBDgRfu59 76EmyWmsMmdXm+7NFzf2Yr+0bybSNkLa/MDFeCosMy7O2q3mPK9t3viHrwkYiKodq7f49cF6ULL oQdp5XFWl+UruNu6YzMVat1OiEu+899ewJ0eacPhEublBVLtFTlEyPN76iInq272v6ozbm0j+v4 dODiO9YWj3H5tgsJT8uGwdCphesONwj0ehWE8RIOlcUgPq4CG6I5T2hqeBC816s74u8j3SXm1gs UhtJlBc/VY3cXU1/oQ2tjN4SSA6n7oGSwK+LRulGbjdZC6TUoOksZ1YjYPPMnyAOQ5TRVyAAgpc O/JcWDzz2hNjVcm8QKZsT7maPZt2pSxPvzOMz6stvRCSGt8xEj/e2l9kUWyvKNOEIFsGMjCJ4NB pytKX14Dode4YAKX1vRHPXwn7/ugDk+4mt37W8v1DKB3P4UJu9L8YinWg2FGRK8OTzDd+mMm7aT E0xuadOhVSJzsCQlpI4JB5RAmJ9WvMZdP4Mo65KTRR9rVKvDeEboNO+ggGjsDNOsWBeK+S/od4x iQ07BZ5MWxFvlRw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-MFC-PROC-ID: FAl71IotVJWAVOSEjfipUjAnMp35J6PKHyeAAHri7vM_1792493303 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-42698a/1792493318-1B2DC9EA-14E3AB90/0/0 X-purgate-type: clean X-purgate-size: 2445 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493800363158501 Convert the acpi OnOffAuto property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/arm/virt.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 0d56197dacee..0da10b799cfb 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -73,7 +73,7 @@ #include "whpx_arm.h" #include "hw/firmware/smbios.h" #include "qapi/visitor.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "qobject/qlist.h" #include "standard-headers/linux/input.h" #include "hw/arm/smmuv3.h" @@ -3565,21 +3565,16 @@ bool virt_is_acpi_enabled(const VirtMachineState *v= ms) return true; } =20 -static void virt_get_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int virt_get_acpi(Object *obj, Error **errp) { VirtMachineState *vms =3D VIRT_MACHINE(obj); - OnOffAuto acpi =3D vms->acpi; - - visit_type_OnOffAuto(v, name, &acpi, errp); + return vms->acpi; } =20 -static void virt_set_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void virt_set_acpi(Object *obj, int value, Error **errp) { VirtMachineState *vms =3D VIRT_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &vms->acpi, errp); + vms->acpi =3D value; } =20 static bool virt_get_ras(Object *obj, Error **errp) @@ -4207,11 +4202,13 @@ static void virt_machine_class_init(ObjectClass *oc= , const void *data) mc->default_ram_id =3D "mach-virt.ram"; mc->default_nic =3D "virtio-net-pci"; =20 - object_class_property_add(oc, "acpi", "OnOffAuto", - virt_get_acpi, virt_set_acpi, - NULL, NULL); - object_class_property_set_description(oc, "acpi", - "Enable ACPI"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "acpi", + .description =3D "Enable ACPI", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D virt_get_acpi, + .set =3D virt_set_acpi, + )); object_class_property_add_bool(oc, "secure", virt_get_secure, virt_set_secure); object_class_property_set_description(oc, "secure", --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792494707; cv=none; d=zohomail.com; s=zohoarc; b=miPYjquaNdj2w+6GEQQmUqvoWfcYYTQrqE6gkCVO19nwv3W5R51m2mHs6+hTs3u4h8z6GtQvVq16/jXp9O50t9q/FyhHfEkcC2Htdtd7x7t28Bsslqy34nh6T+Wi01VWO/ghx+2m6+VHyKLDfXRtkO2DcyoJ8EhxSN15RZTX2rc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792494707; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jKM88emaTtDD8hNN+EMLi80BeL2n1f7ZRXAzTgl+JrI=; b=EwvS08pblPy86N7HRQsTGoQ88kmoEA5F9T/Y4Dc3kmFAkXn6mhp7QT4sEfRahH2hT1QfJdb8nbITkVn7ZnhGOMLmvzMV2ixwZn5W8WjuJm+3BOFJtzXs4YI+z/SAYcLlT/scmyaO4s2pmZCcykS7s96rTUH1edk/sjCgLv7aRCw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792494707660716.8730794954481; Tue, 20 Oct 2026 04:11:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7Q6-0006UF-Pr; Tue, 20 Oct 2026 06:50:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Od-0003BZ-P6 for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:48:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Oa-0005Z8-Uj for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:48:43 -0400 Received: from mx-prod-mc-03.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-562-EQKPMv8wMpawhrKwHK50cA-1; Tue, 20 Oct 2026 10:48:33 +0000 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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 57756195604D; Tue, 20 Oct 2026 10:48:28 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1F5DC1956095; Tue, 20 Oct 2026 10:48:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jKM88emaTtDD8hNN+EMLi80BeL2n1f7ZRXAzTgl+JrI=; b=ZOPmkaMgvo6uFwaFECQZxpwUn+x+i00u2b3aVaVBdzNMMoHgBQolMSDwg0hpu+d3pvwriD OxhPuFamkx7PAOJNloGgJbfbFRzeU/MUd/5t2AbAP80SF+5TPvGw8VXnCy7Wwmrv+vRqQm EuEILLQDQXLtzOp4VtYu9QCF78eThIg= X-MC-Unique: EQKPMv8wMpawhrKwHK50cA-1 X-Mimecast-MFC-AGG-ID: EQKPMv8wMpawhrKwHK50cA_1792493308 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:42 +0400 Subject: [PATCH v7 25/65] riscv/virt: convert OnOffAuto properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-25-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=3989; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=HRo91rA2atLaPMjCcy77uoSJBv27Cj9pfW470LYlxds=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZZn3Inx2fUnnD+uy0noJtEswlqC284ZfNax CJpcQgVj++JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWQAKCRDa6OEJdZac 5YyTD/sHV9okzYNJc6MkoRYx/8TowxhPLBhPsWuj+Z23OSrNnkhKkHnDExMsk5HmnvTa0ulRg4b LYQKIHIadpWN/XU7ugrsNMWvt2vE1M6WMh1J6VHifxNwfktdLDiRJbe0FDZnfd37CWdaQUUl2J8 avTewGpI6EMGes/ro4NKDvyC4R0266xA2ma3nkF4giv5r4D9u10PkgS0JY1La1JPmg8jSCrBWSG h5SRiJTRRB838tgMyKtlieM2qvFkwYs6vxZta8mwMLWRCJ2qlrDou4X+w0mQmWe22ZDxnnKShlS 862qoPEe5fd+gL0bJwae3XjbgOWdIFsVxVAp8CGayp+xYpvHin9d0m0LqMai3fWlbmhL7Cfg1s1 rydrYSQTeUYAMErEqGvu2WCnqBtBZtQFmwr15x6v5/bqPorKv4DQHwiVwdKURNyFdW+Nx3KFAfq AscOzqRwse2gfkIaC1/3VfU4l2KUfFX5H7n6u7Qmir7AEKGBJmV21sGsvEGiLanNfn6G5Mhk3t3 rOWtlDBNgJ7TPddfv1DlKc4E1knF6kuaAYaQ0h/fdvNK4/n+iTgK2yAcTj5LqixHVyRzDDDdAX3 AjXEd1EQ7S0ak0D07LG6vcNpzqsFF0hV1CHcYiqXo8BniMFmPKjS8rc/4CkqczHYdJv0WAwtWHl AkxiOqO7ZuvqssQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792494708752158500 Convert the acpi and iommu-sys OnOffAuto properties from manual visitor-based callbacks to property_add_qapi_enum(). Acked-by: Alistair Francis Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/riscv/virt.c | 52 +++++++++++++++++++++++----------------------------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index d4b501802f60..c33a279f1e5c 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -57,7 +57,7 @@ #include "hw/pci-host/gpex.h" #include "hw/display/ramfb.h" #include "hw/acpi/aml-build.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "hw/virtio/virtio-iommu.h" #include "hw/uefi/var-service-api.h" =20 @@ -1049,21 +1049,16 @@ bool virt_is_iommu_sys_enabled(RISCVVirtState *s) return s->iommu_sys =3D=3D ON_OFF_AUTO_ON; } =20 -static void virt_get_iommu_sys(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int virt_get_iommu_sys(Object *obj, Error **errp) { RISCVVirtState *s =3D RISCV_VIRT_MACHINE(obj); - OnOffAuto iommu_sys =3D s->iommu_sys; - - visit_type_OnOffAuto(v, name, &iommu_sys, errp); + return s->iommu_sys; } =20 -static void virt_set_iommu_sys(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void virt_set_iommu_sys(Object *obj, int value, Error **errp) { RISCVVirtState *s =3D RISCV_VIRT_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &s->iommu_sys, errp); + s->iommu_sys =3D value; } =20 bool virt_is_acpi_enabled(RISCVVirtState *s) @@ -1071,21 +1066,16 @@ bool virt_is_acpi_enabled(RISCVVirtState *s) return s->acpi !=3D ON_OFF_AUTO_OFF; } =20 -static void virt_get_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int virt_get_acpi(Object *obj, Error **errp) { RISCVVirtState *s =3D RISCV_VIRT_MACHINE(obj); - OnOffAuto acpi =3D s->acpi; - - visit_type_OnOffAuto(v, name, &acpi, errp); + return s->acpi; } =20 -static void virt_set_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void virt_set_acpi(Object *obj, int value, Error **errp) { RISCVVirtState *s =3D RISCV_VIRT_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &s->acpi, errp); + s->acpi =3D value; } =20 static const HotplugHandler * @@ -1183,17 +1173,21 @@ static void virt_machine_class_init(ObjectClass *oc= , const void *data) object_class_property_set_description(oc, "aia-guests", str); } =20 - object_class_property_add(oc, "acpi", "OnOffAuto", - virt_get_acpi, virt_set_acpi, - NULL, NULL); - object_class_property_set_description(oc, "acpi", - "Enable ACPI"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "acpi", + .description =3D "Enable ACPI", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D virt_get_acpi, + .set =3D virt_set_acpi, + )); =20 - object_class_property_add(oc, "iommu-sys", "OnOffAuto", - virt_get_iommu_sys, virt_set_iommu_sys, - NULL, NULL); - object_class_property_set_description(oc, "iommu-sys", - "Enable IOMMU platform device"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "iommu-sys", + .description =3D "Enable IOMMU platform device", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D virt_get_iommu_sys, + .set =3D virt_set_iommu_sys, + )); } =20 static const TypeInfo virt_machine_typeinfo =3D { --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493817; cv=none; d=zohomail.com; s=zohoarc; b=EVpTfU76pzsRWaffDBYJgNu+oVk+3bcZWPKGvgS7zmYvsbRgJzkzqJCc4v/MRhMtHxXPT3atExuSjGm5o40JPARo+ZWorhOV48XjZENBjskr3bIXktrlMt84IO7SYEEizm0blL1Mz2m15c27S+OksaYDffbWBvpClxctXUlAKeU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493817; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PV9kuqJKGQPXQgRGsKGHU0tbZKUNtph+KWyMZp45370=; b=eWR29QkLjkUHAIq0oP0eXJeO4pPSyyNHT6RdO9TEH77X/XzkbxxYtQACtjJiRVqlbY2vpgwBdscqx4Z9Q0ffVzhBk02AurK/6WENfeeK0qIaqAMW5gUB48Y1vSf85WwaCP+epmhd+sb046h7tlOlAXW0llrUTJxnF/i8eCiLiOk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493817268166.40534938168548; Tue, 20 Oct 2026 03:56:57 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455323.1669034 (Exim 4.92) (envelope-from ) id 1xJ7WD-0006GD-Du; Tue, 20 Oct 2026 10:56:33 +0000 Received: by outflank-mailman (output) from mailman id 1455323.1669034; Tue, 20 Oct 2026 10:56:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7WC-00069U-8C; Tue, 20 Oct 2026 10:56:32 +0000 Received: by outflank-mailman (input) for mailman id 1455323; Tue, 20 Oct 2026 10:50:50 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Qg-0008Vg-BF for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:50:50 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7Qf-00Crdk-O5 for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:50:49 +0200 Received: from [10.42.69.1] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74788-2eae-0a2a0a5409dd-0a2a4501d57a-6 for ; Tue, 20 Oct 2026 12:50:49 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad74710-5984-0a2a45010019-aa0a857cbf29-3 for ; Tue, 20 Oct 2026 12:48:49 +0200 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-656-evkX-KHbNye8aHdQO4NYlg-1; Tue, 20 Oct 2026 10:48:38 +0000 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 BF9F3180056E; Tue, 20 Oct 2026 10:48:33 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D3CE130000E7; Tue, 20 Oct 2026 10:48:30 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PV9kuqJKGQPXQgRGsKGHU0tbZKUNtph+KWyMZp45370=; b=TpWlFmnBdRUuF9+RlCvOXz1huOM59mJdNdVCwlhpbJrHDIRV3Du9T5FMMMoMUxJ9xT4xgM ib41fCWIdNVRCxhqQk/AXra30L/osptgj5eYtsqv9DTacrdUcswPNAcdljjAqqApT6O4cb 3J7IhiKNxQd3KewFYF4gA1674FjWe9A= X-MC-Unique: evkX-KHbNye8aHdQO4NYlg-1 X-Mimecast-MFC-AGG-ID: evkX-KHbNye8aHdQO4NYlg_1792493313 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:43 +0400 Subject: [PATCH v7 26/65] loongarch/virt: convert OnOffAuto properties to QAPI-aware registration MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-26-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=6018; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=mcn2JeHI5hIu+VBT7QhXgV3egUYPPh04IMlXvF5e4Ec=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZZn4jMd/2ebsZ0FoPPbj1jDn2hGRETnXjT2 a9TRgsJMRyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWQAKCRDa6OEJdZac 5VcbD/0XQPP+Hq6G02Te1ATdBSDCe1WOePn+q3hsXMEjoOzOBoMnryWDu8kNBch2qC8q592TwYn hRkWhx3p8YWF9kYFeQ23u32TqttVt/lCxq8pWndKI6GgSC5v8616dnw2YpSgsb3fosKThWBUUUk fCN2F7JenKbU2ahFlCWtu7UAB0XSoTl4KkhrepX20amiSBjQnvZQvYi/1xg7w2m5ZMSYMSmH/LC l23OSw7QCemnhrF++uLTOObyXcs8T5yYj67uh0BF19kJB3ZzZ0jaMA3li1HytdrFcV7GwnFvH0D LXX8Rrv5mvff1zR2spKxkS9RctUmQZdKlOZ+GhgQnZX+wyQIgSQesWnPD8JmIU9lJGXw7voOqGQ cnwmMtO4dkVkqgg8e8dPEOenMG0LMpxPwEXmbP1l4zz9T5pL6YEFBPe3sLJ/Q4vz+eChkhPJpnT kbYtHnZSNae7agOjfkGpzv0xQZnugriVrT0XMl8A8/QQEQDDkngQF3/tF2Wjp1UBd9uE9NLqTVA 5kCV+wPxw4rBcTH/PtAQiXN2Y/UxDOIz8vsWuaQySEqGQynllWHdiPAk4QmiAgkoxO/0r0j4yWG zVIXphd2t3fdmg99IfAn5usbT83aXvGpab7PMeWgsXcGpLJh205ful7Mp2GUVpQTa6A92/oPOaA YI89h+wirCbvd3w== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-MFC-PROC-ID: mAAx1bP5p02YpV9wJ8dBplXAqWl-DFTtV_vHElF0KnY_1792493313 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-d62444/1792493329-C4558757-B1EA9200/0/0 X-purgate-type: clean X-purgate-size: 6020 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493818675158500 Convert the acpi, v-eiointc, and dmsi OnOffAuto properties from manual visitor-based callbacks to property_add_qapi_enum(). Reviewed-by: Bibo Mao Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/loongarch/virt.c | 85 +++++++++++++++++++++++++------------------------= ---- 1 file changed, 40 insertions(+), 45 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 9c5371af9dee..db8ea76f117c 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -36,7 +36,8 @@ #include "target/loongarch/cpu.h" #include "target/loongarch/cpu-mmu.h" #include "hw/firmware/smbios.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" +#include "qapi/visitor.h" #include "hw/acpi/generic_event_device.h" #include "hw/mem/nvdimm.h" #include "hw/core/platform-bus.h" @@ -51,26 +52,21 @@ #include "qemu/log.h" #include "kvm/kvm_loongarch.h" =20 -static void virt_get_dmsi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int virt_get_dmsi(Object *obj, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(obj); - OnOffAuto dmsi =3D lvms->dmsi; - - visit_type_OnOffAuto(v, name, &dmsi, errp); - + return lvms->dmsi; } -static void virt_set_dmsi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) + +static void virt_set_dmsi(Object *obj, int value, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(obj); + lvms->dmsi =3D value; =20 - visit_type_OnOffAuto(v, name, &lvms->dmsi, errp); - - if (lvms->dmsi =3D=3D ON_OFF_AUTO_OFF) { + if (value =3D=3D ON_OFF_AUTO_OFF) { lvms->misc_feature &=3D ~BIT(IOCSRF_DMSI); lvms->misc_status &=3D ~BIT_ULL(IOCSRM_DMSI_EN); - } else if (lvms->dmsi =3D=3D ON_OFF_AUTO_ON) { + } else if (value =3D=3D ON_OFF_AUTO_ON) { lvms->misc_feature =3D BIT(IOCSRF_DMSI); } } @@ -78,21 +74,16 @@ static void virt_set_dmsi(Object *obj, Visitor *v, cons= t char *name, #define DEFAULT_HIGH_PCIE_MMIO_SIZE_GB 64 #define DEFAULT_HIGH_PCIE_MMIO_SIZE (DEFAULT_HIGH_PCIE_MMIO_SIZE_GB * GiB) =20 -static void virt_get_veiointc(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int virt_get_veiointc(Object *obj, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(obj); - OnOffAuto veiointc =3D lvms->veiointc; - - visit_type_OnOffAuto(v, name, &veiointc, errp); + return lvms->veiointc; } =20 -static void virt_set_veiointc(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void virt_set_veiointc(Object *obj, int value, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &lvms->veiointc, errp); + lvms->veiointc =3D value; } =20 static bool virt_get_highmem_mmio(Object *obj, Error **errp) @@ -1025,21 +1016,16 @@ static void virt_init(MachineState *machine) loongarch_load_kernel(machine, &lvms->bootinfo, phys_addr_mask); } =20 -static void virt_get_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int virt_get_acpi(Object *obj, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(obj); - OnOffAuto acpi =3D lvms->acpi; - - visit_type_OnOffAuto(v, name, &acpi, errp); + return lvms->acpi; } =20 -static void virt_set_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void virt_set_acpi(Object *obj, int value, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &lvms->acpi, errp); + lvms->acpi =3D value; } =20 static char *virt_get_oem_id(Object *obj, Error **errp) @@ -1483,20 +1469,29 @@ static void virt_class_init(ObjectClass *oc, const = void *data) hc->unplug_request =3D virt_device_unplug_request; hc->unplug =3D virt_device_unplug; =20 - object_class_property_add(oc, "acpi", "OnOffAuto", - virt_get_acpi, virt_set_acpi, - NULL, NULL); - object_class_property_set_description(oc, "acpi", - "Enable ACPI"); - object_class_property_add(oc, "v-eiointc", "OnOffAuto", - virt_get_veiointc, virt_set_veiointc, - NULL, NULL); - object_class_property_set_description(oc, "v-eiointc", - "Enable Virt Extend I/O Interrupt Controller."= ); - object_class_property_add(oc, "dmsi", "OnOffAuto", - virt_get_dmsi, virt_set_dmsi, NULL, NULL); - object_class_property_set_description(oc, "dmsi", - "Enable direct Message-interrupts Controller."= ); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "acpi", + .description =3D "Enable ACPI", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D virt_get_acpi, + .set =3D virt_set_acpi, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "v-eiointc", + .description =3D "Enable Virt Extend I/O Interrupt Controller.", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D virt_get_veiointc, + .set =3D virt_set_veiointc, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "dmsi", + .description =3D "Enable direct Message-interrupts Controller.", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D virt_get_dmsi, + .set =3D virt_set_dmsi, + )); machine_class_allow_dynamic_sysbus_dev(mc, TYPE_RAMFB_DEVICE); machine_class_allow_dynamic_sysbus_dev(mc, TYPE_UEFI_VARS_SYSBUS); #ifdef CONFIG_TPM --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493821; cv=none; d=zohomail.com; s=zohoarc; b=fncRRDGbuUHdEak3NMz+2eDjF6HfoFKQRp982gOiHcoqUQn4mlXtXhcevot0cRqGwgk7o6rvwDBRxBPtvN7BqvwuJC4axEsxaXFENhOU0kc9ffiuDmnDkwbZ/9dPt6tzABQuWG6VoERoPl00WGQE5zd4e1gutc/Z9/TeO3gGyqo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493821; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VsbaU0VdjEFE5/Kdiolu0QHc56Ub04+6AJsyszfha5Q=; b=nG1iKXwp/8VxwEr07wuOhOjYw26iyrtbW1qEeTYq3iNflHxbzCkiDYhIWipLIBlFrY6sHMYzEMOmFMvv8Ex+r0xTw3SfN+VxyBeh33307U7y+CGOrUrV6VfIPxlACQUl9tOsHX0oRV3RzYIwUCKToi9hz2VpePKpPbN/yMYZaPc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493821510853.5403057180628; Tue, 20 Oct 2026 03:57:01 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455321.1669027 (Exim 4.92) (envelope-from ) id 1xJ7WB-0005qq-U8; Tue, 20 Oct 2026 10:56:31 +0000 Received: by outflank-mailman (output) from mailman id 1455321.1669027; Tue, 20 Oct 2026 10:56:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7WA-0005jq-6N; Tue, 20 Oct 2026 10:56:30 +0000 Received: by outflank-mailman (input) for mailman id 1455321; Tue, 20 Oct 2026 10:50:49 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Qf-0008V4-DI for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:50:49 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7Qe-004d40-QV for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:50:48 +0200 Received: from [10.42.69.12] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74785-8faa-0a2a0a5109dd-0a2a450cd584-16 for ; Tue, 20 Oct 2026 12:50:48 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad7470e-f479-0a2a450c0019-aa0a817c6ed9-3 for ; Tue, 20 Oct 2026 12:48:47 +0200 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-83--Z5Wuh_zPUyc0JzRRnv_JA-1; Tue, 20 Oct 2026 06:48:42 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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 15B921956076; Tue, 20 Oct 2026 10:48:39 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1EFBA418; Tue, 20 Oct 2026 10:48:36 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VsbaU0VdjEFE5/Kdiolu0QHc56Ub04+6AJsyszfha5Q=; b=Kvj6Uhmx0CftacNi8fS11w2+s5+vYOuMOklkfQcL817okxj1BLEXQ5Wx0bxnDrs2S7y03u /igaXAem0RanY67EA4+bRDbOFopm14PF8Is+FUroEJEjxZShXK7zfrGslsQ1kCajOGRwjm flMBuzKO9F2N5mpB94gS69XuGdt0/A0= X-MC-Unique: -Z5Wuh_zPUyc0JzRRnv_JA-1 X-Mimecast-MFC-AGG-ID: -Z5Wuh_zPUyc0JzRRnv_JA_1792493319 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:44 +0400 Subject: [PATCH v7 27/65] hostmem-file: convert OnOffAuto rom property to QAPI-aware registration MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-27-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=3017; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=iZFd9HvderJ8uRReytwVEg9V/BI0/W9et6yTV5n+0HQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZaUi0I/HhTBoPEm8cGvUR2Ags/oP63+/IJC B3aPbt5x/6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWgAKCRDa6OEJdZac 5SbrEACzpT4DA3aDgoPm1mkI7LWP4C1/KmFL4+/JVH+4dvDiHK2lfPUcj6g8+5ZAjiaZ7BNg5vr GU3ywL52hlZ5JZCn41HMfti/ha4z983dNfIctpiaV9RJU+A22EtAvPLpDEcFPF9PfeB/aMB6a1h 0Dpk/O8iKpIR0ww2sHYfJ7HC8jqBpBpc5BTWLONeOzWTk3OnFRU6R0c5BPcI6cENi7juVgxXrtZ ispq5YrtGrp52pLe3Ewh7Z+QrKyA2oKxwo7jhh3PQ9MQf1Bv4H9XMKBZmivwnir/bT4wnDtabCG Z3MBE8QRfPUHzLW7s8idRTcelPr99S0+ZteQGhagDNHrC6CSQMSUQPO7daBJj8bgI/gxraF66d0 ceIDBeRODFFyp397ZvOHRafc6G41UZt3Q09G/ONGcgNom+1IxZuqlJKhvb2/lhLdZMQFRPNkGAj +EpBka/x64Ny38YdXyQE79VKzddpZZLDC1bVdR+/jm4r3s6ujtMANYlwZojYhpW6CGtB8RorWmI BzUp4XLCDTQrGR4EZej7rnfAUKzkJ3+sMWrkIk59mZgmLJ5fXSxLqhwExH6OrIEp1ay3QZ15Bhp MS3Wp8RSmuhgaHr6i15QnVDly1vb0u60cJvRjNcpvjIEC40XFnirrOV6Qw6AmT4lgBoJx/CvkS4 b2y0JppmjOhRU9g== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-MFC-PROC-ID: AjAgkOcKgY090WkV1dYEmrwuURwST74AHYyS7yURdok_1792493319 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-d25034/1792493328-51936A5B-8B59395A/0/0 X-purgate-type: clean X-purgate-size: 3019 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493822730158500 Convert the rom OnOffAuto property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- backends/hostmem-file.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 7efecf71f565..7d4d52482966 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -19,7 +19,7 @@ #include "qom/object_interfaces.h" #include "qom/object.h" #include "qapi/visitor.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" =20 OBJECT_DECLARE_SIMPLE_TYPE(HostMemoryBackendFile, MEMORY_BACKEND_FILE) =20 @@ -230,30 +230,24 @@ static void file_memory_backend_set_readonly(Object *= obj, bool value, fb->readonly =3D value; } =20 -static void file_memory_backend_get_rom(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static int file_memory_backend_get_rom(Object *obj, Error **errp) { HostMemoryBackendFile *fb =3D MEMORY_BACKEND_FILE(obj); - OnOffAuto rom =3D fb->rom; - - visit_type_OnOffAuto(v, name, &rom, errp); + return fb->rom; } =20 -static void file_memory_backend_set_rom(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void file_memory_backend_set_rom(Object *obj, int value, Error **er= rp) { HostMemoryBackend *backend =3D MEMORY_BACKEND(obj); HostMemoryBackendFile *fb =3D MEMORY_BACKEND_FILE(obj); =20 if (host_memory_backend_mr_inited(backend)) { - error_setg(errp, "cannot change property '%s' of %s.", name, + error_setg(errp, "cannot change property 'rom' of %s.", object_get_typename(obj)); return; } =20 - visit_type_OnOffAuto(v, name, &fb->rom, errp); + fb->rom =3D value; } =20 static void file_backend_unparent(Object *obj) @@ -298,10 +292,13 @@ file_backend_class_init(ObjectClass *oc, const void *= data) object_class_property_add_bool(oc, "readonly", file_memory_backend_get_readonly, file_memory_backend_set_readonly); - object_class_property_add(oc, "rom", "OnOffAuto", - file_memory_backend_get_rom, file_memory_backend_set_rom, NULL, NU= LL); - object_class_property_set_description(oc, "rom", - "Whether to create Read Only Memory (ROM)"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "rom", + .description =3D "Whether to create Read Only Memory (ROM)", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D file_memory_backend_get_rom, + .set =3D file_memory_backend_set_rom, + )); } =20 static void file_backend_instance_finalize(Object *o) --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493662; cv=none; d=zohomail.com; s=zohoarc; b=QsdqEBr7Mc1pqdgOmYiQVkABAlSdYMIc8VE+XLcPVAOQF/3OrQG/ckBPd/RTp+Ay/zAQkaythdUNo1GzN/g3tqhwOz/6juHzOx+ctiBe4QM3oHDKT082mz78IjPpsXZoE3nTe3Gawu25eu1cpEqexCYlkdW+R6ZwbzcugAXl2Ic= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493662; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ITZAmzqb42SOieKlyK1KvmCdBEM4ZFKVGJMc/HmGp5k=; b=gnIbqEWHol4dUEKH1W6I12ZQO8Nu4Blbz81kmMMrypFQhiMewRnvpe5U/JI+wzIRX3GO00otECTXCLCYlQn+z4waslN+GVFa9YRFgSmx7ZfIuzE76Buz8xBO4V0REhlz6RGsuVIZXCjORnY2YbpgQIVb4agFHDIE0Yn+2ZP0U3w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792493662502239.83144602320033; Tue, 20 Oct 2026 03:54:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7QN-0007KX-3D; Tue, 20 Oct 2026 06:50:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Os-0003M2-D0 for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:49:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Oo-0005dI-9v for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:48:56 -0400 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-491-PGS6jTcAOfWke_074JgvdA-1; Tue, 20 Oct 2026 10:48:48 +0000 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 607CC1955DCB; Tue, 20 Oct 2026 10:48:44 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3C7E018002B1; Tue, 20 Oct 2026 10:48:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ITZAmzqb42SOieKlyK1KvmCdBEM4ZFKVGJMc/HmGp5k=; b=JCJit/yyp+w4uCtBxlQ7FlBWBWcri0e09WOjyciMVunktBf1haZiXW+tk5/w9dHzd6xpKl TWdowu2f70FRV+VNgDP7JMl/Z2j4DNhNqRNQh1drKDLxHvCM6/RqL1nePonbuTiaJr12Xc i5F+Af30OT0T9wlb8XK/b39QLf6R3Ms= X-MC-Unique: PGS6jTcAOfWke_074JgvdA-1 X-Mimecast-MFC-AGG-ID: PGS6jTcAOfWke_074JgvdA_1792493324 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:45 +0400 Subject: [PATCH v7 28/65] sev: convert OnOffAuto legacy-vm-type property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-28-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2932; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=e2zxmMhmJGF0dwc0SRzZuUR5qMnfM/36nnJtEEhS5HU=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZaPCLOl/jTkrNhGvjvoErUEYn1j7um/aMo0 ZI7dyqyzT6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWgAKCRDa6OEJdZac 5bBPD/9YSzBj8rYL1VR6mIizfqkgB0/PpThetAFKK6VOJ5UwsrSCvay3ut/gvIfOk0yHdhdHVWq Uz2ZKUkj9DO9sRX39BQCuKmjIsfoY3siZbaDChTtbShjPxhuFraX/nC2nvPuqd3vJJCy6AOeiCN 0ihLqhJPkeYoPKVqVd8jLDAt24/RSLOtUiuCXK3ZjSyXPiQCI7Q+c4ObrWUqfFSKoZuD/WjUmpI Ydb1AYXzIDBSx6VHn33zxDswViVybQV5ahY7osUUBE7KAI28mVSFrxFOCGWT58Hpz/xomG0JKq8 9VXoJNH+E5shv0v0VhMSnm+pvNmz0id2LZty8354Pi1CZ+KdmxSwz7Kxqdc0NCFER77a7+xn7J6 x0S9Zu85aLRNnCRSOJ5auSHQgryCGQvKSOlqFFL+SCOVftpsiiUH4bd8CAKJCIPeqw7j7beCCGY KNB6BsQL6TDT7zaAQmMPNVZur/l87U4iJmPZjBF6c3RiM/10WKCnxRb3MWcocawkttpcuS9FLxg B9ud9eSGegnwhA1PxzXyburB+4c8MbRt5hdLKQvae+gUTUK0Z3BG3jbmybChBhoNKRREWEUepvd LkDhvCIHcfCmtyY2QCNu5qT/nkPIDzUZOqpHc0Oq8GA49cI/MvabenocOgTLTS9BEKBuQDZRWKY jeq3wdMr+xiPpNg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493663884158500 Convert the legacy-vm-type OnOffAuto property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- target/i386/sev.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index cc16c6b07123..b2c7260c80a4 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -20,6 +20,7 @@ #include =20 #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "qom/object_interfaces.h" #include "qemu/base64.h" #include "qemu/module.h" @@ -2939,23 +2940,16 @@ sev_guest_set_session_file(Object *obj, const char = *value, Error **errp) SEV_GUEST(obj)->session_file =3D g_strdup(value); } =20 -static void sev_guest_get_legacy_vm_type(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static int sev_guest_get_legacy_vm_type(Object *obj, Error **errp) { SevGuestState *sev_guest =3D SEV_GUEST(obj); - OnOffAuto legacy_vm_type =3D sev_guest->legacy_vm_type; - - visit_type_OnOffAuto(v, name, &legacy_vm_type, errp); + return sev_guest->legacy_vm_type; } =20 -static void sev_guest_set_legacy_vm_type(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void sev_guest_set_legacy_vm_type(Object *obj, int value, Error **e= rrp) { SevGuestState *sev_guest =3D SEV_GUEST(obj); - - visit_type_OnOffAuto(v, name, &sev_guest->legacy_vm_type, errp); + sev_guest->legacy_vm_type =3D value; } =20 static void @@ -2981,11 +2975,14 @@ sev_guest_class_init(ObjectClass *oc, const void *d= ata) sev_guest_set_session_file); object_class_property_set_description(oc, "session-file", "guest owners session parameters (encoded with base64)"); - object_class_property_add(oc, "legacy-vm-type", "OnOffAuto", - sev_guest_get_legacy_vm_type, - sev_guest_set_legacy_vm_type, NULL, NULL); - object_class_property_set_description(oc, "legacy-vm-type", - "use legacy VM type to maintain measurement compatibility with= older QEMU or kernel versions."); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "legacy-vm-type", + .description =3D "use legacy VM type to maintain measurement " + "compatibility with older QEMU or kernel versions.", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D sev_guest_get_legacy_vm_type, + .set =3D sev_guest_set_legacy_vm_type, + )); } =20 static void --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493829; cv=none; d=zohomail.com; s=zohoarc; b=jhXCYvKy5tglEy/eZ0zcUZwRP9smtxp1ur6N6IT7wILmrUDgZvFVfAoiHrYNSwcaL3ikn8kdkPrpwfsmpqQupdxZRxiqG97dKkRDzsUaCSJB4xIRdDZ5ahNrVVtPTiXFqDxBps9xpz+NMNPglxRL48M2GaludMs17ypDwDBTsK8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493829; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=neSxnRoG/OmCl+kteGebRHQJWP0OZxqFcRCZ8c/QA3c=; b=NkyIjWU9jwmuwQkJVZwJCJBpofCDbMtj512qHMcuQEw5YlE3ZYIkEtWzH9A8mLGHDHdj7AyyQ+i136GzxVbK3W4LG2reZwC4nleYN/mS/vgz0KFCslvVRcUz8FymeSgvcDt7tbYinyeTz0QMi7LKff9vUN2dWdbtFXuQBv71xww= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493829599586.3444101371105; Tue, 20 Oct 2026 03:57:09 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455331.1669080 (Exim 4.92) (envelope-from ) id 1xJ7WO-0000Ft-Qt; Tue, 20 Oct 2026 10:56:44 +0000 Received: by outflank-mailman (output) from mailman id 1455331.1669080; Tue, 20 Oct 2026 10:56:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7WN-0000AK-Kk; Tue, 20 Oct 2026 10:56:43 +0000 Received: by outflank-mailman (input) for mailman id 1455331; Tue, 20 Oct 2026 10:50:58 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Qo-00006Y-7d for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:50:58 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7Qn-00CrhG-KR for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:50:57 +0200 Received: from [10.42.69.8] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74791-2eae-0a2a0a5409dd-0a2a4508a15a-0 for ; Tue, 20 Oct 2026 12:50:57 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad74718-f659-0a2a45080019-aa0a817c92c1-3 for ; Tue, 20 Oct 2026 12:48:57 +0200 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-561--SDF1wKINiCajNC4XN8nVg-1; Tue, 20 Oct 2026 10:48:53 +0000 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 C281219560AD; Tue, 20 Oct 2026 10:48:49 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CC00130000E7; Tue, 20 Oct 2026 10:48:46 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=neSxnRoG/OmCl+kteGebRHQJWP0OZxqFcRCZ8c/QA3c=; b=is2p5rs4M47Kb5I0qVWQ/8KTtLVZw4mr0u4/M0xbmkcNDhobWEdHz26KaB3A9bGpx5OSOu GwPrQVsHXBT6NdUvceRnTjgx236NyOx3OjOQKs4f4ym943i489aC68QjLunJDcydcVWCY7 CYhP+St76XYBBSW7eetEHzPNa02hWtE= X-MC-Unique: -SDF1wKINiCajNC4XN8nVg-1 X-Mimecast-MFC-AGG-ID: -SDF1wKINiCajNC4XN8nVg_1792493329 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:46 +0400 Subject: [PATCH v7 29/65] whpx: convert OnOffAuto hyperv property to QAPI-aware registration MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-29-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2624; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=fGCiDH3DKuAcB7LiCAkFXJHjeu1egNzKD2fVY9nF9O8=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZaOCCAg3rKTDCUl37+MgI4Ayhi8dunIN41j jugR4kjAkCJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWgAKCRDa6OEJdZac 5b6WEACNN5lLKAUjdYB4zCcQJTY9b/clU3Ul2ZqrNT8WzHUQ+fqxHO7sMKEnV/KpehWqsAYB7Wa TcTcGvlU8B+Rp77AddGo/jHP3KiihUrvHM5s2QNpNKBTkpdE/FtNtDGvtY7Rl7BnE0I4ur8xacz HXMHNM++tzb2u4VkpDDbgWl8A7MUiCYAu2iAC93LMBoFtVGYq/tjz4PQr2gFfLvNxJ8hh8g+2iu smVuhJO5UxVs/qkZoh6kIe0LZ6WvLafLB9/AU4a+YYPl0g7G3gvQV+Pzb64VIcibMzpV8qJ8b8M t+/BnO1YoRZPZ11BLDzxA83zKDcZQWNwtNYWZCCxAgLA9Evb3RKKpX3ezykZW625hA11ml8/USP Ng9IwZx3DS+SVp66cPB3YD4Vblja8jaJLVCuGSQnNstkM9jWJ41xW1pTt/RQn1TsRK/t7qyBtO1 kHBG4Xp7bkht89XuKnLvIPrFH/W85g9KGuerywfZYfz/FobiX2GdtR3qPJiq0+oIJa2vLvqAjID 3M72ERKY7E2DdWkQ/qN6y7zsbhicNq980YAI7vae2/ht1mYnRZYyo4tF62m7MjopLEjAufj+RHB jZQHwA8CL5TVxFAQmJ8wDFE+5CAwj4qru7MbpAYn1njH780Iqg5frmuGfrB2B5bUXeimrR8uppN FX/dQnG4r/dU1+A== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-MFC-PROC-ID: GYxlFWTtJOgEk61ITIIlRybRnLBqwAUTgoBs8eeYCz4_1792493329 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-c1860d/1792493337-CD54C87B-B4D0087C/0/0 X-purgate-type: clean X-purgate-size: 2626 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493830943158500 Convert the hyperv OnOffAuto property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- accel/whpx/whpx-common.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c index 247e12db8128..187938c02b51 100644 --- a/accel/whpx/whpx-common.c +++ b/accel/whpx/whpx-common.c @@ -22,6 +22,7 @@ #include "qemu/error-report.h" #include "qapi/error.h" #include "qapi/qapi-types-common.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qapi-visit-common.h" #include "migration/blocker.h" #include "accel/accel-cpu-target.h" @@ -470,18 +471,11 @@ static void whpx_set_kernel_irqchip(Object *obj, Visi= tor *v, } } =20 -static void whpx_set_hyperv(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_hyperv(Object *obj, int value, Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffAuto mode; =20 - if (!visit_type_OnOffAuto(v, name, &mode, errp)) { - return; - } - - switch (mode) { + switch (value) { case ON_OFF_AUTO_ON: whpx->hyperv_enlightenments_allowed =3D true; whpx->hyperv_enlightenments_required =3D true; @@ -497,11 +491,7 @@ static void whpx_set_hyperv(Object *obj, Visitor *v, whpx->hyperv_enlightenments_required =3D false; break; default: - /* - * The value was checked in visit_type_OnOffAuto() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 @@ -533,11 +523,12 @@ static void whpx_accel_class_init(ObjectClass *oc, co= nst void *data) NULL, NULL); object_class_property_set_description(oc, "kernel-irqchip", "Configure WHPX in-kernel irqchip"); - object_class_property_add(oc, "hyperv", "OnOffAuto", - NULL, whpx_set_hyperv, - NULL, NULL); - object_class_property_set_description(oc, "hyperv", - "Configure Hyper-V enlightenments"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "hyperv", + .description =3D "Configure Hyper-V enlightenments", + .qapi_type =3D &OnOffAuto_type_info, + .set =3D whpx_set_hyperv, + )); =20 whpx_arch_accel_class_init(oc); } --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493766; cv=none; d=zohomail.com; s=zohoarc; b=ButnA2NiR48kNkG0+25Kw3auCwN6NTQdU1o6u/dC7n49eOoqij4mlojyt6vePDxN0UOE5rWLnbGd+xtbuYlJGvyprof1C03sAl2Up57V+rK8NZrkhgxwk9ZpQBBICFMZhv7QMPgC09jl5FPe2VVv2Yoyy4HzNkt9uNVHhPjN29I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493766; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=vqRAumP9Q4P45v+BnAaswZB9eyGK4924nboYOJbbp2E=; b=AcVeWCQagOY8TWlWeGVzSKetW5+d43GLtOq4ijjttJN/Xic4dvG6AkQZkOX+jVGU608YraXabiACXMdOVrPllTJjWdP5Fh7vcLwp7EBlYP29UMcDMbfoaTgAWnZWbzgpBkZKN70GNZcNcS7ZtBH4ehiIYjpzknaat4MBDKuwJ9o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792493766335332.5381831182028; Tue, 20 Oct 2026 03:56:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7QT-0007eM-F4; Tue, 20 Oct 2026 06:50:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Oz-0003j3-PK for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:49:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Ox-0005gS-Nc for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:49:05 -0400 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-517-GSbpLDLrPQqHZRQ94vMg0A-1; Tue, 20 Oct 2026 10:48:59 +0000 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 401F418002AD; Tue, 20 Oct 2026 10:48:55 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4CB201800257; Tue, 20 Oct 2026 10:48:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vqRAumP9Q4P45v+BnAaswZB9eyGK4924nboYOJbbp2E=; b=Pp4t7PoXPc6risekObVBS7oa6PvODWLaqylR7KF5GeyLlZMt4v+yvY98KvsFbymQs/cFo4 +r1HfspmEgErdD637s5UZt8hdC9SDGdxbS7YY8MZFHNICCVRXgYBgRF3wNNjh9uHVs94mu zj0DlI2EeCXv9rHQxGO759Wn89eTnzA= X-MC-Unique: GSbpLDLrPQqHZRQ94vMg0A-1 X-Mimecast-MFC-AGG-ID: GSbpLDLrPQqHZRQ94vMg0A_1792493335 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:47 +0400 Subject: [PATCH v7 30/65] whpx: convert OnOffAuto arch properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-30-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=6702; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=F8HZ01XPkkBAtzYnAznI+OeIpIRAjOQCT4x6+nWcsZQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZaNHtr+AkGnY6QtTL0vsHs6SXFQUQ8MQ6i4 S1YABGB6XOJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWgAKCRDa6OEJdZac 5U3+D/0bY0Yw06OplfGaxwkWeRkmM8vGPJ5F9M0cVeicCg/oXCYp+UKgC78TYi76WRGpbyL2C7S 0KxXaqPjOuPoiru3KbrrdebJxsrbKZijDWmhlIsP9jywqVWMuCB+weipCeiSrSWcM8KYKDNl6lh BAGjS+eZuivN40OoVe2PxA7lKt96RrybUNJq39LwnTdm/8Lx0x5A7nOmtMf6p5zUDEy6bO9wTJ9 /9cnmG5OgUn4fNab0GmXDPDj2/b7lDQNLOZQiOEE1aPD1CnruklCEcrbKrMXEZIYQc9JkVJVviZ sWu3vDJ9GCWP/JGd6P26BcaZeOw6qiIfSjJgGMcE3CyRguBdSr4ldn+yC83f6n9vVa68VDVU85t PoSwXa0eYL0MCuvzu1v2GPnE/oDcMkqhH7+e/tLdejjt7K9jX7qtbmGTnHtszQGZv3Bn0tfV3RM fJtheu+i9GFuCM5MxESNY85RUBO6acenPHsR1+nmHtqbICIGanSHvfZzCXqJL4WwAH/IRbzic4F sB4SZ4sCdErodKNcNWECfUhDwpvmtfzJ5r4PC9kT3qEABypAk8pdibNyUNuaX6p+KJtOwuuQsnA NP6Npp4aqbXBUyIW3gZUAcetZJhmn/V7jRQ/TFEG2uGqdOa3T2YNGJ9TDknE1CAeWkCjRf+IwA6 Z2YAEk2bZvmBjgQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493767855158500 Convert the ignore-unknown-msr, intercept-msr-gp, and ssd OnOffAuto properties from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- target/i386/whpx/whpx-all.c | 101 +++++++++++++++-------------------------= ---- 1 file changed, 34 insertions(+), 67 deletions(-) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 113f79afb9ab..64fa389a2f93 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -30,7 +30,7 @@ #include "qemu/error-report.h" #include "qapi/error.h" #include "qapi/qapi-types-common.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "migration/blocker.h" #include "host-cpu.h" #include "accel/accel-cpu-target.h" @@ -1875,6 +1875,7 @@ void whpx_apply_breakpoints( } } =20 + void whpx_arch_destroy_vcpu(CPUState *cpu) { X86CPU *x86cpu =3D X86_CPU(cpu); @@ -1955,7 +1956,7 @@ static int whpx_handle_hyperv_guestidle(CPUState *cpu) return whpx_handle_halt(cpu); } =20 -static void whpx_vcpu_kick_out_of_hlt(CPUState *cpu)=20 +static void whpx_vcpu_kick_out_of_hlt(CPUState *cpu) { WHV_REGISTER_VALUE reg; whpx_get_reg(cpu, WHvRegisterInternalActivityState, ®); @@ -2059,7 +2060,7 @@ static void whpx_vcpu_pre_run(CPUState *cpu) .Vector =3D irq, }; reg_count +=3D 1; - /*=20 + /* * When the Hyper-V APIC is enabled, to get out of HLT we * either have to request an interrupt or manually get it away * from HLT. @@ -2359,7 +2360,7 @@ int whpx_vcpu_run(CPUState *cpu) WHV_REGISTER_VALUE reg_values[3] =3D {0}; WHV_REGISTER_NAME reg_names[3]; UINT32 reg_count; - bool is_known_msr =3D 0;=20 + bool is_known_msr =3D 0; bool raises_gpf =3D false; uint64_t val; =20 @@ -2911,120 +2912,86 @@ void whpx_cpu_instance_init(CPUState *cs) * Partition support */ =20 -static void whpx_set_unknown_msr(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_unknown_msr(Object *obj, int value, Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffAuto mode; =20 - if (!visit_type_OnOffAuto(v, name, &mode, errp)) { - return; - } - - switch (mode) { + switch (value) { case ON_OFF_AUTO_ON: whpx->ignore_unknown_msr =3D true; break; - case ON_OFF_AUTO_OFF: whpx->ignore_unknown_msr =3D false; break; - case ON_OFF_AUTO_AUTO: whpx->ignore_unknown_msr =3D true; break; default: - /* - * The value was checked in visit_type_OnOffAuto() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 -static void whpx_set_intercept_msr_gp(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_intercept_msr_gp(Object *obj, int value, Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffAuto mode; =20 - if (!visit_type_OnOffAuto(v, name, &mode, errp)) { - return; - } - - switch (mode) { + switch (value) { case ON_OFF_AUTO_ON: whpx->intercept_msr_gp =3D true; break; - case ON_OFF_AUTO_OFF: whpx->intercept_msr_gp =3D false; break; - case ON_OFF_AUTO_AUTO: whpx->intercept_msr_gp =3D false; break; default: - /* - * The value was checked in visit_type_OnOffAuto() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 -static void whpx_set_ssd(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_ssd(Object *obj, int value, Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffAuto mode; =20 - if (!visit_type_OnOffAuto(v, name, &mode, errp)) { - return; - } - - switch (mode) { + switch (value) { case ON_OFF_AUTO_ON: whpx->separate_security_domain =3D true; break; - case ON_OFF_AUTO_OFF: whpx->separate_security_domain =3D false; break; - case ON_OFF_AUTO_AUTO: whpx->separate_security_domain =3D true; break; default: - /* - * The value was checked in visit_type_OnOffAuto() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 =20 void whpx_arch_accel_class_init(ObjectClass *oc) { - object_class_property_add(oc, "ignore-unknown-msr", "OnOffAuto", - NULL, whpx_set_unknown_msr, - NULL, NULL); - object_class_property_set_description(oc, "ignore-unknown-msr", - "Configure unknown MSR behavior"); - object_class_property_add(oc, "intercept-msr-gp", "OnOffAuto", - NULL, whpx_set_intercept_msr_gp, - NULL, NULL); - object_class_property_set_description(oc, "intercept-msr-gp", - "Intercept #GP to log erroring MSR accesses."); - object_class_property_add(oc, "ssd", "OnOffAuto", - NULL, whpx_set_ssd, - NULL, NULL); - object_class_property_set_description(oc, "ssd", - "Separate security domain"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "ignore-unknown-msr", + .description =3D "Configure unknown MSR behavior", + .qapi_type =3D &OnOffAuto_type_info, + .set =3D whpx_set_unknown_msr, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "intercept-msr-gp", + .description =3D "Intercept #GP to log erroring MSR accesses.", + .qapi_type =3D &OnOffAuto_type_info, + .set =3D whpx_set_intercept_msr_gp, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "ssd", + .description =3D "Separate security domain", + .qapi_type =3D &OnOffAuto_type_info, + .set =3D whpx_set_ssd, + )); } =20 int whpx_accel_init(AccelState *as, MachineState *ms) --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493848; cv=none; d=zohomail.com; s=zohoarc; b=lOv+N5VEJdrAOnx+B1Q5cdfy8YhgOM2F96WPcHlYPOV/4rHnezZJAiYtwhJU6XGKyAuGiwz6F+N5jF316iKnv9Xn8yAz38d3l2sGpZT/OGkgyH97qDDc+C/q2vAhBDVmmwWsfrMo7bFoQpx9exGqhqdWug9iDLUtDGN3l8OFWq8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493848; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GzrRsz6mLl7MwzdhkY7vfYrvBkZMGUNTXQg1+7bFvLg=; b=eaNCJuK9rf2JfeA5XHn7Vmlz4rIpFz5T+IN+dx8KpbFFjQp3kV++ytmRhsxqkyilwp6fMdrlKBn3a+45CB4vZeLDLk6moAm5t1WtjKqlUB5KiUazq8M6katI5ODHmwGNRBtEnCE32H5xczlpFm8EP72RAKgz9vQnIj7ZO0L7gy8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493848630187.6133774815346; Tue, 20 Oct 2026 03:57:28 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455352.1669182 (Exim 4.92) (envelope-from ) id 1xJ7Wo-0005Nz-Qx; Tue, 20 Oct 2026 10:57:10 +0000 Received: by outflank-mailman (output) from mailman id 1455352.1669182; Tue, 20 Oct 2026 10:57:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Wn-0005KP-9f; Tue, 20 Oct 2026 10:57:09 +0000 Received: by outflank-mailman (input) for mailman id 1455352; Tue, 20 Oct 2026 10:51:11 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7R0-0000CH-ST for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:10 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7R0-00EzG1-97 for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:10 +0200 Received: from [10.42.69.5] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad7479c-e002-0a2a0a5209dd-0a2a4505a14c-10 for ; Tue, 20 Oct 2026 12:51:10 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad74724-4cb1-0a2a45050019-aa0a817c6d61-3 for ; Tue, 20 Oct 2026 12:49:09 +0200 Received: from mx-prod-mc-03.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-695-yDBtsgiZMVeudebqgTG40w-1; Tue, 20 Oct 2026 10:49:04 +0000 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 463A71955F13; Tue, 20 Oct 2026 10:49:00 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C02F71800643; Tue, 20 Oct 2026 10:48:57 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GzrRsz6mLl7MwzdhkY7vfYrvBkZMGUNTXQg1+7bFvLg=; b=WjI35hrQXJ0ijBYcUi0UVMCHqSVtKNNZW1/084jkdA/Q5NyXD8a085euiie+zES1K6B6ZS PgzFLcHRGxQ/qH951645GnryXtaSjuAlaz/ic3UGMN0jHvB9bwO4QsRpjHWAeK18vROm9e WwOPmBovFIroMLyoFI+pmgrUa/iZfP4= X-MC-Unique: yDBtsgiZMVeudebqgTG40w-1 X-Mimecast-MFC-AGG-ID: yDBtsgiZMVeudebqgTG40w_1792493340 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:48 +0400 Subject: [PATCH v7 31/65] accel/kvm: convert OnOffSplit property to QAPI-aware registration MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-31-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2783; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=+bwgKTQoEXvch3Nux+0BT762997CE8SOrsZR1127GSg=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10Za8fqdACvj1nRd8+C/AFYeoaG4KSLJ6yGQQ Glfe3Z930GJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWgAKCRDa6OEJdZac 5eUfD/9SnH6zP3RrX1y/+UloXnrP0adIyHDiLTAU3ewz/VXg/42/fyfveSadLjnEYI4LS5PYVJD v/pRwcO+N8ttIKGUUnzvZ8LbPJ2aOUgbCxlb4OK1H/o0SeUotkF4vrecY3jiuanZDAad9nnJknV xUSfv6C47md+eGcoSxfBJtIoHoCzqP0VrumAL7f2whnw8f6IDaVVKTSD6sZJ2Efs7s1Qn16rBMu sqGVWI8FrPFjMzb/2EDPUkou27o+hp2N8qu8YOve5UpP6QDxfnvjhmhmzJqVkCfvoO7rCGKkijo k6vWvpqSMKDK7l1tHS0Ku4FIISLg98nxTng63G6H0qOK0nHyQP1GSk2qwxpiYk8u9Ce9qsIz+11 sIE9BYfcmZCOjWPUgJLaVkhwmIjD02zSVmTioREECRxLjNPpDkjuJr0Xdlsh2WYnRWY3Fl1t7OD GbNk+8g5pktMfc35r/EnZqCHRxK62xZpnLhPmwgZXCOU2v78mH+KMUj4kAc1hL4GqVsXBZ9hmrQ jIMQW97/Fx15LS09jI953OtIvrmwRkkpGdMo1MDk0IGUeACzxNcIm9WjoGfUs6o75BDqmwcC7i1 Z3C6vhvu7wZNWdHqfWnywxQ/mt0EngUghtCxbR/EkXeD+K3qeezLfiPlajqHqOA85YFTZ6KTEUz jiYTPV8RQoITU0g== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-MFC-PROC-ID: 2Z1-Kbm-t9Y3NgDiW21Y-rDzCnPh0Bs1Z9_mxRN93ws_1792493340 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-c201ff/1792493350-2551A2A1-D300DC9D/0/0 X-purgate-type: clean X-purgate-size: 2785 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493849309158500 Convert the OnOffSplit property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- accel/kvm/kvm-all.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index db8fba53f339..1d91667fb880 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -46,6 +46,7 @@ #include "qapi/visitor.h" #include "qapi/qapi-types-common.h" #include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "system/reset.h" #include "qemu/guest-random.h" #include "system/hw_accel.h" @@ -4151,22 +4152,17 @@ static void kvm_set_kvm_shadow_mem(Object *obj, Vis= itor *v, s->kvm_shadow_mem =3D value; } =20 -static void kvm_set_kernel_irqchip(Object *obj, Visitor *v, - const char *name, void *opaque, +static void kvm_set_kernel_irqchip(Object *obj, int value, Error **errp) { KVMState *s =3D KVM_STATE(obj); - OnOffSplit mode; =20 if (s->fd !=3D -1) { error_setg(errp, "Cannot set properties after the accelerator has = been initialized"); return; } =20 - if (!visit_type_OnOffSplit(v, name, &mode, errp)) { - return; - } - switch (mode) { + switch (value) { case ON_OFF_SPLIT_ON: s->kernel_irqchip_allowed =3D true; s->kernel_irqchip_required =3D true; @@ -4183,10 +4179,7 @@ static void kvm_set_kernel_irqchip(Object *obj, Visi= tor *v, s->kernel_irqchip_split =3D ON_OFF_AUTO_ON; break; default: - /* The value was checked in visit_type_OnOffSplit() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 @@ -4303,11 +4296,12 @@ static void kvm_accel_class_init(ObjectClass *oc, c= onst void *data) ac->has_memory =3D kvm_accel_has_memory; ac->allowed =3D &kvm_allowed; =20 - object_class_property_add(oc, "kernel-irqchip", "on|off|split", - NULL, kvm_set_kernel_irqchip, - NULL, NULL); - object_class_property_set_description(oc, "kernel-irqchip", - "Configure KVM in-kernel irqchip"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "kernel-irqchip", + .qapi_type =3D &OnOffSplit_type_info, + .set =3D kvm_set_kernel_irqchip, + .description =3D "Configure KVM in-kernel irqchip", + )); =20 object_class_property_add(oc, "kvm-shadow-mem", "int", kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_mem, --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493637; cv=none; d=zohomail.com; s=zohoarc; b=ffQyiyXgXv47ZLw3kg8Q6ok1b8LBlAePtXyH4+JSeV5GAI1DGGO1XBI6tgb4xXWqXdC+iCDB8I4odan+MTHrl4BpAL7UNz08hLGbn8ALPO3Ez3NuzDgRSyFK3Hqtt9c/TgETcKsA4k/yfslr9hzkZ1Kkk8aJQVJKdOcFC8S2kFQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493637; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+msWSN975JraU+AQ2pjkwTOzy6rb7VP7Sy0YWpQFyaI=; b=T2UsWq8Ksq9r4LCxfFOkgYppPwD00uzNMF6FFUsjGn/9QQWcm4bxnwM9mIvR703I7Py2MyngdnlDuqxju2LN94GiV/+n8CJMyGw5YSh+kBGgGzZyI4I8ambR49RJRHdWhzJxK1p5ba+IjZ0qUcwWTU5VgwAAEFziOenEdgcS6TU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792493637161776.6915163421369; Tue, 20 Oct 2026 03:53:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7QX-0007pb-0o; Tue, 20 Oct 2026 06:50:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7P9-0003wW-Rf for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:49:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7P8-0005iu-2c for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:49:15 -0400 Received: from mx-prod-mc-03.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-189-NYqEQbiqO-eptIVh-iXBxg-1; Tue, 20 Oct 2026 10:49:09 +0000 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CC9791955DC2; Tue, 20 Oct 2026 10:49:05 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AB839418; Tue, 20 Oct 2026 10:49:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+msWSN975JraU+AQ2pjkwTOzy6rb7VP7Sy0YWpQFyaI=; b=WMwxtfs9ibMlyq05dCMs8f/jwudkWoTlmXfl1l0NVnOfN7wSJBbxwr6/qjJUBZ/xGbw2qA v1TlWyZVW1U7XEyHrL72+xsIql93N2sNI746PaPn0mD38k9A1J2oW5u74ZUfpaX3yhDTwR cl2BZwh6BZcf+hrQfFTEwmT21bYpCEQ= X-MC-Unique: NYqEQbiqO-eptIVh-iXBxg-1 X-Mimecast-MFC-AGG-ID: NYqEQbiqO-eptIVh-iXBxg_1792493346 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:49 +0400 Subject: [PATCH v7 32/65] whpx: convert OnOffSplit property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-32-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2405; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=qwLr64BOI3m44mmy9A+SITIRRpm72tGui++1suPv5QI=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZaQPXZ9WY6MhNw1DyiQHvUVteDQyhQLNYx9 5hVrQKQA32JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWgAKCRDa6OEJdZac 5WR8D/9WFCaokBX+igEl9S/wj1xhyGPSG66SFfV27Dltbb57zmq4uC5jvUX5w6dWXvYhtPNHQFe 9K66GKAgusLvRKSD+H3zGLUW8U3ETC61HN7gxl/1me7MCOgx4nP4TuXC1IGc7N04Uy5p/K7CCsv 3m46hhOQ/zOVysQ/z+FfY9DGA3PsDFV5vpg2sI4loFLN5558gsYEPjpded2r/AVynOfpuqed2bX NsNJM/utLP5uFN4rESVP7aXet5+W6chof8bssQP5vH834/eDq3PJrbZ4Ot9Q1iHx9WPiPv9Rw56 JYEYeGXqbn3zlh5nLP8rzUGp2ug5AdD4t/I9Z26eJu6bDuLCkBYk74iepLUVgX9W4DO6oiGh3et GKakHxnLhUun1C5Ol9NCVBaytv0BslRU/Fvw+cX2rIIZ0km5KyWtqiP7Fp65uNlItR2MeaUEDQ3 yloZx1kGhihimd582aexp35/fKD5T1d3yhKR0VFCwxbT9halzluTupdhjEGH+0ZFsekn9ipXO7N AuESTeKZ/orDCQk3U9Z1+5iRkWyT+M7qnMaKqFtveqCTTqKQhVQaCO+cbv92R+RjOruwYCbOgB8 /9W9WeMcY/EDXsuwsJ5c9Hn3lYMIZuQYd2A0dPWG2l+UDTv6P77b/e0AvpSGAfOx92YoEM7oybG +IQmmuEwivE+VvA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493639521158500 Convert the OnOffSplit property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- accel/whpx/whpx-common.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c index 187938c02b51..5d4b405e56d3 100644 --- a/accel/whpx/whpx-common.c +++ b/accel/whpx/whpx-common.c @@ -434,18 +434,12 @@ error: return false; } =20 -static void whpx_set_kernel_irqchip(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_kernel_irqchip(Object *obj, int value, + Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffSplit mode; =20 - if (!visit_type_OnOffSplit(v, name, &mode, errp)) { - return; - } - - switch (mode) { + switch (value) { case ON_OFF_SPLIT_ON: whpx->kernel_irqchip_allowed =3D true; whpx->kernel_irqchip_required =3D true; @@ -463,11 +457,7 @@ static void whpx_set_kernel_irqchip(Object *obj, Visit= or *v, break; =20 default: - /* - * The value was checked in visit_type_OnOffSplit() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 @@ -518,11 +508,12 @@ static void whpx_accel_class_init(ObjectClass *oc, co= nst void *data) ac->pre_resume_vm =3D whpx_pre_resume_vm; ac->allowed =3D &whpx_allowed; =20 - object_class_property_add(oc, "kernel-irqchip", "on|off|split", - NULL, whpx_set_kernel_irqchip, - NULL, NULL); - object_class_property_set_description(oc, "kernel-irqchip", - "Configure WHPX in-kernel irqchip"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "kernel-irqchip", + .qapi_type =3D &OnOffSplit_type_info, + .set =3D whpx_set_kernel_irqchip, + .description =3D "Configure WHPX in-kernel irqchip", + )); object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( .name =3D "hyperv", .description =3D "Configure Hyper-V enlightenments", --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493867; cv=none; d=zohomail.com; s=zohoarc; b=Y4YHVtLMzBkOVNHB/3AhnXBlC7PkM4dx9nkiNKzvFSLkcG2Za5OmQruWwpkz2C5uDt8Y30oUC+/sdugJLtYJNIbj10hbzgGgeiGmal597t9W1N6QSnx7o3OpXuPsPrFOVLwBhGO0g/+UDrwICvU0x2EZhX+JlZ/m5Wv9R4Mk0oc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493867; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=R8vVLHsjEWyiM3GyLmHOx9f7QvIPqbFYRpW6VNEtrF4=; b=jLRwcHGQtZW1sGOulSiw/JGz18WH0tPc7+B6Twecg2zg6KkQQZdRisYGj6Jf6sgqY7Xf19Had6HJ4L367SiyB5AADE12AETqNVOdU3METl6GsRvn2KJsSIAErbk5nTXCwb3YgkDmumBAvQrX+E+rfvf6FL7ru6UNaLRIKIGWUXw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493867616242.48543061103567; Tue, 20 Oct 2026 03:57:47 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455373.1669255 (Exim 4.92) (envelope-from ) id 1xJ7X7-0000nl-Ua; Tue, 20 Oct 2026 10:57:29 +0000 Received: by outflank-mailman (output) from mailman id 1455373.1669255; Tue, 20 Oct 2026 10:57:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7X6-0000gG-Ds; Tue, 20 Oct 2026 10:57:28 +0000 Received: by outflank-mailman (input) for mailman id 1455373; Tue, 20 Oct 2026 10:51:21 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7RB-0000Ih-Fh for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:21 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7RA-00EzNE-SZ for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:20 +0200 Received: from [10.42.69.2] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad747a7-e002-0a2a0a5209dd-0a2a4502edb4-6 for ; Tue, 20 Oct 2026 12:51:20 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad7472f-6ca4-0a2a45020019-aa0a817cd067-3 for ; Tue, 20 Oct 2026 12:49:20 +0200 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-443-LCXPFJilNDyc21HBnDLkMg-1; Tue, 20 Oct 2026 10:49:15 +0000 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 8E0361955BD4; Tue, 20 Oct 2026 10:49:11 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 51BBB18002B1; Tue, 20 Oct 2026 10:49:08 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R8vVLHsjEWyiM3GyLmHOx9f7QvIPqbFYRpW6VNEtrF4=; b=Dq0C0yWnYVZ/Cx04ZWwngqaU/lvTR7rTCu3Y2LlZCeBipOK8drahR2e87jqbeGo0GENNNl jnf1ISCS3yTIMiKqbXKY19MtoyM0fpIiQPgQ1PlQmybTs3xV0Y6272mZ+mzCUcRODyjCJF e4jXAgviV8e6k0wITVm72TFevIy3+nw= X-MC-Unique: LCXPFJilNDyc21HBnDLkMg-1 X-Mimecast-MFC-AGG-ID: LCXPFJilNDyc21HBnDLkMg_1792493351 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:50 +0400 Subject: [PATCH v7 33/65] hw/ppc/spapr_caps: fix property type name MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-33-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=878; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=Qq7OSQxtuwlCseGf35wegvnM5f+EnUrGWd4RRhnAzxw=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZaWeTAuqQ+RlnWisH2RQ0zLCOkC+4rdcGXQ QZYeC6VHiyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWgAKCRDa6OEJdZac 5SEMD/9w84ouUqqiCZ64ZylCbaeUJxtrtqWrrPUGFcC4JDbVpUU7Nct7HZK5iaBsDnqrZURBNr/ 8RtOPyRuf3Q4/lguHW+RKtJ6Jw6sS9784J67RNrbD/EUHDIUOt7QzUVNwflsohDZNJOI9y+5Jnm kQo6SsduyW19qi63LcidGWcAlV/Xhkp7CQCbfFhhsWCCOZImzdzQNYXU5o48Xw0oHdXg8nKkp8o CHqOboRWcyM8r62/Gw1pH4wfJ4FTNQ6cZE+4d9Vig+z5pqWha7vzQllfk7aMxXAmqkXS/vARQoM UXUUZp/aZHyRnnikACNHPNcdFMpXi+1ZumV++RqFqAMt4YSox+qwQ7UscrjDUjEIb5XAOUktB5B VPkm6qZmiK9o23zlZPnbrcOd6Cc/oVEoxtzF/5aGWNPq4xUErMRaj6oZ1O0g3E2Sp17WjDScFl+ 0lzVm3f2Q6znwnFis+4sg7ZlVUeCQv4+0yNa6+YCuJUlOi9rSfQRe9bHmQZvOvqRYdxKhXzWeUP px5zlcXZSRP9vaSQKS4s9yZuJXZyk9Fm+4Tp9UD7LAkNEdD0HnXM4AvsfFojISVCJV9Kog3R+f0 PepoSJr4XZ308R58TgTJ4NL5LlAsuYnr0Pwm+XPXvg1N8aoTb4MS7gKitj+utet5HHJ0ws1tClu dh4Iln1OvPNjzpQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-MFC-PROC-ID: TmiLVO2uMf2EMiQvrSYpTqR_qs6qj7ZiyaocpYtQ5fE_1792493351 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-720697/1792493360-F1CAA2AC-2B8EB8D5/0/0 X-purgate-type: clean X-purgate-size: 880 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493869633158500 The getter/setter use visit_type_size(). Fix the type name mismatch. Reviewed-by: Amit Machhiwal Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/ppc/spapr_caps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index 0d659e9b0251..103b17364feb 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -784,7 +784,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_HPT_MAXPAGESIZE, .get =3D spapr_cap_get_pagesize, .set =3D spapr_cap_set_pagesize, - .type =3D "int", + .type =3D "size", .apply =3D cap_hpt_maxpagesize_apply, .cpu_apply =3D cap_hpt_maxpagesize_cpu_apply, }, --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493877; cv=none; d=zohomail.com; s=zohoarc; b=CFZE43hpG3s0LGvbrfM93JHTspbFazsQRDUcNYqKcARyzLVGAsA4oVEoLZkerdhDdxZUyrV5C+ixedBtSC0gIhLq4CSkoWLJvF+pHUJHP4z94wgvFnNVg+0qGLzs/t1/F+/hZj35i09PLkMUyVaLSLyN7kKXn08XvTtGbuCpmQw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493877; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=G0tJqQA4vjH1OewDrlPPbV755lqj6OJV4iLGYLxe1dQ=; b=RQh6CgKtynorfxTyuDMNjRBsRHE9a+82K8rwkAiZMjmAdQ3D4q2C1uQp89cQlRBuKFWEz0R3CzZ0IxRU3OzUZ1bsBrupmZ7zpdAx/emd+K5yQPzQzUm084c47mOljw8Q8BduGr8ZOOkU44WPHo9ld8u7AAHm+sROvCAgf35eocU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493877878785.6555533608405; Tue, 20 Oct 2026 03:57:57 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455382.1669297 (Exim 4.92) (envelope-from ) id 1xJ7XJ-0003Gz-DU; Tue, 20 Oct 2026 10:57:41 +0000 Received: by outflank-mailman (output) from mailman id 1455382.1669297; Tue, 20 Oct 2026 10:57:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7XH-00038O-RH; Tue, 20 Oct 2026 10:57:39 +0000 Received: by outflank-mailman (input) for mailman id 1455382; Tue, 20 Oct 2026 10:51:28 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7RI-0000LC-1t for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:28 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7RH-00Crub-Eu for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:27 +0200 Received: from [10.42.69.4] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad7479d-2eae-0a2a0a5409dd-0a2a450480cc-44 for ; Tue, 20 Oct 2026 12:51:27 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad74736-b57f-0a2a45040019-aa0a857c9e75-3 for ; Tue, 20 Oct 2026 12:49:27 +0200 Received: from mx-prod-mc-03.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-532-AU63UEb8PQ-MadFO--Yndg-1; Tue, 20 Oct 2026 10:49:20 +0000 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8EE4D1955DE9; Tue, 20 Oct 2026 10:49:16 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1701A418; Tue, 20 Oct 2026 10:49:14 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=G0tJqQA4vjH1OewDrlPPbV755lqj6OJV4iLGYLxe1dQ=; b=M+ZBmkfYHDagIKA6a0QK4yLoimrm2zgmjFSPRWk0GK1/K/o4rcn8/QDeza+mlmLq7Oyl0F rtF88j7+w9ll9ohQWO0171oemcXpW2gE4m3dJrQlgVgWJEF4UtHgyC3+0tPt6L+x27h0tv mQRPKrSDYwcXbUlTX2BNYVRx6Z5Z1MA= X-MC-Unique: AU63UEb8PQ-MadFO--Yndg-1 X-Mimecast-MFC-AGG-ID: AU63UEb8PQ-MadFO--Yndg_1792493356 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:51 +0400 Subject: [PATCH v7 34/65] ppc/spapr-caps: convert to QAPI-aware property registration MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-34-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=6963; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=h0OiLsI4rZp+v/Mhu46aHZ2MeGUSC4RGBbFRwR/fgso=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZafzwZrCef0nnjKmQFgGHI7d1DU4j3tcKg8 rfJ8YYSxbiJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWgAKCRDa6OEJdZac 5ZNiD/9uJkrnfIq0f1AAFb55zRGcmM6E9/bY9PjcQwic7qZwiIF30FoVEyW+LS1V4LBV8lFxJNS PQU7j6R+CB6v9HoMI64E1PyApDwdLlnaHAJlXcyEPUzd2BVafhj1hHbaYhLxkEy1FKLnJgXjLkJ gdIwysLCQIt8EXWXa5PEr9we5qawBjwypQ0Lag+ls7M/dEH/0Kh1uzOi9w8a2krYIDQZcarZN7i E4LtOP390qyqqA6YnMhP59VMT+qvfxHzc/ZQswUOQyZJDTsWt5bsBXzpOFFpbBXuTXpDT9AtofO ID8iow8Lpz1Tszo5kP/m/Lm4S8UWRsm6FmK1PFXmwtWWlyXJh+CUFxiKOxoxpS5FTXbRJGSv05O ZMYDLHTHu8+gadlaJjYgyFbJVyKlNsrAGTmFvM/RU3rpVkTt06dMhmHo8K8rWEYHAwUYB4Ks35l E6S+GJ02O0X284mnQwikHn+fLhcivRrqM+9mynA/bGmrsWZIK4DhT6Cp8zFSPLW47Oshjun/E64 G1PIDvecXY/KRp7V24XZJYFMStRWq10r6lNpi654+g4kT2EsUxLVHwoqsQTcV+XoNk/+hsNx570 AStfbHcS7MyUnY6GxM7Pl2zFwIbukx86j8jruO3yrSjE+v6CcaPGGLJ2oigWATENvOZrnqpgn3Y yk4mypdVxiZikCA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-MFC-PROC-ID: 1cQZwZqz_9-azft6scwSnN05ejfbyioGzpBabvjSL3k_1792493356 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-ebf023/1792493367-C26CAB50-006B6F29/0/0 X-purgate-type: clean X-purgate-size: 6965 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493879885158500 Replace the type string in SpaprCapabilityInfo with a QAPITypeInfo pointer and switch spapr_caps_add_properties() from object_class_property_add() to object_class_property_add_qapi(). Reviewed-by: Amit Machhiwal Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/ppc/spapr_caps.c | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index 103b17364feb..e622c79eb52a 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu/error-report.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "system/hw_accel.h" @@ -59,7 +60,7 @@ typedef struct SpaprCapabilityInfo { /* Getter and Setter Function Pointers */ ObjectPropertyAccessor *get; ObjectPropertyAccessor *set; - const char *type; + const QAPITypeInfo *type; /* Possible values if this is a custom string type */ SpaprCapPossible *possible; /* Make sure the virtual hardware can support this capability */ @@ -725,7 +726,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_HTM, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_htm_apply, }, [SPAPR_CAP_VSX] =3D { @@ -734,7 +735,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_VSX, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_vsx_apply, }, [SPAPR_CAP_DFP] =3D { @@ -743,7 +744,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_DFP, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_dfp_apply, }, [SPAPR_CAP_CFPC] =3D { @@ -752,7 +753,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_CFPC, .get =3D spapr_cap_get_string, .set =3D spapr_cap_set_string, - .type =3D "string", + .type =3D &str_type_info, .possible =3D &cap_cfpc_possible, .apply =3D cap_safe_cache_apply, }, @@ -762,7 +763,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_SBBC, .get =3D spapr_cap_get_string, .set =3D spapr_cap_set_string, - .type =3D "string", + .type =3D &str_type_info, .possible =3D &cap_sbbc_possible, .apply =3D cap_safe_bounds_check_apply, }, @@ -774,7 +775,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_IBS, .get =3D spapr_cap_get_string, .set =3D spapr_cap_set_string, - .type =3D "string", + .type =3D &str_type_info, .possible =3D &cap_ibs_possible, .apply =3D cap_safe_indirect_branch_apply, }, @@ -784,7 +785,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_HPT_MAXPAGESIZE, .get =3D spapr_cap_get_pagesize, .set =3D spapr_cap_set_pagesize, - .type =3D "size", + .type =3D &size_type_info, .apply =3D cap_hpt_maxpagesize_apply, .cpu_apply =3D cap_hpt_maxpagesize_cpu_apply, }, @@ -794,7 +795,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_NESTED_KVM_HV, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_nested_kvm_hv_apply, }, [SPAPR_CAP_NESTED_PAPR] =3D { @@ -803,7 +804,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_NESTED_PAPR, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_nested_papr_apply, }, [SPAPR_CAP_LARGE_DECREMENTER] =3D { @@ -812,7 +813,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_LARGE_DECREMENTER, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_large_decr_apply, .cpu_apply =3D cap_large_decr_cpu_apply, }, @@ -822,7 +823,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_CCF_ASSIST, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_ccf_assist_apply, }, [SPAPR_CAP_FWNMI] =3D { @@ -831,7 +832,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_FWNMI, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_fwnmi_apply, }, [SPAPR_CAP_RPT_INVALIDATE] =3D { @@ -840,7 +841,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_RPT_INVALIDATE, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_rpt_invalidate_apply, }, [SPAPR_CAP_AIL_MODE_3] =3D { @@ -849,7 +850,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_AIL_MODE_3, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_ail_mode_3_apply, }, [SPAPR_CAP_DAWR1] =3D { @@ -858,7 +859,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_DAWR1, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_dawr1_apply, }, }; @@ -1069,9 +1070,9 @@ void spapr_caps_add_properties(SpaprMachineClass *smc) g_autofree char *name =3D g_strdup_printf("cap-%s", cap->name); g_autofree char *desc =3D g_strdup(cap->description); =20 - object_class_property_add(klass, name, cap->type, - cap->get, cap->set, - NULL, cap); + object_class_property_add_qapi(klass, name, cap->type, + cap->get, cap->set, + NULL, cap); =20 object_class_property_set_description(klass, name, desc); } --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493791; cv=none; d=zohomail.com; s=zohoarc; b=K3VdM/GGYIwNTIlbR/FV7uO/CQ9aYmTuqDOKmslx4cZYwQx8eiqv+D8fXOoGzIDXpjiqNVg4U7gdMUMfHEBublcW3FZ7LeZMwDiCtW8NiTqdlVsJc7ps+iQrVf2P7cnJea52NV4JjvkFPqi2IRT+iFogc/QQZhB0OGpyqRgEoAs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493791; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=563WFmKiLO7dqjDqTC7WMPfEiXr6apTsp1OZACEim0s=; b=FduN+azH6ifnuhS3FhFj0oYOP6c1DeqXPh4WGKquoJPUaAe2EXO52Yw2aRRx62F091GCXP1NLeMAit6Ru+7e+ophg7AaM8GK6h+Q6Anr1cUHLa6MUXIgclg2wHYh2WMCeEOM2sBZAbDWYd6zpdtEEGM8TKhwAh9m4HSMLDOSAxs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493791960651.796749364504; Tue, 20 Oct 2026 03:56:31 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455300.1668927 (Exim 4.92) (envelope-from ) id 1xJ7Vv-0002d4-9q; Tue, 20 Oct 2026 10:56:15 +0000 Received: by outflank-mailman (output) from mailman id 1455300.1668927; Tue, 20 Oct 2026 10:56:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Vu-0002Z4-Ry; Tue, 20 Oct 2026 10:56:14 +0000 Received: by outflank-mailman (input) for mailman id 1455300; Tue, 20 Oct 2026 10:49:37 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7PV-0007Pt-Nk for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:49:37 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7PV-002FFo-4b for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:49:37 +0200 Received: from [10.42.69.9] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74737-2eae-0a2a0a5409dd-0a2a4509c02e-16 for ; Tue, 20 Oct 2026 12:49:36 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad7473f-be1a-0a2a45090019-aa0a817cbbe9-3 for ; Tue, 20 Oct 2026 12:49:36 +0200 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-31-cMjt34M1M1KDozVQqfp4-Q-1; Tue, 20 Oct 2026 06:49:25 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 6DEAB18005BC; Tue, 20 Oct 2026 10:49:21 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 88FC91956088; Tue, 20 Oct 2026 10:49:18 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=563WFmKiLO7dqjDqTC7WMPfEiXr6apTsp1OZACEim0s=; b=fDnrM/lx3VpgORToMAsKRUAnQzsIfHPn6VWSwqt2sh2Qk5QS1cWgeSNS2GqhZHKixfBzVR FVIoiRuOMXiXrpuy2YE2p8Af4L4NEX4pzkwYOJY1a93DrKO9vMU631sxEaQwyvngD7FZ9X zn+hnMqJXeeOUFmaqY4EYYldsES6MLA= X-MC-Unique: cMjt34M1M1KDozVQqfp4-Q-1 X-Mimecast-MFC-AGG-ID: cMjt34M1M1KDozVQqfp4-Q_1792493361 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:52 +0400 Subject: [PATCH v7 35/65] net/colo-compare: fix compare_timeout setter visitor type MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-35-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=986; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=ut4iYtgZkRe9PHyTHqoA5Y4P74BD/xuE+aYJ9SkZgtQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZaypTQuRSc2e46naq5h2E43TS8QqJ3WLD4A vhN/XcoCWiJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWgAKCRDa6OEJdZac 5d7uEACx86dNfBKT5U/pKovqIeXYBLYQ//vmgkwdkrPTI4ndp54y3HdcyZ5HRfCgtKdveLHg+jd X+w+YSqBLl5VEUHjm/meu5m+OH+47NHQTNS2OKFtIjrxy/gNQNKipDooyWUZscVjYX1UGThUBNN dVl9HT3PRymM5GJv6gQ6PTVcRkeH0Kxu4oI+1CFyViK6e+5yw9DJwVb5QoOpVeThfgWhFpg3pjL sceKJT9j8XZXVzHbmihcdoYAT3+D7EKFVk1qo0UyOLGA9/8KZOP1HdXhWDgb2qZfH53dKb7Ko8e uEwVXLIXLPEvUgi9lAaQyLh7T+FyJcBCnEEs6xCFzJqne3xq63RvlAKDFKOu/ILq50B/wHxRXFw AjBbG/L64r+z+dli7dfrYX/QYWxXTLKaMrudDjRReACkngn9oQQ6QeuvsTH+PK6E0IORyfozZwd PZX89gASbZR1oNofjZBZlHjuYS4yeBsThEwa4eD7jAxHw81oB1ubcKmEIPILuJUom2AZbAZfx2j +6EZUzt+UOWlN5WSLgBSX4ZnOSrhDJo1RQmsu4JsKh0Pe4hsWUb+I+nUCfKE6aydG/D+MwmW2qS ddEbgTIu+25MUoFBllzZJOwwYkCEgScY2rLSf628Aspu5Mgqq5QEpvfYnAis/PeOgKgX88neUhv FwqeHEUL+SZt/vA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-MFC-PROC-ID: YSO0PXlRKix1fsUgzX3q9yIM4pvQjWXAtORZY3jpXGs_1792493361 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-bad1c0/1792493376-BC2F4034-FC48F7EC/0/0 X-purgate-type: clean X-purgate-size: 988 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493792225158500 The setter was using visit_type_uint32, truncating the value, while the getter and typename use uint64. Use visit_type_uint64 consistently. Fixes: 0c4266ef2690 ("net/colo-compare.c: Fix compare_timeout format issue") Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- net/colo-compare.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 5986fb1e8800..948a2f7f9e4b 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -1075,9 +1075,9 @@ static void compare_set_timeout(Object *obj, Visitor = *v, Error **errp) { CompareState *s =3D COLO_COMPARE(obj); - uint32_t value; + uint64_t value; =20 - if (!visit_type_uint32(v, name, &value, errp)) { + if (!visit_type_uint64(v, name, &value, errp)) { return; } if (!value) { --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493800; cv=none; d=zohomail.com; s=zohoarc; b=KCW+zgyh84U+V6Qrdq0yQCMcjD7DGDvgy86kcAg904RAI/ySZS7sErvkWCc6WBdeoODtXrmhgrdfGZoz2AJTB2BzJI3RxZgdDyh0LL3tUfS59RPMdTzJ7frYC5Cx93COS91jnVkrZxKZRLLz4EF75sxyOaRH240kWXV4/dEZLMA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493800; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0IAJt0UD2BHY2aeJtNI3vxcEoKPgyvku96KOQdFfo40=; b=N2ufRtuqfhYUIlpDgqkO0PX7G3pgwEDOvjjl8b7fDdEtYwp4wVMi8br8GJI5NgpfIVuKuPdN7/7qsJsv6WaJLlqrGaIBSCt0WcqJjVfL0Xizok0tD2Pv4fWcZhZP8HConWYEGKouHps8mh/K4I2MOUsdUg9zCokMoga/TVZYtwU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493800815901.0211409890559; Tue, 20 Oct 2026 03:56:40 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455305.1668953 (Exim 4.92) (envelope-from ) id 1xJ7Vx-0003Fn-Tw; Tue, 20 Oct 2026 10:56:17 +0000 Received: by outflank-mailman (output) from mailman id 1455305.1668953; Tue, 20 Oct 2026 10:56:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Vx-0003AJ-9H; Tue, 20 Oct 2026 10:56:17 +0000 Received: by outflank-mailman (input) for mailman id 1455305; Tue, 20 Oct 2026 10:50:38 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7QU-0008RA-Kh for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:50:38 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7QU-00CvYD-1M for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:50:38 +0200 Received: from [10.42.69.12] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad7476d-bab6-0a2a0a5309dd-0a2a450ca39a-30 for ; Tue, 20 Oct 2026 12:50:38 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad74740-f479-0a2a450c0019-aa0a857ccd51-3 for ; Tue, 20 Oct 2026 12:49:37 +0200 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-692-f6pkGtb9O-GKxmFhJLnr0g-1; Tue, 20 Oct 2026 10:49:33 +0000 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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 96BF018011E7; Tue, 20 Oct 2026 10:49:29 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 07CCA418; Tue, 20 Oct 2026 10:49:24 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0IAJt0UD2BHY2aeJtNI3vxcEoKPgyvku96KOQdFfo40=; b=H7ZrEHKdzz68TWuYsdgHagkcKbQxkCBIwiD7+9bunZJ45w0cUzRT8zVV1c3G9p75AAp7WQ T7bbBL3/PReTdz1tCir39/t5pBGimpjvBDvw1bWV/YW/Wc+AGHVJ1pQAhTwl7ssy/jM9CX X0XYMo3u0biEqJSuQDdCD/slsK3hL5U= X-MC-Unique: f6pkGtb9O-GKxmFhJLnr0g-1 X-Mimecast-MFC-AGG-ID: f6pkGtb9O-GKxmFhJLnr0g_1792493369 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:53 +0400 Subject: [PATCH v7 36/65] net/colo-compare: fix max_queue_size setter visitor type MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-36-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1019; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=2Ht6gW7AXC+9m2hyIj3XjReAS0cmbqbO/nhhR3s10ik=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZaBju/eY1bBbqeZbyaaIna3yDT1YO5S2ZfK Dk+TjopPr+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWgAKCRDa6OEJdZac 5dQZD/9+OPsZ+9wdTvZlJAHJ8LdZ+1IrTm8SRc4WfgMoVaUgmxvUmArgHB8hI32zhhT+Ba88j5h KVa4ATUp8pq0eFWpUQQliSGEcG8IcvbDzwCdXHlbCyx1nenDacuX0x1Xzy6lOPsZkDaLW4sd1av aslU4lzEjPo+woZOS+f31o8bS96Uj4DK9zSO/2jZS60JmsZVWU2RuRFsQ4ynCztQC5WVe561WiF Neo8iP9N1N6jRWQ/W9lDjOjhSLPfoogGEELTAUdypajGDPuGgyGOUNHGrXgAoT6RZ9LSPkaXi9M YVb+sG/RbGXWjlrdd/CFkcXWKmRvs4HZYOoCxI3XLPjngyKh4mXKogIvBPZkZyD1Mc01f37OWJJ Z601T1TKyOwOevdMSa3zjfTSInCHXtBGcfygNJ1EHaIfbfspA5GBA6TYOD34MkYVQ7Xo0EMeDYd ZIRp02UPolMQALQO0ANg3mVOP62D3BNsyhxHxlfjumfHsGoGYZ6mHjkjkO/PzHDEye+BfFcPcE1 op8EVu1uAVHHecAerzTbPZ2xi8hfaVgovOLMJe0DIozxp7l06V9c+bbZegHgr1qr0kr+5Z1dy+b cGCIdsvGHbP8dorXb8/DNE5clHvwjDTMX8mVMgxx/XbT5GQClDJRTRj2mTFy/Cr8znwahtft6UL 2RCiOOUs4aDYIGg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-MFC-PROC-ID: t2UDmA5Ri04ASnUKEJ0mPmk-iyUtk1Qg-GnqhxDfmK8_1792493369 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-d25034/1792493377-52331A5B-2042A45C/0/0 X-purgate-type: clean X-purgate-size: 1021 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493802442158501 The setter was using visit_type_uint64, accepting values wider than the uint32_t field. Use visit_type_uint32 to match the getter, field, and typename. Fixes: 0c4266ef2690 ("net/colo-compare.c: Fix compare_timeout format issue") Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- net/colo-compare.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 948a2f7f9e4b..a6910de869ff 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -1129,9 +1129,9 @@ static void set_max_queue_size(Object *obj, Visitor *= v, const char *name, void *opaque, Error **errp) { - uint64_t value; + uint32_t value; =20 - if (!visit_type_uint64(v, name, &value, errp)) { + if (!visit_type_uint32(v, name, &value, errp)) { return; } if (!value) { --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493804; cv=none; d=zohomail.com; s=zohoarc; b=iMIugjBKmZNTIrANxS1R7AwmcwJrYG/XCTj31ak0SMFBQWpB2jCYwaMdKI4D8WU5UQJCJsCzKH9kE7aHl8wTRbijFekh8Fav+Wl6G4a4CxDAHP844RzI+oArEv2DZ/y6G7hMj2YaFeSwzBabEYnXVnN7GRCLh/DEyWpSOTRu0UM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493804; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pJsKiDwP7cQjHHYkeJJ5It1m2SB+6i/Xk0ZLXrFcWgM=; b=DSdMMBeAQpN3droYPf8nYhg0HQ5DCPaFRZJoUthCX24arbnsxr0fNPPoR+cA10xpXJo8VCmFLcG0vSvwBawTsoGUnX4fGYgM3X6lzJs8oC1Wp4q9Rr04FsKnPsq6sDmuKHetbFIuFy2oT140G6ajgW/vCWQsco6/OTl+wi1nzEw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 179249380426445.496895474446774; Tue, 20 Oct 2026 03:56:44 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455311.1668978 (Exim 4.92) (envelope-from ) id 1xJ7W2-00049o-Bt; Tue, 20 Oct 2026 10:56:22 +0000 Received: by outflank-mailman (output) from mailman id 1455311.1668978; Tue, 20 Oct 2026 10:56:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7W1-00043p-D0; Tue, 20 Oct 2026 10:56:21 +0000 Received: by outflank-mailman (input) for mailman id 1455311; Tue, 20 Oct 2026 10:50:42 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7QY-0008T2-Af for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:50:42 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7QX-004d16-NY for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:50:41 +0200 Received: from [10.42.69.11] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74765-8faa-0a2a0a5109dd-0a2a450b8d4a-48 for ; Tue, 20 Oct 2026 12:50:41 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad74744-b7e8-0a2a450b0019-aa0a817cc801-3 for ; Tue, 20 Oct 2026 12:49:41 +0200 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-533-OoWhFoGcPlaWpGKQnrYdqg-1; Tue, 20 Oct 2026 10:49:38 +0000 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 DEDA7180056E; Tue, 20 Oct 2026 10:49:34 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F20721956095; Tue, 20 Oct 2026 10:49:31 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pJsKiDwP7cQjHHYkeJJ5It1m2SB+6i/Xk0ZLXrFcWgM=; b=BLQHVwSP4y4yzoziJP2D0gjyTzL+idpS0aU1x4+ElIIkjLX63goWhyZ4XHfWKbps/inmX4 rno6TW/C4lKJzW3t0FnT0TpTZjiAcMbwB3KE7gEXa56L6D0GVFnmd/JNUBWG30uGc+y9KI 5ddxpKlNqRk2K2yzw4ZiRaE8lBBBZ9A= X-MC-Unique: OoWhFoGcPlaWpGKQnrYdqg-1 X-Mimecast-MFC-AGG-ID: OoWhFoGcPlaWpGKQnrYdqg_1792493375 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:54 +0400 Subject: [PATCH v7 37/65] hw/misc/xlnx-versal-trng: add missing getter for fips-fault-events MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-37-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1222; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=2e+J+3h+NUPhMCTdhI0KGfNu+o02kfLWSTEk2RShPvY=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZaaRUiZcgxP4oeKcbE8gs+UJl28BKoajpQ9 8TC/3Dz3TSJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWgAKCRDa6OEJdZac 5XzVD/4vu1/c4/2gcCv9WZzxVogHqWbTFYkuxZ02zog+1m/pXb+X9tvwReTfeI9FydQAbiZpvId gteOK6+wAlg83zfJniCoLV7jtP+dM5FXb46UnupVcgv/SpBK4D2RejZAEufi29iApBO2oMfn9MA 3gfevxd7THNtXegKa7wKxruBeVPEYPFhEync0+DH6wgg9EKaD4+GFKqqZ1aFNfaCLt7UzUsP7Io b9+cbToEVKKLoDEBVL7pnuO/RzwrBYxdHtsto9XcDx8y4g00K8cmochz1vpOtUh1O6/aPjsDzwK lKyeCMpsv+EwbyDSx+RRGeRZoQL3XRTFUrpQmhchGFQcMAfKsHMqjtEKGrCcBGzulk4EhNmKESi edlb7NLs0r0skfsaaxWorKW1rpeiTEEy7alnw7IdbIUqKy3rnu3rveuxXewnTcB5bnsDrNxwMVM RJ1A+85E1foSNRMRMPCuJRAvBFVzYYCaInFNaD07ePzVfR7vR1R636oNhc5efIWcOKbTVs3dJXz FKOIZkVWdXxVmQbuvftuGvvca4rYARfHdC0A54iqWotUPHpfdcW7NJx6aWHAQ7T4HiH7zy6MznP 41E815xj58W8vZEWWlZSmcwXiUWFv7br2GVoiGXDN/GV9hh7gLgW1P2qn3CFsh0+V4JLm81THXE KiNpEqL9FN+vZmA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-MFC-PROC-ID: JS-yoMsrphmC7hWTtUOO9oIwz0MOA-XNXFfl1Hp0gWk_1792493375 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-42698a/1792493381-2C59A9EA-E1C400D4/0/0 X-purgate-type: clean X-purgate-size: 1224 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493806500158500 Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/misc/xlnx-versal-trng.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/misc/xlnx-versal-trng.c b/hw/misc/xlnx-versal-trng.c index aa1d65de7b70..0584ee089e3c 100644 --- a/hw/misc/xlnx-versal-trng.c +++ b/hw/misc/xlnx-versal-trng.c @@ -650,10 +650,22 @@ static void trng_prop_fault_event_set(Object *obj, Vi= sitor *v, trng_fault_event_set(XLNX_VERSAL_TRNG(obj), *events); } =20 +static void trng_prop_fault_event_get(Object *obj, Visitor *v, + const char *name, + void *opaque, + Error **errp) +{ + const Property *prop =3D opaque; + uint32_t *events =3D object_field_prop_ptr(obj, prop); + + visit_type_uint32(v, name, events, errp); +} + static const PropertyInfo trng_prop_fault_events =3D { .type =3D "uint32", .description =3D "Set to trigger TRNG fault events", .set =3D trng_prop_fault_event_set, + .get =3D trng_prop_fault_event_get, .realized_set_allowed =3D true, }; =20 --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493818; cv=none; d=zohomail.com; s=zohoarc; b=dkIhvl7kYhd4CMDutI1j7xKLt1k1Hp2r45s/iuZKloY4DMqgbs8x8RDchEH7FMdTm9wmXTJfO2ozR55oqOxiE3b5I4AL9W/XYB+FQJO+weKqRSytSnRXYO3VwZozlovqWOrb2PDk9J9IUD2GQSriyuNxO3SZIpSUP/bhgugZsbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493818; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eVX3ZvHEwBSXNYOzSbNt3BOZCjs1Nmjrz4zkatMYBkU=; b=e1+MTPS8jvjgdsCOf0+mqj9Q3VthH+QL2S6oGlr8uPckXgnF7z6ixynY70KooVnaObpDt5jgeFOB1WgnkpQpS/zWLAMUevyQMVYvgTVHIz3EujDzrxNc6+ZchYdtNmaIK1du1FSs+PdIeRLfTXXzfn/pIkMnr2XqSjhEUJw6Zzo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792493818400278.21648961567246; Tue, 20 Oct 2026 03:56:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7QY-0007te-2I; Tue, 20 Oct 2026 06:50:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Po-0005SP-2B for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:49:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Pi-0005rl-0G for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:49:55 -0400 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-117-XUXv77GHO2OCTyQEVcEWJg-1; Tue, 20 Oct 2026 06:49:45 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 3B1F418011E7; Tue, 20 Oct 2026 10:49:41 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1CB63195608C; Tue, 20 Oct 2026 10:49:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eVX3ZvHEwBSXNYOzSbNt3BOZCjs1Nmjrz4zkatMYBkU=; b=DMbvYzi4kxDNZersoh9WJvgV5DA2ucWZmeNUYnvgOUSxk3mZQXK/I2quJwmTV/j5abcjYu 3onjaKdN3xKFctvs1dYb3mBoS+RhNNol9lPZ3a7SeWWgJSS+ov5uybUVoquOesvBW/HH3q d6osQFNW0dpAdbQ543IsjXyh/L67qz4= X-MC-Unique: XUXv77GHO2OCTyQEVcEWJg-1 X-Mimecast-MFC-AGG-ID: XUXv77GHO2OCTyQEVcEWJg_1792493381 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:55 +0400 Subject: [PATCH v7 38/65] qom: convert scalar properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-38-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=108660; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=1zdoLwB5ecSZAOO1VVlwa1bcSEdnAj2iT7iIGMQmjQI=; b=kA0DAAoB2ujhCXWWnOUByyZiAGrXRlug7fU4tcjGQ3ZxPTnQv47jZ4pm1Upu65UQZYx4q2LyX 4kCMwQAAQoAHRYhBIepvZM/h8YG0nb2Ldro4Ql1lpzlBQJq10ZbAAoJENro4Ql1lpzlRpUQAJOE 23fi4vI9nH+/CLvpSC11JRPuhf1vH6nL/qoCGl7PRC02AfW9rh9dE58JN2nICu/RCzlVNNzjFgE l8wwCwqlkoIQrnwY69hYr7ogAcNKmd5U2MZl5dhGPE0o0BiXNSqAdN+sbqoddy0/6glYWBTD+3+ QFx9KUiYOLrobwBKKw3lefiYxWcL3xds0MQ0AiMCxc91rljgd/q8JmNABVabbuoXAP4kHbZtGCJ LTwGEUEZFEfVy6Gkh1ZxAwRWog7NX9XQuODji6k+WJGL1Mm+0zLK/lkMmDF6oUFeGu/PAnyso/n Sk549aGfT+IbDWNM/rIwRnUY6p5yOJv50F0lAviXB0GtTRjKKG/Q/mkhCr2xu+Ce7TejKG3jmZh hHg7OWJdvp69PJP3J5EbyVWA+9KHaZahNNfBHtFLZ2kBIuSH5i29hZxTO/52/RtiyOQPv5pBObV iyJ7vaelDLq7PuoOzAbspq2Mwh328NfY5M2sdL/9mco2je6BFlb8+sYmFpUllV4/w+j2ujETL5e oklsO1Lc/dXjPkNz2bWGTw7aDVHRfrSsEmwB8qNbEJUhkujo2wORZKktaoYamHIEPLhSyhk3xOQ XczODyC4xAAyzdEGcIROtfsTZu1BlsY+gOcDTW0h36kQv9Gj1y4jjr35A2NWiKSxT+CYe3s7qfC PNU3Y X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493818752158500 Reviewed-by: Amit Machhiwal Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- accel/kvm/kvm-all.c | 5 ++- accel/nitro/nitro-accel.c | 3 +- accel/tcg/tcg-all.c | 3 +- backends/cryptodev.c | 7 ++-- backends/hostmem-file.c | 4 +- backends/hostmem-memfd.c | 3 +- backends/hostmem.c | 6 +-- block/throttle-groups.c | 5 ++- crypto/secret_keyring.c | 9 +++-- event-loop-base.c | 7 ++-- hw/acpi/ich9.c | 1 + hw/acpi/pci.c | 7 ++-- hw/arm/virt.c | 4 +- hw/core/clock.c | 3 +- hw/core/machine.c | 2 +- hw/cpu/core.c | 10 +++-- hw/cxl/cxl-host.c | 2 +- hw/gpio/aspeed_gpio.c | 5 ++- hw/gpio/aspeed_sgpio.c | 3 +- hw/gpio/stm32l4x5_gpio.c | 5 ++- hw/i386/pc.c | 6 +-- hw/i386/sgx-epc.c | 10 +++-- hw/i386/x86.c | 6 +-- hw/ide/ide-dev.c | 3 +- hw/intc/apic_common.c | 3 +- hw/loongarch/virt.c | 2 +- hw/mem/nvdimm.c | 7 ++-- hw/mem/pc-dimm.c | 3 +- hw/misc/aspeed_lpc.c | 73 +++++++++++++++++++++++++--------= ---- hw/misc/aspeed_sdmc.c | 3 +- hw/misc/npcm7xx_mft.c | 3 +- hw/net/ne2000-isa.c | 3 +- hw/nvme/ctrl.c | 3 +- hw/pci-bridge/pci_expander_bridge.c | 3 +- hw/pci-host/i440fx.c | 29 +++++++++------ hw/pci-host/pnv_phb3.c | 5 ++- hw/pci-host/pnv_phb4.c | 5 ++- hw/pci-host/q35.c | 9 +++-- hw/ppc/spapr_drc.c | 3 +- hw/riscv/microchip_pfsoc.c | 3 +- hw/s390x/sclpcpi.c | 8 ++-- hw/s390x/virtio-ccw-mem.c | 3 +- hw/sensor/adc128d818.c | 16 +++++--- hw/sensor/adm1266.c | 3 +- hw/sensor/adm1272.c | 9 +++-- hw/sensor/emc141x.c | 9 +++-- hw/sensor/isl_pmbus_vr.c | 19 +++++----- hw/sensor/lsm303dlhc_mag.c | 9 +++-- hw/sensor/max34451.c | 5 ++- hw/sensor/tmp105.c | 3 +- hw/sensor/tmp421.c | 9 +++-- hw/usb/dev-storage-classic.c | 3 +- hw/virtio/virtio-balloon.c | 3 +- hw/virtio/virtio-mem-pci.c | 3 +- hw/virtio/virtio-mem.c | 18 +++++---- hw/xen/xen-pvh-common.c | 9 +++-- iothread.c | 9 +++-- net/colo-compare.c | 7 ++-- net/dump.c | 6 ++- net/filter-buffer.c | 3 +- qom/object.c | 42 ++++++++++----------- system/bootdevice.c | 3 +- system/memory.c | 5 ++- target/arm/cpu64.c | 11 +++--- target/arm/kvm.c | 3 +- target/arm/tcg/cpu64.c | 11 +++--- target/i386/cpu.c | 12 +++--- target/i386/kvm/kvm.c | 8 ++-- target/i386/sev.c | 2 +- target/ppc/compat.c | 3 +- target/riscv/cpu.c | 15 ++++---- target/riscv/kvm/kvm-cpu.c | 7 ++-- target/riscv/tcg/tcg-cpu.c | 13 ++++--- target/s390x/cpu_models.c | 5 ++- tests/unit/test-qdev-global-props.c | 11 ++++-- ui/console.c | 3 +- util/thread-context.c | 7 ++-- 77 files changed, 347 insertions(+), 244 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 1d91667fb880..bc178482b309 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -24,6 +24,7 @@ #include "qemu/config-file.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "hw/pci/msi.h" #include "hw/pci/msix.h" #include "hw/s390x/adapter.h" @@ -4303,13 +4304,13 @@ static void kvm_accel_class_init(ObjectClass *oc, c= onst void *data) .description =3D "Configure KVM in-kernel irqchip", )); =20 - object_class_property_add(oc, "kvm-shadow-mem", "int", + object_class_property_add_qapi(oc, "kvm-shadow-mem", &int_type_info, kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_mem, NULL, NULL); object_class_property_set_description(oc, "kvm-shadow-mem", "KVM shadow MMU size"); =20 - object_class_property_add(oc, "dirty-ring-size", "uint32", + object_class_property_add_qapi(oc, "dirty-ring-size", &uint32_type_inf= o, kvm_get_dirty_ring_size, kvm_set_dirty_ring_size, NULL, NULL); object_class_property_set_description(oc, "dirty-ring-size", diff --git a/accel/nitro/nitro-accel.c b/accel/nitro/nitro-accel.c index a1e97a9162e9..05841c1277dc 100644 --- a/accel/nitro/nitro-accel.c +++ b/accel/nitro/nitro-accel.c @@ -29,6 +29,7 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qemu/rcu.h" @@ -238,7 +239,7 @@ static void nitro_accel_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, "debug-mode", "Start enclave in debug mode (enables console output)"); =20 - object_class_property_add(oc, "enclave-cid", "uint64", + object_class_property_add_qapi(oc, "enclave-cid", &uint64_type_info, nitro_get_enclave_cid, nitro_set_enclave_cid, NULL, NULL); diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 767e8805552f..277cf0e2d012 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -29,6 +29,7 @@ #include "exec/icount.h" #include "tcg/startup.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/error-report.h" #include "qemu/accel.h" #include "qemu/atomic.h" @@ -270,7 +271,7 @@ static void tcg_accel_class_init(ObjectClass *oc, const= void *data) tcg_get_thread, tcg_set_thread); =20 - object_class_property_add(oc, "tb-size", "uint32", + object_class_property_add_qapi(oc, "tb-size", &uint32_type_info, tcg_get_tb_size, tcg_set_tb_size, NULL, NULL); object_class_property_set_description(oc, "tb-size", diff --git a/backends/cryptodev.c b/backends/cryptodev.c index e8f2b18f2017..a69adb70440c 100644 --- a/backends/cryptodev.c +++ b/backends/cryptodev.c @@ -25,6 +25,7 @@ #include "system/cryptodev.h" #include "system/stats.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-commands-cryptodev.h" #include "qapi/qapi-types-stats.h" #include "qapi/visitor.h" @@ -622,15 +623,15 @@ cryptodev_backend_class_init(ObjectClass *oc, const v= oid *data) ucc->prepare_delete =3D cryptodev_backend_prepare_delete; =20 QTAILQ_INIT(&crypto_clients); - object_class_property_add(oc, "queues", "uint32", + object_class_property_add_qapi(oc, "queues", &uint32_type_info, cryptodev_backend_get_queues, cryptodev_backend_set_queues, NULL, NULL); - object_class_property_add(oc, "throttle-bps", "uint64", + object_class_property_add_qapi(oc, "throttle-bps", &uint64_type_info, cryptodev_backend_get_bps, cryptodev_backend_set_bps, NULL, NULL); - object_class_property_add(oc, "throttle-ops", "uint64", + object_class_property_add_qapi(oc, "throttle-ops", &uint64_type_info, cryptodev_backend_get_ops, cryptodev_backend_set_ops, NULL, NULL); diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 7d4d52482966..46646115713e 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -275,11 +275,11 @@ file_backend_class_init(ObjectClass *oc, const void *= data) file_memory_backend_get_discard_data, file_memory_backend_set_disc= ard_data); object_class_property_add_str(oc, "mem-path", get_mem_path, set_mem_path); - object_class_property_add(oc, "align", "uint64", + object_class_property_add_qapi(oc, "align", &uint64_type_info, file_memory_backend_get_align, file_memory_backend_set_align, NULL, NULL); - object_class_property_add(oc, "offset", "int", + object_class_property_add_qapi(oc, "offset", &int_type_info, file_memory_backend_get_offset, file_memory_backend_set_offset, NULL, NULL); diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index 666593ff6c0b..fcd51680cd64 100644 --- a/backends/hostmem-memfd.c +++ b/backends/hostmem-memfd.c @@ -16,6 +16,7 @@ #include "qemu/memfd.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qom/object.h" #include "migration/cpr.h" #include "system/kvm.h" @@ -195,7 +196,7 @@ memfd_backend_class_init(ObjectClass *oc, const void *d= ata) memfd_backend_set_hugetlb); object_class_property_set_description(oc, "hugetlb", "Use huge pages"); - object_class_property_add(oc, "hugetlbsize", "uint64", + object_class_property_add_qapi(oc, "hugetlbsize", &uint64_type_inf= o, memfd_backend_get_hugetlbsize, memfd_backend_set_hugetlbsize, NULL, NULL); diff --git a/backends/hostmem.c b/backends/hostmem.c index edb8e6ab4502..45a2ea6ef174 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -529,7 +529,7 @@ host_memory_backend_class_init(ObjectClass *oc, const v= oid *data) host_memory_backend_set_prealloc); object_class_property_set_description(oc, "prealloc", "Preallocate memory"); - object_class_property_add(oc, "prealloc-threads", "int", + object_class_property_add_qapi(oc, "prealloc-threads", &int_type_info, host_memory_backend_get_prealloc_threads, host_memory_backend_set_prealloc_threads, NULL, NULL); @@ -540,13 +540,13 @@ host_memory_backend_class_init(ObjectClass *oc, const= void *data) object_property_allow_set_link, OBJ_PROP_LINK_STRONG); object_class_property_set_description(oc, "prealloc-context", "Context to use for creating CPU threads for preallocation"); - object_class_property_add(oc, "size", "size", + object_class_property_add_qapi(oc, "size", &size_type_info, host_memory_backend_get_size, host_memory_backend_set_size, NULL, NULL); object_class_property_set_description(oc, "size", "Size of the memory region (ex: 500M)"); - object_class_property_add(oc, "host-nodes", "[uint16]", + object_class_property_add_qapi(oc, "host-nodes", &uint16List_type_info, host_memory_backend_get_host_nodes, host_memory_backend_set_host_nodes, NULL, NULL); diff --git a/block/throttle-groups.c b/block/throttle-groups.c index 987867477acc..c0f24ad91e42 100644 --- a/block/throttle-groups.c +++ b/block/throttle-groups.c @@ -31,6 +31,7 @@ #include "qemu/thread.h" #include "system/qtest.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-type-infos-block-core.h" #include "qapi/qapi-visit-block-core.h" #include "qom/object.h" @@ -985,9 +986,9 @@ static void throttle_group_obj_class_init(ObjectClass *= klass, =20 /* individual properties */ for (i =3D 0; i < sizeof(properties) / sizeof(ThrottleParamInfo); i++)= { - object_class_property_add(klass, + object_class_property_add_qapi(klass, properties[i].name, - "int64", + &int64_type_info, throttle_group_get, throttle_group_set, NULL, &properties[i]); diff --git a/crypto/secret_keyring.c b/crypto/secret_keyring.c index 3b332276ef5b..6ac7cd6a232d 100644 --- a/crypto/secret_keyring.c +++ b/crypto/secret_keyring.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include #include +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/error.h" #include "qom/object_interfaces.h" #include "trace.h" @@ -107,10 +108,10 @@ qcrypto_secret_keyring_class_init(ObjectClass *oc, co= nst void *data) QCryptoSecretCommonClass *sic =3D QCRYPTO_SECRET_COMMON_CLASS(oc); sic->load_data =3D qcrypto_secret_keyring_load_data; =20 - object_class_property_add(oc, "serial", "int32_t", - qcrypto_secret_prop_get_key, - qcrypto_secret_prop_set_key, - NULL, NULL); + object_class_property_add_qapi(oc, "serial", &int32_type_info, + qcrypto_secret_prop_get_key, + qcrypto_secret_prop_set_key, + NULL, NULL); } =20 =20 diff --git a/event-loop-base.c b/event-loop-base.c index 23f554d92ce8..c16c5366f680 100644 --- a/event-loop-base.c +++ b/event-loop-base.c @@ -14,6 +14,7 @@ #include "qemu/osdep.h" #include "qom/object_interfaces.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "block/thread-pool.h" #include "system/event-loop-base.h" =20 @@ -104,15 +105,15 @@ static void event_loop_base_class_init(ObjectClass *k= lass, ucc->complete =3D event_loop_base_complete; ucc->prepare_delete =3D event_loop_base_prepare_delete; =20 - object_class_property_add(klass, "aio-max-batch", "int64", + object_class_property_add_qapi(klass, "aio-max-batch", &int64_type_inf= o, event_loop_base_get_param, event_loop_base_set_param, NULL, &aio_max_batch_info); - object_class_property_add(klass, "thread-pool-min", "int64", + object_class_property_add_qapi(klass, "thread-pool-min", &int64_type_i= nfo, event_loop_base_get_param, event_loop_base_set_param, NULL, &thread_pool_min_info); - object_class_property_add(klass, "thread-pool-max", "int64", + object_class_property_add_qapi(klass, "thread-pool-max", &int64_type_i= nfo, event_loop_base_get_param, event_loop_base_set_param, NULL, &thread_pool_max_info); diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 6d421b990cef..64228a620e69 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -26,6 +26,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/pci/pci.h" #include "migration/vmstate.h" diff --git a/hw/acpi/pci.c b/hw/acpi/pci.c index c82924be8620..71d01307e141 100644 --- a/hw/acpi/pci.c +++ b/hw/acpi/pci.c @@ -27,6 +27,7 @@ #include "qemu/error-report.h" #include "qom/object_interfaces.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "hw/core/boards.h" #include "hw/acpi/aml-build.h" #include "hw/acpi/pci.h" @@ -139,7 +140,7 @@ static void acpi_generic_initiator_class_init(ObjectCla= ss *oc, const void *data) acpi_generic_initiator_set_pci_device); object_class_property_set_description(oc, "pci-dev", "PCI device to associate with the node"); - object_class_property_add(oc, "node", "uint32", NULL, + object_class_property_add_qapi(oc, "node", &uint32_type_info, NULL, acpi_generic_initiator_set_node, NULL, NULL); object_class_property_set_description(oc, "node", "NUMA node associated with the PCI device"); @@ -253,8 +254,8 @@ static void acpi_generic_port_class_init(ObjectClass *o= c, const void *data) acpi_generic_port_set_pci_bus); object_class_property_set_description(oc, "pci-bus", "PCI Bus of the host bridge associated with this GP affinity struct= ure"); - object_class_property_add(oc, "node", "uint32", NULL, - acpi_generic_port_set_node, NULL, NULL); + object_class_property_add_qapi(oc, "node", &uint32_type_info, NULL, + acpi_generic_port_set_node, NULL, NULL); object_class_property_set_description(oc, "node", "The NUMA node like ID to index HMAT/SLIT NUMA properties involving= GP"); } diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 0da10b799cfb..2fa728b99e08 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -4257,7 +4257,7 @@ static void virt_machine_class_init(ObjectClass *oc, = const void *data) "Set on/off to enable/disable hi= gh " "memory region for PCI MMIO"); =20 - object_class_property_add(oc, "highmem-mmio-size", "size", + object_class_property_add_qapi(oc, "highmem-mmio-size", &size_type_inf= o, virt_get_highmem_mmio_size, virt_set_highmem_mmio_size, NULL, NULL); @@ -4265,7 +4265,7 @@ static void virt_machine_class_init(ObjectClass *oc, = const void *data) "Set the high memory region size= " "for PCI MMIO"); =20 - object_class_property_add(oc, "virtio-mmio-transports", "uint8", + object_class_property_add_qapi(oc, "virtio-mmio-transports", &uint8_ty= pe_info, virt_get_virtio_transports, virt_set_virtio_transports, NULL, NULL); diff --git a/hw/core/clock.c b/hw/core/clock.c index 3fc98a0c65d5..f55cb17af77e 100644 --- a/hw/core/clock.c +++ b/hw/core/clock.c @@ -13,6 +13,7 @@ =20 #include "qemu/osdep.h" #include "qemu/cutils.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "system/qtest.h" #include "hw/core/clock.h" @@ -185,7 +186,7 @@ static void clock_initfn(Object *obj) QLIST_INIT(&clk->children); =20 if (qtest_enabled()) { - object_property_add(obj, "qtest-clock-period", "uint64", + object_property_add_qapi(obj, "qtest-clock-period", &uint64_type_i= nfo, clock_period_prop_get, NULL, NULL, NULL); } } diff --git a/hw/core/machine.c b/hw/core/machine.c index 94737e17e66f..7272944f30a2 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1137,7 +1137,7 @@ static void machine_class_init(ObjectClass *oc, const= void *data) object_class_property_set_description(oc, "smp-cache", "Cache properties list for SMP machine"); =20 - object_class_property_add(oc, "phandle-start", "int", + object_class_property_add_qapi(oc, "phandle-start", &int_type_info, machine_get_phandle_start, machine_set_phandle_start, NULL, NULL); object_class_property_set_description(oc, "phandle-start", diff --git a/hw/cpu/core.c b/hw/cpu/core.c index 26e488f3d8e3..d7c89f47ab04 100644 --- a/hw/cpu/core.c +++ b/hw/cpu/core.c @@ -12,6 +12,7 @@ #include "hw/core/boards.h" #include "hw/cpu/core.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" =20 static void core_prop_get_core_id(Object *obj, Visitor *v, const char *nam= e, @@ -82,10 +83,11 @@ static void cpu_core_class_init(ObjectClass *oc, const = void *data) DeviceClass *dc =3D DEVICE_CLASS(oc); =20 set_bit(DEVICE_CATEGORY_CPU, dc->categories); - object_class_property_add(oc, "core-id", "int", core_prop_get_core_id, - core_prop_set_core_id, NULL, NULL); - object_class_property_add(oc, "nr-threads", "int", core_prop_get_nr_th= reads, - core_prop_set_nr_threads, NULL, NULL); + object_class_property_add_qapi(oc, "core-id", &int_type_info, core_pro= p_get_core_id, + core_prop_set_core_id, NULL, NULL); + object_class_property_add_qapi(oc, "nr-threads", &int_type_info, + core_prop_get_nr_threads, core_prop_set= _nr_threads, + NULL, NULL); } =20 static const TypeInfo cpu_core_type_info =3D { diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index 8997bf1785c8..326a1eda69ac 100644 --- a/hw/cxl/cxl-host.c +++ b/hw/cxl/cxl-host.c @@ -611,7 +611,7 @@ static void machine_set_cfmw(Object *obj, Visitor *v, c= onst char *name, =20 void cxl_machine_init(Object *obj, CXLState *state) { - object_property_add(obj, "cxl", "bool", machine_get_cxl, + object_property_add_qapi(obj, "cxl", &bool_type_info, machine_get_cxl, machine_set_cxl, NULL, state); object_property_set_description(obj, "cxl", "Set on/off to enable/disable " diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c index 1cf6f5df5505..0c90bcd723da 100644 --- a/hw/gpio/aspeed_gpio.c +++ b/hw/gpio/aspeed_gpio.c @@ -12,6 +12,7 @@ #include "hw/gpio/aspeed_gpio.h" #include "hw/misc/aspeed_scu.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/irq.h" #include "migration/vmstate.h" @@ -1481,7 +1482,7 @@ static void aspeed_gpio_init(Object *obj) int pin_idx =3D j % GPIOS_PER_GROUP; const char *group =3D &props->group_label[group_idx][0]; char *name =3D g_strdup_printf("gpio%s%d", group, pin_idx); - object_property_add(obj, name, "bool", aspeed_gpio_get_pin, + object_property_add_qapi(obj, name, &bool_type_info, aspeed_gp= io_get_pin, aspeed_gpio_set_pin, NULL, NULL); g_free(name); } @@ -1489,7 +1490,7 @@ static void aspeed_gpio_init(Object *obj) =20 for (int i =3D 0; i < agc->nr_gpio_sets; i++) { g_autofree char *name =3D g_strdup_printf("gpio-set[%d]", i); - object_property_add(obj, name, "uint32", aspeed_gpio_get_set, + object_property_add_qapi(obj, name, &uint32_type_info, aspeed_gpio= _get_set, aspeed_gpio_set_set, NULL, NULL); } } diff --git a/hw/gpio/aspeed_sgpio.c b/hw/gpio/aspeed_sgpio.c index 7d2f73699520..67b0c10d79fa 100644 --- a/hw/gpio/aspeed_sgpio.c +++ b/hw/gpio/aspeed_sgpio.c @@ -11,6 +11,7 @@ #include "qemu/log.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/irq.h" #include "hw/core/qdev-properties.h" @@ -300,7 +301,7 @@ static void aspeed_sgpio_init(Object *obj) { for (int i =3D 0; i < ASPEED_SGPIO_MAX_PIN_PAIR * 2; i++) { g_autofree char *name =3D g_strdup_printf("sgpio%03d", i); - object_property_add(obj, name, "bool", aspeed_sgpio_get_pin, + object_property_add_qapi(obj, name, &bool_type_info, aspeed_sgpio_= get_pin, aspeed_sgpio_set_pin, NULL, NULL); } } diff --git a/hw/gpio/stm32l4x5_gpio.c b/hw/gpio/stm32l4x5_gpio.c index 92fa397fbafe..d349d41e41a1 100644 --- a/hw/gpio/stm32l4x5_gpio.c +++ b/hw/gpio/stm32l4x5_gpio.c @@ -25,6 +25,7 @@ #include "hw/core/qdev-properties.h" #include "qapi/visitor.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "migration/vmstate.h" #include "trace.h" =20 @@ -409,10 +410,10 @@ static void stm32l4x5_gpio_init(Object *obj) =20 s->clk =3D qdev_init_clock_in(DEVICE(s), "clk", NULL, s, 0); =20 - object_property_add(obj, "disconnected-pins", "uint16", + object_property_add_qapi(obj, "disconnected-pins", &uint16_type_info, disconnected_pins_get, disconnected_pins_set, NULL, &s->disconnected_pins); - object_property_add(obj, "clock-freq-hz", "uint32", + object_property_add_qapi(obj, "clock-freq-hz", &uint32_type_info, clock_freq_get, NULL, NULL, NULL); } =20 diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 12de020adfbf..c2bca40e511a 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1718,7 +1718,7 @@ static void pc_machine_class_init(ObjectClass *oc, co= nst void *data) mc->default_ram_id =3D "pc.ram"; pcmc->default_smbios_ep_type =3D SMBIOS_ENTRY_POINT_TYPE_AUTO; =20 - object_class_property_add(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "size", + object_class_property_add_qapi(oc, PC_MACHINE_MAX_RAM_BELOW_4G, &size_= type_info, pc_machine_get_max_ram_below_4g, pc_machine_set_max_ram_below_4g, NULL, NULL); object_class_property_set_description(oc, PC_MACHINE_MAX_RAM_BELOW_4G, @@ -1756,13 +1756,13 @@ static void pc_machine_class_init(ObjectClass *oc, = const void *data) pc_machine_get_default_bus_bypass_iommu, pc_machine_set_default_bus_bypass_iommu); =20 - object_class_property_add(oc, PC_MACHINE_MAX_FW_SIZE, "size", + object_class_property_add_qapi(oc, PC_MACHINE_MAX_FW_SIZE, &size_type_= info, pc_machine_get_max_fw_size, pc_machine_set_max_fw_size, NULL, NULL); object_class_property_set_description(oc, PC_MACHINE_MAX_FW_SIZE, "Maximum combined firmware size"); =20 - object_class_property_add(oc, PC_MACHINE_SMBIOS_EP, "str", + object_class_property_add_qapi(oc, PC_MACHINE_SMBIOS_EP, &str_type_inf= o, pc_machine_get_smbios_ep, pc_machine_set_smbios_ep, NULL, NULL); object_class_property_set_description(oc, PC_MACHINE_SMBIOS_EP, diff --git a/hw/i386/sgx-epc.c b/hw/i386/sgx-epc.c index 29cda843c942..9636f32fb624 100644 --- a/hw/i386/sgx-epc.c +++ b/hw/i386/sgx-epc.c @@ -15,6 +15,7 @@ #include "hw/mem/memory-device.h" #include "hw/core/qdev-properties.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "target/i386/cpu.h" #include "system/address-spaces.h" @@ -159,10 +160,11 @@ static void sgx_epc_class_init(ObjectClass *oc, const= void *data) mdc->get_memory_region =3D sgx_epc_md_get_memory_region; mdc->fill_device_info =3D sgx_epc_md_fill_device_info; =20 - object_class_property_add(oc, SGX_EPC_SIZE_PROP, "uint64", - sgx_epc_get_size, - NULL, - NULL, NULL); + object_class_property_add_qapi(oc, SGX_EPC_SIZE_PROP, + &uint64_type_info, + sgx_epc_get_size, + NULL, + NULL, NULL); } =20 static const TypeInfo sgx_epc_info =3D { diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 63f297a10532..d0c782ec8544 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -420,9 +420,9 @@ static void x86_machine_class_init(ObjectClass *oc, con= st void *data) "in ACPI table header." "The string may be up to 8 bytes= in size"); =20 - object_class_property_add(oc, X86_MACHINE_BUS_LOCK_RATELIMIT, "uint64_= t", - x86_machine_get_bus_lock_ratelimit, - x86_machine_set_bus_lock_ratelimit, NULL, = NULL); + object_class_property_add_qapi(oc, X86_MACHINE_BUS_LOCK_RATELIMIT, &ui= nt64_type_info, + x86_machine_get_bus_lock_ratelimit, + x86_machine_set_bus_lock_ratelimit, NUL= L, NULL); object_class_property_set_description(oc, X86_MACHINE_BUS_LOCK_RATELIM= IT, "Set the ratelimit for the bus locks acquired in VMs"); =20 diff --git a/hw/ide/ide-dev.c b/hw/ide/ide-dev.c index 5d478588c614..e2dd2439991f 100644 --- a/hw/ide/ide-dev.c +++ b/hw/ide/ide-dev.c @@ -19,6 +19,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-types-block.h" #include "qemu/error-report.h" #include "qemu/module.h" @@ -174,7 +175,7 @@ out: =20 static void ide_dev_instance_init(Object *obj) { - object_property_add(obj, "bootindex", "int32", + object_property_add_qapi(obj, "bootindex", &int32_type_info, ide_dev_get_bootindex, ide_dev_set_bootindex, NULL, NULL); object_property_set_int(obj, "bootindex", -1, NULL); diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c index 0f0f37d45734..dc0517ceea90 100644 --- a/hw/intc/apic_common.c +++ b/hw/intc/apic_common.c @@ -22,6 +22,7 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/i386/apic.h" #include "hw/i386/apic_internal.h" @@ -442,7 +443,7 @@ static void apic_common_initfn(Object *obj) APICCommonState *s =3D APIC_COMMON(obj); =20 s->id =3D s->initial_apic_id =3D -1; - object_property_add(obj, "id", "uint32", + object_property_add_qapi(obj, "id", &uint32_type_info, apic_common_get_id, apic_common_set_id, NULL, NULL); } diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index db8ea76f117c..edb59568038b 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -1520,7 +1520,7 @@ static void virt_class_init(ObjectClass *oc, const vo= id *data) object_class_property_set_description(oc, "highmem-mmio", "Set on/off to enable/disable hi= gh " "memory region for PCI MMIO"); - object_class_property_add(oc, "highmem-mmio-size", "size", + object_class_property_add_qapi(oc, "highmem-mmio-size", &size_type_inf= o, virt_get_highmem_mmio_size, virt_set_highmem_mmio_size, NULL, NULL); diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index cf8a4d8c5f2a..123ddc938546 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -26,6 +26,7 @@ #include "qemu/module.h" #include "qemu/pmem.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/mem/nvdimm.h" #include "hw/core/qdev-properties.h" @@ -99,9 +100,9 @@ static void nvdimm_set_uuid(Object *obj, Visitor *v, con= st char *name, =20 static void nvdimm_init(Object *obj) { - object_property_add(obj, NVDIMM_LABEL_SIZE_PROP, "size", - nvdimm_get_label_size, nvdimm_set_label_size, NULL, - NULL); + object_property_add_qapi(obj, NVDIMM_LABEL_SIZE_PROP, &size_type_info, + nvdimm_get_label_size, nvdimm_set_label_size,= NULL, + NULL); =20 object_property_add(obj, NVDIMM_UUID_PROP, "QemuUUID", nvdimm_get_uuid, nvdimm_set_uuid, NULL, NULL); diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 68862926ee2d..ee586ecc0c7d 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -26,6 +26,7 @@ #include "hw/mem/nvdimm.h" #include "hw/mem/memory-device.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "system/hostmem.h" @@ -176,7 +177,7 @@ static void pc_dimm_get_size(Object *obj, Visitor *v, c= onst char *name, =20 static void pc_dimm_init(Object *obj) { - object_property_add(obj, PC_DIMM_SIZE_PROP, "uint64", pc_dimm_get_size, + object_property_add_qapi(obj, PC_DIMM_SIZE_PROP, &uint64_type_info, pc= _dimm_get_size, NULL, NULL, NULL); } =20 diff --git a/hw/misc/aspeed_lpc.c b/hw/misc/aspeed_lpc.c index 7f7e4f1a0985..e2d9b7572f27 100644 --- a/hw/misc/aspeed_lpc.c +++ b/hw/misc/aspeed_lpc.c @@ -12,6 +12,7 @@ #include "qemu/error-report.h" #include "hw/misc/aspeed_lpc.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/irq.h" #include "hw/core/qdev-properties.h" @@ -417,30 +418,54 @@ static void aspeed_lpc_realize(DeviceState *dev, Erro= r **errp) =20 static void aspeed_lpc_init(Object *obj) { - object_property_add(obj, "idr1", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr1", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str1", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr2", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr2", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str2", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr3", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr3", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str3", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr4", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr4", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str4", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); + object_property_add_qapi(obj, "idr1", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "odr1", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "str1", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "idr2", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "odr2", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "str2", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "idr3", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "odr3", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "str3", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "idr4", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "odr4", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "str4", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); } =20 static const VMStateDescription vmstate_aspeed_lpc =3D { diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c index f8fbaebee6ab..d096cc88f5c5 100644 --- a/hw/misc/aspeed_sdmc.c +++ b/hw/misc/aspeed_sdmc.c @@ -15,6 +15,7 @@ #include "hw/core/qdev-properties.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "trace.h" #include "qemu/units.h" #include "qemu/cutils.h" @@ -259,7 +260,7 @@ static void aspeed_sdmc_set_ram_size(Object *obj, Visit= or *v, const char *name, =20 static void aspeed_sdmc_initfn(Object *obj) { - object_property_add(obj, "ram-size", "int", + object_property_add_qapi(obj, "ram-size", &int_type_info, aspeed_sdmc_get_ram_size, aspeed_sdmc_set_ram_size, NULL, NULL); } diff --git a/hw/misc/npcm7xx_mft.c b/hw/misc/npcm7xx_mft.c index 742166c4e828..99e9e49788c0 100644 --- a/hw/misc/npcm7xx_mft.c +++ b/hw/misc/npcm7xx_mft.c @@ -23,6 +23,7 @@ #include "hw/core/registerfields.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/bitops.h" #include "qemu/error-report.h" @@ -491,7 +492,7 @@ static void npcm7xx_mft_init(Object *obj) s->clock_2 =3D qdev_init_clock_out(dev, "clock2"); =20 for (int i =3D 0; i < NPCM7XX_PWM_PER_MODULE; ++i) { - object_property_add(obj, "max_rpm[*]", "uint32", + object_property_add_qapi(obj, "max_rpm[*]", &uint32_type_info, npcm7xx_mft_get_max_rpm, npcm7xx_mft_set_max_rpm, NULL, &s->max_rpm[i]); diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c index 673c785abc94..63e0d40ee726 100644 --- a/hw/net/ne2000-isa.c +++ b/hw/net/ne2000-isa.c @@ -29,6 +29,7 @@ #include "ne2000.h" #include "system/system.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qom/object.h" @@ -131,7 +132,7 @@ out: =20 static void isa_ne2000_instance_init(Object *obj) { - object_property_add(obj, "bootindex", "int32", + object_property_add_qapi(obj, "bootindex", &int32_type_info, isa_ne2000_get_bootindex, isa_ne2000_set_bootindex, NULL, NULL); object_property_set_int(obj, "bootindex", -1, NULL); diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 578421c21761..1065b9411ddf 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -203,6 +203,7 @@ #include "qemu/units.h" #include "qemu/range.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "system/system.h" #include "system/block-backend.h" @@ -10612,7 +10613,7 @@ static void nvme_instance_init(Object *obj) "bootindex", "/namespace@1,0", DEVICE(obj)); =20 - object_property_add(obj, "smart_critical_warning", "uint8", + object_property_add_qapi(obj, "smart_critical_warning", &uint8_type_in= fo, nvme_get_smart_warning, nvme_set_smart_warning, NULL, NULL); } diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expand= er_bridge.c index 40ffbc4e0821..9bb7d3c9debe 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -12,6 +12,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "hw/pci/pci.h" #include "hw/pci/pci_bus.h" #include "hw/pci/pci_host.h" @@ -103,7 +104,7 @@ static void pxb_bus_class_init(ObjectClass *class, cons= t void *data) pbc->bus_num =3D pxb_bus_num; pbc->numa_node =3D pxb_bus_numa_node; =20 - object_class_property_add(class, "acpi_uid", "uint32", + object_class_property_add_qapi(class, "acpi_uid", &uint32_type_info, prop_pxb_uid_get, NULL, NULL, NULL); object_class_property_set_description(class, "acpi_uid", "ACPI Unique ID used to distinguish this PCI Host Bridge / ACPI000= 16"); diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index c1982f7962a6..feafa6a72fe4 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -32,6 +32,7 @@ #include "hw/core/qdev-properties.h" #include "hw/core/sysbus.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "migration/vmstate.h" #include "qapi/visitor.h" #include "qemu/error-report.h" @@ -387,21 +388,25 @@ static void i440fx_pcihost_class_init(ObjectClass *kl= ass, const void *data) /* Reason: needs to be wired up by pc_init1 */ dc->user_creatable =3D false; =20 - object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_START, "uint32= ", - i440fx_pcihost_get_pci_hole_start, - NULL, NULL, NULL); + object_class_property_add_qapi(klass, PCI_HOST_PROP_PCI_HOLE_START, + &uint32_type_info, + i440fx_pcihost_get_pci_hole_start, + NULL, NULL, NULL); =20 - object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_END, "uint32", - i440fx_pcihost_get_pci_hole_end, - NULL, NULL, NULL); + object_class_property_add_qapi(klass, PCI_HOST_PROP_PCI_HOLE_END, + &uint32_type_info, + i440fx_pcihost_get_pci_hole_end, + NULL, NULL, NULL); =20 - object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE64_START, "uint= 64", - i440fx_pcihost_get_pci_hole64_start, - NULL, NULL, NULL); + object_class_property_add_qapi(klass, PCI_HOST_PROP_PCI_HOLE64_START, + &uint64_type_info, + i440fx_pcihost_get_pci_hole64_start, + NULL, NULL, NULL); =20 - object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE64_END, "uint64= ", - i440fx_pcihost_get_pci_hole64_end, - NULL, NULL, NULL); + object_class_property_add_qapi(klass, PCI_HOST_PROP_PCI_HOLE64_END, + &uint64_type_info, + i440fx_pcihost_get_pci_hole64_end, + NULL, NULL, NULL); } =20 static const TypeInfo i440fx_pcihost_info =3D { diff --git a/hw/pci-host/pnv_phb3.c b/hw/pci-host/pnv_phb3.c index db061c134e95..667e9585ab8f 100644 --- a/hw/pci-host/pnv_phb3.c +++ b/hw/pci-host/pnv_phb3.c @@ -11,6 +11,7 @@ #include "qemu/bswap.h" #include "qapi/visitor.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "hw/pci-host/pnv_phb3_regs.h" #include "hw/pci-host/pnv_phb.h" #include "hw/pci-host/pnv_phb3.h" @@ -1164,12 +1165,12 @@ static void pnv_phb3_root_bus_class_init(ObjectClas= s *klass, const void *data) { BusClass *k =3D BUS_CLASS(klass); =20 - object_class_property_add(klass, "phb-id", "uint32", + object_class_property_add_qapi(klass, "phb-id", &uint32_type_info, pnv_phb3_root_bus_get_prop, pnv_phb3_root_bus_set_prop, NULL, NULL); =20 - object_class_property_add(klass, "chip-id", "uint32", + object_class_property_add_qapi(klass, "chip-id", &uint32_type_info, pnv_phb3_root_bus_get_prop, pnv_phb3_root_bus_set_prop, NULL, NULL); diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index 9acaf4c0c2f5..96c2f89f889b 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -11,6 +11,7 @@ #include "qemu/bswap.h" #include "qapi/visitor.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "target/ppc/cpu.h" #include "hw/pci-host/pnv_phb4_regs.h" #include "hw/pci-host/pnv_phb4.h" @@ -1761,12 +1762,12 @@ static void pnv_phb4_root_bus_class_init(ObjectClas= s *klass, const void *data) { BusClass *k =3D BUS_CLASS(klass); =20 - object_class_property_add(klass, "phb-id", "uint32", + object_class_property_add_qapi(klass, "phb-id", &uint32_type_info, pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop, NULL, NULL); =20 - object_class_property_add(klass, "chip-id", "uint32", + object_class_property_add_qapi(klass, "chip-id", &uint32_type_info, pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop, NULL, NULL); diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index f4556ad03a04..6eba30e06811 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -35,6 +35,7 @@ #include "hw/core/qdev-properties.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" =20 @@ -226,19 +227,19 @@ static void q35_host_initfn(Object *obj) qdev_prop_set_uint64(DEVICE(s), PCI_HOST_PROP_PCI_HOLE64_SIZE, Q35_PCI_HOST_HOLE64_SIZE_DEFAULT); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE_START, &uint32_ty= pe_info, q35_host_get_pci_hole_start, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE_END, &uint32_type= _info, q35_host_get_pci_hole_end, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE64_START, &uint64_= type_info, q35_host_get_pci_hole64_start, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE64_END, &uint64_ty= pe_info, q35_host_get_pci_hole64_end, NULL, NULL, NULL); =20 diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 5c2150b71c86..64f9ca29b02e 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -12,6 +12,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qobject/qnull.h" #include "qemu/cutils.h" #include "hw/ppc/spapr_drc.h" @@ -584,7 +585,7 @@ static void spapr_dr_connector_instance_init(Object *ob= j) SpaprDrcClass *drck =3D SPAPR_DR_CONNECTOR_GET_CLASS(drc); =20 object_property_add_uint32_ptr(obj, "id", &drc->id, OBJ_PROP_FLAG_READ= ); - object_property_add(obj, "index", "uint32", prop_get_index, + object_property_add_qapi(obj, "index", &uint32_type_info, prop_get_ind= ex, NULL, NULL, NULL); object_property_add(obj, "fdt", "struct", prop_get_fdt, NULL, NULL, NULL); diff --git a/hw/riscv/microchip_pfsoc.c b/hw/riscv/microchip_pfsoc.c index edd29626fa07..e36063244bde 100644 --- a/hw/riscv/microchip_pfsoc.c +++ b/hw/riscv/microchip_pfsoc.c @@ -39,6 +39,7 @@ #include "qemu/units.h" #include "qemu/cutils.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/boards.h" #include "hw/core/loader.h" @@ -743,7 +744,7 @@ static void microchip_icicle_kit_machine_class_init(Obj= ectClass *oc, */ mc->default_ram_size =3D 1537 * MiB; =20 - object_class_property_add(oc, "clint-timebase-frequency", "uint32_t", + object_class_property_add_qapi(oc, "clint-timebase-frequency", &uint32= _type_info, microchip_icicle_kit_get_clint_timebase_freq, microchip_icicle_kit_set_clint_timebase_freq, NULL, NULL); diff --git a/hw/s390x/sclpcpi.c b/hw/s390x/sclpcpi.c index ec4bdf23509b..97d37ae4b932 100644 --- a/hw/s390x/sclpcpi.c +++ b/hw/s390x/sclpcpi.c @@ -53,6 +53,7 @@ #include "qemu/timer.h" #include "hw/s390x/event-facility.h" #include "hw/s390x/ebcdic.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-visit-machine.h" #include "qapi/qapi-events-machine-s390x.h" #include "migration/vmstate.h" @@ -195,12 +196,13 @@ static void cpi_class_init(ObjectClass *klass, const = void *data) "name of the cluster which the VM belongs to, if any" " e.g. \"PLEX \""); =20 - object_class_property_add(klass, "system_level", "uint64", get_system_= level, - NULL, NULL, NULL); + object_class_property_add_qapi(klass, "system_level", + &uint64_type_info, get_system_level, + NULL, NULL, NULL); object_class_property_set_description(klass, "system_level", "distribution and kernel version in Linux e.g. 748723438054305= 28"); =20 - object_class_property_add(klass, "timestamp", "uint64", get_timestamp, + object_class_property_add_qapi(klass, "timestamp", &uint64_type_info, = get_timestamp, NULL, NULL, NULL); object_class_property_set_description(klass, "timestamp", "latest update of CPI data in nanoseconds since the UNIX EPOCH= "); diff --git a/hw/s390x/virtio-ccw-mem.c b/hw/s390x/virtio-ccw-mem.c index dea30aacfb32..046dfd544cf3 100644 --- a/hw/s390x/virtio-ccw-mem.c +++ b/hw/s390x/virtio-ccw-mem.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "hw/core/qdev-properties.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/module.h" #include "virtio-ccw-mem.h" #include "hw/mem/memory-device.h" @@ -205,7 +206,7 @@ static void virtio_ccw_mem_instance_init(Object *obj) OBJECT(&dev->vdev), VIRTIO_MEM_BLOCK_SIZE_PR= OP); object_property_add_alias(obj, VIRTIO_MEM_SIZE_PROP, OBJECT(&dev->vdev= ), VIRTIO_MEM_SIZE_PROP); - object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", + object_property_add_qapi(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, &size_ty= pe_info, virtio_ccw_mem_get_requested_size, virtio_ccw_mem_set_requested_size, NULL, NULL); } diff --git a/hw/sensor/adc128d818.c b/hw/sensor/adc128d818.c index c65508cba144..7efc48a036ec 100644 --- a/hw/sensor/adc128d818.c +++ b/hw/sensor/adc128d818.c @@ -8,6 +8,7 @@ =20 #include "qemu/osdep.h" #include "qemu/log.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "qom/object.h" @@ -642,15 +643,18 @@ static void adc128d818_initfn(Object *obj) for (unsigned ch =3D 0u; ch < ADC128D818_NUM_CHANNELS; ch++) { char *name =3D g_strdup_printf("ain%u", ch); =20 - object_property_add(obj, name, "int", adc128d818_get_ain, - adc128d818_set_ain, NULL, NULL); + object_property_add_qapi(obj, name, &int_type_info, + adc128d818_get_ain, + adc128d818_set_ain, NULL, NULL); g_free(name); } =20 - object_property_add(obj, "temperature", "int", adc128d818_get_temperat= ure, - adc128d818_set_temperature, NULL, NULL); - object_property_add(obj, "ext-vref-mv", "int", adc128d818_get_ext_vref, - adc128d818_set_ext_vref, NULL, NULL); + object_property_add_qapi(obj, "temperature", &int_type_info, + adc128d818_get_temperature, + adc128d818_set_temperature, NULL, NULL); + object_property_add_qapi(obj, "ext-vref-mv", &int_type_info, + adc128d818_get_ext_vref, + adc128d818_set_ext_vref, NULL, NULL); } =20 static void adc128d818_realize(DeviceState *dev, Error **errp) diff --git a/hw/sensor/adm1266.c b/hw/sensor/adm1266.c index 37d1cffd57a9..62f563af7a7a 100644 --- a/hw/sensor/adm1266.c +++ b/hw/sensor/adm1266.c @@ -14,6 +14,7 @@ #include "hw/core/irq.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h" @@ -217,7 +218,7 @@ static void adm1266_init(Object *obj) for (int i =3D 0; i < ADM1266_NUM_PAGES; i++) { pmbus_page_config(pmdev, i, flags); =20 - object_property_add(obj, "vout[*]", "uint16", + object_property_add_qapi(obj, "vout[*]", &uint16_type_info, adm1266_get, adm1266_set, NULL, &pmdev->pages[i].read_vout); } diff --git a/hw/sensor/adm1272.c b/hw/sensor/adm1272.c index 0aa2a8655683..e1c1bf1c54de 100644 --- a/hw/sensor/adm1272.c +++ b/hw/sensor/adm1272.c @@ -12,6 +12,7 @@ #include "hw/core/irq.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h" @@ -493,19 +494,19 @@ static void adm1272_init(Object *obj) =20 pmbus_page_config(pmdev, 0, flags); =20 - object_property_add(obj, "vin", "uint16", + object_property_add_qapi(obj, "vin", &uint16_type_info, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_vin); =20 - object_property_add(obj, "vout", "uint16", + object_property_add_qapi(obj, "vout", &uint16_type_info, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_vout); =20 - object_property_add(obj, "iout", "uint16", + object_property_add_qapi(obj, "iout", &uint16_type_info, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_iout); =20 - object_property_add(obj, "pin", "uint16", + object_property_add_qapi(obj, "pin", &uint16_type_info, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_pin); =20 diff --git a/hw/sensor/emc141x.c b/hw/sensor/emc141x.c index a51fc44395ab..5efe94643ca0 100644 --- a/hw/sensor/emc141x.c +++ b/hw/sensor/emc141x.c @@ -22,6 +22,7 @@ #include "hw/i2c/i2c.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qom/object.h" @@ -251,16 +252,16 @@ static void emc141x_reset(DeviceState *dev) =20 static void emc141x_initfn(Object *obj) { - object_property_add(obj, "temperature0", "int", + object_property_add_qapi(obj, "temperature0", &int_type_info, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature1", "int", + object_property_add_qapi(obj, "temperature1", &int_type_info, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature2", "int", + object_property_add_qapi(obj, "temperature2", &int_type_info, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature3", "int", + object_property_add_qapi(obj, "temperature3", &int_type_info, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); } diff --git a/hw/sensor/isl_pmbus_vr.c b/hw/sensor/isl_pmbus_vr.c index 0fad04def773..8923e9e87510 100644 --- a/hw/sensor/isl_pmbus_vr.c +++ b/hw/sensor/isl_pmbus_vr.c @@ -9,6 +9,7 @@ #include "qemu/osdep.h" #include "hw/sensor/isl_pmbus_vr.h" #include "hw/core/qdev-properties.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h" @@ -136,63 +137,63 @@ static void isl_pmbus_vr_add_props(Object *obj, uint6= 4_t *flags, uint8_t pages) PMBusDevice *pmdev =3D PMBUS_DEVICE(obj); for (int i =3D 0; i < pages; i++) { if (flags[i] & PB_HAS_VIN) { - object_property_add(obj, "vin[*]", "uint16", + object_property_add_qapi(obj, "vin[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_vin); } =20 if (flags[i] & PB_HAS_VOUT) { - object_property_add(obj, "vout[*]", "uint16", + object_property_add_qapi(obj, "vout[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_vout); } =20 if (flags[i] & PB_HAS_IIN) { - object_property_add(obj, "iin[*]", "uint16", + object_property_add_qapi(obj, "iin[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_iin); } =20 if (flags[i] & PB_HAS_IOUT) { - object_property_add(obj, "iout[*]", "uint16", + object_property_add_qapi(obj, "iout[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_iout); } =20 if (flags[i] & PB_HAS_PIN) { - object_property_add(obj, "pin[*]", "uint16", + object_property_add_qapi(obj, "pin[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_pin); } =20 if (flags[i] & PB_HAS_POUT) { - object_property_add(obj, "pout[*]", "uint16", + object_property_add_qapi(obj, "pout[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_pout); } =20 if (flags[i] & PB_HAS_TEMPERATURE) { - object_property_add(obj, "temp1[*]", "uint16", + object_property_add_qapi(obj, "temp1[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_temperature_1); } =20 if (flags[i] & PB_HAS_TEMP2) { - object_property_add(obj, "temp2[*]", "uint16", + object_property_add_qapi(obj, "temp2[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_temperature_2); } =20 if (flags[i] & PB_HAS_TEMP3) { - object_property_add(obj, "temp3[*]", "uint16", + object_property_add_qapi(obj, "temp3[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_temperature_3); diff --git a/hw/sensor/lsm303dlhc_mag.c b/hw/sensor/lsm303dlhc_mag.c index cd5773ae64e8..c8085739ca47 100644 --- a/hw/sensor/lsm303dlhc_mag.c +++ b/hw/sensor/lsm303dlhc_mag.c @@ -25,6 +25,7 @@ #include "hw/i2c/i2c.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qemu/log.h" @@ -509,19 +510,19 @@ static void lsm303dlhc_mag_reset(DeviceState *dev) */ static void lsm303dlhc_mag_initfn(Object *obj) { - object_property_add(obj, "mag-x", "int", + object_property_add_qapi(obj, "mag-x", &int_type_info, lsm303dlhc_mag_get_x, lsm303dlhc_mag_set_x, NULL, NULL); =20 - object_property_add(obj, "mag-y", "int", + object_property_add_qapi(obj, "mag-y", &int_type_info, lsm303dlhc_mag_get_y, lsm303dlhc_mag_set_y, NULL, NULL); =20 - object_property_add(obj, "mag-z", "int", + object_property_add_qapi(obj, "mag-z", &int_type_info, lsm303dlhc_mag_get_z, lsm303dlhc_mag_set_z, NULL, NULL); =20 - object_property_add(obj, "temperature", "int", + object_property_add_qapi(obj, "temperature", &int_type_info, lsm303dlhc_mag_get_temperature, lsm303dlhc_mag_set_temperature, NULL, NULL); } diff --git a/hw/sensor/max34451.c b/hw/sensor/max34451.c index 4d64434f3af4..3c8fa3d4a861 100644 --- a/hw/sensor/max34451.c +++ b/hw/sensor/max34451.c @@ -11,6 +11,7 @@ #include "hw/core/irq.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h" @@ -727,7 +728,7 @@ static void max34451_init(Object *obj) =20 /* get and set the voltage in millivolts, max is 32767 mV */ for (int i =3D 0; i < MAX34451_NUM_PWR_DEVICES; i++) { - object_property_add(obj, "vout[*]", "uint16", + object_property_add_qapi(obj, "vout[*]", &uint16_type_info, max34451_get, max34451_set, NULL, &pmdev->pages[i].read_vout= ); } @@ -737,7 +738,7 @@ static void max34451_init(Object *obj) * centidegrees Celsius i.e.: 2500 -> 25.00 C, max is 327.67 C */ for (int i =3D 0; i < MAX34451_NUM_TEMP_DEVICES; i++) { - object_property_add(obj, "temperature[*]", "uint16", + object_property_add_qapi(obj, "temperature[*]", &uint16_type_info, max34451_get, max34451_set, NULL, diff --git a/hw/sensor/tmp105.c b/hw/sensor/tmp105.c index ece0650d703f..5b6cc3ba2dc5 100644 --- a/hw/sensor/tmp105.c +++ b/hw/sensor/tmp105.c @@ -28,6 +28,7 @@ #include "qemu/osdep.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qom/object.h" #include "hw/sensor/tmp105.h" @@ -408,7 +409,7 @@ static void tmp105_realize(DeviceState *dev, Error **er= rp) =20 static void tmp105_initfn(Object *obj) { - object_property_add(obj, "temperature", "int", + object_property_add_qapi(obj, "temperature", &int_type_info, tmp105_get_temperature, tmp105_set_temperature, NULL, NULL); object_property_set_description(obj, "temperature", diff --git a/hw/sensor/tmp421.c b/hw/sensor/tmp421.c index 127edd0ba568..60844e76b21f 100644 --- a/hw/sensor/tmp421.c +++ b/hw/sensor/tmp421.c @@ -28,6 +28,7 @@ #include "hw/i2c/i2c.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qom/object.h" @@ -350,16 +351,16 @@ static void tmp421_class_init(ObjectClass *klass, con= st void *data) dc->vmsd =3D &vmstate_tmp421; sc->dev =3D (DeviceInfo *) data; =20 - object_class_property_add(klass, "temperature0", "int", + object_class_property_add_qapi(klass, "temperature0", &int_type_info, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature1", "int", + object_class_property_add_qapi(klass, "temperature1", &int_type_info, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature2", "int", + object_class_property_add_qapi(klass, "temperature2", &int_type_info, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature3", "int", + object_class_property_add_qapi(klass, "temperature3", &int_type_info, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); } diff --git a/hw/usb/dev-storage-classic.c b/hw/usb/dev-storage-classic.c index 977151c4a087..06584092bcae 100644 --- a/hw/usb/dev-storage-classic.c +++ b/hw/usb/dev-storage-classic.c @@ -9,6 +9,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/usb/usb.h" #include "hw/usb/desc.h" @@ -122,7 +123,7 @@ out: =20 static void usb_msd_instance_init(Object *obj) { - object_property_add(obj, "bootindex", "int32", + object_property_add_qapi(obj, "bootindex", &int32_type_info, usb_msd_get_bootindex, usb_msd_set_bootindex, NULL, NULL); object_property_set_int(obj, "bootindex", -1, NULL); diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 07d519cf6d77..7ffbe48e5134 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -27,6 +27,7 @@ #include "hw/virtio/virtio-balloon.h" #include "system/address-spaces.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-events-machine.h" #include "qapi/visitor.h" #include "trace.h" @@ -1039,7 +1040,7 @@ static void virtio_balloon_instance_init(Object *obj) object_property_add(obj, "guest-stats", "guest statistics", balloon_stats_get_all, NULL, NULL, NULL); =20 - object_property_add(obj, "guest-stats-polling-interval", "int", + object_property_add_qapi(obj, "guest-stats-polling-interval", &int_typ= e_info, balloon_stats_get_poll_interval, balloon_stats_set_poll_interval, NULL, NULL); diff --git a/hw/virtio/virtio-mem-pci.c b/hw/virtio/virtio-mem-pci.c index f592eb1a7849..80e9bfedd9f5 100644 --- a/hw/virtio/virtio-mem-pci.c +++ b/hw/virtio/virtio-mem-pci.c @@ -14,6 +14,7 @@ #include "virtio-mem-pci.h" #include "hw/mem/memory-device.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-events-machine.h" #include "qapi/qapi-events-misc.h" =20 @@ -211,7 +212,7 @@ static void virtio_mem_pci_instance_init(Object *obj) OBJECT(&dev->vdev), VIRTIO_MEM_BLOCK_SIZE_PR= OP); object_property_add_alias(obj, VIRTIO_MEM_SIZE_PROP, OBJECT(&dev->vdev= ), VIRTIO_MEM_SIZE_PROP); - object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", + object_property_add_qapi(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, &size_ty= pe_info, virtio_mem_pci_get_requested_size, virtio_mem_pci_set_requested_size, NULL, NULL); } diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c index 7130ed852d9c..42dc028e3bdc 100644 --- a/hw/virtio/virtio-mem.c +++ b/hw/virtio/virtio-mem.c @@ -26,6 +26,7 @@ #include "hw/virtio/virtio-bus.h" #include "hw/virtio/virtio-mem.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "migration/misc.h" #include "hw/core/boards.h" @@ -1533,14 +1534,15 @@ static void virtio_mem_instance_init(Object *obj) =20 notifier_list_init(&vmem->size_change_notifiers); =20 - object_property_add(obj, VIRTIO_MEM_SIZE_PROP, "size", virtio_mem_get_= size, - NULL, NULL, NULL); - object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", - virtio_mem_get_requested_size, - virtio_mem_set_requested_size, NULL, NULL); - object_property_add(obj, VIRTIO_MEM_BLOCK_SIZE_PROP, "size", - virtio_mem_get_block_size, virtio_mem_set_block_si= ze, - NULL, NULL); + object_property_add_qapi(obj, VIRTIO_MEM_SIZE_PROP, &size_type_info, + virtio_mem_get_size, + NULL, NULL, NULL); + object_property_add_qapi(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, &size_ty= pe_info, + virtio_mem_get_requested_size, + virtio_mem_set_requested_size, NULL, NULL); + object_property_add_qapi(obj, VIRTIO_MEM_BLOCK_SIZE_PROP, &size_type_i= nfo, + virtio_mem_get_block_size, virtio_mem_set_blo= ck_size, + NULL, NULL); } =20 static void virtio_mem_instance_finalize(Object *obj) diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c index cca37202ffb2..7b4fd933a8fb 100644 --- a/hw/xen/xen-pvh-common.c +++ b/hw/xen/xen-pvh-common.c @@ -9,6 +9,7 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qemu/units.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/boards.h" #include "hw/core/irq.h" @@ -413,7 +414,7 @@ void xen_pvh_class_setup_common_props(XenPVHMachineClas= s *xpc) =20 #define OC_MEMMAP_PROP_BASE(c, prop_name, name) \ do { \ - object_class_property_add(c, prop_name "-base", "uint64_t", \ + object_class_property_add_qapi(c, prop_name "-base", &uint64_type_info= ,\ xen_pvh_get_ ## name ## _base, \ xen_pvh_set_ ## name ## _base, NULL, NULL); \ object_class_property_set_description(oc, prop_name "-base", \ @@ -422,7 +423,7 @@ do { = \ =20 #define OC_MEMMAP_PROP_SIZE(c, prop_name, name) \ do { \ - object_class_property_add(c, prop_name "-size", "uint64_t", \ + object_class_property_add_qapi(c, prop_name "-size", &size_type_info, \ xen_pvh_get_ ## name ## _size, \ xen_pvh_set_ ## name ## _size, NULL, NULL); \ object_class_property_set_description(oc, prop_name "-size", \ @@ -458,7 +459,7 @@ do { = \ OC_MEMMAP_PROP(oc, "pci-mmio", pci_mmio); OC_MEMMAP_PROP(oc, "pci-mmio-high", pci_mmio_high); =20 - object_class_property_add(oc, "pci-intx-irq-base", "uint32_t", + object_class_property_add_qapi(oc, "pci-intx-irq-base", &uint32_ty= pe_info, xen_pvh_get_pci_intx_irq_base, xen_pvh_set_pci_intx_irq_base, NULL, NULL); @@ -468,7 +469,7 @@ do { = \ =20 #ifdef CONFIG_TPM if (xpc->has_tpm) { - object_class_property_add(oc, "tpm-base-addr", "uint64_t", + object_class_property_add_qapi(oc, "tpm-base-addr", &uint64_type_i= nfo, xen_pvh_get_tpm_base, xen_pvh_set_tpm_base, NULL, NULL); diff --git a/iothread.c b/iothread.c index 76eea6df3861..7285135d40a8 100644 --- a/iothread.c +++ b/iothread.c @@ -20,6 +20,7 @@ #include "system/event-loop-base.h" #include "system/iothread.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-commands-misc.h" #include "qemu/error-report.h" #include "qemu/rcu.h" @@ -315,19 +316,19 @@ static void iothread_class_init(ObjectClass *klass, c= onst void *class_data) bc->init =3D iothread_init; bc->update_params =3D iothread_set_aio_context_params; =20 - object_class_property_add(klass, "poll-max-ns", "int64", + object_class_property_add_qapi(klass, "poll-max-ns", &int64_type_info, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_max_ns_info); - object_class_property_add(klass, "poll-grow", "int64", + object_class_property_add_qapi(klass, "poll-grow", &int64_type_info, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_grow_info); - object_class_property_add(klass, "poll-shrink", "int64", + object_class_property_add_qapi(klass, "poll-shrink", &int64_type_info, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_shrink_info); - object_class_property_add(klass, "poll-weight", "int64", + object_class_property_add_qapi(klass, "poll-weight", &int64_type_info, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_weight_info); diff --git a/net/colo-compare.c b/net/colo-compare.c index a6910de869ff..4b237a59d120 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -16,6 +16,7 @@ #include "qemu/error-report.h" #include "trace.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "net/net.h" #include "net/eth.h" #include "qom/object_interfaces.h" @@ -1373,15 +1374,15 @@ static void colo_compare_init(Object *obj) object_property_add_str(obj, "notify_dev", compare_get_notify_dev, compare_set_notify_dev= ); =20 - object_property_add(obj, "compare_timeout", "uint64", + object_property_add_qapi(obj, "compare_timeout", &uint64_type_info, compare_get_timeout, compare_set_timeout, NULL, NULL); =20 - object_property_add(obj, "expired_scan_cycle", "uint32", + object_property_add_qapi(obj, "expired_scan_cycle", &uint32_type_info, compare_get_expired_scan_cycle, compare_set_expired_scan_cycle, NULL, NULL); =20 - object_property_add(obj, "max_queue_size", "uint32", + object_property_add_qapi(obj, "max_queue_size", &uint32_type_info, get_max_queue_size, set_max_queue_size, NULL, NULL); =20 diff --git a/net/dump.c b/net/dump.c index 0c39f09892c2..3d7bb36182ec 100644 --- a/net/dump.c +++ b/net/dump.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include "clients.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/error-report.h" #include "qemu/iov.h" #include "qemu/module.h" @@ -238,8 +239,9 @@ static void filter_dump_class_init(ObjectClass *oc, con= st void *data) { NetFilterClass *nfc =3D NETFILTER_CLASS(oc); =20 - object_class_property_add(oc, "maxlen", "uint32", filter_dump_get_maxl= en, - filter_dump_set_maxlen, NULL, NULL); + object_class_property_add_qapi(oc, "maxlen", &uint32_type_info, + filter_dump_get_maxlen, + filter_dump_set_maxlen, NULL, NULL); object_class_property_add_str(oc, "file", file_dump_get_filename, file_dump_set_filename); =20 diff --git a/net/filter-buffer.c b/net/filter-buffer.c index 427da24097f2..9d7a9f5cb2c7 100644 --- a/net/filter-buffer.c +++ b/net/filter-buffer.c @@ -10,6 +10,7 @@ #include "net/filter.h" #include "net/queue.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/timer.h" #include "qemu/iov.h" #include "qapi/qapi-builtin-visit.h" @@ -182,7 +183,7 @@ static void filter_buffer_class_init(ObjectClass *oc, c= onst void *data) { NetFilterClass *nfc =3D NETFILTER_CLASS(oc); =20 - object_class_property_add(oc, "interval", "uint32", + object_class_property_add_qapi(oc, "interval", &uint32_type_info, filter_buffer_get_interval, filter_buffer_set_interval, NULL, NULL); =20 diff --git a/qom/object.c b/qom/object.c index cc113c0810e7..9f9a2abfa08d 100644 --- a/qom/object.c +++ b/qom/object.c @@ -22,10 +22,10 @@ #include "qapi/string-output-visitor.h" #include "qapi/qobject-input-visitor.h" #include "qapi/forward-visitor.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-builtin-visit.h" #include "qapi/compat-policy.h" #include "qobject/qdict.h" -#include "qobject/qjson.h" #include "qemu/id.h" #include "qapi/qmp/qerror.h" #include "trace.h" @@ -2449,7 +2449,7 @@ object_property_add_str(Object *obj, const char *name, prop->get =3D get; prop->set =3D set; =20 - return object_property_add(obj, name, "string", + return object_property_add_qapi(obj, name, &str_type_info, get ? property_get_str : NULL, set ? property_set_str : NULL, property_release_data, @@ -2467,7 +2467,7 @@ object_class_property_add_str(ObjectClass *klass, con= st char *name, prop->get =3D get; prop->set =3D set; =20 - return object_class_property_add(klass, name, "string", + return object_class_property_add_qapi(klass, name, &str_type_info, get ? property_get_str : NULL, set ? property_set_str : NULL, NULL, @@ -2519,7 +2519,7 @@ object_property_add_bool(Object *obj, const char *nam= e, prop->get =3D get; prop->set =3D set; =20 - return object_property_add(obj, name, "bool", + return object_property_add_qapi(obj, name, &bool_type_info, get ? property_get_bool : NULL, set ? property_set_bool : NULL, property_release_data, @@ -2536,7 +2536,7 @@ object_class_property_add_bool(ObjectClass *klass, co= nst char *name, prop->get =3D get; prop->set =3D set; =20 - return object_class_property_add(klass, name, "bool", + return object_class_property_add_qapi(klass, name, &bool_type_info, get ? property_get_bool : NULL, set ? property_set_bool : NULL, NULL, @@ -2945,8 +2945,8 @@ object_property_add_uint8_ptr(Object *obj, const char= *name, setter =3D property_set_uint8_ptr; } =20 - return object_property_add(obj, name, "uint8", - getter, setter, NULL, (void *)v); + return object_property_add_qapi(obj, name, &uint8_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -2986,8 +2986,8 @@ object_class_static_property_add_uint8_ptr(ObjectClas= s *klass, setter =3D property_set_uint8_ptr; } =20 - return object_class_property_add(klass, name, "uint8", - getter, setter, NULL, (void *)v); + return object_class_property_add_qapi(klass, name, &uint8_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -3006,8 +3006,8 @@ object_property_add_uint16_ptr(Object *obj, const cha= r *name, setter =3D property_set_uint16_ptr; } =20 - return object_property_add(obj, name, "uint16", - getter, setter, NULL, (void *)v); + return object_property_add_qapi(obj, name, &uint16_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -3047,8 +3047,8 @@ object_class_static_property_add_uint16_ptr(ObjectCla= ss *klass, setter =3D property_set_uint16_ptr; } =20 - return object_class_property_add(klass, name, "uint16", - getter, setter, NULL, (void *)v); + return object_class_property_add_qapi(klass, name, &uint16_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -3067,8 +3067,8 @@ object_property_add_uint32_ptr(Object *obj, const cha= r *name, setter =3D property_set_uint32_ptr; } =20 - return object_property_add(obj, name, "uint32", - getter, setter, NULL, (void *)v); + return object_property_add_qapi(obj, name, &uint32_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -3108,8 +3108,8 @@ object_class_static_property_add_uint32_ptr(ObjectCla= ss *klass, setter =3D property_set_uint32_ptr; } =20 - return object_class_property_add(klass, name, "uint32", - getter, setter, NULL, (void *)v); + return object_class_property_add_qapi(klass, name, &uint32_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -3128,8 +3128,8 @@ object_property_add_uint64_ptr(Object *obj, const cha= r *name, setter =3D property_set_uint64_ptr; } =20 - return object_property_add(obj, name, "uint64", - getter, setter, NULL, (void *)v); + return object_property_add_qapi(obj, name, &uint64_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -3169,8 +3169,8 @@ object_class_static_property_add_uint64_ptr(ObjectCla= ss *klass, setter =3D property_set_uint64_ptr; } =20 - return object_class_property_add(klass, name, "uint64", - getter, setter, NULL, (void *)v); + return object_class_property_add_qapi(klass, name, &uint64_type_info, + getter, setter, NULL, (void *)v); } =20 typedef struct { diff --git a/system/bootdevice.c b/system/bootdevice.c index 9538b08983f5..7789e464186a 100644 --- a/system/bootdevice.c +++ b/system/bootdevice.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "system/system.h" #include "qapi/visitor.h" #include "qemu/error-report.h" @@ -336,7 +337,7 @@ void device_add_bootindex_property(Object *obj, int32_t= *bootindex, prop->suffix =3D suffix; prop->dev =3D dev; =20 - object_property_add(obj, name, "int32", + object_property_add_qapi(obj, name, &int32_type_info, device_get_bootindex, device_set_bootindex, property_release_bootindex, diff --git a/system/memory.c b/system/memory.c index f1910af8a010..ff8dae018aa2 100644 --- a/system/memory.c +++ b/system/memory.c @@ -16,6 +16,7 @@ #include "qemu/osdep.h" #include "qemu/log.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "system/memory.h" #include "qapi/visitor.h" #include "qemu/bitops.h" @@ -1293,11 +1294,11 @@ static void memory_region_initfn(Object *obj) =20 object_property_add_uint64_ptr(OBJECT(mr), "addr", &mr->addr, OBJ_PROP_FLAG_READ); - object_property_add(OBJECT(mr), "priority", "int32", + object_property_add_qapi(OBJECT(mr), "priority", &int32_type_info, memory_region_get_priority, NULL, /* memory_region_set_priority */ NULL, NULL); - object_property_add(OBJECT(mr), "size", "uint64", + object_property_add_qapi(OBJECT(mr), "size", &uint64_type_info, memory_region_get_size, NULL, /* memory_region_set_size, */ NULL, NULL); diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index dcd0d698b300..c9e5f294b336 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -20,6 +20,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "cpu.h" #include "cpregs.h" #include "qemu/module.h" @@ -328,7 +329,7 @@ static void prop_bool_set_false(Object *obj, Visitor *v= , const char *name, =20 static void prop_add_stub_bool(Object *obj, const char *name) { - object_property_add(obj, name, "bool", prop_bool_get_false, + object_property_add_qapi(obj, name, &bool_type_info, prop_bool_get_fal= se, prop_bool_set_false, NULL, NULL); } =20 @@ -518,13 +519,13 @@ void aarch64_add_sve_properties(Object *obj) for (vq =3D 1; vq <=3D ARM_MAX_VQ; ++vq) { char name[8]; snprintf(name, sizeof(name), "sve%d", vq * 128); - object_property_add(obj, name, "bool", cpu_arm_get_vq, + object_property_add_qapi(obj, name, &bool_type_info, cpu_arm_get_v= q, cpu_arm_set_vq, NULL, &cpu->sve_vq); } =20 #ifdef CONFIG_USER_ONLY /* Mirror linux /proc/sys/abi/sve_default_vector_length. */ - object_property_add(obj, "sve-default-vector-length", "int32", + object_property_add_qapi(obj, "sve-default-vector-length", &int32_type= _info, cpu_arm_get_default_vec_len, cpu_arm_set_default_vec_len, NULL, &cpu->sve_default_vq); @@ -543,13 +544,13 @@ void aarch64_add_sme_properties(Object *obj) for (vq =3D 1; vq <=3D ARM_MAX_VQ; vq <<=3D 1) { char name[8]; snprintf(name, sizeof(name), "sme%d", vq * 128); - object_property_add(obj, name, "bool", cpu_arm_get_vq, + object_property_add_qapi(obj, name, &bool_type_info, cpu_arm_get_v= q, cpu_arm_set_vq, NULL, &cpu->sme_vq); } =20 #ifdef CONFIG_USER_ONLY /* Mirror linux /proc/sys/abi/sme_default_vector_length. */ - object_property_add(obj, "sme-default-vector-length", "int32", + object_property_add_qapi(obj, "sme-default-vector-length", &int32_type= _info, cpu_arm_get_default_vec_len, cpu_arm_set_default_vec_len, NULL, &cpu->sme_default_vq); diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 3d905f8565de..1569a64b3b57 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -20,6 +20,7 @@ #include "qemu/main-loop.h" #include "qom/object.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "system/system.h" #include "system/runstate.h" #include "system/ramblock.h" @@ -1820,7 +1821,7 @@ static void kvm_arch_set_eager_split_size(Object *obj= , Visitor *v, =20 void kvm_arch_accel_class_init(ObjectClass *oc) { - object_class_property_add(oc, "eager-split-size", "size", + object_class_property_add_qapi(oc, "eager-split-size", &size_type_info, kvm_arch_get_eager_split_size, kvm_arch_set_eager_split_size, NULL, NULL); =20 diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c index c92e331e7317..db73b7668f42 100644 --- a/target/arm/tcg/cpu64.c +++ b/target/arm/tcg/cpu64.c @@ -20,6 +20,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "cpu.h" #include "qemu/module.h" #include "qapi/visitor.h" @@ -1392,9 +1393,9 @@ void aarch64_max_v8_tcg_initfn(Object *obj) /* v8.2: FEAT_SVE */ cpu->sve_vq.supported =3D MAKE_64BIT_MASK(0, ARM_MAX_VQ); aarch64_add_sve_properties(OBJECT(cpu)); - object_property_add(OBJECT(cpu), "sve-max-vq", "uint32", - cpu_max_get_sve_max_vq, cpu_max_set_sve_max_vq, - NULL, NULL); + object_property_add_qapi(OBJECT(cpu), "sve-max-vq", &uint32_type_info, + cpu_max_get_sve_max_vq, + cpu_max_set_sve_max_vq, NULL, NULL); =20 /* v8.2: FEAT_PAuth2 */ aarch64_add_pauth_properties(OBJECT(cpu)); @@ -1529,8 +1530,8 @@ void aarch64_max_v9_tcg_initfn(Object *obj) object_property_add_bool(obj, "x-rme", cpu_arm_get_rme, cpu_arm_set_rm= e); =20 /* v9.4: FEAT_RME_GPC2 */ - object_property_add(obj, "x-l0gptsz", "uint32", cpu_max_get_l0gptsz, - cpu_max_set_l0gptsz, NULL, NULL); + object_property_add_qapi(obj, "x-l0gptsz", &uint32_type_info, cpu_max_= get_l0gptsz, + cpu_max_set_l0gptsz, NULL, NULL); } =20 static const ARMCPUInfo aarch64_cpus[] =3D { diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 4553ef0892a1..3601a56e6848 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -10457,7 +10457,7 @@ static void x86_cpu_register_bit_prop(X86CPUClass *= xcc, fp =3D g_new0(BitProperty, 1); fp->w =3D w; fp->mask =3D mask; - object_class_property_add(oc, prop_name, "bool", + object_class_property_add_qapi(oc, prop_name, &bool_type_info, x86_cpu_get_bit_prop, x86_cpu_set_bit_prop, NULL, fp); @@ -10977,13 +10977,13 @@ static void x86_cpu_common_class_init(ObjectClass= *oc, const void *data) =20 dc->user_creatable =3D true; =20 - object_class_property_add(oc, "family", "uint64", + object_class_property_add_qapi(oc, "family", &uint64_type_info, x86_cpuid_version_get_family, x86_cpuid_version_set_family, NULL, NULL); - object_class_property_add(oc, "model", "uint64", + object_class_property_add_qapi(oc, "model", &uint64_type_info, x86_cpuid_version_get_model, x86_cpuid_version_set_model, NULL, NULL); - object_class_property_add(oc, "stepping", "uint64", + object_class_property_add_qapi(oc, "stepping", &uint64_type_info, x86_cpuid_version_get_stepping, x86_cpuid_version_set_stepping, NULL, NULL); object_class_property_add_str(oc, "vendor", @@ -10992,7 +10992,7 @@ static void x86_cpu_common_class_init(ObjectClass *= oc, const void *data) object_class_property_add_str(oc, "model-id", x86_cpuid_get_model_id, x86_cpuid_set_model_id); - object_class_property_add(oc, "tsc-frequency", "int", + object_class_property_add_qapi(oc, "tsc-frequency", &int_type_info, x86_cpuid_get_tsc_freq, x86_cpuid_set_tsc_freq, NULL, NULL); /* @@ -11005,7 +11005,7 @@ static void x86_cpu_common_class_init(ObjectClass *= oc, const void *data) x86_cpu_get_unavailable_features, NULL, NULL, NULL); =20 - object_class_property_add(oc, "avx10-version", "uint8", + object_class_property_add_qapi(oc, "avx10-version", &uint8_type_info, x86_cpuid_get_avx10_version, x86_cpuid_set_avx10_version, NULL, NULL); diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index f2e8dc8c156d..03c6816cf61e 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -7099,7 +7099,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc) .set =3D kvm_arch_set_notify_vmexit, )); =20 - object_class_property_add(oc, "notify-window", "uint32", + object_class_property_add_qapi(oc, "notify-window", &uint32_type_info, kvm_arch_get_notify_window, kvm_arch_set_notify_window, NULL, NULL); @@ -7107,7 +7107,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc) "Clock cycles without an event w= indow " "after which a notification VM e= xit occurs"); =20 - object_class_property_add(oc, "xen-version", "uint32", + object_class_property_add_qapi(oc, "xen-version", &uint32_type_info, kvm_arch_get_xen_version, kvm_arch_set_xen_version, NULL, NULL); @@ -7116,14 +7116,14 @@ void kvm_arch_accel_class_init(ObjectClass *oc) "(in XENVER_version form " "e.g. 0x4000a for 4.10)"); =20 - object_class_property_add(oc, "xen-gnttab-max-frames", "uint16", + object_class_property_add_qapi(oc, "xen-gnttab-max-frames", &uint16_ty= pe_info, kvm_arch_get_xen_gnttab_max_frames, kvm_arch_set_xen_gnttab_max_frames, NULL, NULL); object_class_property_set_description(oc, "xen-gnttab-max-frames", "Maximum number of grant table f= rames"); =20 - object_class_property_add(oc, "xen-evtchn-max-pirq", "uint16", + object_class_property_add_qapi(oc, "xen-evtchn-max-pirq", &uint16_type= _info, kvm_arch_get_xen_evtchn_max_pirq, kvm_arch_set_xen_evtchn_max_pirq, NULL, NULL); diff --git a/target/i386/sev.c b/target/i386/sev.c index b2c7260c80a4..3a36fa4d0b95 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -3266,7 +3266,7 @@ sev_snp_guest_class_init(ObjectClass *oc, const void = *data) x86_klass->adjust_cpuid_features =3D sev_snp_adjust_cpuid_features; x86_klass->kvm_type =3D sev_snp_kvm_type; =20 - object_class_property_add(oc, "policy", "uint64", + object_class_property_add_qapi(oc, "policy", &uint64_type_info, sev_snp_guest_get_policy, sev_snp_guest_set_policy, NULL, NULL); object_class_property_add_str(oc, "guest-visible-workarounds", diff --git a/target/ppc/compat.c b/target/ppc/compat.c index 55de3bd5d5de..4d81225de37f 100644 --- a/target/ppc/compat.c +++ b/target/ppc/compat.c @@ -23,6 +23,7 @@ #include "kvm_ppc.h" #include "system/cpus.h" #include "qemu/error-report.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "cpu-models.h" @@ -335,7 +336,7 @@ void ppc_compat_add_property(Object *obj, const char *n= ame, gchar *names, *desc; int i; =20 - object_property_add(obj, name, "string", + object_property_add_qapi(obj, name, &str_type_info, ppc_compat_prop_get, ppc_compat_prop_set, NULL, compat_pvr); =20 diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 08a4d14ea1f6..664c1a767950 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -28,6 +28,7 @@ #include "target/riscv/tcg/csr.h" #include "internals.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/error-report.h" #include "qemu/timer.h" @@ -1412,20 +1413,20 @@ void riscv_add_satp_mode_properties(Object *obj) { RISCVCPU *cpu =3D RISCV_CPU(obj); =20 - object_property_add(obj, "svbare", "bool", cpu_riscv_get_satp, - cpu_riscv_set_satp, NULL, &cpu->satp_modes); + object_property_add_qapi(obj, "svbare", &bool_type_info, cpu_riscv_get= _satp, + cpu_riscv_set_satp, NULL, &cpu->satp_modes); =20 if (cpu->env.misa_mxl =3D=3D MXL_RV32) { - object_property_add(obj, "sv32", "bool", cpu_riscv_get_satp, + object_property_add_qapi(obj, "sv32", &bool_type_info, cpu_riscv_g= et_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); } else { - object_property_add(obj, "sv39", "bool", cpu_riscv_get_satp, + object_property_add_qapi(obj, "sv39", &bool_type_info, cpu_riscv_g= et_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv48", "bool", cpu_riscv_get_satp, + object_property_add_qapi(obj, "sv48", &bool_type_info, cpu_riscv_g= et_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv57", "bool", cpu_riscv_get_satp, + object_property_add_qapi(obj, "sv57", &bool_type_info, cpu_riscv_g= et_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv64", "bool", cpu_riscv_get_satp, + object_property_add_qapi(obj, "sv64", &bool_type_info, cpu_riscv_g= et_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); } } diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c index 45ad5e1525a8..c90db86cda85 100644 --- a/target/riscv/kvm/kvm-cpu.c +++ b/target/riscv/kvm/kvm-cpu.c @@ -24,6 +24,7 @@ =20 #include "qemu/timer.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qapi/visitor.h" @@ -539,7 +540,7 @@ static void riscv_cpu_add_kvm_unavail_prop(Object *obj,= const char *prop_name) * unknown to KVM and error out if the user attempts * to enable any of them. */ - object_property_add(obj, prop_name, "bool", + object_property_add_qapi(obj, prop_name, &bool_type_info, cpu_get_cfg_unavailable, cpu_set_cfg_unavailable, NULL, (void *)prop_name); @@ -559,7 +560,7 @@ static void kvm_riscv_add_cpu_user_properties(Object *c= pu_obj) misa_cfg->name =3D riscv_get_misa_ext_name(bit); misa_cfg->description =3D riscv_get_misa_ext_description(bit); =20 - object_property_add(cpu_obj, misa_cfg->name, "bool", + object_property_add_qapi(cpu_obj, misa_cfg->name, &bool_type_info, kvm_cpu_get_misa_ext_cfg, kvm_cpu_set_misa_ext_cfg, NULL, misa_cfg); @@ -575,7 +576,7 @@ static void kvm_riscv_add_cpu_user_properties(Object *c= pu_obj) for (i =3D 0; i < ARRAY_SIZE(kvm_multi_ext_cfgs); i++) { KVMCPUConfig *multi_cfg =3D &kvm_multi_ext_cfgs[i]; =20 - object_property_add(cpu_obj, multi_cfg->name, "bool", + object_property_add_qapi(cpu_obj, multi_cfg->name, &bool_type_info, kvm_cpu_get_multi_ext_cfg, kvm_cpu_set_multi_ext_cfg, NULL, multi_cfg); diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c index e07ca95e49bd..88fdbec4fb4c 100644 --- a/target/riscv/tcg/tcg-cpu.c +++ b/target/riscv/tcg/tcg-cpu.c @@ -26,6 +26,7 @@ #include "pmu.h" #include "time_helper.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/accel.h" #include "qemu/error-report.h" @@ -1473,7 +1474,7 @@ static void riscv_cpu_add_misa_properties(Object *cpu= _obj) continue; } =20 - object_property_add(cpu_obj, name, "bool", + object_property_add_qapi(cpu_obj, name, &bool_type_info, cpu_get_misa_ext_cfg, cpu_set_misa_ext_cfg, NULL, (void *)misa_cfg); @@ -1527,7 +1528,7 @@ static void riscv_cpu_add_profiles(Object *cpu_obj) for (int i =3D 0; riscv_profiles[i] !=3D NULL; i++) { RISCVCPUProfile *profile =3D riscv_profiles[i]; =20 - object_property_add(cpu_obj, profile->name, "bool", + object_property_add_qapi(cpu_obj, profile->name, &bool_type_info, cpu_get_profile, cpu_set_profile, NULL, (void *)profile); =20 @@ -1603,10 +1604,10 @@ static void riscv_cpu_add_user_properties(Object *o= bj) =20 for (edata =3D isa_edata_arr; edata && edata->name; edata++) { if (edata->prop_name) { - object_property_add(obj, edata->prop_name, "bool", - cpu_get_multi_ext_cfg, - cpu_set_multi_ext_cfg, - NULL, (void *)&edata->ext_enable_offset); + object_property_add_qapi(obj, edata->prop_name, &bool_type_inf= o, + cpu_get_multi_ext_cfg, + cpu_set_multi_ext_cfg, + NULL, (void *)&edata->ext_enable_offs= et); } } =20 diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index c41d629d6803..72bf0f48de83 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -17,6 +17,7 @@ #include "system/kvm.h" #include "system/tcg.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/error-report.h" #include "qapi/visitor.h" #include "qemu/module.h" @@ -915,13 +916,13 @@ void s390_cpu_model_class_register_props(ObjectClass = *oc) =20 for (feat =3D 0; feat < S390_FEAT_MAX; feat++) { const S390FeatDef *def =3D s390_feat_def(feat); - object_class_property_add(oc, def->name, "bool", get_feature, + object_class_property_add_qapi(oc, def->name, &bool_type_info, get= _feature, set_feature, NULL, (void *) feat); object_class_property_set_description(oc, def->name, def->desc); } for (group =3D 0; group < S390_FEAT_GROUP_MAX; group++) { const S390FeatGroupDef *def =3D s390_feat_group_def(group); - object_class_property_add(oc, def->name, "bool", get_feature_group, + object_class_property_add_qapi(oc, def->name, &bool_type_info, get= _feature_group, set_feature_group, NULL, (void *) group); object_class_property_set_description(oc, def->name, def->desc); } diff --git a/tests/unit/test-qdev-global-props.c b/tests/unit/test-qdev-glo= bal-props.c index 8ea362cbb902..204436fb7276 100644 --- a/tests/unit/test-qdev-global-props.c +++ b/tests/unit/test-qdev-global-props.c @@ -27,6 +27,7 @@ #include "hw/core/qdev-properties.h" #include "qom/object.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" =20 =20 @@ -171,10 +172,12 @@ static void prop2_accessor(Object *obj, Visitor *v, c= onst char *name, =20 static void dynamic_instance_init(Object *obj) { - object_property_add(obj, "prop1", "uint32", prop1_accessor, prop1_acce= ssor, - NULL, NULL); - object_property_add(obj, "prop2", "uint32", prop2_accessor, prop2_acce= ssor, - NULL, NULL); + object_property_add_qapi(obj, "prop1", &uint32_type_info, + prop1_accessor, prop1_accessor, + NULL, NULL); + object_property_add_qapi(obj, "prop2", &uint32_type_info, + prop2_accessor, prop2_accessor, + NULL, NULL); } =20 static void dynamic_class_init(ObjectClass *oc, const void *data) diff --git a/ui/console.c b/ui/console.c index b7357172007e..840603cb233f 100644 --- a/ui/console.c +++ b/ui/console.c @@ -28,6 +28,7 @@ #include "ui/vgafont.h" #include "hw/core/qdev.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-commands-ui.h" #include "qapi/visitor.h" #include "qemu/coroutine.h" @@ -535,7 +536,7 @@ qemu_graphic_console_class_init(ObjectClass *oc, const = void *data) offsetof(QemuGraphicConsole, device), object_property_allow_set_link, OBJ_PROP_LINK_STRONG); - object_class_property_add(oc, "head", "uint32", + object_class_property_add_qapi(oc, "head", &uint32_type_info, qemu_graphic_console_prop_get_head, NULL, NULL, NULL); =20 diff --git a/util/thread-context.c b/util/thread-context.c index 88d8f0a55a4e..7fa6840dd401 100644 --- a/util/thread-context.c +++ b/util/thread-context.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "qemu/thread-context.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-builtin-visit.h" #include "qapi/visitor.h" #include "qemu/config-file.h" @@ -278,13 +279,13 @@ static void thread_context_class_init(ObjectClass *oc= , const void *data) UserCreatableClass *ucc =3D USER_CREATABLE_CLASS(oc); =20 ucc->complete =3D thread_context_instance_complete; - object_class_property_add(oc, "thread-id", "uint64", + object_class_property_add_qapi(oc, "thread-id", &uint64_type_info, thread_context_get_thread_id, NULL, NULL, NULL); - object_class_property_add(oc, "cpu-affinity", "[uint16]", + object_class_property_add_qapi(oc, "cpu-affinity", &uint16List_type_in= fo, thread_context_get_cpu_affinity, thread_context_set_cpu_affinity, NULL, NULL); - object_class_property_add(oc, "node-affinity", "[uint16]", NULL, + object_class_property_add_qapi(oc, "node-affinity", &uint16List_type_i= nfo, NULL, thread_context_set_node_affinity, NULL, NULL= ); } =20 --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493658; cv=none; d=zohomail.com; s=zohoarc; b=aUsMwpS31svhIidBTXHWH53JzlL2SFcaGJVqERe/CRT3f8P6S9mlK3fR4vbYFZQQJfJf1S201sdScc6+GLANi0XM0ZDOQg/tIGFqst1No64MA/Gz5CLzOr2J0zrShMgCjxi4lLRgkneYoKNQxSpp6EBcfI7aD0Da+uyHMmzBunQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493658; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SaO9TD83O1mESMfVgH3WuoSzmG3APdCIb1nj0sICWaY=; b=lYT0PbgrVWjqYvsyVl8ik1G1kJMyWbHWX4fBVixgBfh4rMAHfvNcF8CbLwUdQqQ+idvaSy1uCeAfy3T3GsxEpxYi/Vix93kpbLHzt6m43S6BDKlTq0XQGrHDNPRSquZm1+oCVyMHZDeoUOCSqat/jiFyEFYvUl0EYh72Yyba2yg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179249365832037.296879691919344; Tue, 20 Oct 2026 03:54:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7Qb-00081Y-9d; Tue, 20 Oct 2026 06:50:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Pr-0005dH-Uo for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:50:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Pp-0005td-CD for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:49:59 -0400 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-206-FotbGa2bN3uiQWrd6VJL7Q-1; Tue, 20 Oct 2026 10:49:52 +0000 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 1CFF51800A30; Tue, 20 Oct 2026 10:49:48 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8F8041800677; Tue, 20 Oct 2026 10:49:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SaO9TD83O1mESMfVgH3WuoSzmG3APdCIb1nj0sICWaY=; b=iNGh3B3uckSXQwe9OYfQbFlK5rbHREk4cSMdE4P9sG29Kx/eBL4SbKqjV0oHAN/m8WFENn uUkd8KFK05JTGf/8yu75d9RyGOY1gKGnBREi2u+ogkRUHgoAj3fO9V+/ZOV5f7xMwoVuhF pS/690y5XrhGYatbpf6+wNw9LfHRkOk= X-MC-Unique: FotbGa2bN3uiQWrd6VJL7Q-1 X-Mimecast-MFC-AGG-ID: FotbGa2bN3uiQWrd6VJL7Q_1792493388 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:56 +0400 Subject: [PATCH v7 39/65] i386/cpu: convert strList property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-39-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=927; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=/KSVjwfA6NJABrU8j/+rplEihE7WbSuvvPqkwS91nlk=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10Zbi8OK49WAzCOnFkroErxJhCPevzYVZbRRQ puH2R/pXLCJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWwAKCRDa6OEJdZac 5Za+EAC4HYxAzDB6R6B/Noe10vMQK3B2SHQlClijhbENvmsvZv+GkuP6ofyL3AMjQq7g/lGOrmr kZR2Ol0ojf7GsTbPDPZC1kjtzUdQMn/LtO42Lk23fn3xUsw2aW27mj3TXI7nh1DDVWX3jgPxwiK ydRbU6lC/4F6A2VQWjdFzU4fbU2KK61YYgUEglYkpb5R7yjvLJ7W4mKRBchEfEtR49x12Pq5twp DWF2vI63kyQ/P+Qvouz+2AbBduW0y+965Qh/qC22TeE2/sEmP9wJbYUB2zJytThfAWj2eyNiueK GizBJDEuMzW1gBvPXs4efEsA9PwP5/qk6kJHD/DYuianSi4tR+5ENhbyKrBLusUCPSLdvQwkAh4 3U1ofLR/Z2pxMxJR4y8fxT7RNDj7Jtl9kLNLxZEhSQqnkKDtN58/dHtfzjnHnxsuGU/ntoYHAxO 4HYyMk9ilCrrh200rMF5WADd68dXw0wcnmHZMt7J3ihT8FcMQw7g+jVnCiYfY6yGwqvW8n6STUT +U6Uzo4zLAOoAHD699r7p6EkjoKe8OT7lqPFtrwIyM+Tpv0Sh47SdRwNoD8CcP6tycIaDAyB5lZ jlNKLfm+Ov/X+M47Kj5g0z3/DpvIrUhDJ2+rTO5vF4Sgl8eVMwqfuLYlVB0lTw7eQ9ys7QpVHig U3bIykrc/pNCZdA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493659775158500 Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- target/i386/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 3601a56e6848..0a9acfa74600 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -11001,7 +11001,8 @@ static void x86_cpu_common_class_init(ObjectClass *= oc, const void *data) * QMP command: they list the features that would have prevented the * CPU from running if the "enforce" flag was set. */ - object_class_property_add(oc, "unavailable-features", "strList", + object_class_property_add_qapi(oc, "unavailable-features", + &strList_type_info, x86_cpu_get_unavailable_features, NULL, NULL, NULL); =20 --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493833; cv=none; d=zohomail.com; s=zohoarc; b=WMqzXGgPe85Gr6WUpAChlkKTbPx/+GqwLPdP08QU8sok5EUD3n9+P7aBZhbgEXYo1/OrsrRIFcfqOa1mkXzNT0/caZXZ81kgTLKWNhlZK9YiaBoQ7Q8gOLJHqYhfsnXg/w8brafl5Cdv5xZ/pekL7xWCoaSkbHiZURL5NdTv5LU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493833; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zgYXy9wUlwpZwJEXhfhg6ueZe5iP6OdFNQDVMpjhNJA=; b=GGdnaqJR4Hq5sTov2pfPZoeHftAn2cVqTg/uoCRpD4LPJRP7koZNfwFNLHjkl/M6IQfL4RxjzJBpo7d0qJrAHRpoPSm8DUtkjY9BzWkavPfdQZ2Fy5VmtMBwYCXMWLimZNKM42Z7hciGHO0Bl32Moc+7L3u7/0T5lGgnEkGrv0I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493833339606.1964495541333; Tue, 20 Oct 2026 03:57:13 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455344.1669133 (Exim 4.92) (envelope-from ) id 1xJ7Wb-0002qV-CT; Tue, 20 Oct 2026 10:56:57 +0000 Received: by outflank-mailman (output) from mailman id 1455344.1669133; Tue, 20 Oct 2026 10:56:56 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7WZ-0002l8-Q9; Tue, 20 Oct 2026 10:56:55 +0000 Received: by outflank-mailman (input) for mailman id 1455344; Tue, 20 Oct 2026 10:51:05 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Qv-0000AR-NM for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:05 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7Qv-002FXm-47 for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:05 +0200 Received: from [10.42.69.5] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad7478f-bab6-0a2a0a5309dd-0a2a4505d420-22 for ; Tue, 20 Oct 2026 12:51:05 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad7475a-4cb1-0a2a45050019-aa0a817c826f-3 for ; Tue, 20 Oct 2026 12:50:04 +0200 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-691-X_BZbfi1OoaEw-XuKd7GEA-1; Tue, 20 Oct 2026 10:49:57 +0000 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 382911954B17; Tue, 20 Oct 2026 10:49:53 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 89D3D1956089; Tue, 20 Oct 2026 10:49:50 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zgYXy9wUlwpZwJEXhfhg6ueZe5iP6OdFNQDVMpjhNJA=; b=BOWeipw9WxhEler+SP0WenptoYrcVWFdcYkTTIlvIHnxl7sPdiWMA0oxqEFr945ebzsYo0 P17DXAeI97qM2dPjnj28vJc0XJJn7SbsZUJn/8cGp4Uw+pV9DVZs/WsNRIF9vkzpMI9iJN b9KDO5+9/M7+1JFEbjRRPHHGA09SD4M= X-MC-Unique: X_BZbfi1OoaEw-XuKd7GEA-1 X-Mimecast-MFC-AGG-ID: X_BZbfi1OoaEw-XuKd7GEA_1792493393 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:57 +0400 Subject: [PATCH v7 40/65] accel/hvf: convert OnOffSplit property to QAPI-aware registration MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-40-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2523; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=21V2JPj2rB3XQ9p0Fpt/4Sfi5TlT/INiy3CejR1RcSQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10Zbcvmz2dcDonHaGuZ+0JSpCQbdwS1IqolsF mrcOSZwsk+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWwAKCRDa6OEJdZac 5fbMD/4oDBa4aRAcuosgqEgTN/lLvXMd4CMMg/8NISFX3WirC2kLfaACPLJXeKGgyRmLFD49aZS C90374vVULKD25rkYEUinJNvw+z9cP8i/VTdLPCDvrtC/7kvYoqnDLVLO3J2Q3Wd5nfI6rmQZEk BwtAVjR6SSBb0iStYbJyVtP1TklsvdIlQhIhxfshPIqRwse/RgRnOxnAYRNMRVtDhm7Vu0j9+oI wQB+bCNaqKS88nEJIGu53wZ2zbS3wyEAQfjpFxwi2bIDLHSRhy3a07Hpo2bHHN003BU8sQAI530 fQnkPZFCQYFsKo1aZUPu739hgcgJsTtebTEHP7wVhaY5T9oTYjhlHy1h4bcxUIi+sUYQMwDz/B2 FNBgAkMwUmaom+WrzqUMDHFkmLBUULwbNeGiCgyNquapgGac7N7DQsItMvc5RouXeu8HIEjusQP ji/64PxnCl55S40Wr93VNww9w+uHtJ2MYwSRdIxtBvnRYW8k45wZ6f8n/bZ43PwOPLzkIMPhkAB AZPh9GndU9GtEDdzZQobzjyi5YtG9aqyHYwsF8IvbkM9hDWBKeSxYQInUbsFVgKYsEzJt9ORvoG Xh7xWXHM+nTdrSEW+k93/3Qu2ekkPkSElHFptLpXseE43g35XzS9fsK0+PV6Y6aNivNUO37QrR2 au4mCAtBZO6aHYg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-MFC-PROC-ID: Z0XUv_bmELUFBRsn_Y3lCCIiU8iMB11Msyq1zWIBHjY_1792493393 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-c201ff/1792493404-F68B62A1-15046773/0/0 X-purgate-type: clean X-purgate-size: 2525 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493834922158500 Convert the OnOffSplit property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- accel/hvf/hvf-all.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 8bd9154a50b6..2fd594ad156f 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -11,6 +11,7 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qapi-visit-common.h" #include "accel/accel-ops.h" #include "exec/cpu-common.h" @@ -230,18 +231,12 @@ static int hvf_accel_init(AccelState *as, MachineStat= e *ms) return hvf_arch_init(); } =20 -static void hvf_set_kernel_irqchip(Object *obj, Visitor *v, - const char *name, void *opaque, +static void hvf_set_kernel_irqchip(Object *obj, int value, Error **errp) { - OnOffSplit mode; - hvf_kernel_irqchip_override =3D true; - if (!visit_type_OnOffSplit(v, name, &mode, errp)) { - return; - } =20 - switch (mode) { + switch (value) { case ON_OFF_SPLIT_ON: #ifdef HOST_X86_64 /* macOS 12 onwards exposes an HVF virtual APIC. */ @@ -261,11 +256,7 @@ static void hvf_set_kernel_irqchip(Object *obj, Visito= r *v, break; =20 default: - /* - * The value was checked in visit_type_OnOffSplit() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 @@ -277,11 +268,13 @@ static void hvf_accel_class_init(ObjectClass *oc, con= st void *data) ac->allowed =3D &hvf_allowed; hvf_kernel_irqchip_override =3D false; hvf_kernel_irqchip =3D false; - object_class_property_add(oc, "kernel-irqchip", "on|off|split", - NULL, hvf_set_kernel_irqchip, - NULL, NULL); - object_class_property_set_description(oc, "kernel-irqchip", - "Configure HVF irqchip"); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "kernel-irqchip", + .qapi_type =3D &OnOffSplit_type_info, + .set =3D hvf_set_kernel_irqchip, + .description =3D "Configure HVF irqchip", + )); } =20 static const TypeInfo hvf_accel_type =3D { --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493552; cv=none; d=zohomail.com; s=zohoarc; b=JaYZK6qVM+yswzcKjzbfNwzPNLMWm1N15u07th6/htuU3eHRlWPVKW4/9N5D+cxqm08ZTJe/7X8vuZ0+oa1vo0ViInLmZ9mSwXDUX5Zbqidv1LAmAc0MYdlbjIIVBA9hHlfUTxvI9nrEUFE+eEO7HB0u9DriTqV/GfFHDd1QC+4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493552; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GVWb5UrZ3l9OWc8z0jMYQBZzqJcQOCGKYpInKz+na1M=; b=LUruK1H61kilLeCFBXR6sz/XJSfDKt3Vq/hYj3OSUhwwxJ5+FqnT6UFSwhlGWul2FHnPqlYxE+smYDJatQxkkU/0sT0C/Lp4dWgLGYqokELmPq3zLDzZVG/DKamx2R+VmCt6Gv26GsZ7bBhPg33gXccJGP+wLzoEViEz7hqLKqI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792493552771815.8283550627468; Tue, 20 Oct 2026 03:52:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7Qe-00089o-L6; Tue, 20 Oct 2026 06:50:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Q1-0006DS-Uk for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:50:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Q0-00069r-6T for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:50:09 -0400 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-37-O30bwBRGPzmDiwX1sYGXKg-1; Tue, 20 Oct 2026 06:50:02 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 726D5195606F; Tue, 20 Oct 2026 10:49:58 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6513818002B1; Tue, 20 Oct 2026 10:49:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GVWb5UrZ3l9OWc8z0jMYQBZzqJcQOCGKYpInKz+na1M=; b=aHpODoElLVt8435sL0m4j8p0XHudzNdF95pS+jjgGr4OZrgvvEWxoMSUUaESVf8Aczc2Ij gcKRorF41qLrEFO+/hErGR6qrQHhanQl73eJE4SibWPW0G8I1He5ASLjGjRRjbpbp/pnDW +ngibas2i+qZ8ChPAcp6OL97aCoWSWQ= X-MC-Unique: O30bwBRGPzmDiwX1sYGXKg-1 X-Mimecast-MFC-AGG-ID: O30bwBRGPzmDiwX1sYGXKg_1792493398 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:58 +0400 Subject: [PATCH v7 41/65] i386/x86: convert SgxEPCList property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-41-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1122; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=3ycIKkcsrbeBaqgGVPPqutgRU2x41tR3vpY71IOY4RM=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10Zbm7moIDDW7GGdTGA1Ntevlz9fNWvXvLsJR bIPPo13KrCJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWwAKCRDa6OEJdZac 5Z6AD/9gPLakZLGtkob/1hq4vp9WcOhy+Qf2mehJtKFcowbdPBQjOD8jHexmcUoSOILep2f0ZLJ dZ93x7+KtpDPJ/4hOVEelty3/2kYzR1QGS2GLV1xt70MVDdKb6YGI7nv9ZhSRPqLxUf2quaFnpm umHDou1B6dYT/+c0icU7IlgdqRtOxyZ75sKO27Z6dmZnoqFYLIP/lXyNuIuKzlZ2yjLPAGUsLFk LK3zOo1vwisjf/BZLY9TIovgjVy9se5BpqWx1A7pqHpe32TwXQU1x7ixQEeFADdUg1WCkE/isdM krDIS7cujn4AJtgOxH6JqN07z+G7SToDICJtrtNtgw/zd3B649uK5Li/udmEyCLk1PK2QpnS/+6 QpLTgx5m+Nobyae7jNQ7UKPCwATlex3vDyur7bvIfFNayOgpP/FZpJy2MwJzaxXsKL/juZ8h5dk NKpgvzPljgaORC5S+IsFoYPk7tgCHPRUF4r7b0ueCMur6MDrxaHIbMJKGergjautzcwg3hpKn8x Ul7p9A/g0SdO4ZaHIVOBXSGBW+ng3qndsxDvkIeH5v8SOsNZtu9D9oCnarKouLgzTUoO0aJoslY tDeb5MWngF3MQnylC815Zw6FQmYbBKNJCkjC0aiegP2CSTAx7etM/l6FB+NT/OktrtRZUXlUxN2 Ai4S2aLDD28Dk1g== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493555743158500 Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/i386/x86.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index d0c782ec8544..ed38760d798d 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -25,6 +25,7 @@ #include "qemu/units.h" #include "qapi/error.h" #include "qapi/qapi-type-infos-common.h" +#include "qapi/qapi-type-infos-machine.h" #include "qapi/qapi-visit-machine.h" #include "qapi/visitor.h" #include "system/qtest.h" @@ -426,7 +427,7 @@ static void x86_machine_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, X86_MACHINE_BUS_LOCK_RATELIM= IT, "Set the ratelimit for the bus locks acquired in VMs"); =20 - object_class_property_add(oc, "sgx-epc", "SgxEPC", + object_class_property_add_qapi(oc, "sgx-epc", &SgxEPCList_type_info, machine_get_sgx_epc, machine_set_sgx_epc, NULL, NULL); object_class_property_set_description(oc, "sgx-epc", --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493868; cv=none; d=zohomail.com; s=zohoarc; b=hk7ipEBeGbIPuv7VRFWCrJgia75wwecK41AS48LJxp3eNDyl0CH5LOR2LzN/wd8DwRpnKAc2EZFe1D9PTWLfEwBL2ndR8q7xM0CTvAt9MWGmoy4rx3nkbfYuMSkOCH3e7Y//D9Duoj6SdMVJh3HsLJfbBXimz2Clu+9qaX438as= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493868; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EljyyKpOaP+UVHeVMtiabRjWia9m5EXPj7DEMxHLTqI=; b=KH6bemNH4NJ+vRCa/0NywuKCfo9dB8JpUtnoRbNIvhAIDIqdrXULSxk6u8SfeWfQhjmFtPtUMDlf+JS/5mzX6EdLtERYTUNQeJCCyqVetroEQaf8trCfM9hGDR/cToKOXQTxZEjpXJEAei3X7pCGBSKQvs2qxmQXa026cj9w968= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493868765844.8342553108523; Tue, 20 Oct 2026 03:57:48 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455361.1669209 (Exim 4.92) (envelope-from ) id 1xJ7Ww-0006zY-5S; Tue, 20 Oct 2026 10:57:18 +0000 Received: by outflank-mailman (output) from mailman id 1455361.1669209; Tue, 20 Oct 2026 10:57:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Wu-0006tN-VQ; Tue, 20 Oct 2026 10:57:16 +0000 Received: by outflank-mailman (input) for mailman id 1455361; Tue, 20 Oct 2026 10:51:14 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7R4-0000F4-En for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:14 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7R3-002FaV-RW for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:13 +0200 Received: from [10.42.69.6] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74796-bab6-0a2a0a5309dd-0a2a4506ed12-36 for ; Tue, 20 Oct 2026 12:51:13 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad74764-195a-0a2a45060019-aa0a817c6f5d-3 for ; Tue, 20 Oct 2026 12:50:13 +0200 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-553-_7Frlu4AM46-pYvhF0dpvA-1; Tue, 20 Oct 2026 10:50:08 +0000 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 7188D1956076; Tue, 20 Oct 2026 10:50:03 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DC7271800586; Tue, 20 Oct 2026 10:50:00 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EljyyKpOaP+UVHeVMtiabRjWia9m5EXPj7DEMxHLTqI=; b=QMWsi5VVcviMK0s0SHV+TgMQk21CviSjtawjS/R8q89kZClam+7WG56cyle89XmhkpEnMp 9JMXCTEeMD61s7Ip6tjq2YTSPsDcHoc0fea4kdHHaI3V0ZcykzlXQ/yoMvpxa8DQuLr5za 0MvGekwskWGDTwuoBBqy1OmjO3Zc8Zo= X-MC-Unique: _7Frlu4AM46-pYvhF0dpvA-1 X-Mimecast-MFC-AGG-ID: _7Frlu4AM46-pYvhF0dpvA_1792493403 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:45:59 +0400 Subject: [PATCH v7 42/65] virtio-balloon: convert guest-stats property to QAPI type MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-42-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=10182; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=0g8PFfs3LJuc0BLWv6rMvjXCCHAbNtdnRJuucBbysso=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZbJgd7s8Bcgu4jJ87MBVuZ+yAsGD3uZV7Ld ZOdhpMi4vyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWwAKCRDa6OEJdZac 5a+iD/9O1qwWl2Gco4J1mBvanY/rwFGr7NPb9pyAfuwVDpozMDdvXhMl7hahB1Ds96uxJ/rE4qX SBiL4gdjh3V17vwq4s8eVGAy4vXzmKarp9JFyYGBdIYBMyaD/l/nF9JpCvzHBfeoJVaJiT1PQQt xYL67ZSgUBNuzxP6nOe8i/6molK+XMubhLA3Kq2QQXlkYO/VdfQtO/IJhzrmXxbG01aPW1rlCzK dpH2Pg86MU+st3pFO6V2u2mWPT4iBrhRvldHPguFEFz3XzWBP4mk0lC6FjZzlsEbsug2La+TE/A Cssx+kRcv3yHPtzgrG0dTA8JSlBWJMGi6Mj+MpceHoDoFYuX3fYpide5R/fVlg+SeNqlorDtHuk novEDfzkqUfPInZeNVGWeblx5V2CWdPPHGjJiTexE+gYnW0dCzCdm7huVbeMNcwx115bEnARo3K 3p5W5EaVBokC/qsklxmPmHMpC8HOC11c6bky6ZydQ9R0CXbJaooGegZUHMl8BQVojw9uT4HuIEf zhvHk7DKGkyT1aTa3Oe+Ey83EQ7NDIygPh75uIZjWT6gzgVMLebNYJMiE9wdeb8EdXuAg/JFEnW F8wmPQVW1QH9o6VSbwih+m8LfSoBGJO4URR1+cnKCLSUdPeyYFJmFz5ZccsUYDyKK8i/VtQMyW0 2U8t9WP1qP4jaPg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-MFC-PROC-ID: tIpB-4zpMbNMmps9qekzvNkoNPKCEbNfugiMWQYz9t8_1792493403 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-16d1c6/1792493413-FC80577B-77A5D993/0/0 X-purgate-type: clean X-purgate-size: 10184 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493869780158500 Define VirtioBalloonStats and VirtioBalloonGuestStats QAPI struct types in the schema, replacing the hand-rolled visitor in balloon_stats_get_all() with a generated visit_type_VirtioBalloonGuestStats() call. The wire format is preserved: the JSON output from qom-get is identical to the previous hand-rolled visitor output. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- docs/interop/virtio-balloon-stats.rst | 22 +-------- hw/virtio/virtio-balloon.c | 84 ++++++++++++-------------------- qapi/machine.json | 92 +++++++++++++++++++++++++++++++= ++++ 3 files changed, 123 insertions(+), 75 deletions(-) diff --git a/docs/interop/virtio-balloon-stats.rst b/docs/interop/virtio-ba= lloon-stats.rst index b9a6a6edb229..88d3271bbb02 100644 --- a/docs/interop/virtio-balloon-stats.rst +++ b/docs/interop/virtio-balloon-stats.rst @@ -22,27 +22,7 @@ polling the guest's balloon driver for new stats in the = specified time interval. =20 To retrieve those stats, clients have to query the guest-stats property, -which will return a dictionary containing: - - * A key named 'stats', containing all available stats. If the guest - doesn't support a particular stat, or if it couldn't be retrieved, - its value will be -1. Currently, the following stats are supported: - - - stat-swap-in - - stat-swap-out - - stat-major-faults - - stat-minor-faults - - stat-free-memory - - stat-total-memory - - stat-available-memory - - stat-disk-caches - - stat-htlb-pgalloc - - stat-htlb-pgfail - - * A key named last-update, which contains the last stats update - timestamp in seconds. Since this timestamp is generated by the host, - a buggy guest can't influence its value. The value is 0 if the guest - has not updated the stats (yet). +which will return a VirtioBalloonGuestStats (see QAPI documentation). =20 It's also important to note the following: =20 diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 7ffbe48e5134..bfc75f5dfc72 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -29,6 +29,8 @@ #include "qapi/error.h" #include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-events-machine.h" +#include "qapi/qapi-type-infos-machine.h" +#include "qapi/qapi-visit-machine.h" #include "qapi/visitor.h" #include "trace.h" #include "qemu/error-report.h" @@ -170,33 +172,8 @@ static void balloon_deflate_page(VirtIOBalloon *balloo= n, } } =20 -/* - * All stats upto VIRTIO_BALLOON_S_NR /must/ have a - * non-NULL name declared here, since these are used - * as keys for populating the QDict with stats - */ -static const char *balloon_stat_names[] =3D { - [VIRTIO_BALLOON_S_SWAP_IN] =3D "stat-swap-in", - [VIRTIO_BALLOON_S_SWAP_OUT] =3D "stat-swap-out", - [VIRTIO_BALLOON_S_MAJFLT] =3D "stat-major-faults", - [VIRTIO_BALLOON_S_MINFLT] =3D "stat-minor-faults", - [VIRTIO_BALLOON_S_MEMFREE] =3D "stat-free-memory", - - [VIRTIO_BALLOON_S_MEMTOT] =3D "stat-total-memory", - [VIRTIO_BALLOON_S_AVAIL] =3D "stat-available-memory", - [VIRTIO_BALLOON_S_CACHES] =3D "stat-disk-caches", - [VIRTIO_BALLOON_S_HTLB_PGALLOC] =3D "stat-htlb-pgalloc", - [VIRTIO_BALLOON_S_HTLB_PGFAIL] =3D "stat-htlb-pgfail", - - [VIRTIO_BALLOON_S_OOM_KILL] =3D "stat-oom-kills", - [VIRTIO_BALLOON_S_ALLOC_STALL] =3D "stat-alloc-stalls", - [VIRTIO_BALLOON_S_ASYNC_SCAN] =3D "stat-async-scans", - [VIRTIO_BALLOON_S_DIRECT_SCAN] =3D "stat-direct-scans", - [VIRTIO_BALLOON_S_ASYNC_RECLAIM] =3D "stat-async-reclaims", - - [VIRTIO_BALLOON_S_DIRECT_RECLAIM] =3D "stat-direct-reclaims", -}; -G_STATIC_ASSERT(G_N_ELEMENTS(balloon_stat_names) =3D=3D VIRTIO_BALLOON_S_N= R); +/* Update VirtioBalloonStats QAPI type when new stats are added */ +G_STATIC_ASSERT(VIRTIO_BALLOON_S_NR =3D=3D 16); =20 /* * reset_stats - Mark all items in the stats array as unset @@ -258,33 +235,31 @@ static void balloon_stats_get_all(Object *obj, Visito= r *v, const char *name, void *opaque, Error **errp) { VirtIOBalloon *s =3D VIRTIO_BALLOON(obj); - bool ok =3D false; - int i; + VirtioBalloonStats stats =3D { + .stat_swap_in =3D s->stats[VIRTIO_BALLOON_S_SWAP_IN], + .stat_swap_out =3D s->stats[VIRTIO_BALLOON_S_SWAP_OUT], + .stat_major_faults =3D s->stats[VIRTIO_BALLOON_S_MAJFLT], + .stat_minor_faults =3D s->stats[VIRTIO_BALLOON_S_MINFLT], + .stat_free_memory =3D s->stats[VIRTIO_BALLOON_S_MEMFREE], + .stat_total_memory =3D s->stats[VIRTIO_BALLOON_S_MEMTOT], + .stat_available_memory =3D s->stats[VIRTIO_BALLOON_S_AVAIL], + .stat_disk_caches =3D s->stats[VIRTIO_BALLOON_S_CACHES], + .stat_htlb_pgalloc =3D s->stats[VIRTIO_BALLOON_S_HTLB_PGALLOC], + .stat_htlb_pgfail =3D s->stats[VIRTIO_BALLOON_S_HTLB_PGFAIL], + .stat_oom_kills =3D s->stats[VIRTIO_BALLOON_S_OOM_KILL], + .stat_alloc_stalls =3D s->stats[VIRTIO_BALLOON_S_ALLOC_STALL], + .stat_async_scans =3D s->stats[VIRTIO_BALLOON_S_ASYNC_SCAN], + .stat_direct_scans =3D s->stats[VIRTIO_BALLOON_S_DIRECT_SCAN], + .stat_async_reclaims =3D s->stats[VIRTIO_BALLOON_S_ASYNC_RECLAIM], + .stat_direct_reclaims =3D s->stats[VIRTIO_BALLOON_S_DIRECT_RECLAIM= ], + }; + VirtioBalloonGuestStats guest_stats =3D { + .last_update =3D s->stats_last_update, + .stats =3D &stats, + }; + VirtioBalloonGuestStats *argp =3D &guest_stats; =20 - if (!visit_start_struct(v, name, NULL, 0, errp)) { - return; - } - if (!visit_type_int(v, "last-update", &s->stats_last_update, errp)) { - goto out_end; - } - - if (!visit_start_struct(v, "stats", NULL, 0, errp)) { - goto out_end; - } - for (i =3D 0; i < VIRTIO_BALLOON_S_NR; i++) { - if (!visit_type_uint64(v, balloon_stat_names[i], &s->stats[i], err= p)) { - goto out_nested; - } - } - ok =3D visit_check_struct(v, errp); -out_nested: - visit_end_struct(v, NULL); - - if (ok) { - visit_check_struct(v, errp); - } -out_end: - visit_end_struct(v, NULL); + visit_type_VirtioBalloonGuestStats(v, name, &argp, errp); } =20 static void balloon_stats_get_poll_interval(Object *obj, Visitor *v, @@ -1037,7 +1012,8 @@ static void virtio_balloon_instance_init(Object *obj) s->free_page_hint_cmd_id =3D VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN; s->free_page_hint_notify.notify =3D virtio_balloon_free_page_hint_noti= fy; =20 - object_property_add(obj, "guest-stats", "guest statistics", + object_property_add_qapi(obj, "guest-stats", + &VirtioBalloonGuestStats_type_info, balloon_stats_get_all, NULL, NULL, NULL); =20 object_property_add_qapi(obj, "guest-stats-polling-interval", &int_typ= e_info, diff --git a/qapi/machine.json b/qapi/machine.json index 9b145c635baf..34be3156270c 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1126,6 +1126,98 @@ ## { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } } =20 +## +# @VirtioBalloonStats: +# +# VirtIO balloon device guest memory statistics. +# +# If the guest doesn't support a particular stat, or if it couldn't +# be retrieved, its value will be -1. +# +# @stat-swap-in: The amount of memory that has been +# swapped in (in bytes). +# +# @stat-swap-out: The amount of memory that has been +# swapped out to disk (in bytes). +# +# @stat-major-faults: The number of major page faults +# that have occurred. +# +# @stat-minor-faults: The number of minor page faults +# that have occurred. +# +# @stat-free-memory: The amount of memory not being used +# for any purpose (in bytes). +# +# @stat-total-memory: The total amount of memory available +# (in bytes). +# +# @stat-available-memory: An estimate of how much memory is available +# (in bytes) for starting new applications, without pushing the +# system to swap. +# +# @stat-disk-caches: The amount of memory, in bytes, that can be +# quickly reclaimed without additional I/O. Typically these pages +# are used for caching files from disk. +# +# @stat-htlb-pgalloc: The number of successful hugetlb page +# allocations +# +# @stat-htlb-pgfail: The number of failed hugetlb page +# allocations +# +# @stat-oom-kills: The number of OOM killer invocations +# +# @stat-alloc-stalls: The number of memory allocation stalls +# +# @stat-async-scans: The number of memory scanned asynchronously +# +# @stat-direct-scans: The number of memory scanned directly +# +# @stat-async-reclaims: The number of memory reclaimed asynchronously +# +# @stat-direct-reclaims: The number of memory reclaimed directly +# +# Since: 11.2 +## +{ 'struct': 'VirtioBalloonStats', + 'data': { + 'stat-swap-in': 'uint64', + 'stat-swap-out': 'uint64', + 'stat-major-faults': 'uint64', + 'stat-minor-faults': 'uint64', + 'stat-free-memory': 'uint64', + 'stat-total-memory': 'uint64', + 'stat-available-memory': 'uint64', + 'stat-disk-caches': 'uint64', + 'stat-htlb-pgalloc': 'uint64', + 'stat-htlb-pgfail': 'uint64', + 'stat-oom-kills': 'uint64', + 'stat-alloc-stalls': 'uint64', + 'stat-async-scans': 'uint64', + 'stat-direct-scans': 'uint64', + 'stat-async-reclaims': 'uint64', + 'stat-direct-reclaims': 'uint64' } } + +## +# @VirtioBalloonGuestStats: +# +# Guest statistics from the VirtIO balloon device. +# +# @last-update: timestamp in seconds of the last stats +# update from the guest (since this timestamp is generated +# by the host, a buggy guest can't influence its value), +# or 0 if no update has been received yet. +# +# @stats: balloon memory statistics +# +# Since: 11.2 +## +{ 'struct': 'VirtioBalloonGuestStats', + 'data': { + 'last-update': 'int', + 'stats': 'VirtioBalloonStats' } } + ## # @query-balloon: # Return information about the balloon device. --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493669; cv=none; d=zohomail.com; s=zohoarc; b=hM1AHRpqRTb6zLp9adJ69/70ApMWnMZLDdLAugMsAbTOYEDQfxeXF53vuEmjm8xijwFaa83S6aF+fBwRA5kriNG9//V1TCtPETKnq/Jei8R9340mnOlN7hf8w2P+H2ureh9fIUTgS5UELyHj3AD0KUzKFLP0SCU1ca+nhRXKS5I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493669; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Itw7ntZ95b3QcknDaSfuTChM6ZY/eyyVFOmmM9NldCA=; b=Guh2I5J+bCc7GBUEB7zetxWfR1mhtRCBWUMGgo0YYaEbxicJ2gXowaaz+F93mXky0qBxATL1U+IGBslsUR8zcc8lmufn2qmdHFqZ/eelVNqg1R88jHdxcwUjR5AuXLhl+aWePlts9R6y3L0q9GvcuxxXW3GwuAjL3uQ0nWgQMas= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792493669878153.18233631416786; Tue, 20 Oct 2026 03:54:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7Sw-00020q-02; Tue, 20 Oct 2026 06:53:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7QA-0006ho-GT for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:50:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Q8-0006E2-3L for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:50:18 -0400 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-508-dvXahRDTM9ep7v5fxtgUQQ-1; Tue, 20 Oct 2026 10:50:13 +0000 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 250A01954B17; Tue, 20 Oct 2026 10:50:09 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D408F1800643; Tue, 20 Oct 2026 10:50:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Itw7ntZ95b3QcknDaSfuTChM6ZY/eyyVFOmmM9NldCA=; b=cqU7I/M25Gyzg0uMQhdJWzOInH8Xv5obTJ5bVsb+rS9/C18Jbffk23PMKxEm5/VxbEissu iebfpjpfdIPqdGGWymVPx58QrZYMkSy+b8634NRx6OY+KXudj7dClpXEDfV6a5OVXmiWCX +DWw9/2e/I+EBfzEu5OjEzP7PoNHdT8= X-MC-Unique: dvXahRDTM9ep7v5fxtgUQQ-1 X-Mimecast-MFC-AGG-ID: dvXahRDTM9ep7v5fxtgUQQ_1792493409 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:00 +0400 Subject: [PATCH v7 43/65] qom: replace object_property_add_tm with StructTm QAPI type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-43-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=10126; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=8en+VmzcHhkOLZUQUh0YjN1piPKoLpt2OiF/08xyjt4=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZbnN7eBjTOgKWdRnn37M96n/vY+BRbUyYzY fpY6OFY4GyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWwAKCRDa6OEJdZac 5YVUD/9onwAEiHq4pCCkbty5UAKselNdSCAGMHXx5SISVLS2Kwi85In4t9/kLGEyHrqHeZQuERb /DrZ3NA7govycT07do1BCxp0bJ9Tsl1z7uJ4Kjoa862ewDpOD825V9s/3o8StmpPJoOtYthPSyK gPvECR0A34F5byFx68WIF0RiEx5+zxT3cIWaS2BQ/n9aN+iP9nslNRRyVURbpSu/HLWg9PJ2RCo 6D4EIrnn+ct6phJy5oEmDmD8fuchqDjTRI5Uf+Of+uf/KkSFwFilkUS2gt3DtjU/dI/ngzQnQjM A4togvItM9aalAiU32Ccxvck2JsYA21Y4SU9yNvXyW3wGemfbFApSEM8JyNq3pc8zPpEjN5pwf3 pD1Me0RXjz5Hm8AMvVw4bQ9NruvfmbUxftEfh04ryFlAqRLb3zqC2EYQvIa57Lu637taVwqYF38 ChZGbQKAD9tG7noF8pinzh5OCw/N0JHhIMkXcugBD6Ib31pA8zY/ByWYHO+Vgsr53dLJGgHpYPT jN6RFE1SokU1E6XU978tXDwQMOmYbzZifj1e8yyZVjvS/7ewgYLNx4oszXrh2Ez++ApJnBhsfss aQUwz1FeO06KT5e6USlZd8/B5+Yq1ppDR7geKaJQU6y6wnWs2H4dE61Y+jbOF1Ck6NK8ECMGVBo 8wUA5cr0hid+yZw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493672122158500 Define a StructTm QAPI struct in common.json matching the existing "struct tm" property wire format (tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec as int32). Convert the two callers (mc146818rtc and spapr_rtc) to use object_property_add_qapi() with a standard ObjectPropertyAccessor that populates a StructTm and calls the generated visitor. Remove object_property_add_tm(), object_class_property_add_tm(), the TMProperty type, and the property_get_tm() helper from qom/object.c, along with their declarations in object.h. Reviewed-by: Amit Machhiwal Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/ppc/spapr_rtc.c | 24 +++++++++++++++--- hw/rtc/mc146818rtc.c | 22 ++++++++++++++--- include/qom/object.h | 29 ---------------------- qapi/common.json | 28 +++++++++++++++++++++ qapi/pragma.json | 1 + qom/object.c | 69 ------------------------------------------------= ---- 6 files changed, 69 insertions(+), 104 deletions(-) diff --git a/hw/ppc/spapr_rtc.c b/hw/ppc/spapr_rtc.c index 1f7d2d8f898b..5105cf538f64 100644 --- a/hw/ppc/spapr_rtc.c +++ b/hw/ppc/spapr_rtc.c @@ -33,6 +33,9 @@ #include "migration/vmstate.h" #include "qapi/error.h" #include "qapi/qapi-events-misc.h" +#include "qapi/qapi-type-infos-common.h" +#include "qapi/qapi-visit-common.h" +#include "qapi/visitor.h" #include "qemu/cutils.h" #include "qemu/module.h" =20 @@ -131,9 +134,23 @@ static void rtas_set_time_of_day(PowerPCCPU *cpu, Spap= rMachineState *spapr, rtas_st(rets, 0, RTAS_OUT_SUCCESS); } =20 -static void spapr_rtc_qom_date(Object *obj, struct tm *current_tm, Error *= *errp) +static void spapr_rtc_qom_date(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { - spapr_rtc_read(SPAPR_RTC(obj), current_tm, NULL); + struct tm value; + StructTm tm, *tmp =3D &tm; + + spapr_rtc_read(SPAPR_RTC(obj), &value, NULL); + + tm =3D (StructTm) { + .tm_year =3D value.tm_year, + .tm_mon =3D value.tm_mon, + .tm_mday =3D value.tm_mday, + .tm_hour =3D value.tm_hour, + .tm_min =3D value.tm_min, + .tm_sec =3D value.tm_sec, + }; + visit_type_StructTm(v, name, &tmp, errp); } =20 static void spapr_rtc_realize(DeviceState *dev, Error **errp) @@ -150,7 +167,8 @@ static void spapr_rtc_realize(DeviceState *dev, Error *= *errp) rtc_ns =3D qemu_clock_get_ns(rtc_clock); rtc->ns_offset =3D host_s * NANOSECONDS_PER_SECOND - rtc_ns; =20 - object_property_add_tm(OBJECT(rtc), "date", spapr_rtc_qom_date); + object_property_add_qapi(OBJECT(rtc), "date", &StructTm_type_info, + spapr_rtc_qom_date, NULL, NULL, NULL); } =20 static const VMStateDescription vmstate_spapr_rtc =3D { diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index ba396435d1af..6010f8587ce0 100644 --- a/hw/rtc/mc146818rtc.c +++ b/hw/rtc/mc146818rtc.c @@ -42,6 +42,8 @@ #include "migration/vmstate.h" #include "qapi/error.h" #include "qapi/qapi-events-misc.h" +#include "qapi/qapi-type-infos-common.h" +#include "qapi/qapi-visit-common.h" #include "qapi/visitor.h" #include "trace.h" =20 @@ -854,12 +856,25 @@ static const MemoryRegionOps cmos_ops =3D { .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 -static void rtc_get_date(Object *obj, struct tm *current_tm, Error **errp) +static void rtc_get_date(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { MC146818RtcState *s =3D MC146818_RTC(obj); + struct tm value; + StructTm tm, *tmp =3D &tm; =20 rtc_update_time(s); - rtc_get_time(s, current_tm); + rtc_get_time(s, &value); + + tm =3D (StructTm) { + .tm_year =3D value.tm_year, + .tm_mon =3D value.tm_mon, + .tm_mday =3D value.tm_mday, + .tm_hour =3D value.tm_hour, + .tm_min =3D value.tm_min, + .tm_sec =3D value.tm_sec, + }; + visit_type_StructTm(v, name, &tmp, errp); } =20 static void rtc_realizefn(DeviceState *dev, Error **errp) @@ -1019,7 +1034,8 @@ static void rtc_class_initfn(ObjectClass *klass, cons= t void *data) device_class_set_props(dc, mc146818rtc_properties); set_bit(DEVICE_CATEGORY_MISC, dc->categories); =20 - object_class_property_add_tm(klass, "date", rtc_get_date); + object_class_property_add_qapi(klass, "date", &StructTm_type_info, + rtc_get_date, NULL, NULL, NULL); } =20 static const TypeInfo mc146818rtc_info =3D { diff --git a/include/qom/object.h b/include/qom/object.h index e04be4caed57..29cbd84b8d03 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -2156,35 +2156,6 @@ object_class_property_add_qapi(ObjectClass *klass, ObjectPropertyRelease *release, void *opaque); =20 -/** - * object_property_add_tm: - * @obj: the object to add a property to - * @name: the name of the property - * @get: the getter or NULL if the property is write-only. - * - * Add a read-only struct tm valued property using a getter function. - * This function will add a property of type 'struct tm'. - * - * Returns: The newly added property on success, or %NULL on failure. - */ -ObjectProperty *object_property_add_tm(Object *obj, const char *name, - void (*get)(Object *, struct tm *, Error **)); - -/** - * object_class_property_add_tm: - * @klass: the object class to add a property to - * @name: the name of the property - * @get: the getter or NULL if the property is write-only. - * - * Add a read-only struct tm valued property using a getter function. - * This function will add a property of type 'struct tm'. - * - * Returns: The newly added property on success, or %NULL on failure. - */ -ObjectProperty *object_class_property_add_tm(ObjectClass *klass, - const char *name, - void (*get)(Object *, struct tm *, Error **)); - typedef enum { /* Automatically add a getter to the property */ OBJ_PROP_FLAG_READ =3D 1 << 0, diff --git a/qapi/common.json b/qapi/common.json index 1352e664b23e..222037ea0b32 100644 --- a/qapi/common.json +++ b/qapi/common.json @@ -218,3 +218,31 @@ ## { 'enum': 'EndianMode', 'data': [ 'unspecified', 'little', 'big' ] } + +## +# @StructTm: +# +# Broken-down time. Field semantics match C ``struct tm``. +# +# @tm_year: years since 1900 +# +# @tm_mon: months since January (0-11) +# +# @tm_mday: day of the month (1-31) +# +# @tm_hour: hours since midnight (0-23) +# +# @tm_min: minutes after the hour (0-59) +# +# @tm_sec: seconds after the minute (0-59, 60-61 for leap seconds) +# +# Since: 11.2 +## +{ 'struct': 'StructTm', + 'data': { + 'tm_year': 'int32', + 'tm_mon': 'int32', + 'tm_mday': 'int32', + 'tm_hour': 'int32', + 'tm_min': 'int32', + 'tm_sec': 'int32' } } diff --git a/qapi/pragma.json b/qapi/pragma.json index 342cedc42e76..9be2819a46bd 100644 --- a/qapi/pragma.json +++ b/qapi/pragma.json @@ -109,6 +109,7 @@ 'QKeyCode', # send-key, input-sent-event 'QapiErrorClass', # QMP error replies 'SshHostKeyCheckMode', # blockdev-add, -blockdev + 'StructTm', # qom-get of RTC date property 'SysEmuTarget', # query-cpu-fast, query-target 'UuidInfo', # query-uuid 'VncClientInfo', # query-vnc, query-vnc-servers, ... diff --git a/qom/object.c b/qom/object.c index 9f9a2abfa08d..cf18880c6c0c 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2721,75 +2721,6 @@ object_class_property_add_qapi(ObjectClass *klass, c= onst char *name, return prop; } =20 -typedef struct TMProperty { - void (*get)(Object *, struct tm *, Error **); -} TMProperty; - -static void property_get_tm(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - TMProperty *prop =3D opaque; - Error *err =3D NULL; - struct tm value; - - prop->get(obj, &value, &err); - if (err) { - error_propagate(errp, err); - return; - } - - if (!visit_start_struct(v, name, NULL, 0, errp)) { - return; - } - if (!visit_type_int32(v, "tm_year", &value.tm_year, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_mon", &value.tm_mon, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_mday", &value.tm_mday, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_hour", &value.tm_hour, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_min", &value.tm_min, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_sec", &value.tm_sec, errp)) { - goto out_end; - } - visit_check_struct(v, errp); -out_end: - visit_end_struct(v, NULL); -} - -ObjectProperty * -object_property_add_tm(Object *obj, const char *name, - void (*get)(Object *, struct tm *, Error **)) -{ - TMProperty *prop =3D g_malloc0(sizeof(*prop)); - - prop->get =3D get; - - return object_property_add(obj, name, "struct tm", - get ? property_get_tm : NULL, NULL, - property_release_data, - prop); -} - -ObjectProperty * -object_class_property_add_tm(ObjectClass *klass, const char *name, - void (*get)(Object *, struct tm *, Error **)) -{ - TMProperty *prop =3D g_malloc0(sizeof(*prop)); - - prop->get =3D get; - - return object_class_property_add(klass, name, "struct tm", - get ? property_get_tm : NULL, - NULL, NULL, prop); -} =20 static char *object_get_type(Object *obj, Error **errp) { --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493651; cv=none; d=zohomail.com; s=zohoarc; b=PFdEYDON/tlKtlOh3M/+YTqoR4XwpRMK/3zl89jLdSDDihipLysmTy94YcJJizgRqezsQOtJGE0jGLWe65aDFYhSOFJIsvZtYiVwTQVWMDwgqsQYKviIBI/JDM+xq5Bz6Ulp2fJfs+2IyCnJtc2m+tx+w+fG+YwlEIKvyx1kTf4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493651; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5CC43HGq5NqmO9GuRv3YOCIPDVNxOH0lYT23DJe+EOs=; b=Lprg0fUOl5Jbo9iDg+4Pakfp9pTF+QJKbfLmN7NGBoeWwhsGH3ogDZHk81IkTxeV0jG8TPlqkDQpucnqaJKmf4R571rLNji4ZnTt4mOh1BRFXNmVX2MgiUapxwsQmJN7yKBO6a6Myx/ljVbx/m7pVVfHzqH9S87LmyS1wGdUAZA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792493651572264.81026104178056; Tue, 20 Oct 2026 03:54:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7T8-0002QW-8e; Tue, 20 Oct 2026 06:53:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7QH-00073O-6W for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:50:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7QF-0006HO-4Z for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:50:24 -0400 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-461-0yk3KpK5MBKZ9_x5V_hyRg-1; Tue, 20 Oct 2026 10:50:18 +0000 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 78F3E1954102; Tue, 20 Oct 2026 10:50:14 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8AABE1956095; Tue, 20 Oct 2026 10:50:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5CC43HGq5NqmO9GuRv3YOCIPDVNxOH0lYT23DJe+EOs=; b=W/bpnmLm1Uz2WwbuFjvvC0161c0UZylGBi05TIrDD6OdY70s/V7tEQJh+OzlK0yT+e2Se9 IIvy/MRguNONDAAB4b604Eax8BDWfIXsUWil1P2d8woCzBuyrkAIhthNBFDOiPM4eEvhYS 7SU/fzcHnFkesHVLHEn8PU81pEc/h48= X-MC-Unique: 0yk3KpK5MBKZ9_x5V_hyRg-1 X-Mimecast-MFC-AGG-ID: 0yk3KpK5MBKZ9_x5V_hyRg_1792493414 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:01 +0400 Subject: [PATCH v7 44/65] hw/nvdimm: convert UUID property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-44-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2398; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=JcrXJbY3n1i8Aie2efrfuUCSPF/58nBE1VKv/oA1cHQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10Zb3uRNyW/Ops8TO0GvUmz+pY4b6iH48X9V4 dT8KSx5JbWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWwAKCRDa6OEJdZac 5eITD/46vxBPKKy5DKVq41RW+PpNl8DJi94l5Ic/FKfo92YajuNHmy1WErhgftc0rpWEf92vWp2 /kk3U5z38JmBDTtBklsCNKY8V6UA1XuWHNxhMtpJz2/4uluVz/cPDYqtyc5XAf9WWJkCw/hKmmS GadWFMgjwRsGaAuWAT8IbDB82XGWkgzxZBqh76fEVznt+V5gX1shJ/a/u7KUcuHEJIPgCWlTFJL QBCIrSrvGW7MWZ0xI6AR+EAtJ5oG9xc74eILqmJoNMDhp/m+1JEEOl25Mbb1EyX6EfB8kpzqdSH KM5tKqVXHz/gpPWacm9DzXGSH+nsG/v0CDnsS4ywByxghoIzo5/Ky0uP3XENBVy1UT+Uf8hu9t5 CD+bEOs7ExRxdT41kAbWSQ1vB42SwN1uJkXot5RNttTmmYv0IAoxkSuNpwJa+Cs1fdhKaoPZfil VUqLPeJmD5Q6WahLYyg8bC0pz2HjinNVlT0LFkveiW9+hmae361bD7hOPLGVvxO7cDzDUOLn1Xm E/kEb3lwBP8u23KM6nwMg79RA4QttKHK8lFNs00JdB3dg5vTZuLt8HetlALcd+9l8UGL2rTRW1P hEksQQ1rUSoEHWaxQZgtclQUsPD8AksY8ygzbhXCo6fmu78aH5/mTWRUeItn2w9Ul5sPsE2sTFj 9RH9c/P0NdV/h2w== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493653728158500 Add a QemuUUID_type_info and use object_property_add_qapi() instead of object_property_add() for the nvdimm UUID property. The type info is defined manually in uuid.c rather than generated, since QAPI does not yet support string typedefs. An alternative would be to extend the QAPI schema language with a 'typedef' construct (e.g. { 'typedef': 'UUID', 'data': 'str' }), which would let the generator produce the type info, C typedef, and introspection entry automatically. Alternatively, the exposed type being a string, we could change the property to be str_type_info. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/mem/nvdimm.c | 4 ++-- include/qemu/uuid.h | 4 ++++ util/uuid.c | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index 123ddc938546..b7ccb5c93678 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -104,8 +104,8 @@ static void nvdimm_init(Object *obj) nvdimm_get_label_size, nvdimm_set_label_size,= NULL, NULL); =20 - object_property_add(obj, NVDIMM_UUID_PROP, "QemuUUID", nvdimm_get_uuid, - nvdimm_set_uuid, NULL, NULL); + object_property_add_qapi(obj, NVDIMM_UUID_PROP, &QemuUUID_type_info, + nvdimm_get_uuid, nvdimm_set_uuid, NULL, NULL); } =20 static void nvdimm_finalize(Object *obj) diff --git a/include/qemu/uuid.h b/include/qemu/uuid.h index 869f84af09dd..ed0c62327d4d 100644 --- a/include/qemu/uuid.h +++ b/include/qemu/uuid.h @@ -16,6 +16,8 @@ #ifndef QEMU_UUID_H #define QEMU_UUID_H =20 +#include "qapi/qapi-type-info.h" + =20 /* Version 4 UUID (pseudo random numbers), RFC4122 4.4. */ =20 @@ -99,4 +101,6 @@ QemuUUID qemu_uuid_bswap(QemuUUID uuid); =20 uint32_t qemu_uuid_hash(const void *uuid); =20 +extern const QAPITypeInfo QemuUUID_type_info; + #endif diff --git a/util/uuid.c b/util/uuid.c index 234619dd5e69..363a03051aba 100644 --- a/util/uuid.c +++ b/util/uuid.c @@ -17,6 +17,11 @@ #include "qemu/uuid.h" #include "qemu/bswap.h" =20 +const QAPITypeInfo QemuUUID_type_info =3D { + .name =3D "QemuUUID", + .masked_name =3D "str", +}; + void qemu_uuid_generate(QemuUUID *uuid) { int i; --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493880; cv=none; d=zohomail.com; s=zohoarc; b=nKuQ+PynnOv5iPfwOtnTR/DugjiYUua5UsTeVFBYa79nlSE65pgpyXMWLt3rZNs7q7tDfPhbyrElpXIjOOGJmkESmWsDNoTsIt91BBj0M66lzjrusQOK3eN4O4HmLw2nKzuuuFqfWw3zXJ0SbS6Um89bGkSGEOna98kwBWMlv+4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493880; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cjstbMWmXOAnQJ0vRg4/TV0UxKxkDAMv9/7iDMdvYXk=; b=jp+iOCCi4/MhsVUWa1U3wzCIyO3L7qwjhCplneC9TUkwW+mAl+3GbFm59I9FCWlDU/Rak2JFmK0j28RsMj1bWWrDsX4Klegjuxkce9O8RQuJrSB2cRMfY3oiwkvB+w5hzqC0o8I+hax3hJ5A2qeHb7d3tqEkVibLaaY9uhddBco= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493880528972.0869761173803; Tue, 20 Oct 2026 03:58:00 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455385.1669304 (Exim 4.92) (envelope-from ) id 1xJ7XK-0003fP-T1; Tue, 20 Oct 2026 10:57:42 +0000 Received: by outflank-mailman (output) from mailman id 1455385.1669304; Tue, 20 Oct 2026 10:57:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7XJ-0003YG-O1; Tue, 20 Oct 2026 10:57:41 +0000 Received: by outflank-mailman (input) for mailman id 1455385; Tue, 20 Oct 2026 10:51:30 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7RK-0000Lp-3A for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:30 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7RJ-00HSQO-G6 for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:29 +0200 Received: from [10.42.69.11] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad747b1-bab6-0a2a0a5309dd-0a2a450b8e48-0 for ; Tue, 20 Oct 2026 12:51:29 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad74774-b7e8-0a2a450b0019-aa0a857c6d91-3 for ; Tue, 20 Oct 2026 12:50:29 +0200 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-142-LEtBYtaXNhep3HOST1h5pg-1; Tue, 20 Oct 2026 06:50:24 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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 C61F61955DA5; Tue, 20 Oct 2026 10:50:19 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 854725BC; Tue, 20 Oct 2026 10:50:16 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cjstbMWmXOAnQJ0vRg4/TV0UxKxkDAMv9/7iDMdvYXk=; b=XSffY2IVRgKgqakC6JFT2BMyHFj54TJXSMa5xU8QBEIRxg5dsbGsaWvi+/pHaj3+eRokW0 qn1zCMaRbLDwnuJ94IPUwSpWYP8YhZiu1/RaIzLsTmOvRrL0Qjj7FQBlojsaIcts423yVY cE9YQQJd2SiIeiKrPZB49vwaau/9VhQ= X-MC-Unique: LEtBYtaXNhep3HOST1h5pg-1 X-Mimecast-MFC-AGG-ID: LEtBYtaXNhep3HOST1h5pg_1792493420 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:02 +0400 Subject: [PATCH v7 45/65] hw/s390-virtio-ccw: convert loadparm property to QAPI-aware registration MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-45-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1438; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=kUpPGFy4418k+1NoT02grj7G7ylnBF+ugRFLSNuQ/I8=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZbZ381/sBWM1azZ53D7cfjK2vNDIyCM5jiw Xz8ukfeXYKJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWwAKCRDa6OEJdZac 5WE7EACcNb6WUPAXGp4swEqKgOrI7mRkcimuGMJxDQptX6voqKSzXDGgbjpNbOpCSvTsAUBzqkf VmQ+u1XXdOcMUFOXV12h+uVIagNkH/FDk+vj6EhW+7Kv+xUWHQwihzevCBsOe5YRu7AoC5JFL7e 0gnAXgwlHoUc7rofc1b2A696Xi73B0BOxB5zdDwbfJPmC+zNLT3hs1Td4Kz/nHF5mI2tkY38zor J9Gu+Zngb8i7tCVWNN4rxMRTflUnEleoTBaZ/MzpgKLm6BMGvNB/RklxuTW9RaHm5c7Hn2tOkUX BjBeCAlN8BDg+4cPXlsrKBOZG04cS8ma9QO+ZFcTJJ0v6YXzwA+GsHW4fPIoGszFa+UyJOoyFyZ JjxorHFP+v58GJcIr421M6yCPKqLa70RxTrPsVBPMAHrP0TejWLeOs0hIrNkRiE5+2601BD6apI rZkqEk8rXGc2YmuOolkjrs6b6PIw2R6sibjUwbIPFEHNu7HbC/WLZG6sxGdbaHB5xKhjg7Yo0Hf sljEdE+S9n89L1t8za9aF28F5ivQkNlw/vJ2npjoxGF9L6HCdk+EiYF61ps7MRQR9ViFVustynh PdOoORH0IHDSPitjUdZoIvZb6i6CW8KZCeXn1ZUTNMv/w8f9vbbxVroo3zzRSKiilj8k+2MxLjs N6G+newXEeukaug== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-MFC-PROC-ID: vqv6ZsqdlPP53dCUgsK0l7KtoPyI116VmiZcYaluEWk_1792493420 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-42698a/1792493429-AA8D99EA-6ADA8562/0/0 X-purgate-type: clean X-purgate-size: 1440 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493881913158500 The QAPI type is actually a string. Here also, if we had typedef support we could expose a more specific type. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/s390x/s390-virtio-ccw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index fda5ecc9ad3c..3ed425b16c3e 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -43,6 +43,7 @@ #include "system/hostmem.h" #include "target/s390x/kvm/pv.h" #include "migration/blocker.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qapi/qapi-visit-machine-s390x.h" #include "hw/s390x/cpu-topology.h" @@ -908,7 +909,8 @@ static void ccw_machine_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, "dea-key-wrap", "enable/disable DEA key wrapping using the CPACF wrapping key"= ); =20 - object_class_property_add(oc, "loadparm", "loadparm", + /* if QAPI learns to typedef str, we could expose a more specific type= */ + object_class_property_add_qapi(oc, "loadparm", &str_type_info, machine_get_loadparm, machine_set_loadparm, NULL, NULL); object_class_property_set_description(oc, "loadparm", --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493801; cv=none; d=zohomail.com; s=zohoarc; b=Z/eJ56wSG0Y9yyhmZD9RreQcaMigcllSIyKNyvtNuvAsgEqQN/IDzb/d93IvvgJMpcLO8f9pjnl+pvRg0fgB8w/J+z71HafsKf59wab5Zyjjw7ajDVruu6b1s1hCTctfLkMkXG6cZsfI5o9Dj+iTf2laADJCE1LZjkSHkcZ28KA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493801; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=stj/oklFy5XE7Ux6UVzd34CG7YO8zlEFRRZGNs4BwjQ=; b=aUHpKmXvXELyL06mx78Y9ms5YzFKd5VTLWTS3I2TGTG6PMpTMbnNxUgPhG8/XKH94113+ppSI3KqVQ3I77yM7qjQteMSQuCd0gB2u6bQV7kMBGT8zC39dsNr4tSek1oOq1bZX+zpU5uZrj+IiDKmu8U74VncbKW7pdNfu7QTFqs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493801038103.33113250456609; Tue, 20 Oct 2026 03:56:41 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455302.1668939 (Exim 4.92) (envelope-from ) id 1xJ7Vw-0002qy-8a; Tue, 20 Oct 2026 10:56:16 +0000 Received: by outflank-mailman (output) from mailman id 1455302.1668939; Tue, 20 Oct 2026 10:56:16 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Vv-0002ni-LH; Tue, 20 Oct 2026 10:56:15 +0000 Received: by outflank-mailman (input) for mailman id 1455302; Tue, 20 Oct 2026 10:50:36 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7QS-0008Qv-LU for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:50:36 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7QR-004cyI-Uv for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:50:35 +0200 Received: from [10.42.69.6] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74775-8faa-0a2a0a5109dd-0a2a4506bdee-32 for ; Tue, 20 Oct 2026 12:50:35 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad7477a-195a-0a2a45060019-aa0a857c58db-3 for ; Tue, 20 Oct 2026 12:50:35 +0200 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-656-Cd5iFrsSPFiy_O9eCidOaQ-1; Tue, 20 Oct 2026 10:50:30 +0000 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 C16C31955DE8; Tue, 20 Oct 2026 10:50:24 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4304D1956095; Tue, 20 Oct 2026 10:50:22 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=stj/oklFy5XE7Ux6UVzd34CG7YO8zlEFRRZGNs4BwjQ=; b=FA0d2bZnAjmxVWje6jrukFJntl8LiVIkhaR2F4/sYQiFzzxjDZjYwU0+k2L+2hmOh0kOs6 NGTCd6tAIogNIkzjpZnuTBTOijskLjMXw/PYFRv5NLwTxBguhSwKPlbmuFabxHk5BLVOvH w6Q9huSBL1rRBYe+t1owfKD78Tazug0= X-MC-Unique: Cd5iFrsSPFiy_O9eCidOaQ-1 X-Mimecast-MFC-AGG-ID: Cd5iFrsSPFiy_O9eCidOaQ_1792493424 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:03 +0400 Subject: [PATCH v7 46/65] hw/ppc/spapr_drc: convert fdt property to QAPI-aware registration MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-46-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1126; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=tzAtw2N/GmjCt5f2xymcXMco6tXqwvWNy/tFAoovn48=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZbrmMIXAAgbwi3HHXAfckNSBqoT7PupXMdX jNNL1pkTe6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWwAKCRDa6OEJdZac 5ZtBD/9HzJq3j9NRTh8cC/IrlGiBUn7R8G3aWpPmmvNkh3x2f+rQGtv+c4/4fZ5SVY8vIMlozLI LUxj6qGBu0GxrQWT8fSd91RvbaYDeiByrDclv6ElUBKkE+tgleBEJUKwQJfK3M0e39H0MbjtzRg dxzN4rNG0OtE8h6qgxhP29CFH3AITnPK6JfYp3BIuQLwbsy/HZwgwge9j97HT9lCQ3XaWTtwWEp mj+SjQmSYNj3MWpB5O71V5XG20mItYobMA5CEVyvnwge7sN5eyuap4ds31caHAW78QyHPlOFVoC mLdbsQcFaIesAIo6kEnisNkqHnb8yVLFTI6dZfqTwCKl2twuRgOyGq3sME35mvXwpXYnk7ngkNm 4Wv7Qk3oqp9AjkpD2TpcMxKOiMI/qMeCTzwBE3Ul8FypE56v856BMn24Tr0BYUM36SttPitGe8O y06nmXFiwC88uT5JL/gPnfbVYmjDD8CwTftjlcRo66wdO/Uj1cC4+wc1ynGvOspelolj6z9kjry bcWiTwBgrkt3gSwktkytTSDlZ5MqNlPDv0mE82BFtszFNBtxOhfX0w97OQzXtVLle5h+YKHfgdn N5d4ugnLs5FJL1SrpPAd+tbg85sl64x/ZW1OdnyMEQL9XhQtUEDzjmQBCxiIyHOFat+aC63mV0H gQWNLU0ZIgJd7oA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-MFC-PROC-ID: _nnVg7BEkDR_5LkQkCG8wdxg9IDhvmWsX7fRsSmZsBA_1792493424 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-16d1c6/1792493435-FC40377B-124A8830/0/0 X-purgate-type: clean X-purgate-size: 1128 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493802442158500 Use object_property_add_qapi() with any_type_info for the "fdt" property, since the FDT structure is dynamically shaped at runtime and cannot be represented as a static QAPI type. Reviewed-by: Amit Machhiwal Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/ppc/spapr_drc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 64f9ca29b02e..740149ffdf3e 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -587,7 +587,7 @@ static void spapr_dr_connector_instance_init(Object *ob= j) object_property_add_uint32_ptr(obj, "id", &drc->id, OBJ_PROP_FLAG_READ= ); object_property_add_qapi(obj, "index", &uint32_type_info, prop_get_ind= ex, NULL, NULL, NULL); - object_property_add(obj, "fdt", "struct", prop_get_fdt, + object_property_add_qapi(obj, "fdt", &any_type_info, prop_get_fdt, NULL, NULL, NULL); drc->state =3D drck->empty_state; } --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493808; cv=none; d=zohomail.com; s=zohoarc; b=j9X2BqI5+LaiHFunBHDXK0dsFvxHIj+mCgS12n31pOf5uh5g0pWKxz39hPV9njXluLGU9H+BHKzOx4rMUFJ0Tao7sjE8yQ6agilM4nURaHic4omxNUm9DCRQvFhiPAi65MLngpFW53LfuGr3UHlfom+KGFYuFAchOIx1goOm/q4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493808; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wDKqI9lxsJYOWv5oXkIIVMolronNVooZmn3jjB1NaoM=; b=RZ8SWLdMCLu8jIXmt/7fxxFv1vjALK9WnCiRFP2XEGerb5ixM1t2o90IR3qw3+EnJWooKQNVEMLhVkuS4qo10TIyZN1twfuLLfnI6lV7NHmr4EmjGFd+AN/SQIBBgS7vW9H/GxvpE8MDijogtVJtxAeAMvgvgRM7VqUWPdGIT+U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493807968170.17702281770153; Tue, 20 Oct 2026 03:56:47 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455312.1668991 (Exim 4.92) (envelope-from ) id 1xJ7W4-0004al-S5; Tue, 20 Oct 2026 10:56:24 +0000 Received: by outflank-mailman (output) from mailman id 1455312.1668991; Tue, 20 Oct 2026 10:56:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7W3-0004Ui-JT; Tue, 20 Oct 2026 10:56:23 +0000 Received: by outflank-mailman (input) for mailman id 1455312; Tue, 20 Oct 2026 10:50:42 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7QY-0008T3-J6 for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:50:42 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7QY-002FRA-03 for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:50:42 +0200 Received: from [10.42.69.2] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74779-bab6-0a2a0a5309dd-0a2a4502e220-30 for ; Tue, 20 Oct 2026 12:50:41 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad74780-6ca4-0a2a45020019-aa0a857c9cdd-3 for ; Tue, 20 Oct 2026 12:50:41 +0200 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-694-nPrkmqWhMXen_3R1vU7oZw-1; Tue, 20 Oct 2026 10:50:34 +0000 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 06E3A1805A18; Tue, 20 Oct 2026 10:50:30 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D157218005B8; Tue, 20 Oct 2026 10:50:26 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wDKqI9lxsJYOWv5oXkIIVMolronNVooZmn3jjB1NaoM=; b=JnSpf3wkoHQHHOIAZ6Y9OpdY5+3qdd/WVTpPWP2/pBk31YNgGDzJLoiiCvAm2aBDxBcbNq wOVT2Vvgn9/FBcozigME5XA3dxwUym/aBfkPuC6Xwb6xUKKZqM9WRiO8Ia889aTJfSIid0 VjvCKp7r82Zl8AC+PX7K9F1hSI9pnZk= X-MC-Unique: nPrkmqWhMXen_3R1vU7oZw-1 X-Mimecast-MFC-AGG-ID: nPrkmqWhMXen_3R1vU7oZw_1792493430 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:04 +0400 Subject: [PATCH v7 47/65] hw/s390x: convert BootCertificatesList to QAPI-aware registration MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-47-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1505; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=wdbhYWD/vf672j0phUbR1cOU3kwkLl3/cupZ0YaTznU=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZbDkYgPj0HDzsA3Y34WzGHrPrDPeDHvzd0l wPaLOFmX3WJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWwAKCRDa6OEJdZac 5QyFD/0b7xA4ChrYMo5WcQsrtlQZqCXFanjHmndWojPNq6E6DJrh7yNweRlM5B8GO8az5oyA75h sUttRiBWYNvMnlgXQtH/nE8T96ywsGyTT9ZInHttlzN9P5Fh5Kr/SqOcHkuYj6mXh4Qo8l9kpkX 5Ls7K8Ke23byTyibodkbaedkpfdM3EpJ3hzQ5r3Cbp68RrQqxPRAGGe+DEVXyTzCaUIrg/oKuKl ee+1owd49sj/oDWlsbQ8JKwkl9rM61yJQqCHZ/8bYXLsQ8Sy+lP6fJkHm9Ng4C2rM7dDW0wPeZJ /AnxrnFDz+SaS70Z+Q7qSIRHxareyWZJA0rnKOl82n26hwJ2mAFFTibkJxJPdnojLqX+mWBzWUU 61jumL2L/vI6Hbuh3iO7YnsdjYk+RAjIYNyc/LVGHWFYLkgevtNRkvL4bo4c8ILFq/kfEbpOOX9 IJctXj/7n79Sx62wNtTjV3Wmenr+zMkYIemOn14uqf9VuXdkB0ih5iiJgO031WJpDUGUW/l3UO0 Nt1goAs8YdyzC1w+yD/OBemcsUJMxG2IKhcXMBoyjQtwO1hYYX+0qqyxosT72NLiOrgKTvIWx/C AamF9QKFFgHdWVkuKlqIBCfed1sEkedvwsLa07Bik/rEdPJdSrKHrHCPDZ9x/Q5r3QVwD+zyVVq V10wnjLfSGUrDTg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-MFC-PROC-ID: utdPST58jF8PmTWVmLhvTFx64KcObVXir9opW5y0A2w_1792493430 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-720697/1792493441-676BF2AC-68B38349/0/0 X-purgate-type: clean X-purgate-size: 1507 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493808519158500 Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/s390x/s390-virtio-ccw.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 3ed425b16c3e..8bc09c179552 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -44,6 +44,7 @@ #include "target/s390x/kvm/pv.h" #include "migration/blocker.h" #include "qapi/qapi-builtin-type-infos.h" +#include "qapi/qapi-type-infos-machine-s390x.h" #include "qapi/visitor.h" #include "qapi/qapi-visit-machine-s390x.h" #include "hw/s390x/cpu-topology.h" @@ -918,8 +919,10 @@ static void ccw_machine_class_init(ObjectClass *oc, co= nst void *data) " to upper case) to pass to machine loader, boot manager," " and guest kernel"); =20 - object_class_property_add(oc, "boot-certs", "BootCertificatesList", - machine_get_boot_certs, machine_set_boot_cer= ts, NULL, NULL); + object_class_property_add_qapi(oc, "boot-certs", + &BootCertificatesList_type_info, + machine_get_boot_certs, + machine_set_boot_certs, NULL, NULL); object_class_property_set_description(oc, "boot-certs", "provide paths to a directory and/or a certificate file for se= cure boot"); =20 --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493809; cv=none; d=zohomail.com; s=zohoarc; b=UYLULUuFeUkJoYyF2eSfCye1ha1W+kkZYl+QOtLeZHHyeYmh2bh3cq9O6WOxwVv1UYbcLom6Oh+2FACUwdARTFim5tEI8NJy1Tkzkuf+G7Dt9geCsdkjdmnmLQ9RjVj/Wrb3kQM2lQRlsO5bPJXEU1PpvodXto4y1TPxnSK8KpY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493809; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qwky9rRTw8oAHcuQCucWGoFZKa5DrHxcGAirH7r71y0=; b=TCqbkr+CNymiXLxVPd32yLDT4OxKByDuN38Znpwk9QHrTWd4UBIzQf3EIK5gNacX2SJpW2XEX5zzyDTwfIzewXONTv5Y2QQwfjxfc+fIBe9X2t7Mxwxa/Al4iAmzKnGjsDz/o2AOG7ET52E+doOGd9VjaFP7i549MA7sxf3vejA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493809842442.0255843661555; Tue, 20 Oct 2026 03:56:49 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455316.1668997 (Exim 4.92) (envelope-from ) id 1xJ7W6-0004vW-Il; Tue, 20 Oct 2026 10:56:26 +0000 Received: by outflank-mailman (output) from mailman id 1455316.1668997; Tue, 20 Oct 2026 10:56:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7W5-0004n4-Kq; Tue, 20 Oct 2026 10:56:25 +0000 Received: by outflank-mailman (input) for mailman id 1455316; Tue, 20 Oct 2026 10:50:47 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Qd-0008Ua-08 for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:50:47 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7Qc-004d16-DC for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:50:46 +0200 Received: from [10.42.69.1] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74772-8faa-0a2a0a5109dd-0a2a4501af7a-44 for ; Tue, 20 Oct 2026 12:50:46 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad74785-5984-0a2a45010019-aa0a817cd663-3 for ; Tue, 20 Oct 2026 12:50:46 +0200 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-589-Nf-L8n-POp-Ce5Q3K4PxmQ-1; Tue, 20 Oct 2026 10:50:39 +0000 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 BCEDD1800846; Tue, 20 Oct 2026 10:50:35 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7AC121800643; Tue, 20 Oct 2026 10:50:32 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493444; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qwky9rRTw8oAHcuQCucWGoFZKa5DrHxcGAirH7r71y0=; b=IPHu8QiVTsVREFNzvpxqRWJ5kpgS1hMLyiPLkyDn6tseFZFhs3kUudzTJpGQIDTkUIxTOk tmWKOIb70DWUH4bBWU2nQRr2Ptj6z+UAPQLst4l0YNOzVJOpnkvRXAbv923oDk0mJZKbQY SA7+MkNwMf4KTFlD6mugXrRGAqhD/CU= X-MC-Unique: Nf-L8n-POp-Ce5Q3K4PxmQ-1 X-Mimecast-MFC-AGG-ID: Nf-L8n-POp-Ce5Q3K4PxmQ_1792493435 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:05 +0400 Subject: [PATCH v7 48/65] hw/gpio/pca955x: use QAPI enums for led and pin properties MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-48-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=15047; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=N091Shg2JHcPog3qa/YLAcE9hWHktbmtx29N6CIdf6Y=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZbJcXMYrMMXfr6szUmvgOQEfgL142iqUKd5 YT6P0Nj+9+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGWwAKCRDa6OEJdZac 5Y1YEAC7Jjf0CNAuzPG1AoI6lNR1KKO2PD4cPsq5GQornKbm+OrFX6OdHOWVRiNy9yshRki5VHt y1UIfWtv5lVJuPfzIgFkDFdGGFqhZ5SX0+7I6l66rkSAPfQ9MYYZRi289uk6B2/arJH7Z5EFSKu iGlcGVQc9S4x3c/Kg1PtMxGhPvrXr76hSgtXid7nFld1/V2cAMfUm0M6Vr6yAb7Lul5Rp3r/caN cCC0tt6RzA9y+QM8LZnrQwFHhW7YHTh58dM4yXW5D3r/njyP8n3g0XYR1Jim0YTWx3z3PJWUMuE GxUCHw92BCWEbbwDilX7tms1L3KPst0YiZ7RL79JHKJb9xCAa6jVwQsv584lT0mhe1F1Ogonqkn NDkBOXyzBbvt79Pyn0stvJKsMla/XLny8sSa8o3wQZRTjd10guCFqF+CAbeX5XwrWLig/kslQgi jmNCSeNgdwl+kFZJQ3Glx9hD55WBtmbMVgakjAAfk2GP44aEKIPJ0c9xGjUtf4jdsQHElwlk3dc 2IUG2VKR7vs+3NqwHkSYoCEk4c5P7Y42OJuYcXbXlU5s45IJDDbzPXqMdfHHkLd94cf/XE2iFHx E+2DhjzzNnw3c3Sr3XpRdw/jiWTPqEjBMSGCfy/ObEFvsn6BTov7EsqvWS6VL9qe04p2/+GTroa X35jn64JCYgndcQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-MFC-PROC-ID: dNcVM2fCgkWhu22-AcrWY6KpHIE_1zbgCeuWl94dHYc_1792493435 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-d62444/1792493446-1E664757-7A7EDC81/0/0 X-purgate-type: clean X-purgate-size: 15049 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493810548158500 Replace hand-rolled string lookup tables with QAPI enums Pca9552LedState and Pca955{2,4}PinState for the led%d and pin%d QOM properties. This fixes the incorrect property type ("bool" for LEDs, "str" for pins) and lets QAPI handle string-to-enum conversion in the visitor, removing the manual string matching in the setters. Add QEMU_BUILD_BUG_ON guards to ensure the QAPI-generated enum values stay in sync with the hardware register encoding. I kept Pca9552PinState & @Pca9554PinState separate types, because I don't know if they could diverge. We could eventually merge those. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Glenn Miles --- hw/gpio/pca9552.c | 82 +++++++++++++++++++++------------------------------= ---- hw/gpio/pca9554.c | 39 ++++++++++---------------- qapi/machine.json | 46 +++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+), 75 deletions(-) diff --git a/hw/gpio/pca9552.c b/hw/gpio/pca9552.c index 719149b7174b..16741c22dea3 100644 --- a/hw/gpio/pca9552.c +++ b/hw/gpio/pca9552.c @@ -23,7 +23,8 @@ #include "hw/core/irq.h" #include "migration/vmstate.h" #include "qapi/error.h" -#include "qapi/visitor.h" +#include "qapi/qapi-types-machine.h" +#include "qapi/qapi-visit-machine.h" #include "trace.h" #include "qom/object.h" =20 @@ -59,16 +60,15 @@ struct PCA955xClass { /* * Note: The LED_ON and LED_OFF configuration values for the PCA955X * chips are the reverse of the PCA953X family of chips. + * + * The QAPI enums must match the hardware register values. */ -#define PCA9552_LED_ON 0x0 -#define PCA9552_LED_OFF 0x1 -#define PCA9552_LED_PWM0 0x2 -#define PCA9552_LED_PWM1 0x3 -#define PCA9552_PIN_LOW 0x0 -#define PCA9552_PIN_HIZ 0x1 - -static const char *led_state[] =3D {"on", "off", "pwm0", "pwm1"}; -static const char *pin_state[] =3D {"low", "high"}; +QEMU_BUILD_BUG_ON(PCA9552_LED_STATE_ON !=3D 0x0); +QEMU_BUILD_BUG_ON(PCA9552_LED_STATE_OFF !=3D 0x1); +QEMU_BUILD_BUG_ON(PCA9552_LED_STATE_PWM0 !=3D 0x2); +QEMU_BUILD_BUG_ON(PCA9552_LED_STATE_PWM1 !=3D 0x3); +QEMU_BUILD_BUG_ON(PCA9552_PIN_STATE_LOW !=3D 0x0); +QEMU_BUILD_BUG_ON(PCA9552_PIN_STATE_HIGH !=3D 0x1); =20 static uint8_t pca955x_pin_get_config(PCA955xState *s, int pin) { @@ -142,24 +142,24 @@ static void pca955x_update_pin_input(PCA955xState *s) uint8_t config =3D pca955x_pin_get_config(s, i); =20 switch (config) { - case PCA9552_LED_ON: + case PCA9552_LED_STATE_ON: /* Pin is set to 0V to turn on LED */ s->regs[input_reg] &=3D ~bit_mask; break; - case PCA9552_LED_OFF: + case PCA9552_LED_STATE_OFF: /* * Pin is set to Hi-Z to turn off LED and * pullup sets it to a logical 1 unless * external device drives it low. */ - if (s->ext_state[i] =3D=3D PCA9552_PIN_LOW) { + if (s->ext_state[i] =3D=3D PCA9552_PIN_STATE_LOW) { s->regs[input_reg] &=3D ~bit_mask; } else { s->regs[input_reg] |=3D bit_mask; } break; - case PCA9552_LED_PWM0: - case PCA9552_LED_PWM1: + case PCA9552_LED_STATE_PWM0: + case PCA9552_LED_STATE_PWM1: /* TODO */ default: break; @@ -176,7 +176,7 @@ static void pca955x_update_pin_input(PCA955xState *s) */ if (s->regs[config_reg] & bit_mask) { /* Input mode - reflect external state */ - if (s->ext_state[i] =3D=3D PCA9552_PIN_LOW) { + if (s->ext_state[i] =3D=3D PCA9552_PIN_STATE_LOW) { s->regs[input_reg] &=3D ~bit_mask; } else { s->regs[input_reg] |=3D bit_mask; @@ -360,7 +360,7 @@ static void pca955x_get_led(Object *obj, Visitor *v, co= nst char *name, PCA955xClass *k =3D PCA955X_GET_CLASS(obj); PCA955xState *s =3D PCA955X(obj); int led, rc, reg; - uint8_t state; + Pca9552LedState state; =20 rc =3D sscanf(name, "led%2d", &led); if (rc !=3D 1) { @@ -378,7 +378,7 @@ static void pca955x_get_led(Object *obj, Visitor *v, co= nst char *name, */ reg =3D PCA9552_LS0 + led / 4; state =3D (pca955x_read(s, reg) >> ((led % 4) * 2)) & 0x3; - visit_type_str(v, name, (char **)&led_state[state], errp); + visit_type_Pca9552LedState(v, name, &state, errp); } =20 /* @@ -397,10 +397,9 @@ static void pca955x_set_led(Object *obj, Visitor *v, c= onst char *name, PCA955xClass *k =3D PCA955X_GET_CLASS(obj); PCA955xState *s =3D PCA955X(obj); int led, rc, reg, val; - uint8_t state; - g_autofree char *state_str =3D NULL; + Pca9552LedState state; =20 - if (!visit_type_str(v, name, &state_str, errp)) { + if (!visit_type_Pca9552LedState(v, name, &state, errp)) { return; } rc =3D sscanf(name, "led%2d", &led); @@ -413,16 +412,6 @@ static void pca955x_set_led(Object *obj, Visitor *v, c= onst char *name, return; } =20 - for (state =3D 0; state < ARRAY_SIZE(led_state); state++) { - if (!strcmp(state_str, led_state[state])) { - break; - } - } - if (state >=3D ARRAY_SIZE(led_state)) { - error_setg(errp, "%s invalid led state %s", __func__, state_str); - return; - } - reg =3D PCA9552_LS0 + led / 4; val =3D pca955x_read(s, reg); val =3D pca955x_ledsel(val, led % 4, state); @@ -437,7 +426,8 @@ static void pca955x_get_pin(Object *obj, Visitor *v, co= nst char *name, PCA955xClass *k =3D PCA955X_GET_CLASS(obj); PCA955xState *s =3D PCA955X(obj); int pin, rc; - uint8_t input_reg, state; + uint8_t input_reg; + Pca9552PinState state; =20 rc =3D sscanf(name, "pin%2d", &pin); if (rc !=3D 1) { @@ -455,7 +445,7 @@ static void pca955x_get_pin(Object *obj, Visitor *v, co= nst char *name, */ input_reg =3D PCA9535_INPUT0 + (pin / 8); state =3D (s->regs[input_reg] >> (pin % 8)) & 0x1; - visit_type_str(v, name, (char **)&pin_state[state], errp); + visit_type_Pca9552PinState(v, name, &state, errp); } =20 static void pca955x_set_pin(Object *obj, Visitor *v, const char *name, @@ -464,10 +454,10 @@ static void pca955x_set_pin(Object *obj, Visitor *v, = const char *name, PCA955xClass *k =3D PCA955X_GET_CLASS(obj); PCA955xState *s =3D PCA955X(obj); int pin, rc; - uint8_t state, config_reg; - g_autofree char *state_str =3D NULL; + Pca9552PinState state; + uint8_t config_reg; =20 - if (!visit_type_str(v, name, &state_str, errp)) { + if (!visit_type_Pca9552PinState(v, name, &state, errp)) { return; } rc =3D sscanf(name, "pin%2d", &pin); @@ -480,16 +470,6 @@ static void pca955x_set_pin(Object *obj, Visitor *v, c= onst char *name, return; } =20 - for (state =3D 0; state < ARRAY_SIZE(pin_state); state++) { - if (!strcmp(state_str, pin_state[state])) { - break; - } - } - if (state >=3D ARRAY_SIZE(pin_state)) { - error_setg(errp, "%s invalid pin state %s", __func__, state_str); - return; - } - /* Only input-configured pins can be driven by an external device. */ config_reg =3D PCA9535_CONFIG0 + (pin / 8); if (!((s->regs[config_reg] >> (pin % 8)) & 0x1)) { @@ -499,7 +479,7 @@ static void pca955x_set_pin(Object *obj, Visitor *v, co= nst char *name, return; } =20 - pca955x_set_ext_state(s, pin, state !=3D PCA9552_PIN_LOW); + pca955x_set_ext_state(s, pin, state !=3D PCA9552_PIN_STATE_LOW); } =20 static const VMStateDescription pca9552_vmstate =3D { @@ -529,7 +509,7 @@ static void pca9552_reset_hold(Object *obj, ResetType t= ype) s->regs[PCA9552_LS2] =3D 0x55; s->regs[PCA9552_LS3] =3D 0x55; =20 - memset(s->ext_state, PCA9552_PIN_HIZ, PCA955X_PIN_COUNT_MAX); + memset(s->ext_state, PCA9552_PIN_STATE_HIGH, PCA955X_PIN_COUNT_MAX); pca955x_update_pin_input(s); =20 s->pointer =3D 0xFF; @@ -549,7 +529,7 @@ static void pca9535_reset_hold(Object *obj, ResetType t= ype) s->regs[PCA9535_CONFIG0] =3D 0xFF; /* All pins as inputs */ s->regs[PCA9535_CONFIG1] =3D 0xFF; /* All pins as inputs */ =20 - memset(s->ext_state, PCA9552_PIN_HIZ, PCA955X_PIN_COUNT_MAX); + memset(s->ext_state, PCA9552_PIN_STATE_HIGH, PCA955X_PIN_COUNT_MAX); pca955x_update_pin_input(s); =20 s->pointer =3D 0xFF; @@ -567,12 +547,12 @@ static void pca955x_initfn(Object *obj) if (k->has_led_support) { /* LED variant: expose the LED selector state as led%d. */ name =3D g_strdup_printf("led%d", ix); - object_property_add(obj, name, "bool", + object_property_add(obj, name, "Pca9552LedState", pca955x_get_led, pca955x_set_led, NULL, NU= LL); } else { /* GPIO variant: expose the pin logic level as pin%d. */ name =3D g_strdup_printf("pin%d", ix); - object_property_add(obj, name, "str", + object_property_add(obj, name, "Pca9552PinState", pca955x_get_pin, pca955x_set_pin, NULL, NU= LL); } g_free(name); diff --git a/hw/gpio/pca9554.c b/hw/gpio/pca9554.c index 904698cdce85..e4eddc829ef7 100644 --- a/hw/gpio/pca9554.c +++ b/hw/gpio/pca9554.c @@ -16,6 +16,8 @@ #include "hw/core/irq.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-types-machine.h" +#include "qapi/qapi-visit-machine.h" #include "qapi/visitor.h" #include "trace.h" #include "qom/object.h" @@ -32,10 +34,8 @@ typedef struct PCA9554Class PCA9554Class; DECLARE_CLASS_CHECKERS(PCA9554Class, PCA9554, TYPE_PCA9554) =20 -#define PCA9554_PIN_LOW 0x0 -#define PCA9554_PIN_HIZ 0x1 - -static const char *pin_state[] =3D {"low", "high"}; +QEMU_BUILD_BUG_ON(PCA9554_PIN_STATE_LOW !=3D 0x0); +QEMU_BUILD_BUG_ON(PCA9554_PIN_STATE_HIGH !=3D 0x1); =20 static void pca9554_update_pin_input(PCA9554State *s) { @@ -54,7 +54,7 @@ static void pca9554_update_pin_input(PCA9554State *s) * Input: the pin is Hi-Z with a pull-up, so it reads high * unless an external device drives it low. */ - if (s->ext_state[i] =3D=3D PCA9554_PIN_LOW) { + if (s->ext_state[i] =3D=3D PCA9554_PIN_STATE_LOW) { s->regs[PCA9554_INPUT] &=3D ~bit_mask; } else { s->regs[PCA9554_INPUT] |=3D bit_mask; @@ -156,7 +156,7 @@ static void pca9554_get_pin(Object *obj, Visitor *v, co= nst char *name, { PCA9554State *s =3D PCA9554(obj); int pin, rc; - uint8_t state; + Pca9554PinState state; =20 rc =3D sscanf(name, "pin%2d", &pin); if (rc !=3D 1) { @@ -175,7 +175,7 @@ static void pca9554_get_pin(Object *obj, Visitor *v, co= nst char *name, * holds the wire level regardless of the configured direction. */ state =3D (s->regs[PCA9554_INPUT] >> pin) & 0x1; - visit_type_str(v, name, (char **)&pin_state[state], errp); + visit_type_Pca9554PinState(v, name, &state, errp); } =20 static void pca9554_set_pin(Object *obj, Visitor *v, const char *name, @@ -183,10 +183,10 @@ static void pca9554_set_pin(Object *obj, Visitor *v, = const char *name, { PCA9554State *s =3D PCA9554(obj); int pin, rc, val; - uint8_t state, mask; - g_autofree char *state_str =3D NULL; + uint8_t mask; + Pca9554PinState state; =20 - if (!visit_type_str(v, name, &state_str, errp)) { + if (!visit_type_Pca9554PinState(v, name, &state, errp)) { return; } rc =3D sscanf(name, "pin%2d", &pin); @@ -199,16 +199,6 @@ static void pca9554_set_pin(Object *obj, Visitor *v, c= onst char *name, return; } =20 - for (state =3D 0; state < ARRAY_SIZE(pin_state); state++) { - if (!strcmp(state_str, pin_state[state])) { - break; - } - } - if (state >=3D ARRAY_SIZE(pin_state)) { - error_setg(errp, "%s invalid pin state %s", __func__, state_str); - return; - } - if (s->hw_dir) { /* Warn and ignore if the guest has configured this pin as output = */ if (!((s->regs[PCA9554_CONFIG] >> pin) & 0x1)) { @@ -219,13 +209,13 @@ static void pca9554_set_pin(Object *obj, Visitor *v, = const char *name, return; } /* Drive the external input level */ - pca9554_set_ext_state(s, pin, state !=3D PCA9554_PIN_LOW); + pca9554_set_ext_state(s, pin, state !=3D PCA9554_PIN_STATE_LOW); } else { /* Legacy behavior: force output mode and drive */ /* First, modify the output register bit */ val =3D pca9554_read(s, PCA9554_OUTPUT); mask =3D 0x1 << pin; - if (state =3D=3D PCA9554_PIN_LOW) { + if (state =3D=3D PCA9554_PIN_STATE_LOW) { val &=3D ~(mask); } else { val |=3D mask; @@ -264,7 +254,7 @@ static void pca9554_reset(DeviceState *dev) s->regs[PCA9554_POLARITY] =3D 0x0; /* No pins are inverted */ s->regs[PCA9554_CONFIG] =3D pin_mask; /* All pins are inputs */ =20 - memset(s->ext_state, PCA9554_PIN_HIZ, pc->pin_count); + memset(s->ext_state, PCA9554_PIN_STATE_HIGH, pc->pin_count); pca9554_update_pin_input(s); =20 s->pointer =3D 0x0; @@ -280,7 +270,8 @@ static void pca9554_initfn(Object *obj) char *name; =20 name =3D g_strdup_printf("pin%d", pin); - object_property_add(obj, name, "str", pca9554_get_pin, pca9554_set= _pin, + object_property_add(obj, name, "Pca9554PinState", + pca9554_get_pin, pca9554_set_pin, NULL, NULL); g_free(name); } diff --git a/qapi/machine.json b/qapi/machine.json index 34be3156270c..46b6935ab0b8 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -416,6 +416,52 @@ { 'enum': 'LostTickPolicy', 'data': ['discard', 'delay', 'slew' ] } =20 +## +# @Pca9552LedState: +# +# LED state for PCA9552. +# +# @on: LED on +# +# @off: LED off +# +# @pwm0: LED controlled by PWM0 +# +# @pwm1: LED controlled by PWM1 +# +# Since: 11.2 +## +{ 'enum': 'Pca9552LedState', + 'data': ['on', 'off', 'pwm0', 'pwm1'] } + +## +# @Pca9552PinState: +# +# Pin state for PCA9552. +# +# @low: Pin low +# +# @high: Pin high +# +# Since: 11.2 +## +{ 'enum': 'Pca9552PinState', + 'data': ['low', 'high'] } + +## +# @Pca9554PinState: +# +# Pin state for PCA9554. +# +# @low: Pin low +# +# @high: Pin high +# +# Since: 11.2 +## +{ 'enum': 'Pca9554PinState', + 'data': ['low', 'high'] } + ## # @inject-nmi: # Injects a Non-Maskable Interrupt (machine specific: for example --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493811; cv=none; d=zohomail.com; s=zohoarc; b=QUsqM5Jzz+FWAACPlte67avlhc9wYIn2dKS/jiB4ZXyqWVMyW3JCyAtZyhBGRsNdfGjPQU920X63uIz+XDNdGinzbZ5rFXJ5cWXZyTYhDGZuY/8r632cc7jONSWu+0f64w+U+asFDweUXwtZlOvH5lCbJxnftYDXP7MtUnXgQ3s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493811; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=S8kTexksySb92RkWPQob17KtLeYJq8y0yNIndqLcc+s=; b=MNzKjHjpy3xmlcctM5IEyJtIPRkYV9uJg3bjkW2zjcb0PFPM/YsKq18Jip9WjhsiHLk1TjaFtMb0YQfh4L5nF+B6c4j6SdsPka9w7hE4xGYZnD//SGT+tMlh2HgN3BZBu+yzeCAGhx2NOq+J4Hm8QTrg14ACAWhfFxc32oHIas0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493811084809.1881908438331; Tue, 20 Oct 2026 03:56:51 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455318.1669018 (Exim 4.92) (envelope-from ) id 1xJ7W9-0005XL-Il; Tue, 20 Oct 2026 10:56:29 +0000 Received: by outflank-mailman (output) from mailman id 1455318.1669018; Tue, 20 Oct 2026 10:56:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7W8-0005RV-K8; Tue, 20 Oct 2026 10:56:28 +0000 Received: by outflank-mailman (input) for mailman id 1455318; Tue, 20 Oct 2026 10:50:48 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Qe-0008Um-PZ for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:50:48 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7Qe-004d16-67 for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:50:48 +0200 Received: from [10.42.69.4] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74781-8faa-0a2a0a5109dd-0a2a4504a994-44 for ; Tue, 20 Oct 2026 12:50:48 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad74786-b57f-0a2a45040019-aa0a817c6709-3 for ; Tue, 20 Oct 2026 12:50:47 +0200 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-689-7M2NqJufMDOobZCWpwZs9w-1; Tue, 20 Oct 2026 10:50:45 +0000 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 5E3CE1954AF3; Tue, 20 Oct 2026 10:50:41 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4CA251956095; Tue, 20 Oct 2026 10:50:38 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S8kTexksySb92RkWPQob17KtLeYJq8y0yNIndqLcc+s=; b=BIawTRzGLvx1avtBgI+2CzxYzP7GS/2Kj++TtBPLdzMuo/aypEovwbrGl6TahSumY596Cn 071ufiPwswGDnizIZZtkL2Nxd0AW8InkQzGIvUjt9sq3H2RwM+dy6IcFlViWZKvbT9sasm S32jN6KyezERGhoWxUp1dcp9t+R7v+k= X-MC-Unique: 7M2NqJufMDOobZCWpwZs9w-1 X-Mimecast-MFC-AGG-ID: 7M2NqJufMDOobZCWpwZs9w_1792493441 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:06 +0400 Subject: [PATCH v7 49/65] include: add QEMU_REPEAT helper macro MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-49-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=5069; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=QfToyuYJOLlF7sVISH3TkcbrVSBGm2Ii2KsCu8httjE=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZctD1NQTngqU/jBCkEfMek9xa0vMpb6NJE8 n3GhucWk+2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGXAAKCRDa6OEJdZac 5Ql3D/wOI62xjJd8gtsu1K015Mj1esGNk3N1OdLVzhvzC8XbQvPEjY9tEjanTvUT/tSDkebzQqp wfSbuNHZo2LWhz4d7Wb0804H4k/QbpWXXItKX82506hR5MwcSm8hUjY/X6b3sz99rcdsWT0OYuB N2PLFvmXrXrT34rd2lk3l9IEv008VGElWvHn+lGOsyEFdIi/zoDQuQTkGXQNX9r8iwDerholxzT +YZ5vO9NOWYzlEcvAPuA1dqTZKv0M9sHG++CE+6rKm7la2iiLolf0dIPC9Lek616L5XTeNy7Con EF8tZhpLovhA6XrZr2f/PiaJxHf5yCU0Sq0nNl8Fbybo63RLmGHKN3Eu3hwqRCLDy9l1/5v++ol S9hoHIJukwRZWnX0ts9nDy7TeFwjlL2jTa5zYCWg9W7/sdnOtFpaRYdj/lgqkMlTa+D86mUvx9a 9InKktX0yyqWi5G5hNKi9NOS0lo8H7z0cS/vAMcv16S106YylJ7/t+pIcH0uo8VsZZRuXZ7h/LE P4apvjyFIb53bu2HO5H2KfwPzrSgW8jM6CGO9+0RBtkG7nQ+6OYilLtspSRo2mGJD8ejzD5m8U6 /mj9N3MBuGZckwN2lJSTywe0n7qy4Ybb5v/f4A7HZtbB78gEulqlZppqsvIUcivzHg3tITYzqlL tsVVC+qXxIFzhWg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-MFC-PROC-ID: QhIwsYQSFdP_batAZoqWWBKJkzb2S8QHqhw6wpbOyAc_1792493441 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-ebf023/1792493448-530CDB50-B313043F/0/0 X-purgate-type: clean X-purgate-size: 5071 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493812635158501 Introduce a macro used in following commit, and convert a few existing candidates. Inspired by a similar macro in Linux kernel/trace/bpf_trace.c Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/misc/tz-ppc.c | 19 ++----------------- hw/remote/vfio-user-obj.c | 17 +++-------------- include/hw/cxl/cxl_component.h | 5 +---- include/qemu/osdep.h | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 35 deletions(-) diff --git a/hw/misc/tz-ppc.c b/hw/misc/tz-ppc.c index 6f820430eed8..5f09ce164c19 100644 --- a/hw/misc/tz-ppc.c +++ b/hw/misc/tz-ppc.c @@ -303,26 +303,11 @@ static const VMStateDescription tz_ppc_vmstate =3D { =20 #define DEFINE_PORT(N) \ DEFINE_PROP_LINK("port[" #N "]", TZPPC, port[N].downstream, \ - TYPE_MEMORY_REGION, MemoryRegion *) + TYPE_MEMORY_REGION, MemoryRegion *), =20 static const Property tz_ppc_properties[] =3D { DEFINE_PROP_UINT32("NONSEC_MASK", TZPPC, nonsec_mask, 0), - DEFINE_PORT(0), - DEFINE_PORT(1), - DEFINE_PORT(2), - DEFINE_PORT(3), - DEFINE_PORT(4), - DEFINE_PORT(5), - DEFINE_PORT(6), - DEFINE_PORT(7), - DEFINE_PORT(8), - DEFINE_PORT(9), - DEFINE_PORT(10), - DEFINE_PORT(11), - DEFINE_PORT(12), - DEFINE_PORT(13), - DEFINE_PORT(14), - DEFINE_PORT(15), + QEMU_REPEAT(TZ_NUM_PORTS, DEFINE_PORT) }; =20 static void tz_ppc_class_init(ObjectClass *klass, const void *data) diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c index 7e6819f670b5..84c3ff05cfb8 100644 --- a/hw/remote/vfio-user-obj.c +++ b/hw/remote/vfio-user-obj.c @@ -496,22 +496,11 @@ static size_t vfu_object_bar_rw(PCIDevice *pci_dev, i= nt pci_bar, buf, count, is_write); = \ } = \ =20 -VFU_OBJECT_BAR_HANDLER(0) -VFU_OBJECT_BAR_HANDLER(1) -VFU_OBJECT_BAR_HANDLER(2) -VFU_OBJECT_BAR_HANDLER(3) -VFU_OBJECT_BAR_HANDLER(4) -VFU_OBJECT_BAR_HANDLER(5) -VFU_OBJECT_BAR_HANDLER(6) +QEMU_REPEAT(PCI_NUM_REGIONS, VFU_OBJECT_BAR_HANDLER) =20 +#define VFU_OBJECT_BAR_HANDLER_PTR(BAR_NO) vfu_object_bar##BAR_NO##_handle= r, static vfu_region_access_cb_t *vfu_object_bar_handlers[PCI_NUM_REGIONS] = =3D { - &vfu_object_bar0_handler, - &vfu_object_bar1_handler, - &vfu_object_bar2_handler, - &vfu_object_bar3_handler, - &vfu_object_bar4_handler, - &vfu_object_bar5_handler, - &vfu_object_bar6_handler, + QEMU_REPEAT(PCI_NUM_REGIONS, VFU_OBJECT_BAR_HANDLER_PTR) }; =20 /** diff --git a/include/hw/cxl/cxl_component.h b/include/hw/cxl/cxl_component.h index ffc82202206c..fca8b7055ccd 100644 --- a/include/hw/cxl/cxl_component.h +++ b/include/hw/cxl/cxl_component.h @@ -186,10 +186,7 @@ REG32(CXL_HDM_DECODER_GLOBAL_CONTROL, CXL_HDM_REGISTER= S_OFFSET + 4) /* Support 4 decoders at all levels of topology */ #define CXL_HDM_DECODER_COUNT 4 =20 -HDM_DECODER_INIT(0); -HDM_DECODER_INIT(1); -HDM_DECODER_INIT(2); -HDM_DECODER_INIT(3); +QEMU_REPEAT(CXL_HDM_DECODER_COUNT, HDM_DECODER_INIT) =20 /* * CXL r3.1 Section 8.2.4.21: CXL Extended Security Capability Structure diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 1ec5b42230be..a5e7ff99cb89 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -191,6 +191,39 @@ extern "C" { =20 #include "qemu/typedefs.h" =20 +/* + * QEMU_REPEAT(n, m) - invoke m(0) m(1) ... m(n-1) + * + * Expands to n invocations of m, each with a literal integer argument. + * n must be a compile-time constant in 0..16. + * + * Example - generate 4 per-index function definitions: + * + * #define DEFINE_GETTER(i) \ + * static int get_##i(void) { return values[i]; } + * + * QEMU_REPEAT(4, DEFINE_GETTER) + */ +#define QEMU_REPEAT_0(m) +#define QEMU_REPEAT_1(m) QEMU_REPEAT_0(m) m(0) +#define QEMU_REPEAT_2(m) QEMU_REPEAT_1(m) m(1) +#define QEMU_REPEAT_3(m) QEMU_REPEAT_2(m) m(2) +#define QEMU_REPEAT_4(m) QEMU_REPEAT_3(m) m(3) +#define QEMU_REPEAT_5(m) QEMU_REPEAT_4(m) m(4) +#define QEMU_REPEAT_6(m) QEMU_REPEAT_5(m) m(5) +#define QEMU_REPEAT_7(m) QEMU_REPEAT_6(m) m(6) +#define QEMU_REPEAT_8(m) QEMU_REPEAT_7(m) m(7) +#define QEMU_REPEAT_9(m) QEMU_REPEAT_8(m) m(8) +#define QEMU_REPEAT_10(m) QEMU_REPEAT_9(m) m(9) +#define QEMU_REPEAT_11(m) QEMU_REPEAT_10(m) m(10) +#define QEMU_REPEAT_12(m) QEMU_REPEAT_11(m) m(11) +#define QEMU_REPEAT_13(m) QEMU_REPEAT_12(m) m(12) +#define QEMU_REPEAT_14(m) QEMU_REPEAT_13(m) m(13) +#define QEMU_REPEAT_15(m) QEMU_REPEAT_14(m) m(14) +#define QEMU_REPEAT_16(m) QEMU_REPEAT_15(m) m(15) +#define QEMU_REPEAT_(n, m) QEMU_REPEAT_##n(m) +#define QEMU_REPEAT(n, m) QEMU_REPEAT_(n, m) + /** * Mark a function that executes in coroutine context * --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493842; cv=none; d=zohomail.com; s=zohoarc; b=UVT8iVH695iAOARq1XngyJ7MOnHLUpvtmRIDIm1uU3NZjqEjS+p9NQ2GMz5Xk4W8GLhL2nN6venH46YdYR7F6Xs1WqdsfSfN3XEfZR7cgeMGtzwAZr4w5lf1zpPfyVR7YmtRFvbgPufgl5ks2rHMmzMblfqGQVL4N7bgHvY3EJ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493842; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UI1oOgUjr2C09/42flcMtOL/qp5uyR5nZp4lNbzLhMM=; b=KD7cHz7aKmrgoNpLTH0qw87I78P521U5RGKII8V93pvEgQhi8NiPe1hC6MOqN53lCubn6JNsDl5Km6NkJYZ7jYic5+6lS2M6HZPR8fmR72nfrJQr0eHvoh1329flZRvGq3Qjq9UHzzt5yymZb+cCLVTw//NPVsUFhteBfHE51GQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493842528690.2686041359061; Tue, 20 Oct 2026 03:57:22 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455339.1669109 (Exim 4.92) (envelope-from ) id 1xJ7WV-0001XL-Pk; Tue, 20 Oct 2026 10:56:51 +0000 Received: by outflank-mailman (output) from mailman id 1455339.1669109; Tue, 20 Oct 2026 10:56:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7WT-0001Rj-Qg; Tue, 20 Oct 2026 10:56:49 +0000 Received: by outflank-mailman (input) for mailman id 1455339; Tue, 20 Oct 2026 10:51:02 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Qr-00008Y-SV for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:02 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7Qr-002FXm-9J for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:01 +0200 Received: from [10.42.69.6] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74783-bab6-0a2a0a5309dd-0a2a450695a8-38 for ; Tue, 20 Oct 2026 12:51:01 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad74793-195a-0a2a45060019-aa0a817ce921-3 for ; Tue, 20 Oct 2026 12:51:01 +0200 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-47-CrQK4deUNTad1FIQ0b2Mjg-1; Tue, 20 Oct 2026 06:50:50 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 F3CE01954194; Tue, 20 Oct 2026 10:50:46 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B3F891956088; Tue, 20 Oct 2026 10:50:43 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UI1oOgUjr2C09/42flcMtOL/qp5uyR5nZp4lNbzLhMM=; b=aBcpfFks5R2JtW3NhoETeQXUYT2rpM7YPXqSibr/ZjfBs9N0eqw6qdWoZ4IsDtYLzThO+j me6pmCJ3rmWDYqVxVY4lXIAquWMAY8K2sG3rcEGofGbIo9PxKmmZ9/LhQwplKUSEFSNo2H 59feevwZ3PJrLVW2kIV/5CuL/wOkSAU= X-MC-Unique: CrQK4deUNTad1FIQ0b2Mjg-1 X-Mimecast-MFC-AGG-ID: CrQK4deUNTad1FIQ0b2Mjg_1792493447 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:07 +0400 Subject: [PATCH v7 50/65] hw/gpio/pca955x: convert pin/led property to QAPI-aware enum MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-50-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=18182; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=/T2C1S926CriVURvy1V0b555zaz9n8rbWnuo7vsoD8E=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10Zc/MyZjsGCSo1em3rwgIrcI3my50hA6ArKg XY6eoCG8OOJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGXAAKCRDa6OEJdZac 5WerD/9ns1InvVwABVk1Ky8TEmeyVcSbJeoQ9nMEgwkTHwjl6qy+A2E4Cjjp5FAOPp7vSLb1FVz ZXMI8PMPr4JEzANxAvBYlnRoEGPZWbJJLf767vjKnD8shLpXlXhnvL9alhzbcNGyXIkOUELKEGB P4mM2H4U9fK8o3tgDeq4H0SEsbQVrgGpKJ27O9m7ISTwXbHhZ2ZBBLm4DQguo/iU1/kJ5Rgp9DD vlZFzPj+Ou/pP1RN7vLgr+2VKDcu6BSThcuqpOnYT/g7z14okU02LhRu/+3E4siXVFTnLUMc9kP W36YY8NastaSyEKVu3Y8pSvJiiTk0LClt+biOdN06lDl5EeoLSyczPFdPrfibyX5qyqz35XJfvf SLw9HQCVxO9o+9cACPrRm31c8Q0pHEpDEs6p12Jk0YhG7LSCGOL3smAcPDNSwqA8VE6ea5paj7z 74Tr28SsZAahFvb95zAmoYTZmaobkL/CnrvnQJDmnJgaA2EBKeYSj2COvwCHP1zz6zzbY2ySv6g vCVkOGb3B2VMQVrjOQg68OiiNgB9U+5qCBJkyzHVLXTebevqwzcbalEFgE2RHHzL3tbBq/ecpRG HWNo20RnvrQvpG9pxYxhGmGni7lpSdZzHnm/WuJYaHbEgwLAwAAvYXD1+eTxTM6Lx7smAXkFK2l xSsQ6OzWsYMuwNw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-MFC-PROC-ID: Fh5QFf8XGwno5fvV-EcJBDueGcckmhwG1uxEu3QyQlk_1792493447 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-16d1c6/1792493461-F5E0E77B-BBE043D4/0/0 X-purgate-type: clean X-purgate-size: 18184 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493843105158500 Replaces the runtime-parsed visitor-based QOM property accessors with compile-time per-pin/per-LED accessor functions using QEMU_REPEAT. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/gpio/pca9552.c | 205 +++++++++++++++++++++-----------------------------= ---- hw/gpio/pca9554.c | 136 ++++++++++++++---------------------- 2 files changed, 131 insertions(+), 210 deletions(-) diff --git a/hw/gpio/pca9552.c b/hw/gpio/pca9552.c index 16741c22dea3..0a007bbbe4ac 100644 --- a/hw/gpio/pca9552.c +++ b/hw/gpio/pca9552.c @@ -25,6 +25,7 @@ #include "qapi/error.h" #include "qapi/qapi-types-machine.h" #include "qapi/qapi-visit-machine.h" +#include "qapi/qapi-type-infos-machine.h" #include "trace.h" #include "qom/object.h" =20 @@ -354,33 +355,6 @@ static int pca955x_event(I2CSlave *i2c, enum i2c_event= event) return 0; } =20 -static void pca955x_get_led(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - PCA955xClass *k =3D PCA955X_GET_CLASS(obj); - PCA955xState *s =3D PCA955X(obj); - int led, rc, reg; - Pca9552LedState state; - - rc =3D sscanf(name, "led%2d", &led); - if (rc !=3D 1) { - error_setg(errp, "%s: error reading %s", __func__, name); - return; - } - if (led < 0 || led >=3D k->pin_count) { - error_setg(errp, "%s: invalid led %s", __func__, name); - return; - } - /* - * Get the LSx register as the qom interface should expose the device - * state, not the modeled 'input line' behaviour which would come from - * reading the INPUTx reg - */ - reg =3D PCA9552_LS0 + led / 4; - state =3D (pca955x_read(s, reg) >> ((led % 4) * 2)) & 0x3; - visit_type_Pca9552LedState(v, name, &state, errp); -} - /* * Return an LED selector register value based on an existing one, with * the appropriate 2-bit state value set for the given LED number (0-3). @@ -391,97 +365,8 @@ static inline uint8_t pca955x_ledsel(uint8_t oldval, i= nt led_num, int state) ((state & 0x3) << (led_num << 1)); } =20 -static void pca955x_set_led(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - PCA955xClass *k =3D PCA955X_GET_CLASS(obj); - PCA955xState *s =3D PCA955X(obj); - int led, rc, reg, val; - Pca9552LedState state; - - if (!visit_type_Pca9552LedState(v, name, &state, errp)) { - return; - } - rc =3D sscanf(name, "led%2d", &led); - if (rc !=3D 1) { - error_setg(errp, "%s: error reading %s", __func__, name); - return; - } - if (led < 0 || led >=3D k->pin_count) { - error_setg(errp, "%s: invalid led %s", __func__, name); - return; - } - - reg =3D PCA9552_LS0 + led / 4; - val =3D pca955x_read(s, reg); - val =3D pca955x_ledsel(val, led % 4, state); - pca955x_write(s, reg, val); -} - static void pca955x_set_ext_state(PCA955xState *s, int pin, int level); =20 -static void pca955x_get_pin(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - PCA955xClass *k =3D PCA955X_GET_CLASS(obj); - PCA955xState *s =3D PCA955X(obj); - int pin, rc; - uint8_t input_reg; - Pca9552PinState state; - - rc =3D sscanf(name, "pin%2d", &pin); - if (rc !=3D 1) { - error_setg(errp, "%s: error reading %s", __func__, name); - return; - } - if (pin < 0 || pin >=3D k->pin_count) { - error_setg(errp, "%s invalid pin %s", __func__, name); - return; - } - - /* - * Report the raw pin logic level; polarity inversion is a read-time - * transform applied to the INPUT register, not to the pin state itsel= f. - */ - input_reg =3D PCA9535_INPUT0 + (pin / 8); - state =3D (s->regs[input_reg] >> (pin % 8)) & 0x1; - visit_type_Pca9552PinState(v, name, &state, errp); -} - -static void pca955x_set_pin(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - PCA955xClass *k =3D PCA955X_GET_CLASS(obj); - PCA955xState *s =3D PCA955X(obj); - int pin, rc; - Pca9552PinState state; - uint8_t config_reg; - - if (!visit_type_Pca9552PinState(v, name, &state, errp)) { - return; - } - rc =3D sscanf(name, "pin%2d", &pin); - if (rc !=3D 1) { - error_setg(errp, "%s: error reading %s", __func__, name); - return; - } - if (pin < 0 || pin >=3D k->pin_count) { - error_setg(errp, "%s invalid pin %s", __func__, name); - return; - } - - /* Only input-configured pins can be driven by an external device. */ - config_reg =3D PCA9535_CONFIG0 + (pin / 8); - if (!((s->regs[config_reg] >> (pin % 8)) & 0x1)) { - qemu_log_mask(LOG_UNIMP, - "%s: pin %d is configured as output, ignoring set\n", - s->description, pin); - return; - } - - pca955x_set_ext_state(s, pin, state !=3D PCA9552_PIN_STATE_LOW); -} - static const VMStateDescription pca9552_vmstate =3D { .name =3D "PCA9552", .version_id =3D 0, @@ -536,26 +421,92 @@ static void pca9535_reset_hold(Object *obj, ResetType= type) s->len =3D 0; } =20 +/* + * Get the LSx register as the qom interface should expose the device + * state, not the modeled 'input line' behaviour which would come from + * reading the INPUTx reg + */ +#define DEFINE_LED_ACCESSORS(n) = \ +static int prop_get_led##n(Object *obj, Error **errp) = \ +{ = \ + PCA955xState *s =3D PCA955X(obj); = \ + uint8_t reg =3D PCA9552_LS0 + (n) / 4; = \ + return (pca955x_read(s, reg) >> (((n) % 4) * 2)) & 0x3; = \ +} = \ +static void prop_set_led##n(Object *obj, int val, Error **errp) = \ +{ = \ + PCA955xState *s =3D PCA955X(obj); = \ + uint8_t reg =3D PCA9552_LS0 + (n) / 4; = \ + uint8_t old =3D pca955x_read(s, reg); = \ + pca955x_write(s, reg, pca955x_ledsel(old, (n) % 4, val)); = \ +} + +QEMU_REPEAT(PCA955X_PIN_COUNT_MAX, DEFINE_LED_ACCESSORS) + +#define LED_ENUM_PROP(n) { \ + .name =3D "led" #n, \ + .default_value =3D -1, \ + .qapi_type =3D &Pca9552LedState_type_info, \ + .get =3D prop_get_led##n, \ + .set =3D prop_set_led##n, \ +}, + +static const QapiEnumProp led_enum_props[] =3D { + QEMU_REPEAT(PCA955X_PIN_COUNT_MAX, LED_ENUM_PROP) +}; + +/* + * Report the raw pin logic level; polarity inversion is a read-time + * transform applied to the INPUT register, not to the pin state + * itself. + */ +#define DEFINE_PIN_ACCESSORS(n) = \ +static int prop_get_pin##n(Object *obj, Error **errp) = \ +{ = \ + PCA955xState *s =3D PCA955X(obj); = \ + uint8_t input_reg =3D PCA9535_INPUT0 + (n) / 8; = \ + return (s->regs[input_reg] >> ((n) % 8)) & 0x1; = \ +} = \ +static void prop_set_pin##n(Object *obj, int val, Error **errp) = \ +{ = \ + PCA955xState *s =3D PCA955X(obj); = \ + uint8_t config_reg =3D PCA9535_CONFIG0 + (n) / 8; = \ + /* Only input-configured pins can be driven by an external device */ = \ + if (!((s->regs[config_reg] >> ((n) % 8)) & 0x1)) { = \ + qemu_log_mask(LOG_UNIMP, = \ + "%s: pin %d configured as output, ignoring set\n", = \ + s->description, (n)); = \ + return; = \ + } = \ + pca955x_set_ext_state(s, (n), val !=3D PCA9552_PIN_STATE_LOW); = \ +} + +QEMU_REPEAT(PCA955X_PIN_COUNT_MAX, DEFINE_PIN_ACCESSORS) + +#define PIN_ENUM_PROP(n) { \ + .name =3D "pin" #n, \ + .default_value =3D -1, \ + .qapi_type =3D &Pca9552PinState_type_info, \ + .get =3D prop_get_pin##n, \ + .set =3D prop_set_pin##n, \ +}, + +static const QapiEnumProp pin_enum_props[] =3D { + QEMU_REPEAT(PCA955X_PIN_COUNT_MAX, PIN_ENUM_PROP) +}; + static void pca955x_initfn(Object *obj) { PCA955xClass *k =3D PCA955X_GET_CLASS(obj); =20 assert(k->pin_count <=3D PCA955X_PIN_COUNT_MAX); + /* TODO: use array/list instead of individual QAPI enum properties */ for (int ix =3D 0; ix < k->pin_count; ix++) { - char *name; - if (k->has_led_support) { - /* LED variant: expose the LED selector state as led%d. */ - name =3D g_strdup_printf("led%d", ix); - object_property_add(obj, name, "Pca9552LedState", - pca955x_get_led, pca955x_set_led, NULL, NU= LL); + object_property_add_qapi_enum(obj, &led_enum_props[ix]); } else { - /* GPIO variant: expose the pin logic level as pin%d. */ - name =3D g_strdup_printf("pin%d", ix); - object_property_add(obj, name, "Pca9552PinState", - pca955x_get_pin, pca955x_set_pin, NULL, NU= LL); + object_property_add_qapi_enum(obj, &pin_enum_props[ix]); } - g_free(name); } } =20 diff --git a/hw/gpio/pca9554.c b/hw/gpio/pca9554.c index e4eddc829ef7..f2a5b94a36d8 100644 --- a/hw/gpio/pca9554.c +++ b/hw/gpio/pca9554.c @@ -18,7 +18,7 @@ #include "qapi/error.h" #include "qapi/qapi-types-machine.h" #include "qapi/qapi-visit-machine.h" -#include "qapi/visitor.h" +#include "qapi/qapi-type-infos-machine.h" #include "trace.h" #include "qom/object.h" =20 @@ -151,83 +151,60 @@ static void pca9554_set_ext_state(PCA9554State *s, in= t pin, int level) } } =20 -static void pca9554_get_pin(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - PCA9554State *s =3D PCA9554(obj); - int pin, rc; - Pca9554PinState state; - - rc =3D sscanf(name, "pin%2d", &pin); - if (rc !=3D 1) { - error_setg(errp, "%s: error reading %s", __func__, name); - return; - } - if (pin < 0 || pin >=3D PCA9554_GET_CLASS(s)->pin_count) { - error_setg(errp, "%s invalid pin %s", __func__, name); - return; - } - - /* - * Report the physical pin level. The input register is kept in sync by - * pca9554_update_pin_input(): output pins mirror the OUTPUT register = and - * input pins reflect the externally driven (or pulled-up) level, so it - * holds the wire level regardless of the configured direction. - */ - state =3D (s->regs[PCA9554_INPUT] >> pin) & 0x1; - visit_type_Pca9554PinState(v, name, &state, errp); +/* + * Report the physical pin level. The input register is kept in sync + * by pca9554_update_pin_input(): output pins mirror the OUTPUT + * register and input pins reflect the externally driven (or + * pulled-up) level, so it holds the wire level regardless of the + * configured direction. + */ +#define DEFINE_PIN_ACCESSORS(n) = \ +static int prop_get_pin##n(Object *obj, Error **errp) = \ +{ = \ + PCA9554State *s =3D PCA9554(obj); = \ + return (s->regs[PCA9554_INPUT] >> (n)) & 0x1; = \ +} = \ +static void prop_set_pin##n(Object *obj, int val, Error **errp) = \ +{ = \ + PCA9554State *s =3D PCA9554(obj); = \ + if (s->hw_dir) { = \ + if (!((s->regs[PCA9554_CONFIG] >> (n)) & 0x1)) { = \ + qemu_log_mask(LOG_UNIMP, = \ + "%s: pin %d configured as output," = \ + " ignoring set\n", = \ + s->description, (n)); = \ + return; = \ + } = \ + pca9554_set_ext_state(s, (n), val !=3D PCA9554_PIN_STATE_LOW); = \ + } else { = \ + /* Legacy behavior: force output mode and drive */ = \ + uint8_t mask =3D 0x1 << (n); = \ + int v =3D pca9554_read(s, PCA9554_OUTPUT); = \ + if (val =3D=3D PCA9554_PIN_STATE_LOW) { = \ + v &=3D ~mask; = \ + } else { = \ + v |=3D mask; = \ + } = \ + pca9554_write(s, PCA9554_OUTPUT, v); = \ + v =3D pca9554_read(s, PCA9554_CONFIG); = \ + v &=3D ~mask; = \ + pca9554_write(s, PCA9554_CONFIG, v); = \ + } = \ } =20 -static void pca9554_set_pin(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - PCA9554State *s =3D PCA9554(obj); - int pin, rc, val; - uint8_t mask; - Pca9554PinState state; +QEMU_REPEAT(PCA9554_PIN_COUNT, DEFINE_PIN_ACCESSORS) =20 - if (!visit_type_Pca9554PinState(v, name, &state, errp)) { - return; - } - rc =3D sscanf(name, "pin%2d", &pin); - if (rc !=3D 1) { - error_setg(errp, "%s: error reading %s", __func__, name); - return; - } - if (pin < 0 || pin >=3D PCA9554_GET_CLASS(s)->pin_count) { - error_setg(errp, "%s invalid pin %s", __func__, name); - return; - } +#define PIN_ENUM_PROP(n) { \ + .name =3D "pin" #n, \ + .default_value =3D -1, \ + .qapi_type =3D &Pca9554PinState_type_info, \ + .get =3D prop_get_pin##n, \ + .set =3D prop_set_pin##n, \ +}, =20 - if (s->hw_dir) { - /* Warn and ignore if the guest has configured this pin as output = */ - if (!((s->regs[PCA9554_CONFIG] >> pin) & 0x1)) { - qemu_log_mask(LOG_UNIMP, - "%s: pin %d is configured as output, " - "ignoring external set\n", - s->description, pin); - return; - } - /* Drive the external input level */ - pca9554_set_ext_state(s, pin, state !=3D PCA9554_PIN_STATE_LOW); - } else { - /* Legacy behavior: force output mode and drive */ - /* First, modify the output register bit */ - val =3D pca9554_read(s, PCA9554_OUTPUT); - mask =3D 0x1 << pin; - if (state =3D=3D PCA9554_PIN_STATE_LOW) { - val &=3D ~(mask); - } else { - val |=3D mask; - } - pca9554_write(s, PCA9554_OUTPUT, val); - - /* Then, clear the config register bit for output mode */ - val =3D pca9554_read(s, PCA9554_CONFIG); - val &=3D ~mask; - pca9554_write(s, PCA9554_CONFIG, val); - } -} +static const QapiEnumProp pin_enum_props[] =3D { + QEMU_REPEAT(PCA9554_PIN_COUNT, PIN_ENUM_PROP) +}; =20 static const VMStateDescription pca9554_vmstate =3D { .name =3D "PCA9554", @@ -264,16 +241,9 @@ static void pca9554_reset(DeviceState *dev) static void pca9554_initfn(Object *obj) { PCA9554Class *pc =3D PCA9554_GET_CLASS(obj); - int pin; =20 - for (pin =3D 0; pin < pc->pin_count; pin++) { - char *name; - - name =3D g_strdup_printf("pin%d", pin); - object_property_add(obj, name, "Pca9554PinState", - pca9554_get_pin, pca9554_set_pin, - NULL, NULL); - g_free(name); + for (int pin =3D 0; pin < pc->pin_count; pin++) { + object_property_add_qapi_enum(obj, &pin_enum_props[pin]); } } =20 --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493866; cv=none; d=zohomail.com; s=zohoarc; b=cPzt9BGDRhRB9K8GD/S5HgQ4z+CRngQyII5TvEEsxyhFOFhzoOI126U03Cgwx1eIjX38abCnzcpD5fpY2c7RSuK7/d+XUIg1T7FUefRoR3wu2F3KreJTXClRz+1oaQhP5HIuPAx/mBAAQqfBMnWwNuNePPWM85UfDce8MOlTJY8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493866; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xYy3oSp+ff1fXLKzAr/ltjneF4aulTjsLHGvoluUofo=; b=PD2hzFRWiWT5zRWFtOV3ViSj3BwPd4t+fP1S5QbFm5iNK9t3O8varIz/vlcuuRpFZGjBI5+eUsP+Ce/e9TwDBzoruBQEvJ8WVZLp89sghSrPbYHnquXwcdkTgHjvqX1YE+oTpC+VELAqG5Od4FxzEMhZWtayNktlaRButtUQWmU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493866599905.0725082080731; Tue, 20 Oct 2026 03:57:46 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455364.1669225 (Exim 4.92) (envelope-from ) id 1xJ7X0-0007gt-DO; Tue, 20 Oct 2026 10:57:22 +0000 Received: by outflank-mailman (output) from mailman id 1455364.1669225; Tue, 20 Oct 2026 10:57:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Wy-0007Z7-NK; Tue, 20 Oct 2026 10:57:20 +0000 Received: by outflank-mailman (input) for mailman id 1455364; Tue, 20 Oct 2026 10:51:15 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7R5-0000Fe-E2 for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:15 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7R4-002Fd5-Mw for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:14 +0200 Received: from [10.42.69.9] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad74794-bab6-0a2a0a5309dd-0a2a4509e19c-42 for ; Tue, 20 Oct 2026 12:51:14 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad747a1-be1a-0a2a45090019-aa0a817c9cfb-3 for ; Tue, 20 Oct 2026 12:51:14 +0200 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-317-_02t9xyMOm20feBYezgTrw-1; Tue, 20 Oct 2026 10:50:55 +0000 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 E195F1954AF3; Tue, 20 Oct 2026 10:50:51 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 668161956089; Tue, 20 Oct 2026 10:50:49 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xYy3oSp+ff1fXLKzAr/ltjneF4aulTjsLHGvoluUofo=; b=X6XVMan97T5ihTg48c2LqhaCkgh+pMdhNbPs4qiNVuGZooyWrOAFFN0/qnf56VddwYvV9f Q5SS6aueFM1ee0mm8zfvrmqmncOJnWzs6aeP2kyhwu9SJHz7eQNJwn5nacKCHpQOTtm9SJ IqXyFpjSR0JdM29wmvi7VhWoZKi/jZ4= X-MC-Unique: _02t9xyMOm20feBYezgTrw-1 X-Mimecast-MFC-AGG-ID: _02t9xyMOm20feBYezgTrw_1792493452 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:08 +0400 Subject: [PATCH v7 51/65] hw/pci: change the busnr type to uint8 MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-51-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=676; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=XgvIxLl/BnhUDwV4Ml62CrnmhSOe02ljvgEL6HF9kIM=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZcsdAOAS0hjUnxh3WDcMl5LulHDaGVEH+/r GrDaZ1+NveJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGXAAKCRDa6OEJdZac 5WzUD/4gS8E5fmzaBRANZzmTHi4LMZi0Pnr4ISijVYni9psdGZecJgyELgBiKlkS5moIjcmgfO9 LtzEDam7EKKaMjQcN5+qoT9kJDLjDpBykqFrZivQF2+tVHrtUmmPMpE3gd+qdxjg6bjuHJE9nm1 y58JRaSIUeY5pv9QUPqHyIIC2MN6AtkJNS6T4D6zslZnqceh+5SUOmjDOh3IoP69Ya4dCoo4eLh /c5wEk48USsos1BczsynxRLqlv372oV7D6FHO+gwf7Umv7Wuuk3wMq7v55VvBk9ClGMFFFHl1Bl K3IymWi5lcpeebgGoY2rJ461Nf1K2sX+de1UruF0XycFGG7zJB0fY0/QCktkFe//ULP8eWVVPxr x4po1soNOkYf6gQEeqjLamK0g8ZJygWnnbTzMGQEwO1n2GefBmYe/bslKuhzlSlv0HKmfN1M7tb byc79SREJ+GyMzX/SS2qzWi9Gn2rDYqKAs9h/RWWJ+yB/ND5yn9/LQ7juXguQ9BRcahIQMeTOiD VEEzjLcJHQbx5RCwpKZQ95j9UiN4WpHPiULZe4dPYsvpFHaoocZ8FKiKm53uryDXr8nXEA4SAUg dfhpm5tVTAMYZqUADL7oer+1PwE0J6AANyAUXX8h59mqI45I6O/T5kqAez+QPc00dcUYloWmkkC 4rA7sxiB57P9E5A== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-MFC-PROC-ID: 3-zo0R8hDFTe36sl23F5YEoxm1tPW3954qsxBThSEqo_1792493452 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-bad1c0/1792493474-BF2DC034-E1FB13CE/0/0 X-purgate-type: clean X-purgate-size: 678 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493867605158500 It is effectively a u8. The next changes are going to use the uint8_type_info for it. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 0efb4eb4bb03..6edc702776ab 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -80,7 +80,7 @@ static void prop_pci_busnr_get(Object *obj, Visitor *v, c= onst char *name, } =20 static const PropertyInfo prop_pci_busnr =3D { - .type =3D "busnr", + .type =3D "uint8", .get =3D prop_pci_busnr_get, }; =20 --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493859; cv=none; d=zohomail.com; s=zohoarc; b=QNbq4oIeDfmXsvgQFsRPSqXh0M92jDyzprVG+nxiguIcHMTYpRwnVO/cgrigN0wig4edcKObUhUQIyL+JddtAHLhC8JVGMOqL46YTu/Vth4ZH3mKS3fFT3QxEmbdLjUZYOQGQvHmZl9mVp5BEFJq5T3OAjtDU3xl+zMxiihIsfU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493859; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=O4pdCz1MgQ3GeOtrPeQzKHNQrLJKFwMgs4D5tHNFOGI=; b=dkw6C3HS9qegUAeJeWizqefQn13LF1HD81Wo3nF8GHVWxnuYiafwFQqpAvYLEigAm2R8uIOwICiKdgVWx+sQzBwjHDYvA9jVt1ACrgbuo0DjpBS+O/UfjReVQ0Nt+JhMnncK+CO9tky9JuOFqnebMG5D4kJK5T/qn6tuNcOojeo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 17924938594011021.6510656860073; Tue, 20 Oct 2026 03:57:39 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455360.1669205 (Exim 4.92) (envelope-from ) id 1xJ7Wu-0006fc-Vc; Tue, 20 Oct 2026 10:57:16 +0000 Received: by outflank-mailman (output) from mailman id 1455360.1669205; Tue, 20 Oct 2026 10:57:16 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Wt-0006aK-Hs; Tue, 20 Oct 2026 10:57:15 +0000 Received: by outflank-mailman (input) for mailman id 1455360; Tue, 20 Oct 2026 10:51:14 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7R4-0000Eh-36 for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:14 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7R3-00EzJf-G6 for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:13 +0200 Received: from [10.42.69.5] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad7479c-e002-0a2a0a5209dd-0a2a4505a14c-18 for ; Tue, 20 Oct 2026 12:51:13 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad7479f-4cb1-0a2a45050019-aa0a857c7871-3 for ; Tue, 20 Oct 2026 12:51:13 +0200 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-456-_pwTePgnOyq7pM8ip4VO7Q-1; Tue, 20 Oct 2026 10:51:01 +0000 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 91D281800EFA; Tue, 20 Oct 2026 10:50:56 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 15C651956088; Tue, 20 Oct 2026 10:50:54 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O4pdCz1MgQ3GeOtrPeQzKHNQrLJKFwMgs4D5tHNFOGI=; b=XsVRMeFFt21/YhHE2stfcKEd33yp9FwNaoEOIFlWhKw0JoA9Ag1wdQB8kvNTJSsMztXxcc FTPNsz+G57IRpLci0SFzClu5GR4GyJCLxO9s7VWlAzfV3IL4kQcGDXFMxGEscRbwr0mb4Y pTHDiFkMG9yZRxtlNZumwpYJdCN+3GA= X-MC-Unique: _pwTePgnOyq7pM8ip4VO7Q-1 X-Mimecast-MFC-AGG-ID: _pwTePgnOyq7pM8ip4VO7Q_1792493456 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:09 +0400 Subject: [PATCH v7 52/65] qdev: add qapi_type field to PropertyInfo with fallback registration MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-52-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=7178; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=MHwt79KEqovxMUVbjLHZbzyPQ3O7/QvHLzBLKn+XdlM=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10Zcd4GS3Tym0oVL8eCpFa4hRCCy54I3T6LAS GF+IaGc/aeJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGXAAKCRDa6OEJdZac 5WzhEACv7w/6wGYDKzLQ4S7kKafC2zvA6aWWltqZx5U2rfzcdYynrwTqRWspmtblrvG3W+dgEC+ GAiDyLTgKT/lplKlqYBCdfo+mBOQ4RjrVFTquBNP7tb1Fd+qp3t9zQNOdVsG19deLE9AuNuonie dHae66WUQvaHL65hhmJipl9CSHWAnomOXOJyyJ5TL7veXseSM7+BeIhf9rfjjFO8FcXXPYefN7N Vj3I83aE6DPR/08nzenNixXWPzk/ArswJ6q/WcvvA4tPhYrSNEycqptfkH7BEXqVd7el6w8D/YN MPh3DkIQPMJRNazDp8xYwJ9S7WdeQafqvm2YRNH3av88ggfFTz7NYxyA1NqzQtYSoUdHWuIhTn4 iEQZvksitISNyDmdkzfDLuR2kXyHOr5e/Ll/cSV0Ps9dQfXLywgbcnCbHnAusIvjx2/yJpdI/Kw UDLtSxgSEKeHrkvuJ1rkjQRWeS3sG8ZaCwAtAzrvEAf7FBdvdyzvLVfovAymyrCO3O4KUQsdLtc k505iFW90rwA+7wcXcuPkUs77jjArhUF6EOpJVKL6ErZLXV946xeHqqPjfKif9ol3evcCxzVX6r unBBDNEV7BsJc5ZHOQ+1Ftf9LXCkbgKFmXSobicTcap1DX/Io5n/fKrAoeaRBbBM42ysjZJzaqZ B28Z8/csjxKt2hA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-MFC-PROC-ID: GIUICMVa35xPwusYeLywITNAKTrcBo3E3X-oKi0LE0Y_1792493456 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-c201ff/1792493473-F5EA92A1-0FE4773E/0/0 X-purgate-type: clean X-purgate-size: 7180 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493861569158500 Add a qapi_type field to PropertyInfo to prepare for the transition from string-based type metadata to QAPI type-info. Add a qdev_prop_qapi_type() helper that resolves the QAPI type for a property from .qapi_type. It will be later extended to cope with array types. Update qdev_property_add_static() and qdev_class_add_property() to prefer object_property_add_qapi() when a QAPI type is available, falling back to the old object_property_add() for unconverted properties. Update the shared enum accessor functions to prefer .qapi_type->lookup over .enum_table via a new qdev_propinfo_enum_lookup() helper. No PropertyInfo definitions are changed, all .qapi_type fields default to NULL, so the fallback paths are always taken. This patch is no-op for now. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-properties.c | 68 ++++++++++++++++++++++++++++++-----= ---- include/hw/core/qdev-properties.h | 1 + 2 files changed, 53 insertions(+), 16 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 34d7b26a7303..ee50fbb9f570 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -99,13 +99,22 @@ static ObjectPropertyAccessor *field_prop_setter(const = PropertyInfo *info) return info->set ? field_prop_set : NULL; } =20 +static const QEnumLookup *qdev_propinfo_enum_lookup(const PropertyInfo *in= fo) +{ + if (info->qapi_type) { + assert(info->qapi_type->lookup); + return info->qapi_type->lookup; + } + return info->enum_table; +} + void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { const Property *prop =3D opaque; int *ptr =3D object_field_prop_ptr(obj, prop); =20 - visit_type_enum(v, name, ptr, prop->info->enum_table, errp); + visit_type_enum(v, name, ptr, qdev_propinfo_enum_lookup(prop->info), e= rrp); } =20 void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name, @@ -114,14 +123,15 @@ void qdev_propinfo_set_enum(Object *obj, Visitor *v, = const char *name, const Property *prop =3D opaque; int *ptr =3D object_field_prop_ptr(obj, prop); =20 - visit_type_enum(v, name, ptr, prop->info->enum_table, errp); + visit_type_enum(v, name, ptr, qdev_propinfo_enum_lookup(prop->info), e= rrp); } =20 void qdev_propinfo_set_default_value_enum(ObjectProperty *op, const Property *prop) { object_property_set_default_str(op, - qapi_enum_lookup(prop->info->enum_table, prop->defval.i)); + qapi_enum_lookup(qdev_propinfo_enum_lookup(prop->info), + prop->defval.i)); } =20 /* Bit */ @@ -941,8 +951,8 @@ void qdev_prop_set_enum(DeviceState *dev, const char *n= ame, int value) =20 prop =3D qdev_prop_find(dev, name); object_property_set_str(OBJECT(dev), name, - qapi_enum_lookup(prop->info->enum_table, value= ), - &error_abort); + qapi_enum_lookup(qdev_propinfo_enum_lookup(prop->info), value), + &error_abort); } =20 void qdev_prop_set_array(DeviceState *dev, const char *name, QList *values) @@ -1143,18 +1153,33 @@ const PropertyInfo qdev_prop_link =3D { .set =3D set_link, }; =20 +static const QAPITypeInfo *qdev_prop_qapi_type(const Property *prop) +{ + /* this will be later extended to cope with QAPI array properties */ + return prop->info->qapi_type; +} + void qdev_property_add_static(DeviceState *dev, const Property *prop) { Object *obj =3D OBJECT(dev); ObjectProperty *op; + const QAPITypeInfo *qapi_type =3D qdev_prop_qapi_type(prop); =20 assert(!prop->info->create); =20 - op =3D object_property_add(obj, prop->name, prop->info->type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); + if (qapi_type) { + op =3D object_property_add_qapi(obj, prop->name, qapi_type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); + } else { + op =3D object_property_add(obj, prop->name, prop->info->type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); + } =20 object_property_set_description(obj, prop->name, prop->info->description); @@ -1176,12 +1201,23 @@ static void qdev_class_add_property(DeviceClass *kl= ass, const char *name, if (prop->info->create) { op =3D prop->info->create(oc, name, prop); } else { - op =3D object_class_property_add(oc, - name, prop->info->type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); + const QAPITypeInfo *qapi_type =3D qdev_prop_qapi_type(prop); + + if (qapi_type) { + op =3D object_class_property_add_qapi(oc, + name, qapi_type, + field_prop_getter(prop->inf= o), + field_prop_setter(prop->inf= o), + prop->info->release, + (Property *)prop); + } else { + op =3D object_class_property_add(oc, + name, prop->info->type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); + } } if (prop->set_default) { prop->info->set_default_value(op, prop); diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-prope= rties.h index eba5436e53b1..1ea2ba66bb37 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -34,6 +34,7 @@ struct PropertyInfo { const char *type; const char *description; const QEnumLookup *enum_table; + const QAPITypeInfo *qapi_type; bool realized_set_allowed; /* allow setting property on realized devic= e */ char *(*print)(Object *obj, const Property *prop); void (*set_default_value)(ObjectProperty *op, const Property *prop); --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493865; cv=none; d=zohomail.com; s=zohoarc; b=ed2rE2xmxEMNC9powASlKH8bHg3Qg0OwkyRUffr3eou8Rcd/P/WZbY4iv52B/C/TgRvmSkJfpjP5xcJUsXlOhTY+J4QWwad48T+zm2ZCrkvpxzfANVDdmNZg+1AAK4Do5bDCrFuCO+Z1woz3/cbdWgpFaChBNFfpIXCrlEXX7fs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493865; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=OxciqWPAoEP3mYi79fT0gwyx/y+Ueu4PihTpFMb+Vro=; b=cB6SVq2o8UvBPEE7FXH+uMUCqx2Q0/la24n3voQUGpXPoKR0IiQVhxBUEbipD0quxUU9ffyCcPbvOdTTnDXeBPjjPxiZ77MV1sj+eCB4FgslQFYjDm0lF6fgNmr1/QoipdyNc1xsAH66AJro/NLK81DIp5oYFUv9SPeojREe+4U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 179249386553062.78543598850263; Tue, 20 Oct 2026 03:57:45 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455358.1669200 (Exim 4.92) (envelope-from ) id 1xJ7Wt-0006Ht-6k; Tue, 20 Oct 2026 10:57:15 +0000 Received: by outflank-mailman (output) from mailman id 1455358.1669200; Tue, 20 Oct 2026 10:57:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Wr-0006AG-Cc; Tue, 20 Oct 2026 10:57:13 +0000 Received: by outflank-mailman (input) for mailman id 1455358; Tue, 20 Oct 2026 10:51:12 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7R2-0000Dh-IT for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:12 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7R1-004dBJ-Vi for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:11 +0200 Received: from [10.42.69.11] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad7479c-8faa-0a2a0a5109dd-0a2a450bb700-12 for ; Tue, 20 Oct 2026 12:51:11 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad7479e-b7e8-0a2a450b0019-aa0a817cb205-3 for ; Tue, 20 Oct 2026 12:51:11 +0200 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-315-plwKHC4NOLSL9hNBtPanxA-1; Tue, 20 Oct 2026 10:51:05 +0000 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 D94121800628; Tue, 20 Oct 2026 10:51:01 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1B6D11956089; Tue, 20 Oct 2026 10:50:59 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OxciqWPAoEP3mYi79fT0gwyx/y+Ueu4PihTpFMb+Vro=; b=CqVoWHLhZ84pEkgr5wDmP1CtQuk4fnkA/sNu5kqWFyG9/dspdTTyTqiQuuCtdd8MMfZkX2 SmLFvkJz2YFfq+amhUWzz8P2S4jyk+J+GD7oBPIwUYqVMrUjHfw/+tM37LXaSYoL95Zf/0 nZEY3p2ceyX8mRg4TWcw6heDNo09TWc= X-MC-Unique: plwKHC4NOLSL9hNBtPanxA-1 X-Mimecast-MFC-AGG-ID: plwKHC4NOLSL9hNBtPanxA_1792493462 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:10 +0400 Subject: [PATCH v7 53/65] qdev: convert core PropertyInfo definitions to use qapi_type MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-53-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=6959; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=RHtqBiZ1ZpqW16u5ZDKaCCTk7bDqrZ48KqqtmQit3DY=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZctFtIhQr7wjwq0vlVATZsMz0DILvEH+0jv hwCsb531JmJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGXAAKCRDa6OEJdZac 5fUsD/9v7R2O4amiuZ6SP+5w4OuXKDrY8C+/Sc9jWdJC+ykOn3MS1oFd6aG72bZkKifmaaiUg7L TYOQ73e/j30Aq8BxvAneXubghaxQasTkvl99rK7tpyVZmrR50QihCvaY/ojpH0CLNYG2XkUUxKL y8yd7vUzbbeRmLV9PNMcmwDeruh6TA0cZ9WXnDE587xYeh2mwT4wozR1RpBy/mOaVV6pCsAH5fC FJEzUzb0nzAnNGbVueWWQDRGCe73rj4hcn34RKSLYVxJQzQWL2mdCkPZN0RISYsH2pQ7vRwObYz NfzpXdVqc2iGmdIhuVCSrT22vQagV3Ver1Mu/8au7kLcxHnm9QFUhImJS4yToAOJk2Lgk2IJuAj RKOI0UHd43FbgYRrs5+S+TOkayjmFvlvJQ5ttHfYA95e+Dy55b6P2DbihYrAcl+AabExEmH+ikO Z3dzsDiMnsSR4xCGGFtThVh4RJ/4Qw1IGQAl3Lu+8C3d89oEU6hCmPWUiZAWw0a20/UT9N9KyKx is8Bnc3h8p0qMcWdiz2wZ7Pb/oOW6ZTqdF94KyeCq1FZS1D/CmS265DPmP+EGKz75jb30ZiRafc vpG2mZrXz/I1P9ivzKYIX20Jf3dTEQesxhMn3mUkfIGOcm3wVD1XCjYjkRPs6YUrOSeAgL0EmlP kEIkN/dkX0GxvOQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-MFC-PROC-ID: oItgUr_EWg9djf1ysjyX_2vq_zrOc5vUYItMzxhG-TY_1792493462 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-42698a/1792493471-198C19EA-9AEC1DC8/0/0 X-purgate-type: clean X-purgate-size: 6961 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493867707158500 Replace .type string with .qapi_type pointer on all core PropertyInfo definitions in qdev-properties.c. Remove .enum_table from enum definitions, since the lookup is now accessed through .qapi_type->lookup via the qdev_propinfo_enum_lookup() fallback helper. Note that qdev_prop_usize now reports "uint32" or "uint64" depending on the host. If usize is worth preserving, it should be added as a QAPI builtin type. Or perhaps we should simply use "size" everywhere (u64)? It's also strange to use type "size" for both u32 (prop_size32) and u64 (prop_size). Link property are actually strings. The "full type name" is set when the property is added, as "link". Array property will be refactored in a subsequent patch. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-properties.c | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index ee50fbb9f570..abdb380cb9ec 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -12,6 +12,8 @@ #include "qdev-prop-internal.h" #include "qom/compat-properties.h" #include "qom/qom-qobject.h" +#include "qapi/qapi-builtin-type-infos.h" +#include "qapi/qapi-type-infos-common.h" =20 void qdev_prop_set_after_realize(DeviceState *dev, const char *name, Error **errp) @@ -181,7 +183,7 @@ static void set_default_value_bool(ObjectProperty *op, = const Property *prop) } =20 const PropertyInfo qdev_prop_bit =3D { - .type =3D "bool", + .qapi_type =3D &bool_type_info, .description =3D "on/off", .get =3D prop_get_bit, .set =3D prop_set_bit, @@ -231,7 +233,7 @@ static void prop_set_bit64(Object *obj, Visitor *v, con= st char *name, } =20 const PropertyInfo qdev_prop_bit64 =3D { - .type =3D "bool", + .qapi_type =3D &bool_type_info, .description =3D "on/off", .get =3D prop_get_bit64, .set =3D prop_set_bit64, @@ -293,9 +295,8 @@ static void prop_set_on_off_auto_bit64(Object *obj, Vis= itor *v, } =20 const PropertyInfo qdev_prop_on_off_auto_bit64 =3D { - .type =3D "OnOffAuto", + .qapi_type =3D &OnOffAuto_type_info, .description =3D "on/off/auto", - .enum_table =3D &OnOffAuto_lookup, .get =3D prop_get_on_off_auto_bit64, .set =3D prop_set_on_off_auto_bit64, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -322,7 +323,7 @@ static void set_bool(Object *obj, Visitor *v, const cha= r *name, void *opaque, } =20 const PropertyInfo qdev_prop_bool =3D { - .type =3D "bool", + .qapi_type =3D &bool_type_info, .description =3D "on/off", .get =3D get_bool, .set =3D set_bool, @@ -362,7 +363,7 @@ void qdev_propinfo_set_default_value_uint(ObjectPropert= y *op, } =20 const PropertyInfo qdev_prop_uint8 =3D { - .type =3D "uint8", + .qapi_type =3D &uint8_type_info, .get =3D get_uint8, .set =3D set_uint8, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -389,7 +390,7 @@ static void set_uint16(Object *obj, Visitor *v, const c= har *name, } =20 const PropertyInfo qdev_prop_uint16 =3D { - .type =3D "uint16", + .qapi_type =3D &uint16_type_info, .get =3D get_uint16, .set =3D set_uint16, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -434,14 +435,14 @@ static void set_int32(Object *obj, Visitor *v, const = char *name, void *opaque, } =20 const PropertyInfo qdev_prop_uint32 =3D { - .type =3D "uint32", + .qapi_type =3D &uint32_type_info, .get =3D get_uint32, .set =3D set_uint32, .set_default_value =3D qdev_propinfo_set_default_value_uint, }; =20 const PropertyInfo qdev_prop_int32 =3D { - .type =3D "int32", + .qapi_type =3D &int32_type_info, .get =3D qdev_propinfo_get_int32, .set =3D set_int32, .set_default_value =3D qdev_propinfo_set_default_value_int, @@ -486,14 +487,14 @@ static void set_int64(Object *obj, Visitor *v, const = char *name, } =20 const PropertyInfo qdev_prop_uint64 =3D { - .type =3D "uint64", + .qapi_type =3D &uint64_type_info, .get =3D get_uint64, .set =3D set_uint64, .set_default_value =3D qdev_propinfo_set_default_value_uint, }; =20 const PropertyInfo qdev_prop_int64 =3D { - .type =3D "int64", + .qapi_type =3D &int64_type_info, .get =3D get_int64, .set =3D set_int64, .set_default_value =3D qdev_propinfo_set_default_value_int, @@ -515,7 +516,7 @@ static void set_uint64_checkmask(Object *obj, Visitor *= v, const char *name, } =20 const PropertyInfo qdev_prop_uint64_checkmask =3D { - .type =3D "uint64", + .qapi_type =3D &uint64_type_info, .get =3D get_uint64, .set =3D set_uint64_checkmask, }; @@ -551,7 +552,11 @@ static void set_usize(Object *obj, Visitor *v, const c= har *name, void *opaque, } =20 const PropertyInfo qdev_prop_usize =3D { - .type =3D "usize", +#if HOST_LONG_BITS =3D=3D 32 + .qapi_type =3D &uint32_type_info, +#else + .qapi_type =3D &uint64_type_info, +#endif .get =3D get_usize, .set =3D set_usize, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -595,7 +600,7 @@ static void set_string(Object *obj, Visitor *v, const c= har *name, } =20 const PropertyInfo qdev_prop_string =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .release =3D release_string, .get =3D get_string, .set =3D set_string, @@ -604,9 +609,8 @@ const PropertyInfo qdev_prop_string =3D { /* --- on/off/auto --- */ =20 const PropertyInfo qdev_prop_on_off_auto =3D { - .type =3D "OnOffAuto", + .qapi_type =3D &OnOffAuto_type_info, .description =3D "on/off/auto", - .enum_table =3D &OnOffAuto_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -647,7 +651,7 @@ static void set_size32(Object *obj, Visitor *v, const c= har *name, void *opaque, } =20 const PropertyInfo qdev_prop_size32 =3D { - .type =3D "size", + .qapi_type =3D &size_type_info, .get =3D qdev_propinfo_get_size32, .set =3D set_size32, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -1060,7 +1064,7 @@ static void set_size(Object *obj, Visitor *v, const c= har *name, void *opaque, } =20 const PropertyInfo qdev_prop_size =3D { - .type =3D "size", + .qapi_type =3D &size_type_info, .get =3D get_size, .set =3D set_size, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -1142,7 +1146,7 @@ static void set_link(Object *obj, Visitor *v, const c= har *name, void *opaque, } =20 const PropertyInfo qdev_prop_link =3D { - .type =3D "link", + .qapi_type =3D &str_type_info, .create =3D create_link_property, /* * Since we have a create method, the get and set are used --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493659; cv=none; d=zohomail.com; s=zohoarc; b=P2PYqGhJN4/AUSvmxpoj2qUXNc1PQwwFLWi3A14RTCnHvluKihxztxnNtbU7exlXnVU0RJnc8aXB4EXAWQE+hYurJ1Yto5/v6BhFlvTiPop/wwWMC5el+lFbhuun5plHBSEyzIR12iAvCGKzNQVo10JvY5fIXRyHZX1xKIIpWSA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493659; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AzOqWKFaDt1dcUvSh5TH4ogfAdXt1H3DxJt5OXlYfGQ=; b=jGB5WhkFBruGKddaXuUwuFGMK1aQAZPcYNCUFM9W/rE3umwZrYOqkLEGNmJctTHU8x8k0DAuN2a9uUdclczifyVmXk6qE+Z1dSvil1lXf8XLmqyfiJkbsMKlMDdQGpLsXZeCqvTTWSyleyU1LYgBdGsHOgCcDYn00aKtx0kuczY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792493659716498.94853939752454; Tue, 20 Oct 2026 03:54:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7TR-00038a-BO; Tue, 20 Oct 2026 06:53:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7RA-0000Mx-S0 for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:51:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7R7-0006Vq-Sv for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:51:20 -0400 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-330-D7y_ed00OAaymLbt3bjJCQ-1; Tue, 20 Oct 2026 10:51:11 +0000 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 BC19B18011FD; Tue, 20 Oct 2026 10:51:06 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D664E30002CD; Tue, 20 Oct 2026 10:51:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AzOqWKFaDt1dcUvSh5TH4ogfAdXt1H3DxJt5OXlYfGQ=; b=UXmfB+1eRqoFqt+6qRebqrY3LwruqULdHzmDivgd7cpu5rMSykCK9Ef+d+itGS5d7VrqE9 IvwVNo6dEvagsGBeB5sWkrGm+CTB2+fLO5GD3kPqGHng+pGAcSAYcQnVrH2ZWoLsHU0khK hP6zRo2cZI8C6ljutrfl6Q3w05CdmZk= X-MC-Unique: D7y_ed00OAaymLbt3bjJCQ-1 X-Mimecast-MFC-AGG-ID: D7y_ed00OAaymLbt3bjJCQ_1792493466 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:11 +0400 Subject: [PATCH v7 54/65] qdev: adjust PciDevfn declared type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-54-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1182; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=Rc9Kn1ykFR1030A/T3Qsw/MLRtZoT0IcFryuHUpEgHo=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZcBKB9OckTgPDc5ceinUI9Ks8T8mQpbSHjR wt32qduSASJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGXAAKCRDa6OEJdZac 5UlxD/0aesvLeJMhDPNK4VKMeyOaPPsCQtFR4qFG7KlCXynT1T2vJymf0cc0GzQxvMuqQi7QkP3 Nq+vx1h0wS8aWYock4+0cMRoNcvRyjdcEIEaz+hY9fYszOClGXo+WgnVvXIP/ymzT6wOrtEm8zi KyTeNOPlbml9T8xE5XCRMCuRDYgQQ/C50LkGOdvWZPi4/QPg61NcRcEdwgwyKWGA//4KF53Etv9 YF57/ckC+h0DIpVltVP7DozmL6yMRAQhvvbN/k7Wvocf991FXI4FBBQjx3DjWlI02TWx1ZbTHj7 Ul0nCa4y4Trxncc4kvuErZYreWkXTb3OM10IrtqT0Cxjebhspuf6b49Tpbr3s/b8iiX9czsUwXA p89Q53jzV6hkwxaqFNslKASETfvPDs+MhV9lykZnoFlxSdUnXT9X0E7aN2lUv3YRzxnc6Jff11W T3pb97gVWEOi/Odv9Mpm+kqrjqMdiRufTDS9y2rm+bzyC4oRVO5awihl+6ojLB1OJGVVwkwc7rQ Zbl0T+Ercm3AhwHa5/RMvPncaAuJqvWSIsEqW1vouhls8x0QJ+F7U8ndzLr4k1Xw79jazen5h9J arXpcL+C7MupGvk2Kx7ddRWgG+DbBn8bd6xO139DIRMT2by8ApQ+rFpyVEq/Uj7YjDAk1NxdvS0 GHFEBLCP2lMK0Ow== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493661815158500 PciDevfn is a bit special, since it accepts integer and string as setter, but only output integer as getter. Unfortunately, we can't declare an alternate str|int QAPI type for it, since: branch 'string' can't be distinguished from 'integer' Rather than declaring it as "str", use the common type instead. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-properties-system.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 5bfdfe1ab9d9..3381de1144d6 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -904,7 +904,8 @@ static char *print_pci_devfn(Object *obj, const Propert= y *prop) } =20 const PropertyInfo qdev_prop_pci_devfn =3D { - .type =3D "str", + /* The formatted string accepted by the setter is a CLI convenience. */ + .type =3D "int32", .description =3D "Slot and optional function number, example: 06.0 or = 06", .print =3D print_pci_devfn, .get =3D qdev_propinfo_get_int32, --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493873; cv=none; d=zohomail.com; s=zohoarc; b=X94YU9e7Cz6jUOkD44X7VYO7jFldFE/xGUNDLOIQlNZfkSUGXBEVMjjQf1e2G1WDaBpJsQcxFYMjRu2iii9LzdaN/Ra2+kzvh7tD+Y/tzwJUOUj5Rn+IE+/MsqLZacb3qp2SuKgzmsI1OEc9jkAu0RA/xJYQAfCB+2g6kcbbh14= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493873; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kVlgXy2vPG5I3mKp16fhq+bJb3obYLJd/3IFPjDdE9g=; b=ev15lE9oCeIi1iPKoYxBjS5yMyq+G2HlOvhvjE3ks1KCN0bHhVen7t0VAjdBz9rnMYdV3DtvxixXl3tw9R9Ici02l6Rbw6KUy+a2Id8CaYcZnOWYFo9/FRb4awmCTNlANTdgVPYazfgsEooabdlluiJNqguipJT9yswavG/ijgw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493873713885.7978844522972; Tue, 20 Oct 2026 03:57:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455375.1669272 (Exim 4.92) (envelope-from ) id 1xJ7XC-0001sT-Rh; Tue, 20 Oct 2026 10:57:34 +0000 Received: by outflank-mailman (output) from mailman id 1455375.1669272; Tue, 20 Oct 2026 10:57:34 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7XA-0001hE-Va; Tue, 20 Oct 2026 10:57:32 +0000 Received: by outflank-mailman (input) for mailman id 1455375; Tue, 20 Oct 2026 10:51:23 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7RD-0000JG-CX for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:23 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7RC-004dBJ-Pa for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:22 +0200 Received: from [10.42.69.8] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad747a7-8faa-0a2a0a5109dd-0a2a4508b6ba-10 for ; Tue, 20 Oct 2026 12:51:22 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad747a9-f659-0a2a45080019-aa0a817cdb43-3 for ; Tue, 20 Oct 2026 12:51:22 +0200 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-571-wpfby2pGOJyKwLe7dRoy5g-1; Tue, 20 Oct 2026 10:51:16 +0000 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 59F701956058; Tue, 20 Oct 2026 10:51:12 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6E20D1956088; Tue, 20 Oct 2026 10:51:09 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kVlgXy2vPG5I3mKp16fhq+bJb3obYLJd/3IFPjDdE9g=; b=R/ar126Pn4RLNJDh7XB+2g8touJ5NII/vb6HQut+LtJRJ/dIifJFHN5UnAnYRbMai3kFuo UdQyo/HmrmfrsD9q9fNNePfjfObK3+ADLALpIwGY1xYzOXCHHHy+CLTa3fJEuc1U7KiRhw XRPOZd1ZB6gKsReh+rTJH8WdS5HqjA0= X-MC-Unique: wpfby2pGOJyKwLe7dRoy5g-1 X-Mimecast-MFC-AGG-ID: wpfby2pGOJyKwLe7dRoy5g_1792493472 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:12 +0400 Subject: [PATCH v7 55/65] qdev: convert system PropertyInfo definitions to use qapi_type MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-55-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=16488; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=bKJiGjLc93NMNQe/axyuBXbCYEzkRfYsjB6tY47k/ME=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZcE6NcoIi2kkZhgPlwo4cwnMvIG9Khmkeki 3B164oT25KJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGXAAKCRDa6OEJdZac 5X4UD/oDIy4uzsDDKJ07Mwj4Le45Vv+5f8w9BOVeka0VijEf6x5pFmvuYTSqEfaovLHlXgeSaEI zRulvXe5KuGodBABZfg89LkkU5r2EBsPvVQVTz36tFtr/RA9tZ5OtkaUG4KoKgg1D84YjYZBKYC Dk7TuM+jRsDKwGYy9VsZ8RbLtkeZYVkKQ47Ekt/kYAgAbfRS6HL0GjcKqnMhKmZy4bFDxIEZtzd 0Zxv6JkIMu/i85FepDnytt2YCwhT6mvnL2ScEExHqyED7UcBzuU9VNMIEQSEAubvjd+MjJTK3RI 5q04XcpN4cpum2fvygKb8Trpj87BED6uoFvqmN48XHYwvPraPB3A8R9QYjPirdeq2e7K8SiblBq vliHBphsgAVgdcD1TuoFYOjqePJRz6v/Y/2M5pEg4m/MUBMWxvgP+O1qKuanj4WpOpXOG6xMlj9 pPUbKIIOtP6V1WUU7l5JRxfNPSGI4nhqjUO6LuQAwQWZE1zl+QKxMNgfWZledVaSyNLWWxAwHnO PHlyxs6OELk7p+QbfVeRnCQExc9dguQA8maKFafKmWIv91WwQ5KyX7D0OKHowXAosPoJ38fqbha 5UVZ5QSnmbDWHl/Qu80RjzcHcFsVx39BDAbueT4Ue3krKr40/8NsJQcY3lboVJN0DEmse+TPH0o 9Mdq/H0L6fXU0Cg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-MFC-PROC-ID: q0X-a5wx3T2LJMP0VZSIwKujFwCSwBfXZV6xmhzfBhU_1792493472 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-c1860d/1792493482-CDF4787B-B4E6DA02/0/0 X-purgate-type: clean X-purgate-size: 16490 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493875783158500 Replace .type string and .enum_table pointer with .qapi_type in all PropertyInfo definitions in qdev-properties-system.c Update file-private enum accessor functions to use .qapi_type->lookup instead of .enum_table. Note, this should be a faithful conversion, but it would be worth to consider better types than just "str" for references (block node names, chardev/netdev IDs, MAC addrs, etc) Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-prop-internal.h | 2 + hw/core/qdev-properties-system.c | 93 +++++++++++++++++-------------------= ---- hw/core/qdev-properties.c | 2 +- 3 files changed, 43 insertions(+), 54 deletions(-) diff --git a/hw/core/qdev-prop-internal.h b/hw/core/qdev-prop-internal.h index d7b77844fe0b..c190b7b88cf4 100644 --- a/hw/core/qdev-prop-internal.h +++ b/hw/core/qdev-prop-internal.h @@ -8,6 +8,8 @@ #ifndef HW_CORE_QDEV_PROP_INTERNAL_H #define HW_CORE_QDEV_PROP_INTERNAL_H =20 +const QEnumLookup *qdev_propinfo_enum_lookup(const PropertyInfo *info); + void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp); void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name, diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 3381de1144d6..8819a9a0b748 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -27,6 +27,7 @@ #include "qemu/uuid.h" #include "qemu/error-report.h" #include "qdev-prop-internal.h" +#include "qapi/qapi-type-infos.h" =20 #include "qemu/audio.h" #include "chardev/char-fe.h" @@ -238,7 +239,7 @@ static void release_drive(Object *obj, const char *name= , void *opaque) } =20 const PropertyInfo qdev_prop_drive =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Node name or ID of a block device to use as a backen= d", .realized_set_allowed =3D true, .get =3D get_drive, @@ -247,7 +248,7 @@ const PropertyInfo qdev_prop_drive =3D { }; =20 const PropertyInfo qdev_prop_drive_iothread =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Node name or ID of a block device to use as a backen= d", .realized_set_allowed =3D true, .get =3D get_drive, @@ -315,7 +316,7 @@ static void release_chr(Object *obj, const char *name, = void *opaque) } =20 const PropertyInfo qdev_prop_chr =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "ID of a chardev to use as a backend", .get =3D get_chr, .set =3D set_chr, @@ -389,7 +390,7 @@ inval: } =20 const PropertyInfo qdev_prop_macaddr =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Ethernet 6-byte MAC Address, example: 52:54:00:12:34= :56", .get =3D get_mac, .set =3D set_mac, @@ -477,7 +478,7 @@ out: } =20 const PropertyInfo qdev_prop_netdev =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "ID of a netdev to use as a backend", .get =3D get_netdev, .set =3D set_netdev, @@ -514,7 +515,7 @@ static void set_audiodev(Object *obj, Visitor *v, const= char* name, } =20 const PropertyInfo qdev_prop_audiodev =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "ID of an audiodev to use as a backend", /* release done on shutdown */ .get =3D get_audiodev, @@ -584,7 +585,8 @@ static void qdev_propinfo_set_losttickpolicy(Object *ob= j, Visitor *v, int *ptr =3D object_field_prop_ptr(obj, prop); int value; =20 - if (!visit_type_enum(v, name, &value, prop->info->enum_table, errp)) { + if (!visit_type_enum(v, name, &value, + qdev_propinfo_enum_lookup(prop->info), errp)) { return; } =20 @@ -604,9 +606,8 @@ static void qdev_propinfo_set_losttickpolicy(Object *ob= j, Visitor *v, QEMU_BUILD_BUG_ON(sizeof(LostTickPolicy) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_losttickpolicy =3D { - .type =3D "LostTickPolicy", + .qapi_type =3D &LostTickPolicy_type_info, .description =3D "Policy for handling lost ticks (discard/delay/slew)", - .enum_table =3D &LostTickPolicy_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_losttickpolicy, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -631,7 +632,7 @@ static void set_blocksize(Object *obj, Visitor *v, cons= t char *name, } =20 const PropertyInfo qdev_prop_blocksize =3D { - .type =3D "size", + .qapi_type =3D &size_type_info, .description =3D "A power of two between " MIN_BLOCK_SIZE_STR " and " MAX_BLOCK_SIZE_STR, .get =3D qdev_propinfo_get_size32, @@ -644,9 +645,8 @@ const PropertyInfo qdev_prop_blocksize =3D { QEMU_BUILD_BUG_ON(sizeof(BlockdevOnError) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_blockdev_on_error =3D { - .type =3D "BlockdevOnError", + .qapi_type =3D &BlockdevOnError_type_info, .description =3D "Error handling policy (report/ignore/enospc/stop/aut= o)", - .enum_table =3D &BlockdevOnError_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -657,10 +657,9 @@ const PropertyInfo qdev_prop_blockdev_on_error =3D { QEMU_BUILD_BUG_ON(sizeof(BiosAtaTranslation) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_bios_chs_trans =3D { - .type =3D "BiosAtaTranslation", + .qapi_type =3D &BiosAtaTranslation_type_info, .description =3D "Logical CHS translation algorithm " " (auto/none/lba/large/rechs)", - .enum_table =3D &BiosAtaTranslation_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -669,9 +668,8 @@ const PropertyInfo qdev_prop_bios_chs_trans =3D { /* --- FDC default drive types */ =20 const PropertyInfo qdev_prop_fdc_drive_type =3D { - .type =3D "FloppyDriveType", + .qapi_type =3D &FloppyDriveType_type_info, .description =3D "Floppy drive type (144/288/120/none/auto)", - .enum_table =3D &FloppyDriveType_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -680,10 +678,9 @@ const PropertyInfo qdev_prop_fdc_drive_type =3D { /* --- MultiFDCompression --- */ =20 const PropertyInfo qdev_prop_multifd_compression =3D { - .type =3D "MultiFDCompression", + .qapi_type =3D &MultiFDCompression_type_info, .description =3D "multifd compression method" " (none/zlib/zstd/qpl/uadk/qatzip)", - .enum_table =3D &MultiFDCompression_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -694,9 +691,8 @@ const PropertyInfo qdev_prop_multifd_compression =3D { QEMU_BUILD_BUG_ON(sizeof(MigMode) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_mig_mode =3D { - .type =3D "MigMode", + .qapi_type =3D &MigMode_type_info, .description =3D "Migration mode (normal/cpr-reboot)", - .enum_table =3D &MigMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -707,18 +703,16 @@ const PropertyInfo qdev_prop_mig_mode =3D { QEMU_BUILD_BUG_ON(sizeof(GranuleMode) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_granule_mode =3D { - .type =3D "GranuleMode", + .qapi_type =3D &GranuleMode_type_info, .description =3D "Granule page size (4k/8k/16k/64k/host)", - .enum_table =3D &GranuleMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, }; =20 const PropertyInfo qdev_prop_zero_page_detection =3D { - .type =3D "ZeroPageDetection", + .qapi_type =3D &ZeroPageDetection_type_info, .description =3D "Zero page detection (none/legacy/multifd)", - .enum_table =3D &ZeroPageDetection_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -729,9 +723,8 @@ const PropertyInfo qdev_prop_zero_page_detection =3D { QEMU_BUILD_BUG_ON(sizeof(SsidSizeMode) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_ssidsize_mode =3D { - .type =3D "SsidSizeMode", + .qapi_type =3D &SsidSizeMode_type_info, .description =3D "ssidsize mode: auto, 0-20", - .enum_table =3D &SsidSizeMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -742,9 +735,8 @@ const PropertyInfo qdev_prop_ssidsize_mode =3D { QEMU_BUILD_BUG_ON(sizeof(OasMode) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_oas_mode =3D { - .type =3D "OasMode", + .qapi_type =3D &OasMode_type_info, .description =3D "oas mode: auto, 32, 36, 40, 42, 44, 48, 52, 56", - .enum_table =3D &OasMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -824,7 +816,7 @@ out: } =20 const PropertyInfo qdev_prop_reserved_region =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Reserved Region, example: 0xFEE00000:0xFEEFFFFF:0", .get =3D get_reserved_region, .set =3D set_reserved_region, @@ -904,8 +896,7 @@ static char *print_pci_devfn(Object *obj, const Propert= y *prop) } =20 const PropertyInfo qdev_prop_pci_devfn =3D { - /* The formatted string accepted by the setter is a CLI convenience. */ - .type =3D "int32", + .qapi_type =3D &int32_type_info, .description =3D "Slot and optional function number, example: 06.0 or = 06", .print =3D print_pci_devfn, .get =3D qdev_propinfo_get_int32, @@ -1011,7 +1002,7 @@ inval: } =20 const PropertyInfo qdev_prop_pci_host_devaddr =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Address (bus:device.function) of " "the host device, example: 04:10.0", .get =3D get_pci_host_devaddr, @@ -1021,9 +1012,8 @@ const PropertyInfo qdev_prop_pci_host_devaddr =3D { /* --- OffAutoPCIBAR off/auto/bar0/bar1/bar2/bar3/bar4/bar5 --- */ =20 const PropertyInfo qdev_prop_off_auto_pcibar =3D { - .type =3D "OffAutoPCIBAR", + .qapi_type =3D &OffAutoPCIBAR_type_info, .description =3D "off/auto/bar0/bar1/bar2/bar3/bar4/bar5", - .enum_table =3D &OffAutoPCIBAR_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1062,7 +1052,8 @@ static void get_prop_pcielinkspeed(Object *obj, Visit= or *v, const char *name, abort(); } =20 - visit_type_enum(v, name, &speed, prop->info->enum_table, errp); + visit_type_enum(v, name, &speed, + qdev_propinfo_enum_lookup(prop->info), errp); } =20 static void set_prop_pcielinkspeed(Object *obj, Visitor *v, const char *na= me, @@ -1072,8 +1063,8 @@ static void set_prop_pcielinkspeed(Object *obj, Visit= or *v, const char *name, PCIExpLinkSpeed *p =3D object_field_prop_ptr(obj, prop); int speed; =20 - if (!visit_type_enum(v, name, &speed, prop->info->enum_table, - errp)) { + if (!visit_type_enum(v, name, &speed, + qdev_propinfo_enum_lookup(prop->info), errp)) { return; } =20 @@ -1103,9 +1094,8 @@ static void set_prop_pcielinkspeed(Object *obj, Visit= or *v, const char *name, } =20 const PropertyInfo qdev_prop_pcie_link_speed =3D { - .type =3D "PCIELinkSpeed", + .qapi_type =3D &PCIELinkSpeed_type_info, .description =3D "2_5/5/8/16/32/64", - .enum_table =3D &PCIELinkSpeed_lookup, .get =3D get_prop_pcielinkspeed, .set =3D set_prop_pcielinkspeed, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1147,7 +1137,8 @@ static void get_prop_pcielinkwidth(Object *obj, Visit= or *v, const char *name, abort(); } =20 - visit_type_enum(v, name, &width, prop->info->enum_table, errp); + visit_type_enum(v, name, &width, + qdev_propinfo_enum_lookup(prop->info), errp); } =20 static void set_prop_pcielinkwidth(Object *obj, Visitor *v, const char *na= me, @@ -1157,8 +1148,8 @@ static void set_prop_pcielinkwidth(Object *obj, Visit= or *v, const char *name, PCIExpLinkWidth *p =3D object_field_prop_ptr(obj, prop); int width; =20 - if (!visit_type_enum(v, name, &width, prop->info->enum_table, - errp)) { + if (!visit_type_enum(v, name, &width, + qdev_propinfo_enum_lookup(prop->info), errp)) { return; } =20 @@ -1191,9 +1182,8 @@ static void set_prop_pcielinkwidth(Object *obj, Visit= or *v, const char *name, } =20 const PropertyInfo qdev_prop_pcie_link_width =3D { - .type =3D "PCIELinkWidth", + .qapi_type =3D &PCIELinkWidth_type_info, .description =3D "1/2/4/8/12/16/32", - .enum_table =3D &PCIELinkWidth_lookup, .get =3D get_prop_pcielinkwidth, .set =3D set_prop_pcielinkwidth, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1241,7 +1231,7 @@ static void set_default_uuid_auto(ObjectProperty *op,= const Property *prop) } =20 const PropertyInfo qdev_prop_uuid =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "UUID (aka GUID) or \"" UUID_VALUE_AUTO "\" for random value (default)", .get =3D get_uuid, @@ -1254,9 +1244,8 @@ const PropertyInfo qdev_prop_uuid =3D { QEMU_BUILD_BUG_ON(sizeof(S390CpuEntitlement) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_cpus390entitlement =3D { - .type =3D "S390CpuEntitlement", + .qapi_type =3D &S390CpuEntitlement_type_info, .description =3D "auto/low/medium/high (default medium)", - .enum_table =3D &S390CpuEntitlement_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1299,7 +1288,7 @@ static void release_iothread_vq_mapping_list(Object *= obj, } =20 const PropertyInfo qdev_prop_iothread_vq_mapping_list =3D { - .type =3D "IOThreadVirtQueueMappingList", + .qapi_type =3D &IOThreadVirtQueueMappingList_type_info, .description =3D "IOThread virtqueue mapping list [{\"iothread\":\"\", " "\"vqs\":[1,2,3,...]},...]", .get =3D get_iothread_vq_mapping_list, @@ -1310,18 +1299,16 @@ const PropertyInfo qdev_prop_iothread_vq_mapping_li= st =3D { /* --- Endian modes */ =20 const PropertyInfo qdev_prop_endian_mode =3D { - .type =3D "EndianMode", + .qapi_type =3D &EndianMode_type_info, .description =3D "Endian mode, big/little/unspecified", - .enum_table =3D &EndianMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, }; =20 const PropertyInfo qdev_prop_vmapple_virtio_blk_variant =3D { - .type =3D "VMAppleVirtioBlkVariant", + .qapi_type =3D &VMAppleVirtioBlkVariant_type_info, .description =3D "unspecified/root/aux", - .enum_table =3D &VMAppleVirtioBlkVariant_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1364,7 +1351,7 @@ static void release_virtio_gpu_output_list(Object *ob= j, } =20 const PropertyInfo qdev_prop_virtio_gpu_output_list =3D { - .type =3D "VirtIOGPUOutputList", + .qapi_type =3D &VirtIOGPUOutputList_type_info, .description =3D "VirtIO GPU output list [{\"name\":\"\"},...]", .get =3D get_virtio_gpu_output_list, .set =3D set_virtio_gpu_output_list, diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index abdb380cb9ec..a9abc646d5d7 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -101,7 +101,7 @@ static ObjectPropertyAccessor *field_prop_setter(const = PropertyInfo *info) return info->set ? field_prop_set : NULL; } =20 -static const QEnumLookup *qdev_propinfo_enum_lookup(const PropertyInfo *in= fo) +const QEnumLookup *qdev_propinfo_enum_lookup(const PropertyInfo *info) { if (info->qapi_type) { assert(info->qapi_type->lookup); --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493885; cv=none; d=zohomail.com; s=zohoarc; b=j/Fn+cGCqLX59LzExi6QF+YLH9dSOG16rvkXhZIQgwuBV2gf2vv4nudUGhvETyuy6WuR9MmqxTOJH/Z1Zaq5qSMIik5WJT2ZSG84p0pkk8WSpAFQUNjfwU6N/WszMwU+z68qWT7MlFOJTmtyg8Kzdj7U/r5K/1ZrVFEBgdzDvTE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493885; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1eBYCbo62pybnrvd2zJR+X4E8rHf2MlZgP3d6Su31eo=; b=HyVaR5bKXbfTLHiTi6TBZQ32OziVKbohbrA0+SiLV+yCmggWXTETsIMiTHFHkI5lg6mhHBEr2Cw+XMpyD5oLIs0By0i+KFOTPlL/LlS9JJJwMITXtrFAbsOuLL4fwLY9Jzjo5REZjIOYQ96zuK41I/3vOse1axMnsKFNXGz69ss= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493885319341.0879849604994; Tue, 20 Oct 2026 03:58:05 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455381.1669292 (Exim 4.92) (envelope-from ) id 1xJ7XH-0002o5-Mw; Tue, 20 Oct 2026 10:57:39 +0000 Received: by outflank-mailman (output) from mailman id 1455381.1669292; Tue, 20 Oct 2026 10:57:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7XF-0002ca-GA; Tue, 20 Oct 2026 10:57:37 +0000 Received: by outflank-mailman (input) for mailman id 1455381; Tue, 20 Oct 2026 10:51:27 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7RH-0000Kp-6r for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:27 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7RG-004dEx-K0 for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:26 +0200 Received: from [10.42.69.11] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad7479c-8faa-0a2a0a5109dd-0a2a450bb700-46 for ; Tue, 20 Oct 2026 12:51:26 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad747ad-b7e8-0a2a450b0019-aa0a857c5e61-3 for ; Tue, 20 Oct 2026 12:51:26 +0200 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-640-LD3Q4rjXMEKqjPFqN7WD9w-1; Tue, 20 Oct 2026 10:51:21 +0000 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 2D8291955BD4; Tue, 20 Oct 2026 10:51:17 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id ABCAE1956089; Tue, 20 Oct 2026 10:51:14 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1eBYCbo62pybnrvd2zJR+X4E8rHf2MlZgP3d6Su31eo=; b=B5BTHB2zdGsiYb36C/7V5s1tj6j776NLHQIAysWTvKqVwxHdmR2nE2rq/6jrMaFjqTtR0I hePnLysUxSFu7/Mh0lIzoylI8cAef7lYjHk/EvxAY9Cfp339NA2fWb0vp7zougiOAdJ8RB nGCrXqNa6ENmH2AYVYgTeXQ1DOCKEHo= X-MC-Unique: LD3Q4rjXMEKqjPFqN7WD9w-1 X-Mimecast-MFC-AGG-ID: LD3Q4rjXMEKqjPFqN7WD9w_1792493477 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:13 +0400 Subject: [PATCH v7 56/65] hw: convert device-local PropertyInfo definitions to use qapi_type MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-56-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=8815; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=IuCBdKGBPF8OB+y7s4jio7rdRTdD0humb0BIR918jzY=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZcQxqX6eOMSpfYs+pLT9Ow0Na9hEzQjJ0+w S7czDd2tmOJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGXAAKCRDa6OEJdZac 5Ss8D/9u4K3F7gThG/+rssznoV4GJ740Eb7vM34SO7kM+CMcAz0SmichYUKsY043yCHop4AuZHC LCq264K5jqI6bLVK5pUhsy42PlJ5ABe9K2vKHMUqJp8pSnncy2C74LHZmXSwl/61sE/J3BLrH7h nYIupz1f2RXz2Kseg4wCVaJb/12YUegn0C4BbAn1osYrlQC1CpAPskw/O4gjHHg19dANxc0iuOl kP/04E9U9V5/Qv3sg7Gma0B2LGOdkqB3UDFV+ya/UgRaGAzYW/FGRfCX3zHJjg/sFdqnVmmeQST Bd1Tu7ZeRf5mznPPYqaQXSiRpnQZWF8j/f9MZkFOJprVi9JKsVO0NzFxbG0wPemso49Okgkzmq0 tdFxFZlrsEPQ2lI/7l83w3+2xaA2aV+uqDCdxukgn+J2CNR9CNo80p75nJpZDjhncVjJGd1M8Yo msm+r+wrIQSoNQ9OrNQYvJ9I2AH5VOpdkqnrBqH+/c0d1BcIg+M/xYRpFfF6xcNX/t2hVaRZjjX 5tEZTIjyloiOSYCAqN2wriWOfN+tmlUocDn/0o53+Th53eTDQl6slDt39kqP+VURUXmsyer4GF8 Mic7qD4Dg11IPqUhCiVLNiuH+iTqs3LsM0IQqHPrhsl2ZPqybHUGY2vDA565zimKYuU3A1kLKNc 4eR+F+9z6aMxDww== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-MFC-PROC-ID: uPzOGT0iGuh59v6EHfTVg7HgD8gKs-haIeTaB9J-9jw_1792493477 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-42698a/1792493486-188C99EA-96F1E895/0/0 X-purgate-type: clean X-purgate-size: 8817 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493886270158500 Mechanical conversion of PropertyInfo definitions in device-specific files, replacing .type string with .qapi_type pointer to the corresponding QAPITypeInfo. Except "display_mode" for apple-gfx, which is a string of a specific format. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/block/xen-block.c | 3 ++- hw/display/apple-gfx.m | 3 ++- hw/misc/xlnx-versal-trng.c | 3 ++- hw/nvme/nguid.c | 3 ++- hw/nvram/xlnx-bbram.c | 3 ++- hw/nvram/xlnx-efuse.c | 3 ++- hw/pci/pci.c | 3 ++- hw/s390x/ccw-device.c | 3 ++- hw/s390x/css.c | 5 +++-- hw/s390x/s390-pci-bus.c | 3 ++- hw/vfio/pci-quirks.c | 3 ++- 11 files changed, 23 insertions(+), 12 deletions(-) diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c index 474c12fe4ac8..d9721c565c5f 100644 --- a/hw/block/xen-block.c +++ b/hw/block/xen-block.c @@ -29,6 +29,7 @@ #include "dataplane/xen-block.h" #include "hw/xen/interface/io/xs_wire.h" #include "trace.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #define XVDA_MAJOR 202 #define XVDQ_MAJOR (1 << 20) @@ -663,7 +664,7 @@ invalid: * https://xenbits.xen.org/docs/unstable/man/xen-vbd-interface.7.html */ static const PropertyInfo xen_block_prop_vdev =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Virtual Disk specifier (d*p*/xvd*/hd*/sd*)", .get =3D xen_block_get_vdev, .set =3D xen_block_set_vdev, diff --git a/hw/display/apple-gfx.m b/hw/display/apple-gfx.m index be0061b9db25..77c420b30006 100644 --- a/hw/display/apple-gfx.m +++ b/hw/display/apple-gfx.m @@ -15,6 +15,7 @@ #include "qemu/lockable.h" #include "qemu/cutils.h" #include "qemu/log.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qapi/error.h" #include "qemu/aio-wait.h" @@ -871,7 +872,7 @@ static void apple_gfx_set_display_mode(Object *obj, Vis= itor *v, } =20 const PropertyInfo qdev_prop_apple_gfx_display_mode =3D { - .type =3D "display_mode", + .qapi_type =3D &str_type_info, .description =3D "Display mode in pixels and Hertz, as x@ " "Example: 3840x2160@60", diff --git a/hw/misc/xlnx-versal-trng.c b/hw/misc/xlnx-versal-trng.c index 0584ee089e3c..97bd3c3f8475 100644 --- a/hw/misc/xlnx-versal-trng.c +++ b/hw/misc/xlnx-versal-trng.c @@ -36,6 +36,7 @@ #include "qapi/visitor.h" #include "migration/vmstate.h" #include "hw/core/qdev-properties.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #ifndef XLNX_VERSAL_TRNG_ERR_DEBUG #define XLNX_VERSAL_TRNG_ERR_DEBUG 0 @@ -662,7 +663,7 @@ static void trng_prop_fault_event_get(Object *obj, Visi= tor *v, } =20 static const PropertyInfo trng_prop_fault_events =3D { - .type =3D "uint32", + .qapi_type =3D &uint32_type_info, .description =3D "Set to trigger TRNG fault events", .set =3D trng_prop_fault_event_set, .get =3D trng_prop_fault_event_get, diff --git a/hw/nvme/nguid.c b/hw/nvme/nguid.c index 4cd6fad6ac9b..6eaf90fca88e 100644 --- a/hw/nvme/nguid.c +++ b/hw/nvme/nguid.c @@ -18,6 +18,7 @@ #include "qapi/visitor.h" #include "qemu/ctype.h" #include "nvme.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #define NGUID_SEPARATOR '-' =20 @@ -179,7 +180,7 @@ static void set_nguid(Object *obj, Visitor *v, const ch= ar *name, void *opaque, } =20 const PropertyInfo qdev_prop_nguid =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "NGUID or \"" NGUID_VALUE_AUTO "\" for random value", .get =3D get_nguid, diff --git a/hw/nvram/xlnx-bbram.c b/hw/nvram/xlnx-bbram.c index e336874bdef4..eb032ab8b9c8 100644 --- a/hw/nvram/xlnx-bbram.c +++ b/hw/nvram/xlnx-bbram.c @@ -34,6 +34,7 @@ #include "hw/core/qdev-properties.h" #include "hw/core/qdev-properties-system.h" #include "hw/nvram/xlnx-efuse.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #ifndef XLNX_BBRAM_ERR_DEBUG #define XLNX_BBRAM_ERR_DEBUG 0 @@ -486,7 +487,7 @@ static void bbram_prop_release_drive(Object *obj, const= char *name, } =20 static const PropertyInfo bbram_prop_drive =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Node name or ID of a block device to use as BBRAM ba= ckend", .realized_set_allowed =3D true, .get =3D bbram_prop_get_drive, diff --git a/hw/nvram/xlnx-efuse.c b/hw/nvram/xlnx-efuse.c index 03c9fbc0d076..b1c9ee4980a0 100644 --- a/hw/nvram/xlnx-efuse.c +++ b/hw/nvram/xlnx-efuse.c @@ -34,6 +34,7 @@ #include "system/blockdev.h" #include "hw/core/qdev-properties.h" #include "hw/core/qdev-properties-system.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #define TBIT0_OFFSET 28 #define TBIT1_OFFSET 29 @@ -251,7 +252,7 @@ static void efuse_prop_release_drive(Object *obj, const= char *name, } =20 static const PropertyInfo efuse_prop_drive =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Node name or ID of a block device to use as eFUSE ba= ckend", .realized_set_allowed =3D true, .get =3D efuse_prop_get_drive, diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 6edc702776ab..1b22c8d112f3 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -53,6 +53,7 @@ #include "qapi/error.h" #include "qemu/cutils.h" #include "pci-internal.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #include "hw/xen/xen.h" #include "hw/i386/kvm/xen_evtchn.h" @@ -80,7 +81,7 @@ static void prop_pci_busnr_get(Object *obj, Visitor *v, c= onst char *name, } =20 static const PropertyInfo prop_pci_busnr =3D { - .type =3D "uint8", + .qapi_type =3D &uint8_type_info, .get =3D prop_pci_busnr_get, }; =20 diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c index 25c427327957..fd21a4346522 100644 --- a/hw/s390x/ccw-device.c +++ b/hw/s390x/ccw-device.c @@ -17,6 +17,7 @@ #include "qapi/visitor.h" #include "qemu/ctype.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" =20 static void ccw_device_refill_ids(CcwDevice *dev) { @@ -74,7 +75,7 @@ static void ccw_device_set_loadparm(Object *obj, Visitor = *v, } =20 const PropertyInfo ccw_loadparm =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Up to 8 chars in set of [A-Za-z0-9. ] to select" " a guest kernel", .get =3D ccw_device_get_loadparm, diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 65341c68c3bf..50d14ab855f7 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -24,6 +24,7 @@ #include "hw/s390x/s390-virtio-ccw.h" #include "hw/s390x/s390-ccw.h" #include "exec/cpu-common.h" +#include "qapi/qapi-builtin-type-infos.h" =20 typedef struct CrwContainer { CRW crw; @@ -2530,7 +2531,7 @@ out: } =20 const PropertyInfo css_devid_propinfo =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Identifier of an I/O device in the channel " "subsystem, example: fe.1.23ab", .get =3D get_css_devid, @@ -2538,7 +2539,7 @@ const PropertyInfo css_devid_propinfo =3D { }; =20 const PropertyInfo css_devid_ro_propinfo =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Read-only identifier of an I/O device in the channel= " "subsystem, example: fe.1.23ab", .get =3D get_css_devid, diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 2724b27ec2a1..96603bfdb8a9 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -35,6 +35,7 @@ #include "system/runstate.h" =20 #include "trace.h" +#include "qapi/qapi-builtin-type-infos.h" =20 S390pciState *s390_get_phb(void) { @@ -1843,7 +1844,7 @@ static void s390_pci_set_fid(Object *obj, Visitor *v,= const char *name, } =20 static const PropertyInfo s390_pci_fid_propinfo =3D { - .type =3D "uint32", + .qapi_type =3D &uint32_type_info, .description =3D "zpci_fid", .get =3D s390_pci_get_fid, .set =3D s390_pci_set_fid, diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index c5b4f9091d49..4a3fd374a211 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -26,6 +26,7 @@ #include "pci.h" #include "pci-quirks.h" #include "trace.h" +#include "qapi/qapi-builtin-type-infos.h" =20 /* * List of device ids/vendor ids for which to disable @@ -1436,7 +1437,7 @@ static void set_nv_gpudirect_clique_id(Object *obj, V= isitor *v, } =20 const PropertyInfo qdev_prop_nv_gpudirect_clique =3D { - .type =3D "uint8", + .qapi_type =3D &uint8_type_info, .description =3D "NVIDIA GPUDirect Clique ID (0 - 15)", .get =3D get_nv_gpudirect_clique_id, .set =3D set_nv_gpudirect_clique_id, --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493891; cv=none; d=zohomail.com; s=zohoarc; b=j9hYq6xRFYwKhMgOh7gZ7hEAvQvc/wMJsP1G+jE60RvV2+oREqaQPHbYwiAVQe46K5sQ2Q5J45pjFvuTBqJoAFDEo+dTMt3J6S6CuX4PzbXeeO/S3/TX8guK6ZpzyrngXrpNc58MGMDoIhsx9NEc4APsKFJRpCwAQXo2aKxZnF4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493891; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0exBW/XllTPTbSwFohqKA2w8apHuJMdvUCko9RJ056E=; b=U/yR/wjhIm/W81Gaz54XmoP8fFSX4HW5JULq2G6biPrCuWSezbegx+Cs10jYda2UpYyJZtRNPXtcN15UnE1p3OYj8yJ21OFnq+l4xyJ+mF0hoO5TJb2SUO4FROUgFKNY2WVKGyijbouvLGU6S1o+Jdp9jr0bTnrA/6sVqawWr1g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493891639232.04301575601744; Tue, 20 Oct 2026 03:58:11 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455388.1669319 (Exim 4.92) (envelope-from ) id 1xJ7XO-0004BN-2G; Tue, 20 Oct 2026 10:57:46 +0000 Received: by outflank-mailman (output) from mailman id 1455388.1669319; Tue, 20 Oct 2026 10:57:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7XM-00045W-1X; Tue, 20 Oct 2026 10:57:44 +0000 Received: by outflank-mailman (input) for mailman id 1455388; Tue, 20 Oct 2026 10:51:34 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7RO-0000N6-4A for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:34 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7RN-004dIO-HK for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:33 +0200 Received: from [10.42.69.1] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad747a4-8faa-0a2a0a5109dd-0a2a4501b65a-46 for ; Tue, 20 Oct 2026 12:51:33 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad747b2-5984-0a2a45010019-aa0a817c5cad-3 for ; Tue, 20 Oct 2026 12:51:31 +0200 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-365-se9LWCHqPrS8GDVKoZHxeg-1; Tue, 20 Oct 2026 10:51:26 +0000 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 5E2BF1800878; Tue, 20 Oct 2026 10:51:22 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3CCCA18005B3; Tue, 20 Oct 2026 10:51:19 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0exBW/XllTPTbSwFohqKA2w8apHuJMdvUCko9RJ056E=; b=Pma88dWqnTmc4FPmMNkYkgNUTRvQZ2HY3kR7RsYoRLUoQJ0FXkp8KgmATBtb+RTbDvRM9N ZZCVCo/bsC3Uv1XcTFzW+AOuAEAKgb2gt+q+ZXtf5Re27G4KejpIzMnvk+z20sPWf/v5z7 wUVcfzqLGrrEepRyA6SU4O6Oq3itDdA= X-MC-Unique: se9LWCHqPrS8GDVKoZHxeg-1 X-Mimecast-MFC-AGG-ID: se9LWCHqPrS8GDVKoZHxeg_1792493482 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:14 +0400 Subject: [PATCH v7 57/65] target/riscv: convert PropertyInfo definitions to use qapi_type MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-57-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=5488; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=XKjrfhJ2Z/vpJVDltF2KXqS9w+wUXXQdOLcco6lHE08=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10Zc82i8KNdsFK3/pKeHfVnxA4m/fOSulmH97 UqyLuCWFoWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGXAAKCRDa6OEJdZac 5Z6cD/40rHcZVYX8wDxKQt8xTbOSbGFHhrkGBp+FJMr/D3qXf1CzfRM/zrW7BsamxNoTKamLgia vG/IF1pMis4auL226bPWZSNCw1wM64OiZLp34N3g6ajQDAnS4jfnerIAq7txzCCJUbSjDZABnY+ O/X/WwsFuXapBnFcvD2GRf7OtzeasFepDj3L1mQI9qlcIH41qkSHstkXLXEuCxStBNzaQuJ+1nT f8elVasH3Qez1yhQlVLkdcseJ+WxT9culB/RhJzlcYMOY3ijoorNNWBmNMniKWqUHM380+dg4mi s5Xym63nleHU9QrcqKokpmXEO6nqQXGl5BVpG/+GI8J37DOJEBt7FopbJ8Qa/Prf2L0HVZ2F4Ri v52x6jhQ2cVDf52+6cx4EEUH1NulOv3VMoE+O/9QeuJjD6NvDl0kfVkgV83mliwEwc7vahuvnT6 MZHRXzDT5gm/k1ueiE/SDcCEv9mGmfnj3XnZ7GWpLcbscFJebhqv5NagTK8eB75QcE5f7Li5RfK wc2VMbA5H3KXsbPLwfv0Bwcz8Ok9gFGyw0cb4nah/uS/gLpuvZSH3RlnyRCw3dHiiNOvmw9ktLa bEN7ShgjTnPCfdQW49hOPBZARpkjinKmx6OFPDecrZiaNqDlQaduXgMnp5B749lfM7OBJ8Ch+S8 7b7viGC9MASEqng== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-MFC-PROC-ID: DA2jTM9ESM5rdDbEhPDzBLagdqfUFOHp66NC6XzKjH4_1792493482 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-d62444/1792493492-BC95A757-F6AB39A4/0/0 X-purgate-type: clean X-purgate-size: 5490 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493892147158500 Mechanical conversion of all local PropertyInfo definitions in target/riscv/cpu.c Signed-off-by: Markus Armbruster Reviewed-by: Alistair Francis Signed-off-by: Marc-Andr=C3=A9 Lureau --- target/riscv/cpu.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 664c1a767950..28bfcb36ecb7 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1704,7 +1704,7 @@ static void prop_pmu_num_get(Object *obj, Visitor *v,= const char *name, } =20 static const PropertyInfo prop_pmu_num =3D { - .type =3D "uint8", + .qapi_type =3D &uint8_type_info, .description =3D "pmu-num", .get =3D prop_pmu_num_get, .set =3D prop_pmu_num_set, @@ -1746,7 +1746,7 @@ static void prop_pmu_mask_get(Object *obj, Visitor *v= , const char *name, } =20 static const PropertyInfo prop_pmu_mask =3D { - .type =3D "uint32", + .qapi_type =3D &uint32_type_info, .description =3D "pmu-mask", .get =3D prop_pmu_mask_get, .set =3D prop_pmu_mask_set, @@ -1778,7 +1778,7 @@ static void prop_mmu_get(Object *obj, Visitor *v, con= st char *name, } =20 static const PropertyInfo prop_mmu =3D { - .type =3D "bool", + .qapi_type =3D &bool_type_info, .description =3D "mmu", .get =3D prop_mmu_get, .set =3D prop_mmu_set, @@ -1811,7 +1811,7 @@ static void prop_pmp_get(Object *obj, Visitor *v, con= st char *name, } =20 static const PropertyInfo prop_pmp =3D { - .type =3D "bool", + .qapi_type =3D &bool_type_info, .description =3D "pmp", .get =3D prop_pmp_get, .set =3D prop_pmp_set, @@ -1851,7 +1851,7 @@ static void prop_num_pmp_regions_get(Object *obj, Vis= itor *v, const char *name, } =20 static const PropertyInfo prop_num_pmp_regions =3D { - .type =3D "uint8", + .qapi_type =3D &uint8_type_info, .description =3D "num-pmp-regions", .get =3D prop_num_pmp_regions_get, .set =3D prop_num_pmp_regions_set, @@ -1889,7 +1889,7 @@ static void prop_pmp_granularity_get(Object *obj, Vis= itor *v, const char *name, } =20 static const PropertyInfo prop_pmp_granularity =3D { - .type =3D "uint32", + .qapi_type =3D &uint32_type_info, .description =3D "pmp-granularity", .get =3D prop_pmp_granularity_get, .set =3D prop_pmp_granularity_set, @@ -1965,7 +1965,7 @@ static void prop_priv_spec_get(Object *obj, Visitor *= v, const char *name, } =20 static const PropertyInfo prop_priv_spec =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "priv_spec", /* FIXME enum? */ .get =3D prop_priv_spec_get, @@ -1998,7 +1998,7 @@ static void prop_vext_spec_get(Object *obj, Visitor *= v, const char *name, } =20 static const PropertyInfo prop_vext_spec =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "vext_spec", /* FIXME enum? */ .get =3D prop_vext_spec_get, @@ -2041,7 +2041,7 @@ static void prop_vlen_get(Object *obj, Visitor *v, co= nst char *name, } =20 static const PropertyInfo prop_vlen =3D { - .type =3D "uint16", + .qapi_type =3D &uint16_type_info, .description =3D "vlen", .get =3D prop_vlen_get, .set =3D prop_vlen_set, @@ -2082,7 +2082,7 @@ static void prop_elen_get(Object *obj, Visitor *v, co= nst char *name, } =20 static const PropertyInfo prop_elen =3D { - .type =3D "uint16", + .qapi_type =3D &uint16_type_info, .description =3D "elen", .get =3D prop_elen_get, .set =3D prop_elen_set, @@ -2118,7 +2118,7 @@ static void prop_cbom_blksize_get(Object *obj, Visito= r *v, const char *name, } =20 static const PropertyInfo prop_cbom_blksize =3D { - .type =3D "uint16", + .qapi_type =3D &uint16_type_info, .description =3D "cbom_blocksize", .get =3D prop_cbom_blksize_get, .set =3D prop_cbom_blksize_set, @@ -2154,7 +2154,7 @@ static void prop_cbop_blksize_get(Object *obj, Visito= r *v, const char *name, } =20 static const PropertyInfo prop_cbop_blksize =3D { - .type =3D "uint16", + .qapi_type =3D &uint16_type_info, .description =3D "cbop_blocksize", .get =3D prop_cbop_blksize_get, .set =3D prop_cbop_blksize_set, @@ -2190,7 +2190,7 @@ static void prop_cboz_blksize_get(Object *obj, Visito= r *v, const char *name, } =20 static const PropertyInfo prop_cboz_blksize =3D { - .type =3D "uint16", + .qapi_type =3D &uint16_type_info, .description =3D "cboz_blocksize", .get =3D prop_cboz_blksize_get, .set =3D prop_cboz_blksize_set, @@ -2226,7 +2226,7 @@ static void prop_mvendorid_get(Object *obj, Visitor *= v, const char *name, } =20 static const PropertyInfo prop_mvendorid =3D { - .type =3D "uint32", + .qapi_type =3D &uint32_type_info, .description =3D "mvendorid", .get =3D prop_mvendorid_get, .set =3D prop_mvendorid_set, @@ -2262,7 +2262,7 @@ static void prop_mimpid_get(Object *obj, Visitor *v, = const char *name, } =20 static const PropertyInfo prop_mimpid =3D { - .type =3D "uint64", + .qapi_type =3D &uint64_type_info, .description =3D "mimpid", .get =3D prop_mimpid_get, .set =3D prop_mimpid_set, @@ -2319,7 +2319,7 @@ static void prop_marchid_get(Object *obj, Visitor *v,= const char *name, } =20 static const PropertyInfo prop_marchid =3D { - .type =3D "uint64", + .qapi_type =3D &uint64_type_info, .description =3D "marchid", .get =3D prop_marchid_get, .set =3D prop_marchid_set, --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493709; cv=none; d=zohomail.com; s=zohoarc; b=jlt0abGPpmNdn9mYG/8lvFhTjWHzpXQyi529+qe8KNU+w1t23NCxcRD5AiHSpwQhK9aavRhSZhryo7R5MhnQA3CEVNndf7pXVZUlHquZ3kB+TIt2wWoQuCm3gshU6io3Ku17N7JzTyJe0udO3r+i3ktB+JKHkjg1bBS+8an3i/o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493709; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VTmJNa8VT5lexLUKxdzeLthZimg97eONPVFzq6wZuao=; b=GVfmJFLg2qhF71zb+6dHp/OGOEcooTwAz5Llr8VTiHMYxYzMmJdaN/pY+VcpJkroCqcgPNCb+8UWdu+mb8ruVLi9Uag+fjFMEQ7m07k0184TnXcfqvXu/yFD0Az+8CCpshxgbBgbrrwAxRpLzd1NQ1Yhc7caRfhVgEiVD7gHFHI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179249370932824.95465983111535; Tue, 20 Oct 2026 03:55:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7Tk-0003pB-Jb; Tue, 20 Oct 2026 06:54:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7RV-0000vE-7x for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:51:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7RT-0006bu-24 for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:51:40 -0400 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-15-JRWtrvsmMnafOZ4pe9-J1A-1; Tue, 20 Oct 2026 06:51:33 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 B4C2E1800BDD; Tue, 20 Oct 2026 10:51:27 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CA95D1800677; Tue, 20 Oct 2026 10:51:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VTmJNa8VT5lexLUKxdzeLthZimg97eONPVFzq6wZuao=; b=JFJRBBMxrgIwyH3/8nZ3rKXUe9OKUByBAOT6CUTwH1MAKUAVluJxgAqcml/JLl6gX7QexW J1KFC+8UyRhD0fyxdm8Q4xU5s/a5ivMBkCbvg73IUy+bHAEYNQ+A119k98NcPpKGIBxefc C2ryI3h/4CPYwvOyISDFDWrsHs25+UU= X-MC-Unique: JRWtrvsmMnafOZ4pe9-J1A-1 X-Mimecast-MFC-AGG-ID: JRWtrvsmMnafOZ4pe9-J1A_1792493487 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:15 +0400 Subject: [PATCH v7 58/65] qdev: convert PropertyInfo definitions to use qapi_type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-58-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Stefan Berger X-Developer-Signature: v=1; a=openpgp-sha256; l=3664; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=LIT19w6YWiCW19RYxdZdXGqpA2yVHBE+/WdhPO2w+KQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZcuI+2h8ZVKhhoVFi3OkRbLhN7DQhHpw2e8 ZI+IW/5ZPeJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGXAAKCRDa6OEJdZac 5d+rD/94HsUuS+bA630XGAf6+mNBdx3g5ggb5XrVvKXw9Au65Kows5jbGNX5ExMKeDtXzXsYPQZ 7bawMDy/OvYIm6c0sRa+DQhSHoKTRGyrflTzi3akNDBX1iTFKTE4ApPz982Yb2V1+zjv7S6JoKL s9x+m0L+aJhxXlji2Ne4h/2GqI65xptxwVMDeF5hdFhM1b/GVOLPZQYUgjk16EE7HtDzi9XcRpU qLzkGt0xA8pztXbBxv9kfTMNJvnlKFhUM2FhczGoJMlwLYyrRx/K4ZHzoaT6XiuPZUK7YMxmpkr 6kU46qGrWbK2PfH+q/Y8JKYadL6yh8v3kSS3na9fd5DaDkQX0p+Bnx8iLycn9BNcAfY/w7UNwsU 1syWcvdD3Zjx91KEjMZBf6XQOUp3zeontuSGuATb4jhC/tPGcmnOMzCZilju6MMinaNxT3lY42y HXItgz39UYWffKdBjfxJX3O1XuqYxbblcTGZmheVuso724KYPKlpfJKMUI+l8dYZwzkB21LBjpD CypHEsnuhmR2vRevpDVirDYKTs59vv51cttaKCBf0mOGodSLdbRKt66uM3ORmazmTeb/HPU+/oD vW8fnePj8pQJmxXFS18zBsuuz75rzcslLcOf/SWSu8i8o5lSfTxYhOhED+/Lizl23J6M6lVvKko +KUM9I7WMK1AoZw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493710699158500 Convert the remaining PropertyInfo definitions outside hw/ After this patch, all PropertyInfo definitions have .qapi_type set, except qdev_prop_link (uses .create) and qdev_prop_array (refactored in the next patches). Signed-off-by: Markus Armbruster Reviewed-by: Stefan Berger Signed-off-by: Marc-Andr=C3=A9 Lureau --- backends/spdm-socket.c | 4 ++-- backends/tpm/tpm_util.c | 3 ++- migration/options.c | 4 +++- target/sparc/cpu.c | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/backends/spdm-socket.c b/backends/spdm-socket.c index 826efc276dcd..4a4307975965 100644 --- a/backends/spdm-socket.c +++ b/backends/spdm-socket.c @@ -17,6 +17,7 @@ #include "hw/core/qdev-properties.h" #include "hw/core/qdev-properties-system.h" #include "hw/core/qdev-prop-internal.h" +#include "qapi/qapi-type-infos-sockets.h" =20 static bool read_bytes(const int socket, uint8_t *buffer, size_t number_of_bytes) @@ -253,9 +254,8 @@ void spdm_socket_close(const int socket, SpdmTransportT= ype transport_type) } =20 const PropertyInfo qdev_prop_spdm_trans =3D { - .type =3D "SpdmTransportType", + .qapi_type =3D &SpdmTransportType_type_info, .description =3D "Spdm Transport, doe/nvme/mctp/scsi/unspecified", - .enum_table =3D &SpdmTransportType_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, diff --git a/backends/tpm/tpm_util.c b/backends/tpm/tpm_util.c index 7019f7fd3eb9..dc6d4b211567 100644 --- a/backends/tpm/tpm_util.c +++ b/backends/tpm/tpm_util.c @@ -30,6 +30,7 @@ #include "system/tpm_backend.h" #include "system/tpm_util.h" #include "trace.h" +#include "qapi/qapi-builtin-type-infos.h" =20 /* tpm backend property */ =20 @@ -77,7 +78,7 @@ static void release_tpm(Object *obj, const char *name, vo= id *opaque) } =20 const PropertyInfo qdev_prop_tpm =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "ID of a tpm to use as a backend", .get =3D get_tpm, .set =3D set_tpm, diff --git a/migration/options.c b/migration/options.c index 46d040fc3f25..029282a1605c 100644 --- a/migration/options.c +++ b/migration/options.c @@ -37,6 +37,8 @@ #include "ram.h" #include "options.h" #include "system/kvm.h" +#include "qapi/qapi-builtin-type-infos.h" +#include "qapi/qapi-type-infos-common.h" =20 /* Maximum migrate downtime set to 2000 seconds */ #define MAX_MIGRATE_DOWNTIME_SECONDS 2000 @@ -294,7 +296,7 @@ static void set_default_value_tls_opt(ObjectProperty *o= p, const Property *prop) * TYPE_MIGRATION's TLS options. */ const PropertyInfo qdev_prop_StrOrNull =3D { - .type =3D "StrOrNull", + .qapi_type =3D &StrOrNull_type_info, .get =3D get_StrOrNull, .set =3D set_StrOrNull, .release =3D release_StrOrNull, diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index ae9bdca9df82..d0354a4d02af 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -30,6 +30,7 @@ #include "tcg/tcg.h" #include "fpu/softfloat.h" #include "target/sparc/translate.h" +#include "qapi/qapi-builtin-type-infos.h" =20 //#define DEBUG_FEATURES =20 @@ -948,7 +949,7 @@ static void sparc_set_nwindows(Object *obj, Visitor *v,= const char *name, } =20 static const PropertyInfo qdev_prop_nwindows =3D { - .type =3D "int", + .qapi_type =3D &int_type_info, .description =3D "Number of register windows", .get =3D sparc_get_nwindows, .set =3D sparc_set_nwindows, --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493896; cv=none; d=zohomail.com; s=zohoarc; b=LnyMBl7csE3DECl+i46ccE853sytXzWl2o/IaC+C5PJPYiaz45Pt5QHkvsoglaM5X9rHVuYsnhoZf44dDSurTdn37WHlkEIGex5DOSqF+WrYPl59+S2Kr/cdYhyMcir4es2ZN5Sy2BXayawPXwgnSJ9IEHyGP6ed9AGpAZ177Q4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493896; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nP79V/gtequIXU+t/Eu02ll/FN9WUbHuc8AyTpCeGFQ=; b=F6Aoxj21QUF5NzU+LFMMllvvu+3GgOdPzTv/MqQqV5WkuXzksVcvp3MisZaZ0YI4v8nSl9AqH058LZ/Hk54D1bFl3qOVIhaijHXilpJXCx3zcAAVrA2c/TQ+h0+qdwyps5BVAEByQTo3ockTS52fe6xtUrX2oYCmr69Ku+VFy6A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493896589838.0131663595004; Tue, 20 Oct 2026 03:58:16 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455392.1669331 (Exim 4.92) (envelope-from ) id 1xJ7XQ-0004yE-VJ; Tue, 20 Oct 2026 10:57:48 +0000 Received: by outflank-mailman (output) from mailman id 1455392.1669331; Tue, 20 Oct 2026 10:57:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7XP-0004qq-KM; Tue, 20 Oct 2026 10:57:47 +0000 Received: by outflank-mailman (input) for mailman id 1455392; Tue, 20 Oct 2026 10:51:42 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7RW-0000OE-GC for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:42 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7RV-00HSUK-TI for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:41 +0200 Received: from [10.42.69.5] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad747b7-bab6-0a2a0a5309dd-0a2a4505c874-22 for ; Tue, 20 Oct 2026 12:51:41 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad747bc-4cb1-0a2a45050019-aa0a817c8131-3 for ; Tue, 20 Oct 2026 12:51:41 +0200 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-491-xio_7je-O7qSetICYWdMZA-1; Tue, 20 Oct 2026 10:51:36 +0000 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 A1AEC19541A2; Tue, 20 Oct 2026 10:51:32 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DDBF930000E7; Tue, 20 Oct 2026 10:51:29 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493500; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nP79V/gtequIXU+t/Eu02ll/FN9WUbHuc8AyTpCeGFQ=; b=JHHN6DP0gi4BBye0SSokSIdSfmIn576WOZoBFdd7NUvYXQvKHlFdSNXmjc8/cwiMaYqeTl 7GsK2p9lyUnqNjrDMmWM1oSjnRdkPkhmPAdnkT+lACm3nvJ/S9vBRngWb6w1F2XUK4b3PW zB54U7s1JrmGFNuBD0XG4CMiWoIAFU0= X-MC-Unique: xio_7je-O7qSetICYWdMZA-1 X-Mimecast-MFC-AGG-ID: xio_7je-O7qSetICYWdMZA_1792493492 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:16 +0400 Subject: [PATCH v7 59/65] qdev: introduce typed array PropertyInfos MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-59-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=14678; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=mlWOi/fW9OK4tckY+TRn1APE+VrJXQmOBnALGjwbEQ0=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZcpE0N36exL5+QBGMlSA4uACN+Y42xftBBX h9qkQtQ0riJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGXAAKCRDa6OEJdZac 5c4yD/0UfQJG5WPTuqhdaOYQ99AXPKpribvFkipRwwlEz96K4bv7wRdXGRAr48+aD1LJmqKvk4f V17WHG4HitooSDv/eG/xUEtK/FocBxblDotXH8BhHVOB/Vm6+WZvumi1SaA7wsEEJTOmCoxI/+1 JA4g74DbBXlF27s435rmq88I5yk503Hr5D/mtYjnBGEfJQJWP6gtGR0jJooy4WkKd1mu2/doJoa GW4yy09MADqm4HEVyvYVFq3jhw9DCTR1I6QOkWeiDwWMpsMGGG80At5F8/GBdJaNBTvKB8RZIx8 MW0217lABMAz0nqw4WtpPqsol58KGjFV+nukL2w94iheX41hZlKyYMRt9HIMJvIlqJKkYnC/Pod Lf2LyJ9MJTjl3cStpGO6ZWTbaI7PTJTbDg/EPSgMc5bXZN+74W/24LNLnlAJV42D6Gn3H5x5HXc kRlLKg4vMoJA+KqASQpzEaMBcqXVKg5hlFivlzNZ783+Jo1g5fMBJCcH8BnPj9MWzmabnxLyWPU L/Vgjr2BOHK8D+hyhWAoWZGJSCdsQ+cvw06/E7oFhDC2pt/iuWjoHiDroClUn2z1un54JMSBOeF 6koVyz1y+KYiYSH2xjv1sEelhoyWcBxu0Gsr6HR7pAkp7whYnNX+56uoutkbGSccx3fFcrczzZN x8oPZybEnxuzd7A== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-MFC-PROC-ID: y0a8Gz-0_LCaggKu8PaIZVlATlsHioyDrFqPhNUaRXM_1792493492 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-c201ff/1792493501-F4EA12A1-B6C11B05/0/0 X-purgate-type: clean X-purgate-size: 14680 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493898348158500 Add element_info and element_size fields to PropertyInfo, and extend qdev_prop_qapi_type() to derive QAPI types for array properties via element_info->qapi_type->list. Add typed list PropertyInfo definitions that replace the generic qdev_prop_array. Each typed list PropertyInfo knows its element type at compile time through the element_info and element_size fields, which allows the QAPI type to be derived automatically. Infrastructure changes: - Add prop_array_info() and prop_array_elem_size() helpers that prefer the new element_info/element_size fields with fallback to the old arrayinfo/arrayfieldsize fields for compatibility - Make get_prop_array, set_prop_array, release_prop_array, and default_prop_array non-static so they can be used by DEFINE_PROP_ARRAY_INFO in other translation units - Add DEFINE_PROP_ARRAY_INFO macro in qdev-prop-internal.h The array of links needs special care for its "full type name" to follow the "linkList" pattern used by link properties ("link"). The old qdev_prop_array and DEFINE_PROP_ARRAY macro are preserved for compatibility; they will be replaced in the next patch. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-prop-internal.h | 21 +++++++ hw/core/qdev-properties-system.c | 5 ++ hw/core/qdev-properties.c | 104 ++++++++++++++++++++++++---= ---- include/hw/core/qdev-properties-system.h | 2 + include/hw/core/qdev-properties.h | 8 +++ 5 files changed, 119 insertions(+), 21 deletions(-) diff --git a/hw/core/qdev-prop-internal.h b/hw/core/qdev-prop-internal.h index c190b7b88cf4..40fa4bc63f03 100644 --- a/hw/core/qdev-prop-internal.h +++ b/hw/core/qdev-prop-internal.h @@ -27,4 +27,25 @@ void qdev_propinfo_get_int32(Object *obj, Visitor *v, co= nst char *name, void qdev_propinfo_get_size32(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp); =20 +void get_prop_array(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp); +void set_prop_array(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp); +void release_prop_array(Object *obj, const char *name, void *opaque); +void default_prop_array(ObjectProperty *op, const Property *prop); + +/* + * Note: .qapi_type is derived from element_info->qapi_type->list by + * qdev_prop_qapi_type() + */ +#define DEFINE_PROP_ARRAY_INFO(_elem_prop_info, _elem_type) \ + { \ + .element_info =3D &(_elem_prop_info), \ + .element_size =3D sizeof(_elem_type), \ + .get =3D get_prop_array, \ + .set =3D set_prop_array, \ + .release =3D release_prop_array, \ + .set_default_value =3D default_prop_array, \ + } + #endif diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 8819a9a0b748..ad4a00f776e6 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -484,6 +484,8 @@ const PropertyInfo qdev_prop_netdev =3D { .set =3D set_netdev, }; =20 +const PropertyInfo qdev_prop_netdev_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_netdev, NICPeers); =20 /* --- audiodev --- */ static void get_audiodev(Object *obj, Visitor *v, const char* name, @@ -822,6 +824,9 @@ const PropertyInfo qdev_prop_reserved_region =3D { .set =3D set_reserved_region, }; =20 +const PropertyInfo qdev_prop_reserved_region_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_reserved_region, ReservedRegion); + /* --- pci address --- */ =20 /* diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index a9abc646d5d7..bace12b10e36 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -666,6 +666,22 @@ struct ArrayElementList { void *value; }; =20 +static const PropertyInfo *prop_array_info(const Property *prop) +{ + if (prop->info->element_info) { + return prop->info->element_info; + } + return prop->arrayinfo; +} + +static int prop_array_elem_size(const Property *prop) +{ + if (prop->info->element_size) { + return prop->info->element_size; + } + return prop->arrayfieldsize; +} + /* * Given an array property @parent_prop in @obj, return a Property for a * specific element of the array. Arrays are backed by an uint32_t length = field @@ -675,7 +691,7 @@ static Property array_elem_prop(Object *obj, const Prop= erty *parent_prop, const char *name, char *elem) { return (Property) { - .info =3D parent_prop->arrayinfo, + .info =3D prop_array_info(parent_prop), .name =3D name, /* * This ugly piece of pointer arithmetic sets up the offset so @@ -693,19 +709,21 @@ static Property array_elem_prop(Object *obj, const Pr= operty *parent_prop, * underlying element's property release hook for each element and free the * property array. */ -static void release_prop_array(Object *obj, const char *name, void *opaque) +void release_prop_array(Object *obj, const char *name, void *opaque) { const Property *prop =3D opaque; uint32_t *alenptr =3D object_field_prop_ptr(obj, prop); void **arrayptr =3D (void *)obj + prop->arrayoffset; char *elem =3D *arrayptr; int i; + const PropertyInfo *elem_info =3D prop_array_info(prop); + int elem_size =3D prop_array_elem_size(prop); =20 - if (prop->arrayinfo->release) { + if (elem_info->release) { for (i =3D 0; i < *alenptr; i++) { Property elem_prop =3D array_elem_prop(obj, prop, name, elem); - prop->arrayinfo->release(obj, NULL, &elem_prop); - elem +=3D prop->arrayfieldsize; + elem_info->release(obj, NULL, &elem_prop); + elem +=3D elem_size; } } =20 @@ -719,8 +737,8 @@ static void release_prop_array(Object *obj, const char = *name, void *opaque) * (a pointer to which is stored in the additional field described by * prop->arrayoffset). */ -static void set_prop_array(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +void set_prop_array(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { ERRP_GUARD(); const Property *prop =3D opaque; @@ -728,6 +746,8 @@ static void set_prop_array(Object *obj, Visitor *v, con= st char *name, void **arrayptr =3D (void *)obj + prop->arrayoffset; ArrayElementList *list, *elem, *next; const size_t size =3D sizeof(*list); + const PropertyInfo *elem_info =3D prop_array_info(prop); + int elem_size =3D prop_array_elem_size(prop); char *elemptr; bool ok =3D true; =20 @@ -746,9 +766,9 @@ static void set_prop_array(Object *obj, Visitor *v, con= st char *name, while (elem) { Property elem_prop; =20 - elem->value =3D g_malloc0(prop->arrayfieldsize); + elem->value =3D g_malloc0(elem_size); elem_prop =3D array_elem_prop(obj, prop, name, elem->value); - prop->arrayinfo->set(obj, v, NULL, &elem_prop, errp); + elem_info->set(obj, v, NULL, &elem_prop, errp); if (*errp) { ok =3D false; goto out_obj; @@ -770,8 +790,8 @@ out_obj: for (elem =3D list; elem; elem =3D next) { Property elem_prop =3D array_elem_prop(obj, prop, name, elem->value); - if (prop->arrayinfo->release) { - prop->arrayinfo->release(obj, NULL, &elem_prop); + if (elem_info->release) { + elem_info->release(obj, NULL, &elem_prop); } next =3D elem->next; g_free(elem->value); @@ -784,19 +804,19 @@ out_obj: * Now that we know how big the array has to be, move the data over to= a * linear array and free the temporary list. */ - *arrayptr =3D g_malloc_n(*alenptr, prop->arrayfieldsize); + *arrayptr =3D g_malloc_n(*alenptr, elem_size); elemptr =3D *arrayptr; for (elem =3D list; elem; elem =3D next) { - memcpy(elemptr, elem->value, prop->arrayfieldsize); - elemptr +=3D prop->arrayfieldsize; + memcpy(elemptr, elem->value, elem_size); + elemptr +=3D elem_size; next =3D elem->next; g_free(elem->value); g_free(elem); } } =20 -static void get_prop_array(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +void get_prop_array(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { ERRP_GUARD(); const Property *prop =3D opaque; @@ -806,6 +826,8 @@ static void get_prop_array(Object *obj, Visitor *v, con= st char *name, ArrayElementList *list =3D NULL, *elem; ArrayElementList **tail =3D &list; const size_t size =3D sizeof(*list); + const PropertyInfo *elem_info =3D prop_array_info(prop); + int elem_size =3D prop_array_elem_size(prop); int i; bool ok; =20 @@ -813,7 +835,7 @@ static void get_prop_array(Object *obj, Visitor *v, con= st char *name, for (i =3D 0; i < *alenptr; i++) { elem =3D g_new0(ArrayElementList, 1); elem->value =3D elemptr; - elemptr +=3D prop->arrayfieldsize; + elemptr +=3D elem_size; =20 *tail =3D elem; tail =3D &elem->next; @@ -826,7 +848,7 @@ static void get_prop_array(Object *obj, Visitor *v, con= st char *name, elem =3D list; while (elem) { Property elem_prop =3D array_elem_prop(obj, prop, name, elem->valu= e); - prop->arrayinfo->get(obj, v, NULL, &elem_prop, errp); + elem_info->get(obj, v, NULL, &elem_prop, errp); if (*errp) { goto out_obj; } @@ -848,7 +870,7 @@ out_obj: } } =20 -static void default_prop_array(ObjectProperty *op, const Property *prop) +void default_prop_array(ObjectProperty *op, const Property *prop) { object_property_set_default_list(op); } @@ -861,6 +883,39 @@ const PropertyInfo qdev_prop_array =3D { .set_default_value =3D default_prop_array, }; =20 +const PropertyInfo qdev_prop_uint8_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint8, uint8_t); +const PropertyInfo qdev_prop_uint16_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint16, uint16_t); +const PropertyInfo qdev_prop_uint32_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint32, uint32_t); +const PropertyInfo qdev_prop_uint64_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint64, uint64_t); +const PropertyInfo qdev_prop_string_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_string, char *); + +static ObjectProperty *create_link_list_property(ObjectClass *oc, + const char *name, + const Property *prop) +{ + g_autofree char *full_type =3D g_strdup_printf("link<%s>List", + prop->link_type); + + return object_class_property_add(oc, name, full_type, + get_prop_array, set_prop_array, + release_prop_array, (Property *)prop); +} + +const PropertyInfo qdev_prop_link_list =3D { + .element_info =3D &qdev_prop_link, + .element_size =3D sizeof(void *), + .create =3D create_link_list_property, + .get =3D get_prop_array, + .set =3D set_prop_array, + .release =3D release_prop_array, + .set_default_value =3D default_prop_array, +}; + /* --- public helpers --- */ =20 static const Property *qdev_prop_walk(DeviceClass *cls, const char *name) @@ -1159,8 +1214,15 @@ const PropertyInfo qdev_prop_link =3D { =20 static const QAPITypeInfo *qdev_prop_qapi_type(const Property *prop) { - /* this will be later extended to cope with QAPI array properties */ - return prop->info->qapi_type; + if (prop->info->qapi_type) { + return prop->info->qapi_type; + } + if (prop->info->element_info) { + assert(prop->info->element_info->qapi_type); + assert(prop->info->element_info->qapi_type->list); + return prop->info->element_info->qapi_type->list; + } + return NULL; } =20 void qdev_property_add_static(DeviceState *dev, const Property *prop) diff --git a/include/hw/core/qdev-properties-system.h b/include/hw/core/qde= v-properties-system.h index 2cbea16d615e..819dce7d5e5d 100644 --- a/include/hw/core/qdev-properties-system.h +++ b/include/hw/core/qdev-properties-system.h @@ -23,6 +23,8 @@ extern const PropertyInfo qdev_prop_fdc_drive_type; extern const PropertyInfo qdev_prop_drive; extern const PropertyInfo qdev_prop_drive_iothread; extern const PropertyInfo qdev_prop_netdev; +extern const PropertyInfo qdev_prop_netdev_list; +extern const PropertyInfo qdev_prop_reserved_region_list; extern const PropertyInfo qdev_prop_pci_devfn; extern const PropertyInfo qdev_prop_blocksize; extern const PropertyInfo qdev_prop_pci_host_devaddr; diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-prope= rties.h index 1ea2ba66bb37..0c067170079d 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -35,6 +35,8 @@ struct PropertyInfo { const char *description; const QEnumLookup *enum_table; const QAPITypeInfo *qapi_type; + const struct PropertyInfo *element_info; + int element_size; bool realized_set_allowed; /* allow setting property on realized devic= e */ char *(*print)(Object *obj, const Property *prop); void (*set_default_value)(ObjectProperty *op, const Property *prop); @@ -75,7 +77,13 @@ extern const PropertyInfo qdev_prop_string; extern const PropertyInfo qdev_prop_on_off_auto; extern const PropertyInfo qdev_prop_size32; extern const PropertyInfo qdev_prop_array; +extern const PropertyInfo qdev_prop_uint8_list; +extern const PropertyInfo qdev_prop_uint16_list; +extern const PropertyInfo qdev_prop_uint32_list; +extern const PropertyInfo qdev_prop_uint64_list; +extern const PropertyInfo qdev_prop_string_list; extern const PropertyInfo qdev_prop_link; +extern const PropertyInfo qdev_prop_link_list; =20 #define DEFINE_PROP(_name, _state, _field, _prop, _type, ...) { \ .name =3D (_name), \ --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493895; cv=none; d=zohomail.com; s=zohoarc; b=NeE1dRMBCIvLYr0Jdq2gfVKkWfWIjbKyRIV6AT1bK7NdoUXschmc5jB/QEPJRuqWminPSKvb2LcBAOEoGvFt6uFNIL3EILpijVcAxz18PulouG1YODcpqGsV2Yyh999qa1aR3t0cOvnG4M7iIh9DUnGi3HsftWeJxxE6hklqnoc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493895; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=r8QtuizhlL08ffZvDlPlw2v2PSSFR41aZ6S3u6bs6Qs=; b=Ovi9NS6fshZnAGtnRnEpUe/Xrn7mgFt/2fTttKdakMHpufXE4+NU7/9zJjxYqFOQbJyK0xJOOZCrwcP+6wQlH6G76/LOYDVvbHoC84IIPQTpabCL8HCs1bW0GfpdiEb5GQgeOQ26ZIM2gwmsFSih7E1fQt8SSPu+yGnnEdPD1Vg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493895247307.8772751924538; Tue, 20 Oct 2026 03:58:15 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455394.1669344 (Exim 4.92) (envelope-from ) id 1xJ7XT-0005Lx-2K; Tue, 20 Oct 2026 10:57:51 +0000 Received: by outflank-mailman (output) from mailman id 1455394.1669344; Tue, 20 Oct 2026 10:57:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7XR-0005Hf-Pz; Tue, 20 Oct 2026 10:57:49 +0000 Received: by outflank-mailman (input) for mailman id 1455394; Tue, 20 Oct 2026 10:51:47 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Rb-0000Om-IS for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:47 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7Ra-004dLe-VK for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:46 +0200 Received: from [10.42.69.10] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad747bc-8faa-0a2a0a5109dd-0a2a450ac0cc-28 for ; Tue, 20 Oct 2026 12:51:46 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad747c1-f2d2-0a2a450a0019-aa0a817c8407-3 for ; Tue, 20 Oct 2026 12:51:46 +0200 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-443-ZgjA7GB6MIOQEU4UKDz0Pw-1; Tue, 20 Oct 2026 10:51:41 +0000 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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 9DAA619541A2; Tue, 20 Oct 2026 10:51:37 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2887A5BC; Tue, 20 Oct 2026 10:51:35 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r8QtuizhlL08ffZvDlPlw2v2PSSFR41aZ6S3u6bs6Qs=; b=Dl5WQd25DyFfc1Bf2Vnqio5y2uLcQNgdmza66W2oUqvHs3aOkVxLYrdLwDGO6l6DsigvSo 0GUVkGg9QM/Z8lNnaiYCcKvANqSsOp94fEUe/Xc4Z0UM2SBokcQP5HYloX4JKJOhzrcn8k 2NsBnUsFAbEJQ9tahCYrgubQdqie9fo= X-MC-Unique: ZgjA7GB6MIOQEU4UKDz0Pw-1 X-Mimecast-MFC-AGG-ID: ZgjA7GB6MIOQEU4UKDz0Pw_1792493497 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:17 +0400 Subject: [PATCH v7 60/65] qdev: simplify DEFINE_PROP_ARRAY and remove generic array PropertyInfo MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-60-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=18915; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=AcBmF3xK1ByT+5UwBtaglHA+LD1ebp5i6d9a8Eno2C4=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZcQVsvYZthZcJnIe4I+d1Hh4MrCaE9gYxWU lhG/CyXLeSJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGXAAKCRDa6OEJdZac 5ehBD/0bQxYDrIfQP8eZONOGiv1tqlX8g1WhNB17TG+vBi5j+C3oGfzsx38lnKRAcN5xgxzz1CM 1C6QLO3YbdB7nO7OD6wXVB2ACmBrsKt/kzhkJMRAOS2F6RZkcrxNnIvxNV64HsPCaV/bgKHptCW i3j8mn2meJlvQg1JeQ9c6gGf0UkYJsMGfVKnqEU6rUR5mZx0iX5zghoO+VG1oXmHXVYe7oOl7lb E5wtqIj6ipYyrt3nTaE84ZNyXgchLpOG3YU+afL4IA6cH4CkPrnv7B4OmnjET3jRLE+kStLOe9C N0izUsnNyTalfSJxy4y0Dbrewp8QQntANZnrle7jyFTW8kUQmu0G/0/80F4LxWf9y8dRpqJYDHl 4nzzttOhpDmwqnqQoB16CcQlMNhX3vXFqO+jDwjYeS5qXdM91f88Cgn+r6fakjIYk/II637VUYV Pb0MHezwGN8sBTUROcVPxo65vHguUIdV1Zcp6jJ/seTaCbNFiOqFY9mqhW6PEI/dn4u8rTWLhvV JbZdVZyrW1STJql4uj6cX7xOhzHzd1/FtlOUJKxigqrbx8XjmLOauttoZzOnJdnnsQHcShiKuAb VdyqA86tVpuDQPZba/kmur0HlRnDqMuvW+V3Mb8Ij0S8aGdUuq9Zp5RscZC2sLV9VUt8bwaf8mz 3T5spA2nBMmHtjQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-MFC-PROC-ID: pcixnRtM0l1SHRb4oJi-nW0yVtYtnO3OVDaV5fECdcg_1792493497 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-4011c0/1792493506-508CDCFC-AF7B7058/0/0 X-purgate-type: clean X-purgate-size: 18917 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493896358158500 Change DEFINE_PROP_ARRAY, the macro now uses _arrayprop##_list to resolve the typed list PropertyInfo (introduced in the previous patch) instead of the generic qdev_prop_array. This means the element type and size information is carried by the PropertyInfo itself rather than duplicated at each callsite. Since the typed list PropertyInfos encode element_info and element_size, the .arrayinfo and .arrayfieldsize fields are no longer set by the macro (they will be removed from the Property struct in the next patch). Remove qdev_prop_array, which is now unused. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-properties.c | 8 -------- hw/display/apple-gfx-mmio.m | 2 +- hw/display/apple-gfx-pci.m | 2 +- hw/display/apple-gfx.h | 1 + hw/display/apple-gfx.m | 4 ++++ hw/input/stellaris_gamepad.c | 2 +- hw/intc/arm_gicv3_common.c | 2 +- hw/intc/arm_gicv5_common.c | 4 ++-- hw/intc/rx_icu.c | 4 ++-- hw/misc/arm_sysctl.c | 4 ++-- hw/misc/mps2-scc.c | 2 +- hw/net/rocker/rocker.c | 2 +- hw/net/virtio-net.c | 2 +- hw/nvram/xlnx-efuse.c | 2 +- hw/nvram/xlnx-versal-efuse-ctrl.c | 2 +- hw/riscv/riscv_hart.c | 6 ++---- hw/virtio/virtio-iommu-pci.c | 2 +- include/hw/block/block.h | 2 +- include/hw/core/qdev-properties.h | 27 ++++++++++----------------- tests/unit/test-qdev.c | 2 +- 20 files changed, 35 insertions(+), 47 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index bace12b10e36..5c403cc2e57e 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -875,14 +875,6 @@ void default_prop_array(ObjectProperty *op, const Prop= erty *prop) object_property_set_default_list(op); } =20 -const PropertyInfo qdev_prop_array =3D { - .type =3D "list", - .get =3D get_prop_array, - .set =3D set_prop_array, - .release =3D release_prop_array, - .set_default_value =3D default_prop_array, -}; - const PropertyInfo qdev_prop_uint8_list =3D DEFINE_PROP_ARRAY_INFO(qdev_prop_uint8, uint8_t); const PropertyInfo qdev_prop_uint16_list =3D diff --git a/hw/display/apple-gfx-mmio.m b/hw/display/apple-gfx-mmio.m index 58beaadd1f10..dcd04617eb87 100644 --- a/hw/display/apple-gfx-mmio.m +++ b/hw/display/apple-gfx-mmio.m @@ -258,7 +258,7 @@ static void apple_gfx_mmio_reset(Object *obj, ResetType= type) static const Property apple_gfx_mmio_properties[] =3D { DEFINE_PROP_ARRAY("display-modes", AppleGFXMMIOState, common.num_display_modes, common.display_modes, - qdev_prop_apple_gfx_display_mode, AppleGFXDisplayMod= e), + qdev_prop_apple_gfx_display_mode), }; =20 static void apple_gfx_mmio_class_init(ObjectClass *klass, const void *data) diff --git a/hw/display/apple-gfx-pci.m b/hw/display/apple-gfx-pci.m index b0694f4cb855..74f79c8b157b 100644 --- a/hw/display/apple-gfx-pci.m +++ b/hw/display/apple-gfx-pci.m @@ -118,7 +118,7 @@ static void apple_gfx_pci_reset(Object *obj, ResetType = type) static const Property apple_gfx_pci_properties[] =3D { DEFINE_PROP_ARRAY("display-modes", AppleGFXPCIState, common.num_display_modes, common.display_modes, - qdev_prop_apple_gfx_display_mode, AppleGFXDisplayMod= e), + qdev_prop_apple_gfx_display_mode), }; =20 static void apple_gfx_pci_class_init(ObjectClass *klass, const void *data) diff --git a/hw/display/apple-gfx.h b/hw/display/apple-gfx.h index 3197bd853dab..b7eef7b9b14a 100644 --- a/hw/display/apple-gfx.h +++ b/hw/display/apple-gfx.h @@ -69,6 +69,7 @@ void *apple_gfx_host_ptr_for_gpa_range(uint64_t guest_phy= sical, MemoryRegion **mapping_in_region); =20 extern const PropertyInfo qdev_prop_apple_gfx_display_mode; +extern const PropertyInfo qdev_prop_apple_gfx_display_mode_list; =20 #endif =20 diff --git a/hw/display/apple-gfx.m b/hw/display/apple-gfx.m index 77c420b30006..592d692d793d 100644 --- a/hw/display/apple-gfx.m +++ b/hw/display/apple-gfx.m @@ -16,6 +16,7 @@ #include "qemu/cutils.h" #include "qemu/log.h" #include "qapi/qapi-builtin-type-infos.h" +#include "hw/core/qdev-prop-internal.h" #include "qapi/visitor.h" #include "qapi/error.h" #include "qemu/aio-wait.h" @@ -879,3 +880,6 @@ static void apple_gfx_set_display_mode(Object *obj, Vis= itor *v, .get =3D apple_gfx_get_display_mode, .set =3D apple_gfx_set_display_mode, }; + +const PropertyInfo qdev_prop_apple_gfx_display_mode_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_apple_gfx_display_mode, AppleGFXDispl= ayMode); diff --git a/hw/input/stellaris_gamepad.c b/hw/input/stellaris_gamepad.c index 376d91abad70..20613f649977 100644 --- a/hw/input/stellaris_gamepad.c +++ b/hw/input/stellaris_gamepad.c @@ -80,7 +80,7 @@ static void stellaris_gamepad_reset_enter(Object *obj, Re= setType type) =20 static const Property stellaris_gamepad_properties[] =3D { DEFINE_PROP_ARRAY("keycodes", StellarisGamepad, num_buttons, - keycodes, qdev_prop_uint32, uint32_t), + keycodes, qdev_prop_uint32), }; =20 static void stellaris_gamepad_class_init(ObjectClass *klass, const void *d= ata) diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c index f7ba74e6d52a..1298b6b735e9 100644 --- a/hw/intc/arm_gicv3_common.c +++ b/hw/intc/arm_gicv3_common.c @@ -615,7 +615,7 @@ static const Property arm_gicv3_common_properties[] =3D= { */ DEFINE_PROP_BOOL("force-8-bit-prio", GICv3State, force_8bit_prio, 0), DEFINE_PROP_ARRAY("redist-region-count", GICv3State, nb_redist_regions, - redist_region_count, qdev_prop_uint32, uint32_t), + redist_region_count, qdev_prop_uint32), DEFINE_PROP_LINK("sysmem", GICv3State, dma, TYPE_MEMORY_REGION, MemoryRegion *), DEFINE_PROP_UINT32("first-cpu-index", GICv3State, first_cpu_idx, 0), diff --git a/hw/intc/arm_gicv5_common.c b/hw/intc/arm_gicv5_common.c index b155486af65e..61c8ae493021 100644 --- a/hw/intc/arm_gicv5_common.c +++ b/hw/intc/arm_gicv5_common.c @@ -191,9 +191,9 @@ static void gicv5_common_realize(DeviceState *dev, Erro= r **errp) =20 static const Property arm_gicv5_common_properties[] =3D { DEFINE_PROP_LINK_ARRAY("cpus", GICv5Common, num_cpus, - cpus, TYPE_ARM_CPU, ARMCPU *), + cpus, TYPE_ARM_CPU), DEFINE_PROP_ARRAY("cpu-iaffids", GICv5Common, num_cpu_iaffids, - cpu_iaffids, qdev_prop_uint32, uint32_t), + cpu_iaffids, qdev_prop_uint32), DEFINE_PROP_UINT32("irsid", GICv5Common, irsid, 0), DEFINE_PROP_UINT32("spi-range", GICv5Common, spi_range, 0), DEFINE_PROP_UINT32("spi-base", GICv5Common, spi_base, 0), diff --git a/hw/intc/rx_icu.c b/hw/intc/rx_icu.c index 992b069ae245..125a6dcb6804 100644 --- a/hw/intc/rx_icu.c +++ b/hw/intc/rx_icu.c @@ -356,9 +356,9 @@ static const VMStateDescription vmstate_rxicu =3D { =20 static const Property rxicu_properties[] =3D { DEFINE_PROP_ARRAY("ipr-map", RXICUState, nr_irqs, map, - qdev_prop_uint8, uint8_t), + qdev_prop_uint8), DEFINE_PROP_ARRAY("trigger-level", RXICUState, nr_sense, init_sense, - qdev_prop_uint8, uint8_t), + qdev_prop_uint8), }; =20 static void rxicu_class_init(ObjectClass *klass, const void *data) diff --git a/hw/misc/arm_sysctl.c b/hw/misc/arm_sysctl.c index ebc95b9bb54c..1df85593a5cb 100644 --- a/hw/misc/arm_sysctl.c +++ b/hw/misc/arm_sysctl.c @@ -626,10 +626,10 @@ static const Property arm_sysctl_properties[] =3D { DEFINE_PROP_UINT32("proc_id", arm_sysctl_state, proc_id, 0), /* Daughterboard power supply voltages (as reported via SYS_CFG) */ DEFINE_PROP_ARRAY("db-voltage", arm_sysctl_state, db_num_vsensors, - db_voltage, qdev_prop_uint32, uint32_t), + db_voltage, qdev_prop_uint32), /* Daughterboard clock reset values (as reported via SYS_CFG) */ DEFINE_PROP_ARRAY("db-clock", arm_sysctl_state, db_num_clocks, - db_clock_reset, qdev_prop_uint32, uint32_t), + db_clock_reset, qdev_prop_uint32), }; =20 static void arm_sysctl_class_init(ObjectClass *klass, const void *data) diff --git a/hw/misc/mps2-scc.c b/hw/misc/mps2-scc.c index 554b504c7203..32f9e166feed 100644 --- a/hw/misc/mps2-scc.c +++ b/hw/misc/mps2-scc.c @@ -464,7 +464,7 @@ static const Property mps2_scc_properties[] =3D { * motherboard configuration controller to suit the FPGA image. */ DEFINE_PROP_ARRAY("oscclk", MPS2SCC, num_oscclk, oscclk_reset, - qdev_prop_uint32, uint32_t), + qdev_prop_uint32), }; =20 static void mps2_scc_class_init(ObjectClass *klass, const void *data) diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c index 910dce901b67..afbc32e99d94 100644 --- a/hw/net/rocker/rocker.c +++ b/hw/net/rocker/rocker.c @@ -1466,7 +1466,7 @@ static const Property rocker_properties[] =3D { DEFINE_PROP_UINT64("switch_id", Rocker, switch_id, 0), DEFINE_PROP_ARRAY("ports", Rocker, fp_ports, - fp_ports_peers, qdev_prop_netdev, NICPeers), + fp_ports_peers, qdev_prop_netdev), }; =20 static const VMStateDescription rocker_vmsd =3D { diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 19f453fb7dfd..56194398742e 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -4377,7 +4377,7 @@ static const Property virtio_net_properties[] =3D { DEFINE_PROP_BIT64("hash", VirtIONet, host_features, VIRTIO_NET_F_HASH_REPORT, false), DEFINE_PROP_ARRAY("ebpf-rss-fds", VirtIONet, nr_ebpf_rss_fds, - ebpf_rss_fds, qdev_prop_string, char*), + ebpf_rss_fds, qdev_prop_string), DEFINE_PROP_BIT64("guest_rsc_ext", VirtIONet, host_features, VIRTIO_NET_F_RSC_EXT, false), DEFINE_PROP_UINT32("rsc_interval", VirtIONet, rsc_timeout, diff --git a/hw/nvram/xlnx-efuse.c b/hw/nvram/xlnx-efuse.c index b1c9ee4980a0..99c16ce76f15 100644 --- a/hw/nvram/xlnx-efuse.c +++ b/hw/nvram/xlnx-efuse.c @@ -266,7 +266,7 @@ static const Property efuse_properties[] =3D { DEFINE_PROP_UINT32("efuse-size", XlnxEFuse, efuse_size, 64 * 32), DEFINE_PROP_BOOL("init-factory-tbits", XlnxEFuse, init_tbits, true), DEFINE_PROP_ARRAY("read-only", XlnxEFuse, ro_bits_cnt, ro_bits, - qdev_prop_uint32, uint32_t), + qdev_prop_uint32), }; =20 static void efuse_class_init(ObjectClass *klass, const void *data) diff --git a/hw/nvram/xlnx-versal-efuse-ctrl.c b/hw/nvram/xlnx-versal-efuse= -ctrl.c index f5d5587cb657..101320b82fd9 100644 --- a/hw/nvram/xlnx-versal-efuse-ctrl.c +++ b/hw/nvram/xlnx-versal-efuse-ctrl.c @@ -740,7 +740,7 @@ static const Property efuse_ctrl_props[] =3D { TYPE_XLNX_EFUSE, XlnxEFuse *), DEFINE_PROP_ARRAY("pg0-lock", XlnxVersalEFuseCtrl, extra_pg0_lock_n16, - extra_pg0_lock_spec, qdev_prop_uint16, uint16_t), + extra_pg0_lock_spec, qdev_prop_uint16), }; =20 static void efuse_ctrl_class_init(ObjectClass *klass, const void *data) diff --git a/hw/riscv/riscv_hart.c b/hw/riscv/riscv_hart.c index 32fd39737ff6..132cf8737001 100644 --- a/hw/riscv/riscv_hart.c +++ b/hw/riscv/riscv_hart.c @@ -48,11 +48,9 @@ static const Property riscv_harts_props[] =3D { * defined by "rnmi-exception-vector". */ DEFINE_PROP_ARRAY("rnmi-interrupt-vector", RISCVHartArrayState, - num_rnmi_irqvec, rnmi_irqvec, qdev_prop_uint64, - uint64_t), + num_rnmi_irqvec, rnmi_irqvec, qdev_prop_uint64), DEFINE_PROP_ARRAY("rnmi-exception-vector", RISCVHartArrayState, - num_rnmi_excpvec, rnmi_excpvec, qdev_prop_uint64, - uint64_t), + num_rnmi_excpvec, rnmi_excpvec, qdev_prop_uint64), DEFINE_PROP_LINK("memory", RISCVHartArrayState, memory, TYPE_MEMORY_REGION, MemoryRegion *), }; diff --git a/hw/virtio/virtio-iommu-pci.c b/hw/virtio/virtio-iommu-pci.c index 7b5ffddc1e97..1f3a07c5d119 100644 --- a/hw/virtio/virtio-iommu-pci.c +++ b/hw/virtio/virtio-iommu-pci.c @@ -38,7 +38,7 @@ static const Property virtio_iommu_pci_properties[] =3D { DEFINE_PROP_UINT32("class", VirtIOPCIProxy, class_code, 0), DEFINE_PROP_ARRAY("reserved-regions", VirtIOIOMMUPCI, vdev.nr_prop_resv_regions, vdev.prop_resv_regions, - qdev_prop_reserved_region, ReservedRegion), + qdev_prop_reserved_region), }; =20 static void virtio_iommu_pci_realize(VirtIOPCIProxy *vpci_dev, Error **err= p) diff --git a/include/hw/block/block.h b/include/hw/block/block.h index df941df19f26..70bf03a8de73 100644 --- a/include/hw/block/block.h +++ b/include/hw/block/block.h @@ -83,7 +83,7 @@ static inline unsigned int get_physical_block_exp(BlockCo= nf *conf) _conf.account_failed, ON_OFF_AUTO_AUTO), \ DEFINE_PROP_ARRAY("stats-intervals", _state, \ _conf.num_stats_intervals, _conf.stats_intervals, \ - qdev_prop_uint32, uint32_t) + qdev_prop_uint32) =20 #define DEFINE_BLOCK_PROPERTIES(_state, _conf) \ DEFINE_PROP_DRIVE("drive", _state, _conf.blk), \ diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-prope= rties.h index 0c067170079d..39f95ce7a3c6 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -76,7 +76,6 @@ extern const PropertyInfo qdev_prop_size; extern const PropertyInfo qdev_prop_string; extern const PropertyInfo qdev_prop_on_off_auto; extern const PropertyInfo qdev_prop_size32; -extern const PropertyInfo qdev_prop_array; extern const PropertyInfo qdev_prop_uint8_list; extern const PropertyInfo qdev_prop_uint16_list; extern const PropertyInfo qdev_prop_uint32_list; @@ -148,15 +147,15 @@ extern const PropertyInfo qdev_prop_link_list; * @_name: name of the array * @_state: name of the device state structure type * @_field: uint32_t field in @_state to hold the array length - * @_arrayfield: field in @_state (of type '@_arraytype *') which - * will point to the array - * @_arrayprop: PropertyInfo defining what property the array elements have - * @_arraytype: C type of the array elements + * @_arrayfield: field in @_state which will point to the array + * @_arrayprop: PropertyInfo for the array elements (e.g. qdev_prop_uint32= ); + * a corresponding list PropertyInfo named @_arrayprop##_list + * must exist * * Define device properties for a variable-length array _name. The array = is * represented as a list in the visitor interface. * - * @_arraytype is required to be movable with memcpy(). + * The element type must be movable with memcpy(). * * When the array property is set, the @_field member of the device * struct is set to the array length, and @_arrayfield is set to point @@ -166,12 +165,10 @@ extern const PropertyInfo qdev_prop_link_list; * @_arrayfield memory. */ #define DEFINE_PROP_ARRAY(_name, _state, _field, \ - _arrayfield, _arrayprop, _arraytype) \ - DEFINE_PROP(_name, _state, _field, qdev_prop_array, uint32_t, \ + _arrayfield, _arrayprop) \ + DEFINE_PROP(_name, _state, _field, _arrayprop##_list, uint32_t, \ .set_default =3D true, \ .defval.u =3D 0, \ - .arrayinfo =3D &(_arrayprop), \ - .arrayfieldsize =3D sizeof(_arraytype), \ .arrayoffset =3D offsetof(_state, _arrayfield)) =20 #define DEFINE_PROP_LINK(_name, _state, _field, _type, _ptr_type) \ @@ -183,10 +180,8 @@ extern const PropertyInfo qdev_prop_link_list; * @_name: name of the array * @_state: name of the device state structure type * @_field: uint32_t field in @_state to hold the array length - * @_arrayfield: field in @_state (of type '@_arraytype *') which - * will point to the array + * @_arrayfield: field in @_state which will point to the array * @_linktype: QOM type name of the link type - * @_arraytype: C type of the array elements * * Define device properties for a variable-length array _name of links * (i.e. this is the array version of DEFINE_PROP_LINK). @@ -195,12 +190,10 @@ extern const PropertyInfo qdev_prop_link_list; * where each string is the QOM path of the object to be linked. */ #define DEFINE_PROP_LINK_ARRAY(_name, _state, _field, _arrayfield, \ - _linktype, _arraytype) \ - DEFINE_PROP(_name, _state, _field, qdev_prop_array, uint32_t, \ + _linktype) \ + DEFINE_PROP(_name, _state, _field, qdev_prop_link_list, uint32_t, \ .set_default =3D true, \ .defval.u =3D 0, \ - .arrayinfo =3D &qdev_prop_link, \ - .arrayfieldsize =3D sizeof(_arraytype), \ .arrayoffset =3D offsetof(_state, _arrayfield), \ .link_type =3D _linktype) =20 diff --git a/tests/unit/test-qdev.c b/tests/unit/test-qdev.c index 77c3eee71713..8cd004b1efab 100644 --- a/tests/unit/test-qdev.c +++ b/tests/unit/test-qdev.c @@ -23,7 +23,7 @@ static const Property my_dev_props[] =3D { DEFINE_PROP_UINT32("u32", MyDev, prop_u32, 100), DEFINE_PROP_STRING("string", MyDev, prop_string), DEFINE_PROP_ARRAY("array-u32", MyDev, prop_array_u32_nb, prop_array_u3= 2, - qdev_prop_uint32, uint32_t), + qdev_prop_uint32), }; =20 static void my_dev_class_init(ObjectClass *oc, const void *data) --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493903; cv=none; d=zohomail.com; s=zohoarc; b=JrAZP2UbFFlqQick2h7vOJ/h6f4Hkf/EiinkakUIDPgSVnpXkBmpTNBxu+81haekJaTO3KOSy06ffiE0ipThyEQjmCMkAq6u8I6+oYUDeQRa61dOChuKAs75eC2inKdQU92dF3tzqGLkxk84ndH+m9Y1Ccw4LtHZuaVfuym15Jg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493903; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LYACgjhTWZ9q+fLhnzsamP9g+AzKgXq2yAfu5fEslcg=; b=N5WBmx+MIW/EIzvJcpgh+YUhYKQMiZWsZyGkCvBZHoHkDv/SIMy4Jao1fHb3qpE/t1b/thAUfN6YaTmVKTuCMbZJrlwFeNA5o1ziB+25e/UDGJhy9Y7NMPk8qqK/a2EHn73uM4o35TpRyYvqTAS8mrqJ7Vt1WV/SEqJI/f9MPD0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493903970904.7209228698466; Tue, 20 Oct 2026 03:58:23 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455396.1669353 (Exim 4.92) (envelope-from ) id 1xJ7XV-0005kS-9P; Tue, 20 Oct 2026 10:57:53 +0000 Received: by outflank-mailman (output) from mailman id 1455396.1669353; Tue, 20 Oct 2026 10:57:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7XT-0005bv-Km; Tue, 20 Oct 2026 10:57:51 +0000 Received: by outflank-mailman (input) for mailman id 1455396; Tue, 20 Oct 2026 10:51:58 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Rm-0000PJ-Bk for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:58 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7Rl-00Cvm1-Hq for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:57 +0200 Received: from [10.42.69.5] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad747ca-8faa-0a2a0a5109dd-0a2a4505e676-10 for ; Tue, 20 Oct 2026 12:51:57 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad747cb-4cb1-0a2a45050019-aa0a857c501f-3 for ; Tue, 20 Oct 2026 12:51:57 +0200 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-674-wz3IHZmqNpWyL00b1VAr7Q-1; Tue, 20 Oct 2026 10:51:46 +0000 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 390C7180132B; Tue, 20 Oct 2026 10:51:42 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AEC3230000E7; Tue, 20 Oct 2026 10:51:39 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LYACgjhTWZ9q+fLhnzsamP9g+AzKgXq2yAfu5fEslcg=; b=aanf2Mf7GTaqdeppr2099HyhO9I/TSgix+uC+WtKZV2G8B6Kmdc7XEbSim7JOqlhC/6Ee7 K+eG0nFiK/NUTA/b80rr8zIsGdF19H1FD4YKd+YjdHzQUQHy1fsdEVjhdRSNwbxj1LiUjO ApO0yCl0V+8Vq3W+7VIwWrSWc79xMf0= X-MC-Unique: wz3IHZmqNpWyL00b1VAr7Q-1 X-Mimecast-MFC-AGG-ID: wz3IHZmqNpWyL00b1VAr7Q_1792493502 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:18 +0400 Subject: [PATCH v7 61/65] qdev: remove deprecated PropertyInfo.type and .enum_table fields MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-61-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=5656; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=GW0iWX+ovnUEAGVG0BxcFS64OjWdn47qGiXFBFBt6kE=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZduD65Qr6F408CFXCHRwiWcGKpWuyckav27 m0L7FlHyHOJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGXQAKCRDa6OEJdZac 5SIyD/9K494S/RKkzAsSOv9T/MgMAP/WgYu11N3TAUAFlouXn2Swjs8mxH+DvN0TL1zOI7DEln4 fWF3jd4K9yGpeOdK3FVhlUuUGIu+vCahmXGsC2IRNnSgUJb4k2RHjeIiyWV/jhtNA/9wx465q/C 0OSjxbW+EtYZ3lz0RkjF6YDM+tm9WVYqnQnMDbFuzngcpgqksdveXP06Xu2THNHykMaEy9m8nir mzxnTI67NabjcysMX+MF1Qgy6e2kI6X8PSi5Ii4CpJXlg6NszHB8aISyuxGh3En/Fv2Y/2f/fzC sIKxBFBcSVSMYhRpwzAZZCX8YSUbh2Y42NRkfwZMI08gHA+sl8pYFdenolCBtd8mEDlWjtCWGLB c97FNo8YgEqQpDTNZOal6LhBdRktum+TSi1XlcqMndZ/TCO/g5x8g/hnsFrp/+6WHt+4VAegrzT mkGeBr/Y+ok5ueSlc+kTZYEoLpKHAsHeYM3r+GcPnXOgCk9GvkOrAfaAoHc155+qqmkOyAUeWJu V4X338aVVee/lykp8yDDcAkwPVhw1DH0lCRXuHCA2/aR8xhiZg8zMindNp8TtG/QbTUCwDa/WMw hJcKbcWKMOqkjIZn3eNTlzVwzpE6SFeoKKAnXaQFooDRlL0a/mAzPqJ1ahGBT4iLEdc/AVpxjkM ETt5bqcvNS2VmlQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-MFC-PROC-ID: aiKVchuLA7BQOzpTiF3oqenAXhvLeVLnjKgzaRlMziU_1792493502 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-c201ff/1792493517-2551A2A1-B41E74CC/0/0 X-purgate-type: clean X-purgate-size: 5658 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493906411158500 Now that all PropertyInfo definitions use .qapi_type, remove the legacy .type (string) and .enum_table fields from PropertyInfo, and the .arrayinfo/.arrayfieldsize fields from Property. Remove fallback branches in qdev_property_add_static() and qdev_class_add_property() that used object_property_add() with prop->info->type: these always use the QAPI-aware registration path now. Simplify qdev_propinfo_enum_lookup(), prop_array_info() and prop_array_elem_size() to use the new fields directly. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-properties.c | 58 ++++++++++++-----------------------= ---- include/hw/core/qdev-properties.h | 4 --- 2 files changed, 17 insertions(+), 45 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 5c403cc2e57e..a121878467e1 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -103,11 +103,8 @@ static ObjectPropertyAccessor *field_prop_setter(const= PropertyInfo *info) =20 const QEnumLookup *qdev_propinfo_enum_lookup(const PropertyInfo *info) { - if (info->qapi_type) { - assert(info->qapi_type->lookup); - return info->qapi_type->lookup; - } - return info->enum_table; + assert(info->qapi_type->lookup); + return info->qapi_type->lookup; } =20 void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, @@ -668,18 +665,12 @@ struct ArrayElementList { =20 static const PropertyInfo *prop_array_info(const Property *prop) { - if (prop->info->element_info) { - return prop->info->element_info; - } - return prop->arrayinfo; + return prop->info->element_info; } =20 static int prop_array_elem_size(const Property *prop) { - if (prop->info->element_size) { - return prop->info->element_size; - } - return prop->arrayfieldsize; + return prop->info->element_size; } =20 /* @@ -1224,20 +1215,13 @@ void qdev_property_add_static(DeviceState *dev, con= st Property *prop) const QAPITypeInfo *qapi_type =3D qdev_prop_qapi_type(prop); =20 assert(!prop->info->create); + assert(qapi_type); =20 - if (qapi_type) { - op =3D object_property_add_qapi(obj, prop->name, qapi_type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); - } else { - op =3D object_property_add(obj, prop->name, prop->info->type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); - } + op =3D object_property_add_qapi(obj, prop->name, qapi_type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); =20 object_property_set_description(obj, prop->name, prop->info->description); @@ -1261,21 +1245,13 @@ static void qdev_class_add_property(DeviceClass *kl= ass, const char *name, } else { const QAPITypeInfo *qapi_type =3D qdev_prop_qapi_type(prop); =20 - if (qapi_type) { - op =3D object_class_property_add_qapi(oc, - name, qapi_type, - field_prop_getter(prop->inf= o), - field_prop_setter(prop->inf= o), - prop->info->release, - (Property *)prop); - } else { - op =3D object_class_property_add(oc, - name, prop->info->type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); - } + assert(qapi_type); + op =3D object_class_property_add_qapi(oc, + name, qapi_type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); } if (prop->set_default) { prop->info->set_default_value(op, prop); diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-prope= rties.h index 39f95ce7a3c6..2267e734d1fd 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -23,17 +23,13 @@ struct Property { int64_t i; uint64_t u; } defval; - const PropertyInfo *arrayinfo; int arrayoffset; - int arrayfieldsize; uint8_t bitnr; bool set_default; }; =20 struct PropertyInfo { - const char *type; const char *description; - const QEnumLookup *enum_table; const QAPITypeInfo *qapi_type; const struct PropertyInfo *element_info; int element_size; --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493896; cv=none; d=zohomail.com; s=zohoarc; b=OIlk9+1AioJEEKfsZnFM9EqJpg5TcwfjhHrf0Q1pq6/1NlDTMkbWXdXcwM0dJDxwGHelr8tXzWziskJI49oNy76jCZGmHhYnZLimQ3Z/qkOamJl0X1K2OzFc869QhrJsl+D8tr+S2Iol9Sf7jYjgnGxCzjIFdzez2HB8BH220qE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493896; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=th1JKpfzAzi8+0DyZvMgIumhc4CFEiTeW47qkGiYHs4=; b=AqoppB7IzSpvfKYt/zBVIPzPCfxE8NhK9KTIDJ/lPUbryfI/X+7EK+IuPomIBU+zki6OzuIBi+oRgEv295uEGDXTaS1L+Mm634/5jj/+VZ3e84nI7TXGEKUs8tqYyJVI/5DUBxB/mIR1B2EUsWD+Kf7lMiobCx/L/VqV+h5K3hs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493896979238.66449816642466; Tue, 20 Oct 2026 03:58:16 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455397.1669365 (Exim 4.92) (envelope-from ) id 1xJ7XX-0006L1-Oa; Tue, 20 Oct 2026 10:57:55 +0000 Received: by outflank-mailman (output) from mailman id 1455397.1669365; Tue, 20 Oct 2026 10:57:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7XW-0006Dj-5f; Tue, 20 Oct 2026 10:57:54 +0000 Received: by outflank-mailman (input) for mailman id 1455397; Tue, 20 Oct 2026 10:51:59 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Rn-0000PP-4T for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:51:59 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7Rm-00Cs1D-HQ for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:51:58 +0200 Received: from [10.42.69.2] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad747ce-e002-0a2a0a5209dd-0a2a4502e712-0 for ; Tue, 20 Oct 2026 12:51:58 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad747cd-6ca4-0a2a45020019-aa0a857c9a75-3 for ; Tue, 20 Oct 2026 12:51:58 +0200 Received: from mx-prod-mc-03.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-228-MDo8sez-NcyGAOl5_G0YjQ-1; Tue, 20 Oct 2026 10:51:52 +0000 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E077E1955DD1; Tue, 20 Oct 2026 10:51:47 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9E9F31800677; Tue, 20 Oct 2026 10:51:44 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=th1JKpfzAzi8+0DyZvMgIumhc4CFEiTeW47qkGiYHs4=; b=CC9N30oSmUu8aKCBiTlzH5oGWOB22lcZbrsEu/zrhlPXWSMPtPn+Fgza5e90uxzsgnRxHz KWncaeA2qEmJ9H2qn4/7hZOk7ZIdqGmu92gH+LuwBKUVDj/4925N57zH8/dQ2WYDURzDBY w/7b3TLtK8zK6lDFgTSL8lG3y66IhIQ= X-MC-Unique: MDo8sez-NcyGAOl5_G0YjQ-1 X-Mimecast-MFC-AGG-ID: MDo8sez-NcyGAOl5_G0YjQ_1792493508 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:19 +0400 Subject: [PATCH v7 62/65] hw/i386: convert PCSouthBridgeOption to QAPI enum MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-62-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=6526; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=jr+R1XEAXGqEfl6dzBqQchDTHMoMaEnbkkCJTWPjK7M=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZdHAMFgnhAvWl4qCaozSGC8ZoljjEYi6VBP 70IoZTx452JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGXQAKCRDa6OEJdZac 5bQgEACXrVy4PI0RHLf3EYbpFdgeh/G/qw9Szqqn90QJFXbDyFtQmp3c6wFtAFWSP3ffrhRIGOr RcUHeYkCVoyizAcDDgjI8OyPrmHVEnG3PwXeWRtGK0kH1my0bbmCJx/osVW8rApSvdzvYpi9s0Y 6bnxKKjw0JzliwdtFqTmFt0nn1S7YQOKfUDqhPgAWAHg8bwDPi1N1201GaF9lvKcJLYtaT4uNPx duB+KEvf23TePBMMCkwNlGjW5qm6S0gf5Ryxjb7UDLk0DAMDD6sOLYbUwrlEcS2bJu7T+7pz3Pk KIUx9WJmwNr8hA510xbEUM7U+qI4jtLtBszuvBioYQI3kVmqBqcaNtqPICXlIwOy+0b4xnL1Gkk eA26OvbARkhRxfm9CnY4bEgdMJQoeQnDOu1qzkbjiH5164V7Vey/w6iyXw5kqW/vm1Sq08RW2k9 ICd329fnCbR+neChTSaunOu2wlSsKfBfb8AHGJDPC9l+G08VUaWeDhOHfuAgrke7NLVPatk+RPO Idq2+9q621/0Y/k95lzrzNRBGYp6P2uo1GlxLYcHglKAYZo/Cej2Jt8gBe7Gw+Qz351rWqwXcvm 8YX+kB6Z2Q3knEFy4SolR3NudeuK7WGfrFsryom7DUjqSDf2dGK5/LD4kxH5aflGMGZmB0moZnG LnhWzV1mrbEwmtw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-MFC-PROC-ID: mRP8Zf2jinq8Tnm-_d0gupfXADqfnbadxFEyOdcGcts_1792493508 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-720697/1792493518-660A82AC-05C22CCB/0/0 X-purgate-type: clean X-purgate-size: 6528 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493898284158500 Move PCSouthBridgeOption from a hand-rolled C enum to a proper QAPI enum in qapi/machine.json. This gives the x-south-bridge property a generated type_info with a valid masked_name, so it appears in query-qmp-schema introspection and the qapi-type field of qom-list-properties output. The south_bridge/default_south_bridge fields change from const char * to PCSouthBridgeOption, with an explicit mapping table from enum value to QOM device type name. Enum values are changed: "PIIX3"->"ppix3", "piix4-isa"->"piix4", this is under a x-property, so shouldn't be a breaking change. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/i386/pc_piix.c | 61 ++++++++++++++++--------------------------------= ---- include/hw/i386/pc.h | 4 ++-- qapi/machine.json | 14 ++++++++++++ 3 files changed, 34 insertions(+), 45 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 63c4667ea372..5a94a34166d8 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -47,6 +47,7 @@ #include "hw/acpi/acpi.h" #include "hw/vfio/types.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-machine.h" #include "qemu/error-report.h" #include "system/xen.h" #ifdef CONFIG_XEN @@ -75,6 +76,11 @@ static GlobalProperty pc_piix_compat_defaults[] =3D { static const size_t pc_piix_compat_defaults_len =3D G_N_ELEMENTS(pc_piix_compat_defaults); =20 +static const char *pc_south_bridge_type[] =3D { + [PC_SOUTH_BRIDGE_OPTION_PIIX3] =3D TYPE_PIIX3_DEVICE, + [PC_SOUTH_BRIDGE_OPTION_PIIX4] =3D TYPE_PIIX4_PCI_DEVICE, +}; + /* * Return the global irq number corresponding to a given device irq * pin. We could also use the bus number to have a more precise mapping. @@ -236,7 +242,8 @@ static void pc_init1(MachineState *machine, const char = *pci_type) =20 gsi_state =3D pc_gsi_create(&x86ms->gsi, true); =20 - pci_dev =3D pci_new_multifunction(-1, pcms->south_bridge); + pci_dev =3D pci_new_multifunction(-1, + pc_south_bridge_type[pcms->south_bridg= e]); object_property_set_bool(OBJECT(pci_dev), "has-usb", machine_usb(machine), &error_abort); object_property_set_bool(OBJECT(pci_dev), "has-acpi", @@ -317,51 +324,18 @@ static void pc_init1(MachineState *machine, const cha= r *pci_type) } } =20 -typedef enum PCSouthBridgeOption { - PC_SOUTH_BRIDGE_OPTION_PIIX3, - PC_SOUTH_BRIDGE_OPTION_PIIX4, - PC_SOUTH_BRIDGE_OPTION_MAX, -} PCSouthBridgeOption; - -static const QEnumLookup PCSouthBridgeOption_lookup =3D { - .array =3D (const char *const[]) { - [PC_SOUTH_BRIDGE_OPTION_PIIX3] =3D TYPE_PIIX3_DEVICE, - [PC_SOUTH_BRIDGE_OPTION_PIIX4] =3D TYPE_PIIX4_PCI_DEVICE, - }, - .size =3D PC_SOUTH_BRIDGE_OPTION_MAX -}; - static int pc_get_south_bridge(Object *obj, Error **errp) { PCMachineState *pcms =3D PC_MACHINE(obj); - int i; =20 - for (i =3D 0; i < PCSouthBridgeOption_lookup.size; i++) { - if (g_strcmp0(PCSouthBridgeOption_lookup.array[i], - pcms->south_bridge) =3D=3D 0) { - return i; - } - } - - error_setg(errp, "Invalid south bridge value set"); - return 0; + return pcms->south_bridge; } =20 static void pc_set_south_bridge(Object *obj, int value, Error **errp) { PCMachineState *pcms =3D PC_MACHINE(obj); =20 - if (value < 0) { - error_setg(errp, "Value can't be negative"); - return; - } - - if (value >=3D PCSouthBridgeOption_lookup.size) { - error_setg(errp, "Value too big"); - return; - } - - pcms->south_bridge =3D PCSouthBridgeOption_lookup.array[value]; + pcms->south_bridge =3D value; } =20 #ifdef CONFIG_XEN @@ -398,7 +372,7 @@ static void pc_i440fx_machine_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); ObjectClass *oc =3D OBJECT_CLASS(m); - pcmc->default_south_bridge =3D TYPE_PIIX3_DEVICE; + pcmc->default_south_bridge =3D PC_SOUTH_BRIDGE_OPTION_PIIX3; pcmc->pci_root_uid =3D 0; pcmc->default_cpu_version =3D 1; =20 @@ -413,12 +387,13 @@ static void pc_i440fx_machine_options(MachineClass *m) machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE); machine_class_allow_dynamic_sysbus_dev(m, TYPE_UEFI_VARS_X64); =20 - object_class_property_add_enum(oc, "x-south-bridge", "PCSouthBridgeOpt= ion", - &PCSouthBridgeOption_lookup, - pc_get_south_bridge, - pc_set_south_bridge); - object_class_property_set_description(oc, "x-south-bridge", - "Use a different south bridge than PI= IX3"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "x-south-bridge", + .description =3D "Use a different south bridge than PIIX3", + .qapi_type =3D &PCSouthBridgeOption_type_info, + .get =3D pc_get_south_bridge, + .set =3D pc_set_south_bridge, + )); compat_props_add(m->compat_props, pc_piix_compat_defaults, pc_piix_compat_defaults_len); } diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 8edec62a1af2..3afd376116b1 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -47,7 +47,7 @@ typedef struct PCMachineState { uint64_t max_ram_below_4g; OnOffAuto vmport; SmbiosEntryPointType smbios_entry_point_type; - const char *south_bridge; + PCSouthBridgeOption south_bridge; =20 bool acpi_build_enabled; bool wdat_enabled; @@ -94,7 +94,7 @@ struct PCMachineClass { =20 /* Device configuration: */ bool pci_enabled; - const char *default_south_bridge; + PCSouthBridgeOption default_south_bridge; =20 /* Compat options: */ =20 diff --git a/qapi/machine.json b/qapi/machine.json index 46b6935ab0b8..cc028e890ae5 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -462,6 +462,20 @@ { 'enum': 'Pca9554PinState', 'data': ['low', 'high'] } =20 +## +# @PCSouthBridgeOption: +# +# South bridge chipset option for PC i440FX machines. +# +# @piix3: Intel PIIX3 (default) +# +# @piix4: Intel PIIX4 +# +# Since: 11.2 +## +{ 'enum': 'PCSouthBridgeOption', + 'data': ['piix3', 'piix4'] } + ## # @inject-nmi: # Injects a Non-Maskable Interrupt (machine specific: for example --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493768; cv=none; d=zohomail.com; s=zohoarc; b=mMbAxozHIxdIOMUczcDFGehnVQD/sr5KX99MzFD+OFib/BhPFJPvc5htatn86EgGzVhdXd05rhHe5w+IbWUgn+HTacemOibTZ62upJImmey7rd3Dz3Jg9j1mfvBpQKqD2+W+izna/eOvyR9h1sSCaYK6kYeYiPOMoCU7Y0B8+d8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493768; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ccOsUIeVtpZ4LAvRKvLPIKBLjfW8xoZv/G7l+9bsArM=; b=ivnbuLnFD0Ciw7Scqy60bYB6lm97IqXDntnWMAlzA1Q5WQKOQ/WCFvoli5AMkRD1NJ0pfmsZCTo/skYpQ/d4ovfr7a2WOh+mZxcFWjQj/C+70WYo2AmJt91et9rpSEFQJIz3bxu10mEPZfpzHAileqFgS9wkpaXZkqIvHyqgLVw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792493768987376.2388257601193; Tue, 20 Oct 2026 03:56:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJ7Uh-0007Cw-Ks; Tue, 20 Oct 2026 06:54:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Rw-0001Ht-O9 for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:52:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJ7Rr-0006iC-Sg for qemu-devel@nongnu.org; Tue, 20 Oct 2026 06:52:08 -0400 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-328-LUDw3GgDOriOUgUPMvJZCA-1; Tue, 20 Oct 2026 10:51:57 +0000 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 55CF01955BD4; Tue, 20 Oct 2026 10:51:53 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7054130000E7; Tue, 20 Oct 2026 10:51:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ccOsUIeVtpZ4LAvRKvLPIKBLjfW8xoZv/G7l+9bsArM=; b=K9WCtTdV7r+EwLaE5aExv1tr5fJoh2XluabdFEhxfEp9wMxhw2+AQrv4f2IVNopJDnm/9r bp7AhES0I5qEEOrdIJVTuVBNAOqM6niBB7I/mQNquYYGkGUcOdMlzSnnPykL7d4sXR3sXi +20y5Lzn3wqgIeRJbsmw9RoZQeTdkos= X-MC-Unique: LUDw3GgDOriOUgUPMvJZCA-1 X-Mimecast-MFC-AGG-ID: LUDw3GgDOriOUgUPMvJZCA_1792493513 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:20 +0400 Subject: [PATCH v7 63/65] qom: remove old enum property registration API MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261020-qom-qapi-v7-63-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=7342; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=4DUVOH2Il1uXarwapsGNw4Sqxi5JL+XRDYj5v/DxTXw=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZdSCtnqLwFsuDwikbI6gRflGPZtD05w5lEa CvQaDVyJvKJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGXQAKCRDa6OEJdZac 5VbJEACAn2E9Fh4lFMReVrd4NHuC3naIFHBUIw5ZLoxN7mbcaqivG69WFWxx7ZOrTDRmg/G7yWj fDJpczz3Mb0e0IfqafD0Zo52HRprrS3vQqsPJaRNSQkXu2fm6LC1O8aSPWSYAU1eanghk9OhXWy YrwTj+hC9ewJZHcH2F93rQKIhbccNRiQPCGgJPy4Lrq/uTwsScJ1VwIlavz58EMOc8D5pLsrqcC yq0g6DK4SrNPSK30qRc1DYPDZzDv6UP/6SYl4MOl80b/lEg9HtMa3nOcPYat73Xrz4lJ34zsyq2 DaiEjhshxRzeWlxSRKFBlCtFXeclBqDgqyY/wXjt1O7g+q+UUKYGqmFXdH3HZHF2a0DzqVUoNpl 4FKV2A5wr9Y9wmy+YIR0Lnw3Te8+UkuWx8TJu4UGPD64J7Am8Zdr+5lc4k63v3MIxbJ3V6i3/gx xcPgIxzQ2tjUAC413GKGiKMZihOU5ca3wMMcT+SurJ4f6AckLphRseXIw6lV64r07VMlIt2v/on t/KCYg7F6sIRLgxf7Q8rsFrDB/0o+lW42EJjrEKIKBVNwdsoxM+4Tc7BWJ7ciCx3ovDWcgc+b9G Z8i3KE57kVIhAV2xKZSycVzEGQWVUjJagDqkIlSLS/+8A/FeLV/wYW0PQJQEo9s4t45BXPSFjoI Q65g0nQz/0Olqvw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493769982158500 Now that all callers use object_class_property_add_qapi_enum(), remove the legacy object_property_add_enum() and object_class_property_add_enum() functions along with their EnumProperty struct and property_get_enum / property_set_enum helpers. Simplify object_property_get_enum() to assert on qapi_type rather than falling back to the old EnumProperty opaque data. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/qom/object.h | 45 ++-------------------------- qom/object.c | 82 ++----------------------------------------------= ---- 2 files changed, 4 insertions(+), 123 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 29cbd84b8d03..a9bbc44cfcc9 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1697,12 +1697,12 @@ char *object_get_canonical_path(const Object *obj); * because it was ambiguous, or %NULL. Set to %false on success. * * There are two types of supported paths--absolute paths and partial path= s. - *=20 + * * Absolute paths are derived from the root object and can follow child<> = or * link<> properties. Since they can follow link<> properties, they can be * arbitrarily long. Absolute paths look like absolute filenames and are * prefixed with a leading slash. - *=20 + * * Partial paths look like relative filenames. They do not begin with a * prefix. The matching rules for partial paths are subtle but designed t= o make * specifying objects easy. At each level of the composition tree, the pa= rtial @@ -1986,47 +1986,6 @@ ObjectProperty *object_class_property_add_bool(Objec= tClass *klass, bool (*get)(Object *, Error **), void (*set)(Object *, bool, Error **)); =20 -/** - * object_property_add_enum: - * @obj: the object to add a property to - * @name: the name of the property - * @typename: the name of the enum data type - * @lookup: enum value namelookup table - * @get: the getter or %NULL if the property is write-only. - * @set: the setter or %NULL if the property is read-only - * - * Add an enum property using getters/setters. This function will add a - * property of type '@typename'. - * - * Returns: The newly added property on success, or %NULL on failure. - */ -ObjectProperty *object_property_add_enum(Object *obj, const char *name, - const char *typename, - const QEnumLookup *lookup, - int (*get)(Object *, Error **), - void (*set)(Object *, int, Error **)); - -/** - * object_class_property_add_enum: - * @klass: the object class to add a property to - * @name: the name of the property - * @typename: the name of the enum data type - * @lookup: enum value namelookup table - * @get: the getter or %NULL if the property is write-only. - * @set: the setter or %NULL if the property is read-only - * - * Add an enum property using getters/setters. This function will add a - * property of type '@typename'. - * - * Returns: The newly added property on success, or %NULL on failure. - */ -ObjectProperty *object_class_property_add_enum(ObjectClass *klass, - const char *name, - const char *typename, - const QEnumLookup *lookup, - int (*get)(Object *, Error **), - void (*set)(Object *, int, Error **)); - /** * struct QapiEnumProp: Descriptor for a property backed by a QAPI enum ty= pe * diff --git a/qom/object.c b/qom/object.c index cf18880c6c0c..791d981dc689 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1774,12 +1774,6 @@ uint64_t object_property_get_uint(Object *obj, const= char *name, return retval; } =20 -typedef struct EnumProperty { - const QEnumLookup *lookup; - int (*get)(Object *, Error **); - void (*set)(Object *, int, Error **); -} EnumProperty; - int object_property_get_enum(Object *obj, const char *name, const char *typename, Error **errp) { @@ -1803,12 +1797,8 @@ int object_property_get_enum(Object *obj, const char= *name, return -1; } =20 - if (prop->qapi_type) { - ret =3D qapi_enum_parse(prop->qapi_type->lookup, str, -1, errp); - } else { - EnumProperty *enumprop =3D prop->opaque; - ret =3D qapi_enum_parse(enumprop->lookup, str, -1, errp); - } + assert(prop->qapi_type); + ret =3D qapi_enum_parse(prop->qapi_type->lookup, str, -1, errp); g_free(str); =20 return ret; @@ -2543,74 +2533,6 @@ object_class_property_add_bool(ObjectClass *klass, c= onst char *name, prop); } =20 -static void property_get_enum(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - EnumProperty *prop =3D opaque; - int value; - Error *err =3D NULL; - - value =3D prop->get(obj, &err); - if (err) { - error_propagate(errp, err); - return; - } - - visit_type_enum(v, name, &value, prop->lookup, errp); -} - -static void property_set_enum(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - EnumProperty *prop =3D opaque; - int value; - - if (!visit_type_enum(v, name, &value, prop->lookup, errp)) { - return; - } - prop->set(obj, value, errp); -} - -ObjectProperty * -object_property_add_enum(Object *obj, const char *name, - const char *typename, - const QEnumLookup *lookup, - int (*get)(Object *, Error **), - void (*set)(Object *, int, Error **)) -{ - EnumProperty *prop =3D g_malloc(sizeof(*prop)); - - prop->lookup =3D lookup; - prop->get =3D get; - prop->set =3D set; - - return object_property_add(obj, name, typename, - get ? property_get_enum : NULL, - set ? property_set_enum : NULL, - property_release_data, - prop); -} - -ObjectProperty * -object_class_property_add_enum(ObjectClass *klass, const char *name, - const char *typename, - const QEnumLookup *lookup, - int (*get)(Object *, Error **), - void (*set)(Object *, int, Error **)) -{ - EnumProperty *prop =3D g_malloc(sizeof(*prop)); - - prop->lookup =3D lookup; - prop->get =3D get; - prop->set =3D set; - - return object_class_property_add(klass, name, typename, - get ? property_get_enum : NULL, - set ? property_set_enum : NULL, - NULL, - prop); -} - static void get_qapi_enum(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493908; cv=none; d=zohomail.com; s=zohoarc; b=iNaNvIHnVs1whpjdFMY7eivDh0ELGoXpOBZweFGOeX1N5WB8VyjtADNCDs4AHVoDqH5++uRdFlYej3WE/aH+3lxXdWBH/dWAkIp0iW7TMjtIT/f+mJZBQ/nqvYBtfStPN+wJBUb6kqlWKkSQYXheW36nXo8Ny2H7T7W71s5w3Dc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493908; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=edIbxy8j0ZeLmK0JPM910tAFzYTrVmN4a79XoyzsTPs=; b=lEQai+QCan4AxAjqHeCP6Ts7ZqDeMmieMtCplT3iwwKSHbudp3tdTTAGFhpPosURxCdYwWfb+5ybeGV07iFiaANvOCfiIS+PUpYbKkep5roEYuC1BjfBhlQQYfyLzO8FZLeL5Noaa9TeFdLMV5sgkwCXHHg60w+51I2fgeF/pQc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493908778707.8839447739155; Tue, 20 Oct 2026 03:58:28 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455402.1669382 (Exim 4.92) (envelope-from ) id 1xJ7Xb-00070O-UP; Tue, 20 Oct 2026 10:57:59 +0000 Received: by outflank-mailman (output) from mailman id 1455402.1669382; Tue, 20 Oct 2026 10:57:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7XZ-0006qd-JO; Tue, 20 Oct 2026 10:57:57 +0000 Received: by outflank-mailman (input) for mailman id 1455402; Tue, 20 Oct 2026 10:52:08 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Rw-0000Qr-PE for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:52:08 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7Rw-00CvpI-5z for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:52:08 +0200 Received: from [10.42.69.12] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad747d8-8faa-0a2a0a5109dd-0a2a450cb766-0 for ; Tue, 20 Oct 2026 12:52:08 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad747d6-f479-0a2a450c0019-aa0a817caceb-3 for ; Tue, 20 Oct 2026 12:52:07 +0200 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-607-UkF2cxSIP0KFpD-x2kfPug-1; Tue, 20 Oct 2026 10:52:03 +0000 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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 171B41955DE8; Tue, 20 Oct 2026 10:51:59 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D26A65BC; Tue, 20 Oct 2026 10:51:55 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=edIbxy8j0ZeLmK0JPM910tAFzYTrVmN4a79XoyzsTPs=; b=XWLOffIqp0dzfMN7npTE8ln70l0mHDaJQ4YaNJRInktXlCaBxNhmbyBVPhyAV6otDDtdZy SGBHj4GLBUSArH6Iom+X3eSUe1sm1Jj0316wi3U4uAgDVTXTIztlHtKwQV/ossAe8gzT6w DXMxUDvxjwkY5B0h7ZOJsOZASue9/7c= X-MC-Unique: UkF2cxSIP0KFpD-x2kfPug-1 X-Mimecast-MFC-AGG-ID: UkF2cxSIP0KFpD-x2kfPug_1792493519 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:21 +0400 Subject: [PATCH v7 64/65] qom: use QAPITypeInfo in object_property_get_enum MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-64-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=4777; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=btPOLigegMrUtE/H8gDPhCCZC+0Be3DpIj2amZiGpeM=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZdBPk60N5wT01axiLdb48ZwuPjCejnM2ZCc 8PglQD+RAWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGXQAKCRDa6OEJdZac 5SPyEAC5HRZ0r0eZqxI5kzCsHrclz4H0Z1qTSRRBggURJDWP1KPYcglKwzX4001DDcIq+3FTVpq uqL6jJTS5vpJyJyR897eCp/+/txzLU8tlhsslIoDbOhlREexjvA38cJU7R22vQlvcx+DpICRHE3 a5XvP5h0s1/Pyiwdap+iMevEvuEEcbH/jRuSHep2d8iVv7Koi8q0iUC8zZ9PuwSKBiXi/oILGfy aiMrs8f/RgP9W/MoV3ZQRoFzC+PDRjFuTVfcaA60kq0BkbXlZZqC8u7Z+II9Xx+mxD8jpqF0dvl YdxYl9iXw3cbjdx662K6DNPPTjQqlqch+lUyD9IDKGSOxwMVRZODMwFtKF8oOvp/VlJSjSI2dYp n/X+gSwpl4DPtL64HznEe7j1fcGEq0YFRHnDbDHbwuxtIa57jCuK6wDAdaarfxUiuLtPfX7zXKA 1mhzw7Xk53JCYfVRtyhDDwz68cwocztkSeDoHbr+rWIMtJWAgR3K0ZgRcwpuhUoaQpp7LtkUpd6 SttTn4wc4MNuYc4Awpzamcf3DaIFaC+EQhFDU5i9gl+OPJb5rstVcuwsDzcleSXgUaDrqgSpCQo Bgm5lkNrnrlf7BG0h6WM3CgbBEadCmph3q1159HTgqfLA36QI7zt946mDEQrtiXWNDke3TZA+Wo l6wkFmd77J6ABag== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-MFC-PROC-ID: 1QqciViunR43AoID7g27I24Nvg6AtEsZPSRbmjCdOo0_1792493519 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-d25034/1792493527-01EC2A5B-1FD9F548/0/0 X-purgate-type: clean X-purgate-size: 4779 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493910510158500 The typename parameter becomes a QAPITypeInfo pointer, and the validation compares prop->qapi_type against it instead of matching prop->type strings. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/machine-qmp-cmds.c | 4 +++- include/qom/object.h | 4 ++-- qom/object.c | 8 ++++---- tests/unit/check-qom-proplist.c | 6 +++--- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 3fee45d568da..6b425baeb2da 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -18,6 +18,7 @@ #include "qapi/qapi-commands-accelerator.h" #include "qapi/qapi-commands-machine.h" #include "qobject/qobject.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qobject-input-visitor.h" #include "qapi/type-helpers.h" #include "qemu/uuid.h" @@ -252,7 +253,8 @@ static int query_memdev(Object *obj, void *opaque) } else { m->has_reserve =3D true; } - m->policy =3D object_property_get_enum(obj, "policy", "HostMemPoli= cy", + m->policy =3D object_property_get_enum(obj, "policy", + &HostMemPolicy_type_info, &error_abort); host_nodes =3D object_property_get_qobject(obj, "host-nodes", diff --git a/include/qom/object.h b/include/qom/object.h index a9bbc44cfcc9..9f937e30dae5 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1566,7 +1566,7 @@ uint64_t object_property_get_uint(Object *obj, const = char *name, * object_property_get_enum: * @obj: the object * @name: the name of the property - * @typename: the name of the enum data type + * @type_info: the QAPITypeInfo of the enum * @errp: returns an error if this function fails * * Returns: the value of the property, converted to an integer (which @@ -1574,7 +1574,7 @@ uint64_t object_property_get_uint(Object *obj, const = char *name, * value is not an enum). */ int object_property_get_enum(Object *obj, const char *name, - const char *typename, Error **errp); + const QAPITypeInfo *type_info, Error **errp); =20 /** * object_property_set: diff --git a/qom/object.c b/qom/object.c index 791d981dc689..40b569d4d574 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1775,7 +1775,7 @@ uint64_t object_property_get_uint(Object *obj, const = char *name, } =20 int object_property_get_enum(Object *obj, const char *name, - const char *typename, Error **errp) + const QAPITypeInfo *type_info, Error **errp) { char *str; int ret; @@ -1785,10 +1785,10 @@ int object_property_get_enum(Object *obj, const cha= r *name, return -1; } =20 - if (!g_str_equal(prop->type, typename)) { + if (prop->qapi_type !=3D type_info) { error_setg(errp, "Property %s on %s is not '%s' enum type", - name, object_class_get_name( - object_get_class(obj)), typename); + name, object_class_get_name(object_get_class(obj)), + type_info->name); return -1; } =20 diff --git a/tests/unit/check-qom-proplist.c b/tests/unit/check-qom-proplis= t.c index 69155e720751..1cb48c7490ef 100644 --- a/tests/unit/check-qom-proplist.c +++ b/tests/unit/check-qom-proplist.c @@ -582,14 +582,14 @@ static void test_dummy_getenum(void) =20 val =3D object_property_get_enum(OBJECT(dobj), "av", - "DummyAnimal", + &dummy_animal_qapi_type_info, &error_abort); g_assert(val =3D=3D DUMMY_PLATYPUS); =20 /* A bad enum type name */ val =3D object_property_get_enum(OBJECT(dobj), "av", - "BadAnimal", + &dummy_str_qapi_type_info, &err); g_assert(val =3D=3D -1); error_free_or_abort(&err); @@ -597,7 +597,7 @@ static void test_dummy_getenum(void) /* A non-enum property name */ val =3D object_property_get_enum(OBJECT(dobj), "iv", - "DummyAnimal", + &dummy_animal_qapi_type_info, &err); g_assert(val =3D=3D -1); error_free_or_abort(&err); --=20 2.56.0.116.g6de20f6092dc From nobody Mon Nov 23 22:39:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792493898; cv=none; d=zohomail.com; s=zohoarc; b=Zu19TmG42Kn0hbflY2yeAnZ83tolpHcCdiztNLEI3dhhI2s9d5E+6HFwFqcJa8t1CyBKCPEneIoltDwaaisNcK2P3/janIzVR0xIW5bQFGwwDFkl6FbVQ19CjAkxayhSK7JabJiuf0F+InS6wPSc5vT4dpZT3mRkG0dJ1dkce/c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792493898; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Cht00yUtxWZgYYGvkiDrdQx2K2tPqKneM6BMi8EBSe8=; b=nm68Jw/Nod2DPKXcBLdjGzEG8gM9td6xE2H0B0O9yRvaSSg6rEv9m9eKlCBCR6lQLELDUKWvhlP08X9E91yEWAH9bL8iluqGHxdYzYc9JkZkYcJUh/7isvPELsN3r5pTJV3Qn+FZWxcFjoJKadTRKEuxw+IrikX3sbs84ADeNKw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792493898281156.3995984239474; Tue, 20 Oct 2026 03:58:18 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1455404.1669390 (Exim 4.92) (envelope-from ) id 1xJ7Xd-0007Nt-BV; Tue, 20 Oct 2026 10:58:01 +0000 Received: by outflank-mailman (output) from mailman id 1455404.1669390; Tue, 20 Oct 2026 10:58:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7Xb-0007D8-BS; Tue, 20 Oct 2026 10:57:59 +0000 Received: by outflank-mailman (input) for mailman id 1455404; Tue, 20 Oct 2026 10:52:14 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xJ7S1-0000RO-VR for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 10:52:14 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xJ7S1-00Cs6O-Bb for xen-devel@lists.xenproject.org; Tue, 20 Oct 2026 12:52:13 +0200 Received: from [10.42.69.6] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad747dd-e002-0a2a0a5209dd-0a2a45068648-0 for ; Tue, 20 Oct 2026 12:52:13 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad747dc-195a-0a2a45060019-aa0a857cab35-3 for ; Tue, 20 Oct 2026 12:52:13 +0200 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-460-7pgMjRlDPJm6ek2MrAPphA-1; Tue, 20 Oct 2026 10:52:08 +0000 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 0A12B1954ACE; Tue, 20 Oct 2026 10:52:04 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 81B4630000E7; Tue, 20 Oct 2026 10:52:01 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792493532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cht00yUtxWZgYYGvkiDrdQx2K2tPqKneM6BMi8EBSe8=; b=JaiHpW5pNptVTLB7kq5Loz5RYWsz0iErLrcBMQyuIH2NKRp/XtwXC0Fo8kcAcKMTa/GByy PXiWvaEOgXNT6N/xpromKLPXwbMAYgPHHoMCaJ9WvKZifDD4qmpMYHnULwOqwM7crvzIpE FkkBzsY6OxL878kJyet2CGiWhQwacI0= X-MC-Unique: 7pgMjRlDPJm6ek2MrAPphA-1 X-Mimecast-MFC-AGG-ID: 7pgMjRlDPJm6ek2MrAPphA_1792493524 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 20 Oct 2026 14:46:22 +0400 Subject: [PATCH v7 65/65] tests/qmp-cmd-test: assert qapi-type resolves in query-qmp-schema MIME-Version: 1.0 Message-Id: <20261020-qom-qapi-v7-65-431a86b02b58@redhat.com> References: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> In-Reply-To: <20261020-qom-qapi-v7-0-431a86b02b58@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kostiantyn Kostiuk , Eric Blake , David Hildenbrand , Igor Mammedov , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org, Alberto Garcia , Kevin Wolf , Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Jonathan Cameron , Junjie Cao , Anisa Su , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Sergio Lopez , qemu-arm@nongnu.org, Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org, Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , Pedro Barbuda , Mohamed Mediouni , Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , qemu-ppc@nongnu.org, Zhang Chen , Li Zhijian , Alistair Francis , Alexander Graf , "Gonglei (Arei)" , zhenwei pi , Ani Sinha , Luc Michel , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Kane Chen , Samuel Tardieu , "Denis V. Lunev" , FangSheng Huang , Tyrone Ting , Hao Wu , Keith Busch , Klaus Jensen , Jesper Devantier , Aditya Gupta , Glenn Miles , Conor Dooley , Sebastian Huber , Halil Pasic , Christian Borntraeger , Jason Herne , Titus Rwantare , Stefano Stabellini , Anthony PERARD , Peter Xu , Chinmay Rath , Hendrik Brueckner , xen-devel@lists.xenproject.org, Roman Bolshakov , Phil Dennis-Jordan , Fam Zheng , Farhan Ali , Alex Williamson , Tao Tang , Stefan Berger , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko , Yoshinori Sato , Jiri Pirko , Eric Auger , Laurent Vivier , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=3522; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=d0AC/pqR2xkFHzouOcdpk0rfewmoRKNngAyjCDgTMl8=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq10ZdBKSnHJPBpmcmbmASu7qOtoUGXTowk7yNX g+tgxS9nNCJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCatdGXQAKCRDa6OEJdZac 5YaTD/9vG9jkAEkIZLFzUN64FilSwr9riDSC6dE2d/cUhX4cjMjxDVeEJE3fOoiBKvDHuHP6Fam eLESfFQfsqJcKbQZcC7fZwpUyYgAah0Te7HBf1dTcZEFTRvKN74njWw41ZqG0c7tTwK2RvnjIsK 8fHHImBlQjy3IQpEa+tkvQUC4iH8rw0sZLyrCG2YcdoTu7W+WXDLexUk2cOs0ruBPuwoKzJNY0h kfSjtPXCqWAYW/CLE/XAxTIg0npoHuOEJsdHN2vFua1QGpata7fM9WvmMdkxxN/mTWXE368BfaR SefydRBG8ysGItK2Wa42Jka1iFQCJauQfgYfzHLKFuwYgNDhmVGREedy/FHX4FKrmlFt+/DTCBT WQqkUunveY9WHZTah8Oyc6HQu217yOg1Pu1mzdUOKA7L5efOGeeF2VXLU4xx8F0cI3x9n1w2m9S ZjD8AIg2GEOQSHZTOHmvLShHGgZeqbIHmzkuVPwP9Uu0Xvd4oFkSUdsv018jZzRlsuC1WZ19WVs HwVfX09lvPTKCeCW/MnPJHOy4Jz9YIZOrueZvIMglgwQcZOoG8zo20m3HJUDkc4M1fhIN0xN5GX +pxjl6niKchvnstVDhaDerpY/9nebfmNnSTV8sMRAPUBnvklXn1847TNA0iuqTN+Qp24h+XOk0a iSGRIgq7QkVJWcA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-MFC-PROC-ID: QGr1tgqQxZy1zMlcyfZ_8mAsnv1CZVgTP_7M39yeS5A_1792493524 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-16d1c6/1792493533-FE27077B-F57D7AFD/0/0 X-purgate-type: clean X-purgate-size: 3524 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1792493900297158500 For every QOM type returned by qom-list-types, call qom-list-properties and verify that each property's qapi-type value (when present) maps to a valid entry in the query-qmp-schema introspection output. The test is gated behind g_test_slow() since it iterates all registered QOM types. Signed-off-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau --- tests/qtest/qmp-cmd-test.c | 55 ++++++++++++++++++++++++++++++++++++++++++= +++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/tests/qtest/qmp-cmd-test.c b/tests/qtest/qmp-cmd-test.c index 279a8f5614e9..acb7b0dd6a9f 100644 --- a/tests/qtest/qmp-cmd-test.c +++ b/tests/qtest/qmp-cmd-test.c @@ -15,6 +15,7 @@ #include "qapi/error.h" #include "qapi/qapi-visit-introspect.h" #include "qobject/qdict.h" +#include "qobject/qlist.h" #include "qapi/qobject-input-visitor.h" =20 const char common_args[] =3D "-nodefaults -machine none"; @@ -131,6 +132,8 @@ typedef struct { GHashTable *hash; } QmpSchema; =20 +static QmpSchema schema; + static void qmp_schema_init(QmpSchema *schema) { QDict *resp; @@ -343,9 +346,56 @@ static void test_object_add_failure_modes(void) qtest_quit(qts); } =20 +static void test_qapi_type(void) +{ + QTestState *qts; + g_autoptr(QDict) resp =3D NULL; + QList *types; + QListEntry *type_entry, *prop_entry; + + qts =3D qtest_init(common_args); + + resp =3D qtest_qmp(qts, + "{ 'execute': 'qom-list-types'," + " 'arguments': { 'abstract': true } }"); + g_assert(qdict_haskey(resp, "return")); + types =3D qdict_get_qlist(resp, "return"); + + QLIST_FOREACH_ENTRY(types, type_entry) { + QDict *type =3D qobject_to(QDict, qlist_entry_obj(type_entry)); + const char *name =3D qdict_get_str(type, "name"); + g_autoptr(QDict) props_resp =3D NULL; + QList *props; + + props_resp =3D qtest_qmp(qts, + "{ 'execute': 'qom-list-properties'," + " 'arguments': { 'typename': %s } }", + name); + if (!qdict_haskey(props_resp, "return")) { + continue; + } + props =3D qdict_get_qlist(props_resp, "return"); + + QLIST_FOREACH_ENTRY(props, prop_entry) { + QDict *prop =3D qobject_to(QDict, qlist_entry_obj(prop_entry)); + const char *qapi_type =3D qdict_get_try_str(prop, "qapi-type"); + const char *propname =3D qdict_get_str(prop, "name"); + const char *ty =3D qdict_get_str(prop, "type"); + + if (qapi_type) { + g_assert_nonnull(qmp_schema_lookup(&schema, qapi_type)); + } else if (!g_str_has_prefix(ty, "child<") && + !g_str_has_prefix(ty, "link<")) { + g_test_message("%s.%s %s has no associated qapi-type", + name, propname, ty); + } + } + } + qtest_quit(qts); +} + int main(int argc, char *argv[]) { - QmpSchema schema; int ret; =20 g_test_init(&argc, &argv, NULL); @@ -355,6 +405,9 @@ int main(int argc, char *argv[]) =20 qtest_add_func("qmp/object-add-failure-modes", test_object_add_failure_modes); + if (g_test_slow()) { + qtest_add_func("qmp/qapi-type", test_qapi_type); + } =20 ret =3D g_test_run(); =20 --=20 2.56.0.116.g6de20f6092dc