From nobody Mon Nov 23 04:26:22 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=1793564341; cv=none; d=zohomail.com; s=zohoarc; b=ZGqhIHvRM5MIlm80dN/JwHbusnD8roQNXkXEg13a/WhRkNb0pENU/aiwJO7ix/UWq9aFjsspBaVo3mEXRwuezzvDljuOBrz5+QE8DZjOAcftNnLmZfMOJ0PSk4vdQClIMXOnnCrYCbE5evwg2CfAa1Es92DFDqshr2qVkTibYg4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564341; 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=CSxgsTUnQouCiI9l4m+bAXq4jKGAtFjLqin4bnvrP94=; b=afAUENbQmMMpcfl1aDNdJsl1f3AGH3rHGC6VsYGwwmFm/nFhQ1mxJkqAgy4s8CNZPVb30P7I6MIwUkTU2F7UP6sNdFi0oNZZTgACTulOitwb+T8O/JWoto5cs++z7eI+mt0NiUd7eP0pNicrRoEdhlEabElJOoya0478zd+zH8U= 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 1793564341116193.74004445288813; Sun, 1 Nov 2026 12:19:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNbzi-0004rq-E8; Sun, 01 Nov 2026 15:17:34 -0500 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 1xNbzb-0004pr-SB for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:28 -0500 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 1xNbza-00079Q-0h for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:27 -0500 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-380-2yafYqvaMvKN8VVTv4PLZw-1; Sun, 01 Nov 2026 15:17:21 -0500 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 3808519560B7 for ; Sun, 1 Nov 2026 20:17:20 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EAE24195608B for ; Sun, 1 Nov 2026 20:17:19 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9508A21E692D; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564245; 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=CSxgsTUnQouCiI9l4m+bAXq4jKGAtFjLqin4bnvrP94=; b=GzE3kMzG1B4BuJTNaKalS/1m5U5mVBeaVAUvj8WRPC7xuwFDXKrsYpgJnc5xEksoQTxAUW JQbgKuvhm+9OZmertA0Voawu/utL9ypjxwLwKrIHspFmBmaWG5fG72PAiD7TFMgzsxMe2R gwuJDTg+lgrX4nQAsI5Vx9Pytxl62tg= X-MC-Unique: 2yafYqvaMvKN8VVTv4PLZw-1 X-Mimecast-MFC-AGG-ID: 2yafYqvaMvKN8VVTv4PLZw_1793564240 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 01/56] qapi/schema: Rename .lookup_entity() and tighten return type Date: Sun, 1 Nov 2026 21:16:22 +0100 Message-ID: <20261101201717.3911097-2-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564342890158500 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 54a32e45f7..31d09ed634 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 8d88b40de2..9c9e257a8f 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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564617; cv=none; d=zohomail.com; s=zohoarc; b=dJP6GeFXmIKKwLFSAhDtfEMsv8SH+z2qVHXtAyEcWf8Ogl9CzwdpiYqA/qODiYoOg96EPP0jeyjGNVgVoudttRG/avf/nzCHLq0kCkVDQfpKxG6eufO00LQ4qoKJfrbtuFjeCbCV9vGIaqFV7nEFtqXRoL5hwnFnC302EJoEDi8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564617; 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=hNvUzxggpMQ7ipuMkRm8Hr7UKvCuX0VtYhHPE2+rV+s=; b=ErAwbt00KRyL6CzlGk9BvrS2cmHj6B3qJdF3nRNpo/EGMUbRnh/QlI3Xv3OmztudS1AidnCOpkiDVjN2OyoTXkoshkt3a8QAFwU7qgzTCDHUrcTfNxWS8xbx+ndVSzefTbhfJQMxmcTSu0mqsZGb/v+v2h+QdJ1LVD9uwZtGr9Q= 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 1793564617854459.82003008201923; Sun, 1 Nov 2026 12:23:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNbzt-00054H-3n; Sun, 01 Nov 2026 15:17:45 -0500 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 1xNbzg-0004rU-AH for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:33 -0500 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 1xNbza-00079u-Jn for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:32 -0500 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-149-bhfEjxxNOyGnb7-dE-pZpA-1; Sun, 01 Nov 2026 15:17:21 -0500 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 82A8F18005A1 for ; Sun, 1 Nov 2026 20:17:20 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 02E22195608C for ; Sun, 1 Nov 2026 20:17:20 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 99B4721E6880; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564245; 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=hNvUzxggpMQ7ipuMkRm8Hr7UKvCuX0VtYhHPE2+rV+s=; b=CStG9tYwTQ5PjgJVRWTfZKMMqCAjUHbDu5lfRjx05CPn/VF+D2+9zoqqBQ9BjtZrjHSV4a 8a+oQ0PWLud28IhM6WHHxIHzEIANhXkm1t69IIgJxXDUgSSZe131QvYT+ss9SauCXSlu04 n82opd6fT+k/kRYn72c7/DqZMmmfuB0= X-MC-Unique: bhfEjxxNOyGnb7-dE-pZpA-1 X-Mimecast-MFC-AGG-ID: bhfEjxxNOyGnb7-dE-pZpA_1793564240 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 02/56] qapi: Ease access to introspection names Date: Sun, 1 Nov 2026 21:16:23 +0100 Message-ID: <20261101201717.3911097-3-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564618514158500 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 --- docs/devel/qapi-code-gen.rst | 24 ++++++++++---------- scripts/qapi/introspect.py | 23 ++++--------------- scripts/qapi/schema.py | 43 ++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 31 deletions(-) diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst index b1cc5b5f0d..9bd5a3af28 100644 --- a/docs/devel/qapi-code-gen.rst +++ b/docs/devel/qapi-code-gen.rst @@ -2012,33 +2012,33 @@ Example:: =20 const QLitObject example_qmp_schema_qlit =3D QLIT_QLIST(((QLitObject[]= ) { QLIT_QDICT(((QLitDictEntry[]) { - { "arg-type", QLIT_QSTR("0"), }, + { "arg-type", QLIT_QSTR("34"), }, { "meta-type", QLIT_QSTR("command"), }, { "name", QLIT_QSTR("my-command"), }, - { "ret-type", QLIT_QSTR("1"), }, + { "ret-type", QLIT_QSTR("32"), }, {} })), QLIT_QDICT(((QLitDictEntry[]) { - { "arg-type", QLIT_QSTR("2"), }, + { "arg-type", QLIT_QSTR("30"), }, { "meta-type", QLIT_QSTR("event"), }, { "name", QLIT_QSTR("MY_EVENT"), }, {} })), - /* "0" =3D q_obj_my-command-arg */ + /* "34" =3D q_obj_my-command-arg */ QLIT_QDICT(((QLitDictEntry[]) { { "members", QLIT_QLIST(((QLitObject[]) { QLIT_QDICT(((QLitDictEntry[]) { { "name", QLIT_QSTR("arg1"), }, - { "type", QLIT_QSTR("[1]"), }, + { "type", QLIT_QSTR("[32]"), }, {} })), {} })), }, { "meta-type", QLIT_QSTR("object"), }, - { "name", QLIT_QSTR("0"), }, + { "name", QLIT_QSTR("34"), }, {} })), - /* "1" =3D UserDefOne */ + /* "32" =3D UserDefOne */ QLIT_QDICT(((QLitDictEntry[]) { { "members", QLIT_QLIST(((QLitObject[]) { QLIT_QDICT(((QLitDictEntry[]) { @@ -2061,22 +2061,22 @@ Example:: {} })), }, { "meta-type", QLIT_QSTR("object"), }, - { "name", QLIT_QSTR("1"), }, + { "name", QLIT_QSTR("32"), }, {} })), - /* "2" =3D q_empty */ + /* "30" =3D q_empty */ QLIT_QDICT(((QLitDictEntry[]) { { "members", QLIT_QLIST(((QLitObject[]) { {} })), }, { "meta-type", QLIT_QSTR("object"), }, - { "name", QLIT_QSTR("2"), }, + { "name", QLIT_QSTR("30"), }, {} })), QLIT_QDICT(((QLitDictEntry[]) { - { "element-type", QLIT_QSTR("1"), }, + { "element-type", QLIT_QSTR("32"), }, { "meta-type", QLIT_QSTR("array"), }, - { "name", QLIT_QSTR("[1]"), }, + { "name", QLIT_QSTR("[32]"), }, {} })), QLIT_QDICT(((QLitDictEntry[]) { diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 7e28de2279..644461560c 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 9c9e257a8f..11f3accec8 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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564259; cv=none; d=zohomail.com; s=zohoarc; b=k59s6CFyjIJfg7xwhoto80D521D2IQLx++ndoTlwYCcHK5P3JggGi2IIx/o1W+WX+GkeU1KnRpRqwzSmZvx3ORAAT8FKMIwMuWEGlqOtYQSugvNIOv1xPeQz7hm3On+3U72DOn6tVa4a3jfPohJNLecIWJABLoY/1ibCYDF/ltw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564259; 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=Vx23Yp8oncTViPbxf1fUSUUsIWLw2zMupHM3JckgRZc=; b=H/60mr+V00UnnzCwq7qSrCgmK3A8CnL3Qt6hlZF2APwp5zdGPnfv5EhKIb/soh+IZKlt9HaIwFT7q1iBB9r3vq4/gRIK1B2335rZw+wCffAQOHCCg2GXbpdZ3junSFGrtG0PrC6QJymTKYvvhpEzGiXUDySlXuy6PKqpnP9apBk= 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 1793564259427821.9558058322057; Sun, 1 Nov 2026 12:17:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNbzj-0004tz-Lt; Sun, 01 Nov 2026 15:17:35 -0500 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 1xNbza-0004ph-90 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:27 -0500 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 1xNbzY-000793-Fx for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:25 -0500 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-625-Ip1e5_EDPB2duAZDuKCdKw-1; Sun, 01 Nov 2026 15:17:21 -0500 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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A3A2D19560B1 for ; Sun, 1 Nov 2026 20:17:20 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 60FE61800444 for ; Sun, 1 Nov 2026 20:17:20 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9DE3921E6882; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564242; 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=Vx23Yp8oncTViPbxf1fUSUUsIWLw2zMupHM3JckgRZc=; b=JpO03CT4UF64CB90LHDQDqpeq8RJvl52d/1UtcUdFobfRYCygg/6oEabhMsM0B2gzt6jIV J710Uz6SbQC+i4MtKQN0NoklEZ4kbyOnQNb7WeVN/kSFsiSYnPmywIqRtwPH2BZi8VYLNY ZJg7flV1xkvCYSlRWKuU6AnOGuuyFXg= X-MC-Unique: Ip1e5_EDPB2duAZDuKCdKw-1 X-Mimecast-MFC-AGG-ID: Ip1e5_EDPB2duAZDuKCdKw_1793564240 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 03/56] qapi/introspect: Simplify masked name comment emission slighly Date: Sun, 1 Nov 2026 21:16:24 +0100 Message-ID: <20261101201717.3911097-4-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564261313158500 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 --- docs/devel/qapi-code-gen.rst | 1 + scripts/qapi/introspect.py | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst index 9bd5a3af28..1e89cbbcd7 100644 --- a/docs/devel/qapi-code-gen.rst +++ b/docs/devel/qapi-code-gen.rst @@ -2073,6 +2073,7 @@ Example:: { "name", QLIT_QSTR("30"), }, {} })), + /* "[32]" =3D UserDefOneList */ QLIT_QDICT(((QLitDictEntry[]) { { "element-type", QLIT_QSTR("32"), }, { "meta-type", QLIT_QSTR("array"), }, diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 644461560c..49d1ed2897 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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564437; cv=none; d=zohomail.com; s=zohoarc; b=jT7OfXVooOMYKsj/vDjL8OAQcrcT3ASOiwlweR3Lrs4ztKhXn6C2dbBIGR3p2OGmKVUIPNrNv9jzV2J4MkyUEFfEiZPn0L7TRhS7ywjzZWtKnPWgoe+Elmj52qRapKSDpTMoV4C5oC5fjMJuV4sbJG7FbIcN5//Pxu/AUSnfy6c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564437; 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=u1K5IcS+3PR2hyQ0yfWatXgw4VCxJabxIQzP9yNshdU=; b=bWXN28Ywdk9bDXPnIHbiI+Vss8qQSNTqjq4HHhhSjqMrcTq+IiGeWs1aXYWWYTb3sxsti11qKXo27KUvl5EG4KNh/2RCHMl6iRvAR3dWaK90sWDz1NoQ4IsSQeiMfwrvV/c/CfMtZSQ3Exuw+E1ucQtIVexHbRt7tPpuR8pPDIg= 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 1793564437644745.3222788531542; Sun, 1 Nov 2026 12:20:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNbzq-00051W-GQ; Sun, 01 Nov 2026 15:17:42 -0500 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 1xNbza-0004pl-LX for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:27 -0500 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 1xNbzY-000792-DD for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:26 -0500 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-625-p_Ep-jfiNWGY5wLm2SVFXw-1; Sun, 01 Nov 2026 15:17:21 -0500 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 A04491955F45 for ; Sun, 1 Nov 2026 20:17:20 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 168321956086 for ; Sun, 1 Nov 2026 20:17:20 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id A20F821E6883; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564242; 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=u1K5IcS+3PR2hyQ0yfWatXgw4VCxJabxIQzP9yNshdU=; b=iJ1dzthLXwyMLSIACTs2j5uSPsF8lpOyvzg4LCwT5aBBhNheCygJFlqajxnJ/EzwKO2ac4 aM9Xt6ZunfpP9PtR0PL/k0dAhbyXNezA7Rs2ATcHnSzOaiJUr7BEgGw7uz4cBQ5T1NvMUr 4W6LchqPa1llPlLFZSTKJJP9ZzowKXk= X-MC-Unique: p_Ep-jfiNWGY5wLm2SVFXw-1 X-Mimecast-MFC-AGG-ID: p_Ep-jfiNWGY5wLm2SVFXw_1793564240 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 04/56] qapi/introspect: Don't elide types Date: Sun, 1 Nov 2026 21:16:25 +0100 Message-ID: <20261101201717.3911097-5-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564438922158500 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 | 67 ++++++++++++++---------------------- scripts/qapi/introspect.py | 31 +++-------------- 2 files changed, 30 insertions(+), 68 deletions(-) diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst index 1e89cbbcd7..3c21dda91b 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 @@ -2012,32 +2010,19 @@ Example:: =20 const QLitObject example_qmp_schema_qlit =3D QLIT_QLIST(((QLitObject[]= ) { QLIT_QDICT(((QLitDictEntry[]) { - { "arg-type", QLIT_QSTR("34"), }, - { "meta-type", QLIT_QSTR("command"), }, - { "name", QLIT_QSTR("my-command"), }, - { "ret-type", QLIT_QSTR("32"), }, + { "json-type", QLIT_QSTR("string"), }, + { "meta-type", QLIT_QSTR("builtin"), }, + { "name", QLIT_QSTR("str"), }, {} })), + /* "[str]" =3D strList */ QLIT_QDICT(((QLitDictEntry[]) { - { "arg-type", QLIT_QSTR("30"), }, - { "meta-type", QLIT_QSTR("event"), }, - { "name", QLIT_QSTR("MY_EVENT"), }, - {} - })), - /* "34" =3D q_obj_my-command-arg */ - QLIT_QDICT(((QLitDictEntry[]) { - { "members", QLIT_QLIST(((QLitObject[]) { - QLIT_QDICT(((QLitDictEntry[]) { - { "name", QLIT_QSTR("arg1"), }, - { "type", QLIT_QSTR("[32]"), }, - {} - })), - {} - })), }, - { "meta-type", QLIT_QSTR("object"), }, - { "name", QLIT_QSTR("34"), }, + { "element-type", QLIT_QSTR("str"), }, + { "meta-type", QLIT_QSTR("array"), }, + { "name", QLIT_QSTR("[str]"), }, {} })), + [Remainder of built-in types omitted...] /* "32" =3D UserDefOne */ QLIT_QDICT(((QLitDictEntry[]) { { "members", QLIT_QLIST(((QLitObject[]) { @@ -2064,15 +2049,6 @@ Example:: { "name", QLIT_QSTR("32"), }, {} })), - /* "30" =3D q_empty */ - QLIT_QDICT(((QLitDictEntry[]) { - { "members", QLIT_QLIST(((QLitObject[]) { - {} - })), }, - { "meta-type", QLIT_QSTR("object"), }, - { "name", QLIT_QSTR("30"), }, - {} - })), /* "[32]" =3D UserDefOneList */ QLIT_QDICT(((QLitDictEntry[]) { { "element-type", QLIT_QSTR("32"), }, @@ -2080,22 +2056,31 @@ Example:: { "name", QLIT_QSTR("[32]"), }, {} })), + /* "34" =3D q_obj_my-command-arg */ QLIT_QDICT(((QLitDictEntry[]) { - { "json-type", QLIT_QSTR("int"), }, - { "meta-type", QLIT_QSTR("builtin"), }, - { "name", QLIT_QSTR("int"), }, + { "members", QLIT_QLIST(((QLitObject[]) { + QLIT_QDICT(((QLitDictEntry[]) { + { "name", QLIT_QSTR("arg1"), }, + { "type", QLIT_QSTR("[32]"), }, + {} + })), + {} + })), }, + { "meta-type", QLIT_QSTR("object"), }, + { "name", QLIT_QSTR("34"), }, {} })), QLIT_QDICT(((QLitDictEntry[]) { - { "json-type", QLIT_QSTR("string"), }, - { "meta-type", QLIT_QSTR("builtin"), }, - { "name", QLIT_QSTR("str"), }, + { "arg-type", QLIT_QSTR("34"), }, + { "meta-type", QLIT_QSTR("command"), }, + { "name", QLIT_QSTR("my-command"), }, + { "ret-type", QLIT_QSTR("32"), }, {} })), QLIT_QDICT(((QLitDictEntry[]) { - { "json-type", QLIT_QSTR("boolean"), }, - { "meta-type", QLIT_QSTR("builtin"), }, - { "name", QLIT_QSTR("bool"), }, + { "arg-type", QLIT_QSTR("30"), }, + { "meta-type", QLIT_QSTR("event"), }, + { "name", QLIT_QSTR("MY_EVENT"), }, {} })), {} diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 49d1ed2897..15302ecf15 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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564265; cv=none; d=zohomail.com; s=zohoarc; b=l1y8tpIZ1JbqvGkYd2D6dFtAU001OMRigQ88Oa67jjXz5BKP9YUpVjAS+KZsgMCDXRuuzU8tNCqI3vUhYxnzTxa6bT56QePW7AOsWDfuCAxTAhGo9ovHDepcBGeuY7EkwiNyofGEx5EAW0uxK+wd0KgKbmow/Z8e2b9wm6bYvo0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564265; 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=uqQopNDkWYoXL+LP7Dx6UXJelVuF2x0QKI3cwEWfvN0=; b=eOZ7NrzoTCCM66jQRdwMUEehZ7twTmbGIHtVQqjGp/A7tgm54oo7WS5bVnYKYLYaq7YXqWNZ19XAIWuWZmPJXQhjOgrDMYLficKlC5hpGlZwY1YEuko0YlFl+JG54BQCgHxPCIwDooyd5bSaGwvxosKIlTrVCD+/sDJCa6FDSXg= 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 1793564265433545.389608168765; Sun, 1 Nov 2026 12:17:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNbzg-0004qs-Al; Sun, 01 Nov 2026 15:17:33 -0500 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 1xNbzb-0004pp-Lo for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:28 -0500 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 1xNbza-00079K-0Q for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:27 -0500 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-456-ILklEcEZP_Cu6Q3jFFK9Tg-1; Sun, 01 Nov 2026 15:17:23 -0500 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 17A02195606B for ; Sun, 1 Nov 2026 20:17:23 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C9AB21956086 for ; Sun, 1 Nov 2026 20:17:22 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id A611E21E6884; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564245; 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=uqQopNDkWYoXL+LP7Dx6UXJelVuF2x0QKI3cwEWfvN0=; b=WcyjBxAtJ8Ru2YD0eqqgLllS08pm92o0aq9BuAgtESJm+M8ESigmtLm5enhxjg7J6ZrUAp td1g5sqR8xqDsD58xA4QQ0miDhDL68P91iDtaT36p8oNro7KI7dExwnmpudQ3WWgBMSyxC JVSXi1SFyIIVMlhFEUy4zN2Tde4fKfg= X-MC-Unique: ILklEcEZP_Cu6Q3jFFK9Tg-1 X-Mimecast-MFC-AGG-ID: ILklEcEZP_Cu6Q3jFFK9Tg_1793564243 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 05/56] qapi: QAPISchemaVisitor.visit_needed() is now unused, drop Date: Sun, 1 Nov 2026 21:16:26 +0100 Message-ID: <20261101201717.3911097-6-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564267453158500 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 11f3accec8..9e2152fa41 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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564413; cv=none; d=zohomail.com; s=zohoarc; b=nGfa70HuG8ZWblANkeR7dc/EmQX9L8qeNS10PaQuxP8/USEz0uPGiv2066mWZDU77YQhgK+uf1ZW3Axn2GYZGQm32JwM0rfQLwJmMuQlo6JDXQn3Dk8lb84mEcso2lAUn3Ii9pJRlVyPcsUhYySfG3LHqaIEpbgoW3p+CZICHsk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564413; 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=TlE4K6Hbs7w0w8JxsYKQzev8bKfW4kAg0+GlYsPY+Ns=; b=FAw46D0JcX0wjTJ5vXhirWGgEgkt4xf7W/7RZuWLqCCqVN+rdoEtLDlMRZoIqoqQEqwYDmzY/mvwET6A/acnO7ixmE2QnHPSgPqXTjU5PoxpBH7m3zRRY/687QOvXaWaIGD+tF0si2CvLHT84dcUcwm8l2X7eRode6FMhu7Xd4M= 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 1793564413243636.7036678679121; Sun, 1 Nov 2026 12:20:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1D-00061m-1N; Sun, 01 Nov 2026 15:19:07 -0500 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 1xNbzd-0004qd-Ps for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:29 -0500 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 1xNbza-00079O-1N for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:29 -0500 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-epKyMmBfPi2JxXzMm7esMw-1; Sun, 01 Nov 2026 15:17:24 -0500 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 3B7B818005BC for ; Sun, 1 Nov 2026 20:17:23 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EAC9A30002CB for ; Sun, 1 Nov 2026 20:17:22 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id AA38F21E6885; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564245; 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=TlE4K6Hbs7w0w8JxsYKQzev8bKfW4kAg0+GlYsPY+Ns=; b=RMPBjEzbh/zNO5bfI3UV2k4mg9MGwJBAf9JzaDa9aNxg538QX2buV4p5jGnYRhgnSFBYL7 N933VGo2+jkdagsXTcrxJnKq7WDqGzS5XkMTUu9Q855ydK7oPWPriTsSYBTeokkISXitfx wZT55VXxD3bkeSYoJc33GSombKNDghE= X-MC-Unique: epKyMmBfPi2JxXzMm7esMw-1 X-Mimecast-MFC-AGG-ID: epKyMmBfPi2JxXzMm7esMw_1793564243 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 06/56] qapi/introspect: Tweak integer type masking Date: Sun, 1 Nov 2026 21:16:27 +0100 Message-ID: <20261101201717.3911097-7-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564414330158500 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 15302ecf15..dc6f70a6fe 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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564425; cv=none; d=zohomail.com; s=zohoarc; b=S8r6iViRIlJGqTbv6HAeOWoLxRTGd8P1RKO1taCzWdLhSFYgzQl32t3TqZx7oPoWvU8hYedbRM+xtO3QvKJe7UfC3LZlUTFi1/w9nii144rqIA5alUCJd9nA/qlsns5Xi8qPbpc3vVxxz66tpr7w/edJIma861X09Se8rQFyjRs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564425; 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=XS5g/TUzHi//uYd4mjcBhOY5lKFenyaHSOeaApi5HdY=; b=Mgi7xAlRId2doiolT1CRO1UZvUJmCYiRW+552oxvc1QiL+PBX7B2m5D+cAjnOIsXlEOxsgbBWFDgganNRwqAyURobLte2ASoZqHeW6TBQgCREg8eitvwwFEQm52i2Dej5LqYno0AgVFOc0AS4GChkwxJ2JmYpQuhKmTsQj+k0vk= 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 1793564425888951.6753796888346; Sun, 1 Nov 2026 12:20:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNbzq-00051J-F7; Sun, 01 Nov 2026 15:17:42 -0500 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 1xNbze-0004qp-1D for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:30 -0500 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 1xNbza-00079Z-45 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:29 -0500 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-456-LIWlVQvPNcybuEFIGPaNYg-1; Sun, 01 Nov 2026 15:17:24 -0500 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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5EDB119560B1 for ; Sun, 1 Nov 2026 20:17:23 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0397D180057F for ; Sun, 1 Nov 2026 20:17:22 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id AEE9521E6886; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564245; 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=XS5g/TUzHi//uYd4mjcBhOY5lKFenyaHSOeaApi5HdY=; b=BI1NcSZIq5YbOQ6WykEYOjbVkXBQT/Tc30Iw9UHuCO7B7YFTy2wDI9bjRlyUqgb5c8X8zS PdlLmAm5np+qWfw/Ud6p0qObdZ0zCeAnjuwOkjS0J5LZLSsSdmO633uADqg/NIXb7HzayH iBwU1fGpj5dl15NZDqX35vVdANy7O6g= X-MC-Unique: LIWlVQvPNcybuEFIGPaNYg-1 X-Mimecast-MFC-AGG-ID: LIWlVQvPNcybuEFIGPaNYg_1793564243 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 07/56] qapi: add QAPITypeInfo struct definition Date: Sun, 1 Nov 2026 21:16:28 +0100 Message-ID: <20261101201717.3911097-8-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564426548158500 From: Marc-Andr=C3=A9 Lureau 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: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- include/qapi/qapi-type-info.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 include/qapi/qapi-type-info.h diff --git a/include/qapi/qapi-type-info.h b/include/qapi/qapi-type-info.h new file mode 100644 index 0000000000..a14ba56016 --- /dev/null +++ b/include/qapi/qapi-type-info.h @@ -0,0 +1,25 @@ +/* + * 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 output of query-qmp-schema, + * assigned by scripts/qapi code generator (e.g. "368"). + * @lookup: QEnumLookup for this type, or NULL for non-enum types. + */ +typedef struct QAPITypeInfo { + const char *name; + const char *masked_name; + const QEnumLookup *lookup; +} QAPITypeInfo; + +#endif /* QAPI_TYPE_INFO_H */ --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564373; cv=none; d=zohomail.com; s=zohoarc; b=DXzjFdcNZRQ7mFaM791c5JCwzseVYYKWUi4lfzdu8nVrQwEcKYfscjZroUJPRJlMUBc6BaLBVIyJABVA/70eBCn6kNtZ73udRQfVvw5XrVjoZ2L23N70xl1mSSKvUwVCdpJnC1eM9W0QbnsM3dKGuuiQetQ2HAAVk/pdtROY4O8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564373; 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=4P0YvOM2n46Nh6lf78OnyHqZCRfY0taJOMr9VwMMNGU=; b=QSyzJ+Ry/O4uNYYtxw8Mf0fDJfiXf44cQxU+uYvHwxYVA+9EbT0uJ774blhkiBl35AEN7p5ZC0wvmOZEykqCUBhfHNgBoKLxfBPAfQM0HZ5kXBlXWIpbczsT1wYwe6n0ewVOzUypGsCqGPZ3E3yAl3QMMSiX9zmxVCwlCGhD9Fk= 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 1793564373820231.94124137384165; Sun, 1 Nov 2026 12:19:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNbzs-00052U-Jg; Sun, 01 Nov 2026 15:17:44 -0500 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 1xNbzb-0004pq-MF for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:28 -0500 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 1xNbza-00079M-0A for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:27 -0500 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-456-vNkAcBddMbumftio-bsBFA-1; Sun, 01 Nov 2026 15:17:24 -0500 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 47F8E18005B4 for ; Sun, 1 Nov 2026 20:17:23 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E15EA1800444 for ; Sun, 1 Nov 2026 20:17:22 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id B334821E6887; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564245; 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=4P0YvOM2n46Nh6lf78OnyHqZCRfY0taJOMr9VwMMNGU=; b=TIqoghR0RgdwWdM6jRCscW6vs/81M6YkwLhsgouKK/S5ScW6DUI9q4uSRzYYhSfE4wB+87 7DUfqy8K3voi1OX5tMv2xbg4EBVTyELWIFnCAbACxbqbtAu+fPUx5dqgFY9dI6Xr7+9DsA +0/mfbBzY0pQG5VpyABGhTO9Z5Vd7KM= X-MC-Unique: vNkAcBddMbumftio-bsBFA-1 X-Mimecast-MFC-AGG-ID: vNkAcBddMbumftio-bsBFA_1793564243 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 08/56] qapi/gen: fix _module_basename for multi-dash 'what' parameters Date: Sun, 1 Nov 2026 21:16:29 +0100 Message-ID: <20261101201717.3911097-9-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564375538158500 From: Marc-Andr=C3=A9 Lureau 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: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- 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 0c9b8db3b0..690187d428 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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564403; cv=none; d=zohomail.com; s=zohoarc; b=n0xPw1TACxfjodECSIX3TQVsID6gqKsnbAXxcI4TAmQm/nW6VX4mBFUAOFTH+A+Lezqq9WCKGWkaELJoE4J/du5jr8z64lAWEnF7sgxjmBmfQRd3+Dn+2TffXoAu4lHeovIsIOUpzU8LoaVVePKvec9kgmncs8WyE3VXdx/6wd8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564403; 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=XnJifS1G7liQbYvSnt6tKc8iG7M6FUaHuIdhs0nco7k=; b=nyWncEGS21s2ZzH1qNhEWenUGDbRAKEGsR3/IifInIUk3II7QmwhlaD4Q4+8F7rrFAaSb1+UqueL9HuO7cBn8ibMbTBwvvQSxKgOWs1WGK9Zm/A3zyvRWAXZDiF3JUB9/qVhXj90G0w8jV656hQHD7Xp01x2rQ7AiqWJtJfqmgM= 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 1793564403305788.2364898358088; Sun, 1 Nov 2026 12:20:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc16-0005l8-8A; Sun, 01 Nov 2026 15:19:02 -0500 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 1xNbzn-0004yG-OT for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:39 -0500 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 1xNbze-0007Be-1Q for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:39 -0500 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-456-4r2IMbpYPZqegH9cHIaJ0Q-1; Sun, 01 Nov 2026 15:17:24 -0500 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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A7B3A1955F54 for ; Sun, 1 Nov 2026 20:17:23 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 25A2F1800586 for ; Sun, 1 Nov 2026 20:17:23 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id B7F0621E6888; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564248; 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=XnJifS1G7liQbYvSnt6tKc8iG7M6FUaHuIdhs0nco7k=; b=fsnM7ExdFGp93mHpUCt/+x3hd81xiEi1BRfOPn2ARUATj3d/ty5PO9sM8USNupIG/uN8BS lD23IioVS+vKzGxcpcR2YaPAdwUeDn6tAV6baCC3wmnU0ltPhBbG+j7Lju+Wgbe/KdQB/9 fq+b1nU9q92Du+8Qsj3IuNSoeAt4Gb4= X-MC-Unique: 4r2IMbpYPZqegH9cHIaJ0Q-1 X-Mimecast-MFC-AGG-ID: 4r2IMbpYPZqegH9cHIaJ0Q_1793564243 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 09/56] qapi: add type-infos generator Date: Sun, 1 Nov 2026 21:16:30 +0100 Message-ID: <20261101201717.3911097-10-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01 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: 1793564404206158500 From: Marc-Andr=C3=A9 Lureau 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. We want per-module .h for less recompiling when we touch QAPI types. Unfortunately, the per-module .c usually all change then, because the masked names all change. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- docs/devel/qapi-code-gen.rst | 87 ++++++++++++++++++++ meson.build | 1 + qapi/meson.build | 4 + qga/meson.build | 2 + scripts/qapi/backend.py | 2 + scripts/qapi/type_infos.py | 149 ++++++++++++++++++++++++++++++++++ tests/include/meson.build | 2 + tests/meson.build | 6 ++ tests/qapi-schema/meson.build | 1 + 9 files changed, 254 insertions(+) create mode 100644 scripts/qapi/type_infos.py diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst index 3c21dda91b..fc3a1dd6d8 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 @@ -2087,3 +2090,87 @@ 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. + +These type info instances are used by QOM property registration +functions (``object_property_add()``, +``object_class_property_add_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 "32", + }; + + const QAPITypeInfo UserDefOneList_type_info =3D { + .name =3D "UserDefOneList", + .masked_name =3D "[32]", + }; + + [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 7ec3fb9023..2af6f2af01 100644 --- a/meson.build +++ b/meson.build @@ -3522,6 +3522,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/qapi/meson.build b/qapi/meson.build index a46269b5a0..7477953492 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 a046ebe305..5cc43b87df 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/scripts/qapi/backend.py b/scripts/qapi/backend.py index 49ae6ecdd3..508ab21735 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 0000000000..d9ed16d185 --- /dev/null +++ b/scripts/qapi/type_infos.py @@ -0,0 +1,149 @@ +""" +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 _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) -> None: + cname =3D c_name(name, protect=3DFalse) + with ifcontext(ifcond or QAPISchemaIfCond(), + self._genh, self._genc): + self._genh.add(mcgen(''' + +extern const QAPITypeInfo %(cname)s_type_info; +''', + cname=3Dcname)) + self._genc.add(mcgen(''' + +const QAPITypeInfo %(cname)s_type_info =3D { + .name =3D "%(name)s", + .masked_name =3D "%(masked_name)s", +''', + cname=3Dcname, name=3Dname, + masked_name=3Dself._masked_name(name))) + if with_lookup: + self._genc.add(mcgen(''' + .lookup =3D &%(cname)s_lookup, +''', + cname=3Dcname)) + self._genc.add(mcgen(''' +}; +''')) + + def visit_builtin_type(self, + name: str, + info: Optional[QAPISourceInfo], + json_type: str) -> None: + self._gen_type_info(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) + + 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) + + def visit_alternate_type(self, + name: str, + info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + features: List[QAPISchemaFeature], + alternatives: QAPISchemaAlternatives) -> None: + self._gen_type_info(name, ifcond) + + +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) diff --git a/tests/include/meson.build b/tests/include/meson.build index 8e8d1ec4e6..026480d968 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 5877d2f60b..6769a1e781 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 debff633ac..392b59d8dc 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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564354; cv=none; d=zohomail.com; s=zohoarc; b=M9Y3CslmLNPeZ+Qmd2CNwP41RjPw9z8LYCb6fssGCRM10Bi1Iix+jmPdUktorWfrkMfAqdbAapuSgRg3W5W83OjBIDtGZ9OsHptyJA0KnZpEASoQE7iyr5qx67V4omMdrRRrACVixIcPEla7ELd3Hl1DxhPwLGqCO8j0OpioCGY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564354; 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=XJjhP1BkvYlI8yYC+l6PVE20U9iCYk6O6nPiXkZNmHw=; b=Wj3Ut/ZVZxGOhuFkv0Je+bxgqMXQD4gHyYrR9uvsmzdaEHPqvUCJHZ6NBq7QpkKvw5T9PCtoYz2bzhOhjDELkJFN7/os6NgbjqsJ2ZW/GZRtK4NNjn94GSd2UJYUlN7FfG5t8tMwqAs4mc/4RaAew7Amduby0zHBi5o6YUsJgNY= 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 1793564354622731.4196722703437; Sun, 1 Nov 2026 12:19:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1D-00061l-I3; Sun, 01 Nov 2026 15:19:07 -0500 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 1xNbzf-0004rN-Pp for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:32 -0500 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 1xNbza-00079f-Ds for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:30 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-672-ek-ULeB6MmmJIUPN-aAK8A-1; Sun, 01 Nov 2026 15:17:24 -0500 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 63A831800616 for ; Sun, 1 Nov 2026 20:17:23 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 22FD73000B78 for ; Sun, 1 Nov 2026 20:17:23 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id BC9CA21E688A; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564245; 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=XJjhP1BkvYlI8yYC+l6PVE20U9iCYk6O6nPiXkZNmHw=; b=EOVMn+duQpQywzQ24NP0S7W/Id4ud++EDuTqnOLMm4yvpEpEjw6IVP8/0RAtkuzAx2SRv9 XnF1CVLRLLXW0jvrjJdz0qs0Z7i6VYpVIG5bijNDtehm9BMaGxP3qOMQ6XIu2fo9Ddp5EF 4llxc0IwayQ/Un2SO04EDN3UEUJnIqE= X-MC-Unique: ek-ULeB6MmmJIUPN-aAK8A-1 X-Mimecast-MFC-AGG-ID: ek-ULeB6MmmJIUPN-aAK8A_1793564243 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 10/56] qom: add qapi_type field to ObjectProperty Date: Sun, 1 Nov 2026 21:16:31 +0100 Message-ID: <20261101201717.3911097-11-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564355205158500 From: Marc-Andr=C3=A9 Lureau 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: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster Signed-off-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 90c1a34e49..e9b380462d 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 96498f3d00..c34b47312f 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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564431; cv=none; d=zohomail.com; s=zohoarc; b=Rl6tHdCi2R9PbLti7YWECzy9IO90Nio3Ktg0e9IeEeDgKUeSGJ6Fcfio2GopowQYHsbbCr7YQP4wgAmZC1zV6qw6W9J5Ln58py7v3ROw5cicZD1Mt5FGf6uLxNKc3vBTTP7FKIdRg7tUFMz7lqGOAbwo520RRtbtcrV0UyBYlDA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564431; 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=LDePUlGiqQJYKW1u+5YkrThS4X9aa0oHrGzsSWKzJJM=; b=AjuCpSrwK07a4hTpkw/ACeNCYdta2426XlABzO4/UZuXE0TEhBVObydpoxgNkXJW7uRwntXzqKhWdUT7fK9gahTNKYFZJEMqAailg1K+2Tb4A6U8EzcjkKeA+jXRE/msrLuu6DsktlGkTnSx1t/8OP50QfLnQXauuEG8FWpA90w= 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 1793564431955181.4316812242539; Sun, 1 Nov 2026 12:20:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNbzl-0004uP-Dq; Sun, 01 Nov 2026 15:17:37 -0500 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 1xNbzd-0004qg-T7 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:30 -0500 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 1xNbza-00079a-3s for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:29 -0500 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-oFkMw6ZSPwCa-xDHHulzPg-1; Sun, 01 Nov 2026 15:17:24 -0500 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 6E753180061E for ; Sun, 1 Nov 2026 20:17:23 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2883F18005B0 for ; Sun, 1 Nov 2026 20:17:23 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C133721E688B; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564245; 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=LDePUlGiqQJYKW1u+5YkrThS4X9aa0oHrGzsSWKzJJM=; b=HkFlJBO89cpmnE+RDXRIh+nhReU+92V7SR9TXLgX35K4XahLeFw9W2b+201dD3ufv6mktC RvopSqs/6VHr0Don+PIstuDEDt3htqMmVLwMSBxvhAoQXtF0TRGIUUpUDkhMB8nlQs4GZh twj9wWGHRZJDVaoRy/A0PNevCbd+zn0= X-MC-Unique: oFkMw6ZSPwCa-xDHHulzPg-1 X-Mimecast-MFC-AGG-ID: oFkMw6ZSPwCa-xDHHulzPg_1793564243 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 11/56] qapi/qom: add qapi-type to qom-list, qom-list-properties, qom-list-get Date: Sun, 1 Nov 2026 21:16:32 +0100 Message-ID: <20261101201717.3911097-12-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564432710158500 From: Marc-Andr=C3=A9 Lureau QOM introspection is flawed: the type information is just a string (ObjectPropertyInfo and ObjectPropertyValue field 'type'). Management applications need to know these strings. Their documentation is of little help. QAPI introspection is more powerful, and management applications already know how to use it. Let's put it to use for QOM introspection. 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. This cannot fully replace 'type', yet: it doesn't cover child and link properties. Mark 'unstable' for now. Reviewed-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- qapi/qom.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/qapi/qom.json b/qapi/qom.json index 4810d53e58..df523c08c7 100644 --- a/qapi/qom.json +++ b/qapi/qom.json @@ -35,15 +35,24 @@ # 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) # +# Features: +# +# @unstable: Member @qapi-type is experimental. +# # Since: 1.2 ## { 'struct': 'ObjectPropertyInfo', 'data': { 'name': 'str', 'type': 'str', + '*qapi-type': { 'type': 'str', 'features': [ 'unstable' ] }, '*description': 'str', '*default-value': 'any' } } =20 @@ -55,14 +64,23 @@ # @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. # +# Features: +# +# @unstable: Member @qapi-type is experimental. +# # Since: 10.1 ## { 'struct': 'ObjectPropertyValue', 'data': { 'name': 'str', 'type': 'str', + '*qapi-type': { 'type': 'str', 'features': [ 'unstable' ] }, '*value': 'any' } } =20 ## --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564348; cv=none; d=zohomail.com; s=zohoarc; b=Nv9MjmEEsc/Q771eveki5aNY85P0zgN9bqfdENsHX2vNtrGnpaCn6vMAMTeZtssMUU64U7giMYR1/SZMzMVMVfUEm6CfMfFTfw5HWHgGxPFnd3SB8UIpSrAUvh+nvfBy7Z3os3x96BmAFQvnL7OLPgtQAW9Z4yEmnPKjfKFTndI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564348; 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=YdetL3GVMiTOVD6AaoiePxKd35lc51ZeATg2wCP+p8Q=; b=kcnmM/mev/y5UNXWKYdUj4OpsehEkewMtSK+zVWvx4v2g15NuBIg5G9Md/xKgX617tLlnjXxQI703dmHhCgK+xS4nSVuC51QwUUmfCX7KGVvIsCPZKsk6OhlR0UiK34ZqNrzMlGPhmz0mRcLivH5OYGNOXajlMMimjT12tBPjE0= 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 1793564348211752.0969014055945; Sun, 1 Nov 2026 12:19:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNbzz-00059H-No; Sun, 01 Nov 2026 15:17:51 -0500 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 1xNbzf-0004rO-R3 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:32 -0500 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 1xNbza-00079d-EJ for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:30 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-672-v-rkFWyPOciU2zY5HNr5Wg-1; Sun, 01 Nov 2026 15:17:24 -0500 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6FD9118005B9 for ; Sun, 1 Nov 2026 20:17:23 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2F7D97E3 for ; Sun, 1 Nov 2026 20:17:23 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C5BF121E688D; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564245; 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=YdetL3GVMiTOVD6AaoiePxKd35lc51ZeATg2wCP+p8Q=; b=M9jFg1vCTZTWaJivqbZ3Q2ic8bYlrqUdU6tLjU9vEkx0MkUdakY7O9Dnuxxwzwp+fQQsx6 4x+SnMP59iFyTXPy7hKRzHJbiYA+8023TKWteNrYB2kSpTaOvaHTgsiOsr72yMUGCVBKKp gQHBJzP1v7GTkgSw3cymHACmmllSiJo= X-MC-Unique: v-rkFWyPOciU2zY5HNr5Wg-1 X-Mimecast-MFC-AGG-ID: v-rkFWyPOciU2zY5HNr5Wg_1793564243 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 12/56] qom/qmp: populate qapi-type in QMP handlers Date: Sun, 1 Nov 2026 21:16:33 +0100 Message-ID: <20261101201717.3911097-13-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564349067158500 From: Marc-Andr=C3=A9 Lureau 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: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- 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 f17389c730..47bf3bf293 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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564354; cv=none; d=zohomail.com; s=zohoarc; b=dHQq2U1pexpcjqoJSUcvHy8axZn90Htvw0b56VItYFTQc9SMbB3ndbaZfeEy6wNkZYpaaSACMXl2BxJp2kwVDKPvq6h1HEX2nAv3GQxL9S/PJ7XogSEldQrBMzLuru0N2FO6obk42tjN0r2BWGoJwWQL4YzifRrmhWl5R+rSMdA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564354; 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=O7RNZYnm+eF4OzlPujJSw4fjnHCyCQO0WFgeUq72Aac=; b=Yg8OwauHLaB9OhDST3+QFugM2428jvgXKWJGXY0cdLSE5qIOG14+MC8VA8BrNB00WJGIf08jyYv1RP5AhYqgKxhDWzc9tPwTNW17B2eh5ZkrQo0HsIliFISUmZ+4j2KVlrEhC0Z3kUiHgmqtHu9NP/HSglNW0GALvKjyfuhXQ4Y= 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 1793564354827401.77835815140213; Sun, 1 Nov 2026 12:19:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNbzz-00058F-6f; Sun, 01 Nov 2026 15:17:51 -0500 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 1xNbzd-0004qc-OZ for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:30 -0500 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 1xNbza-00079U-3S for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:28 -0500 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-BvXEXWlkMNi0VJFnY3x6TA-1; Sun, 01 Nov 2026 15:17:24 -0500 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 5F9081800364 for ; Sun, 1 Nov 2026 20:17:23 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1E60F30002CF for ; Sun, 1 Nov 2026 20:17:23 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id CA20421E6890; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564245; 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=O7RNZYnm+eF4OzlPujJSw4fjnHCyCQO0WFgeUq72Aac=; b=Z4dnY8MPfM3WYdnAkE8ucJtv07c0BNiLL15o6TKsRXpL8IUwwaBerlAHU2PUZEeUyLhzgX Aea8Coa40A0CAD64bcPIMuu9Naj/jZp/dq38zk1keGQnX3UCl6XtAhJ2gvZeSz8T92u+cC wfPs4/4kqE64S7oT1xQWKFX6lBEUeHM= X-MC-Unique: BvXEXWlkMNi0VJFnY3x6TA-1 X-Mimecast-MFC-AGG-ID: BvXEXWlkMNi0VJFnY3x6TA_1793564243 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 13/56] qom/qmp: populate description & default-value in qom_property_info() Date: Sun, 1 Nov 2026 21:16:34 +0100 Message-ID: <20261101201717.3911097-14-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564355218158500 From: Marc-Andr=C3=A9 Lureau 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: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- 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 47bf3bf293..84a2959051 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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564408; cv=none; d=zohomail.com; s=zohoarc; b=l2/hpJajdZwTqoQngYTUGP+Q0FVNp19teDZKIA7v4KIw4jMTt1nXAp72EJIBENzAo2tjmViYWuDTqYBuKVYjs7n+3WQpRPr0RT1tQR/cKexBl0iPe7mviUvXSUdcilROan8r4EADDHvGSVvk6poGPr1hYTi79eQ9+AlQqLijT1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564408; h=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=xMhIuTo4yqrj4PdgdoC/I5WtBHKM8YlabsMw6rLvFuc=; b=e5/J/OTiFQFbf4SbLTOBcNzRVQUTG+8qMhgEK4iRr+9OltZ+H4IDN1+lgwm9zlBFJdJHa49okl+Ap3MsDaBDrLgwm3Ju0Sg5XSJgILrvPFcKcnJwcIY5opBEbfXIWBpctkn3dWxvta/Z/SqO2inPg4fDdvdr7zYa0bJvfunQ8JE= 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 179356440857962.47917096921083; Sun, 1 Nov 2026 12:20:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1L-0006nF-Q8; Sun, 01 Nov 2026 15:19:17 -0500 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 1xNbzl-0004uY-3h for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:37 -0500 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 1xNbzd-0007Au-8N for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:36 -0500 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-502-FPAUfyVCNPy62crhNWL_Vg-1; Sun, 01 Nov 2026 15:17:25 -0500 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 569A6180059A for ; Sun, 1 Nov 2026 20:17:24 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 44B6D1956088 for ; Sun, 1 Nov 2026 20:17:23 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D04E821E6892; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xMhIuTo4yqrj4PdgdoC/I5WtBHKM8YlabsMw6rLvFuc=; b=ew+5nYXffkH9BArmefAVh41ciHRxl65wcyA/+22pfH/I847oBwHyC1QBCDRwmyty0FOwcY tJGoN0ePiHLecm+TKe9ylk49iL+nsCJ5IQNVX1rzp/v2qv4wW4Af/nWdLXRTQr7Gw8HSV9 /nnYimBwdfRQ36rvT4x5bLM5qB18llI= X-MC-Unique: FPAUfyVCNPy62crhNWL_Vg-1 X-Mimecast-MFC-AGG-ID: FPAUfyVCNPy62crhNWL_Vg_1793564244 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 14/56] qom: New object_property_add() etc. parameter @qapi_type Date: Sun, 1 Nov 2026 21:16:35 +0100 Message-ID: <20261101201717.3911097-15-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1793564410296158500 Content-Type: text/plain; charset="utf-8" This permits setting ObjectProperty's optional @qapi_type. For now, all callers pass null. Callers updated with this Coccinelle script: @@ identifier fun =3D { object_property_try_add, object_property_add, object_class_property_add }; expression obj, name, type; @@ - fun(obj, name, type, + fun(obj, name, type, NULL, ...) Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau --- include/qom/object.h | 5 +++ accel/hvf/hvf-all.c | 6 +-- accel/kvm/kvm-all.c | 19 +++++---- accel/nitro/nitro-accel.c | 2 +- accel/tcg/tcg-all.c | 6 +-- accel/whpx/whpx-common.c | 12 +++--- authz/list.c | 2 +- backends/cryptodev.c | 6 +-- backends/hostmem-file.c | 21 +++++----- backends/hostmem-memfd.c | 4 +- backends/hostmem.c | 24 +++++------ block/throttle-groups.c | 7 +--- chardev/char-socket.c | 2 +- crypto/secret_keyring.c | 2 +- event-loop-base.c | 6 +-- hw/acpi/ich9.c | 2 +- hw/acpi/pci.c | 8 ++-- hw/arm/virt.c | 10 ++--- hw/core/clock.c | 2 +- hw/core/machine.c | 29 +++++++------ hw/core/qdev-properties.c | 5 +-- hw/cpu/core.c | 6 ++- hw/cxl/cxl-host.c | 4 +- hw/gpio/aspeed_gpio.c | 6 +-- hw/gpio/aspeed_sgpio.c | 2 +- hw/gpio/pca9552.c | 4 +- hw/gpio/pca9554.c | 3 +- hw/gpio/stm32l4x5_gpio.c | 4 +- hw/hexagon/hexagon_dsp.c | 2 +- hw/i386/microvm.c | 6 +-- hw/i386/pc.c | 27 ++++++------ hw/i386/sgx-epc.c | 2 +- hw/i386/x86.c | 23 ++++++----- hw/ide/ide-dev.c | 2 +- hw/intc/apic_common.c | 2 +- hw/loongarch/virt.c | 18 ++++---- hw/mem/nvdimm.c | 5 ++- hw/mem/pc-dimm.c | 3 +- hw/misc/aspeed_lpc.c | 36 ++++++++++------ hw/misc/aspeed_sdmc.c | 2 +- hw/misc/npcm7xx_mft.c | 2 +- hw/net/ne2000-isa.c | 2 +- hw/nvme/ctrl.c | 2 +- hw/pci-bridge/pci_expander_bridge.c | 2 +- hw/pci-host/i440fx.c | 4 ++ hw/pci-host/pnv_phb3.c | 4 +- hw/pci-host/pnv_phb4.c | 4 +- hw/pci-host/q35.c | 8 ++-- hw/ppc/spapr_caps.c | 2 +- hw/ppc/spapr_drc.c | 4 +- hw/remote/vfio-user-obj.c | 2 +- hw/riscv/microchip_pfsoc.c | 1 + hw/riscv/virt.c | 4 +- hw/s390x/s390-virtio-ccw.c | 4 +- hw/s390x/sclpcpi.c | 6 ++- hw/s390x/virtio-ccw-mem.c | 2 +- hw/sensor/adc128d818.c | 8 ++-- hw/sensor/adm1266.c | 2 +- hw/sensor/adm1272.c | 8 ++-- hw/sensor/emc141x.c | 8 ++-- hw/sensor/isl_pmbus_vr.c | 18 ++++---- hw/sensor/lsm303dlhc_mag.c | 24 +++++------ hw/sensor/max34451.c | 4 +- hw/sensor/tmp105.c | 2 +- hw/sensor/tmp421.c | 8 ++-- hw/usb/dev-storage-classic.c | 2 +- hw/vfio-user/pci.c | 2 +- hw/virtio/virtio-balloon.c | 4 +- hw/virtio/virtio-mem-pci.c | 2 +- hw/virtio/virtio-mem.c | 7 ++-- hw/xen/xen-pvh-common.c | 8 ++-- iothread.c | 8 ++-- net/colo-compare.c | 6 +-- net/dump.c | 3 +- net/filter-buffer.c | 2 +- qom/object.c | 64 ++++++++++++++++------------- system/bootdevice.c | 2 +- system/memory.c | 4 +- target/arm/cpu64.c | 10 ++--- target/arm/kvm.c | 2 +- target/arm/tcg/cpu64.c | 4 +- target/i386/cpu.c | 20 +++++---- target/i386/kvm/kvm.c | 8 ++-- target/i386/kvm/tdx.c | 2 +- target/i386/sev.c | 8 ++-- target/i386/whpx/whpx-all.c | 18 ++++---- target/ppc/compat.c | 2 +- target/riscv/cpu.c | 12 +++--- target/riscv/kvm/kvm-cpu.c | 6 +-- target/riscv/tcg/tcg-cpu.c | 6 +-- target/s390x/cpu-system.c | 1 + target/s390x/cpu_models.c | 5 ++- tests/unit/test-qdev-global-props.c | 6 ++- ui/console.c | 2 +- util/thread-context.c | 6 +-- 95 files changed, 377 insertions(+), 327 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index e9b380462d..84b273e535 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1163,6 +1163,7 @@ void object_unref(void *obj); * defined. Sub namespaces are constructed by using a prefix and then * to angle brackets. For instance, the type 'virtio-net-pci' in the * 'link' namespace would be 'link'. + * @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, @@ -1188,6 +1189,7 @@ void object_unref(void *obj); */ ObjectProperty *object_property_try_add(Object *obj, const char *name, const char *type, + QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release, @@ -1203,6 +1205,7 @@ ObjectProperty *object_property_try_add(Object *obj, = const char *name, * defined. Sub namespaces are constructed by using a prefix and then * to angle brackets. For instance, the type 'virtio-net-pci' in the * 'link' namespace would be 'link'. + * @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, @@ -1220,6 +1223,7 @@ ObjectProperty *object_property_try_add(Object *obj, = const char *name, */ ObjectProperty *object_property_add(Object *obj, const char *name, const char *type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release, @@ -1237,6 +1241,7 @@ void object_property_del(Object *obj, const char *nam= e); =20 ObjectProperty *object_class_property_add(ObjectClass *klass, const char *= name, const char *type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release, diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 8bd9154a50..213ee15b4a 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -277,9 +277,9 @@ static void hvf_accel_class_init(ObjectClass *oc, const= 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_add(oc, "kernel-irqchip", "on|off|split", NULL, + NULL, hvf_set_kernel_irqchip, + NULL, NULL); object_class_property_set_description(oc, "kernel-irqchip", "Configure HVF irqchip"); } diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index db8fba53f3..9cc1e4b0a9 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -4303,21 +4303,22 @@ 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_add(oc, "kernel-irqchip", "on|off|split", NULL, + NULL, kvm_set_kernel_irqchip, + NULL, NULL); object_class_property_set_description(oc, "kernel-irqchip", "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, - NULL, NULL); + object_class_property_add(oc, "kvm-shadow-mem", "int", NULL, + kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_m= em, + 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", - kvm_get_dirty_ring_size, kvm_set_dirty_ring_size, - NULL, NULL); + object_class_property_add(oc, "dirty-ring-size", "uint32", NULL, + kvm_get_dirty_ring_size, + kvm_set_dirty_ring_size, + NULL, NULL); object_class_property_set_description(oc, "dirty-ring-size", "Size of KVM dirty page ring buffer (default: 0, i.e. use bitmap)"= ); =20 diff --git a/accel/nitro/nitro-accel.c b/accel/nitro/nitro-accel.c index a1e97a9162..597027438c 100644 --- a/accel/nitro/nitro-accel.c +++ b/accel/nitro/nitro-accel.c @@ -238,7 +238,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(oc, "enclave-cid", "uint64", NULL, 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 767e880555..ed314e01cb 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -270,9 +270,9 @@ 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", - tcg_get_tb_size, tcg_set_tb_size, - NULL, NULL); + object_class_property_add(oc, "tb-size", "uint32", NULL, + tcg_get_tb_size, tcg_set_tb_size, + NULL, NULL); object_class_property_set_description(oc, "tb-size", "TCG translation block cache size"); =20 diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c index 247e12db81..f82e607745 100644 --- a/accel/whpx/whpx-common.c +++ b/accel/whpx/whpx-common.c @@ -528,14 +528,14 @@ 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_add(oc, "kernel-irqchip", "on|off|split", NULL, + NULL, whpx_set_kernel_irqchip, + 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_add(oc, "hyperv", "OnOffAuto", NULL, + NULL, whpx_set_hyperv, + NULL, NULL); object_class_property_set_description(oc, "hyperv", "Configure Hyper-V enlightenments"); =20 diff --git a/authz/list.c b/authz/list.c index 17aa0efd80..72aedc6ac4 100644 --- a/authz/list.c +++ b/authz/list.c @@ -126,7 +126,7 @@ qauthz_list_class_init(ObjectClass *oc, const void *dat= a) qauthz_list_prop_get_policy, qauthz_list_prop_set_policy); =20 - object_class_property_add(oc, "rules", "QAuthZListRule", + object_class_property_add(oc, "rules", "QAuthZListRule", NULL, qauthz_list_prop_get_rules, qauthz_list_prop_set_rules, NULL, NULL); diff --git a/backends/cryptodev.c b/backends/cryptodev.c index e8f2b18f20..cc323014cc 100644 --- a/backends/cryptodev.c +++ b/backends/cryptodev.c @@ -622,15 +622,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(oc, "queues", "uint32", NULL, cryptodev_backend_get_queues, cryptodev_backend_set_queues, NULL, NULL); - object_class_property_add(oc, "throttle-bps", "uint64", + object_class_property_add(oc, "throttle-bps", "uint64", NULL, cryptodev_backend_get_bps, cryptodev_backend_set_bps, NULL, NULL); - object_class_property_add(oc, "throttle-ops", "uint64", + object_class_property_add(oc, "throttle-ops", "uint64", NULL, cryptodev_backend_get_ops, cryptodev_backend_set_ops, NULL, NULL); diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 7efecf71f5..aec38bac2f 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -281,14 +281,14 @@ 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", - file_memory_backend_get_align, - file_memory_backend_set_align, - NULL, NULL); - object_class_property_add(oc, "offset", "int", - file_memory_backend_get_offset, - file_memory_backend_set_offset, - NULL, NULL); + object_class_property_add(oc, "align", "uint64", NULL, + file_memory_backend_get_align, + file_memory_backend_set_align, + NULL, NULL); + object_class_property_add(oc, "offset", "int", NULL, + file_memory_backend_get_offset, + file_memory_backend_set_offset, + NULL, NULL); object_class_property_set_description(oc, "offset", "Offset into the target file (ex: 1G)"); #ifdef CONFIG_LIBPMEM @@ -298,8 +298,9 @@ file_backend_class_init(ObjectClass *oc, const void *da= ta) 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_add(oc, "rom", "OnOffAuto", NULL, + file_memory_backend_get_rom, + file_memory_backend_set_rom, NULL, NULL); object_class_property_set_description(oc, "rom", "Whether to create Read Only Memory (ROM)"); } diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index 666593ff6c..15dc8814ba 100644 --- a/backends/hostmem-memfd.c +++ b/backends/hostmem-memfd.c @@ -195,7 +195,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(oc, "hugetlbsize", "uint64", NULL, memfd_backend_get_hugetlbsize, memfd_backend_set_hugetlbsize, NULL, NULL); @@ -203,7 +203,7 @@ memfd_backend_class_init(ObjectClass *oc, const void *d= ata) "Huge pages size (ex: 2M, 1G= )"); } =20 - object_class_property_add(oc, "guest-memfd", "OnOffAuto", + object_class_property_add(oc, "guest-memfd", "OnOffAuto", NULL, memfd_backend_get_guest_memfd, memfd_backend_set_guest_memfd, NULL, NULL); object_class_property_set_description(oc, "guest-memfd", diff --git a/backends/hostmem.c b/backends/hostmem.c index 8782c8b1ea..299a3b90fe 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -528,10 +528,10 @@ host_memory_backend_class_init(ObjectClass *oc, const= void *data) host_memory_backend_set_prealloc); object_class_property_set_description(oc, "prealloc", "Preallocate memory"); - object_class_property_add(oc, "prealloc-threads", "int", - host_memory_backend_get_prealloc_threads, - host_memory_backend_set_prealloc_threads, - NULL, NULL); + object_class_property_add(oc, "prealloc-threads", "int", NULL, + host_memory_backend_get_prealloc_threads, + host_memory_backend_set_prealloc_threads, + NULL, NULL); object_class_property_set_description(oc, "prealloc-threads", "Number of CPU threads to use for prealloc"); object_class_property_add_link(oc, "prealloc-context", @@ -539,16 +539,16 @@ 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", - host_memory_backend_get_size, - host_memory_backend_set_size, - NULL, NULL); + object_class_property_add(oc, "size", "size", NULL, + 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]", - host_memory_backend_get_host_nodes, - host_memory_backend_set_host_nodes, - NULL, NULL); + object_class_property_add(oc, "host-nodes", "[uint16]", NULL, + host_memory_backend_get_host_nodes, + host_memory_backend_set_host_nodes, + 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", diff --git a/block/throttle-groups.c b/block/throttle-groups.c index 37814b84fe..cfe2ea67e3 100644 --- a/block/throttle-groups.c +++ b/block/throttle-groups.c @@ -984,17 +984,14 @@ 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, - properties[i].name, - "int64", + object_class_property_add(klass, properties[i].name, "int64", NULL, throttle_group_get, throttle_group_set, NULL, &properties[i]); } =20 /* ThrottleLimits */ - object_class_property_add(klass, - "limits", "ThrottleLimits", + object_class_property_add(klass, "limits", "ThrottleLimits", NULL, throttle_group_get_limits, throttle_group_set_limits, NULL, NULL); diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 81bac42a15..6ce9c2a50b 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -1568,7 +1568,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(oc, "addr", "SocketAddress", NULL, char_socket_get_addr, NULL, NULL, NULL); =20 diff --git a/crypto/secret_keyring.c b/crypto/secret_keyring.c index 3b332276ef..e9cb222bf8 100644 --- a/crypto/secret_keyring.c +++ b/crypto/secret_keyring.c @@ -107,7 +107,7 @@ qcrypto_secret_keyring_class_init(ObjectClass *oc, cons= t 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", + object_class_property_add(oc, "serial", "int32_t", NULL, qcrypto_secret_prop_get_key, qcrypto_secret_prop_set_key, NULL, NULL); diff --git a/event-loop-base.c b/event-loop-base.c index 23f554d92c..42bf09d58b 100644 --- a/event-loop-base.c +++ b/event-loop-base.c @@ -104,15 +104,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(klass, "aio-max-batch", "int64", NULL, 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(klass, "thread-pool-min", "int64", NULL, 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(klass, "thread-pool-max", "int64", NULL, 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 6d421b990c..f3e248c8da 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -379,7 +379,7 @@ void ich9_pm_add_class_properties(ObjectClass *oc, ptrd= iff_t pm_offset) PM_REG_FIELD(acpi_pci_hotplug.root), object_property_allow_set_link, OBJ_PROP_LINK_STRONG); - object_class_property_add(oc, ACPI_PM_PROP_GPE0_BLK, "uint32", + object_class_property_add(oc, ACPI_PM_PROP_GPE0_BLK, "uint32", NULL, ich9_pm_get_gpe0_blk, NULL, NULL, NULL); object_class_property_add_uint8_ptr(oc, ACPI_PM_PROP_S3_DISABLED, diff --git a/hw/acpi/pci.c b/hw/acpi/pci.c index c82924be86..abd1071f49 100644 --- a/hw/acpi/pci.c +++ b/hw/acpi/pci.c @@ -139,8 +139,8 @@ 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, - acpi_generic_initiator_set_node, NULL, NULL); + object_class_property_add(oc, "node", "uint32", NULL, NULL, + acpi_generic_initiator_set_node, NULL, NULL); object_class_property_set_description(oc, "node", "NUMA node associated with the PCI device"); } @@ -253,8 +253,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(oc, "node", "uint32", NULL, 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 3ab3ad8c3b..dad3f8c39b 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -4206,9 +4206,9 @@ 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_add(oc, "acpi", "OnOffAuto", NULL, + virt_get_acpi, virt_set_acpi, + NULL, NULL); object_class_property_set_description(oc, "acpi", "Enable ACPI"); object_class_property_add_bool(oc, "secure", virt_get_secure, @@ -4259,7 +4259,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(oc, "highmem-mmio-size", "size", NULL, virt_get_highmem_mmio_size, virt_set_highmem_mmio_size, NULL, NULL); @@ -4267,7 +4267,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(oc, "virtio-mmio-transports", "uint8", NULL, virt_get_virtio_transports, virt_set_virtio_transports, NULL, NULL); diff --git a/hw/core/clock.c b/hw/core/clock.c index 3fc98a0c65..d46c888f5c 100644 --- a/hw/core/clock.c +++ b/hw/core/clock.c @@ -185,7 +185,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(obj, "qtest-clock-period", "uint64", NULL, clock_period_prop_get, NULL, NULL, NULL); } } diff --git a/hw/core/machine.c b/hw/core/machine.c index d9ac4b419a..50422750be 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1118,26 +1118,29 @@ 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", - machine_get_boot, machine_set_boot, - NULL, NULL); + object_class_property_add(oc, "boot", "BootConfiguration", NULL, + 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", - machine_get_smp, machine_set_smp, - NULL, NULL); + object_class_property_add(oc, "smp", "SMPConfiguration", NULL, + 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", - machine_get_smp_cache, machine_set_smp_cache, NULL, NULL); + NULL, + machine_get_smp_cache, machine_set_smp_cache, + NULL, NULL); object_class_property_set_description(oc, "smp-cache", "Cache properties list for SMP machine"); =20 - object_class_property_add(oc, "phandle-start", "int", - machine_get_phandle_start, machine_set_phandle_start, - NULL, NULL); + object_class_property_add(oc, "phandle-start", "int", NULL, + machine_get_phandle_start, + machine_set_phandle_start, + NULL, NULL); object_class_property_set_description(oc, "phandle-start", "The first phandle ID we may generate dynamically"); =20 @@ -1212,9 +1215,9 @@ 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", - machine_get_mem, machine_set_mem, - NULL, NULL); + object_class_property_add(oc, "memory", "MemorySizeConfiguration", NUL= L, + machine_get_mem, machine_set_mem, + NULL, NULL); object_class_property_set_description(oc, "memory", "Memory size configuration"); } diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 34d7b26a73..61dca80c95 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -1150,7 +1150,7 @@ void qdev_property_add_static(DeviceState *dev, const= Property *prop) =20 assert(!prop->info->create); =20 - op =3D object_property_add(obj, prop->name, prop->info->type, + op =3D object_property_add(obj, prop->name, prop->info->type, NULL, field_prop_getter(prop->info), field_prop_setter(prop->info), prop->info->release, @@ -1176,8 +1176,7 @@ static void qdev_class_add_property(DeviceClass *klas= s, 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, + op =3D object_class_property_add(oc, name, prop->info->type, NULL, field_prop_getter(prop->info), field_prop_setter(prop->info), prop->info->release, diff --git a/hw/cpu/core.c b/hw/cpu/core.c index 26e488f3d8..f430befad8 100644 --- a/hw/cpu/core.c +++ b/hw/cpu/core.c @@ -82,9 +82,11 @@ static void cpu_core_class_init(ObjectClass *oc, const v= oid *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, + object_class_property_add(oc, "core-id", "int", NULL, + 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, + object_class_property_add(oc, "nr-threads", "int", NULL, + core_prop_get_nr_threads, core_prop_set_nr_threads, NULL, NULL); } =20 diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index e279ce5fe3..2ddff574d1 100644 --- a/hw/cxl/cxl-host.c +++ b/hw/cxl/cxl-host.c @@ -610,13 +610,13 @@ static void machine_set_cfmw(Object *obj, Visitor *v,= const char *name, =20 void cxl_machine_init(Object *obj, CXLState *state) { - object_property_add(obj, "cxl", "bool", machine_get_cxl, + object_property_add(obj, "cxl", "bool", NULL, machine_get_cxl, machine_set_cxl, NULL, state); object_property_set_description(obj, "cxl", "Set on/off to enable/disable " "CXL instantiation"); =20 - object_property_add(obj, "cxl-fmw", "CXLFixedMemoryWindow", + object_property_add(obj, "cxl-fmw", "CXLFixedMemoryWindow", NULL, machine_get_cfmw, machine_set_cfmw, NULL, state); object_property_set_description(obj, "cxl-fmw", diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c index 1cf6f5df55..4463cf7c9f 100644 --- a/hw/gpio/aspeed_gpio.c +++ b/hw/gpio/aspeed_gpio.c @@ -1481,7 +1481,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(obj, name, "bool", NULL, aspeed_gpio_get_p= in, aspeed_gpio_set_pin, NULL, NULL); g_free(name); } @@ -1489,8 +1489,8 @@ 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, - aspeed_gpio_set_set, NULL, NULL); + object_property_add(obj, name, "uint32", NULL, aspeed_gpio_get_set, + aspeed_gpio_set_set, NULL, NULL); } } =20 diff --git a/hw/gpio/aspeed_sgpio.c b/hw/gpio/aspeed_sgpio.c index 7d2f736995..aeaef4f102 100644 --- a/hw/gpio/aspeed_sgpio.c +++ b/hw/gpio/aspeed_sgpio.c @@ -300,7 +300,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(obj, name, "bool", NULL, aspeed_sgpio_get_pin, aspeed_sgpio_set_pin, NULL, NULL); } } diff --git a/hw/gpio/pca9552.c b/hw/gpio/pca9552.c index 719149b717..7e5fda4980 100644 --- a/hw/gpio/pca9552.c +++ b/hw/gpio/pca9552.c @@ -567,12 +567,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, "bool", NULL, 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, "str", NULL, 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 904698cdce..0dd063f93a 100644 --- a/hw/gpio/pca9554.c +++ b/hw/gpio/pca9554.c @@ -280,7 +280,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, "str", NULL, pca9554_get_pin, + pca9554_set_pin, NULL, NULL); g_free(name); } diff --git a/hw/gpio/stm32l4x5_gpio.c b/hw/gpio/stm32l4x5_gpio.c index 92fa397fba..a31999323a 100644 --- a/hw/gpio/stm32l4x5_gpio.c +++ b/hw/gpio/stm32l4x5_gpio.c @@ -409,10 +409,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(obj, "disconnected-pins", "uint16", NULL, disconnected_pins_get, disconnected_pins_set, NULL, &s->disconnected_pins); - object_property_add(obj, "clock-freq-hz", "uint32", + object_property_add(obj, "clock-freq-hz", "uint32", NULL, clock_freq_get, NULL, NULL, NULL); } =20 diff --git a/hw/hexagon/hexagon_dsp.c b/hw/hexagon/hexagon_dsp.c index 05b95f39aa..abccf10c00 100644 --- a/hw/hexagon/hexagon_dsp.c +++ b/hw/hexagon/hexagon_dsp.c @@ -153,7 +153,7 @@ static void hexagon_sim_set_subsystem_base(Object *obj,= Visitor *v, =20 static void add_dsp_properties(ObjectClass *oc) { - object_class_property_add(oc, "subsystem-base", "uint32", + object_class_property_add(oc, "subsystem-base", "uint32", NULL, hexagon_sim_get_subsystem_base, hexagon_sim_set_subsystem_base, NULL, NULL); object_class_property_set_description(oc, "subsystem-base", diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index a49de33749..c679b3b177 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -673,21 +673,21 @@ 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", + object_class_property_add(oc, MICROVM_MACHINE_RTC, "OnOffAuto", NULL, microvm_machine_get_rtc, microvm_machine_set_rtc, NULL, NULL); object_class_property_set_description(oc, MICROVM_MACHINE_RTC, "Enable MC146818 RTC"); =20 - object_class_property_add(oc, MICROVM_MACHINE_PCIE, "OnOffAuto", + object_class_property_add(oc, MICROVM_MACHINE_PCIE, "OnOffAuto", NULL, microvm_machine_get_pcie, microvm_machine_set_pcie, NULL, NULL); object_class_property_set_description(oc, MICROVM_MACHINE_PCIE, "Enable PCIe"); =20 - object_class_property_add(oc, MICROVM_MACHINE_IOAPIC2, "OnOffAuto", + object_class_property_add(oc, MICROVM_MACHINE_IOAPIC2, "OnOffAuto", NU= LL, microvm_machine_get_ioapic2, microvm_machine_set_ioapic2, NULL, NULL); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index dbfd55de30..1fce96f5ec 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1722,15 +1722,16 @@ static void pc_machine_class_init(ObjectClass *oc, = const 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", - pc_machine_get_max_ram_below_4g, pc_machine_set_max_ram_below_4g, - NULL, NULL); + object_class_property_add(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "size", NUL= L, + 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, "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_add(oc, PC_MACHINE_VMPORT, "OnOffAuto", NULL, + pc_machine_get_vmport, pc_machine_set_vmport, + NULL, NULL); object_class_property_set_description(oc, PC_MACHINE_VMPORT, "Enable vmport (pc & q35)"); =20 @@ -1758,15 +1759,17 @@ 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", - pc_machine_get_max_fw_size, pc_machine_set_max_fw_size, - NULL, NULL); + object_class_property_add(oc, PC_MACHINE_MAX_FW_SIZE, "size", NULL, + 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", - pc_machine_get_smbios_ep, pc_machine_set_smbios_ep, - NULL, NULL); + object_class_property_add(oc, PC_MACHINE_SMBIOS_EP, "str", NULL, + pc_machine_get_smbios_ep, + pc_machine_set_smbios_ep, + NULL, NULL); object_class_property_set_description(oc, PC_MACHINE_SMBIOS_EP, "SMBIOS Entry Point type [32, 64]"); =20 diff --git a/hw/i386/sgx-epc.c b/hw/i386/sgx-epc.c index 29cda843c9..a1b55c2ec3 100644 --- a/hw/i386/sgx-epc.c +++ b/hw/i386/sgx-epc.c @@ -159,7 +159,7 @@ static void sgx_epc_class_init(ObjectClass *oc, const v= oid *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", + object_class_property_add(oc, SGX_EPC_SIZE_PROP, "uint64", NULL, sgx_epc_get_size, NULL, NULL, NULL); diff --git a/hw/i386/x86.c b/hw/i386/x86.c index f8ba3244e2..1b7740a97e 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -391,26 +391,26 @@ 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_add(oc, X86_MACHINE_SMM, "OnOffAuto", NULL, + x86_machine_get_smm, x86_machine_set_smm, + NULL, NULL); object_class_property_set_description(oc, X86_MACHINE_SMM, "Enable SMM"); =20 - object_class_property_add(oc, X86_MACHINE_ACPI, "OnOffAuto", - x86_machine_get_acpi, x86_machine_set_acpi, - NULL, NULL); + object_class_property_add(oc, X86_MACHINE_ACPI, "OnOffAuto", NULL, + x86_machine_get_acpi, x86_machine_set_acpi, + NULL, NULL); object_class_property_set_description(oc, X86_MACHINE_ACPI, "Enable ACPI"); =20 - object_class_property_add(oc, X86_MACHINE_PIT, "OnOffAuto", + object_class_property_add(oc, X86_MACHINE_PIT, "OnOffAuto", NULL, x86_machine_get_pit, x86_machine_set_pit, NULL, NULL); object_class_property_set_description(oc, X86_MACHINE_PIT, "Enable i8254 PIT"); =20 - object_class_property_add(oc, X86_MACHINE_PIC, "OnOffAuto", + object_class_property_add(oc, X86_MACHINE_PIC, "OnOffAuto", NULL, x86_machine_get_pic, x86_machine_set_pic, NULL, NULL); @@ -435,14 +435,15 @@ static void x86_machine_class_init(ObjectClass *oc, c= onst void *data) "The string may be up to 8 bytes= in size"); =20 object_class_property_add(oc, X86_MACHINE_BUS_LOCK_RATELIMIT, "uint64_= t", + NULL, x86_machine_get_bus_lock_ratelimit, x86_machine_set_bus_lock_ratelimit, NULL, = NULL); 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", - machine_get_sgx_epc, machine_set_sgx_epc, - NULL, NULL); + object_class_property_add(oc, "sgx-epc", "SgxEPC", NULL, + machine_get_sgx_epc, machine_set_sgx_epc, + NULL, NULL); object_class_property_set_description(oc, "sgx-epc", "SGX EPC device"); } diff --git a/hw/ide/ide-dev.c b/hw/ide/ide-dev.c index 5d478588c6..7bb06088a5 100644 --- a/hw/ide/ide-dev.c +++ b/hw/ide/ide-dev.c @@ -174,7 +174,7 @@ out: =20 static void ide_dev_instance_init(Object *obj) { - object_property_add(obj, "bootindex", "int32", + object_property_add(obj, "bootindex", "int32", NULL, 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 0f0f37d457..ee5f6cb4c3 100644 --- a/hw/intc/apic_common.c +++ b/hw/intc/apic_common.c @@ -442,7 +442,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(obj, "id", "uint32", NULL, apic_common_get_id, apic_common_set_id, NULL, NULL); } diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 9c5371af9d..8ad327b8dd 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -1483,18 +1483,18 @@ 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_add(oc, "acpi", "OnOffAuto", NULL, + 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_add(oc, "v-eiointc", "OnOffAuto", NULL, + 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_add(oc, "dmsi", "OnOffAuto", NULL, + virt_get_dmsi, virt_set_dmsi, NULL, NULL); object_class_property_set_description(oc, "dmsi", "Enable direct Message-interrupts Controller."= ); machine_class_allow_dynamic_sysbus_dev(mc, TYPE_RAMFB_DEVICE); @@ -1525,7 +1525,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(oc, "highmem-mmio-size", "size", NULL, 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 cf8a4d8c5f..8d6e8d0bd9 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -99,11 +99,12 @@ static void nvdimm_set_uuid(Object *obj, Visitor *v, co= nst char *name, =20 static void nvdimm_init(Object *obj) { - object_property_add(obj, NVDIMM_LABEL_SIZE_PROP, "size", + object_property_add(obj, NVDIMM_LABEL_SIZE_PROP, "size", NULL, nvdimm_get_label_size, nvdimm_set_label_size, NULL, NULL); =20 - object_property_add(obj, NVDIMM_UUID_PROP, "QemuUUID", nvdimm_get_uuid, + object_property_add(obj, NVDIMM_UUID_PROP, "QemuUUID", NULL, + nvdimm_get_uuid, nvdimm_set_uuid, NULL, NULL); } =20 diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 68862926ee..7250146c10 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -176,7 +176,8 @@ 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(obj, PC_DIMM_SIZE_PROP, "uint64", NULL, + pc_dimm_get_size, NULL, NULL, NULL); } =20 diff --git a/hw/misc/aspeed_lpc.c b/hw/misc/aspeed_lpc.c index 7f7e4f1a09..a73df07332 100644 --- a/hw/misc/aspeed_lpc.c +++ b/hw/misc/aspeed_lpc.c @@ -417,29 +417,41 @@ 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, + object_property_add(obj, "idr1", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr1", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "odr1", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str1", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "str1", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr2", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "idr2", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr2", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "odr2", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str2", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "str2", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr3", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "idr3", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr3", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "odr3", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str3", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "str3", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr4", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "idr4", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr4", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "odr4", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str4", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "str4", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); } =20 diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c index f8fbaebee6..427816b838 100644 --- a/hw/misc/aspeed_sdmc.c +++ b/hw/misc/aspeed_sdmc.c @@ -259,7 +259,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(obj, "ram-size", "int", NULL, 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 742166c4e8..3ce92fad3a 100644 --- a/hw/misc/npcm7xx_mft.c +++ b/hw/misc/npcm7xx_mft.c @@ -491,7 +491,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(obj, "max_rpm[*]", "uint32", NULL, 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 673c785abc..02300eaaa6 100644 --- a/hw/net/ne2000-isa.c +++ b/hw/net/ne2000-isa.c @@ -131,7 +131,7 @@ out: =20 static void isa_ne2000_instance_init(Object *obj) { - object_property_add(obj, "bootindex", "int32", + object_property_add(obj, "bootindex", "int32", NULL, 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 578421c217..405010af4b 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -10612,7 +10612,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(obj, "smart_critical_warning", "uint8", NULL, 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 40ffbc4e08..1b22f5e383 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -103,7 +103,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(class, "acpi_uid", "uint32", NULL, 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 c1982f7962..bf4b6c4253 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -388,18 +388,22 @@ static void i440fx_pcihost_class_init(ObjectClass *kl= ass, const void *data) dc->user_creatable =3D false; =20 object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_START, "uint32= ", + NULL, i440fx_pcihost_get_pci_hole_start, NULL, NULL, NULL); =20 object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_END, "uint32", + NULL, i440fx_pcihost_get_pci_hole_end, NULL, NULL, NULL); =20 object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE64_START, "uint= 64", + NULL, i440fx_pcihost_get_pci_hole64_start, NULL, NULL, NULL); =20 object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE64_END, "uint64= ", + NULL, i440fx_pcihost_get_pci_hole64_end, NULL, NULL, NULL); } diff --git a/hw/pci-host/pnv_phb3.c b/hw/pci-host/pnv_phb3.c index db061c134e..c45401d9dd 100644 --- a/hw/pci-host/pnv_phb3.c +++ b/hw/pci-host/pnv_phb3.c @@ -1164,12 +1164,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(klass, "phb-id", "uint32", NULL, 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(klass, "chip-id", "uint32", NULL, 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 ac09a0b034..6a5d1bb227 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -1775,12 +1775,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(klass, "phb-id", "uint32", NULL, 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(klass, "chip-id", "uint32", NULL, 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 f4556ad03a..027ae02066 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -226,19 +226,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(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32", NULL, q35_host_get_pci_hole_start, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32", + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32", NULL, q35_host_get_pci_hole_end, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64", + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64", NUL= L, q35_host_get_pci_hole64_start, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64", + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64", NULL, q35_host_get_pci_hole64_end, NULL, NULL, NULL); =20 diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index 0d659e9b02..b8c48bca8a 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -1069,7 +1069,7 @@ 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, + object_class_property_add(klass, name, cap->type, NULL, cap->get, cap->set, NULL, cap); =20 diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 5c2150b71c..a33f0949d1 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -584,9 +584,9 @@ 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(obj, "index", "uint32", NULL, prop_get_index, NULL, NULL, NULL); - object_property_add(obj, "fdt", "struct", prop_get_fdt, + object_property_add(obj, "fdt", "struct", NULL, prop_get_fdt, NULL, NULL, NULL); drc->state =3D drck->empty_state; } diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c index a0498d218f..c4b3cb0b7b 100644 --- a/hw/remote/vfio-user-obj.c +++ b/hw/remote/vfio-user-obj.c @@ -931,7 +931,7 @@ 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, + object_class_property_add(klass, "socket", "SocketAddress", NULL, NULL, vfu_object_set_socket, NULL, NULL); object_class_property_set_description(klass, "socket", "SocketAddress " diff --git a/hw/riscv/microchip_pfsoc.c b/hw/riscv/microchip_pfsoc.c index edd29626fa..04c48a4eda 100644 --- a/hw/riscv/microchip_pfsoc.c +++ b/hw/riscv/microchip_pfsoc.c @@ -744,6 +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", + NULL, microchip_icicle_kit_get_clint_timebase_freq, microchip_icicle_kit_set_clint_timebase_freq, NULL, NULL); diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index de1c92463a..65f4c67bff 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -1184,13 +1184,13 @@ 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", + object_class_property_add(oc, "acpi", "OnOffAuto", NULL, virt_get_acpi, virt_set_acpi, NULL, NULL); object_class_property_set_description(oc, "acpi", "Enable ACPI"); =20 - object_class_property_add(oc, "iommu-sys", "OnOffAuto", + object_class_property_add(oc, "iommu-sys", "OnOffAuto", NULL, virt_get_iommu_sys, virt_set_iommu_sys, NULL, NULL); object_class_property_set_description(oc, "iommu-sys", diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index fda5ecc9ad..7d4392d73f 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -908,7 +908,7 @@ 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", + object_class_property_add(oc, "loadparm", "loadparm", NULL, machine_get_loadparm, machine_set_loadparm, NULL, NULL); object_class_property_set_description(oc, "loadparm", @@ -916,7 +916,7 @@ static void ccw_machine_class_init(ObjectClass *oc, con= st void *data) " to upper case) to pass to machine loader, boot manager," " and guest kernel"); =20 - object_class_property_add(oc, "boot-certs", "BootCertificatesList", + object_class_property_add(oc, "boot-certs", "BootCertificatesList", NU= LL, machine_get_boot_certs, machine_set_boot_cer= ts, NULL, NULL); object_class_property_set_description(oc, "boot-certs", "provide paths to a directory and/or a certificate file for se= cure boot"); diff --git a/hw/s390x/sclpcpi.c b/hw/s390x/sclpcpi.c index ec4bdf2350..90cb36aad6 100644 --- a/hw/s390x/sclpcpi.c +++ b/hw/s390x/sclpcpi.c @@ -195,12 +195,14 @@ 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, + object_class_property_add(klass, "system_level", "uint64", NULL, + 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(klass, "timestamp", "uint64", NULL, + 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 dea30aacfb..1dc19ca914 100644 --- a/hw/s390x/virtio-ccw-mem.c +++ b/hw/s390x/virtio-ccw-mem.c @@ -205,7 +205,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(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", NULL, 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 c65508cba1..14d79d3958 100644 --- a/hw/sensor/adc128d818.c +++ b/hw/sensor/adc128d818.c @@ -642,14 +642,16 @@ 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, + object_property_add(obj, name, "int", NULL, adc128d818_get_ain, adc128d818_set_ain, NULL, NULL); g_free(name); } =20 - object_property_add(obj, "temperature", "int", adc128d818_get_temperat= ure, + object_property_add(obj, "temperature", "int", NULL, + adc128d818_get_temperature, adc128d818_set_temperature, NULL, NULL); - object_property_add(obj, "ext-vref-mv", "int", adc128d818_get_ext_vref, + object_property_add(obj, "ext-vref-mv", "int", NULL, + adc128d818_get_ext_vref, adc128d818_set_ext_vref, NULL, NULL); } =20 diff --git a/hw/sensor/adm1266.c b/hw/sensor/adm1266.c index 37d1cffd57..7927845e32 100644 --- a/hw/sensor/adm1266.c +++ b/hw/sensor/adm1266.c @@ -217,7 +217,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(obj, "vout[*]", "uint16", NULL, adm1266_get, adm1266_set, NULL, &pmdev->pages[i].read_vout); } diff --git a/hw/sensor/adm1272.c b/hw/sensor/adm1272.c index 0aa2a86556..6a7ff02617 100644 --- a/hw/sensor/adm1272.c +++ b/hw/sensor/adm1272.c @@ -493,19 +493,19 @@ static void adm1272_init(Object *obj) =20 pmbus_page_config(pmdev, 0, flags); =20 - object_property_add(obj, "vin", "uint16", + object_property_add(obj, "vin", "uint16", NULL, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_vin); =20 - object_property_add(obj, "vout", "uint16", + object_property_add(obj, "vout", "uint16", NULL, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_vout); =20 - object_property_add(obj, "iout", "uint16", + object_property_add(obj, "iout", "uint16", NULL, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_iout); =20 - object_property_add(obj, "pin", "uint16", + object_property_add(obj, "pin", "uint16", NULL, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_pin); =20 diff --git a/hw/sensor/emc141x.c b/hw/sensor/emc141x.c index a51fc44395..128d721b7b 100644 --- a/hw/sensor/emc141x.c +++ b/hw/sensor/emc141x.c @@ -251,16 +251,16 @@ static void emc141x_reset(DeviceState *dev) =20 static void emc141x_initfn(Object *obj) { - object_property_add(obj, "temperature0", "int", + object_property_add(obj, "temperature0", "int", NULL, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature1", "int", + object_property_add(obj, "temperature1", "int", NULL, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature2", "int", + object_property_add(obj, "temperature2", "int", NULL, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature3", "int", + object_property_add(obj, "temperature3", "int", NULL, 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 0fad04def7..1af0f2af35 100644 --- a/hw/sensor/isl_pmbus_vr.c +++ b/hw/sensor/isl_pmbus_vr.c @@ -136,63 +136,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(obj, "vin[*]", "uint16", NULL, 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(obj, "vout[*]", "uint16", NULL, 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(obj, "iin[*]", "uint16", NULL, 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(obj, "iout[*]", "uint16", NULL, 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(obj, "pin[*]", "uint16", NULL, 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(obj, "pout[*]", "uint16", NULL, 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(obj, "temp1[*]", "uint16", NULL, 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(obj, "temp2[*]", "uint16", NULL, 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(obj, "temp3[*]", "uint16", NULL, 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 cd5773ae64..f362686b69 100644 --- a/hw/sensor/lsm303dlhc_mag.c +++ b/hw/sensor/lsm303dlhc_mag.c @@ -509,21 +509,21 @@ static void lsm303dlhc_mag_reset(DeviceState *dev) */ static void lsm303dlhc_mag_initfn(Object *obj) { - object_property_add(obj, "mag-x", "int", - lsm303dlhc_mag_get_x, - lsm303dlhc_mag_set_x, NULL, NULL); + object_property_add(obj, "mag-x", "int", NULL, + lsm303dlhc_mag_get_x, + lsm303dlhc_mag_set_x, NULL, NULL); =20 - object_property_add(obj, "mag-y", "int", - lsm303dlhc_mag_get_y, - lsm303dlhc_mag_set_y, NULL, NULL); + object_property_add(obj, "mag-y", "int", NULL, + lsm303dlhc_mag_get_y, + lsm303dlhc_mag_set_y, NULL, NULL); =20 - object_property_add(obj, "mag-z", "int", - lsm303dlhc_mag_get_z, - lsm303dlhc_mag_set_z, NULL, NULL); + object_property_add(obj, "mag-z", "int", NULL, + lsm303dlhc_mag_get_z, + lsm303dlhc_mag_set_z, NULL, NULL); =20 - object_property_add(obj, "temperature", "int", - lsm303dlhc_mag_get_temperature, - lsm303dlhc_mag_set_temperature, NULL, NULL); + object_property_add(obj, "temperature", "int", NULL, + lsm303dlhc_mag_get_temperature, + lsm303dlhc_mag_set_temperature, NULL, NULL); } =20 /* diff --git a/hw/sensor/max34451.c b/hw/sensor/max34451.c index 4d64434f3a..6c2f7311ff 100644 --- a/hw/sensor/max34451.c +++ b/hw/sensor/max34451.c @@ -727,7 +727,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(obj, "vout[*]", "uint16", NULL, max34451_get, max34451_set, NULL, &pmdev->pages[i].read_vout= ); } @@ -737,7 +737,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(obj, "temperature[*]", "uint16", NULL, max34451_get, max34451_set, NULL, diff --git a/hw/sensor/tmp105.c b/hw/sensor/tmp105.c index ece0650d70..98f45a49b7 100644 --- a/hw/sensor/tmp105.c +++ b/hw/sensor/tmp105.c @@ -408,7 +408,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(obj, "temperature", "int", NULL, 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 127edd0ba5..8e6823dfcc 100644 --- a/hw/sensor/tmp421.c +++ b/hw/sensor/tmp421.c @@ -350,16 +350,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(klass, "temperature0", "int", NULL, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature1", "int", + object_class_property_add(klass, "temperature1", "int", NULL, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature2", "int", + object_class_property_add(klass, "temperature2", "int", NULL, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature3", "int", + object_class_property_add(klass, "temperature3", "int", NULL, 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 977151c4a0..dfd568da5e 100644 --- a/hw/usb/dev-storage-classic.c +++ b/hw/usb/dev-storage-classic.c @@ -122,7 +122,7 @@ out: =20 static void usb_msd_instance_init(Object *obj) { - object_property_add(obj, "bootindex", "int32", + object_property_add(obj, "bootindex", "int32", NULL, usb_msd_get_bootindex, usb_msd_set_bootindex, NULL, NULL); object_property_set_int(obj, "bootindex", -1, NULL); diff --git a/hw/vfio-user/pci.c b/hw/vfio-user/pci.c index 983e1d4ad4..4c76a3fe5d 100644 --- a/hw/vfio-user/pci.c +++ b/hw/vfio-user/pci.c @@ -471,7 +471,7 @@ 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, + object_class_property_add(klass, "socket", "SocketAddress", NULL, NULL, vfio_user_pci_set_socket, NULL, NULL); object_class_property_set_description(klass, "socket", "SocketAddress (UNIX sockets onl= y)"); diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 07d519cf6d..995b1a41ef 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -1036,10 +1036,10 @@ static void virtio_balloon_instance_init(Object *ob= j) 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(obj, "guest-stats", "guest statistics", NULL, balloon_stats_get_all, NULL, NULL, NULL); =20 - object_property_add(obj, "guest-stats-polling-interval", "int", + object_property_add(obj, "guest-stats-polling-interval", "int", NULL, 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 f592eb1a78..6349337bf4 100644 --- a/hw/virtio/virtio-mem-pci.c +++ b/hw/virtio/virtio-mem-pci.c @@ -211,7 +211,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(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", NULL, 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 7130ed852d..fcfd9fa18a 100644 --- a/hw/virtio/virtio-mem.c +++ b/hw/virtio/virtio-mem.c @@ -1533,12 +1533,13 @@ 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, + object_property_add(obj, VIRTIO_MEM_SIZE_PROP, "size", NULL, + virtio_mem_get_size, NULL, NULL, NULL); - object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", + object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", NULL, virtio_mem_get_requested_size, virtio_mem_set_requested_size, NULL, NULL); - object_property_add(obj, VIRTIO_MEM_BLOCK_SIZE_PROP, "size", + object_property_add(obj, VIRTIO_MEM_BLOCK_SIZE_PROP, "size", NULL, virtio_mem_get_block_size, virtio_mem_set_block_si= ze, NULL, NULL); } diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c index cca37202ff..ddeabe30f2 100644 --- a/hw/xen/xen-pvh-common.c +++ b/hw/xen/xen-pvh-common.c @@ -413,7 +413,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(c, prop_name "-base", "uint64_t", NULL, \ xen_pvh_get_ ## name ## _base, \ xen_pvh_set_ ## name ## _base, NULL, NULL); \ object_class_property_set_description(oc, prop_name "-base", \ @@ -422,7 +422,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(c, prop_name "-size", "uint64_t", NULL, \ xen_pvh_get_ ## name ## _size, \ xen_pvh_set_ ## name ## _size, NULL, NULL); \ object_class_property_set_description(oc, prop_name "-size", \ @@ -458,7 +458,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(oc, "pci-intx-irq-base", "uint32_t", NUL= L, xen_pvh_get_pci_intx_irq_base, xen_pvh_set_pci_intx_irq_base, NULL, NULL); @@ -468,7 +468,7 @@ do { = \ =20 #ifdef CONFIG_TPM if (xpc->has_tpm) { - object_class_property_add(oc, "tpm-base-addr", "uint64_t", + object_class_property_add(oc, "tpm-base-addr", "uint64_t", NULL, xen_pvh_get_tpm_base, xen_pvh_set_tpm_base, NULL, NULL); diff --git a/iothread.c b/iothread.c index 76eea6df38..7084d336a4 100644 --- a/iothread.c +++ b/iothread.c @@ -315,19 +315,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(klass, "poll-max-ns", "int64", NULL, 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(klass, "poll-grow", "int64", NULL, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_grow_info); - object_class_property_add(klass, "poll-shrink", "int64", + object_class_property_add(klass, "poll-shrink", "int64", NULL, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_shrink_info); - object_class_property_add(klass, "poll-weight", "int64", + object_class_property_add(klass, "poll-weight", "int64", NULL, 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 5986fb1e88..7d4a2db522 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -1373,15 +1373,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(obj, "compare_timeout", "uint64", NULL, compare_get_timeout, compare_set_timeout, NULL, NULL); =20 - object_property_add(obj, "expired_scan_cycle", "uint32", + object_property_add(obj, "expired_scan_cycle", "uint32", NULL, compare_get_expired_scan_cycle, compare_set_expired_scan_cycle, NULL, NULL); =20 - object_property_add(obj, "max_queue_size", "uint32", + object_property_add(obj, "max_queue_size", "uint32", NULL, get_max_queue_size, set_max_queue_size, NULL, NULL); =20 diff --git a/net/dump.c b/net/dump.c index 0c39f09892..558115b9c9 100644 --- a/net/dump.c +++ b/net/dump.c @@ -238,7 +238,8 @@ 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, + object_class_property_add(oc, "maxlen", "uint32", NULL, + 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); diff --git a/net/filter-buffer.c b/net/filter-buffer.c index 427da24097..f56b2cfaf0 100644 --- a/net/filter-buffer.c +++ b/net/filter-buffer.c @@ -182,7 +182,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(oc, "interval", "uint32", NULL, filter_buffer_get_interval, filter_buffer_set_interval, NULL, NULL); =20 diff --git a/qom/object.c b/qom/object.c index c34b47312f..0fbd4a7edf 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1340,6 +1340,7 @@ void object_unref(void *objptr) =20 ObjectProperty * object_property_try_add(Object *obj, const char *name, const char *type, + QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release, @@ -1357,8 +1358,8 @@ object_property_try_add(Object *obj, const char *name= , const char *type, for (i =3D 0; i < INT16_MAX; ++i) { char *full_name =3D g_strdup_printf("%s[%d]", name_no_array, i= ); =20 - ret =3D object_property_try_add(obj, full_name, type, get, set, - release, opaque, NULL); + ret =3D object_property_try_add(obj, full_name, type, NULL, + get, set, release, opaque, NULL); g_free(full_name); if (ret) { break; @@ -1379,6 +1380,7 @@ object_property_try_add(Object *obj, const char *name= , const char *type, =20 prop->name =3D g_strdup(name); prop->type =3D g_strdup(type); + prop->qapi_type =3D qapi_type; =20 prop->get =3D get; prop->set =3D set; @@ -1393,12 +1395,13 @@ object_property_try_add(Object *obj, const char *na= me, const char *type, =20 ObjectProperty * object_property_add(Object *obj, const char *name, const char *type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release, void *opaque) { - return object_property_try_add(obj, name, type, get, set, release, + return object_property_try_add(obj, name, type, NULL, get, set, releas= e, opaque, &error_abort); } =20 @@ -1406,6 +1409,7 @@ ObjectProperty * object_class_property_add(ObjectClass *klass, const char *name, const char *type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release, @@ -1420,6 +1424,7 @@ object_class_property_add(ObjectClass *klass, =20 prop->name =3D g_strdup(name); prop->type =3D g_strdup(type); + prop->qapi_type =3D qapi_type; =20 prop->get =3D get; prop->set =3D set; @@ -1947,7 +1952,8 @@ object_property_try_add_child(Object *obj, const char= *name, =20 type =3D g_strdup_printf("child<%s>", object_get_typename(child)); =20 - op =3D object_property_try_add(obj, name, type, object_get_child_prope= rty, + op =3D object_property_try_add(obj, name, type, NULL, + object_get_child_property, NULL, object_finalize_child_property, child, errp); if (!op) { @@ -2141,7 +2147,7 @@ object_add_link_prop(Object *obj, const char *name, =20 full_type =3D g_strdup_printf("link<%s>", type); =20 - op =3D object_property_add(obj, name, full_type, + op =3D object_property_add(obj, name, full_type, NULL, object_get_link_property, check ? object_set_link_property : NULL, object_release_link_property, @@ -2178,7 +2184,7 @@ object_class_property_add_link(ObjectClass *oc, =20 full_type =3D g_strdup_printf("link<%s>", type); =20 - op =3D object_class_property_add(oc, name, full_type, + op =3D object_class_property_add(oc, name, full_type, NULL, object_get_link_property, check ? object_set_link_property : NULL, object_release_link_property, @@ -2438,7 +2444,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(obj, name, "string", NULL, get ? property_get_str : NULL, set ? property_set_str : NULL, property_release_data, @@ -2456,7 +2462,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(klass, name, "string", NULL, get ? property_get_str : NULL, set ? property_set_str : NULL, NULL, @@ -2508,7 +2514,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(obj, name, "bool", NULL, get ? property_get_bool : NULL, set ? property_set_bool : NULL, property_release_data, @@ -2525,7 +2531,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(klass, name, "bool", NULL, get ? property_get_bool : NULL, set ? property_set_bool : NULL, NULL, @@ -2573,7 +2579,7 @@ object_property_add_enum(Object *obj, const char *nam= e, prop->get =3D get; prop->set =3D set; =20 - return object_property_add(obj, name, typename, + return object_property_add(obj, name, typename, NULL, get ? property_get_enum : NULL, set ? property_set_enum : NULL, property_release_data, @@ -2593,7 +2599,7 @@ object_class_property_add_enum(ObjectClass *klass, co= nst char *name, prop->get =3D get; prop->set =3D set; =20 - return object_class_property_add(klass, name, typename, + return object_class_property_add(klass, name, typename, NULL, get ? property_get_enum : NULL, set ? property_set_enum : NULL, NULL, @@ -2651,7 +2657,7 @@ object_property_add_tm(Object *obj, const char *name, =20 prop->get =3D get; =20 - return object_property_add(obj, name, "struct tm", + return object_property_add(obj, name, "struct tm", NULL, get ? property_get_tm : NULL, NULL, property_release_data, prop); @@ -2665,7 +2671,7 @@ object_class_property_add_tm(ObjectClass *klass, cons= t char *name, =20 prop->get =3D get; =20 - return object_class_property_add(klass, name, "struct tm", + return object_class_property_add(klass, name, "struct tm", NULL, get ? property_get_tm : NULL, NULL, NULL, prop); } @@ -2804,7 +2810,7 @@ object_class_property_add_bool_ptr(ObjectClass *klass= , const char *name, setter =3D property_class_set_bool_ptr; } =20 - return object_class_property_add(klass, name, "bool", + return object_class_property_add(klass, name, "bool", NULL, getter, setter, NULL, (void *)offset); } =20 @@ -2824,7 +2830,7 @@ object_property_add_uint8_ptr(Object *obj, const char= *name, setter =3D property_set_uint8_ptr; } =20 - return object_property_add(obj, name, "uint8", + return object_property_add(obj, name, "uint8", NULL, getter, setter, NULL, (void *)v); } =20 @@ -2844,7 +2850,7 @@ object_class_property_add_uint8_ptr(ObjectClass *klas= s, const char *name, setter =3D property_class_set_uint8_ptr; } =20 - return object_class_property_add(klass, name, "uint8", + return object_class_property_add(klass, name, "uint8", NULL, getter, setter, NULL, (void *)offset); } =20 @@ -2865,7 +2871,7 @@ 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", + return object_class_property_add(klass, name, "uint8", NULL, getter, setter, NULL, (void *)v); } =20 @@ -2885,7 +2891,7 @@ 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", + return object_property_add(obj, name, "uint16", NULL, getter, setter, NULL, (void *)v); } =20 @@ -2905,7 +2911,7 @@ object_class_property_add_uint16_ptr(ObjectClass *kla= ss, const char *name, setter =3D property_class_set_uint16_ptr; } =20 - return object_class_property_add(klass, name, "uint16", + return object_class_property_add(klass, name, "uint16", NULL, getter, setter, NULL, (void *)offset); } =20 @@ -2926,7 +2932,7 @@ 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", + return object_class_property_add(klass, name, "uint16", NULL, getter, setter, NULL, (void *)v); } =20 @@ -2946,7 +2952,7 @@ 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", + return object_property_add(obj, name, "uint32", NULL, getter, setter, NULL, (void *)v); } =20 @@ -2966,7 +2972,7 @@ object_class_property_add_uint32_ptr(ObjectClass *kla= ss, const char *name, setter =3D property_class_set_uint32_ptr; } =20 - return object_class_property_add(klass, name, "uint32", + return object_class_property_add(klass, name, "uint32", NULL, getter, setter, NULL, (void *)offset); } =20 @@ -2987,7 +2993,7 @@ 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", + return object_class_property_add(klass, name, "uint32", NULL, getter, setter, NULL, (void *)v); } =20 @@ -3007,7 +3013,7 @@ 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", + return object_property_add(obj, name, "uint64", NULL, getter, setter, NULL, (void *)v); } =20 @@ -3027,7 +3033,7 @@ object_class_property_add_uint64_ptr(ObjectClass *kla= ss, const char *name, setter =3D property_class_set_uint64_ptr; } =20 - return object_class_property_add(klass, name, "uint64", + return object_class_property_add(klass, name, "uint64", NULL, getter, setter, NULL, (void *)offset); } =20 @@ -3048,7 +3054,7 @@ 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", + return object_class_property_add(klass, name, "uint64", NULL, getter, setter, NULL, (void *)v); } =20 @@ -3165,7 +3171,7 @@ object_property_add_alias(Object *obj, const char *na= me, prop->target_name =3D g_strdup(target_name); prop->flags =3D 0; =20 - op =3D object_property_add(obj, name, prop_type, + op =3D object_property_add(obj, name, prop_type, NULL, property_get_alias, property_set_alias, property_release_alias, @@ -3210,7 +3216,7 @@ object_class_property_add_alias(ObjectClass *klass, c= onst char *name, prop->target_name =3D g_strdup(target_name); prop->flags =3D OBJ_PROP_ALIAS_CLASS; =20 - op =3D object_class_property_add(klass, name, prop_type, + op =3D object_class_property_add(klass, name, prop_type, NULL, property_get_alias, property_set_alias, property_release_alias, diff --git a/system/bootdevice.c b/system/bootdevice.c index 9538b08983..4fc6b4c8ed 100644 --- a/system/bootdevice.c +++ b/system/bootdevice.c @@ -336,7 +336,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(obj, name, "int32", NULL, device_get_bootindex, device_set_bootindex, property_release_bootindex, diff --git a/system/memory.c b/system/memory.c index f1910af8a0..ac296cb0d8 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1293,11 +1293,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(OBJECT(mr), "priority", "int32", NULL, memory_region_get_priority, NULL, /* memory_region_set_priority */ NULL, NULL); - object_property_add(OBJECT(mr), "size", "uint64", + object_property_add(OBJECT(mr), "size", "uint64", NULL, memory_region_get_size, NULL, /* memory_region_set_size, */ NULL, NULL); diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index dcd0d698b3..9c869b4488 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -328,7 +328,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(obj, name, "bool", NULL, prop_bool_get_false, prop_bool_set_false, NULL, NULL); } =20 @@ -518,13 +518,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(obj, name, "bool", NULL, cpu_arm_get_vq, 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(obj, "sve-default-vector-length", "int32", NULL, cpu_arm_get_default_vec_len, cpu_arm_set_default_vec_len, NULL, &cpu->sve_default_vq); @@ -543,13 +543,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(obj, name, "bool", NULL, cpu_arm_get_vq, 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(obj, "sme-default-vector-length", "int32", NULL, 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 de09d63d2e..8a698a9d20 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1820,7 +1820,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(oc, "eager-split-size", "size", NULL, 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 c92e331e73..79df821da8 100644 --- a/target/arm/tcg/cpu64.c +++ b/target/arm/tcg/cpu64.c @@ -1392,7 +1392,7 @@ 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", + object_property_add(OBJECT(cpu), "sve-max-vq", "uint32", NULL, cpu_max_get_sve_max_vq, cpu_max_set_sve_max_vq, NULL, NULL); =20 @@ -1529,7 +1529,7 @@ 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, + object_property_add(obj, "x-l0gptsz", "uint32", NULL, cpu_max_get_l0gp= tsz, cpu_max_set_l0gptsz, NULL, NULL); } =20 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index e65eca0459..4514de46ff 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -10484,7 +10484,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(oc, prop_name, "bool", NULL, x86_cpu_get_bit_prop, x86_cpu_set_bit_prop, NULL, fp); @@ -10569,10 +10569,11 @@ 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(obj, "feature-words", "X86CPUFeatureWordInfo", NUL= L, x86_cpu_get_feature_words, NULL, NULL, (void *)env->features); object_property_add(obj, "filtered-features", "X86CPUFeatureWordInfo", + NULL, x86_cpu_get_feature_words, NULL, NULL, (void *)cpu->filtered_features); =20 @@ -11005,13 +11006,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(oc, "family", "uint64", NULL, x86_cpuid_version_get_family, x86_cpuid_version_set_family, NULL, NULL); - object_class_property_add(oc, "model", "uint64", + object_class_property_add(oc, "model", "uint64", NULL, x86_cpuid_version_get_model, x86_cpuid_version_set_model, NULL, NULL); - object_class_property_add(oc, "stepping", "uint64", + object_class_property_add(oc, "stepping", "uint64", NULL, x86_cpuid_version_get_stepping, x86_cpuid_version_set_stepping, NULL, NULL); object_class_property_add_str(oc, "vendor", @@ -11020,7 +11021,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(oc, "tsc-frequency", "int", NULL, x86_cpuid_get_tsc_freq, x86_cpuid_set_tsc_freq, NULL, NULL); /* @@ -11029,17 +11030,18 @@ 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(oc, "unavailable-features", "strList", NULL, x86_cpu_get_unavailable_features, NULL, NULL, NULL); =20 - object_class_property_add(oc, "avx10-version", "uint8", + object_class_property_add(oc, "avx10-version", "uint8", NULL, x86_cpuid_get_avx10_version, x86_cpuid_set_avx10_version, NULL, NULL); =20 #if !defined(CONFIG_USER_ONLY) - object_class_property_add(oc, "crash-information", "GuestPanicInformat= ion", + object_class_property_add(oc, "crash-information", + "GuestPanicInformation", NULL, x86_cpu_get_crash_info_qom, NULL, NULL, NULL= ); #endif =20 diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index da922f72d7..32175604e6 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -7096,7 +7096,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc) object_class_property_set_description(oc, "notify-vmexit", "Enable notify VM exit"); =20 - object_class_property_add(oc, "notify-window", "uint32", + object_class_property_add(oc, "notify-window", "uint32", NULL, kvm_arch_get_notify_window, kvm_arch_set_notify_window, NULL, NULL); @@ -7104,7 +7104,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(oc, "xen-version", "uint32", NULL, kvm_arch_get_xen_version, kvm_arch_set_xen_version, NULL, NULL); @@ -7113,14 +7113,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(oc, "xen-gnttab-max-frames", "uint16", NULL, 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(oc, "xen-evtchn-max-pirq", "uint16", NULL, kvm_arch_get_xen_evtchn_max_pirq, kvm_arch_set_xen_evtchn_max_pirq, NULL, NULL); diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c index 8294dbde3a..f6707abd34 100644 --- a/target/i386/kvm/tdx.c +++ b/target/i386/kvm/tdx.c @@ -1586,7 +1586,7 @@ 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(obj, "quote-generation-socket", "SocketAddress", N= ULL, tdx_guest_get_qgs, tdx_guest_set_qgs, NULL, NULL); diff --git a/target/i386/sev.c b/target/i386/sev.c index 11072b00dc..74a7b719b5 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -3024,7 +3024,7 @@ sev_guest_class_init(ObjectClass *oc, const void *dat= a) 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", + object_class_property_add(oc, "legacy-vm-type", "OnOffAuto", NULL, sev_guest_get_legacy_vm_type, sev_guest_set_legacy_vm_type, NULL, NULL); object_class_property_set_description(oc, "legacy-vm-type", @@ -3056,7 +3056,7 @@ sev_guest_instance_init(Object *obj) sev_guest->policy =3D DEFAULT_GUEST_POLICY; object_property_add_uint32_ptr(obj, "handle", &sev_guest->handle, OBJ_PROP_FLAG_READWRITE); - object_property_add(obj, "policy", "uint32", sev_guest_get_policy, + object_property_add(obj, "policy", "uint32", NULL, sev_guest_get_polic= y, sev_guest_set_policy, NULL, NULL); object_apply_compat_props(obj); =20 @@ -3334,7 +3334,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(oc, "policy", "uint64", NULL, sev_snp_guest_get_policy, sev_snp_guest_set_policy, NULL, NULL); object_class_property_add_str(oc, "guest-visible-workarounds", @@ -3358,7 +3358,7 @@ sev_snp_guest_class_init(ObjectClass *oc, const void = *data) object_class_property_add_bool(oc, "secure-tsc", sev_snp_guest_get_secure_tsc, sev_snp_guest_set_secure_tsc); - object_class_property_add(oc, "tsc-frequency", "uint32", + object_class_property_add(oc, "tsc-frequency", "uint32", NULL, sev_snp_guest_get_tsc_frequency, sev_snp_guest_set_tsc_frequency, NULL, NULL); } diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 113f79afb9..778da68bf4 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -3010,19 +3010,19 @@ static void whpx_set_ssd(Object *obj, Visitor *v, =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_add(oc, "ignore-unknown-msr", "OnOffAuto", NULL, + 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_add(oc, "intercept-msr-gp", "OnOffAuto", NULL, + 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_add(oc, "ssd", "OnOffAuto", NULL, + NULL, whpx_set_ssd, + NULL, NULL); object_class_property_set_description(oc, "ssd", "Separate security domain"); } diff --git a/target/ppc/compat.c b/target/ppc/compat.c index 55de3bd5d5..78f4b23122 100644 --- a/target/ppc/compat.c +++ b/target/ppc/compat.c @@ -335,7 +335,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(obj, name, "string", NULL, 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 5a0529fbda..85b674217e 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1412,20 +1412,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, + object_property_add(obj, "svbare", "bool", NULL, 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(obj, "sv32", "bool", NULL, cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); } else { - object_property_add(obj, "sv39", "bool", cpu_riscv_get_satp, + object_property_add(obj, "sv39", "bool", NULL, cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv48", "bool", cpu_riscv_get_satp, + object_property_add(obj, "sv48", "bool", NULL, cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv57", "bool", cpu_riscv_get_satp, + object_property_add(obj, "sv57", "bool", NULL, cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv64", "bool", cpu_riscv_get_satp, + object_property_add(obj, "sv64", "bool", NULL, cpu_riscv_get_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 5a82a63b82..9bccd59809 100644 --- a/target/riscv/kvm/kvm-cpu.c +++ b/target/riscv/kvm/kvm-cpu.c @@ -541,7 +541,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(obj, prop_name, "bool", NULL, cpu_get_cfg_unavailable, cpu_set_cfg_unavailable, NULL, (void *)prop_name); @@ -561,7 +561,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(cpu_obj, misa_cfg->name, "bool", NULL, kvm_cpu_get_misa_ext_cfg, kvm_cpu_set_misa_ext_cfg, NULL, misa_cfg); @@ -577,7 +577,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(cpu_obj, multi_cfg->name, "bool", NULL, 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 2a7796c382..df73f45829 100644 --- a/target/riscv/tcg/tcg-cpu.c +++ b/target/riscv/tcg/tcg-cpu.c @@ -1478,7 +1478,7 @@ static void riscv_cpu_add_misa_properties(Object *cpu= _obj) continue; } =20 - object_property_add(cpu_obj, name, "bool", + object_property_add(cpu_obj, name, "bool", NULL, cpu_get_misa_ext_cfg, cpu_set_misa_ext_cfg, NULL, (void *)misa_cfg); @@ -1532,7 +1532,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(cpu_obj, profile->name, "bool", NULL, cpu_get_profile, cpu_set_profile, NULL, (void *)profile); =20 @@ -1608,7 +1608,7 @@ static void riscv_cpu_add_user_properties(Object *obj) =20 for (edata =3D isa_edata_arr; edata && edata->name; edata++) { if (edata->prop_name) { - object_property_add(obj, edata->prop_name, "bool", + object_property_add(obj, edata->prop_name, "bool", NULL, cpu_get_multi_ext_cfg, cpu_set_multi_ext_cfg, NULL, (void *)&edata->ext_enable_offset); diff --git a/target/s390x/cpu-system.c b/target/s390x/cpu-system.c index 715ff3ca94..de2f1422e3 100644 --- a/target/s390x/cpu-system.c +++ b/target/s390x/cpu-system.c @@ -138,6 +138,7 @@ void s390_cpu_system_init(Object *obj) =20 cs->start_powered_off =3D true; object_property_add(obj, "crash-information", "GuestPanicInformation", + NULL, s390_cpu_get_crash_info_qom, NULL, NULL, NULL); cpu->env.tod_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_tod_timer, cpu); diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index c30ea2df17..0718df791f 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -792,13 +792,14 @@ 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(oc, def->name, "bool", NULL, 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(oc, def->name, "bool", NULL, + 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 8ea362cbb9..35fb5eca6f 100644 --- a/tests/unit/test-qdev-global-props.c +++ b/tests/unit/test-qdev-global-props.c @@ -171,9 +171,11 @@ static void prop2_accessor(Object *obj, Visitor *v, co= nst char *name, =20 static void dynamic_instance_init(Object *obj) { - object_property_add(obj, "prop1", "uint32", prop1_accessor, prop1_acce= ssor, + object_property_add(obj, "prop1", "uint32", NULL, prop1_accessor, + prop1_accessor, NULL, NULL); - object_property_add(obj, "prop2", "uint32", prop2_accessor, prop2_acce= ssor, + object_property_add(obj, "prop2", "uint32", NULL, prop2_accessor, + prop2_accessor, NULL, NULL); } =20 diff --git a/ui/console.c b/ui/console.c index b735717200..732b4afee0 100644 --- a/ui/console.c +++ b/ui/console.c @@ -535,7 +535,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(oc, "head", "uint32", NULL, qemu_graphic_console_prop_get_head, NULL, NULL, NULL); =20 diff --git a/util/thread-context.c b/util/thread-context.c index 88d8f0a55a..4fe7a6c8f4 100644 --- a/util/thread-context.c +++ b/util/thread-context.c @@ -278,13 +278,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(oc, "thread-id", "uint64", NULL, thread_context_get_thread_id, NULL, NULL, NULL); - object_class_property_add(oc, "cpu-affinity", "[uint16]", + object_class_property_add(oc, "cpu-affinity", "[uint16]", NULL, 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(oc, "node-affinity", "[uint16]", NULL, NULL, thread_context_set_node_affinity, NULL, NULL= ); } =20 --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564560; cv=none; d=zohomail.com; s=zohoarc; b=FxxxYi7hoaH4X7ndcv4MQH8tGUDG/4SV5yOJ9gd2gFXJi3F/PSiDRO6wraJd8QBK1+grzHOkPZ1NL+0Fw32Sx5d9J8zMaJAwrRbrkXAoQEs/Qfk31z2h0IWaE7tNq7EqWkSessLsTqAjgQ70aVVuUCKGRD+zKR3/JZat1Of/aps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564560; h=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=3HT5BIGoS8nHVRiDz3I3Bq8n7Gi547sTZWuTtUMsmx0=; b=dgL2KxRNKXF9M5MzUt/k1qQLitouUtjEbkXWVYkwKlQH1ou0HKM1GgA9PW2UaMYR1TWz94uQnIedwWA0ToYAz50b/9R6REvEe+vu9lq+DPQhN9iyMvlGfUSb9Cq1Ks2kVYeU/Ok0fhsjTkZOoHquXTmd7SYI5iH0yVC2xlGegXI= 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 1793564560101238.73705407847; Sun, 1 Nov 2026 12:22:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNbzr-00051i-M2; Sun, 01 Nov 2026 15:17:43 -0500 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 1xNbzf-0004rQ-TI for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:32 -0500 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 1xNbzc-0007Aa-Qp for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:31 -0500 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-688-BaOlv7z8Phux2OtAlu7tsQ-1; Sun, 01 Nov 2026 15:17:26 -0500 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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EC8A41956056 for ; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 96F561956088 for ; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D4E2B21E6893; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3HT5BIGoS8nHVRiDz3I3Bq8n7Gi547sTZWuTtUMsmx0=; b=A3stDIG8Bp9lVPj4yYsA609WJSbx7IeIVntT3OCf4y/1U0VhZqDEm471lZe2baoXCvkUqF Rjmq2/2SamPv/wu+mlZizvdA2DhMVq7xc6DVx07ct9KUt4p7KlMPEPuDqLylDKXg1kHXA8 cow8xDHIL8iv5QDZoAY7O8SFndJZgTM= X-MC-Unique: BaOlv7z8Phux2OtAlu7tsQ-1 X-Mimecast-MFC-AGG-ID: BaOlv7z8Phux2OtAlu7tsQ_1793564246 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 15/56] qom/object: Move enum property code so it is together Date: Sun, 1 Nov 2026 21:16:36 +0100 Message-ID: <20261101201717.3911097-16-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564561206158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau --- qom/object.c | 76 ++++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/qom/object.c b/qom/object.c index 0fbd4a7edf..9a0966c911 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1770,44 +1770,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) -{ - char *str; - int ret; - ObjectProperty *prop =3D object_property_find_err(obj, name, errp); - EnumProperty *enumprop; - - if (prop =3D=3D NULL) { - return -1; - } - - if (!g_str_equal(prop->type, typename)) { - error_setg(errp, "Property %s on %s is not '%s' enum type", - name, object_class_get_name( - object_get_class(obj)), typename); - return -1; - } - - enumprop =3D prop->opaque; - - str =3D object_property_get_str(obj, name, errp); - if (!str) { - return -1; - } - - ret =3D qapi_enum_parse(enumprop->lookup, str, -1, errp); - g_free(str); - - return ret; -} - bool object_property_parse(Object *obj, const char *name, const char *string, Error **errp) { @@ -2538,6 +2500,12 @@ object_class_property_add_bool(ObjectClass *klass, c= onst char *name, prop); } =20 +typedef struct EnumProperty { + const QEnumLookup *lookup; + int (*get)(Object *, Error **); + void (*set)(Object *, int, Error **); +} EnumProperty; + static void property_get_enum(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { @@ -2606,6 +2574,38 @@ object_class_property_add_enum(ObjectClass *klass, c= onst char *name, prop); } =20 +int object_property_get_enum(Object *obj, const char *name, + const char *typename, Error **errp) +{ + char *str; + int ret; + ObjectProperty *prop =3D object_property_find_err(obj, name, errp); + EnumProperty *enumprop; + + if (prop =3D=3D NULL) { + return -1; + } + + if (!g_str_equal(prop->type, typename)) { + error_setg(errp, "Property %s on %s is not '%s' enum type", + name, object_class_get_name( + object_get_class(obj)), typename); + return -1; + } + + enumprop =3D prop->opaque; + + str =3D object_property_get_str(obj, name, errp); + if (!str) { + return -1; + } + + ret =3D qapi_enum_parse(enumprop->lookup, str, -1, errp); + g_free(str); + + return ret; +} + typedef struct TMProperty { void (*get)(Object *, struct tm *, Error **); } TMProperty; --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564388; cv=none; d=zohomail.com; s=zohoarc; b=kL+6f7croNbO4OAwmA9OnJVtvDniK/qWFiGw0Oxw16y5GhavkrXbJWA0XYW+CDkxkFrmsQBSS3erhYqQYyewlSxRJctWZlHGH04lSuXcLAayAN+CfoBAALdUGJE2paA/GBZ7SBpsEqBePz3N/tzx5nK7F8du/lGUDtYV/04KVvU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564388; h=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=E7Ca6L0OIH9p7Kld2rQUX0hFdwCHdbUHLuj8v7WhKsM=; b=m1et/ICko25Rp5OW3Ii3LzBaQG4ZOlWEm0r52lSeK9nD52XJOuhc4D/mElSPvqVT5GsB6zecmP5kpw4ChlACFmRTiDSJ/pUpJOL84cwxnYmzjlPbryj/PyvWyuLvN3ceDqpHLFv0gHuG2VGCb5jfLoWskt+jIDIaSWMPdwozL6U= 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 1793564388391170.08419382259888; Sun, 1 Nov 2026 12:19:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc02-0005AK-So; Sun, 01 Nov 2026 15:17:55 -0500 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 1xNbzl-0004uv-Nt for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:38 -0500 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 1xNbzd-0007BO-Ss for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:37 -0500 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-26-hDQtQiTEPJi9Q7NO9f9cTQ-1; Sun, 01 Nov 2026 15:17:27 -0500 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 527481800646 for ; Sun, 1 Nov 2026 20:17:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CBADB3000B56 for ; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D98E521E6894; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E7Ca6L0OIH9p7Kld2rQUX0hFdwCHdbUHLuj8v7WhKsM=; b=GZSP7gjMNSLgX/mSutCCT8E2/+O1IAFek1vdCnbDfyFj/5O5P2wq5Xxm9NSR7u6s8qjQMK JFemeh+pZY6ry+YqKrGSGdjQAGD6VRc0/f+A8HaCGh9NpN7CIUe2uM/gXBmp8dDn4DQIpQ WyjsZP4vvMZeHft1n+2afOUPeX7fwhk= X-MC-Unique: hDQtQiTEPJi9Q7NO9f9cTQ-1 X-Mimecast-MFC-AGG-ID: hDQtQiTEPJi9Q7NO9f9cTQ_1793564246 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 16/56] qom: New object_property_add_enum() etc. parameter @qapi_type Date: Sun, 1 Nov 2026 21:16:37 +0100 Message-ID: <20261101201717.3911097-17-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564389931158500 Content-Type: text/plain; charset="utf-8" Callers may either pass a non-null @lookup, or a non-null @qapi_type. For now, all pass a non-null @lookup and a null @qapi_type. Callers updated with this Coccinelle script: @@ identifier fun =3D { object_property_add_enum, object_class_property_add_enum }; expression obj, name, type; @@ - fun(obj, name, type, + fun(obj, name, type, NULL, ...) Future patches will eliminate non-null @lookup and drop the parameter. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau --- include/chardev/char.h | 2 +- include/qom/object.h | 4 ++++ authz/list.c | 3 +-- backends/hostmem.c | 8 ++++---- crypto/secret_common.c | 3 +-- crypto/tlscreds.c | 4 ++-- hw/i386/pc_piix.c | 3 ++- hw/microblaze/petalogix_s3adsp1800_mmu.c | 1 + monitor/qmp.c | 2 +- net/filter.c | 2 +- qom/object.c | 15 +++++++++++---- target/i386/kvm/kvm.c | 3 ++- tests/unit/check-qom-proplist.c | 3 +-- ui/dbus.c | 4 ++-- ui/input-linux.c | 2 +- 15 files changed, 35 insertions(+), 24 deletions(-) diff --git a/include/chardev/char.h b/include/chardev/char.h index 2616c19cc0..5283cc0d5d 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -356,7 +356,7 @@ static inline void chardev_vc_add_encoding_prop(ObjectC= lass *oc, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)) { - object_class_property_add_enum(oc, "encoding", "ChardevVCEncoding", + object_class_property_add_enum(oc, "encoding", "ChardevVCEncoding", NU= LL, &ChardevVCEncoding_lookup, get, set); } =20 diff --git a/include/qom/object.h b/include/qom/object.h index 84b273e535..e9a67017fa 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1987,6 +1987,7 @@ ObjectProperty *object_class_property_add_bool(Object= Class *klass, * @obj: the object to add a property to * @name: the name of the property * @typename: the name of the enum data type + * @qapi_type: QAPI type info descriptor * @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 @@ -1998,6 +1999,7 @@ ObjectProperty *object_class_property_add_bool(Object= Class *klass, */ ObjectProperty *object_property_add_enum(Object *obj, const char *name, const char *typename, + const QAPITypeInfo *qapi_type, const QEnumLookup *lookup, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)); @@ -2007,6 +2009,7 @@ ObjectProperty *object_property_add_enum(Object *obj,= const char *name, * @klass: the object class to add a property to * @name: the name of the property * @typename: the name of the enum data type + * @qapi_type: QAPI type info descriptor * @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 @@ -2019,6 +2022,7 @@ ObjectProperty *object_property_add_enum(Object *obj,= const char *name, ObjectProperty *object_class_property_add_enum(ObjectClass *klass, const char *name, const char *typename, + const QAPITypeInfo *qapi_type, const QEnumLookup *lookup, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)); diff --git a/authz/list.c b/authz/list.c index 72aedc6ac4..40fbccd87e 100644 --- a/authz/list.c +++ b/authz/list.c @@ -120,8 +120,7 @@ qauthz_list_class_init(ObjectClass *oc, const void *dat= a) { QAuthZClass *authz =3D QAUTHZ_CLASS(oc); =20 - object_class_property_add_enum(oc, "policy", - "QAuthZListPolicy", + object_class_property_add_enum(oc, "policy", "QAuthZListPolicy", NULL, &QAuthZListPolicy_lookup, qauthz_list_prop_get_policy, qauthz_list_prop_set_policy); diff --git a/backends/hostmem.c b/backends/hostmem.c index 299a3b90fe..c5882f0b16 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -551,10 +551,10 @@ 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_add_enum(oc, "policy", "HostMemPolicy", NULL, + &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_bool(oc, "share", diff --git a/crypto/secret_common.c b/crypto/secret_common.c index a5ecb876ae..16df64b336 100644 --- a/crypto/secret_common.c +++ b/crypto/secret_common.c @@ -269,8 +269,7 @@ 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", + object_class_property_add_enum(oc, "format", "QCryptoSecretFormat", NU= LL, &QCryptoSecretFormat_lookup, qcrypto_secret_prop_get_format, qcrypto_secret_prop_set_format); diff --git a/crypto/tlscreds.c b/crypto/tlscreds.c index fb09e295a6..db74d302cc 100644 --- a/crypto/tlscreds.c +++ b/crypto/tlscreds.c @@ -221,8 +221,8 @@ qcrypto_tls_creds_class_init(ObjectClass *oc, const voi= d *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", + object_class_property_add_enum(oc, "endpoint", "QCryptoTLSCredsEndpoin= t", + NULL, &QCryptoTLSCredsEndpoint_lookup, qcrypto_tls_creds_prop_get_endpoint, qcrypto_tls_creds_prop_set_endpoint); diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 63c4667ea3..ae07e6c56c 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -413,7 +413,8 @@ 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", + object_class_property_add_enum(oc, "x-south-bridge", + "PCSouthBridgeOption", NULL, &PCSouthBridgeOption_lookup, pc_get_south_bridge, pc_set_south_bridge); diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petal= ogix_s3adsp1800_mmu.c index c5f6431900..8cf7cda7d9 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -175,6 +175,7 @@ static void petalogix_s3adsp1800_machine_class_init(Obj= ectClass *oc, mc->is_default =3D true; =20 prop =3D object_class_property_add_enum(oc, "endianness", "EndianMode", + NULL, &EndianMode_lookup, machine_get_endianness, machine_set_endianness); diff --git a/monitor/qmp.c b/monitor/qmp.c index eb44012643..8d7e49d1ce 100644 --- a/monitor/qmp.c +++ b/monitor/qmp.c @@ -134,7 +134,7 @@ static void monitor_qmp_class_init(ObjectClass *cls, co= nst void *data) monitor_qmp_get_pretty, monitor_qmp_set_pretty); object_class_property_add_enum(cls, "close-action", - "MonitorQMPCloseAction", + "MonitorQMPCloseAction", NULL, &MonitorQMPCloseAction_lookup, monitor_qmp_get_close_action, monitor_qmp_set_close_action); diff --git a/net/filter.c b/net/filter.c index 389f3b0bfe..5311622aca 100644 --- a/net/filter.c +++ b/net/filter.c @@ -342,7 +342,7 @@ static void netfilter_class_init(ObjectClass *oc, const= 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", + object_class_property_add_enum(oc, "queue", "NetFilterDirection", NULL, &NetFilterDirection_lookup, netfilter_get_direction, netfilter_set_= direction); object_class_property_add_str(oc, "status", diff --git a/qom/object.c b/qom/object.c index 9a0966c911..0ef0d4d42c 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2501,6 +2501,7 @@ object_class_property_add_bool(ObjectClass *klass, co= nst char *name, } =20 typedef struct EnumProperty { + const QAPITypeInfo *qapi_type; /* non-null for QAPI enums */ const QEnumLookup *lookup; int (*get)(Object *, Error **); void (*set)(Object *, int, Error **); @@ -2537,17 +2538,20 @@ static void property_set_enum(Object *obj, Visitor = *v, const char *name, ObjectProperty * object_property_add_enum(Object *obj, const char *name, const char *typename, + const QAPITypeInfo *qapi_type, const QEnumLookup *lookup, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)) { EnumProperty *prop =3D g_malloc(sizeof(*prop)); =20 - prop->lookup =3D lookup; + assert(!qapi_type !=3D !lookup); + prop->qapi_type =3D qapi_type; + prop->lookup =3D lookup ?: qapi_type->lookup; prop->get =3D get; prop->set =3D set; =20 - return object_property_add(obj, name, typename, NULL, + return object_property_add(obj, name, typename, qapi_type, get ? property_get_enum : NULL, set ? property_set_enum : NULL, property_release_data, @@ -2557,17 +2561,20 @@ object_property_add_enum(Object *obj, const char *n= ame, ObjectProperty * object_class_property_add_enum(ObjectClass *klass, const char *name, const char *typename, + const QAPITypeInfo *qapi_type, const QEnumLookup *lookup, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)) { EnumProperty *prop =3D g_malloc(sizeof(*prop)); =20 - prop->lookup =3D lookup; + assert(!qapi_type !=3D !lookup); + prop->qapi_type =3D qapi_type; + prop->lookup =3D lookup ?: qapi_type->lookup; prop->get =3D get; prop->set =3D set; =20 - return object_class_property_add(klass, name, typename, NULL, + return object_class_property_add(klass, name, typename, qapi_type, get ? property_get_enum : NULL, set ? property_set_enum : NULL, NULL, diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 32175604e6..abd9aa6241 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -7090,6 +7090,7 @@ static void kvm_arch_set_honor_guest_pat(Object *obj,= int value, Error **errp) void kvm_arch_accel_class_init(ObjectClass *oc) { object_class_property_add_enum(oc, "notify-vmexit", "NotifyVMexitOptio= n", + NULL, &NotifyVmexitOption_lookup, kvm_arch_get_notify_vmexit, kvm_arch_set_notify_vmexit); @@ -7127,7 +7128,7 @@ 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", + object_class_property_add_enum(oc, "honor-guest-pat", "OnOffAuto", NUL= L, &OnOffAuto_lookup, kvm_arch_get_honor_guest_pat, kvm_arch_set_honor_guest_pat); diff --git a/tests/unit/check-qom-proplist.c b/tests/unit/check-qom-proplis= t.c index 89de92b7d9..804d066f28 100644 --- a/tests/unit/check-qom-proplist.c +++ b/tests/unit/check-qom-proplist.c @@ -140,8 +140,7 @@ static void dummy_class_init(ObjectClass *cls, const vo= id *data) object_class_property_add_str(cls, "sv", dummy_get_sv, dummy_set_sv); - object_class_property_add_enum(cls, "av", - "DummyAnimal", + object_class_property_add_enum(cls, "av", "DummyAnimal", NULL, &dummy_animal_map, dummy_get_av, dummy_set_av); diff --git a/ui/dbus.c b/ui/dbus.c index 7be0f8e261..966c2c8b4e 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -508,8 +508,8 @@ dbus_display_class_init(ObjectClass *oc, const void *da= ta) 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, + object_class_property_add_enum(oc, "gl-mode", "DisplayGLMode", NULL, + &DisplayGLMode_lookup, get_gl_mode, set_gl_mode); } =20 diff --git a/ui/input-linux.c b/ui/input-linux.c index f4eee1ffd7..ea4d76e75d 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -506,7 +506,7 @@ static void input_linux_class_init(ObjectClass *oc, con= st 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", + object_class_property_add_enum(oc, "grab-toggle", "GrabToggleKeys", NU= LL, &GrabToggleKeys_lookup, input_linux_get_grab_toggle, input_linux_set_grab_toggle); --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564541; cv=none; d=zohomail.com; s=zohoarc; b=R8kSSDalOxqPm0ChQWRWypY5gCal8p1+XzK1oAYqYkOZwF225n4qjMoMwIgffzVF1oM8nMfuwbDU6BbVEIDhis7a0niekPhi7ZKFkQCGavpTatr2InhYd9jV1LEWcGoyeqICN2rHjwrIhzyiZxgXwv2z4VVqPBOs/arYApnHavk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564541; 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=vNjhBet4yMhVV39knjevH4SHqYj7pufQdSEW6D21yqI=; b=Jm9cH5kPVD6h9mIkQOn5cfWg0cggAOWLHtmlYY7BjQ1rRyZC1EtP5us+vTU3TtzbdjP4sjTci9ALgplDUDrf0p5QraTz9OFuFSwb/YigkDeUr8+UaRosKQTuqej7BP9k7uNRlxT13lECzm2ppAyr8e446ldX7z2rbBImz84EOLI= 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 1793564541521834.8973555147392; Sun, 1 Nov 2026 12:22:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1J-0006XW-9E; Sun, 01 Nov 2026 15:19:13 -0500 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 1xNbzk-0004uW-MY for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:37 -0500 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 1xNbzd-0007BP-T2 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:36 -0500 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-26-SFkJZgGnMgylSjQQao0DqQ-1; Sun, 01 Nov 2026 15:17:27 -0500 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 4DB2D1954AE2 for ; Sun, 1 Nov 2026 20:17:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BD7FA7E1 for ; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id DE25021E6895; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564248; 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=vNjhBet4yMhVV39knjevH4SHqYj7pufQdSEW6D21yqI=; b=I8SBfLXr4QJMvK3eg0d2XVgs83TZbXGK/WGKplb4hk4QE6+3e8C+owAMEetdlwNuiq3AIb DKJsww3XEn15pJmG3TpjR/8YzuWD2bkauL4YJOJ4LyT6RM+nBeReO4x32IXAl0IlgokKKi uadlI2auHKIZVdBzltUFGu5GnW97cac= X-MC-Unique: SFkJZgGnMgylSjQQao0DqQ-1 X-Mimecast-MFC-AGG-ID: SFkJZgGnMgylSjQQao0DqQ_1793564246 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 17/56] tests: update check-qom-proplist for QAPI-aware property registration Date: Sun, 1 Nov 2026 21:16:38 +0100 Message-ID: <20261101201717.3911097-18-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564542932158500 From: Marc-Andr=C3=A9 Lureau 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: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- tests/unit/check-qom-proplist.c | 87 ++++++++++++++++++++++++++++----- 1 file changed, 74 insertions(+), 13 deletions(-) diff --git a/tests/unit/check-qom-proplist.c b/tests/unit/check-qom-proplis= t.c index 804d066f28..246935d714 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,13 +134,25 @@ 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", NULL, - &dummy_animal_map, + object_class_property_add(cls, "sv", "str", + &dummy_str_qapi_type_info, + dummy_get_sv, dummy_set_sv, + NULL, NULL); + object_class_property_add_enum(cls, "av", "DummyAnimal", + &dummy_animal_qapi_type_info, NULL, dummy_get_av, dummy_set_av); } @@ -702,6 +713,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); @@ -726,6 +785,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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564404; cv=none; d=zohomail.com; s=zohoarc; b=Gr3u6KCfZO3hJ81KK4zl4WvNqyWJgFLNxPqK0XJ9WMXUAs/Se9DSNBOdJfhIAi62pQCV8Radyvw9w2ypcwBVT3LAm3JuCWYa49dw/Uun+DAwNsWYLZpq030jsUaNCd8cYTlvrf8j43ouKt4iZhtZLxSEnPuD308h/C7O7G637Ro= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564404; 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=w8kRb99S0l/psFxR+jH598Cu/ICuwN3sx7YUFyW2eCo=; b=PvHIQKjwOEXsQhy87nsroUkjAs19zQQgTB3trF7rWHkICE2HSBMRPbhoDtHeIIBAeuoXj4M6BShEU9SEu9/Mds/kmRilcFRmkRKC42fOPzwPved5lKQ0cpHowgGf0CJyhgoTt3dM+GXW1HgfdMGnHSokCytDrmQHIoSIvmYrKBk= 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 1793564404327735.2632833723281; Sun, 1 Nov 2026 12:20:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc00-00059S-LQ; Sun, 01 Nov 2026 15:17:52 -0500 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 1xNbzk-0004uV-3q for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:37 -0500 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 1xNbzd-0007B4-OV for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:35 -0500 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-685-_4dDcUxtOy6qLtzbmb9-pg-1; Sun, 01 Nov 2026 15:17:27 -0500 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4DF7918005BC for ; Sun, 1 Nov 2026 20:17:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C9DC87E2 for ; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E2FB621E6896; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564248; 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=w8kRb99S0l/psFxR+jH598Cu/ICuwN3sx7YUFyW2eCo=; b=F2d1G/M1lrh3nwxvWWjQfqIeR25GdURa659lYn+C772cKH+g7CUo9ymOMJuIzce5UJ1xRk lURqXqmMK4IDc+9YePtiFAEHx5zIeuTDceqpTTWnEZcZK1v910LjA5XxB/T4Wxl0188b3S iiGtRmgxxynx3RQHXCaR/QR++Ft/dBI= X-MC-Unique: _4dDcUxtOy6qLtzbmb9-pg-1 X-Mimecast-MFC-AGG-ID: _4dDcUxtOy6qLtzbmb9-pg_1793564246 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 18/56] qom: convert QAPI enum properties to QAPI-aware registration Date: Sun, 1 Nov 2026 21:16:39 +0100 Message-ID: <20261101201717.3911097-19-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564406127158500 From: Marc-Andr=C3=A9 Lureau Convert all callers of object_class_property_add_enum() but one to pass QAPITypeInfo instead of QEnumLookup. This enables QMP QOM introspection to report accurate QAPI type names for enum properties in member @qapi-type. Leave pc_i440fx_machine_options() for later, because enum PCSouthBridgeOption is a handmade QAPI-like enum instead of a real one. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- include/chardev/char.h | 6 ++++-- authz/list.c | 6 ++++-- backends/hostmem.c | 5 +++-- crypto/secret_common.c | 5 +++-- crypto/tlscreds.c | 4 ++-- hw/microblaze/petalogix_s3adsp1800_mmu.c | 4 ++-- monitor/qmp.c | 5 +++-- net/filter.c | 5 +++-- target/i386/kvm/kvm.c | 9 +++++---- ui/console-vc.c | 1 + ui/dbus.c | 6 ++++-- ui/input-linux.c | 5 +++-- 12 files changed, 37 insertions(+), 24 deletions(-) diff --git a/include/chardev/char.h b/include/chardev/char.h index 5283cc0d5d..61e6957118 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -1,6 +1,7 @@ #ifndef QEMU_CHAR_H #define QEMU_CHAR_H =20 +#include "qapi/qapi-type-infos-char.h" #include "qapi/qapi-types-char.h" #include "qemu/bitmap.h" #include "qemu/thread.h" @@ -356,8 +357,9 @@ static inline void chardev_vc_add_encoding_prop(ObjectC= lass *oc, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)) { - object_class_property_add_enum(oc, "encoding", "ChardevVCEncoding", NU= LL, - &ChardevVCEncoding_lookup, get, set); + object_class_property_add_enum(oc, "encoding", "ChardevVCEncoding", + &ChardevVCEncoding_type_info, NULL, + get, set); } =20 #endif diff --git a/authz/list.c b/authz/list.c index 40fbccd87e..767e91b3aa 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,8 +121,9 @@ qauthz_list_class_init(ObjectClass *oc, const void *dat= a) { QAuthZClass *authz =3D QAUTHZ_CLASS(oc); =20 - object_class_property_add_enum(oc, "policy", "QAuthZListPolicy", NULL, - &QAuthZListPolicy_lookup, + object_class_property_add_enum(oc, "policy", "QAuthZListPolicy", + &QAuthZListPolicy_type_info, + NULL, qauthz_list_prop_get_policy, qauthz_list_prop_set_policy); =20 diff --git a/backends/hostmem.c b/backends/hostmem.c index c5882f0b16..b43d6ca956 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,8 +552,8 @@ host_memory_backend_class_init(ObjectClass *oc, const v= oid *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", NULL, - &HostMemPolicy_lookup, + object_class_property_add_enum(oc, "policy", "HostMemPolicy", + &HostMemPolicy_type_info, NULL, host_memory_backend_get_policy, host_memory_backend_set_policy); object_class_property_set_description(oc, "policy", diff --git a/crypto/secret_common.c b/crypto/secret_common.c index 16df64b336..8e05f1365e 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,8 +270,8 @@ 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", NU= LL, - &QCryptoSecretFormat_lookup, + object_class_property_add_enum(oc, "format", "QCryptoSecretFormat", + &QCryptoSecretFormat_type_info, NULL, qcrypto_secret_prop_get_format, qcrypto_secret_prop_set_format); object_class_property_add_str(oc, "keyid", diff --git a/crypto/tlscreds.c b/crypto/tlscreds.c index db74d302cc..021e4bf111 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" @@ -222,8 +223,7 @@ qcrypto_tls_creds_class_init(ObjectClass *oc, const voi= d *data) qcrypto_tls_creds_prop_get_dir, qcrypto_tls_creds_prop_set_dir); object_class_property_add_enum(oc, "endpoint", "QCryptoTLSCredsEndpoin= t", - NULL, - &QCryptoTLSCredsEndpoint_lookup, + &QCryptoTLSCredsEndpoint_type_info, NUL= L, qcrypto_tls_creds_prop_get_endpoint, qcrypto_tls_creds_prop_set_endpoint); object_class_property_add_str(oc, "priority", diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petal= ogix_s3adsp1800_mmu.c index 8cf7cda7d9..b52f12924d 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" @@ -175,8 +176,7 @@ static void petalogix_s3adsp1800_machine_class_init(Obj= ectClass *oc, mc->is_default =3D true; =20 prop =3D object_class_property_add_enum(oc, "endianness", "EndianMode", - NULL, - &EndianMode_lookup, + &EndianMode_type_info, NULL, machine_get_endianness, machine_set_endianness); object_property_set_default_str(prop, target_big_endian() ? "big" diff --git a/monitor/qmp.c b/monitor/qmp.c index 8d7e49d1ce..c6341f1a20 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" @@ -134,8 +135,8 @@ static void monitor_qmp_class_init(ObjectClass *cls, co= nst void *data) monitor_qmp_get_pretty, monitor_qmp_set_pretty); object_class_property_add_enum(cls, "close-action", - "MonitorQMPCloseAction", NULL, - &MonitorQMPCloseAction_lookup, + "MonitorQMPCloseAction", + &MonitorQMPCloseAction_type_info, NULL, monitor_qmp_get_close_action, monitor_qmp_set_close_action); =20 diff --git a/net/filter.c b/net/filter.c index 5311622aca..9013d872ea 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,8 +343,8 @@ static void netfilter_class_init(ObjectClass *oc, const= 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", NULL, - &NetFilterDirection_lookup, + object_class_property_add_enum(oc, "queue", "NetFilterDirection", + &NetFilterDirection_type_info, NULL, netfilter_get_direction, netfilter_set_= direction); object_class_property_add_str(oc, "status", netfilter_get_status, netfilter_set_stat= us); diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index abd9aa6241..0f71e75b60 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 @@ -7090,8 +7092,7 @@ static void kvm_arch_set_honor_guest_pat(Object *obj,= int value, Error **errp) void kvm_arch_accel_class_init(ObjectClass *oc) { object_class_property_add_enum(oc, "notify-vmexit", "NotifyVMexitOptio= n", - NULL, - &NotifyVmexitOption_lookup, + &NotifyVmexitOption_type_info, NULL, kvm_arch_get_notify_vmexit, kvm_arch_set_notify_vmexit); object_class_property_set_description(oc, "notify-vmexit", @@ -7128,8 +7129,8 @@ 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", NUL= L, - &OnOffAuto_lookup, + object_class_property_add_enum(oc, "honor-guest-pat", "OnOffAuto", + &OnOffAuto_type_info, NULL, kvm_arch_get_honor_guest_pat, kvm_arch_set_honor_guest_pat); object_class_property_set_description(oc, "honor-guest-pat", diff --git a/ui/console-vc.c b/ui/console-vc.c index 99cc8f09c8..ac8c6bf101 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" diff --git a/ui/dbus.c b/ui/dbus.c index 966c2c8b4e..9c21204771 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,8 +510,8 @@ dbus_display_class_init(ObjectClass *oc, const void *da= ta) 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", NULL, - &DisplayGLMode_lookup, + object_class_property_add_enum(oc, "gl-mode", "DisplayGLMode", + &DisplayGLMode_type_info, NULL, get_gl_mode, set_gl_mode); } =20 diff --git a/ui/input-linux.c b/ui/input-linux.c index ea4d76e75d..127be74450 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,8 +507,8 @@ static void input_linux_class_init(ObjectClass *oc, con= st 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", NU= LL, - &GrabToggleKeys_lookup, + object_class_property_add_enum(oc, "grab-toggle", "GrabToggleKeys", + &GrabToggleKeys_type_info, NULL, input_linux_get_grab_toggle, input_linux_set_grab_toggle); } --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564354; cv=none; d=zohomail.com; s=zohoarc; b=b0xZB+BssA875zx6LiIBE0rMRJiTwjfVOCXdIHArtMY9uL39l9A5EUW4RFt08REMdlDAG/DULdZTYvISBkv1kRLAOwgFi70QrkjG5a3695GNrG+c6+z4uSWDcjvdG5WpEaGK9i7jS7t/9R3tgTkPj+62nvdhce24YRqVTuUq7Ic= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564354; 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=Xy664nPxtZ9gQ5sr5qdJaC2vdj8MuIaenR+/vOnZLWs=; b=MbOrAZVMOAmbtqDVbNzW0AY4Km9owpIVpmilJFWJuz3dIuJ7eS35yTM7gPO7qqEUMAXsmwVJWm8I2XJEIl7ZIKSmGAJNvds/ftKVb4XZvPG9L3Htqn5PE2/m5nnD7t2bHBKeNJQv415rFRLofEymo4/J1Y9h38fPeiRA+Z5IKIc= 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 1793564354801913.6961622685541; Sun, 1 Nov 2026 12:19:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNbzp-0004zb-IZ; Sun, 01 Nov 2026 15:17:41 -0500 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 1xNbzi-0004tD-MZ for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:34 -0500 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 1xNbzd-0007Ai-30 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:33 -0500 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-688-xokVOfZ1PqOkoNLgpQs4Yw-1; Sun, 01 Nov 2026 15:17:27 -0500 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 3622A18005BF for ; Sun, 1 Nov 2026 20:17:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A663430002CB for ; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E788021E6897; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564248; 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=Xy664nPxtZ9gQ5sr5qdJaC2vdj8MuIaenR+/vOnZLWs=; b=eVEx/MqDcDjOOMBINbJNhmdeG08Iz0GRUfEROF2C4kMYu0GXwpH94sHM4ZUhJcLn9JTR5I fPZ4eTcSfrs5mNiYcmnScAHn2cHkl86rWCUf24HhEUdXXxUFcwIEC0RWsTnOGlDDa+qRpd d/UbSMo/X71Ffwcb4pRsWsnsV3FApkc= X-MC-Unique: xokVOfZ1PqOkoNLgpQs4Yw-1 X-Mimecast-MFC-AGG-ID: xokVOfZ1PqOkoNLgpQs4Yw_1793564246 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 19/56] qom: convert struct properties to QAPI-aware registration Date: Sun, 1 Nov 2026 21:16:40 +0100 Message-ID: <20261101201717.3911097-20-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564355194158500 From: Marc-Andr=C3=A9 Lureau Convert all callers of object_property_add() and object_class_property_add() that register struct-typed properties with QAPI visitor-based getters/setters to pass QAPITypeInfo. This enables QMP QOM introspection to report accurate QAPI type information for struct properties in member @qapi-type. Existing getters/setters are preserved unchanged. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- authz/list.c | 3 ++- block/throttle-groups.c | 4 +++- chardev/char-socket.c | 4 +++- hw/core/machine.c | 12 ++++++++---- hw/cxl/cxl-host.c | 4 +++- hw/remote/vfio-user-obj.c | 6 ++++-- hw/vfio-user/pci.c | 4 +++- target/i386/cpu.c | 10 +++++++--- target/i386/kvm/tdx.c | 10 ++++++---- target/s390x/cpu-system.c | 3 ++- 10 files changed, 41 insertions(+), 19 deletions(-) diff --git a/authz/list.c b/authz/list.c index 767e91b3aa..75155cf077 100644 --- a/authz/list.c +++ b/authz/list.c @@ -127,7 +127,8 @@ qauthz_list_class_init(ObjectClass *oc, const void *dat= a) qauthz_list_prop_get_policy, qauthz_list_prop_set_policy); =20 - object_class_property_add(oc, "rules", "QAuthZListRule", NULL, + object_class_property_add(oc, "rules", "QAuthZListRule", + &QAuthZListRuleList_type_info, 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 cfe2ea67e3..5d6b089092 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" @@ -991,7 +992,8 @@ static void throttle_group_obj_class_init(ObjectClass *= klass, } =20 /* ThrottleLimits */ - object_class_property_add(klass, "limits", "ThrottleLimits", NULL, + object_class_property_add(klass, "limits", "ThrottleLimits", + &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 6ce9c2a50b..d62a057e8c 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,8 @@ 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", NULL, + object_class_property_add(oc, "addr", "SocketAddress", + &SocketAddress_type_info, char_socket_get_addr, NULL, NULL, NULL); =20 diff --git a/hw/core/machine.c b/hw/core/machine.c index 50422750be..bc03a62883 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,20 +1119,22 @@ 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", NULL, + object_class_property_add(oc, "boot", "BootConfiguration", + &BootConfiguration_type_info, 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", NULL, + object_class_property_add(oc, "smp", "SMPConfiguration", + &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", - NULL, + &SmpCachePropertiesWrapper_type_info, machine_get_smp_cache, machine_set_smp_cache, NULL, NULL); object_class_property_set_description(oc, "smp-cache", @@ -1215,7 +1218,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", NUL= L, + object_class_property_add(oc, "memory", "MemorySizeConfiguration", + &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 2ddff574d1..ef7f766847 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", NULL, + object_property_add(obj, "cxl-fmw", "CXLFixedMemoryWindow", + &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 c4b3cb0b7b..205582a91f 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,9 @@ 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, NULL, - vfu_object_set_socket, NULL, NULL); + object_class_property_add(klass, "socket", "SocketAddress", + &SocketAddress_type_info, + 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 4c76a3fe5d..c749ff149f 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,7 +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, NULL, + object_class_property_add(klass, "socket", "SocketAddress", + &SocketAddress_type_info, NULL, vfio_user_pci_set_socket, NULL, NULL); object_class_property_set_description(klass, "socket", "SocketAddress (UNIX sockets onl= y)"); diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 4514de46ff..6a05a7144a 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" @@ -10569,11 +10571,12 @@ static void x86_cpu_initfn(Object *obj) =20 x86_cpu_init_default_topo(cpu); =20 - object_property_add(obj, "feature-words", "X86CPUFeatureWordInfo", NUL= L, + object_property_add(obj, "feature-words", "X86CPUFeatureWordInfo", + &X86CPUFeatureWordInfoList_type_info, x86_cpu_get_feature_words, NULL, NULL, (void *)env->features); object_property_add(obj, "filtered-features", "X86CPUFeatureWordInfo", - NULL, + &X86CPUFeatureWordInfo_type_info, x86_cpu_get_feature_words, NULL, NULL, (void *)cpu->filtered_features); =20 @@ -11041,7 +11044,8 @@ static void x86_cpu_common_class_init(ObjectClass *= oc, const void *data) =20 #if !defined(CONFIG_USER_ONLY) object_class_property_add(oc, "crash-information", - "GuestPanicInformation", NULL, + "GuestPanicInformation", + &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 f6707abd34..52bb2ec6ce 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,10 +1587,11 @@ static void tdx_guest_init(Object *obj) tdx_guest_get_mrownerconfig, tdx_guest_set_mrownerconfig); =20 - object_property_add(obj, "quote-generation-socket", "SocketAddress", N= ULL, - tdx_guest_get_qgs, - tdx_guest_set_qgs, - NULL, NULL); + object_property_add(obj, "quote-generation-socket", "SocketAddress", + &SocketAddress_type_info, + tdx_guest_get_qgs, + tdx_guest_set_qgs, + NULL, NULL); =20 tdx->event_notify_vector =3D -1; tdx->event_notify_apicid =3D -1; diff --git a/target/s390x/cpu-system.c b/target/s390x/cpu-system.c index de2f1422e3..5b5406b947 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 @@ -138,7 +139,7 @@ void s390_cpu_system_init(Object *obj) =20 cs->start_powered_off =3D true; object_property_add(obj, "crash-information", "GuestPanicInformation", - NULL, + &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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564407; cv=none; d=zohomail.com; s=zohoarc; b=GTiO79T8ssFU3HqW71cLpnyuFzvOtEX+WH6ILBtA22XPM7i3Dws4BNS0igs3QUTwVgs4h23favmdlg+imjEz1AZy2vJppHgRTz5++sVOYJdtSb8yC5efBNAAmL0ZGB9ZSZaPmUL48B/BSouhi2GaeXByaVKirpdHpWL45PaSvSs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564407; 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=9Ye8Vqw7ZABF63+yTTHX2yboLgVofgzBaL3iuZaloCM=; b=NL7m0JOu4SBXbHMTc/N8nUcCkbhP+hUwBHa/VvOIcPxlW+o9bqSsRuT3QX9PB358u74Z5001FMpWcrj0BFDMhcSpSjsMd968okKuHuoGTO+KK9wh1tWJnJ4NqKA8a00K3pCPF9mM/Pgal7vloDl5neHYylkdTdd1hBHKL7Z4A3E= 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 17935644073401004.2763180845525; Sun, 1 Nov 2026 12:20:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNbzl-0004uU-Dd; Sun, 01 Nov 2026 15:17:37 -0500 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 1xNbzi-0004tB-Lo for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:34 -0500 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 1xNbzd-0007Av-H1 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:33 -0500 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-688-6SLNW9WMOPCiVa89q-cxyw-1; Sun, 01 Nov 2026 15:17:27 -0500 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 426071800612 for ; Sun, 1 Nov 2026 20:17:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BD13218004D2 for ; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id EC22421E6898; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564248; 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=9Ye8Vqw7ZABF63+yTTHX2yboLgVofgzBaL3iuZaloCM=; b=gCiqlL913ATsjTFfB16aU3Ajr9wojogM8l4OUDw63g7Y6uyLffg15mhRr1IsWZ1sBn5qIW dj5vqYnf3BOPojjvQRZeVP7IO1eu4Tj3dc/8CW6dn+pPXdNaJRSFPFF/OiFA37yinAxm+5 rBRSJFE/wWeGrNf8sL7RPfqHYyFwt58= X-MC-Unique: 6SLNW9WMOPCiVa89q-cxyw-1 X-Mimecast-MFC-AGG-ID: 6SLNW9WMOPCiVa89q-cxyw_1793564246 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 20/56] x86: convert OnOffAuto properties to QAPI-aware registration Date: Sun, 1 Nov 2026 21:16:41 +0100 Message-ID: <20261101201717.3911097-21-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564408160158500 From: Marc-Andr=C3=A9 Lureau Convert the smm, acpi, pit, and pic OnOffAuto properties from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- hw/i386/x86.c | 84 ++++++++++++++++++++------------------------------- 1 file changed, 33 insertions(+), 51 deletions(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 1b7740a97e..3416df13ab 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,29 +371,31 @@ 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", NULL, - x86_machine_get_smm, x86_machine_set_smm, - NULL, NULL); + object_class_property_add_enum(oc, X86_MACHINE_SMM, "OnOffAuto", + &OnOffAuto_type_info, NULL, + x86_machine_get_smm, + x86_machine_set_smm); object_class_property_set_description(oc, X86_MACHINE_SMM, "Enable SMM"); =20 - object_class_property_add(oc, X86_MACHINE_ACPI, "OnOffAuto", NULL, - x86_machine_get_acpi, x86_machine_set_acpi, - NULL, NULL); + object_class_property_add_enum(oc, X86_MACHINE_ACPI, "OnOffAuto", + &OnOffAuto_type_info, NULL, + x86_machine_get_acpi, + x86_machine_set_acpi); object_class_property_set_description(oc, X86_MACHINE_ACPI, "Enable ACPI"); =20 - object_class_property_add(oc, X86_MACHINE_PIT, "OnOffAuto", NULL, - x86_machine_get_pit, - x86_machine_set_pit, - NULL, NULL); + object_class_property_add_enum(oc, X86_MACHINE_PIT, "OnOffAuto", + &OnOffAuto_type_info, NULL, + x86_machine_get_pit, + x86_machine_set_pit); object_class_property_set_description(oc, X86_MACHINE_PIT, "Enable i8254 PIT"); =20 - object_class_property_add(oc, X86_MACHINE_PIC, "OnOffAuto", NULL, - x86_machine_get_pic, - x86_machine_set_pic, - NULL, NULL); + object_class_property_add_enum(oc, X86_MACHINE_PIC, "OnOffAuto", + &OnOffAuto_type_info, NULL, + x86_machine_get_pic, + x86_machine_set_pic); object_class_property_set_description(oc, X86_MACHINE_PIC, "Enable i8259 PIC"); =20 --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564586; cv=none; d=zohomail.com; s=zohoarc; b=HgWgWodGHRagpx7IppXpoAPHTLf737QDPbg/a9BA5No0atjYAFWhu/EkL9t2KV9LxUeBWwesSziJ/qwNbA3oAQrF/aqdF2RiQau010+brXbnF+tC2n1YplAlaE7ouqxgdGzNbWfb0XmT++SAE+b7XCV0nIv5c3HjhOsKPDn+83k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564586; 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=8y3cTOIOuMt4gbMFKfbq1Dwyo9CGBgjne1LlrL2/KRE=; b=gcElsMaVDWg4M2/7/NeoWJzaZUDtmLQaYhBr7Ir2cVHqTtSNQN/MW63URbwoCowD1yShSV5W+D48PFP1HAUqXtwzXHYop9/zqWyOJCre0C3GH5Th84sxK7DJr+UnPptUTQEOoJ8WJ9Bg7XAl5g39n9MHSL1a7PwOGoEuxE4C1ks= 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 1793564586552283.5548454905338; Sun, 1 Nov 2026 12:23:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc2K-0002Ii-43; Sun, 01 Nov 2026 15:20:16 -0500 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 1xNbzm-0004wU-DY for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:38 -0500 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 1xNbze-0007BM-12 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:38 -0500 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-464-lia6kvNFPD67sqdhhq_u1w-1; Sun, 01 Nov 2026 15:17:27 -0500 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 568D61955F00 for ; Sun, 1 Nov 2026 20:17:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AF7DA1800444 for ; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id F0CB021E6899; Sun, 01 Nov 2026 21:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564248; 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=8y3cTOIOuMt4gbMFKfbq1Dwyo9CGBgjne1LlrL2/KRE=; b=X+qa127fklK3JjG8iLhuf6CEXfhWa9B4fsL98Bme6ptg47yDFZZa5pGDa9PZiOP49o3hDF IE+g+PCcB5sMuAYwBdWuANBTEz+6dOtnXtBcBihkIQNYz1R4l+kV+qOipalCIL9MP+I1GP GiQAxO6RU96SH3wKTwvDKT+tUJMu/HU= X-MC-Unique: lia6kvNFPD67sqdhhq_u1w-1 X-Mimecast-MFC-AGG-ID: lia6kvNFPD67sqdhhq_u1w_1793564246 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 21/56] microvm: convert OnOffAuto properties to QAPI-aware registration Date: Sun, 1 Nov 2026 21:16:42 +0100 Message-ID: <20261101201717.3911097-22-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564587816158500 From: Marc-Andr=C3=A9 Lureau Convert the rtc, pcie, and ioapic2 OnOffAuto properties from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- hw/i386/microvm.c | 68 +++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 40 deletions(-) diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index c679b3b177..7f010cb2f2 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,24 +658,27 @@ 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", NULL, - microvm_machine_get_rtc, - microvm_machine_set_rtc, - NULL, NULL); + object_class_property_add_enum(oc, MICROVM_MACHINE_RTC, + "OnOffAuto", + &OnOffAuto_type_info, NULL, + microvm_machine_get_rtc, + microvm_machine_set_rtc); object_class_property_set_description(oc, MICROVM_MACHINE_RTC, "Enable MC146818 RTC"); =20 - object_class_property_add(oc, MICROVM_MACHINE_PCIE, "OnOffAuto", NULL, - microvm_machine_get_pcie, - microvm_machine_set_pcie, - NULL, NULL); + object_class_property_add_enum(oc, MICROVM_MACHINE_PCIE, + "OnOffAuto", + &OnOffAuto_type_info, NULL, + microvm_machine_get_pcie, + microvm_machine_set_pcie); object_class_property_set_description(oc, MICROVM_MACHINE_PCIE, "Enable PCIe"); =20 - object_class_property_add(oc, MICROVM_MACHINE_IOAPIC2, "OnOffAuto", NU= LL, - microvm_machine_get_ioapic2, - microvm_machine_set_ioapic2, - NULL, NULL); + object_class_property_add_enum(oc, MICROVM_MACHINE_IOAPIC2, + "OnOffAuto", + &OnOffAuto_type_info, NULL, + microvm_machine_get_ioapic2, + microvm_machine_set_ioapic2); object_class_property_set_description(oc, MICROVM_MACHINE_IOAPIC2, "Enable second IO-APIC"); =20 --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564406; cv=none; d=zohomail.com; s=zohoarc; b=bil5dUWpzKjqM6Ofo4j9/wbHjuePwr9I5fBhDLVeZitOWfOb+Pa6kClDDzkRPx4pT6+5k+hyPQ7HecvExRX1hp75PNOPub6LPOcRvpn0pJMVVxQpn1T3DxQBbDp0965EePbcVD92S6xlWawXHOogvT6M6iLHT+DkCXmmQ8fXjIc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564406; 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=5RBSl5fkD/mbeX6aAczbUd3DDxgneNeikka007B8VZE=; b=hSSX7VuO3I2zHbKwqz/nW9XgPVUv9gKyJTQLKMW2kLox2Jk1RGCQL/P+AuA2+0r80z3TxGE5T+F1QqF/n2lqaPz1du+tC+oMUdyS6Q+s7hnsWlkSCZrh/QGlCI7VZi7SdqxHbVP0/b45nxzw3DG5WEHMCw1d32u03ZlbbZJz/J0= 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 179356440642927.161530069918967; Sun, 1 Nov 2026 12:20:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNbzu-00055i-5q; Sun, 01 Nov 2026 15:17:46 -0500 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 1xNbzf-0004rP-SP for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:32 -0500 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 1xNbzc-0007AX-Qn for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:31 -0500 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-685-_r1WV2qTPsOrdl8K-Gt3oQ-1; Sun, 01 Nov 2026 15:17:26 -0500 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 0D8271955F6F for ; Sun, 1 Nov 2026 20:17:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C1F2C180057F for ; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0171521E689A; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564248; 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=5RBSl5fkD/mbeX6aAczbUd3DDxgneNeikka007B8VZE=; b=Utkw8/1wNpSjUuufEoP5VvCoDK7UUGK4dkqh90xJiT7Xg17XhFWggl1y2pRFhpG3ARcsNd 1zjCXxjY6IkVVOYp3CjY5/CleiCjuhnF3gYLrIec61Jyy4pCf1qh3fMwva6I3Io9LlMu7z 5VJcEHzKKmT5Jo6pxr2U9mAR98r2hj0= X-MC-Unique: _r1WV2qTPsOrdl8K-Gt3oQ-1 X-Mimecast-MFC-AGG-ID: _r1WV2qTPsOrdl8K-Gt3oQ_1793564246 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 22/56] pc: convert OnOffAuto vmport property to QAPI-aware registration Date: Sun, 1 Nov 2026 21:16:43 +0100 Message-ID: <20261101201717.3911097-23-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564408188158500 From: Marc-Andr=C3=A9 Lureau Convert the vmport OnOffAuto property from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- hw/i386/pc.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 1fce96f5ec..649ae27156 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) @@ -1729,9 +1725,11 @@ static void pc_machine_class_init(ObjectClass *oc, c= onst 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", NULL, - pc_machine_get_vmport, pc_machine_set_vmport, - NULL, NULL); + object_class_property_add_enum(oc, PC_MACHINE_VMPORT, + "OnOffAuto", + &OnOffAuto_type_info, NULL, + pc_machine_get_vmport, + pc_machine_set_vmport); object_class_property_set_description(oc, PC_MACHINE_VMPORT, "Enable vmport (pc & q35)"); =20 --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564301; cv=none; d=zohomail.com; s=zohoarc; b=VjGuQpmw4P1CtMk3IenD0cg0igqNYIL2DdFoqRCVMU8xHYNIS9tVFN+ruGQY8NruDe5HDRAYEfRLltJAbcQRBdeAGZEl+PHdyNgZn5YJ99r84bP3C2YylUZYVdm1YxyuCsiWDGpcJuV3RD4dvftAB/HJJccYlnjONlygwJIrSak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564301; 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=xPfCcr5X1+t3iQ3gWBSYBGFDsjGK2kywWp2YDeXT+SQ=; b=ilyxTVB8YJQkcMhgjCr7ZaY72350sFeKRevF8HQEZ7yFqxr1+7IM316KGIzQity+SjMszzkJogjM3LdCr5xEap7BP3Nci/TyQCUAzVXcja+U4FIDn6N0uIQy99nelgazOVZ6DWTuyMD8glLzdVFLWttMqflkDN1rCz0MqE7UBuI= 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 1793564301584622.7210587365281; Sun, 1 Nov 2026 12:18:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNbzn-0004xQ-Ap; Sun, 01 Nov 2026 15:17:39 -0500 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 1xNbzh-0004rc-02 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:34 -0500 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 1xNbzd-0007Ac-5U for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:32 -0500 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-685-byOK4XEHOlmA5fcx9J9W0A-1; Sun, 01 Nov 2026 15:17:26 -0500 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 1D6BD195606B for ; Sun, 1 Nov 2026 20:17:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D06B73000B78 for ; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0636721E689B; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564248; 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=xPfCcr5X1+t3iQ3gWBSYBGFDsjGK2kywWp2YDeXT+SQ=; b=jQeKKjiBxY3RStSu6M7Ckr7WUKTfVTWfZVsGdowX0xMrY8QU+YndhIuMiyZeMOqnCTKcuE XbBZIKoS+Ed3rC7FTcLQNPbitHYxn2W96itqCyQFCzgD8WyfM2/WHOyby9umbe6F+BCshC FAblFbrRDFQlurPHUBH9HfClTOCW6cQ= X-MC-Unique: byOK4XEHOlmA5fcx9J9W0A-1 X-Mimecast-MFC-AGG-ID: byOK4XEHOlmA5fcx9J9W0A_1793564246 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 23/56] arm/virt: convert OnOffAuto acpi property to QAPI-aware registration Date: Sun, 1 Nov 2026 21:16:44 +0100 Message-ID: <20261101201717.3911097-24-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564304187158500 From: Marc-Andr=C3=A9 Lureau Convert the acpi OnOffAuto property from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- hw/arm/virt.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index dad3f8c39b..e39d77eba6 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -72,7 +72,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" @@ -3564,21 +3564,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) @@ -4206,9 +4201,9 @@ 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", NULL, - virt_get_acpi, virt_set_acpi, - NULL, NULL); + object_class_property_add_enum(oc, "acpi", "OnOffAuto", + &OnOffAuto_type_info, NULL, + virt_get_acpi, virt_set_acpi); object_class_property_set_description(oc, "acpi", "Enable ACPI"); object_class_property_add_bool(oc, "secure", virt_get_secure, --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564467; cv=none; d=zohomail.com; s=zohoarc; b=eVGSk8Z0HkDlsibzEV7zJrOnSzk9mDlsOr9WuGmuAuQGW5TlGzYDO18KWPwfxYzxYg+FZYYhL6ew9iIblQgFZ88Id4XWeTcJJMlg3LQoqA591Oqszl8LX29uV46d0sLM95oFZ+igHUG4xBAWu3hhYnUR4JbUc1dW9BfHfDGZLAw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564467; 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=tvV5cI3E2ha6ruHv165a0fCyfphNnmtO2pq8RN/esRE=; b=G4sxPUdp6v/9k6LaPBQkUqYrDscr3kVTJbLz8C8WSYc4ygdxLp/MJQJceK2kUT1vOstEYckpuDDkMuD9uJJ0G7OLO0ZOcV1EnX2lzKSrTl1JbTpI5vZ5GVoc01vOxjLA5jTqicTbqKlDHuQj4ToQqMl27waw7W1vpQhDQRSkFg4= 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 1793564467418207.4133916756797; Sun, 1 Nov 2026 12:21:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1H-0006La-0X; Sun, 01 Nov 2026 15:19:11 -0500 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 1xNbzg-0004ra-PF for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:33 -0500 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 1xNbzd-0007AV-32 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:32 -0500 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-257-8dV_e344NZSQEOk1rLs9Kg-1; Sun, 01 Nov 2026 15:17:26 -0500 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 DBEFF1955F6E; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 96F1718004D2; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0AD0E21E689C; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564248; 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=tvV5cI3E2ha6ruHv165a0fCyfphNnmtO2pq8RN/esRE=; b=doiveBNMaDuQDFmTH0crUzaU5lC3o1vwmglC9zjfLwbROi23EY9b9YO5A9cHqesmY9ZvnR a3EuaeIppyxXvzd4x8keP9y/XxGl7UgytZ6pCQdxepNqVxxXmkBUHDVyu5zjjNQxys6X1o gdL2XE1pog8RCGeV7ZrM9wraPrNQH9w= X-MC-Unique: 8dV_e344NZSQEOk1rLs9Kg-1 X-Mimecast-MFC-AGG-ID: 8dV_e344NZSQEOk1rLs9Kg_1793564246 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com, Alistair Francis Subject: [PATCH v8 24/56] riscv/virt: convert OnOffAuto properties to QAPI-aware registration Date: Sun, 1 Nov 2026 21:16:45 +0100 Message-ID: <20261101201717.3911097-25-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564469480158500 From: Marc-Andr=C3=A9 Lureau Convert the acpi and iommu-sys OnOffAuto properties from manual visitor-based callbacks to object_class_property_add_enum(). Acked-by: Alistair Francis Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- hw/riscv/virt.c | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 65f4c67bff..31fecdc964 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -58,7 +58,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 @@ -1055,38 +1055,28 @@ 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 -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 * @@ -1184,15 +1174,15 @@ 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", NULL, - virt_get_acpi, virt_set_acpi, - NULL, NULL); + object_class_property_add_enum(oc, "acpi", "OnOffAuto", + &OnOffAuto_type_info, NULL, + virt_get_acpi, virt_set_acpi); object_class_property_set_description(oc, "acpi", "Enable ACPI"); =20 - object_class_property_add(oc, "iommu-sys", "OnOffAuto", NULL, - virt_get_iommu_sys, virt_set_iommu_sys, - NULL, NULL); + object_class_property_add_enum(oc, "iommu-sys", "OnOffAuto", + &OnOffAuto_type_info, NULL, + virt_get_iommu_sys, virt_set_iommu_sys); object_class_property_set_description(oc, "iommu-sys", "Enable IOMMU platform device"); } --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564401; cv=none; d=zohomail.com; s=zohoarc; b=WFNpPsLDGpuSCPL2iZpf7Xx9szV+qF9wICk6UR9EpnOMSMyN7MzEZEPXjTJe8olw/VrYp+iCJFO/OLhEMokmxX8ImTMG1TQIK1PXZICnRGG7g/1HW14bUoJGIHkPkEFuk9XC06uW0QtMRxeyhpxYQAh0lA6y448PzQb29Oww29U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564401; 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=mPo/hvO1y+Xu9A/MVbm7qpcfj5Zmu4tFNhSTGOCCeTg=; b=mECKCYWXEKpCeww6yqoVBwI+OYVn/9tHSTOf+kzx/rivnX2x/rxwJPsfN/MfJNMBzO8LYz5jJoTws9zTWHg9KwNqqOWucyK4JkoLTj0eF8EH5PStWYtSxhHIWcIfvZ0Efxep3gT1Cnjrc9TGnmeutt8DIrMYFNBIDQ2JzU53SKw= 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 1793564401231737.4244533755677; Sun, 1 Nov 2026 12:20:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc00-00059M-5z; Sun, 01 Nov 2026 15:17:52 -0500 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 1xNbzi-0004tE-O2 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:34 -0500 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 1xNbzd-0007B1-Lz for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:34 -0500 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-32-oES9EpwFOLq3ODkM3HzTCw-1; Sun, 01 Nov 2026 15:17:27 -0500 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 24DF21955F74; Sun, 1 Nov 2026 20:17:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9BC33767; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0F77821E689D; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564248; 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=mPo/hvO1y+Xu9A/MVbm7qpcfj5Zmu4tFNhSTGOCCeTg=; b=K8mUZFl9u10uijImfnx3VwajSo4fpPGtlRqNmAJ756y/2NblzaJD+QGNPSSXslf0ZefXnY na+rvIBIY/Ki8UPu2kExmPNuLuhM44x+ABpR3hXUGzE1vmCOsg4DNdUF6m4yzOcJuyXFW8 v/voDqJjKYtGJofDaLqqVRSDJTZ6Nro= X-MC-Unique: oES9EpwFOLq3ODkM3HzTCw-1 X-Mimecast-MFC-AGG-ID: oES9EpwFOLq3ODkM3HzTCw_1793564246 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com, Bibo Mao Subject: [PATCH v8 25/56] loongarch/virt: convert OnOffAuto properties to QAPI-aware registration Date: Sun, 1 Nov 2026 21:16:46 +0100 Message-ID: <20261101201717.3911097-26-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564402526158500 From: Marc-Andr=C3=A9 Lureau Convert the acpi, v-eiointc, and dmsi OnOffAuto properties from manual visitor-based callbacks to object_class_property_add_enum(). Reviewed-by: Bibo Mao Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- hw/loongarch/virt.c | 65 ++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 39 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 8ad327b8dd..1e1271ce87 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,18 +1469,19 @@ 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", NULL, - virt_get_acpi, virt_set_acpi, - NULL, NULL); + object_class_property_add_enum(oc, "acpi", "OnOffAuto", + &OnOffAuto_type_info, NULL, + virt_get_acpi, virt_set_acpi); object_class_property_set_description(oc, "acpi", "Enable ACPI"); - object_class_property_add(oc, "v-eiointc", "OnOffAuto", NULL, - virt_get_veiointc, virt_set_veiointc, - NULL, NULL); + object_class_property_add_enum(oc, "v-eiointc", "OnOffAuto", + &OnOffAuto_type_info, NULL, + virt_get_veiointc, virt_set_veiointc); object_class_property_set_description(oc, "v-eiointc", "Enable Virt Extend I/O Interrupt Controller."= ); - object_class_property_add(oc, "dmsi", "OnOffAuto", NULL, - virt_get_dmsi, virt_set_dmsi, NULL, NULL); + object_class_property_add_enum(oc, "dmsi", "OnOffAuto", + &OnOffAuto_type_info, NULL, + virt_get_dmsi, virt_set_dmsi); object_class_property_set_description(oc, "dmsi", "Enable direct Message-interrupts Controller."= ); machine_class_allow_dynamic_sysbus_dev(mc, TYPE_RAMFB_DEVICE); --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564454; cv=none; d=zohomail.com; s=zohoarc; b=mL8hIIu6g9v2j2TKWr+9bCdg8TjhhHSfc4fmVNtn1752pu5z24TUsigDQJZxY+Xd4eFGQVjnw0fjO/R1XwztpwL/PPRZBumKRgVVVIFSnhLRmCWn1gBCAYdHOCjjbqm0tDVyGyjxouHeXAqZaWwbvemoHigM73nHMIpNs2x1lwA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564454; 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=jdePFbhOURNRs5zd35yfXCP91ARvGJ0yg1D6DV9jb3U=; b=lfaxgL8thQ1kIJitUHbsG/8iLiw+/VngrLJ4/vuUX4vIMD5MlodlLyLJfoaHBV+zFkikK8hU8Qhka2cR8Rpkz3slSxXclSZLlHHkwPecqssXz0xTRowgGSdxLgMS+5VU0pBqXvxqanPIWGxujR26sexGRMzS3G1bvmAP0WcnJEM= 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 1793564454280235.42884760542563; Sun, 1 Nov 2026 12:20:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc2E-0001nZ-NT; Sun, 01 Nov 2026 15:20:10 -0500 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 1xNbzn-0004yI-QD for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:39 -0500 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 1xNbzd-0007BU-SH for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:39 -0500 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-26-cLyhqbRPPlCAsgqaVxeNTg-1; Sun, 01 Nov 2026 15:17:27 -0500 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 7B61E1954AE9 for ; Sun, 1 Nov 2026 20:17:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E9FE4195608B for ; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 1415321E689E; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564248; 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=jdePFbhOURNRs5zd35yfXCP91ARvGJ0yg1D6DV9jb3U=; b=J2p6+RGlhF8+BgMcooDMtnZJqzF4kkAVwti2gueHL0hrrIcUw7z6uUKmFKY2ShSnR9Zywa enBerqNv9KSj6TdEVjwsAu5fJKXdcZSoXP/lHSkei4xTuhSdpJL9v1Il5vubWD56V1aTJL NV+nIChHAZsjdmN/US6ukBH5MuDmdh0= X-MC-Unique: cLyhqbRPPlCAsgqaVxeNTg-1 X-Mimecast-MFC-AGG-ID: cLyhqbRPPlCAsgqaVxeNTg_1793564246 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 26/56] hostmem: convert OnOffAuto rom property to QAPI-aware registration Date: Sun, 1 Nov 2026 21:16:47 +0100 Message-ID: <20261101201717.3911097-27-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564455174158500 From: Marc-Andr=C3=A9 Lureau Convert the hostmem-file's rom property and hostmem-memfd's guest-memfd property from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- backends/hostmem-file.c | 25 ++++++++++--------------- backends/hostmem-memfd.c | 23 ++++++++++------------- 2 files changed, 20 insertions(+), 28 deletions(-) diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index aec38bac2f..15b5fee246 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,9 +292,10 @@ file_backend_class_init(ObjectClass *oc, const void *d= ata) object_class_property_add_bool(oc, "readonly", file_memory_backend_get_readonly, file_memory_backend_set_readonly); - object_class_property_add(oc, "rom", "OnOffAuto", NULL, - file_memory_backend_get_rom, - file_memory_backend_set_rom, NULL, NULL); + object_class_property_add_enum(oc, "rom", "OnOffAuto", + &OnOffAuto_type_info, NULL, + file_memory_backend_get_rom, + file_memory_backend_set_rom); object_class_property_set_description(oc, "rom", "Whether to create Read Only Memory (ROM)"); } diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index 15dc8814ba..4e1b23a1d6 100644 --- a/backends/hostmem-memfd.c +++ b/backends/hostmem-memfd.c @@ -20,7 +20,7 @@ #include "migration/cpr.h" #include "system/kvm.h" #include -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" =20 OBJECT_DECLARE_SIMPLE_TYPE(HostMemoryBackendMemfd, MEMORY_BACKEND_MEMFD) =20 @@ -95,24 +95,20 @@ have_fd: backend->size, ram_flags, fd, 0,= errp); } =20 -static void -memfd_backend_get_guest_memfd(Object *o, Visitor *v, - const char *value, void *opaque, - Error **errp) +static int +memfd_backend_get_guest_memfd(Object *o, Error **errp) { HostMemoryBackendMemfd *m =3D MEMORY_BACKEND_MEMFD(o); =20 - visit_type_OnOffAuto(v, value, &m->guest_memfd, errp); + return m->guest_memfd; } =20 static void -memfd_backend_set_guest_memfd(Object *o, Visitor *v, - const char *value, void *opaque, - Error **errp) +memfd_backend_set_guest_memfd(Object *o, int value, Error **errp) { HostMemoryBackendMemfd *m =3D MEMORY_BACKEND_MEMFD(o); =20 - visit_type_OnOffAuto(v, value, &m->guest_memfd, errp); + m->guest_memfd =3D value; } =20 static bool @@ -203,9 +199,10 @@ memfd_backend_class_init(ObjectClass *oc, const void *= data) "Huge pages size (ex: 2M, 1G= )"); } =20 - object_class_property_add(oc, "guest-memfd", "OnOffAuto", NULL, - memfd_backend_get_guest_memfd, - memfd_backend_set_guest_memfd, NULL, NULL); + object_class_property_add_enum(oc, "guest-memfd", "OnOffAuto", + &OnOffAuto_type_info, NULL, + memfd_backend_get_guest_memfd, + memfd_backend_set_guest_memfd); object_class_property_set_description(oc, "guest-memfd", "Use guest memfd"); =20 --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564497; cv=none; d=zohomail.com; s=zohoarc; b=CYwNI3ZEoKc0UZBl6l+BArv6IVz9/URlEgrBXyjVRdzadQBgrRXWdoqJQnUGFEuabdZ/xhOrIuru6JTNq11ToR0avN/Uyai9o4YcwsW4czxxAlQLwSTA9Gf36Qna1oP4iMA3ytWYQ5DfaxK4lotQYChVgqyUZUnzCOG01NeH7X0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564497; 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=rd49YHjQUamWqGGBC57FvF/svKRlYV7H9mtyv/ExC1Q=; b=CuomvgpweJNcRYFVexn4Kh5z3WBylX01PwGcVVQ7ZLGezn5htgoomLGqhL3b0RZ6+aVMw+KeQPRSSy4/0djDfS9cQ+RRw3WP4iqLznR/E6TXZosQB4X2z+WCSRUdCpWQK/ixx56uPmrRYXmuS4wsqBe0ozCgUus/k9cUrLtaM8A= 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 1793564497035630.4088178509423; Sun, 1 Nov 2026 12:21:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNbzn-0004xO-BZ; Sun, 01 Nov 2026 15:17:39 -0500 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 1xNbzi-0004tC-MP for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:34 -0500 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 1xNbzd-0007As-Kl for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:33 -0500 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-464-ByQlaCKxMrCSHJibleCJ0w-1; Sun, 01 Nov 2026 15:17:27 -0500 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 35EEF1955BFE for ; Sun, 1 Nov 2026 20:17:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EA1721800495 for ; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 18BC121E689F; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564248; 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=rd49YHjQUamWqGGBC57FvF/svKRlYV7H9mtyv/ExC1Q=; b=OzS3f9YKzrDcCUxo4Q7AQWgIqiO4j+kXpPx3NvEqZtZnaLKEBw2EIoyPsxV7CeXRSvx+Sr ZZ0sAEuIbQxKj8bULGtE/DC4ZY0m8ZQ1Xelkr1L0eOFf9XF8eiS50CrtMzJ8hZbgn5SevO 8NYdzG1CHTxc6BDQliBmLy26kUXYKiM= X-MC-Unique: ByQlaCKxMrCSHJibleCJ0w-1 X-Mimecast-MFC-AGG-ID: ByQlaCKxMrCSHJibleCJ0w_1793564246 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 27/56] sev: convert OnOffAuto legacy-vm-type property to QAPI-aware registration Date: Sun, 1 Nov 2026 21:16:48 +0100 Message-ID: <20261101201717.3911097-28-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564498037158500 From: Marc-Andr=C3=A9 Lureau Convert the legacy-vm-type OnOffAuto property from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- target/i386/sev.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 74a7b719b5..d19f98e1c7 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" @@ -2982,23 +2983,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 @@ -3024,9 +3018,10 @@ sev_guest_class_init(ObjectClass *oc, const void *da= ta) 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", NULL, - sev_guest_get_legacy_vm_type, - sev_guest_set_legacy_vm_type, NULL, NULL); + object_class_property_add_enum(oc, "legacy-vm-type", "OnOffAuto", + &OnOffAuto_type_info, NULL, + sev_guest_get_legacy_vm_type, + sev_guest_set_legacy_vm_type); object_class_property_set_description(oc, "legacy-vm-type", "use legacy VM type to maintain measurement compatibility with= older QEMU or kernel versions."); } --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564373; cv=none; d=zohomail.com; s=zohoarc; b=UcRn4pWOkunCT9FFDbk4rU0sS+8+AfHv0Bum6raIGEqWRuP9wXvbtWBXMFwBFOHrL6G+rXB+USqUsx+cAhm6h5yNKkdVpbu2g9qYP82CUYw/fg+wSA7IsGXNV3hWLPdvSaQPL3KvGvLMEMBTF7bUZkfAHyMt7Gg/O444P1TYGOk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564373; 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=Xx+fY/gSbyNUPDyYwmw/JfM66U+dysnPLhPYh5UEe4c=; b=bd69y3sTKV7aAbdBMSZXpKaE3HZt1sH1QjJtOrgU+y2CZW6IQcpSDGtv43sdxTD/IaHnX9L3pvFbAHrxVxpkh4x6USV8v5U7kgSJf0SXoX2D2HC60DlY2PzF9D9lSEH65OoLgkn/1mBbEiyrXeSyx7Fann+ksGzdRl/lVEf5ZxY= 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 1793564373529809.4945641392611; Sun, 1 Nov 2026 12:19:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc02-0005AJ-Ow; Sun, 01 Nov 2026 15:17:54 -0500 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 1xNbzj-0004uB-L0 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:35 -0500 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 1xNbzd-0007BB-R4 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:35 -0500 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-464-Kz2D5VnFPGSDhVO-y-N-DA-1; Sun, 01 Nov 2026 15:17:26 -0500 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 1B44F18005B4 for ; Sun, 1 Nov 2026 20:17:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D069B1956086 for ; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 1D92C21E68A0; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564248; 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=Xx+fY/gSbyNUPDyYwmw/JfM66U+dysnPLhPYh5UEe4c=; b=fwnsm3i4MODqrdhegx39IMWhXAaLqg9k+OWx2+mwTi/oFlwzKktGUh255CMZ+I7NEsf3cF KLCw/iujXpYOm8KYNTDC64H5LqloB3tI0OcfNVuh6Nxu3JK63/ZlFPg+bRZPV9jAUx+401 99BHPCoVsb5sSdBc7PPbz6eTFmovKec= X-MC-Unique: Kz2D5VnFPGSDhVO-y-N-DA-1 X-Mimecast-MFC-AGG-ID: Kz2D5VnFPGSDhVO-y-N-DA_1793564246 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 28/56] whpx: convert OnOffAuto hyperv property to QAPI-aware registration Date: Sun, 1 Nov 2026 21:16:49 +0100 Message-ID: <20261101201717.3911097-29-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564375551158500 From: Marc-Andr=C3=A9 Lureau Convert the hyperv OnOffAuto property from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- accel/whpx/whpx-common.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c index f82e607745..3447c52fb1 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,9 +523,9 @@ static void whpx_accel_class_init(ObjectClass *oc, cons= t 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, - NULL, whpx_set_hyperv, - NULL, NULL); + object_class_property_add_enum(oc, "hyperv", "OnOffAuto", + &OnOffAuto_type_info, NULL, + NULL, whpx_set_hyperv); object_class_property_set_description(oc, "hyperv", "Configure Hyper-V enlightenments"); =20 --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564631; cv=none; d=zohomail.com; s=zohoarc; b=YnXPUCYCQIB/VBXtXZoKqG1fIW8zhLhwAmdOgA+qQcAzOiNf20JQ8CHcjIs8fVqzsBWlNlwtyPzJ5/em/59rGF5dB5QHpO0H10cA0GvTdFX1MjTFTG4gC9JrfTFtLVyGNCNFjfpFBPGDuxaeZQ+DIMyAYzCx466MwyNa+KiOgWI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564631; 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=/TXFs6RMMwyms6uO940fWpqKQYCKjsdUfS2UnrHbcqo=; b=YGQJh0gF1xPH9fJykkcSoOeS0+ucoZiV8HS3Be6ln+2B4I494Dp96AqwO6nNUkWQuQzdBXTg8t3TynzmYodweO99LGRPtJrmLhlkis6MhWZVSEbHEcXwxBuC8/oZQzyEmRcYYMkLpfGtUIaUJni6OPINb/C0UCaubtMrcxJJUX0= 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 1793564631237283.935221365311; Sun, 1 Nov 2026 12:23:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc21-00006O-Pt; Sun, 01 Nov 2026 15:19:57 -0500 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 1xNbzm-0004v3-3j for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:38 -0500 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 1xNbzd-0007BN-Vo for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:37 -0500 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-26-03EvWpDwMImW1mRN8BHONQ-1; Sun, 01 Nov 2026 15:17:27 -0500 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 768D41955F03 for ; Sun, 1 Nov 2026 20:17:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EA2951800586 for ; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2230121E68A1; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564248; 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=/TXFs6RMMwyms6uO940fWpqKQYCKjsdUfS2UnrHbcqo=; b=W7vMuy3eRP6yY6HPfy2xYQE7B30xvoD+P8jSV2psQ91zNYnwyMaCqMcYF72flls9+dQcJw 3mu26Qa87wMfUU9P77oF50pcLvvRjPfZ39lmxrlz49ih2iw3szidx+8fYLNtaP89nZxcsf ZPUdEIhaxREMAsUW1GMydEihEZzleWk= X-MC-Unique: 03EvWpDwMImW1mRN8BHONQ-1 X-Mimecast-MFC-AGG-ID: 03EvWpDwMImW1mRN8BHONQ_1793564246 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 29/56] whpx: convert OnOffAuto arch properties to QAPI-aware registration Date: Sun, 1 Nov 2026 21:16:50 +0100 Message-ID: <20261101201717.3911097-30-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564632849158500 From: Marc-Andr=C3=A9 Lureau Convert the ignore-unknown-msr, intercept-msr-gp, and ssd OnOffAuto properties from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- target/i386/whpx/whpx-all.c | 84 ++++++++++--------------------------- 1 file changed, 23 insertions(+), 61 deletions(-) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 778da68bf4..c459138c7e 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,118 +2912,79 @@ 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, - NULL, whpx_set_unknown_msr, - NULL, NULL); + object_class_property_add_enum(oc, "ignore-unknown-msr", "OnOffAuto", + &OnOffAuto_type_info, NULL, + NULL, whpx_set_unknown_msr); object_class_property_set_description(oc, "ignore-unknown-msr", "Configure unknown MSR behavior"); - object_class_property_add(oc, "intercept-msr-gp", "OnOffAuto", NULL, - NULL, whpx_set_intercept_msr_gp, - NULL, NULL); + object_class_property_add_enum(oc, "intercept-msr-gp", "OnOffAuto", + &OnOffAuto_type_info, NULL, + NULL, whpx_set_intercept_msr_gp); object_class_property_set_description(oc, "intercept-msr-gp", "Intercept #GP to log erroring MSR accesses."); - object_class_property_add(oc, "ssd", "OnOffAuto", NULL, - NULL, whpx_set_ssd, - NULL, NULL); + object_class_property_add_enum(oc, "ssd", "OnOffAuto", + &OnOffAuto_type_info, NULL, + NULL, whpx_set_ssd); object_class_property_set_description(oc, "ssd", "Separate security domain"); } --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564356; cv=none; d=zohomail.com; s=zohoarc; b=V27jNKnCmKZNTU4tMy2FU7G2hw2G3lYIuLW3kctZa0MTsXrhIZkL7BhTHg2dWZL4ilQKunDSJF6ABjKE9KSd95RS2Oo+ODXa+OTfJtyOI6e/DUyya3+tPcmpb7fXEXEJWwQlNCSlJ3AH7uO8kly3R4qnyMb6yE3KjeNn9kt+SGo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564356; 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=X/3ULtXxgo7UYHOxO+OXiN+269swaZgzsEvQ9ooK9lY=; b=JRdH39v6uaK+jnJXuIJHeo6ydj3syfwPgXSGFKAkDSgVbx4YWUtSX1I1bNHXpRwBkrmedEn+Jj0ozQbiztB7+HNkhAhEv6yrwgdpB+Fm3BQidT/ZGKYH7mEmYtMaS1c0QbfHZJ2iOZBgoWNC1addnzbiAU7G3zl6Juxi1KANARw= 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 1793564356803888.6607274679128; Sun, 1 Nov 2026 12:19:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc00-00059T-Mh; Sun, 01 Nov 2026 15:17:52 -0500 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 1xNbzj-0004tp-01 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:35 -0500 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 1xNbzd-0007B9-Oa for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:34 -0500 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-259-tkUmU38qPoax2kW6f9xTZw-1; Sun, 01 Nov 2026 15:17:27 -0500 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 401D91954AC2 for ; Sun, 1 Nov 2026 20:17:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F1FE91956087 for ; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2682D21E68A2; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564248; 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=X/3ULtXxgo7UYHOxO+OXiN+269swaZgzsEvQ9ooK9lY=; b=EMs3zO6PEzRc4/0CQ90neYi7ipRrNiTXTqjy8mGiW+dLoXSLwigpSgJ+XrpgbpjgUzobu+ zKi8wdoMJJSGPrzQhLQZx+RErdsHLVna/SEYM/DCzPccmvmiTRUVaalAXa70BnS8ZkIRb4 wo17vH8INZjCUnd/pr3Wm+Ve2hEtA3Y= X-MC-Unique: tkUmU38qPoax2kW6f9xTZw-1 X-Mimecast-MFC-AGG-ID: tkUmU38qPoax2kW6f9xTZw_1793564246 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 30/56] accel/kvm: convert OnOffSplit property to QAPI-aware registration Date: Sun, 1 Nov 2026 21:16:51 +0100 Message-ID: <20261101201717.3911097-31-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564359237158500 From: Marc-Andr=C3=A9 Lureau Convert the OnOffSplit property from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- accel/kvm/kvm-all.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 9cc1e4b0a9..fe11cd92b4 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,9 +4296,9 @@ static void kvm_accel_class_init(ObjectClass *oc, con= st 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, - NULL, kvm_set_kernel_irqchip, - NULL, NULL); + object_class_property_add_enum(oc, "kernel-irqchip", "on|off|split", + &OnOffSplit_type_info, NULL, + NULL, kvm_set_kernel_irqchip); object_class_property_set_description(oc, "kernel-irqchip", "Configure KVM in-kernel irqchip"); =20 --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564632; cv=none; d=zohomail.com; s=zohoarc; b=DUoOTVjOUTYpsDbp9kRmqhj29LLKn4NK2CbnG/oyEmOs4w6oMPqUR95IifI6gNKWlLoguQWCiOzq/0x0DAexMHFVVCZB4ZOl2EHVt1g0OD375AL3tyEExMSU+tNMOpEJhY5LQ6ekm2+YuIVk/4NiEgGhzRyjyhdWzcxlsG5bNeg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564632; 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=mvYNx/B1QlAHdt2LFIFf6fYmZW5V3Dj8V829DyXBFuI=; b=CMT4OBCLvvZ5njxUEAHcPNLRuPDOANgUA1y3XpraT+WtiDwHfy9rZYOLUMtbOtCOSGc1K9ZeIGuX8hVpWuGTEVv8PsupnDgn5Wu3zpWdFfZ7Qic23lTdZx3zh0U43q9d8NaAVfLyBz62Xf7TDwKXL3qRQPuw0IXXOJyVwLP83hw= 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 1793564632131399.99737520882866; Sun, 1 Nov 2026 12:23:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNbzt-000548-0D; Sun, 01 Nov 2026 15:17:45 -0500 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 1xNbzg-0004rS-70 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:32 -0500 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 1xNbzd-0007Ag-3B for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:31 -0500 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-688-fL5EHz--O4GYxwz6GpVhMg-1; Sun, 01 Nov 2026 15:17:27 -0500 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 361111954B0B for ; Sun, 1 Nov 2026 20:17:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EAF107E3 for ; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2B52A21E68A4; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564248; 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=mvYNx/B1QlAHdt2LFIFf6fYmZW5V3Dj8V829DyXBFuI=; b=IB1nMA6KPQt3+oa+pvk9yS3UrgQQLKn2MnzGncrv4sfAqEjykP4wsM4K/KsE3g0lwav1r7 gk7pjV4C6euIXm2F5BiLmpHI86ErXdCCchmP84xPPgUzJK4+S5TM/NQrTzib1FbZlzDO8U cbZXPAnqRtBmxyv2wchkjuTNHHZ84wY= X-MC-Unique: fL5EHz--O4GYxwz6GpVhMg-1 X-Mimecast-MFC-AGG-ID: fL5EHz--O4GYxwz6GpVhMg_1793564246 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 31/56] whpx: convert OnOffSplit property to QAPI-aware registration Date: Sun, 1 Nov 2026 21:16:52 +0100 Message-ID: <20261101201717.3911097-32-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564632794158500 From: Marc-Andr=C3=A9 Lureau Convert the OnOffSplit property from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- accel/whpx/whpx-common.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c index 3447c52fb1..068258bf6c 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,9 +508,9 @@ static void whpx_accel_class_init(ObjectClass *oc, cons= t 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, - NULL, whpx_set_kernel_irqchip, - NULL, NULL); + object_class_property_add_enum(oc, "kernel-irqchip", "on|off|split", + &OnOffSplit_type_info, NULL, + NULL, whpx_set_kernel_irqchip); object_class_property_set_description(oc, "kernel-irqchip", "Configure WHPX in-kernel irqchip"); object_class_property_add_enum(oc, "hyperv", "OnOffAuto", --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564399; cv=none; d=zohomail.com; s=zohoarc; b=F1hUQcNjM2XH07LH+fBV/lL4g0YhaoYWpo6E8yJnkUlUgIJtu/k59PHcZNtGM+QYt8CeNLgktB2bfvYMmnJVgj4qkA7+nK66a3X2w0wYrgxKzgpmmupxxfmMcKUlHWfjDpMJEgH0r9GdshGqxJUkzT2qAQfOPvfeEMC0MjKdiXU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564399; 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=YmZMc9TQwrpq/2MUPnUA00TMj+1dqZbLt5kf6ZI3Qqw=; b=Mj58hxPqSxJS54st4riCQ2WsIcX3QNf8xnrrFEM3ZpI4FSv53S+NgggrepUSPIcb4YAwzFwHRM27ZRanJQuC9CN/hxTVtM7lNqw9N65A+1UH7u6negEOyjVTQsWKCbzyX2Vdkg/M2p5hyHaEAkjwwyr5v7Nuy8YZ04WjIvGB3kU= 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 1793564399542826.5843971594767; Sun, 1 Nov 2026 12:19:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc0V-0005SS-W8; Sun, 01 Nov 2026 15:18:31 -0500 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 1xNbzn-0004yF-Mt for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:39 -0500 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 1xNbze-0007CL-Dd for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:39 -0500 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-466-yBJa6u0gM6mziFNvjXEf0A-1; Sun, 01 Nov 2026 15:17:28 -0500 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 8D2CD1954AEF; Sun, 1 Nov 2026 20:17:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D869D3000B7A; Sun, 1 Nov 2026 20:17:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 301EE21E68A5; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564249; 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=YmZMc9TQwrpq/2MUPnUA00TMj+1dqZbLt5kf6ZI3Qqw=; b=LzBwVojEJo9+2b3C1/GjKd1GiRMYtWpN6l3F2Iygj6NaMOxNTexT5e73foA/awh7T9iZDk wfJMm0FyL33dU8uI3JijhGmsp56PF9UOP4aLOwXf+ct8Y1GSBbQE7gevr3WFGYEqykEEHD 2AVgXJA8xfNEQpgYjG3ydxdgPgDGO5U= X-MC-Unique: yBJa6u0gM6mziFNvjXEf0A-1 X-Mimecast-MFC-AGG-ID: yBJa6u0gM6mziFNvjXEf0A_1793564247 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com, Amit Machhiwal Subject: [PATCH v8 32/56] ppc/spapr-caps: convert to QAPI-aware property registration Date: Sun, 1 Nov 2026 21:16:53 +0100 Message-ID: <20261101201717.3911097-33-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564400042158500 From: Marc-Andr=C3=A9 Lureau Add QAPITypeInfo to SpaprCapabilityInfo, and make spapr_caps_add_properties() pass it to object_class_property_add(). Reviewed-by: Amit Machhiwal Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- hw/ppc/spapr_caps.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index b8c48bca8a..79b1cc2e1d 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" @@ -60,6 +61,7 @@ typedef struct SpaprCapabilityInfo { ObjectPropertyAccessor *get; ObjectPropertyAccessor *set; const char *type; + const QAPITypeInfo *qapi_type; /* Possible values if this is a custom string type */ SpaprCapPossible *possible; /* Make sure the virtual hardware can support this capability */ @@ -726,6 +728,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_htm_apply, }, [SPAPR_CAP_VSX] =3D { @@ -735,6 +738,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_vsx_apply, }, [SPAPR_CAP_DFP] =3D { @@ -744,6 +748,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_dfp_apply, }, [SPAPR_CAP_CFPC] =3D { @@ -753,6 +758,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_string, .set =3D spapr_cap_set_string, .type =3D "string", + .qapi_type =3D &str_type_info, .possible =3D &cap_cfpc_possible, .apply =3D cap_safe_cache_apply, }, @@ -763,6 +769,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_string, .set =3D spapr_cap_set_string, .type =3D "string", + .qapi_type =3D &str_type_info, .possible =3D &cap_sbbc_possible, .apply =3D cap_safe_bounds_check_apply, }, @@ -775,6 +782,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_string, .set =3D spapr_cap_set_string, .type =3D "string", + .qapi_type =3D &str_type_info, .possible =3D &cap_ibs_possible, .apply =3D cap_safe_indirect_branch_apply, }, @@ -785,6 +793,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_pagesize, .set =3D spapr_cap_set_pagesize, .type =3D "int", + .qapi_type =3D &size_type_info, .apply =3D cap_hpt_maxpagesize_apply, .cpu_apply =3D cap_hpt_maxpagesize_cpu_apply, }, @@ -795,6 +804,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_nested_kvm_hv_apply, }, [SPAPR_CAP_NESTED_PAPR] =3D { @@ -804,6 +814,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_nested_papr_apply, }, [SPAPR_CAP_LARGE_DECREMENTER] =3D { @@ -813,6 +824,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_large_decr_apply, .cpu_apply =3D cap_large_decr_cpu_apply, }, @@ -823,6 +835,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_ccf_assist_apply, }, [SPAPR_CAP_FWNMI] =3D { @@ -832,6 +845,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_fwnmi_apply, }, [SPAPR_CAP_RPT_INVALIDATE] =3D { @@ -841,6 +855,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_rpt_invalidate_apply, }, [SPAPR_CAP_AIL_MODE_3] =3D { @@ -850,6 +865,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_ail_mode_3_apply, }, [SPAPR_CAP_DAWR1] =3D { @@ -859,6 +875,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_dawr1_apply, }, }; @@ -1069,7 +1086,7 @@ 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, NULL, + object_class_property_add(klass, name, cap->type, cap->qapi_type, cap->get, cap->set, NULL, cap); =20 --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564356; cv=none; d=zohomail.com; s=zohoarc; b=ToZeC+xGH2Pg+H6xyK+TszmL2lbSoOdiElocHPepBraYgyQ6IAAup+2fDOUlzcCFVpvcyC0abDGXiHMIWAiRB2VT54iEx33RXGGndWs+ona96Q9OOPJcPHuZ9kHsgYryxIYV1iyEM5Jrm9EDTsjNtGA3Tc8BTv7JGhRsBIL3QiQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564356; 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=FNtdl5Kn3Ze0Jze2yz9nEP0uIzOhwHEUiwhNpnPB6es=; b=HJ+3dTH93x3oH8zUia76xnv1Ai+jrJ58OiUa0RF6E39DoffEQrp7tedOD+S+eJKXTCeCwNSITbIZa9Uug2pocNqcdpAPOsOIJb5hzIWxycb8k/5mdRZkuN6oWumVMr8TsBkfSv2979HqVIL2FBhTeME+VV7ph7tP9RFtVfl3ec0= 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 17935643568861018.1466744489343; Sun, 1 Nov 2026 12:19:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc0V-0005RK-Vd; Sun, 01 Nov 2026 15:18:29 -0500 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 1xNbzm-0004x8-Tq for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:38 -0500 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 1xNbze-0007C0-56 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:38 -0500 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-464-86GqNJjdPge0_HILjUSyFQ-1; Sun, 01 Nov 2026 15:17:27 -0500 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 004C219560AD for ; Sun, 1 Nov 2026 20:17:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B58041956086 for ; Sun, 1 Nov 2026 20:17:26 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 34C0921E68A6; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564249; 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=FNtdl5Kn3Ze0Jze2yz9nEP0uIzOhwHEUiwhNpnPB6es=; b=Vl0Jr1jRtZd2BocN8ZSZCtznCEf8AbA/2au4VRBINWcAUKGIKChWOrEaj1OtpB67AmNWd7 SlV14MipCFskatXhm0gHeJnubMBxeElCN4hFnT4OgtwEXOBbiDhZJ1IIy5uJn7ZpHKOXX4 D49i8AyMMx/ixdx/BTF3pQ7uRe/rYDQ= X-MC-Unique: 86GqNJjdPge0_HILjUSyFQ-1 X-Mimecast-MFC-AGG-ID: 86GqNJjdPge0_HILjUSyFQ_1793564247 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 33/56] net/colo-compare: fix compare_timeout setter visitor type Date: Sun, 1 Nov 2026 21:16:54 +0100 Message-ID: <20261101201717.3911097-34-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564359178158500 From: Marc-Andr=C3=A9 Lureau 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: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- 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 7d4a2db522..a9c6cca5e1 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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564615; cv=none; d=zohomail.com; s=zohoarc; b=KP5YfOMh/9hCIgic6ArLQ0DF56WztBT/uAho/NYRnTcWJvrSoQqistmm+qQlkK/V753U62zATuzxGdNhPa1mHfaCtPpPCyJ5e1dHl2NgGgB4TKcwUWDXc9VhjRdGj9ExM28CXbzVy75kc43Vn6V7bK831/Cw18ApybfkRs5HBxE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564615; 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=/8A5DxYNQzEhvQWzPiOLMSKp1sWuCTnPWK0gArjWsQM=; b=WlYxd4BU3aZ2EQ33OiZ1ETnZT834LDzLBB9I/YHGNQuzltk+kcH+DnGXF6bEEnl9aftlI3gLu8HRxMEHrsg55H4iuUg9uNZ1gkVmjgYiQmfS1MB7Ert0I672VXafj52nN0kOZHVOTJGlY/T3GatqJ3CxRhmXurn5bSlLHvfpEm0= 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 1793564615217940.1985561002524; Sun, 1 Nov 2026 12:23:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1n-0007W4-Mt; Sun, 01 Nov 2026 15:19:45 -0500 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 1xNbzn-0004yE-KB for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:39 -0500 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 1xNbze-0007CS-E0 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:39 -0500 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-22-kCww4bi2MIazAYlj5VBrqg-1; Sun, 01 Nov 2026 15:17:28 -0500 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 19A571954AF4 for ; Sun, 1 Nov 2026 20:17:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CD06E1800345 for ; Sun, 1 Nov 2026 20:17:26 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3963D21E68A7; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564249; 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=/8A5DxYNQzEhvQWzPiOLMSKp1sWuCTnPWK0gArjWsQM=; b=AJZYfI10nuO3JNVWbUfkObvzLPvVABXiFA36ZPiFnE+Ac2Jtg6u/Ur3cSy2yW/DmwbVPSK I5YgpmkZi4q6vZhs188Ihrao98lrqVQkjPXJmDxnThLPQsVQGtn5Ojzi0GQkcR29Np6FT7 uj8lN+n9eRPFH0pSbQpQOCtb+VQ9twI= X-MC-Unique: kCww4bi2MIazAYlj5VBrqg-1 X-Mimecast-MFC-AGG-ID: kCww4bi2MIazAYlj5VBrqg_1793564247 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 34/56] net/colo-compare: fix max_queue_size setter visitor type Date: Sun, 1 Nov 2026 21:16:55 +0100 Message-ID: <20261101201717.3911097-35-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564616634158500 From: Marc-Andr=C3=A9 Lureau 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: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- 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 a9c6cca5e1..6bc43e0696 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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564560; cv=none; d=zohomail.com; s=zohoarc; b=OiNiEQ9o6zfHILpQ6+0mCFgO+IeH6p4pCwX5x6sT+C4rA0caP5wbBZSaeR6sVFdqmfP86aor39nxrVqusqkjtTgFH/vjbSeSFk8K5KyyT6E8uMgvgUzPwHXfiLO/e11sXogXyMyb8Dz7dEE32xBfiYAtSLjMc8gB96eA/HRfXTg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564560; 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=KBKgYC0uQRP24B0IcxAs665AAwxx9bXEC9SKQyoBwpM=; b=ihaNfpmSfV1XdZN8bPt9y1Qshxn2YCDBIRQYDm+1hZ0UeyHK2dYOz0vrNLF1hXlbB7GSBWR1KuqZedzb+x2D9C0GBotOCxlec3rOcrTFyyFlIel50Ecqabs9N4jrsNSMGbe8OqvCkZ/flh3R93+Gic0KxOP9Km0Qwe9FvVxPJFs= 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 1793564560702585.6610831894467; Sun, 1 Nov 2026 12:22:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc2M-0002Yv-1N; Sun, 01 Nov 2026 15:20:18 -0500 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 1xNbzo-0004yf-5X for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:40 -0500 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 1xNbzf-0007Cm-DB for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:39 -0500 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-104-nr391T9CN7Wv0IXjBwQGrg-1; Sun, 01 Nov 2026 15:17:29 -0500 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 959121954AE2 for ; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 502481956086 for ; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3DE9721E68A8; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564250; 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=KBKgYC0uQRP24B0IcxAs665AAwxx9bXEC9SKQyoBwpM=; b=ImqpgBvsIM2u0svMIEv2qW8DGhJoKHFJ2wOBwpn2HJTEPLMsxbhQxiNnKqrVAG2q736IwY 4eASOWY1rMV4yVQSUV+o/MhOon8KxlnctGRjgmyKbr/DfBlh7oMG31zOpD0x2wJMGSEg46 Q37VMSvdvfRuOsizlJTx3fFMDKvAHNY= X-MC-Unique: nr391T9CN7Wv0IXjBwQGrg-1 X-Mimecast-MFC-AGG-ID: nr391T9CN7Wv0IXjBwQGrg_1793564248 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 35/56] hw/misc/xlnx-versal-trng: add missing getter for fips-fault-events Date: Sun, 1 Nov 2026 21:16:56 +0100 Message-ID: <20261101201717.3911097-36-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564561218158500 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- 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 aa1d65de7b..0584ee089e 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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564419; cv=none; d=zohomail.com; s=zohoarc; b=kOGP/8sm5Gvton93ZL202/3fIiHocXlwgtKGhG9raUNXSSCiWSzz2fmr+iDSBJYF9oYK9IH67/EAHyH9hjeZsDbHl9jS2VP9He04wLeOylMYr6sfm/jlGHLVD+a3+iUiX8QoeQKpRnaqTGm3B5d7rzaz4VU8MHTWUgJ7x64wCgc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564419; 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=a2uvdeGskkqU565zwgVPASejQLcudocykzaM6kW4Oxc=; b=OBUJC86Yp2Gw28Dz7i/NCmGL9OH8D4KSFVIUK0Uy7tLg4Mx/kMLMKcweN8bOduM5cGA70wX5qz9mpPNY7Wk0Y4Wb7ZrVYF/DVhEjXa14nVvLbtDcDUH1r2V9O3UxeBOl9CMsMj0PNOzPbEurF86xGoCIlHXW996tCq0N8cjBBw8= 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 1793564419643690.5175732125381; Sun, 1 Nov 2026 12:20:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1y-00084k-PJ; Sun, 01 Nov 2026 15:19:55 -0500 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 1xNbzx-000577-Nn for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:50 -0500 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 1xNbzi-0007EU-7h for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:48 -0500 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-467-Yyx8iPj0O1Wg3RxIggnz3Q-1; Sun, 01 Nov 2026 15:17:30 -0500 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 845621955F6E; Sun, 1 Nov 2026 20:17:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7F5B81800495; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 43DA121E681E; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564252; 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=a2uvdeGskkqU565zwgVPASejQLcudocykzaM6kW4Oxc=; b=gbczNPkFf7xZESWOZwKTaO7A1HGXl/HaAeQeLOD5wpfA1VbZubKkkScYkcApZCcjxw/5kI lTi8OrpWbi05Ksv+DiNdgwwpqOpnRBpuQAwHJ89u4FgeX8Nmf6WWixSfB9KY+uyuF9FhuL nqJnX4dIwL+F2zBw2m03CI1EBkm6+rY= X-MC-Unique: Yyx8iPj0O1Wg3RxIggnz3Q-1 X-Mimecast-MFC-AGG-ID: Yyx8iPj0O1Wg3RxIggnz3Q_1793564249 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com, Amit Machhiwal Subject: [PATCH v8 36/56] qom: convert scalar properties to QAPI-aware registration Date: Sun, 1 Nov 2026 21:16:57 +0100 Message-ID: <20261101201717.3911097-37-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564420553158500 From: Marc-Andr=C3=A9 Lureau Pass appropriate QAPITypeInfo to object_class_property_add() and object_property_add(). Reviewed-by: Amit Machhiwal Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- accel/kvm/kvm-all.c | 9 ++++---- accel/nitro/nitro-accel.c | 4 +++- accel/tcg/tcg-all.c | 3 ++- backends/cryptodev.c | 7 +++--- backends/hostmem-file.c | 4 ++-- backends/hostmem-memfd.c | 4 +++- backends/hostmem.c | 7 +++--- block/throttle-groups.c | 4 +++- crypto/secret_keyring.c | 9 ++++---- event-loop-base.c | 10 +++++--- hw/acpi/ich9.c | 4 +++- hw/acpi/pci.c | 5 ++-- hw/arm/virt.c | 18 ++++++++------- hw/core/clock.c | 4 +++- hw/core/machine.c | 2 +- hw/cpu/core.c | 5 ++-- hw/cxl/cxl-host.c | 2 +- hw/gpio/aspeed_gpio.c | 7 ++++-- hw/gpio/aspeed_sgpio.c | 4 +++- hw/gpio/stm32l4x5_gpio.c | 5 ++-- hw/hexagon/hexagon_dsp.c | 4 +++- hw/i386/pc.c | 9 +++++--- hw/i386/sgx-epc.c | 4 +++- hw/i386/x86.c | 6 ++--- hw/ide/ide-dev.c | 3 ++- hw/intc/apic_common.c | 3 ++- hw/loongarch/virt.c | 8 +++---- hw/mem/nvdimm.c | 3 ++- hw/mem/pc-dimm.c | 3 ++- hw/misc/aspeed_lpc.c | 25 ++++++++++---------- hw/misc/aspeed_sdmc.c | 3 ++- hw/misc/npcm7xx_mft.c | 3 ++- hw/net/ne2000-isa.c | 3 ++- hw/nvme/ctrl.c | 4 +++- hw/pci-bridge/pci_expander_bridge.c | 3 ++- hw/pci-host/i440fx.c | 9 ++++---- hw/pci-host/pnv_phb3.c | 5 ++-- hw/pci-host/pnv_phb4.c | 5 ++-- hw/pci-host/q35.c | 13 +++++++---- hw/ppc/spapr_drc.c | 5 ++-- hw/remote/vfio-user-obj.c | 4 ++-- hw/riscv/microchip_pfsoc.c | 3 ++- hw/s390x/sclpcpi.c | 6 +++-- hw/s390x/virtio-ccw-mem.c | 4 +++- hw/sensor/adc128d818.c | 8 ++++--- 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 | 4 +++- hw/virtio/virtio-mem-pci.c | 4 +++- hw/virtio/virtio-mem.c | 10 +++++--- hw/xen/xen-pvh-common.c | 13 +++++++---- iothread.c | 9 ++++---- net/colo-compare.c | 7 +++--- net/dump.c | 3 ++- net/filter-buffer.c | 3 ++- qom/object.c | 36 ++++++++++++++--------------- system/bootdevice.c | 3 ++- system/memory.c | 5 ++-- target/arm/cpu64.c | 16 +++++++++---- target/arm/kvm.c | 3 ++- target/arm/tcg/cpu64.c | 6 +++-- target/i386/cpu.c | 13 ++++++----- target/i386/kvm/kvm.c | 10 ++++---- target/i386/sev.c | 7 +++--- target/ppc/compat.c | 3 ++- target/riscv/cpu.c | 19 ++++++++++----- target/riscv/kvm/kvm-cpu.c | 7 +++--- target/riscv/tcg/tcg-cpu.c | 7 +++--- target/s390x/cpu_models.c | 6 +++-- tests/unit/test-qdev-global-props.c | 9 ++++---- ui/console.c | 3 ++- util/thread-context.c | 10 +++++--- 79 files changed, 335 insertions(+), 213 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index fe11cd92b4..dcb1db139d 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" @@ -4302,15 +4303,15 @@ static void kvm_accel_class_init(ObjectClass *oc, c= onst void *data) object_class_property_set_description(oc, "kernel-irqchip", "Configure KVM in-kernel irqchip"); =20 - object_class_property_add(oc, "kvm-shadow-mem", "int", NULL, + object_class_property_add(oc, "kvm-shadow-mem", "int", &int_type_info, kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_m= em, 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", NULL, - kvm_get_dirty_ring_size, - kvm_set_dirty_ring_size, + object_class_property_add(oc, "dirty-ring-size", "uint32", + &uint32_type_info, + kvm_get_dirty_ring_size, kvm_set_dirty_ring_= size, NULL, NULL); object_class_property_set_description(oc, "dirty-ring-size", "Size of KVM dirty page ring buffer (default: 0, i.e. use bitmap)"= ); diff --git a/accel/nitro/nitro-accel.c b/accel/nitro/nitro-accel.c index 597027438c..9c07483be3 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,8 @@ 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", NULL, + object_class_property_add(oc, "enclave-cid", "uint64", + &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 ed314e01cb..bbc733a707 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", NULL, + object_class_property_add(oc, "tb-size", "uint32", &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 cc323014cc..46059faa26 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", NULL, + object_class_property_add(oc, "queues", "uint32", &uint32_type_info, cryptodev_backend_get_queues, cryptodev_backend_set_queues, NULL, NULL); - object_class_property_add(oc, "throttle-bps", "uint64", NULL, + object_class_property_add(oc, "throttle-bps", "uint64", &uint64_type_i= nfo, cryptodev_backend_get_bps, cryptodev_backend_set_bps, NULL, NULL); - object_class_property_add(oc, "throttle-ops", "uint64", NULL, + object_class_property_add(oc, "throttle-ops", "uint64", &uint64_type_i= nfo, cryptodev_backend_get_ops, cryptodev_backend_set_ops, NULL, NULL); diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 15b5fee246..2f65ca3678 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", NULL, + object_class_property_add(oc, "align", "uint64", &uint64_type_info, file_memory_backend_get_align, file_memory_backend_set_align, NULL, NULL); - object_class_property_add(oc, "offset", "int", NULL, + object_class_property_add(oc, "offset", "int", &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 4e1b23a1d6..19a9a5b409 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" @@ -191,7 +192,8 @@ 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", NULL, + object_class_property_add(oc, "hugetlbsize", "uint64", + &uint64_type_info, memfd_backend_get_hugetlbsize, memfd_backend_set_hugetlbsize, NULL, NULL); diff --git a/backends/hostmem.c b/backends/hostmem.c index b43d6ca956..0f39f4d1b7 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", NULL, + object_class_property_add(oc, "prealloc-threads", "int", &int_type_inf= o, host_memory_backend_get_prealloc_threads, host_memory_backend_set_prealloc_threads, NULL, NULL); @@ -540,13 +540,14 @@ 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", NULL, + object_class_property_add(oc, "size", "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]", NULL, + object_class_property_add(oc, "host-nodes", "[uint16]", + &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 5d6b089092..40a49e6233 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,7 +986,8 @@ 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, properties[i].name, "int64", NULL, + object_class_property_add(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 e9cb222bf8..aa9c45f141 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", NULL, - qcrypto_secret_prop_get_key, - qcrypto_secret_prop_set_key, - NULL, NULL); + object_class_property_add(oc, "serial", "int32_t", &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 42bf09d58b..e4a57c6190 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,18 @@ 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", NULL, + object_class_property_add(klass, "aio-max-batch", "int64", + &int64_type_info, event_loop_base_get_param, event_loop_base_set_param, NULL, &aio_max_batch_info); - object_class_property_add(klass, "thread-pool-min", "int64", NULL, + object_class_property_add(klass, "thread-pool-min", "int64", + &int64_type_info, event_loop_base_get_param, event_loop_base_set_param, NULL, &thread_pool_min_info); - object_class_property_add(klass, "thread-pool-max", "int64", NULL, + object_class_property_add(klass, "thread-pool-max", "int64", + &int64_type_info, 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 f3e248c8da..91a22a8e94 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" @@ -379,7 +380,8 @@ void ich9_pm_add_class_properties(ObjectClass *oc, ptrd= iff_t pm_offset) PM_REG_FIELD(acpi_pci_hotplug.root), object_property_allow_set_link, OBJ_PROP_LINK_STRONG); - object_class_property_add(oc, ACPI_PM_PROP_GPE0_BLK, "uint32", NULL, + object_class_property_add(oc, ACPI_PM_PROP_GPE0_BLK, "uint32", + &uint32_type_info, ich9_pm_get_gpe0_blk, NULL, NULL, NULL); object_class_property_add_uint8_ptr(oc, ACPI_PM_PROP_S3_DISABLED, diff --git a/hw/acpi/pci.c b/hw/acpi/pci.c index abd1071f49..d393638d2e 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, NULL, + object_class_property_add(oc, "node", "uint32", &uint32_type_info, NUL= L, acpi_generic_initiator_set_node, NULL, NULL); object_class_property_set_description(oc, "node", "NUMA node associated with the PCI device"); @@ -253,7 +254,7 @@ 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, NULL, + object_class_property_add(oc, "node", "uint32", &uint32_type_info, NUL= L, 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 e39d77eba6..2f03679afd 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -4254,18 +4254,20 @@ 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", NULL, - virt_get_highmem_mmio_size, - virt_set_highmem_mmio_size, - NULL, NULL); + object_class_property_add(oc, "highmem-mmio-size", "size", + &size_type_info, + virt_get_highmem_mmio_size, + virt_set_highmem_mmio_size, + NULL, NULL); object_class_property_set_description(oc, "highmem-mmio-size", "Set the high memory region size= " "for PCI MMIO"); =20 - object_class_property_add(oc, "virtio-mmio-transports", "uint8", NULL, - virt_get_virtio_transports, - virt_set_virtio_transports, - NULL, NULL); + object_class_property_add(oc, "virtio-mmio-transports", "uint8", + &uint8_type_info, + virt_get_virtio_transports, + virt_set_virtio_transports, + NULL, NULL); object_class_property_set_description(oc, "virtio-mmio-transports", "Set the number of virtio-mmio t= ransports to instantiate"); =20 diff --git a/hw/core/clock.c b/hw/core/clock.c index d46c888f5c..f927354923 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,8 @@ static void clock_initfn(Object *obj) QLIST_INIT(&clk->children); =20 if (qtest_enabled()) { - object_property_add(obj, "qtest-clock-period", "uint64", NULL, + object_property_add(obj, "qtest-clock-period", "uint64", + &uint64_type_info, clock_period_prop_get, NULL, NULL, NULL); } } diff --git a/hw/core/machine.c b/hw/core/machine.c index bc03a62883..0574e4326f 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1140,7 +1140,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", NULL, + object_class_property_add(oc, "phandle-start", "int", &int_type_info, machine_get_phandle_start, machine_set_phandle_start, NULL, NULL); diff --git a/hw/cpu/core.c b/hw/cpu/core.c index f430befad8..5fae05ae37 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,10 @@ 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", NULL, + object_class_property_add(oc, "core-id", "int", &int_type_info, core_prop_get_core_id, core_prop_set_core_id, NULL, NULL); - object_class_property_add(oc, "nr-threads", "int", NULL, + object_class_property_add(oc, "nr-threads", "int", &int_type_info, core_prop_get_nr_threads, core_prop_set_nr_threads, NULL, NULL); } diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index ef7f766847..3bafda0904 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", NULL, machine_get_cxl, + object_property_add(obj, "cxl", "bool", &bool_type_info, machine_get_c= xl, 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 4463cf7c9f..f95fe0d82a 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,8 @@ 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", NULL, aspeed_gpio_get_p= in, + object_property_add(obj, name, "bool", &bool_type_info, + aspeed_gpio_get_pin, aspeed_gpio_set_pin, NULL, NULL); g_free(name); } @@ -1489,7 +1491,8 @@ 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", NULL, aspeed_gpio_get_set, + object_property_add(obj, name, "uint32", &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 aeaef4f102..6263d126ee 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,8 @@ 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", NULL, aspeed_sgpio_get_pin, + object_property_add(obj, name, "bool", &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 a31999323a..e3e5bc46e7 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", NULL, + object_property_add(obj, "disconnected-pins", "uint16", &uint16_type_i= nfo, disconnected_pins_get, disconnected_pins_set, NULL, &s->disconnected_pins); - object_property_add(obj, "clock-freq-hz", "uint32", NULL, + object_property_add(obj, "clock-freq-hz", "uint32", &uint32_type_info, clock_freq_get, NULL, NULL, NULL); } =20 diff --git a/hw/hexagon/hexagon_dsp.c b/hw/hexagon/hexagon_dsp.c index abccf10c00..eddf69545e 100644 --- a/hw/hexagon/hexagon_dsp.c +++ b/hw/hexagon/hexagon_dsp.c @@ -17,6 +17,7 @@ #include "hw/hexagon/hex-subsys.h" #include "hw/core/loader.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/error-report.h" #include "qemu/log.h" @@ -153,7 +154,8 @@ static void hexagon_sim_set_subsystem_base(Object *obj,= Visitor *v, =20 static void add_dsp_properties(ObjectClass *oc) { - object_class_property_add(oc, "subsystem-base", "uint32", NULL, + object_class_property_add(oc, "subsystem-base", "uint32", + &uint32_type_info, hexagon_sim_get_subsystem_base, hexagon_sim_set_subsystem_base, NULL, NULL); object_class_property_set_description(oc, "subsystem-base", diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 649ae27156..80940e81e5 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1718,7 +1718,8 @@ 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", NUL= L, + object_class_property_add(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "size", + &size_type_info, pc_machine_get_max_ram_below_4g, pc_machine_set_max_ram_below_4g, NULL, NULL); @@ -1757,14 +1758,16 @@ 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", NULL, + object_class_property_add(oc, PC_MACHINE_MAX_FW_SIZE, "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", NULL, + object_class_property_add(oc, PC_MACHINE_SMBIOS_EP, "str", + &str_type_info, pc_machine_get_smbios_ep, pc_machine_set_smbios_ep, NULL, NULL); diff --git a/hw/i386/sgx-epc.c b/hw/i386/sgx-epc.c index a1b55c2ec3..e5fc90db9e 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,7 +160,8 @@ static void sgx_epc_class_init(ObjectClass *oc, const v= oid *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", NULL, + object_class_property_add(oc, SGX_EPC_SIZE_PROP, "uint64", + &uint64_type_info, sgx_epc_get_size, NULL, NULL, NULL); diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 3416df13ab..b490c4e715 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -417,9 +417,9 @@ static void x86_machine_class_init(ObjectClass *oc, con= st void *data) "The string may be up to 8 bytes= in size"); =20 object_class_property_add(oc, X86_MACHINE_BUS_LOCK_RATELIMIT, "uint64_= t", - NULL, - x86_machine_get_bus_lock_ratelimit, - x86_machine_set_bus_lock_ratelimit, NULL, = NULL); + &uint64_type_info, + x86_machine_get_bus_lock_ratelimit, + x86_machine_set_bus_lock_ratelimit, NULL, NU= LL); 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 7bb06088a5..94b9147892 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", NULL, + object_property_add(obj, "bootindex", "int32", &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 ee5f6cb4c3..eab75dd169 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", NULL, + object_property_add(obj, "id", "uint32", &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 1e1271ce87..1eae2bffe6 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -1512,10 +1512,10 @@ static void virt_class_init(ObjectClass *oc, const = void *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", NULL, - virt_get_highmem_mmio_size, - virt_set_highmem_mmio_size, - NULL, NULL); + object_class_property_add(oc, "highmem-mmio-size", "size", &size_type_= info, + virt_get_highmem_mmio_size, + virt_set_highmem_mmio_size, + NULL, NULL); object_class_property_set_description(oc, "highmem-mmio-size", "Set the high memory region size= " "for PCI MMIO"); diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index 8d6e8d0bd9..04e8361348 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,7 +100,7 @@ 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", NULL, + object_property_add(obj, NVDIMM_LABEL_SIZE_PROP, "size", &size_type_in= fo, nvdimm_get_label_size, nvdimm_set_label_size, NULL, NULL); =20 diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 7250146c10..e9b872450a 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", NULL, + object_property_add(obj, PC_DIMM_SIZE_PROP, "uint64", &uint64_type_inf= o, pc_dimm_get_size, NULL, NULL, NULL); } diff --git a/hw/misc/aspeed_lpc.c b/hw/misc/aspeed_lpc.c index a73df07332..ef320875cc 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,40 +418,40 @@ static void aspeed_lpc_realize(DeviceState *dev, Erro= r **errp) =20 static void aspeed_lpc_init(Object *obj) { - object_property_add(obj, "idr1", "uint32", NULL, + object_property_add(obj, "idr1", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr1", "uint32", NULL, + object_property_add(obj, "odr1", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str1", "uint32", NULL, + object_property_add(obj, "str1", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr2", "uint32", NULL, + object_property_add(obj, "idr2", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr2", "uint32", NULL, + object_property_add(obj, "odr2", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str2", "uint32", NULL, + object_property_add(obj, "str2", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr3", "uint32", NULL, + object_property_add(obj, "idr3", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr3", "uint32", NULL, + object_property_add(obj, "odr3", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str3", "uint32", NULL, + object_property_add(obj, "str3", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr4", "uint32", NULL, + object_property_add(obj, "idr4", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr4", "uint32", NULL, + object_property_add(obj, "odr4", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str4", "uint32", NULL, + object_property_add(obj, "str4", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); } diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c index 427816b838..412aa17d2e 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", NULL, + object_property_add(obj, "ram-size", "int", &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 3ce92fad3a..a9e827e937 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", NULL, + object_property_add(obj, "max_rpm[*]", "uint32", &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 02300eaaa6..ed2c9e356c 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", NULL, + object_property_add(obj, "bootindex", "int32", &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 405010af4b..10e5d976a8 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,8 @@ static void nvme_instance_init(Object *obj) "bootindex", "/namespace@1,0", DEVICE(obj)); =20 - object_property_add(obj, "smart_critical_warning", "uint8", NULL, + object_property_add(obj, "smart_critical_warning", "uint8", + &uint8_type_info, 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 1b22f5e383..88b2e2971e 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", NULL, + object_class_property_add(class, "acpi_uid", "uint32", &uint32_type_in= fo, 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 bf4b6c4253..0951378836 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" @@ -388,22 +389,22 @@ static void i440fx_pcihost_class_init(ObjectClass *kl= ass, const void *data) dc->user_creatable =3D false; =20 object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_START, "uint32= ", - NULL, + &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", - NULL, + &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", - NULL, + &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= ", - NULL, + &uint64_type_info, i440fx_pcihost_get_pci_hole64_end, NULL, NULL, NULL); } diff --git a/hw/pci-host/pnv_phb3.c b/hw/pci-host/pnv_phb3.c index c45401d9dd..b159f93944 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", NULL, + object_class_property_add(klass, "phb-id", "uint32", &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", NULL, + object_class_property_add(klass, "chip-id", "uint32", &uint32_type_inf= o, 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 6a5d1bb227..a5e1ee2844 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" @@ -1775,12 +1776,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", NULL, + object_class_property_add(klass, "phb-id", "uint32", &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", NULL, + object_class_property_add(klass, "chip-id", "uint32", &uint32_type_inf= o, 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 027ae02066..d53441561f 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,23 @@ 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", NULL, + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32", + &uint32_type_info, q35_host_get_pci_hole_start, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32", NULL, + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32", + &uint32_type_info, q35_host_get_pci_hole_end, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64", NUL= L, + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64", + &uint64_type_info, q35_host_get_pci_hole64_start, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64", NULL, + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64", + &uint64_type_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 a33f0949d1..4054215592 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,8 +585,8 @@ 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", NULL, prop_get_index, - NULL, NULL, NULL); + object_property_add(obj, "index", "uint32", &uint32_type_info, + prop_get_index, NULL, NULL, NULL); object_property_add(obj, "fdt", "struct", NULL, prop_get_fdt, NULL, NULL, NULL); drc->state =3D drck->empty_state; diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c index 205582a91f..eae8a799f1 100644 --- a/hw/remote/vfio-user-obj.c +++ b/hw/remote/vfio-user-obj.c @@ -933,8 +933,8 @@ static void vfu_object_class_init(ObjectClass *klass, c= onst void *data) k->nr_devs =3D 0; =20 object_class_property_add(klass, "socket", "SocketAddress", - &SocketAddress_type_info, - NULL, vfu_object_set_socket, NULL, NULL); + &SocketAddress_type_info, 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/riscv/microchip_pfsoc.c b/hw/riscv/microchip_pfsoc.c index 04c48a4eda..27c7c42231 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" @@ -744,7 +745,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", - NULL, + &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 90cb36aad6..7de38f81e7 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,13 +196,14 @@ 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", NULL, + object_class_property_add(klass, "system_level", "uint64", + &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", NULL, + object_class_property_add(klass, "timestamp", "uint64", &uint64_type_i= nfo, get_timestamp, NULL, NULL, NULL); object_class_property_set_description(klass, "timestamp", diff --git a/hw/s390x/virtio-ccw-mem.c b/hw/s390x/virtio-ccw-mem.c index 1dc19ca914..c9d09237c2 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,8 @@ 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", NULL, + object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", + &size_type_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 14d79d3958..4ac7a4393d 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,16 @@ 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", NULL, adc128d818_get_ain, + object_property_add(obj, name, "int", &int_type_info, + adc128d818_get_ain, adc128d818_set_ain, NULL, NULL); g_free(name); } =20 - object_property_add(obj, "temperature", "int", NULL, + object_property_add(obj, "temperature", "int", &int_type_info, adc128d818_get_temperature, adc128d818_set_temperature, NULL, NULL); - object_property_add(obj, "ext-vref-mv", "int", NULL, + object_property_add(obj, "ext-vref-mv", "int", &int_type_info, adc128d818_get_ext_vref, adc128d818_set_ext_vref, NULL, NULL); } diff --git a/hw/sensor/adm1266.c b/hw/sensor/adm1266.c index 7927845e32..c880fca225 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", NULL, + object_property_add(obj, "vout[*]", "uint16", &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 6a7ff02617..ca66039c20 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", NULL, + object_property_add(obj, "vin", "uint16", &uint16_type_info, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_vin); =20 - object_property_add(obj, "vout", "uint16", NULL, + object_property_add(obj, "vout", "uint16", &uint16_type_info, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_vout); =20 - object_property_add(obj, "iout", "uint16", NULL, + object_property_add(obj, "iout", "uint16", &uint16_type_info, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_iout); =20 - object_property_add(obj, "pin", "uint16", NULL, + object_property_add(obj, "pin", "uint16", &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 128d721b7b..f53ee9f654 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", NULL, + object_property_add(obj, "temperature0", "int", &int_type_info, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature1", "int", NULL, + object_property_add(obj, "temperature1", "int", &int_type_info, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature2", "int", NULL, + object_property_add(obj, "temperature2", "int", &int_type_info, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature3", "int", NULL, + object_property_add(obj, "temperature3", "int", &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 1af0f2af35..dbff398d57 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", NULL, + object_property_add(obj, "vin[*]", "uint16", &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", NULL, + object_property_add(obj, "vout[*]", "uint16", &uint16_type_inf= o, 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", NULL, + object_property_add(obj, "iin[*]", "uint16", &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", NULL, + object_property_add(obj, "iout[*]", "uint16", &uint16_type_inf= o, 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", NULL, + object_property_add(obj, "pin[*]", "uint16", &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", NULL, + object_property_add(obj, "pout[*]", "uint16", &uint16_type_inf= o, 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", NULL, + object_property_add(obj, "temp1[*]", "uint16", &uint16_type_in= fo, 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", NULL, + object_property_add(obj, "temp2[*]", "uint16", &uint16_type_in= fo, 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", NULL, + object_property_add(obj, "temp3[*]", "uint16", &uint16_type_in= fo, 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 f362686b69..1045473595 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", NULL, + object_property_add(obj, "mag-x", "int", &int_type_info, lsm303dlhc_mag_get_x, lsm303dlhc_mag_set_x, NULL, NULL); =20 - object_property_add(obj, "mag-y", "int", NULL, + object_property_add(obj, "mag-y", "int", &int_type_info, lsm303dlhc_mag_get_y, lsm303dlhc_mag_set_y, NULL, NULL); =20 - object_property_add(obj, "mag-z", "int", NULL, + object_property_add(obj, "mag-z", "int", &int_type_info, lsm303dlhc_mag_get_z, lsm303dlhc_mag_set_z, NULL, NULL); =20 - object_property_add(obj, "temperature", "int", NULL, + object_property_add(obj, "temperature", "int", &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 6c2f7311ff..9e3ebf72be 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", NULL, + object_property_add(obj, "vout[*]", "uint16", &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", NULL, + object_property_add(obj, "temperature[*]", "uint16", &uint16_type_= info, max34451_get, max34451_set, NULL, diff --git a/hw/sensor/tmp105.c b/hw/sensor/tmp105.c index 98f45a49b7..ec39c31d90 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", NULL, + object_property_add(obj, "temperature", "int", &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 8e6823dfcc..0e4d0d0ec2 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", NULL, + object_class_property_add(klass, "temperature0", "int", &int_type_info, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature1", "int", NULL, + object_class_property_add(klass, "temperature1", "int", &int_type_info, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature2", "int", NULL, + object_class_property_add(klass, "temperature2", "int", &int_type_info, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature3", "int", NULL, + object_class_property_add(klass, "temperature3", "int", &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 dfd568da5e..353f81dcc0 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", NULL, + object_property_add(obj, "bootindex", "int32", &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 995b1a41ef..366f88e048 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,8 @@ static void virtio_balloon_instance_init(Object *obj) object_property_add(obj, "guest-stats", "guest statistics", NULL, balloon_stats_get_all, NULL, NULL, NULL); =20 - object_property_add(obj, "guest-stats-polling-interval", "int", NULL, + object_property_add(obj, "guest-stats-polling-interval", "int", + &int_type_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 6349337bf4..3044a807c1 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,8 @@ 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", NULL, + object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", + &size_type_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 fcfd9fa18a..cbcfdf9f13 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,13 +1534,16 @@ 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", NULL, + object_property_add(obj, VIRTIO_MEM_SIZE_PROP, "size", + &size_type_info, virtio_mem_get_size, NULL, NULL, NULL); - object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", NULL, + object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", + &size_type_info, virtio_mem_get_requested_size, virtio_mem_set_requested_size, NULL, NULL); - object_property_add(obj, VIRTIO_MEM_BLOCK_SIZE_PROP, "size", NULL, + object_property_add(obj, VIRTIO_MEM_BLOCK_SIZE_PROP, "size", + &size_type_info, virtio_mem_get_block_size, virtio_mem_set_block_si= ze, NULL, NULL); } diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c index ddeabe30f2..ca3326156f 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,8 @@ 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", NULL, \ + object_class_property_add(c, prop_name "-base", "uint64_t", \ + &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 +424,8 @@ do { = \ =20 #define OC_MEMMAP_PROP_SIZE(c, prop_name, name) \ do { \ - object_class_property_add(c, prop_name "-size", "uint64_t", NULL, \ + object_class_property_add(c, prop_name "-size", "uint64_t", \ + &uint64_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 +461,8 @@ 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", NUL= L, + object_class_property_add(oc, "pci-intx-irq-base", "uint32_t", + &uint32_type_info, xen_pvh_get_pci_intx_irq_base, xen_pvh_set_pci_intx_irq_base, NULL, NULL); @@ -468,7 +472,8 @@ do { = \ =20 #ifdef CONFIG_TPM if (xpc->has_tpm) { - object_class_property_add(oc, "tpm-base-addr", "uint64_t", NULL, + object_class_property_add(oc, "tpm-base-addr", "uint64_t", + &uint64_type_info, xen_pvh_get_tpm_base, xen_pvh_set_tpm_base, NULL, NULL); diff --git a/iothread.c b/iothread.c index 7084d336a4..3a1601e28b 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", NULL, + object_class_property_add(klass, "poll-max-ns", "int64", &int64_type_i= nfo, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_max_ns_info); - object_class_property_add(klass, "poll-grow", "int64", NULL, + object_class_property_add(klass, "poll-grow", "int64", &int64_type_inf= o, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_grow_info); - object_class_property_add(klass, "poll-shrink", "int64", NULL, + object_class_property_add(klass, "poll-shrink", "int64", &int64_type_i= nfo, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_shrink_info); - object_class_property_add(klass, "poll-weight", "int64", NULL, + object_class_property_add(klass, "poll-weight", "int64", &int64_type_i= nfo, 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 6bc43e0696..9b04b28484 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", NULL, + object_property_add(obj, "compare_timeout", "uint64", &uint64_type_inf= o, compare_get_timeout, compare_set_timeout, NULL, NULL); =20 - object_property_add(obj, "expired_scan_cycle", "uint32", NULL, + object_property_add(obj, "expired_scan_cycle", "uint32", &uint32_type_= info, compare_get_expired_scan_cycle, compare_set_expired_scan_cycle, NULL, NULL); =20 - object_property_add(obj, "max_queue_size", "uint32", NULL, + object_property_add(obj, "max_queue_size", "uint32", &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 558115b9c9..da366f48da 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,7 +239,7 @@ 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", NULL, + object_class_property_add(oc, "maxlen", "uint32", &uint32_type_info, filter_dump_get_maxlen, filter_dump_set_maxlen, NULL, NULL); object_class_property_add_str(oc, "file", file_dump_get_filename, diff --git a/net/filter-buffer.c b/net/filter-buffer.c index f56b2cfaf0..82a64a4680 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", NULL, + object_class_property_add(oc, "interval", "uint32", &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 0ef0d4d42c..39d26a17c6 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" @@ -2406,7 +2406,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", NULL, + return object_property_add(obj, name, "string", &str_type_info, get ? property_get_str : NULL, set ? property_set_str : NULL, property_release_data, @@ -2424,7 +2424,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", NULL, + return object_class_property_add(klass, name, "string", &str_type_info, get ? property_get_str : NULL, set ? property_set_str : NULL, NULL, @@ -2476,7 +2476,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", NULL, + return object_property_add(obj, name, "bool", &bool_type_info, get ? property_get_bool : NULL, set ? property_set_bool : NULL, property_release_data, @@ -2493,7 +2493,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", NULL, + return object_class_property_add(klass, name, "bool", &bool_type_info, get ? property_get_bool : NULL, set ? property_set_bool : NULL, NULL, @@ -2817,7 +2817,7 @@ object_class_property_add_bool_ptr(ObjectClass *klass= , const char *name, setter =3D property_class_set_bool_ptr; } =20 - return object_class_property_add(klass, name, "bool", NULL, + return object_class_property_add(klass, name, "bool", &bool_type_info, getter, setter, NULL, (void *)offset); } =20 @@ -2837,7 +2837,7 @@ object_property_add_uint8_ptr(Object *obj, const char= *name, setter =3D property_set_uint8_ptr; } =20 - return object_property_add(obj, name, "uint8", NULL, + return object_property_add(obj, name, "uint8", &uint8_type_info, getter, setter, NULL, (void *)v); } =20 @@ -2857,7 +2857,7 @@ object_class_property_add_uint8_ptr(ObjectClass *klas= s, const char *name, setter =3D property_class_set_uint8_ptr; } =20 - return object_class_property_add(klass, name, "uint8", NULL, + return object_class_property_add(klass, name, "uint8", &uint8_type_inf= o, getter, setter, NULL, (void *)offset); } =20 @@ -2878,7 +2878,7 @@ 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", NULL, + return object_class_property_add(klass, name, "uint8", &uint8_type_inf= o, getter, setter, NULL, (void *)v); } =20 @@ -2898,7 +2898,7 @@ 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", NULL, + return object_property_add(obj, name, "uint16", &uint16_type_info, getter, setter, NULL, (void *)v); } =20 @@ -2918,7 +2918,7 @@ object_class_property_add_uint16_ptr(ObjectClass *kla= ss, const char *name, setter =3D property_class_set_uint16_ptr; } =20 - return object_class_property_add(klass, name, "uint16", NULL, + return object_class_property_add(klass, name, "uint16", &uint16_type_i= nfo, getter, setter, NULL, (void *)offset); } =20 @@ -2939,7 +2939,7 @@ 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", NULL, + return object_class_property_add(klass, name, "uint16", &uint16_type_i= nfo, getter, setter, NULL, (void *)v); } =20 @@ -2959,7 +2959,7 @@ 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", NULL, + return object_property_add(obj, name, "uint32", &uint32_type_info, getter, setter, NULL, (void *)v); } =20 @@ -2979,7 +2979,7 @@ object_class_property_add_uint32_ptr(ObjectClass *kla= ss, const char *name, setter =3D property_class_set_uint32_ptr; } =20 - return object_class_property_add(klass, name, "uint32", NULL, + return object_class_property_add(klass, name, "uint32", &uint32_type_i= nfo, getter, setter, NULL, (void *)offset); } =20 @@ -3000,7 +3000,7 @@ 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", NULL, + return object_class_property_add(klass, name, "uint32", &uint32_type_i= nfo, getter, setter, NULL, (void *)v); } =20 @@ -3020,7 +3020,7 @@ 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", NULL, + return object_property_add(obj, name, "uint64", &uint64_type_info, getter, setter, NULL, (void *)v); } =20 @@ -3040,7 +3040,7 @@ object_class_property_add_uint64_ptr(ObjectClass *kla= ss, const char *name, setter =3D property_class_set_uint64_ptr; } =20 - return object_class_property_add(klass, name, "uint64", NULL, + return object_class_property_add(klass, name, "uint64", &uint64_type_i= nfo, getter, setter, NULL, (void *)offset); } =20 @@ -3061,7 +3061,7 @@ 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", NULL, + return object_class_property_add(klass, name, "uint64", &uint64_type_i= nfo, getter, setter, NULL, (void *)v); } =20 diff --git a/system/bootdevice.c b/system/bootdevice.c index 4fc6b4c8ed..36eb582dee 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", NULL, + object_property_add(obj, name, "int32", &int32_type_info, device_get_bootindex, device_set_bootindex, property_release_bootindex, diff --git a/system/memory.c b/system/memory.c index ac296cb0d8..56c5dd6c8a 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", NULL, + object_property_add(OBJECT(mr), "priority", "int32", &int32_type_info, memory_region_get_priority, NULL, /* memory_region_set_priority */ NULL, NULL); - object_property_add(OBJECT(mr), "size", "uint64", NULL, + object_property_add(OBJECT(mr), "size", "uint64", &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 9c869b4488..2a0f61e42d 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,8 @@ 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", NULL, prop_bool_get_false, + object_property_add(obj, name, "bool", &bool_type_info, + prop_bool_get_false, prop_bool_set_false, NULL, NULL); } =20 @@ -518,13 +520,15 @@ 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", NULL, cpu_arm_get_vq, + object_property_add(obj, name, "bool", &bool_type_info, + cpu_arm_get_vq, 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", NULL, + object_property_add(obj, "sve-default-vector-length", "int32", + &int32_type_info, cpu_arm_get_default_vec_len, cpu_arm_set_default_vec_len, NULL, &cpu->sve_default_vq); @@ -543,13 +547,15 @@ 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", NULL, cpu_arm_get_vq, + object_property_add(obj, name, "bool", &bool_type_info, + cpu_arm_get_vq, 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", NULL, + object_property_add(obj, "sme-default-vector-length", "int32", + &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 8a698a9d20..5c78a64b47 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", NULL, + object_class_property_add(oc, "eager-split-size", "size", &size_type_i= nfo, 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 79df821da8..026d074868 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,7 +1393,7 @@ 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", NULL, + object_property_add(OBJECT(cpu), "sve-max-vq", "uint32", &uint32_type_= info, cpu_max_get_sve_max_vq, cpu_max_set_sve_max_vq, NULL, NULL); =20 @@ -1529,7 +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", NULL, cpu_max_get_l0gp= tsz, + object_property_add(obj, "x-l0gptsz", "uint32", &uint32_type_info, + cpu_max_get_l0gptsz, cpu_max_set_l0gptsz, NULL, NULL); } =20 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 6a05a7144a..9ee96cbe39 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -10486,7 +10486,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", NULL, + object_class_property_add(oc, prop_name, "bool", &bool_type_info, x86_cpu_get_bit_prop, x86_cpu_set_bit_prop, NULL, fp); @@ -11009,13 +11009,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", NULL, + object_class_property_add(oc, "family", "uint64", &uint64_type_info, x86_cpuid_version_get_family, x86_cpuid_version_set_family, NULL, NULL); - object_class_property_add(oc, "model", "uint64", NULL, + object_class_property_add(oc, "model", "uint64", &uint64_type_info, x86_cpuid_version_get_model, x86_cpuid_version_set_model, NULL, NULL); - object_class_property_add(oc, "stepping", "uint64", NULL, + object_class_property_add(oc, "stepping", "uint64", &uint64_type_info, x86_cpuid_version_get_stepping, x86_cpuid_version_set_stepping, NULL, NULL); object_class_property_add_str(oc, "vendor", @@ -11024,7 +11024,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", NULL, + object_class_property_add(oc, "tsc-frequency", "int", &int_type_info, x86_cpuid_get_tsc_freq, x86_cpuid_set_tsc_freq, NULL, NULL); /* @@ -11037,7 +11037,8 @@ 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", NULL, + object_class_property_add(oc, "avx10-version", "uint8", + &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 0f71e75b60..e003e47c5b 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -7098,7 +7098,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc) object_class_property_set_description(oc, "notify-vmexit", "Enable notify VM exit"); =20 - object_class_property_add(oc, "notify-window", "uint32", NULL, + object_class_property_add(oc, "notify-window", "uint32", &uint32_type_= info, kvm_arch_get_notify_window, kvm_arch_set_notify_window, NULL, NULL); @@ -7106,7 +7106,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", NULL, + object_class_property_add(oc, "xen-version", "uint32", &uint32_type_in= fo, kvm_arch_get_xen_version, kvm_arch_set_xen_version, NULL, NULL); @@ -7115,14 +7115,16 @@ 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", NULL, + object_class_property_add(oc, "xen-gnttab-max-frames", "uint16", + &uint16_type_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", NULL, + object_class_property_add(oc, "xen-evtchn-max-pirq", "uint16", + &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 d19f98e1c7..c1c12d1125 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -3051,7 +3051,8 @@ sev_guest_instance_init(Object *obj) sev_guest->policy =3D DEFAULT_GUEST_POLICY; object_property_add_uint32_ptr(obj, "handle", &sev_guest->handle, OBJ_PROP_FLAG_READWRITE); - object_property_add(obj, "policy", "uint32", NULL, sev_guest_get_polic= y, + object_property_add(obj, "policy", "uint32", &uint32_type_info, + sev_guest_get_policy, sev_guest_set_policy, NULL, NULL); object_apply_compat_props(obj); =20 @@ -3329,7 +3330,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", NULL, + object_class_property_add(oc, "policy", "uint64", &uint64_type_info, sev_snp_guest_get_policy, sev_snp_guest_set_policy, NULL, NULL); object_class_property_add_str(oc, "guest-visible-workarounds", @@ -3353,7 +3354,7 @@ sev_snp_guest_class_init(ObjectClass *oc, const void = *data) object_class_property_add_bool(oc, "secure-tsc", sev_snp_guest_get_secure_tsc, sev_snp_guest_set_secure_tsc); - object_class_property_add(oc, "tsc-frequency", "uint32", NULL, + object_class_property_add(oc, "tsc-frequency", "uint32", &uint64_type_= info, sev_snp_guest_get_tsc_frequency, sev_snp_guest_set_tsc_frequency, NULL, NULL); } diff --git a/target/ppc/compat.c b/target/ppc/compat.c index 78f4b23122..8740c8727b 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", NULL, + object_property_add(obj, name, "string", &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 85b674217e..adb53aad96 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -29,6 +29,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,26 @@ void riscv_add_satp_mode_properties(Object *obj) { RISCVCPU *cpu =3D RISCV_CPU(obj); =20 - object_property_add(obj, "svbare", "bool", NULL, cpu_riscv_get_satp, + object_property_add(obj, "svbare", "bool", &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", NULL, cpu_riscv_get_satp, + object_property_add(obj, "sv32", "bool", &bool_type_info, + cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); } else { - object_property_add(obj, "sv39", "bool", NULL, cpu_riscv_get_satp, + object_property_add(obj, "sv39", "bool", &bool_type_info, + cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv48", "bool", NULL, cpu_riscv_get_satp, + object_property_add(obj, "sv48", "bool", &bool_type_info, + cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv57", "bool", NULL, cpu_riscv_get_satp, + object_property_add(obj, "sv57", "bool", &bool_type_info, + cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv64", "bool", NULL, cpu_riscv_get_satp, + object_property_add(obj, "sv64", "bool", &bool_type_info, + cpu_riscv_get_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 9bccd59809..21b675c74c 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 "qemu/target-info.h" @@ -541,7 +542,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", NULL, + object_property_add(obj, prop_name, "bool", &bool_type_info, cpu_get_cfg_unavailable, cpu_set_cfg_unavailable, NULL, (void *)prop_name); @@ -561,7 +562,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", NULL, + object_property_add(cpu_obj, misa_cfg->name, "bool", &bool_type_in= fo, kvm_cpu_get_misa_ext_cfg, kvm_cpu_set_misa_ext_cfg, NULL, misa_cfg); @@ -577,7 +578,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", NULL, + object_property_add(cpu_obj, multi_cfg->name, "bool", &bool_type_i= nfo, 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 df73f45829..5834ec1524 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" @@ -1478,7 +1479,7 @@ static void riscv_cpu_add_misa_properties(Object *cpu= _obj) continue; } =20 - object_property_add(cpu_obj, name, "bool", NULL, + object_property_add(cpu_obj, name, "bool", &bool_type_info, cpu_get_misa_ext_cfg, cpu_set_misa_ext_cfg, NULL, (void *)misa_cfg); @@ -1532,7 +1533,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", NULL, + object_property_add(cpu_obj, profile->name, "bool", &bool_type_inf= o, cpu_get_profile, cpu_set_profile, NULL, (void *)profile); =20 @@ -1608,7 +1609,7 @@ static void riscv_cpu_add_user_properties(Object *obj) =20 for (edata =3D isa_edata_arr; edata && edata->name; edata++) { if (edata->prop_name) { - object_property_add(obj, edata->prop_name, "bool", NULL, + object_property_add(obj, edata->prop_name, "bool", &bool_type_= info, cpu_get_multi_ext_cfg, cpu_set_multi_ext_cfg, NULL, (void *)&edata->ext_enable_offset); diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 0718df791f..abbfa96646 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" @@ -792,13 +793,14 @@ 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", NULL, get_feature, + object_class_property_add(oc, def->name, "bool", &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", NULL, + object_class_property_add(oc, def->name, "bool", &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 35fb5eca6f..e32c0eee55 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,11 +172,11 @@ 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", NULL, prop1_accessor, - prop1_accessor, + object_property_add(obj, "prop1", "uint32", &uint32_type_info, + prop1_accessor, prop1_accessor, NULL, NULL); - object_property_add(obj, "prop2", "uint32", NULL, prop2_accessor, - prop2_accessor, + object_property_add(obj, "prop2", "uint32", &uint32_type_info, + prop2_accessor, prop2_accessor, NULL, NULL); } =20 diff --git a/ui/console.c b/ui/console.c index 732b4afee0..c995abc5d1 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", NULL, + object_class_property_add(oc, "head", "uint32", &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 4fe7a6c8f4..d653178048 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,16 @@ 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", NULL, + object_class_property_add(oc, "thread-id", "uint64", + &uint64_type_info, thread_context_get_thread_id, NULL, NULL, NULL); - object_class_property_add(oc, "cpu-affinity", "[uint16]", NULL, + object_class_property_add(oc, "cpu-affinity", "[uint16]", + &uint16List_type_info, thread_context_get_cpu_affinity, thread_context_set_cpu_affinity, NULL, NULL); - object_class_property_add(oc, "node-affinity", "[uint16]", NULL, NULL, + object_class_property_add(oc, "node-affinity", "[uint16]", + &uint16List_type_info, NULL, thread_context_set_node_affinity, NULL, NULL= ); } =20 --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564565; cv=none; d=zohomail.com; s=zohoarc; b=DB/ENZOE4dWU4AttsBxCZFnGjSsfo9AfPwK4GeX36w07ERdf03bRfoAP89N4xbA7yQt0zfFZRfBD+75Z2T5l6QOusiUT4Nmw4oMz/adsAjE+Onq7bsLn0GqaiOMB4wZOf7PYnGabg9EkMnrFX/SUqunLj8ZY0X5QThH8TdOZ7zM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564565; 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=0KE0ur8sr4dIH6G6MrtUY74fbBwchNd6wmD7IyhwGNI=; b=iUrK7QS2GDoZgYW19kRWLIvqv/MPMinOqrOHBxUuwJnP/Y/R+J3saLNVU0rjq/IOuskxpxvwPPdawLETELNrLYReguGvI3ynb/qwsZplGv0Tw5uooXr43qtALp89h5ZPLmCJkg9xLJFoE2TsUcm5osTxZZ5EIHz7B+8kHxjdd7U= 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 1793564565503106.83619528697909; Sun, 1 Nov 2026 12:22:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1e-0007Kc-M7; Sun, 01 Nov 2026 15:19:34 -0500 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 1xNbzp-0004zZ-9P for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:41 -0500 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 1xNbzf-0007Cr-LY for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:41 -0500 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-68-okgGVDG2OLqi9o41tt6hCw-1; Sun, 01 Nov 2026 15:17:29 -0500 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 BA4041954AE9 for ; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 632FA1956089 for ; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4833921E6820; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564250; 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=0KE0ur8sr4dIH6G6MrtUY74fbBwchNd6wmD7IyhwGNI=; b=jWawXldd+oCf3alQlAki8n1yxsnR0hFzSKw5aM3EHfy2euEpyWrSrk4Zk/7NOckFWltUl3 zc6sBjlLe87/Zk44zfapaqWyk6Xf4xQO7QHeGVGKIfIst1R7v2nHrCZblyL62ARftxwHHq PwCIequMIHNiE1refz6wXWAzqRqhzB0= X-MC-Unique: okgGVDG2OLqi9o41tt6hCw-1 X-Mimecast-MFC-AGG-ID: okgGVDG2OLqi9o41tt6hCw_1793564248 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 37/56] i386/cpu: convert strList property to QAPI-aware registration Date: Sun, 1 Nov 2026 21:16:58 +0100 Message-ID: <20261101201717.3911097-38-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564567342158500 From: Marc-Andr=C3=A9 Lureau Pass appropriate QAPITypeInfo to object_class_property_add(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- 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 9ee96cbe39..eab0d5a4d4 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -11033,7 +11033,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", NULL, + object_class_property_add(oc, "unavailable-features", "strList", + &strList_type_info, x86_cpu_get_unavailable_features, NULL, NULL, NULL); =20 --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564586; cv=none; d=zohomail.com; s=zohoarc; b=kmUye6zhV3h9yE1uI1Ah8jDFulNPOj/z5s9FA1l93m7Th6BkaZ502DSdFYhrcn+H/5Jfv8I6FSFjkrXU1qXbEirRuPKphlDe3j5YjpbMhb8A0UPHZiU8L+5u7KaFBvNy+kkefkDWfn7lLr19UvVVKIAsxndurjzW4eEpymglIEI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564586; 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=nbkFzbV43Ns9t0XrhOPzECLv8L71VynW94wQw4V7KYw=; b=HjMQLkDyzIXkE1qzxmU+B9z2QjHXR89pB5xUkZIO1UDDHKsDrayaC++yydAcdev/RvMNf9w7Zt1fmc5RdAI5VrmTNoVpcLoKrG1k52IgZ0ytG3wyG13HTszmBkd2oeB6IU4Nw+pRvu/NKtInJm6SIlXE6dOcX+Ewfks4L7Plj2I= 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 179356458600884.3273403744297; Sun, 1 Nov 2026 12:23:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc23-0000L9-9y; Sun, 01 Nov 2026 15:20:00 -0500 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 1xNbzo-0004yw-Ub for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:41 -0500 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 1xNbzf-0007Cx-IM for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:40 -0500 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-326-br0oxW1CMwaN6AElkKCd7Q-1; Sun, 01 Nov 2026 15:17:29 -0500 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 9DD511955F45 for ; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 598FA1956087 for ; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4CDE221E6821; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564250; 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=nbkFzbV43Ns9t0XrhOPzECLv8L71VynW94wQw4V7KYw=; b=Eyv1r5+DjVmGl0z6Yt815HGQhnEMt8sg/qNVz+w0jbO8X2zx+XRGQbX62kRMy6+h1syK3I JrrAmzJQgGtPB/A33KJ+QdpmPByTDEIEZZGltgfYDw/Z3RL/E/qY16OKoNF2yRaNSUs6vh cRWkIjVnuJAJiQbKXfMrO4VJ2l47xzw= X-MC-Unique: br0oxW1CMwaN6AElkKCd7Q-1 X-Mimecast-MFC-AGG-ID: br0oxW1CMwaN6AElkKCd7Q_1793564248 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 38/56] accel/hvf: convert OnOffSplit property to QAPI-aware registration Date: Sun, 1 Nov 2026 21:16:59 +0100 Message-ID: <20261101201717.3911097-39-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564587834158500 From: Marc-Andr=C3=A9 Lureau Convert the OnOffSplit property from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- accel/hvf/hvf-all.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 213ee15b4a..938379b9f2 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,9 +268,10 @@ static void hvf_accel_class_init(ObjectClass *oc, cons= t 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, - NULL, hvf_set_kernel_irqchip, - NULL, NULL); + + object_class_property_add_enum(oc, "kernel-irqchip", "on|off|split", + &OnOffSplit_type_info, NULL, + NULL, hvf_set_kernel_irqchip); object_class_property_set_description(oc, "kernel-irqchip", "Configure HVF irqchip"); } --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564400; cv=none; d=zohomail.com; s=zohoarc; b=KjWtzil4mXFSONba0X2wijIIevUOPX7tSZ8kA2QgzcSZjGnPPWDAxmGmIS/YO3/breF4iJmSX2PBo6OmCKAyO1zXTCwFCqzyeaLAgurV+CWE8gGrF2tiVUObZU2DJV7oWz36JmVmhuCcZIzecV/gWPUQbhXV8GWocpWtsj1eI9o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564400; 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=YNVNnRsy38PowLER86CsQFj4IDtL4ciBiIqmQIIojlc=; b=Sr0JUgjyVbuvdKkk3b6C4hgBYtPsFXNQCcAukLcbACRQbNsGl6ypimu549xOHOPTcJVGH4CT2vdKHxBHsYk4jnlnlUU6OTPpv9jdDvTWd1YsKIVpfZeHw/vD0mgW2r6vTvbveA4xchVx4+b7g9sc4NJ+t5mUT3OrzT8CeN8qjHs= 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 179356440022282.97396066186877; Sun, 1 Nov 2026 12:20:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1H-0006SB-N3; Sun, 01 Nov 2026 15:19:12 -0500 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 1xNbzo-0004yn-Se for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:40 -0500 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 1xNbzf-0007D1-Jt for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:40 -0500 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-326-ExOp3K4WOz2uaH7ZA8I98Q-1; Sun, 01 Nov 2026 15:17:29 -0500 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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B8D3419560AD for ; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5DDB91800444 for ; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 51BF821E682B; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564250; 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=YNVNnRsy38PowLER86CsQFj4IDtL4ciBiIqmQIIojlc=; b=VZMVhIIKUGiOuNzGNIXg2Pq7DD6cTzydF4iHQI4lJCqEmHGiCiBAbcMto2vhTH4+J3x3z4 bUvKIu4zY5PvWzdVXlFpW1t4uppCESgvR0/V+CDP7swBGo9toI+o8pRapm9V56L713/Kku 06ysdB0UTiHwRP54xhluj3YDDThY1lI= X-MC-Unique: ExOp3K4WOz2uaH7ZA8I98Q-1 X-Mimecast-MFC-AGG-ID: ExOp3K4WOz2uaH7ZA8I98Q_1793564248 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 39/56] i386/x86: convert SgxEPCList property to QAPI-aware registration Date: Sun, 1 Nov 2026 21:17:00 +0100 Message-ID: <20261101201717.3911097-40-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564402088158500 From: Marc-Andr=C3=A9 Lureau Pass appropriate QAPITypeInfo to object_class_property_add(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- 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 b490c4e715..4e5a7cf270 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" @@ -423,7 +424,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", NULL, + object_class_property_add(oc, "sgx-epc", "SgxEPC", &SgxEPCList_type_in= fo, machine_get_sgx_epc, machine_set_sgx_epc, NULL, NULL); object_class_property_set_description(oc, "sgx-epc", --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564436; cv=none; d=zohomail.com; s=zohoarc; b=Y9/cS6u0+xfUhh2tj9fNosEECbzqGQrBfNMxfPqydIg4LGkeEgl2cS2PO1L0MbKIEYoZ3NeC/ofgApL88gVvfAF87hoKU9dkJNpuTlDDz/Xwn15LKZkWyVy98Go/2dIsZvEvMVLyLz+DcTvlBS9auQIFRxP5LdHPFSK8Z/HW8Dw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564436; 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=NC6uhmvLQ89fZfF2IyFMV1DNvqleHpRBGBmy/p89T6s=; b=TSo8iSjzn7iEYYqV097zYaZsPzek4a/SVT7lmb/1XGxGNiP4BCO+ttfIWODlvjw8BfKdmGT/PQInGWtnCSI6AGRWfyI6BEG4GASiEcv+dKmSQbzxKC47SVfj0bq5KEqjVX3Zqh8/Am5uQ2E5d3Ku2msJfmyG0zxf0EaR3Ij520A= 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 1793564436209193.09669207825414; Sun, 1 Nov 2026 12:20:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1K-0006iv-O5; Sun, 01 Nov 2026 15:19:14 -0500 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 1xNbzp-00050C-Fb for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:41 -0500 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 1xNbzf-0007Cq-FX for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:41 -0500 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-68-upkMJw51O4Kdese9Nkwoiw-1; Sun, 01 Nov 2026 15:17:29 -0500 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 E2A851956079 for ; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6AF95195608B for ; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5670721E682C; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564250; 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=NC6uhmvLQ89fZfF2IyFMV1DNvqleHpRBGBmy/p89T6s=; b=fEbwn+45bhqbah4qZhUs4BvCwPTf7n8qYEk0fjn618bVPFOsLgIA1m03jtvEhAxIjiIHMY SX0TyNtqYBaqBfjPjgoV7oSZMtEIdGz5bzhwbeAG1a+WByMcQGoTfmjyNpCUy7EUjc+/zZ 09gyfWyF3ZizfULkQCpuUFA62mnZjAs= X-MC-Unique: upkMJw51O4Kdese9Nkwoiw-1 X-Mimecast-MFC-AGG-ID: upkMJw51O4Kdese9Nkwoiw_1793564249 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 40/56] virtio-balloon: convert guest-stats property to QAPI type Date: Sun, 1 Nov 2026 21:17:01 +0100 Message-ID: <20261101201717.3911097-41-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564438943158500 From: Marc-Andr=C3=A9 Lureau 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: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- docs/interop/virtio-balloon-stats.rst | 22 +------ qapi/machine.json | 88 +++++++++++++++++++++++++++ hw/virtio/virtio-balloon.c | 85 +++++++++----------------- 3 files changed, 119 insertions(+), 76 deletions(-) diff --git a/docs/interop/virtio-balloon-stats.rst b/docs/interop/virtio-ba= lloon-stats.rst index b9a6a6edb2..88d3271bbb 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/qapi/machine.json b/qapi/machine.json index 9b145c635b..80348b5350 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1126,6 +1126,94 @@ ## { '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. The value is 0 if the guest +# has not updated the stats, yet. +# +# @stats: balloon memory statistics +# +# Since: 11.2 +## +{ 'struct': 'VirtioBalloonGuestStats', + 'data': { + 'last-update': 'int', + 'stats': 'VirtioBalloonStats' } } + ## # @query-balloon: # Return information about the balloon device. diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 366f88e048..547173e035 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,34 +172,6 @@ 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); - /* * reset_stats - Mark all items in the stats array as unset * @@ -258,33 +232,33 @@ 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= ], + }; + /* Update VirtioBalloonStats QAPI type when new stats are added */ + G_STATIC_ASSERT(VIRTIO_BALLOON_S_NR =3D=3D 16); + 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 +1011,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", NULL, + object_property_add(obj, "guest-stats", "guest statistics", + &VirtioBalloonGuestStats_type_info, balloon_stats_get_all, NULL, NULL, NULL); =20 object_property_add(obj, "guest-stats-polling-interval", "int", --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564457; cv=none; d=zohomail.com; s=zohoarc; b=aQ800P91GPpE7YavrU+7Ixm+txOwINg/yDWW7++qbaI6zTy1Y6spXdjiaWymWd0p6GGCdVC83yJJAk01oQ2twQR+c1kUArNOFSRMLcOCLG/j0Nj5af3SdunS0kWu6UpuFZ7vSrCw5kGfKmqV/2kjLgbqIEKH3dUYnsfkceenFcE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564457; 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=SU3JdHDRj00b7QAn8XE2AHEA/tfKdUQioGH0BgnkAwU=; b=O22wptq3ulstWhAIZzQ9Th8lMlI8uRPqdD3+76lgHLrmAm2hz8zxbA/Cm56k42h89jJ92K8XWwGb+8XOt++QABbbPvQy3M16vEgSXoq5I+ma/AxFuGcyCpwPIcs1HlLK1kWUxJI0uoWpW5oLcEfkelwa2P/nzgHEOyY2cf8mV4c= 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 179356445780884.78676731410928; Sun, 1 Nov 2026 12:20:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc2H-00023A-Aq; Sun, 01 Nov 2026 15:20:13 -0500 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 1xNbzu-00056V-BV for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:50 -0500 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 1xNbzi-0007Eh-9y for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:46 -0500 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-465-eqr5OyBYPpy9UDUtCww7iA-1; Sun, 01 Nov 2026 15:17:30 -0500 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 24B8719560B7; Sun, 1 Nov 2026 20:17:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9BE89767; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5B16021E6833; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564253; 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=SU3JdHDRj00b7QAn8XE2AHEA/tfKdUQioGH0BgnkAwU=; b=JqlNCAHlTMxLIqXcrg5kUSOUZtcyFQjWRIpSjYfLLinVs5FJG/gkSp7R78jUkFZrzVi2RJ MdIqxKOxBgngyZbDyaF05PphWx1bqUik5aplpIVtamqWsXeT5EvZGrZPo0WpO2X4XMqQ5I 9j9eUNoOP2zQr0nQYTAyAYbh0yhWCIw= X-MC-Unique: eqr5OyBYPpy9UDUtCww7iA-1 X-Mimecast-MFC-AGG-ID: eqr5OyBYPpy9UDUtCww7iA_1793564249 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com, Amit Machhiwal Subject: [PATCH v8 41/56] qom: replace object_property_add_tm with StructTm QAPI type Date: Sun, 1 Nov 2026 21:17:02 +0100 Message-ID: <20261101201717.3911097-42-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564459382158500 From: Marc-Andr=C3=A9 Lureau 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 pass its QAPITypeInfo to object_class_property_add() / object_property_add(), and use 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: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- qapi/common.json | 27 +++++++++++++++++ qapi/pragma.json | 1 + include/qom/object.h | 29 ------------------ hw/ppc/spapr_rtc.c | 25 ++++++++++++++-- hw/rtc/mc146818rtc.c | 23 +++++++++++++-- qom/object.c | 70 -------------------------------------------- 6 files changed, 70 insertions(+), 105 deletions(-) diff --git a/qapi/common.json b/qapi/common.json index 1352e664b2..68b649ecf2 100644 --- a/qapi/common.json +++ b/qapi/common.json @@ -218,3 +218,30 @@ ## { '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 342cedc42e..9be2819a46 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/include/qom/object.h b/include/qom/object.h index e9a67017fa..d1699964fa 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -2027,35 +2027,6 @@ ObjectProperty *object_class_property_add_enum(Objec= tClass *klass, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)); =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/hw/ppc/spapr_rtc.c b/hw/ppc/spapr_rtc.c index 1f7d2d8f89..10d4cddb42 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,9 @@ 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(OBJECT(rtc), "date", "struct tm", + &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 ba396435d1..835684abce 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,9 @@ 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(klass, "date", "struct tm", + &StructTm_type_info, + rtc_get_date, NULL, NULL, NULL); } =20 static const TypeInfo mc146818rtc_info =3D { diff --git a/qom/object.c b/qom/object.c index 39d26a17c6..637459c2b1 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2613,76 +2613,6 @@ int object_property_get_enum(Object *obj, const char= *name, return ret; } =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", NULL, - 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", NULL, - get ? property_get_tm : NULL, - NULL, NULL, prop); -} - static char *object_get_type(Object *obj, Error **errp) { return g_strdup(object_get_typename(obj)); --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564441; cv=none; d=zohomail.com; s=zohoarc; b=iKxiBTFtYJlDcNdEXi92H3lvoS5Fz6WECd/2vqz3qBpA0n6QD8GIpig3PVIOkVzELFpOR7KVpMLc+h5yTaYbevAmR01AMitM2bC40Y3IwV91MxwQz7Hj+6kh/1TsVgSNtm60D++RrAuDpCqOBy/A5xTOeJi4hMHITZ4yzRdw16c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564441; 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=BIPTANSli3F4VyEKG1sBiEBfdSybE/4cJJIxlrFt+Z4=; b=XZMbhVn8XGhZe/VPdhfgvls/ulvuoFLoCwpZ0BVyOqkfY4ao1oNCiRynxGfqlQ33vqpHAKqOVzBvUFkf/XCRcxQpGgV7haLUTleIXRdeh7mc73lllcdHRFlMAI3FscPPQOAV9O/mEyftt43qV5Ow4E4C3tgGQmGDqTYZV+2ZEBQ= 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 1793564441625626.2752484885528; Sun, 1 Nov 2026 12:20:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1H-0006Lm-0D; Sun, 01 Nov 2026 15:19:11 -0500 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 1xNbzo-0004yp-TR for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:40 -0500 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 1xNbzf-0007Cu-Kt for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:40 -0500 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-327-a7c4sjnKNQSNOZWLvkiDGg-1; Sun, 01 Nov 2026 15:17:29 -0500 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 E28AF19560B3 for ; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A4C8F7E5 for ; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5FBE621E6836; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564250; 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=BIPTANSli3F4VyEKG1sBiEBfdSybE/4cJJIxlrFt+Z4=; b=innkAv6UmIQkhb0ygix3gZPjeJQu9essrjadb1YytNbkyQ6WQR+rOcE4exeTpT+Fc8Wez1 r+4vNezWWv1hLkWt2pQwz+xvzZJ81wsiAL2lZxxw4RCqBwg72UEl/NDjx4JhVTF3EX2TDa 4F5mUZ7oL/VGikl89Y6VSGNMa5oum08= X-MC-Unique: a7c4sjnKNQSNOZWLvkiDGg-1 X-Mimecast-MFC-AGG-ID: a7c4sjnKNQSNOZWLvkiDGg_1793564249 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 42/56] hw/nvdimm: convert UUID property to QAPI-aware registration Date: Sun, 1 Nov 2026 21:17:03 +0100 Message-ID: <20261101201717.3911097-43-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564442900158500 From: Marc-Andr=C3=A9 Lureau Pass appropriate QAPITypeInfo to object_property_add(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- hw/mem/nvdimm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index 04e8361348..08086997d7 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -104,7 +104,7 @@ 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", NULL, + object_property_add(obj, NVDIMM_UUID_PROP, "QemuUUID", &str_type_info, nvdimm_get_uuid, nvdimm_set_uuid, NULL, NULL); } --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564451; cv=none; d=zohomail.com; s=zohoarc; b=nclB/digL9TqsaPYqHGj38os11qsU82gZnC5tEehKHALkp+THra0x8QHhHU4AdO8vqqqnEcoBBnDo31Gw07ZHAwT73kuNeeguGycPiL8PsLLjuPzm06PH53Jxr3hiI2MxXUslAjNaojXoluJpg/jBe6Qii29y+aEXWRyu4BaciE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564451; 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=Vg44w5tHT/SOGNvVlCcL+D/bgIpE20M0OpMKYxWv5T0=; b=ghhvr19MZwS7yqeY19bdqLI1U8sSP91rjBQR+84Hl3OW1t825mr1lVINT+sK+fY3VrdT97yrKP7UczUrwbo0OMYKv0Qx/TPtxhH36PAAyt/ju3S7SPykX3n/oYxjgUm3b7egkrnpq0RKU0OmZICloQ8JmiL1Db3r7tEWtN9jd+Y= 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 1793564451773638.7356090887787; Sun, 1 Nov 2026 12:20:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1f-0007Mb-05; Sun, 01 Nov 2026 15:19:35 -0500 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 1xNbzq-00050z-6c for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:42 -0500 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 1xNbzf-0007Cz-R6 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:41 -0500 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-465-V3ZyipqKPSeH6kmvejWonQ-1; Sun, 01 Nov 2026 15:17:29 -0500 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 C9DAC180061E for ; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 88FF41956088 for ; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6458521E6838; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564250; 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=Vg44w5tHT/SOGNvVlCcL+D/bgIpE20M0OpMKYxWv5T0=; b=ewXRHVuDOicyXCIDMDgoSSK/qpw99UgRc8hbZyPzjatIq3Kf0xnL/SxFoDZWR2bkg5XK8i 26nzCxkn+h93nUkVJieHIpTTkOX7igYSEFW2SxRqbpcVQPAa0pzwSMxv1tnrrpBBnefqVm aOHyIUoSLQnvzIN6WwCoIfDG66MjX9Q= X-MC-Unique: V3ZyipqKPSeH6kmvejWonQ-1 X-Mimecast-MFC-AGG-ID: V3ZyipqKPSeH6kmvejWonQ_1793564248 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 43/56] hw/s390-virtio-ccw: convert loadparm property to QAPI-aware registration Date: Sun, 1 Nov 2026 21:17:04 +0100 Message-ID: <20261101201717.3911097-44-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564453135158500 From: Marc-Andr=C3=A9 Lureau Pass appropriate QAPITypeInfo to object_class_property_add(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- hw/s390x/s390-virtio-ccw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 7d4392d73f..393e4d261d 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,7 @@ 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", NULL, + object_class_property_add(oc, "loadparm", "loadparm", &str_type_info, machine_get_loadparm, machine_set_loadparm, NULL, NULL); object_class_property_set_description(oc, "loadparm", --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564435; cv=none; d=zohomail.com; s=zohoarc; b=DHNicsQMZPiS298KpxyD928e9cX1IqAg9JWCCRwITMHCNyqgFI3/GwKixToxVj2V9UrjwHMHqWaXGmktM4auf8YLWUb7KJwNn+27+xQFmHbalmLAIQVOUvBhTP1cluAbp3LTQqktPROka0fzHyr9ninQjIJts7VyEdhPgChHOUk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564435; 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=h+RcLOLDrS1orOUHbRCwo+yNP1NOhjQkyQVYHhFaV2M=; b=PzlG29tBIqEZcA2GYVRtDlSngUiGQKbUlTkbc6NM76oy2PQlV0DjZcQBYOv/8TFet+33E6loZiEVDs5DZWXEak234I/imwyKjX+Ztd9KOzRhzYst2TUJ6osksI57KdDBqyrBqa1f6ToMTdh3hooO+EGhDBTvpW8ThNodKpjX8SE= 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 179356443520748.809819616288905; Sun, 1 Nov 2026 12:20:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1p-0007iD-Qf; Sun, 01 Nov 2026 15:19:45 -0500 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 1xNbzs-000549-Ul for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:44 -0500 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 1xNbzi-0007Ea-8G for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:44 -0500 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-339-IZEjRu_MPq2sepDn4L07dg-1; Sun, 01 Nov 2026 15:17:30 -0500 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 289811800646; Sun, 1 Nov 2026 20:17:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DA3477E7; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 68DD621E6839; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564253; 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=h+RcLOLDrS1orOUHbRCwo+yNP1NOhjQkyQVYHhFaV2M=; b=Z4l4PKty0Oz1MA8P10jh6/EBM0TH+wDhlJWyrso1NP/RDyxoWYKKB1TP/H2PC71e2083mP fhceHGmh8Ap/TicsFfIx8vsjYwGY2dQAPgYlOebAq3oWMDgqNdsTPrbXW0h4IdN87+QT/0 amdZYjVaAmUTIphyxf3CsWGvT+9TBcA= X-MC-Unique: IZEjRu_MPq2sepDn4L07dg-1 X-Mimecast-MFC-AGG-ID: IZEjRu_MPq2sepDn4L07dg_1793564249 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com, Amit Machhiwal Subject: [PATCH v8 44/56] hw/ppc/spapr_drc: convert fdt property to QAPI-aware registration Date: Sun, 1 Nov 2026 21:17:05 +0100 Message-ID: <20261101201717.3911097-45-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564436766158500 From: Marc-Andr=C3=A9 Lureau 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: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- 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 4054215592..7663f232e0 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(obj, "index", "uint32", &uint32_type_info, prop_get_index, NULL, NULL, NULL); - object_property_add(obj, "fdt", "struct", NULL, prop_get_fdt, + object_property_add(obj, "fdt", "struct", &any_type_info, prop_get_fdt, NULL, NULL, NULL); drc->state =3D drck->empty_state; } --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564585; cv=none; d=zohomail.com; s=zohoarc; b=RyHOEk/JRl6dc4zddvaE0tGnDFXmNW3CI9oay7PWY6w10k38K/USlosJwGHkUywwUrljo5+pYQjdYejBZefBb3B3IUf+TClBdf1V24Wnn8wPxEEzzmJnYNrz28CQwTgaLdG6rpvfjwbuzwHUOxLph+dXtjzqw6LhxI5F09ZZhQI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564585; 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=kHozXC4SK++PhxLre4qDSyx0nMyS+xLF7H8PRlPOPO4=; b=jqdCT+Hmd2Bdctbx11bK3RV2dvTpBSV+72/KP9xdUF0fNq16I7BO+nXiQtQc21psLb+nbjRIoxHU/88YipgsnA3lTMh/lSMivTXEsK708gQ+H3t/kVQr0LSHUiomVddH3q9Xn0Nze0L7QuaZk9XAv+EJ/iONq8bjR50JYy8Iqxc= 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 1793564585805300.37829839834615; Sun, 1 Nov 2026 12:23:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc2F-0001vj-J6; Sun, 01 Nov 2026 15:20:12 -0500 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 1xNbzq-00050y-5S for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:42 -0500 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 1xNbzf-0007D4-Se for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:41 -0500 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-15-kSX6lz1lOJWEzg2W0V6b_g-1; Sun, 01 Nov 2026 15:17:29 -0500 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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 051A51956056 for ; Sun, 1 Nov 2026 20:17:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B424E180057F for ; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6D67321E683B; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564251; 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=kHozXC4SK++PhxLre4qDSyx0nMyS+xLF7H8PRlPOPO4=; b=gaiEDb/8/oN8KKRQJVF9EODxWHNiN7f+y2Zq/lpoSwBmFRq8ioHyeL1IeNJDGI02wF3ZVy vmB49eUw8UlgENFMpDI67kIconw384Zn4yf4xCWaV2JFg9EidnfFQVfDb03wCX0FWLSm9Y QW7VHDZzuGKW1CYRXymgfibxvTHWZLM= X-MC-Unique: kSX6lz1lOJWEzg2W0V6b_g-1 X-Mimecast-MFC-AGG-ID: kSX6lz1lOJWEzg2W0V6b_g_1793564249 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 45/56] hw/s390x: convert BootCertificatesList to QAPI-aware registration Date: Sun, 1 Nov 2026 21:17:06 +0100 Message-ID: <20261101201717.3911097-46-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564587822158500 From: Marc-Andr=C3=A9 Lureau Pass appropriate QAPITypeInfo to object_class_property_add(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- 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 393e4d261d..3b197e7dc6 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" @@ -917,7 +918,8 @@ static void ccw_machine_class_init(ObjectClass *oc, con= st void *data) " to upper case) to pass to machine loader, boot manager," " and guest kernel"); =20 - object_class_property_add(oc, "boot-certs", "BootCertificatesList", NU= LL, + object_class_property_add(oc, "boot-certs", "BootCertificatesList", + &BootCertificatesList_type_info, machine_get_boot_certs, machine_set_boot_cer= ts, 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 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564558; cv=none; d=zohomail.com; s=zohoarc; b=W7ASGeEg4U8nGBqJiB3Z2JuI29CE+LOraRA3uyGbzhNH6xUykqJwB390j8jgRLdroICJVxHA/qhxzVQLhAKtlddZF/LbNds7A+AnBfGVGD2LbJAR5uNFRoY6kMrKRGmKJok6mRqsQyJLAjR5ULBpQJz4V+iSW9GeCfq/UBrHg+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564558; 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=KZpiKhqNzVyATfqxqIeSxPHElC8txIX3dvwQKhHu1Ws=; b=mQmrK0hFI7qZhEEDGdGrc/Qx1XF2wCPX3u4ppnB7WHXJPaV2fnlkNPT8blSppd8R634zsXa71PbJTguGMcSiFoU8bS4sALQjazXLbYgLwps87nPqOlNMOa9HBC/dnUWx8kDSD4bqtu4UzmN2SxtiFfqPmkQ0M/wcSbxMiH7siZM= 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 1793564558129464.45602123887204; Sun, 1 Nov 2026 12:22:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc25-0000ci-2V; Sun, 01 Nov 2026 15:20:01 -0500 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 1xNbzr-00051k-5N for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:43 -0500 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 1xNbzg-0007DC-1C for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:42 -0500 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-68-1o_eFy5HM9Wbwh6seFBC9A-1; Sun, 01 Nov 2026 15:17:30 -0500 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 2FC9718005B9 for ; Sun, 1 Nov 2026 20:17:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A4F4E18004D2 for ; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 71F0321E683C; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564251; 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=KZpiKhqNzVyATfqxqIeSxPHElC8txIX3dvwQKhHu1Ws=; b=YMgRhlT51GdzZziF1sTg261AVNJ8+4VPHzRut//bMSH84wKkYXRXSlZCAOb2AsaE1tdVak D5Da068fLMZdQkTzLUd7HZBv8QfLaj6MIicO5f6TOkSl4mZtUjNPpWSbzRC7VPv5y9ih4Q jm2rtfvwflc05Nffxuju8nhPFtt0ABQ= X-MC-Unique: 1o_eFy5HM9Wbwh6seFBC9A-1 X-Mimecast-MFC-AGG-ID: 1o_eFy5HM9Wbwh6seFBC9A_1793564249 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 46/56] qdev: add qapi_type field to PropertyInfo with fallback registration Date: Sun, 1 Nov 2026 21:17:07 +0100 Message-ID: <20261101201717.3911097-47-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564559276158500 From: Marc-Andr=C3=A9 Lureau Add a qapi_type field to PropertyInfo to prepare for the transition from string-based type metadata to QAPI type-info. Update qdev_property_add_static() and qdev_class_add_property() to pass qapi_type instead of NULL to object_property_add() and object_class_property_add(). 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 this patch is no-op for now. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- include/hw/core/qdev-properties.h | 1 + hw/core/qdev-properties.c | 26 +++++++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-prope= rties.h index eba5436e53..1ea2ba66bb 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); diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 61dca80c95..71580c04e4 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) @@ -1150,7 +1160,8 @@ void qdev_property_add_static(DeviceState *dev, const= Property *prop) =20 assert(!prop->info->create); =20 - op =3D object_property_add(obj, prop->name, prop->info->type, NULL, + op =3D object_property_add(obj, prop->name, prop->info->type, + prop->info->qapi_type, field_prop_getter(prop->info), field_prop_setter(prop->info), prop->info->release, @@ -1176,7 +1187,8 @@ static void qdev_class_add_property(DeviceClass *klas= s, 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, NULL, + op =3D object_class_property_add(oc, name, prop->info->type, + prop->info->qapi_type, field_prop_getter(prop->info), field_prop_setter(prop->info), prop->info->release, --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564406; cv=none; d=zohomail.com; s=zohoarc; b=CNs157uBvxU8WbWeh7zZGra8xnKyPqcA2hOQ0+yDeYxrdJod3h+PfMI4UoFvyxyoX4Gv3S554KfXODBzxei1CqHleZ8XtFdT9ZHKy1oF8qVGjgu4qAD2Vm3WCkWXcxCnRtlAvOR/ZgkDzkdzsHuGXWe+704Y0Z2TfsPserTCcFI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564406; 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=jrDnop3TsuHTACNEx0TkMuRani/ukcNR+pTnpBzXEzc=; b=VvZZhk1eHdbn67aeIpJRCjwIYQoPYusL6JvadIFeksISd7RU36Q7eRiT7KOlMRIyY7DqK2ajwYPKR0anGj5PRFtjf37zqPAeoGZzUOUj6tc02W67BR1XL3rlFcgfCJBWgAOQbZuColswuwCwHFt3AMZwIR8jFdtEYajar+6f/24= 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 1793564406410813.0203890698456; Sun, 1 Nov 2026 12:20:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1c-00076Z-QY; Sun, 01 Nov 2026 15:19:33 -0500 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 1xNbzr-00051q-Mz for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:43 -0500 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 1xNbzg-0007DW-4U for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:43 -0500 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-326-QDA7lAcjPTecQPSJMIOoeA-1; Sun, 01 Nov 2026 15:17:30 -0500 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 468B018005BF for ; Sun, 1 Nov 2026 20:17:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BEB6630002CB for ; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 76DB121E683D; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564251; 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=jrDnop3TsuHTACNEx0TkMuRani/ukcNR+pTnpBzXEzc=; b=gZYSwhXKYIFTR+cxCktZDUzEpzOr6VrWlXjwmefdfNHSNSJFLQQXMw3TwblurgYBKB1xP3 80M+oe1S1571UnpIL0mdkJiWuM1+y9q+9RZDjbk34CpjERNb0DuensT9Frykuaxn7RNKjP F3bTdDrXwvxbKjVaHp9W0/DgLdSmnM4= X-MC-Unique: QDA7lAcjPTecQPSJMIOoeA-1 X-Mimecast-MFC-AGG-ID: QDA7lAcjPTecQPSJMIOoeA_1793564249 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 47/56] qdev: convert core PropertyInfo definitions to use qapi_type Date: Sun, 1 Nov 2026 21:17:08 +0100 Message-ID: <20261101201717.3911097-48-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564408257158500 From: Marc-Andr=C3=A9 Lureau Add a .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. It's strange to use type &size_type_info 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 properties are left for later. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- hw/core/qdev-properties.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 71580c04e4..f891fc78ae 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) @@ -182,6 +184,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, @@ -232,6 +235,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, @@ -294,8 +298,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, @@ -323,6 +327,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, @@ -363,6 +368,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, @@ -390,6 +396,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, @@ -435,6 +442,7 @@ static void set_int32(Object *obj, Visitor *v, const ch= ar *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, @@ -442,6 +450,7 @@ const PropertyInfo qdev_prop_uint32 =3D { =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, @@ -487,6 +496,7 @@ static void set_int64(Object *obj, Visitor *v, const ch= ar *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, @@ -494,6 +504,7 @@ const PropertyInfo qdev_prop_uint64 =3D { =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, @@ -516,6 +527,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, }; @@ -552,6 +564,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, @@ -596,6 +613,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, @@ -605,8 +623,8 @@ const PropertyInfo qdev_prop_string =3D { =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, @@ -648,6 +666,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, @@ -1061,6 +1080,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, @@ -1143,6 +1163,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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564626; cv=none; d=zohomail.com; s=zohoarc; b=YG3+8/C+Z1x+qTQayLldaRyUMxq10Ij/W2q3SDCKi3qazL/PNxJj5uk5dGCIMnHykKmOSMcdNjMB0oy9vzkiKQvBzLxtB/sBASCrjRl1P45Es68UiPYM/jqogN/R/go6n4/0NR1DCAjyWP7FFEDzKLz73IIhyw5FXV4LVjTcED4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564626; 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=zOS9y0YqTxn2phsAqv9j41s9qyi20VmW9wn8ndp4of0=; b=Iz9DvIvwu0uO2uu8TPE1zQhXGCcFKdzHHM4KVhFyKCJDOQHhhp2j4rDO8W37HIIWq+JKg3hpbie2XrGqwDZd2LkAcW+GcGXcwpJDviUcbhQAV9yGSFgwDGZjRihPszkoYLLiIEUGrnlmVqiCPcoupLrXUfw+3+2bEAU2i2Ro5+A= 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 179356462675040.41295250426231; Sun, 1 Nov 2026 12:23:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc2I-0002BM-Kv; Sun, 01 Nov 2026 15:20:14 -0500 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 1xNbzs-00052Z-Ce for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:44 -0500 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 1xNbzg-0007DL-48 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:44 -0500 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-465-1IWwMN0fN9iVn6KxF8b9PA-1; Sun, 01 Nov 2026 15:17:30 -0500 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 2A75E1954AE1 for ; Sun, 1 Nov 2026 20:17:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A4FAE7E6 for ; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 7BAE421E683E; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564251; 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=zOS9y0YqTxn2phsAqv9j41s9qyi20VmW9wn8ndp4of0=; b=KuI7ChcNGt8y/mwbmskYT30GXy7Fh/TRsn5L/4b2Zf4gzZT4ScWjY915L5aVwExu1eCFdE /cxQBLfdHr3qjQC1Pc4sbTzMjTqOkU2Kx8iSzWVmim3ND0J+Bpfxa9Ajz94F91pNXBvc86 nEe34oXW+qzLHLCV8Ka073np7mplCmU= X-MC-Unique: 1IWwMN0fN9iVn6KxF8b9PA-1 X-Mimecast-MFC-AGG-ID: 1IWwMN0fN9iVn6KxF8b9PA_1793564249 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 48/56] qdev: convert system PropertyInfo definitions to use qapi_type Date: Sun, 1 Nov 2026 21:17:09 +0100 Message-ID: <20261101201717.3911097-49-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564628747158500 From: Marc-Andr=C3=A9 Lureau Add a .qapi_type pointer on all PropertyInfo definitions in qdev-properties-system.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. 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: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- hw/core/qdev-prop-internal.h | 2 + hw/core/qdev-properties-system.c | 71 +++++++++++++++++++++----------- hw/core/qdev-properties.c | 2 +- 3 files changed, 51 insertions(+), 24 deletions(-) diff --git a/hw/core/qdev-prop-internal.h b/hw/core/qdev-prop-internal.h index d7b77844fe..c190b7b88c 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 5bfdfe1ab9..8924f84806 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" @@ -239,6 +240,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, @@ -248,6 +250,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, @@ -316,6 +319,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, @@ -390,6 +394,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, @@ -478,6 +483,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, @@ -515,6 +521,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 +591,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 @@ -605,8 +613,8 @@ QEMU_BUILD_BUG_ON(sizeof(LostTickPolicy) !=3D sizeof(in= t)); =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, @@ -632,6 +640,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, @@ -645,8 +654,8 @@ QEMU_BUILD_BUG_ON(sizeof(BlockdevOnError) !=3D sizeof(i= nt)); =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, @@ -658,9 +667,9 @@ QEMU_BUILD_BUG_ON(sizeof(BiosAtaTranslation) !=3D sizeo= f(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, @@ -670,8 +679,8 @@ const PropertyInfo qdev_prop_bios_chs_trans =3D { =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, @@ -681,9 +690,9 @@ const PropertyInfo qdev_prop_fdc_drive_type =3D { =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, @@ -695,8 +704,8 @@ 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, @@ -708,8 +717,8 @@ 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, @@ -717,8 +726,8 @@ const PropertyInfo qdev_prop_granule_mode =3D { =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, @@ -730,8 +739,8 @@ 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, @@ -743,8 +752,8 @@ 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, @@ -825,6 +834,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,7 +914,16 @@ static char *print_pci_devfn(Object *obj, const Proper= ty *prop) } =20 const PropertyInfo qdev_prop_pci_devfn =3D { + /* + * Both .type and .qapi_type are inaccurate. We actually accept + * string or integer. The natural QAPI type would be an + * alternate, but QAPI refuses this combination, because it + * wouldn't work with the QObject input keyval visitor. + * set_pci_devfn() bypasses this restriction by doing it manually. + * It can pick integer only with JSON input (QMP). + */ .type =3D "str", + .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,6 +1030,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,8 +1041,8 @@ const PropertyInfo qdev_prop_pci_host_devaddr =3D { =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, @@ -1061,7 +1081,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, @@ -1071,8 +1092,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,8 +1124,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, @@ -1146,7 +1167,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, @@ -1156,8 +1178,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,8 +1213,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,6 +1263,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,8 +1277,8 @@ QEMU_BUILD_BUG_ON(sizeof(S390CpuEntitlement) !=3D siz= eof(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,6 +1322,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,8 +1334,8 @@ const PropertyInfo qdev_prop_iothread_vq_mapping_list= =3D { =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, @@ -1319,8 +1343,8 @@ const PropertyInfo qdev_prop_endian_mode =3D { =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,6 +1388,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 f891fc78ae..fb11eb1f1c 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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564474; cv=none; d=zohomail.com; s=zohoarc; b=IymH4YvvIlQcy1EJ5QchIDrJnG4n2nJERcxI0xPb8/ciBdXsrsZviWeWFb1tuLtjBX06b5Vvoeq/lITnsThKnfRRuT2jziNUZb0IKPMiSObmE5EXpfTUmpvD7gzTjnBMTMG+OqFeQdPFQb9c7VIP+Ozm2tUJxCaGYzd+Q8ufd+s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564474; 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=JeFlJKvXhLiiDJb7ON7nTTGjSqZFkZ8LoJ9RHte+nF4=; b=B06TAfwO6DRfMrsIvzMjnAY4cxVESFC40Aovp5N90uGzX3nvCYrQuHSi2pg8sWplqFOdEBMAP7GSW+DFz8avOopmdzdnckVfYhReStKRXdF6U0HyPFIzPT02SjnetyqESOLvnxonRroWApPdLrkm9jgEy57pe0vAJSv+Xfq9gK4= 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 1793564473988606.6672494597284; Sun, 1 Nov 2026 12:21:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1E-000658-Si; Sun, 01 Nov 2026 15:19:09 -0500 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 1xNbzr-00051j-5N for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:43 -0500 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 1xNbzg-0007DG-0F for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:42 -0500 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-326-qQ0aQNJ5NaOwnt1Ulz_4tg-1; Sun, 01 Nov 2026 15:17:29 -0500 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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 130871955F41 for ; Sun, 1 Nov 2026 20:17:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 920361800480 for ; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8048321E683F; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564251; 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=JeFlJKvXhLiiDJb7ON7nTTGjSqZFkZ8LoJ9RHte+nF4=; b=ZFInMrlsKTbXmmj8/WQU5Z7nsSyqcMwJuYPfC8HZ19isJ3GXafhIwXWlUyPft6bIeGn9JN C67qUYCErM4VtP6Eud+ATfvli+6vQS2dSQccjdmM5auovNy2Gb9grQvHlvm2+uFtDnEon4 15SxwTcHzvp061/t3WAKRjNBvbjMJD4= X-MC-Unique: qQ0aQNJ5NaOwnt1Ulz_4tg-1 X-Mimecast-MFC-AGG-ID: qQ0aQNJ5NaOwnt1Ulz_4tg_1793564249 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 49/56] hw: convert device-local PropertyInfo definitions to use qapi_type Date: Sun, 1 Nov 2026 21:17:10 +0100 Message-ID: <20261101201717.3911097-50-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564475887158500 From: Marc-Andr=C3=A9 Lureau Add a .qapi_type pointer to PropertyInfo definitions in device-specific files. Mechanical, except for "display_mode" in apple-gfx.m, which is a string of a specific format. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- hw/block/xen-block.c | 2 ++ hw/misc/xlnx-versal-trng.c | 2 ++ hw/nvme/nguid.c | 2 ++ hw/nvram/xlnx-bbram.c | 2 ++ hw/nvram/xlnx-efuse.c | 2 ++ hw/pci/pci.c | 2 ++ hw/s390x/ccw-device.c | 2 ++ hw/s390x/css.c | 3 +++ hw/s390x/s390-pci-bus.c | 2 ++ hw/vfio/pci-quirks.c | 2 ++ hw/display/apple-gfx.m | 2 ++ 11 files changed, 23 insertions(+) diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c index 474c12fe4a..ffdb080657 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) @@ -664,6 +665,7 @@ invalid: */ 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/misc/xlnx-versal-trng.c b/hw/misc/xlnx-versal-trng.c index 0584ee089e..3204e083ea 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 @@ -663,6 +664,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 4cd6fad6ac..ccc12ac9f9 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 @@ -180,6 +181,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 e336874bde..8e7597621d 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 @@ -487,6 +488,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 03c9fbc0d0..7d2030f7aa 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 @@ -252,6 +253,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 0efb4eb4bb..0f4c900991 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" @@ -81,6 +82,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", + .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 25c4273279..54766f53e1 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) { @@ -75,6 +76,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 65341c68c3..44805ceb49 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; @@ -2531,6 +2532,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, @@ -2539,6 +2541,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 cdd75cdfd2..6703d4c1cb 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) { @@ -1852,6 +1853,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 c5b4f9091d..a38a0e7a3a 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 @@ -1437,6 +1438,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, diff --git a/hw/display/apple-gfx.m b/hw/display/apple-gfx.m index be0061b9db..4db80f0b10 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" @@ -872,6 +873,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", --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564467; cv=none; d=zohomail.com; s=zohoarc; b=mUdHEoVR5yOUz7Wp0ywRM9Jv7jtx3wUnHD6ddA95wl4cn/4AXGdE0XcdsNpLPmKK8KqW0yryRsZhhkWEGeNGlE6Pnr/SEOlE382yHfxpkeGwSRLlXSTgx1SWEmkYpnPo2QZvHkOvV8PfMBdwo4MR1hn4SJ5InzTKDaCLWgMLvv0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564467; 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=z6QtiCWszoDvq+oJvCKXSbkcKh+jiykbh8awKa6VF8s=; b=e1AFAkNZT4AACVuqjKOhapaotijysy+PTmzgYu7vq0ORkmFQWv3HDkqJDXm9BjNBtw45cOjGzHDkxxWJCWc1RhBn+l3ktMPlQtYLjDNpmKE+TLFagsMhwLyhTGVVH2w3y88H3MrdmWkdxawXrIBTqKmLts/cuqZOL732JgPMsSg= 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 1793564467093644.9421588040947; Sun, 1 Nov 2026 12:21:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc2E-0001iz-7d; Sun, 01 Nov 2026 15:20:10 -0500 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 1xNbzu-00056p-LC for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:50 -0500 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 1xNbzi-0007Ec-8k for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:46 -0500 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-467-vOc-9bqsNA2mXUq7mnfzIA-1; Sun, 01 Nov 2026 15:17:30 -0500 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 494FC1955F43; Sun, 1 Nov 2026 20:17:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BE3FD1956086; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 84E9A21E6742; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564253; 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=z6QtiCWszoDvq+oJvCKXSbkcKh+jiykbh8awKa6VF8s=; b=OeTtuTgx4LzDG4PSCaMP8XJ8feXvORPJvYTuT/hRukmtZ6y6FzF23RvlrvByAXOJk5LZFu V0Au8feMZb8f800jucvi9rW+ZMi8FsXx1U3s4ERzyZocSKOZ56vgGlftugkfSzZ3qUSax5 xG/nXUbTD832Xzg/4zVyV+Pv0ZPDakU= X-MC-Unique: vOc-9bqsNA2mXUq7mnfzIA-1 X-Mimecast-MFC-AGG-ID: vOc-9bqsNA2mXUq7mnfzIA_1793564249 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com, Alistair Francis Subject: [PATCH v8 50/56] target/riscv: convert PropertyInfo definitions to use qapi_type Date: Sun, 1 Nov 2026 21:17:11 +0100 Message-ID: <20261101201717.3911097-51-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564469531158500 From: Marc-Andr=C3=A9 Lureau Mechanically add a .qapi_type pointer to PropertyInfo definitions in target/riscv/cpu.c. Reviewed-by: Alistair Francis Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- target/riscv/cpu.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index adb53aad96..362e561809 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1730,6 +1730,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, @@ -1772,6 +1773,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, @@ -1804,6 +1806,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, @@ -1837,6 +1840,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, @@ -1877,6 +1881,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, @@ -1915,6 +1920,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, @@ -1991,6 +1997,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, @@ -2024,6 +2031,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, @@ -2108,6 +2116,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, @@ -2144,6 +2153,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, @@ -2180,6 +2190,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, @@ -2216,6 +2227,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, @@ -2252,6 +2264,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, @@ -2288,6 +2301,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, @@ -2345,6 +2359,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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564451; cv=none; d=zohomail.com; s=zohoarc; b=K8T6QQq4kjcAwE+H+9Ag1n7mlB3pPjq7F8WlhMurGrqdJEWj2UK0s2A3zgITWJ8qlvwtxuZU4Cs6n9Xdl01Tz5h8a6TKQPClxlWADljflIPey5Fxk9cNQzVZix353ZpL5svCURI/dqKrMvzkV82Knn9T3VpkAdg1FaF8xkV4cPc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564451; 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=YEJqVZbU+S4UhP1/wICxl7VYtJ1cRub3UT3PVWt9/ek=; b=CITn82npCb/W6aK2NvV9kbWY/W2RieG0eemW5aP4ipZ99aKehZVGH21ZhcpanfIvTRGjd+2MRrkrzO+di5N6lyjH+RRDuDPrQr2w5cdxkz+RWvqM5Ucidw7iZx9YWi0/AmguCB2PjqEeaHbG0Q0+0nvF6H0SNKCt2LR+xBiU0OU= 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 1793564451066459.16724121219977; Sun, 1 Nov 2026 12:20:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc2R-0002y2-F1; Sun, 01 Nov 2026 15:20:23 -0500 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 1xNbzt-00054t-7k for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:45 -0500 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 1xNbzi-0007Ef-8j for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:44 -0500 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-120-1WVgtnUvMgaLNBQqZVv0lg-1; Sun, 01 Nov 2026 15:17:30 -0500 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 410CA1800660; Sun, 1 Nov 2026 20:17:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F3A4E1800257; Sun, 1 Nov 2026 20:17:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8976C21E66D7; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564253; 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=YEJqVZbU+S4UhP1/wICxl7VYtJ1cRub3UT3PVWt9/ek=; b=a+sahufrRWHKnfX59zgHpeS4n01VNweoRHFYwnqilNup+VwHHPApQLXy5ZjtTNtv7UmuXQ 8ccdTD0wGz38OU05deAfTWbcMl5ntHn/CCkPeKzE6CC+Up5/kHwCJAld8DbrX0aaYRY0oq AqA4BB31+WxbACt0YpU86bM0uUzINOQ= X-MC-Unique: 1WVgtnUvMgaLNBQqZVv0lg-1 X-Mimecast-MFC-AGG-ID: 1WVgtnUvMgaLNBQqZVv0lg_1793564249 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com, Stefan Berger Subject: [PATCH v8 51/56] qdev: convert PropertyInfo definitions to use qapi_type Date: Sun, 1 Nov 2026 21:17:12 +0100 Message-ID: <20261101201717.3911097-52-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564453176158500 From: Marc-Andr=C3=A9 Lureau Add a .qapi_type pointer to 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 (left for later). Reviewed-by: Stefan Berger Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- backends/spdm-socket.c | 3 ++- backends/tpm/tpm_util.c | 2 ++ migration/options.c | 3 +++ target/sparc/cpu.c | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/backends/spdm-socket.c b/backends/spdm-socket.c index 826efc276d..e1d5626062 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) @@ -254,8 +255,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 7019f7fd3e..e52f342933 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 @@ -78,6 +79,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 46d040fc3f..1be4151ea7 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 @@ -295,6 +297,7 @@ static void set_default_value_tls_opt(ObjectProperty *o= p, const Property *prop) */ 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 28ae629d50..7729413698 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 @@ -950,6 +951,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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564380; cv=none; d=zohomail.com; s=zohoarc; b=l4EY8m17Eil/h3OyluoUwVUn28CArewQNiPuI+bIlVkofOCIecGDfWBKHTsJ1n2783vcG2Xy2Zq0CsfsT+t/Jn2vQS/F/9VzMz6kfg60vERi3nEDEFqEjl3TEbX15k7p0QLtZE2UYUjdwxEAbxHdx+DcFbWiZMS6oQJjB9Zao1w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564380; 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=vKqovksfWyrjKtj6Nr7wZIaZQ6wRKBpciNiIrh6QNoM=; b=dMXduEvkw9CdFenTuu8SAirShN6TBOZ5WuumGwmlEkb/w5BTwDy4Y0uq7vuslroTrIPdznnWfqhqQ/0ihb1+sbTbzbKHixQcmqshCEK6p/kKcxon4xjnB2Lo53xrj0N7jdYHEkM+Ir30Qq6Vfy4pLSlHHTK5grb1TBSKkOKQtgs= 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 1793564380046674.3140252378369; Sun, 1 Nov 2026 12:19:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1O-0006o0-51; Sun, 01 Nov 2026 15:19:21 -0500 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 1xNbzr-000521-Pw for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:43 -0500 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 1xNbzg-0007Dt-CI for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:43 -0500 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-467-rs15mcKfMe6tkdwQtVRNhg-1; Sun, 01 Nov 2026 15:17:30 -0500 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 8D3B31800741 for ; Sun, 1 Nov 2026 20:17:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0CD601956088 for ; Sun, 1 Nov 2026 20:17:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8DEEE21E66D8; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564251; 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=vKqovksfWyrjKtj6Nr7wZIaZQ6wRKBpciNiIrh6QNoM=; b=OhtjbAqjRxC8ag6vVZUwEMWoQuAAqyBavuv3pnvAuxOhd+TVhhUIhdD+LNYnPsvd34+HWl 0ndrKoBgYxR+BnKkeq5wmiVBAy6WL2srsdH9Mz89sDgFBXxclccah7iIthi0vB4WcXQYv/ gKIkeTy8tKFwUwvYCdxsdWr112MlcE0= X-MC-Unique: rs15mcKfMe6tkdwQtVRNhg-1 X-Mimecast-MFC-AGG-ID: rs15mcKfMe6tkdwQtVRNhg_1793564249 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 52/56] qdev: PropertyInfo.enum_table is no longer used, drop Date: Sun, 1 Nov 2026 21:17:13 +0100 Message-ID: <20261101201717.3911097-53-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564381761158500 From: Marc-Andr=C3=A9 Lureau Now that all PropertyInfo for enums definitions use .qapi_type, remove the legacy .enum_table field from PropertyInfo, along with the qdev_propinfo_enum_lookup() helper. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- hw/core/qdev-prop-internal.h | 2 -- include/hw/core/qdev-properties.h | 1 - hw/core/qdev-properties-system.c | 12 +++++------- hw/core/qdev-properties.c | 17 ++++------------- 4 files changed, 9 insertions(+), 23 deletions(-) diff --git a/hw/core/qdev-prop-internal.h b/hw/core/qdev-prop-internal.h index c190b7b88c..d7b77844fe 100644 --- a/hw/core/qdev-prop-internal.h +++ b/hw/core/qdev-prop-internal.h @@ -8,8 +8,6 @@ #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/include/hw/core/qdev-properties.h b/include/hw/core/qdev-prope= rties.h index 1ea2ba66bb..a57291a5a1 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -33,7 +33,6 @@ struct Property { 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); diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 8924f84806..4d605c2056 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -592,7 +592,7 @@ static void qdev_propinfo_set_losttickpolicy(Object *ob= j, Visitor *v, int value; =20 if (!visit_type_enum(v, name, &value, - qdev_propinfo_enum_lookup(prop->info), errp)) { + prop->info->qapi_type->lookup, errp)) { return; } =20 @@ -1081,8 +1081,7 @@ static void get_prop_pcielinkspeed(Object *obj, Visit= or *v, const char *name, abort(); } =20 - visit_type_enum(v, name, &speed, - qdev_propinfo_enum_lookup(prop->info), errp); + visit_type_enum(v, name, &speed, prop->info->qapi_type->lookup, errp); } =20 static void set_prop_pcielinkspeed(Object *obj, Visitor *v, const char *na= me, @@ -1093,7 +1092,7 @@ static void set_prop_pcielinkspeed(Object *obj, Visit= or *v, const char *name, int speed; =20 if (!visit_type_enum(v, name, &speed, - qdev_propinfo_enum_lookup(prop->info), errp)) { + prop->info->qapi_type->lookup, errp)) { return; } =20 @@ -1167,8 +1166,7 @@ static void get_prop_pcielinkwidth(Object *obj, Visit= or *v, const char *name, abort(); } =20 - visit_type_enum(v, name, &width, - qdev_propinfo_enum_lookup(prop->info), errp); + visit_type_enum(v, name, &width, prop->info->qapi_type->lookup, errp); } =20 static void set_prop_pcielinkwidth(Object *obj, Visitor *v, const char *na= me, @@ -1179,7 +1177,7 @@ static void set_prop_pcielinkwidth(Object *obj, Visit= or *v, const char *name, int width; =20 if (!visit_type_enum(v, name, &width, - qdev_propinfo_enum_lookup(prop->info), errp)) { + prop->info->qapi_type->lookup, errp)) { return; } =20 diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index fb11eb1f1c..e2ea894595 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -101,22 +101,13 @@ static ObjectPropertyAccessor *field_prop_setter(cons= t PropertyInfo *info) return info->set ? field_prop_set : NULL; } =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; -} - 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, qdev_propinfo_enum_lookup(prop->info), e= rrp); + visit_type_enum(v, name, ptr, prop->info->qapi_type->lookup, errp); } =20 void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name, @@ -125,14 +116,14 @@ 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, qdev_propinfo_enum_lookup(prop->info), e= rrp); + visit_type_enum(v, name, ptr, prop->info->qapi_type->lookup, errp); } =20 void qdev_propinfo_set_default_value_enum(ObjectProperty *op, const Property *prop) { object_property_set_default_str(op, - qapi_enum_lookup(qdev_propinfo_enum_lookup(prop->info), + qapi_enum_lookup(prop->info->qapi_type->lookup, prop->defval.i)); } =20 @@ -970,7 +961,7 @@ 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(qdev_propinfo_enum_lookup(prop->info), value), + qapi_enum_lookup(prop->info->qapi_type->lookup, value), &error_abort); } =20 --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564541; cv=none; d=zohomail.com; s=zohoarc; b=aFivNgEVugB8LOP9oP+zqmy1QGGowBERS0xiI9+F5hYxlrJLWPhbJBqqKHOHJXinN7VaeZO/ywAU6qFVUul71BjwZGvNU5ueWHtvyG9/9E7Bkqxh7QQut5YR+nV9S4ANIAgUrYNSQsVzkpY3oSw1JlaykigCMNQ9RLmmKNgClrE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564541; 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=b92jq80iVOlRjR8XlvrgEaii+6smZj35x6dYTTpASoM=; b=aokbjnod/h5xIgpHAytovZyZF9Jjh/2kvxb8wxriS5CwWxtc/N/8xIaLOBD/5eqSqP3clQ5+uQoZtKUfJMQtP/HcG0lJRmGJDIezaL+SoaprvkPWAUNjCx+0zN3CjUMVMe6hgbUJkTE4O93GOOjFO9MKkbZm49mEz+ULipStUr0= 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 1793564541405774.594044681894; Sun, 1 Nov 2026 12:22:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1J-0006XN-5a; Sun, 01 Nov 2026 15:19:13 -0500 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 1xNbzs-00052e-G1 for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:44 -0500 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 1xNbzg-0007EC-Ta for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:44 -0500 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-507-tcJhrOXAM9eMTtE1mJ5nZA-1; Sun, 01 Nov 2026 15:17:30 -0500 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 F230E180059A for ; Sun, 1 Nov 2026 20:17:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 72BEA1956086 for ; Sun, 1 Nov 2026 20:17:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9297821E66E5; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564252; 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=b92jq80iVOlRjR8XlvrgEaii+6smZj35x6dYTTpASoM=; b=QGmQWHMVg/CGYzYGKvUlqsoXDpI0TBAdq7KLmuz9hl7aq1QjfMJ4OsuqQytu9PBhb37N+Z 94uu1NW3zLmTWSkJinwfZ0l2aKOOpsgL1H80Lr0TQMS1+/CQwMrq/sziCEfwpVt6WBFNFA 3l4WEV0tdGra70OPGW/kEMCrgiMXGtA= X-MC-Unique: tcJhrOXAM9eMTtE1mJ5nZA-1 X-Mimecast-MFC-AGG-ID: tcJhrOXAM9eMTtE1mJ5nZA_1793564250 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 53/56] hw/i386: convert PCSouthBridgeOption to QAPI enum Date: Sun, 1 Nov 2026 21:17:14 +0100 Message-ID: <20261101201717.3911097-54-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564542987158500 From: Marc-Andr=C3=A9 Lureau 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: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- qapi/machine.json | 13 +++++++++++ include/hw/i386/pc.h | 4 ++-- hw/i386/pc_piix.c | 52 +++++++++++--------------------------------- 3 files changed, 28 insertions(+), 41 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 80348b5350..c19eea2b4b 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -416,6 +416,19 @@ { 'enum': 'LostTickPolicy', 'data': ['discard', 'delay', 'slew' ] } =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 diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 8edec62a1a..3afd376116 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/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index ae07e6c56c..20bd4231c1 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 @@ -414,8 +388,8 @@ static void pc_i440fx_machine_options(MachineClass *m) machine_class_allow_dynamic_sysbus_dev(m, TYPE_UEFI_VARS_X64); =20 object_class_property_add_enum(oc, "x-south-bridge", - "PCSouthBridgeOption", NULL, - &PCSouthBridgeOption_lookup, + "PCSouthBridgeOption", + &PCSouthBridgeOption_type_info, NULL, pc_get_south_bridge, pc_set_south_bridge); object_class_property_set_description(oc, "x-south-bridge", --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564503; cv=none; d=zohomail.com; s=zohoarc; b=Ce5scmu6XC5ZBYwu95wVCsrLvMvdwVKhXvilXWbQBUfxnGwAKQ8uK2NmrbF19M8KJyUM944Cu8+gB47ouFdnOfuWBtji4mmrojY3mgVfaixhhhJhceriZ4A5YYbJ6ppB6dYDy6XCAGmNt06RMp9+CX2WPwa0M2kkRN8E1i0/Nu4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564503; h=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=o6t0D0fURl2GvAxppybGdR9M0EHQSWp60lEziTqdyGw=; b=RaV3tJle5o8vLllVAHsFXAEPm3IW7Us3FLYDE/OKdufeBfmckDKtkE0Kh8gm9arAe0TDqZ3WvqSvGoWbYU0TNY3BRTz343TA4eKb9lOXJEwz/TRZMEBEXKlZBt3WjJ3okjM9nNhnNjLKINMUW6MDzQLK7yEXFGBDs8V/Zh05GfA= 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 1793564503161231.54998659951855; Sun, 1 Nov 2026 12:21:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1G-0006H0-Co; Sun, 01 Nov 2026 15:19:10 -0500 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 1xNbzt-00055v-TP for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:46 -0500 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 1xNbzh-0007EG-4p for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:45 -0500 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-507-5Rz6-D5pPwGEiTZ9hSTW5A-1; Sun, 01 Nov 2026 15:17:30 -0500 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 033A618005B4 for ; Sun, 1 Nov 2026 20:17:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7733B1800444 for ; Sun, 1 Nov 2026 20:17:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9762A21E6686; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o6t0D0fURl2GvAxppybGdR9M0EHQSWp60lEziTqdyGw=; b=Ioe52EpSASOwh+W1tN9ujJa3Kd0JX/xE+PneuIz4XP9PivSuwnLdCdBjFMXMj6Q/Pt6AoR c1VmH7oY06r///zIxFNLp0NUKLMpgSejZzEmcKm3N2EhKllzRFfqVViwaIyuMT33AH17go fjThjJ5MBPnpdsy3Q6B5DJeqmNAz+Y8= X-MC-Unique: 5Rz6-D5pPwGEiTZ9hSTW5A-1 X-Mimecast-MFC-AGG-ID: 5Rz6-D5pPwGEiTZ9hSTW5A_1793564250 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 54/56] qom: Drop object_property_add_enum() parameter @lookup Date: Sun, 1 Nov 2026 21:17:15 +0100 Message-ID: <20261101201717.3911097-55-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564504327158500 Content-Type: text/plain; charset="utf-8" All callers now pass non-null @qapi_type and null @lookup. Drop @lookup and simplify the code accordingly. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau --- include/chardev/char.h | 3 +-- include/qom/object.h | 4 ---- accel/hvf/hvf-all.c | 2 +- accel/kvm/kvm-all.c | 2 +- accel/whpx/whpx-common.c | 4 ++-- authz/list.c | 1 - backends/hostmem-file.c | 2 +- backends/hostmem-memfd.c | 4 ++-- backends/hostmem.c | 2 +- crypto/secret_common.c | 2 +- crypto/tlscreds.c | 2 +- hw/arm/virt.c | 4 ++-- hw/i386/microvm.c | 15 ++++++--------- hw/i386/pc.c | 5 ++--- hw/i386/pc_piix.c | 5 ++--- hw/i386/x86.c | 12 ++++-------- hw/loongarch/virt.c | 14 +++++++------- hw/microblaze/petalogix_s3adsp1800_mmu.c | 2 +- hw/riscv/virt.c | 10 +++++----- monitor/qmp.c | 2 +- net/filter.c | 5 +++-- qom/object.c | 15 ++++----------- target/i386/kvm/kvm.c | 4 ++-- target/i386/sev.c | 2 +- target/i386/whpx/whpx-all.c | 7 +++---- tests/unit/check-qom-proplist.c | 3 +-- ui/dbus.c | 4 ++-- ui/input-linux.c | 2 +- 28 files changed, 58 insertions(+), 81 deletions(-) diff --git a/include/chardev/char.h b/include/chardev/char.h index 61e6957118..45fc3edb5e 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -358,8 +358,7 @@ static inline void chardev_vc_add_encoding_prop(ObjectC= lass *oc, void (*set)(Object *, int, Error **)) { object_class_property_add_enum(oc, "encoding", "ChardevVCEncoding", - &ChardevVCEncoding_type_info, NULL, - get, set); + &ChardevVCEncoding_type_info, get, set); } =20 #endif diff --git a/include/qom/object.h b/include/qom/object.h index d1699964fa..a90cd30675 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1988,7 +1988,6 @@ ObjectProperty *object_class_property_add_bool(Object= Class *klass, * @name: the name of the property * @typename: the name of the enum data type * @qapi_type: QAPI type info descriptor - * @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 * @@ -2000,7 +1999,6 @@ ObjectProperty *object_class_property_add_bool(Object= Class *klass, ObjectProperty *object_property_add_enum(Object *obj, const char *name, const char *typename, const QAPITypeInfo *qapi_type, - const QEnumLookup *lookup, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)); =20 @@ -2010,7 +2008,6 @@ ObjectProperty *object_property_add_enum(Object *obj,= const char *name, * @name: the name of the property * @typename: the name of the enum data type * @qapi_type: QAPI type info descriptor - * @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 * @@ -2023,7 +2020,6 @@ ObjectProperty *object_class_property_add_enum(Object= Class *klass, const char *name, const char *typename, const QAPITypeInfo *qapi_type, - const QEnumLookup *lookup, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)); =20 diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 938379b9f2..f233d86c06 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -271,7 +271,7 @@ static void hvf_accel_class_init(ObjectClass *oc, const= void *data) =20 object_class_property_add_enum(oc, "kernel-irqchip", "on|off|split", &OnOffSplit_type_info, NULL, - NULL, hvf_set_kernel_irqchip); + hvf_set_kernel_irqchip); object_class_property_set_description(oc, "kernel-irqchip", "Configure HVF irqchip"); } diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index dcb1db139d..313c41c4a2 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -4299,7 +4299,7 @@ static void kvm_accel_class_init(ObjectClass *oc, con= st void *data) =20 object_class_property_add_enum(oc, "kernel-irqchip", "on|off|split", &OnOffSplit_type_info, NULL, - NULL, kvm_set_kernel_irqchip); + kvm_set_kernel_irqchip); object_class_property_set_description(oc, "kernel-irqchip", "Configure KVM in-kernel irqchip"); =20 diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c index 068258bf6c..78d2827809 100644 --- a/accel/whpx/whpx-common.c +++ b/accel/whpx/whpx-common.c @@ -510,12 +510,12 @@ static void whpx_accel_class_init(ObjectClass *oc, co= nst void *data) =20 object_class_property_add_enum(oc, "kernel-irqchip", "on|off|split", &OnOffSplit_type_info, NULL, - NULL, whpx_set_kernel_irqchip); + whpx_set_kernel_irqchip); object_class_property_set_description(oc, "kernel-irqchip", "Configure WHPX in-kernel irqchip"); object_class_property_add_enum(oc, "hyperv", "OnOffAuto", &OnOffAuto_type_info, NULL, - NULL, whpx_set_hyperv); + whpx_set_hyperv); object_class_property_set_description(oc, "hyperv", "Configure Hyper-V enlightenments"); =20 diff --git a/authz/list.c b/authz/list.c index 75155cf077..c3dd9d7b68 100644 --- a/authz/list.c +++ b/authz/list.c @@ -123,7 +123,6 @@ qauthz_list_class_init(ObjectClass *oc, const void *dat= a) =20 object_class_property_add_enum(oc, "policy", "QAuthZListPolicy", &QAuthZListPolicy_type_info, - NULL, qauthz_list_prop_get_policy, qauthz_list_prop_set_policy); =20 diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 2f65ca3678..6ad9cad032 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -293,7 +293,7 @@ file_backend_class_init(ObjectClass *oc, const void *da= ta) file_memory_backend_get_readonly, file_memory_backend_set_readonly); object_class_property_add_enum(oc, "rom", "OnOffAuto", - &OnOffAuto_type_info, NULL, + &OnOffAuto_type_info, file_memory_backend_get_rom, file_memory_backend_set_rom); object_class_property_set_description(oc, "rom", diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index 19a9a5b409..496455f7aa 100644 --- a/backends/hostmem-memfd.c +++ b/backends/hostmem-memfd.c @@ -201,8 +201,8 @@ memfd_backend_class_init(ObjectClass *oc, const void *d= ata) "Huge pages size (ex: 2M, 1G= )"); } =20 - object_class_property_add_enum(oc, "guest-memfd", "OnOffAuto", - &OnOffAuto_type_info, NULL, + object_class_property_add_enum(oc, "guest-memfd", "OnOffAuto", + &OnOffAuto_type_info, memfd_backend_get_guest_memfd, memfd_backend_set_guest_memfd); object_class_property_set_description(oc, "guest-memfd", diff --git a/backends/hostmem.c b/backends/hostmem.c index 0f39f4d1b7..173d042be3 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -554,7 +554,7 @@ host_memory_backend_class_init(ObjectClass *oc, const v= oid *data) 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_type_info, NULL, + &HostMemPolicy_type_info, host_memory_backend_get_policy, host_memory_backend_set_policy); object_class_property_set_description(oc, "policy", diff --git a/crypto/secret_common.c b/crypto/secret_common.c index 8e05f1365e..98898aa885 100644 --- a/crypto/secret_common.c +++ b/crypto/secret_common.c @@ -271,7 +271,7 @@ qcrypto_secret_class_init(ObjectClass *oc, const void *= data) ucc->complete =3D qcrypto_secret_complete; =20 object_class_property_add_enum(oc, "format", "QCryptoSecretFormat", - &QCryptoSecretFormat_type_info, NULL, + &QCryptoSecretFormat_type_info, qcrypto_secret_prop_get_format, qcrypto_secret_prop_set_format); object_class_property_add_str(oc, "keyid", diff --git a/crypto/tlscreds.c b/crypto/tlscreds.c index 021e4bf111..74d8d4fe00 100644 --- a/crypto/tlscreds.c +++ b/crypto/tlscreds.c @@ -223,7 +223,7 @@ qcrypto_tls_creds_class_init(ObjectClass *oc, const voi= d *data) qcrypto_tls_creds_prop_get_dir, qcrypto_tls_creds_prop_set_dir); object_class_property_add_enum(oc, "endpoint", "QCryptoTLSCredsEndpoin= t", - &QCryptoTLSCredsEndpoint_type_info, NUL= L, + &QCryptoTLSCredsEndpoint_type_info, qcrypto_tls_creds_prop_get_endpoint, qcrypto_tls_creds_prop_set_endpoint); object_class_property_add_str(oc, "priority", diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 2f03679afd..57bd78479f 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -4202,8 +4202,8 @@ static void virt_machine_class_init(ObjectClass *oc, = const void *data) mc->default_nic =3D "virtio-net-pci"; =20 object_class_property_add_enum(oc, "acpi", "OnOffAuto", - &OnOffAuto_type_info, NULL, - virt_get_acpi, virt_set_acpi); + &OnOffAuto_type_info, virt_get_acpi, + virt_set_acpi); object_class_property_set_description(oc, "acpi", "Enable ACPI"); object_class_property_add_bool(oc, "secure", virt_get_secure, diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index 7f010cb2f2..ed391c0596 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -658,25 +658,22 @@ 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_enum(oc, MICROVM_MACHINE_RTC, - "OnOffAuto", - &OnOffAuto_type_info, NULL, + object_class_property_add_enum(oc, MICROVM_MACHINE_RTC, "OnOffAuto", + &OnOffAuto_type_info, microvm_machine_get_rtc, microvm_machine_set_rtc); object_class_property_set_description(oc, MICROVM_MACHINE_RTC, "Enable MC146818 RTC"); =20 - object_class_property_add_enum(oc, MICROVM_MACHINE_PCIE, - "OnOffAuto", - &OnOffAuto_type_info, NULL, + object_class_property_add_enum(oc, MICROVM_MACHINE_PCIE, "OnOffAuto", + &OnOffAuto_type_info, microvm_machine_get_pcie, microvm_machine_set_pcie); object_class_property_set_description(oc, MICROVM_MACHINE_PCIE, "Enable PCIe"); =20 - object_class_property_add_enum(oc, MICROVM_MACHINE_IOAPIC2, - "OnOffAuto", - &OnOffAuto_type_info, NULL, + object_class_property_add_enum(oc, MICROVM_MACHINE_IOAPIC2, "OnOffAuto= ", + &OnOffAuto_type_info, microvm_machine_get_ioapic2, microvm_machine_set_ioapic2); object_class_property_set_description(oc, MICROVM_MACHINE_IOAPIC2, diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 80940e81e5..4737eb471c 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1726,9 +1726,8 @@ static void pc_machine_class_init(ObjectClass *oc, co= nst 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_enum(oc, PC_MACHINE_VMPORT, - "OnOffAuto", - &OnOffAuto_type_info, NULL, + object_class_property_add_enum(oc, PC_MACHINE_VMPORT, "OnOffAuto", + &OnOffAuto_type_info, pc_machine_get_vmport, pc_machine_set_vmport); object_class_property_set_description(oc, PC_MACHINE_VMPORT, diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 20bd4231c1..211e3c5f9e 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -389,9 +389,8 @@ static void pc_i440fx_machine_options(MachineClass *m) =20 object_class_property_add_enum(oc, "x-south-bridge", "PCSouthBridgeOption", - &PCSouthBridgeOption_type_info, NULL, - pc_get_south_bridge, - pc_set_south_bridge); + &PCSouthBridgeOption_type_info, + pc_get_south_bridge, pc_set_south_bridg= e); object_class_property_set_description(oc, "x-south-bridge", "Use a different south bridge than PI= IX3"); compat_props_add(m->compat_props, diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 4e5a7cf270..4b75b7406a 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -373,29 +373,25 @@ static void x86_machine_class_init(ObjectClass *oc, c= onst void *data) nc->raise_nmi =3D x86_nmi; =20 object_class_property_add_enum(oc, X86_MACHINE_SMM, "OnOffAuto", - &OnOffAuto_type_info, NULL, - x86_machine_get_smm, + &OnOffAuto_type_info, x86_machine_get_s= mm, x86_machine_set_smm); object_class_property_set_description(oc, X86_MACHINE_SMM, "Enable SMM"); =20 object_class_property_add_enum(oc, X86_MACHINE_ACPI, "OnOffAuto", - &OnOffAuto_type_info, NULL, - x86_machine_get_acpi, + &OnOffAuto_type_info, x86_machine_get_a= cpi, x86_machine_set_acpi); object_class_property_set_description(oc, X86_MACHINE_ACPI, "Enable ACPI"); =20 object_class_property_add_enum(oc, X86_MACHINE_PIT, "OnOffAuto", - &OnOffAuto_type_info, NULL, - x86_machine_get_pit, + &OnOffAuto_type_info, x86_machine_get_p= it, x86_machine_set_pit); object_class_property_set_description(oc, X86_MACHINE_PIT, "Enable i8254 PIT"); =20 object_class_property_add_enum(oc, X86_MACHINE_PIC, "OnOffAuto", - &OnOffAuto_type_info, NULL, - x86_machine_get_pic, + &OnOffAuto_type_info, x86_machine_get_p= ic, x86_machine_set_pic); object_class_property_set_description(oc, X86_MACHINE_PIC, "Enable i8259 PIC"); diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 1eae2bffe6..598898e0fb 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -1470,18 +1470,18 @@ static void virt_class_init(ObjectClass *oc, const = void *data) hc->unplug =3D virt_device_unplug; =20 object_class_property_add_enum(oc, "acpi", "OnOffAuto", - &OnOffAuto_type_info, NULL, - virt_get_acpi, virt_set_acpi); + &OnOffAuto_type_info, virt_get_acpi, + virt_set_acpi); object_class_property_set_description(oc, "acpi", "Enable ACPI"); object_class_property_add_enum(oc, "v-eiointc", "OnOffAuto", - &OnOffAuto_type_info, NULL, - virt_get_veiointc, virt_set_veiointc); + &OnOffAuto_type_info, virt_get_veiointc, + virt_set_veiointc); object_class_property_set_description(oc, "v-eiointc", "Enable Virt Extend I/O Interrupt Controller."= ); - object_class_property_add_enum(oc, "dmsi", "OnOffAuto", - &OnOffAuto_type_info, NULL, - virt_get_dmsi, virt_set_dmsi); + object_class_property_add_enum(oc, "dmsi", "OnOffAuto", + &OnOffAuto_type_info, virt_get_dmsi, + virt_set_dmsi); object_class_property_set_description(oc, "dmsi", "Enable direct Message-interrupts Controller."= ); machine_class_allow_dynamic_sysbus_dev(mc, TYPE_RAMFB_DEVICE); diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petal= ogix_s3adsp1800_mmu.c index b52f12924d..4ad04801ce 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -176,7 +176,7 @@ static void petalogix_s3adsp1800_machine_class_init(Obj= ectClass *oc, mc->is_default =3D true; =20 prop =3D object_class_property_add_enum(oc, "endianness", "EndianMode", - &EndianMode_type_info, NULL, + &EndianMode_type_info, machine_get_endianness, machine_set_endianness); object_property_set_default_str(prop, target_big_endian() ? "big" diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 31fecdc964..0cb731482a 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -1175,14 +1175,14 @@ static void virt_machine_class_init(ObjectClass *oc= , const void *data) } =20 object_class_property_add_enum(oc, "acpi", "OnOffAuto", - &OnOffAuto_type_info, NULL, - virt_get_acpi, virt_set_acpi); + &OnOffAuto_type_info, virt_get_acpi, + virt_set_acpi); object_class_property_set_description(oc, "acpi", "Enable ACPI"); =20 - object_class_property_add_enum(oc, "iommu-sys", "OnOffAuto", - &OnOffAuto_type_info, NULL, - virt_get_iommu_sys, virt_set_iommu_sys); + object_class_property_add_enum(oc, "iommu-sys", "OnOffAuto", + &OnOffAuto_type_info, virt_get_iommu_sy= s, + virt_set_iommu_sys); object_class_property_set_description(oc, "iommu-sys", "Enable IOMMU platform device"); } diff --git a/monitor/qmp.c b/monitor/qmp.c index c6341f1a20..d2e45d3993 100644 --- a/monitor/qmp.c +++ b/monitor/qmp.c @@ -136,7 +136,7 @@ static void monitor_qmp_class_init(ObjectClass *cls, co= nst void *data) monitor_qmp_set_pretty); object_class_property_add_enum(cls, "close-action", "MonitorQMPCloseAction", - &MonitorQMPCloseAction_type_info, NULL, + &MonitorQMPCloseAction_type_info, monitor_qmp_get_close_action, monitor_qmp_set_close_action); =20 diff --git a/net/filter.c b/net/filter.c index 9013d872ea..145c72107a 100644 --- a/net/filter.c +++ b/net/filter.c @@ -344,8 +344,9 @@ static void netfilter_class_init(ObjectClass *oc, const= void *data) 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_type_info, NULL, - netfilter_get_direction, netfilter_set_= direction); + &NetFilterDirection_type_info, + netfilter_get_direction, + 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/qom/object.c b/qom/object.c index 637459c2b1..c285eb849f 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2501,8 +2501,7 @@ object_class_property_add_bool(ObjectClass *klass, co= nst char *name, } =20 typedef struct EnumProperty { - const QAPITypeInfo *qapi_type; /* non-null for QAPI enums */ - const QEnumLookup *lookup; + const QAPITypeInfo *qapi_type; int (*get)(Object *, Error **); void (*set)(Object *, int, Error **); } EnumProperty; @@ -2520,7 +2519,7 @@ static void property_get_enum(Object *obj, Visitor *v= , const char *name, return; } =20 - visit_type_enum(v, name, &value, prop->lookup, errp); + visit_type_enum(v, name, &value, prop->qapi_type->lookup, errp); } =20 static void property_set_enum(Object *obj, Visitor *v, const char *name, @@ -2529,7 +2528,7 @@ static void property_set_enum(Object *obj, Visitor *v= , const char *name, EnumProperty *prop =3D opaque; int value; =20 - if (!visit_type_enum(v, name, &value, prop->lookup, errp)) { + if (!visit_type_enum(v, name, &value, prop->qapi_type->lookup, errp)) { return; } prop->set(obj, value, errp); @@ -2539,15 +2538,12 @@ ObjectProperty * object_property_add_enum(Object *obj, const char *name, const char *typename, const QAPITypeInfo *qapi_type, - const QEnumLookup *lookup, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)) { EnumProperty *prop =3D g_malloc(sizeof(*prop)); =20 - assert(!qapi_type !=3D !lookup); prop->qapi_type =3D qapi_type; - prop->lookup =3D lookup ?: qapi_type->lookup; prop->get =3D get; prop->set =3D set; =20 @@ -2562,15 +2558,12 @@ ObjectProperty * object_class_property_add_enum(ObjectClass *klass, const char *name, const char *typename, const QAPITypeInfo *qapi_type, - const QEnumLookup *lookup, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)) { EnumProperty *prop =3D g_malloc(sizeof(*prop)); =20 - assert(!qapi_type !=3D !lookup); prop->qapi_type =3D qapi_type; - prop->lookup =3D lookup ?: qapi_type->lookup; prop->get =3D get; prop->set =3D set; =20 @@ -2607,7 +2600,7 @@ int object_property_get_enum(Object *obj, const char = *name, return -1; } =20 - ret =3D qapi_enum_parse(enumprop->lookup, str, -1, errp); + ret =3D qapi_enum_parse(enumprop->qapi_type->lookup, str, -1, errp); g_free(str); =20 return ret; diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index e003e47c5b..64c9e2e379 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -7092,7 +7092,7 @@ static void kvm_arch_set_honor_guest_pat(Object *obj,= int value, Error **errp) void kvm_arch_accel_class_init(ObjectClass *oc) { object_class_property_add_enum(oc, "notify-vmexit", "NotifyVMexitOptio= n", - &NotifyVmexitOption_type_info, NULL, + &NotifyVmexitOption_type_info, kvm_arch_get_notify_vmexit, kvm_arch_set_notify_vmexit); object_class_property_set_description(oc, "notify-vmexit", @@ -7132,7 +7132,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc) "Maximum number of Xen PIRQs"); =20 object_class_property_add_enum(oc, "honor-guest-pat", "OnOffAuto", - &OnOffAuto_type_info, NULL, + &OnOffAuto_type_info, kvm_arch_get_honor_guest_pat, kvm_arch_set_honor_guest_pat); object_class_property_set_description(oc, "honor-guest-pat", diff --git a/target/i386/sev.c b/target/i386/sev.c index c1c12d1125..604c2255ac 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -3019,7 +3019,7 @@ sev_guest_class_init(ObjectClass *oc, const void *dat= a) object_class_property_set_description(oc, "session-file", "guest owners session parameters (encoded with base64)"); object_class_property_add_enum(oc, "legacy-vm-type", "OnOffAuto", - &OnOffAuto_type_info, NULL, + &OnOffAuto_type_info, sev_guest_get_legacy_vm_type, sev_guest_set_legacy_vm_type); object_class_property_set_description(oc, "legacy-vm-type", diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index c459138c7e..e3e672dcd1 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -2974,17 +2974,16 @@ void whpx_arch_accel_class_init(ObjectClass *oc) { object_class_property_add_enum(oc, "ignore-unknown-msr", "OnOffAuto", &OnOffAuto_type_info, NULL, - NULL, whpx_set_unknown_msr); + whpx_set_unknown_msr); object_class_property_set_description(oc, "ignore-unknown-msr", "Configure unknown MSR behavior"); object_class_property_add_enum(oc, "intercept-msr-gp", "OnOffAuto", &OnOffAuto_type_info, NULL, - NULL, whpx_set_intercept_msr_gp); + whpx_set_intercept_msr_gp); object_class_property_set_description(oc, "intercept-msr-gp", "Intercept #GP to log erroring MSR accesses."); object_class_property_add_enum(oc, "ssd", "OnOffAuto", - &OnOffAuto_type_info, NULL, - NULL, whpx_set_ssd); + &OnOffAuto_type_info, NULL, whpx_set_ss= d); object_class_property_set_description(oc, "ssd", "Separate security domain"); } diff --git a/tests/unit/check-qom-proplist.c b/tests/unit/check-qom-proplis= t.c index 246935d714..381a868a80 100644 --- a/tests/unit/check-qom-proplist.c +++ b/tests/unit/check-qom-proplist.c @@ -152,8 +152,7 @@ static void dummy_class_init(ObjectClass *cls, const vo= id *data) dummy_get_sv, dummy_set_sv, NULL, NULL); object_class_property_add_enum(cls, "av", "DummyAnimal", - &dummy_animal_qapi_type_info, NULL, - dummy_get_av, + &dummy_animal_qapi_type_info, dummy_get= _av, dummy_set_av); } =20 diff --git a/ui/dbus.c b/ui/dbus.c index 9c21204771..f473a66889 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -511,8 +511,8 @@ dbus_display_class_init(ObjectClass *oc, const void *da= ta) 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_type_info, NULL, - get_gl_mode, set_gl_mode); + &DisplayGLMode_type_info, get_gl_mode, + set_gl_mode); } =20 #define TYPE_CHARDEV_VC "chardev-vc" diff --git a/ui/input-linux.c b/ui/input-linux.c index 127be74450..c7f9114036 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -508,7 +508,7 @@ static void input_linux_class_init(ObjectClass *oc, con= st void *data) input_linux_get_repeat, input_linux_set_repeat); object_class_property_add_enum(oc, "grab-toggle", "GrabToggleKeys", - &GrabToggleKeys_type_info, NULL, + &GrabToggleKeys_type_info, input_linux_get_grab_toggle, input_linux_set_grab_toggle); } --=20 2.55.0 From nobody Mon Nov 23 04:26:22 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=1793564434; cv=none; d=zohomail.com; s=zohoarc; b=Vl4B14YRl4bk4RpHbSc4xgvJ7XYomy+mTzSMZuZ71SugXy+1lwn2QmPdQ9L4m0cnQuHrFDZcC4XGMcwnPfi22S2TOfQkWJZm0MHr/KHL7wMxnCulV2sLN8H9qxwAFcM38NekkGfK5U9Onb0p2vogcQUePt1wH+PFaOQZiZIPKis= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564434; 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=W7vdsPryvAC9zNCEG223ha2n9wLYiHOCP1IPWNbY9G0=; b=Vp5EjAvUJI9CK1XM/CFXmy7w12lDbiO61zCrhFfozJfOJyOKUx6LaAXer9A65DVZ1WsGAnAJBUFpJcpo9nGI+vAM/Y6HkDd3OfbQGy1pUhtwd6SBepiF+Znoxus/rGfcmEsYHieUN7cqF+PrCAO3KsniQ7uu0iQgDRFvtRtOY0c= 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 1793564434812868.1385362525064; Sun, 1 Nov 2026 12:20:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1q-0007oU-IB; Sun, 01 Nov 2026 15:19:47 -0500 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 1xNbzv-00056r-4D for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:50 -0500 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 1xNbzi-0007Ew-HB for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:46 -0500 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-45-LLU3c-GwN3qfkFPDOTjdhw-1; Sun, 01 Nov 2026 15:17:32 -0500 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 B138B1955F54 for ; Sun, 1 Nov 2026 20:17:31 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2D3F11800495 for ; Sun, 1 Nov 2026 20:17:31 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9BB4B21E6832; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564253; 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=W7vdsPryvAC9zNCEG223ha2n9wLYiHOCP1IPWNbY9G0=; b=h7Pq4vCUNS4/Qx/NFlNsBwOvOgv6ZbouPsDXTj8m1UjFfgBIbRsVyRzTGRBJJfRhIxKZ9d g+IfZA700d9Lfwo+krm2EM24Nlji0GRnBsflsKdotWB0Z58Gi2D2//vdlwQk/+4ruwpZTS ATXaG/FDa64yDAnH4NUJrD71K5q/bOE= X-MC-Unique: LLU3c-GwN3qfkFPDOTjdhw-1 X-Mimecast-MFC-AGG-ID: LLU3c-GwN3qfkFPDOTjdhw_1793564251 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 55/56] qom: use QAPITypeInfo in object_property_get_enum Date: Sun, 1 Nov 2026 21:17:16 +0100 Message-ID: <20261101201717.3911097-56-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564436824158500 From: Marc-Andr=C3=A9 Lureau 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: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- include/qom/object.h | 4 ++-- hw/core/machine-qmp-cmds.c | 4 +++- qom/object.c | 14 ++++++-------- tests/unit/check-qom-proplist.c | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index a90cd30675..9338f0b986 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1562,7 +1562,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 @@ -1570,7 +1570,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/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 07a048d0a9..0558d6d703 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" @@ -278,7 +279,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/qom/object.c b/qom/object.c index c285eb849f..0858c4a214 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2575,32 +2575,30 @@ object_class_property_add_enum(ObjectClass *klass, = 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; ObjectProperty *prop =3D object_property_find_err(obj, name, errp); - EnumProperty *enumprop; =20 if (prop =3D=3D NULL) { 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 - enumprop =3D prop->opaque; - str =3D object_property_get_str(obj, name, errp); if (!str) { return -1; } =20 - ret =3D qapi_enum_parse(enumprop->qapi_type->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; diff --git a/tests/unit/check-qom-proplist.c b/tests/unit/check-qom-proplis= t.c index 381a868a80..bf7c1386be 100644 --- a/tests/unit/check-qom-proplist.c +++ b/tests/unit/check-qom-proplist.c @@ -580,14 +580,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); @@ -595,7 +595,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.55.0 From nobody Mon Nov 23 04:26:22 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=1793564494; cv=none; d=zohomail.com; s=zohoarc; b=WpTqxBg6QsE0cXWiHoufO5ne/veQvnNOqk3s40NONNbJIaLtg+kJyS5W7zEypSDydSPKyynTY9cflRZT3YrR+dOiMshEYxWeQl4AilmHk+oU49wFmOtz9NhtGkB5Qf3kt6+kwPDuka235BxJYFiJvNBBG7z3x6GjWy1W8Whn6s8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793564494; 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=JAac/l1KwmkzTW2jlMu4iQVrlvI/OwkdwDrVyptuG7k=; b=C2XWdRkTId//aHL4r+eI1orMnzOYATml/FHlnYDHHvyRfhWbM40EXvXRXGlkAXsDtf5vbl3jez4JkVbTSwM8BwZ02DNJJh8tiValYrJelD9wlKg6Ir1IGQzGWTvFdltMowOYpdwZeSLXw/kxM9RemVSAqWkD1ha0wBPBNmPp8L4= 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 1793564494178732.4377215596193; Sun, 1 Nov 2026 12:21:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNc1z-00088S-6t; Sun, 01 Nov 2026 15:19:55 -0500 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 1xNbzt-00055b-OH for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:45 -0500 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 1xNbzi-0007Eq-9P for qemu-devel@nongnu.org; Sun, 01 Nov 2026 15:17:45 -0500 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-107-0WltvZ2ZOn-iTNkQkjJAoA-1; Sun, 01 Nov 2026 15:17:32 -0500 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 6CB531954AC2 for ; Sun, 1 Nov 2026 20:17:31 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 13C3430002CB for ; Sun, 1 Nov 2026 20:17:31 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id A00D321E66BB; Sun, 01 Nov 2026 21:17:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793564253; 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=JAac/l1KwmkzTW2jlMu4iQVrlvI/OwkdwDrVyptuG7k=; b=NONwIPeOcLYAKRtpar5stZEvA9eKksBfmMVZelR+E1kXNq4YSN8ryIGV6/lFQkPi6jT3FQ e2kD2wfIWmWj1Whxu4Gb/JHUu7MIOoZCQiluiXozUFkKMDxHOjCEAo76BUnXvRSI0M0C2a ndhcMOCEgonBVBQ+lAeCF4xr2Nw4Ykw= X-MC-Unique: 0WltvZ2ZOn-iTNkQkjJAoA-1 X-Mimecast-MFC-AGG-ID: 0WltvZ2ZOn-iTNkQkjJAoA_1793564251 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v8 56/56] tests/qmp-cmd-test: assert qapi-type resolves in query-qmp-schema Date: Sun, 1 Nov 2026 21:17:17 +0100 Message-ID: <20261101201717.3911097-57-armbru@redhat.com> In-Reply-To: <20261101201717.3911097-1-armbru@redhat.com> References: <20261101201717.3911097-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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: 1793564496088158500 From: Marc-Andr=C3=A9 Lureau 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: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- 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 279a8f5614..acb7b0dd6a 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.55.0