From nobody Mon Sep 28 00:09:39 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=1787051515; cv=none; d=zohomail.com; s=zohoarc; b=Llyk/u1FlZmYf0ujgx9d9u9rDZpO7Tb2jPKZJ1y65JTU1SCgVPHZy8hXwywmAoRhkDa9Eixb8hbJYSiU96lr4b9HzGkDxQTPLq2H9dysjKQOn/9enL1S2hmTKjXDokji6GAf/jj0hSBHQemMzcXgG/zbw9/XYppJtDCoXWupvyo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051515; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fMR7ZYSXff17dR6913Tl35fhM/WOgUkQM2Kgqza6nyM=; b=nA3BcNMUxiGvyYZBP0ylydJDqH84eF1cQMA0ElUyI/pdzAZ2uSO2QifwVwDmpCcVLvOq4dhq6rKtNj6DLnmM6hHMVzr4XsuQMO4msmgP7rvik0Vgo/foeiFOh8M4m5t2GYGCo9VfXK2YH6b0fIBRNT54hGJexzJA3aJCJrg07Fk= 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 1787051515684790.2808362566607; Tue, 18 Aug 2026 04:11:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHjK-0002UZ-GT; Tue, 18 Aug 2026 07:11:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHjI-0002Tf-Vj for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:11:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHjH-0004lt-MM for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:11:40 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-262-v6krQeuvP9uMFDmwas88fQ-1; Tue, 18 Aug 2026 07:11:37 -0400 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 DD75319560AA; Tue, 18 Aug 2026 11:11:34 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0C84D30002E9; Tue, 18 Aug 2026 11:11:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051498; 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=fMR7ZYSXff17dR6913Tl35fhM/WOgUkQM2Kgqza6nyM=; b=G5RUJF+mQr0ulvwIveZl8t72uDKKyEuAVBv1ee3bqiO3ftKbpFIvM3hlbwuwaBYS+DU3SF vtKPlPJVcQSdr5krcAv69HrMTDkQXKzbf6hZQPWF2skEo40LJ9LbDRAXxiU/koZec0c/2s cRAME16Sw8TMvWOFW8YvfzkkkbOe5FM= X-MC-Unique: v6krQeuvP9uMFDmwas88fQ-1 X-Mimecast-MFC-AGG-ID: v6krQeuvP9uMFDmwas88fQ_1787051495 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:28 +0400 Subject: [PATCH v3 01/74] qapi: add QAPITypeInfo struct definition MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-1-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1812; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=W7+TyZelRY5E+foHgcF2zrOJszOTC1p1pAKFNASayHY=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD22ixsp0BMf9aUWcWN6C7oklEO06Zd+i8i1y dL1Cb/reeaJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9tgAKCRDa6OEJdZac 5ZE4D/4te8JMWo2pbZsY7pbPsFQWK/ESLLMRZ9MqR6WnGJzm3POCkSU9jLNw8vcRiS5qmGgZvEY L3c9Gy9BiEfV+g4j+PLX2WKIQ1xHUTKAod36Oa6l4CsVQQu9tInVGGGgjl/vQCq06cSk/nYjdQA GVs6s/4LUBmT80PtDz3OkYZKPMrgTTJwMWRtrFJfql381Irtjm/zFcu0aty709MFyuGiXJlHhYx gUpjzAuVmeTzGQiZOkhQMBGypP2cPtXsdYnB33AMgeBCwkd+qLkFoGpcEowWrSMP3JkVm9mHxnU wGyv8Vqpt/6aSmRpI7GX/cxGflTqGtd51M6vpJ5/9h3Hlszh1WyBlJTzAjs2dPvwFroc8jo9upx a7wrT8IXGQUxuJ8gVCACYBjQ8iNMPcBQDoSvAVIay8iHENHLU698pKCXQNq/RtytUQGaQwpDXdw 9+t//Huf/UWhVKYl8doA+ySqI9jXqTP0EpE+V6liaSSx0nUrC/JDpjTSioGsugXTJRptXjrknaj rfgxAs/cFl+wVzjVeAyQJx8OHAtFyndhWFwHqc/P98XlW8QyfgC8rH8tmpPd05rqBCvsAcL2+UL MYBnTmgdqXatgZQHBpDa7eKchLgw1xdLYiBL+VRuv3brN+IiXZPUjZUTOAIhX+iFzrAUu3IJqvb mLPqMeMwAyFRC0A== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787051516715158500 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 --- include/qapi/qapi-type-info.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/include/qapi/qapi-type-info.h b/include/qapi/qapi-type-info.h new file mode 100644 index 000000000000..97eb1d7bf490 --- /dev/null +++ b/include/qapi/qapi-type-info.h @@ -0,0 +1,32 @@ +/* + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef QAPI_TYPE_INFO_H +#define QAPI_TYPE_INFO_H + +#include "qapi/util.h" + +/** + * QAPITypeInfo - QAPI type metadata + * + * @name: QAPI type name (e.g. "str", "OnOffAuto", "int32List"). + * QOM uses this as the property type string. + * @masked_name: Name of the type in the QAPI introspection schema, assign= ed by + * scripts/qapi code generator (e.g. "368"). + * NULL for implicit types. + * @lookup: QEnumLookup for this type, or NULL for non-enum types. + * visit_type_enum(), qapi_enum_parse(), and qapi_enum_lookup() + * all rely on it. + * @list: The list-type counterpart, or NULL if none exists. + * str_type_info.list points to strList_type_info. qdev array + * properties follow this to find the list type for their element. + */ +typedef struct QAPITypeInfo { + const char *name; + const char *masked_name; + const QEnumLookup *lookup; + const struct QAPITypeInfo *list; +} QAPITypeInfo; + +#endif /* QAPI_TYPE_INFO_H */ --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051526; cv=none; d=zohomail.com; s=zohoarc; b=J0WkAsNZuMa07uyXo3HgIfgE1xfqcOAoay57oDTEjQkgs9ebdqZJVUFuArIyo+7RIc+2VhWUj5jtBpoASMkNhF9S2ZqsP2gZ8nvRdiIq4bPPohxyn4oFgF0dt/Cq/X6Fqsy4AtnkhbLuyyMPIfnoecQdTHIEDnULS8WqWEl+kAo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051526; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sRnXKZYrzbjyn4A8hYpuDdRC4OzW1AM3O5ymYNZ3gBk=; b=MKz2cj0cgCiSn5MdArREWef8Vrv+/VNpQ/u/zEboPlifO7D+IBfAA5pfpYvNeA6fwF9oppk8vQJU5pySxQMjtDIa6oG2ulSg4seYMy0QViaPKWyRv4oXpcyvKoJGIjfgTfMFBTwV0eGeVfBY35RwsmRi7+j5aYBpIM9CN6jFP50= 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 1787051526511195.88681355476172; Tue, 18 Aug 2026 04:12:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHjd-0002ef-45; Tue, 18 Aug 2026 07:12:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHjb-0002eF-LE for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:11:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHja-0004n2-AQ for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:11:59 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-605-Bb8Oy5bKNLuFafGtK9hbjA-1; Tue, 18 Aug 2026 07:11:56 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D7FBD19560A6; Tue, 18 Aug 2026 11:11:54 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 768371953944; Tue, 18 Aug 2026 11:11:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051517; 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=sRnXKZYrzbjyn4A8hYpuDdRC4OzW1AM3O5ymYNZ3gBk=; b=UtFGM3ebgyeZzib9QLvse7GzuaAUPa6Di5YTLaJGfsbuV7BcTZfZ9OiBvBYKJvorTuHGtb 43k1sqxfmhIVtxJly4+bz6SqNu38g9aOQXwkKOEfNfhiRp6S0eOLMeWkueCcfjTmHZ4nJC G0iPEG0GWdpkhkqxKvwLgjWNPiiDphY= X-MC-Unique: Bb8Oy5bKNLuFafGtK9hbjA-1 X-Mimecast-MFC-AGG-ID: Bb8Oy5bKNLuFafGtK9hbjA_1787051515 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:29 +0400 Subject: [PATCH v3 02/74] qapi/gen: fix _module_basename for multi-dash 'what' parameters MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-2-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1081; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=8qQ5+NhKhFTbUvRZ8NDUWUg42L5+gNHRkxrEPEB9zC8=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD22HbhnBVzaGd/FMcWR/BJIbg8HkZ3hAE6e9 yGONcSC2giJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9tgAKCRDa6OEJdZac 5SL2EACAElf0Jc8QdNyiPOJT597wCTgUwP3Zz+iOLITBgszVk7sd2v2B+urYFdeONoWdItIlzE7 5w/u9SDR/+Z1GPa07RxmaJeIVvf6KF0rUZ8CBGKvf53XcKdbFFGU0DwCWP3r5eSJ/9pBjY7Xv1z 2dvjkIzRIQw5xEkNQnACFcVfyZsSVxZ+BZgfjzqYc4TmGGZ9gf8KOsZd1chYlS8PWv3wrUUTwK/ qzIzHQSSWZLGCVYCXo2GPcTckz2de3WC081SbUESUG2TN40KhDuh7HJkqH+axWsmrMuUmA2fHkB EBvgTHrb24vsmavSLGIcEWGXhROfePZpt5Ll+VFj7UbW8U57YrYS40GhzjhO0HVNmU0MBcfa/GD ZR/Y/0JVACmo1h5TbY+2dkMFD0EMXsb8K+XT6eNaIsSI+PPut6IlkWTQLTYCO6sBroucpDa2y52 9Oio1EYjwrwbn48WqiBIoVhp7M5M+CgSZFBcB3qCh6zdbBBq4NXXniWtGVfydOfGLGaOXdWE+5y ACnpxgfeXorgin7h5bJyvvtHUK5GeSrrwyZfcUdrWZtGGq52ROSn5h96WKaoTsiOTls34UXc/m9 ZUu4eK8AWVLv2uy8a5Ph4rxgDKRO+pou4oua36MRuRYPioV2Bc/Zr5cYWhSFN+zzA/VcgvpLvLx ADGanScd+9CulHw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787051529028158500 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 --- scripts/qapi/gen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index 0c9b8db3b024..690187d4280d 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -300,7 +300,7 @@ def _module_basename(self, what: str, name: str) -> str: ret +=3D '-' + os.path.splitext(basename)[0] else: assert QAPISchemaModule.is_system_module(name) - ret +=3D re.sub(r'-', '-' + name[2:] + '-', what) + ret +=3D re.sub(r'-', '-' + name[2:] + '-', what, count=3D1) return ret =20 def _module_filename(self, what: str, name: str) -> str: --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051649; cv=none; d=zohomail.com; s=zohoarc; b=bMg+TahyZ+GP/ELm3NpeWx8NtkNWFCV/xjthDDLb9FtMt+/hUc+wBinZ02sMlzG8fNmJLYX+9BsEd2B2jnJJFpIzS78v4VQoT/iI/2CgDf6zzr37OFOmJ3nx6Ewur5tWDQ402BvIncgZXaqWqr5IaAdV4LAlKOK1X2NtJqNBin4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051649; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zDsYU84mwLAbqV+OnBgVdBLILxVNuaqtJnPUxcPz1pc=; b=S4XDbKS3CeumNIuQ58ym7ODiUOBB+r/RIlxlLaZK3/oBZrmyGu2+zLaVgk/oSgxA/hk7N92W6c0duyukEYOpEQ+sb8qPykRurXbQlmJAJVtt3ibSkUr8PpW9lMd+GTTYMqhpDReHTwdaXHcjAkXTebc0HHEbM0BRA75pwN6ZJyc= 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 1787051649359729.0280902955142; Tue, 18 Aug 2026 04:14:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHkj-0003di-2m; Tue, 18 Aug 2026 07:13:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHkh-0003dZ-Su for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:13:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHke-0004sE-Tf for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:13:07 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-489-u4H3jL4rNdmdvE48vML9Ew-1; Tue, 18 Aug 2026 07:13:00 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0326E18001CD; Tue, 18 Aug 2026 11:12:59 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7673D1800577; Tue, 18 Aug 2026 11:11:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051584; 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=zDsYU84mwLAbqV+OnBgVdBLILxVNuaqtJnPUxcPz1pc=; b=V5475cONi6H3me7av5xnImwuyzV15CiZDLUVB9KJY3LO+k9FwDnf0Ad8s+xVIAEzB3naz/ iY++cpI5XC4IaEIHvKgpykU+EQ9tnXnC1pliElqslSrGrbCHSoumwrOA+bX1QrN+5Qvjee 4rgp1TicdI/uJeo9ecfwwNbhC9y+FLs= X-MC-Unique: u4H3jL4rNdmdvE48vML9Ew-1 X-Mimecast-MFC-AGG-ID: u4H3jL4rNdmdvE48vML9Ew_1787051579 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:30 +0400 Subject: [PATCH v3 03/74] qapi: factor out QAPISchemaUsedTypes from introspect visitor MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-3-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=17542; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=W/qYHJPJPu5ufAkv7LgU2NtKmzU4u+ZziFSTm/PU/Vc=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD220zFKEVQHj7V96IK7tOYShSy+D/G5ockPO Vc1dEnElaaJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9tgAKCRDa6OEJdZac 5cDAD/9peXnucY9AgISnoKHiOz1QExExXqzKZlRs6uqRESt0kH2W3EvE348SXoRZLCx+9iTJ34+ HuPXVpzb91Ib1O+wP/KmEWlRokxRXYuZRgypuSH1Xi6x1bIs6j6XaAceoWEdf8J7nyeMGRJvzG3 5GQgSPoKBkYTlGO6lpUqC1tLnBybfghHYF1H6O1kTgNDT4sOeL++9vshuyG9PAnKtWWmfw2AGXO H1WY1NcnmU3OTNBtXvvvbc7z4NM8kQAB0g6e1sL7xDTtfgXtK6mRZei93X9X909zIAksYxoKzhm 4+jSiu+hDh/2BGdlXLd2VIPkqJE53Rv5GBm7dGdId6p3Q9+P4zYyq1tolL2cWoTIw5phIDuloic U9aBRjLDoQY/fPjSZGW7Kjs1A3ill31163/H5fV2rLlpBzlpm/uz81tZIehHkSBv4AECICkanLy pdCzfeqRHlbb+eMrGoBOF5Jv9Ia5XeeU+smWT8fxcHyTRJ9bbOUX18B2HS25pD26kOk+dUwL0ul RUXjJMXmDcz+4O1GqkjpzR+JkC/EiQeOyi1Y4ty1SuDGt7vA9QdR4eWBf1DoZlQqj0tkNHZT+Fu jcMPaMxDPBuYuSg/7L//X1e6sevfcQtsA8mICUl5fnVHIKJrSqBOCzSypcQbvGO9YJnmaSdsjBc Bn38hnrbI64LoDg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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: 1787051651756158500 Move QMP-reachable type tracking and name masking out of the introspect visitor into a standalone QAPISchemaUsedTypes visitor in a new schema_analysis module. Run the analysis pass in QAPICBackend.generate() in preparation for other generators. While at it, refactor a bit the code to make it easier to read, and optimize using _used_type_set for O(1) lookups. Signed-off-by: Marc-Andr=C3=A9 Lureau --- meson.build | 1 + scripts/qapi/backend.py | 7 +- scripts/qapi/introspect.py | 78 +++++-------------- scripts/qapi/schema_analysis.py | 164 ++++++++++++++++++++++++++++++++++++= ++++ 4 files changed, 191 insertions(+), 59 deletions(-) diff --git a/meson.build b/meson.build index 49a5baf5b52f..6ddb323c13f5 100644 --- a/meson.build +++ b/meson.build @@ -3499,6 +3499,7 @@ qapi_gen_depends =3D [ meson.current_source_dir() / '= scripts/qapi/__init__.py', meson.current_source_dir() / 'scripts/qapi/main.py', meson.current_source_dir() / 'scripts/qapi/parser.py', meson.current_source_dir() / 'scripts/qapi/schema.py', + meson.current_source_dir() / 'scripts/qapi/schema_ana= lysis.py', meson.current_source_dir() / 'scripts/qapi/source.py', meson.current_source_dir() / 'scripts/qapi/types.py', meson.current_source_dir() / 'scripts/qapi/visit.py', diff --git a/scripts/qapi/backend.py b/scripts/qapi/backend.py index 49ae6ecdd33e..59329965890f 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 .schema_analysis import QAPISchemaUsedTypes from .types import gen_types from .visit import gen_visit =20 @@ -49,7 +50,7 @@ def generate(self, """ Generate C code for the given schema into the target directory. =20 - :param schema_file: The primary QAPI schema file. + :param schema: The primary QAPI schema file. :param output_dir: The output directory to store generated code. :param prefix: Optional C-code prefix for symbol names. :param unmask: Expose non-ABI names through introspection? @@ -57,9 +58,11 @@ def generate(self, =20 :raise QAPIError: On failures. """ + schema_types =3D QAPISchemaUsedTypes(unmask) + schema.visit(schema_types) gen_types(schema, output_dir, prefix, builtins) gen_features(schema, output_dir, prefix) gen_visit(schema, output_dir, prefix, builtins) gen_commands(schema, output_dir, prefix, gen_tracing) gen_events(schema, output_dir, prefix) - gen_introspect(schema, output_dir, prefix, unmask) + gen_introspect(schema, output_dir, prefix, schema_types) diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 7e28de2279ad..9e76e3aa38a9 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -28,9 +28,7 @@ from .schema import ( QAPISchema, QAPISchemaAlternatives, - QAPISchemaArrayType, QAPISchemaBranches, - QAPISchemaBuiltinType, QAPISchemaEntity, QAPISchemaEnumMember, QAPISchemaFeature, @@ -40,6 +38,7 @@ QAPISchemaType, QAPISchemaVariant, ) +from .schema_analysis import QAPISchemaUsedTypes from .source import QAPISourceInfo =20 =20 @@ -169,15 +168,13 @@ def to_c_string(string: str) -> str: =20 class QAPISchemaGenIntrospectVisitor(QAPISchemaMonolithicCVisitor): =20 - def __init__(self, prefix: str, unmask: bool): + def __init__(self, prefix: str, schema_types: QAPISchemaUsedTypes): super().__init__( prefix, 'qapi-introspect', ' * QAPI/QMP schema introspection', __doc__) - self._unmask =3D unmask + self._schema_types =3D schema_types 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" @@ -190,7 +187,7 @@ def visit_begin(self, schema: QAPISchema) -> None: =20 def visit_end(self) -> None: # visit the types that are actually used - for typ in self._used_types: + for typ in self._schema_types.used_types(): typ.visit(self) # generate C name =3D c_name(self._prefix, protect=3DFalse) + 'qmp_schema_qlit' @@ -207,45 +204,11 @@ def visit_end(self) -> None: c_string=3D_tree_to_qlit(self._trees))) 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] - - 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) - # 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) - @staticmethod def _gen_features(features: Sequence[QAPISchemaFeature] ) -> List[Annotated[str]]: @@ -267,11 +230,10 @@ def _gen_tree(self, name: str, mtype: str, obj: Dict[= str, object], """ 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}' - name =3D self._name(name) + masked =3D self._schema_types.masked_name(name) + if masked !=3D name: + comment =3D f'"{masked}" =3D {name}' + name =3D masked obj['name'] =3D name obj['meta-type'] =3D mtype if features: @@ -291,7 +253,7 @@ def _gen_object_member(self, member: QAPISchemaObjectTy= peMember ) -> Annotated[SchemaInfoObjectMember]: obj: SchemaInfoObjectMember =3D { 'name': member.name, - 'type': self._use_type(member.type) + 'type': self._schema_types.introspection_name(member.type) } if member.optional: obj['default'] =3D None @@ -303,7 +265,7 @@ def _gen_variant(self, variant: QAPISchemaVariant ) -> Annotated[SchemaInfoObjectVariant]: obj: SchemaInfoObjectVariant =3D { 'case': variant.name, - 'type': self._use_type(variant.type) + 'type': self._schema_types.introspection_name(variant.type) } return Annotated(obj, variant.ifcond) =20 @@ -326,7 +288,7 @@ 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: - element =3D self._use_type(element_type) + element =3D self._schema_types.introspection_name(element_type) self._gen_tree('[' + element + ']', 'array', {'element-type': elem= ent}, ifcond) =20 @@ -349,8 +311,9 @@ def visit_alternate_type(self, name: str, info: Optiona= l[QAPISourceInfo], alternatives: QAPISchemaAlternatives) -> None: self._gen_tree( name, 'alternate', - {'members': [Annotated({'type': self._use_type(m.type)}, - m.ifcond) + {'members': [Annotated({ + 'type': self._schema_types.introspection_name(m.type) + }, m.ifcond) for m in alternatives.variants]}, ifcond, features ) @@ -367,8 +330,8 @@ def visit_command(self, name: str, info: Optional[QAPIS= ourceInfo], arg_type =3D arg_type or self._schema.the_empty_object_type ret_type =3D ret_type or self._schema.the_empty_object_type obj: SchemaInfoCommand =3D { - 'arg-type': self._use_type(arg_type), - 'ret-type': self._use_type(ret_type) + 'arg-type': self._schema_types.introspection_name(arg_type), + 'ret-type': self._schema_types.introspection_name(ret_type) } if allow_oob: obj['allow-oob'] =3D allow_oob @@ -382,12 +345,13 @@ def visit_event(self, name: str, info: Optional[QAPIS= ourceInfo], assert self._schema is not None =20 arg_type =3D arg_type or self._schema.the_empty_object_type - self._gen_tree(name, 'event', {'arg-type': self._use_type(arg_type= )}, - ifcond, features) + self._gen_tree(name, 'event', { + 'arg-type': self._schema_types.introspection_name(arg_type) + }, ifcond, features) =20 =20 def gen_introspect(schema: QAPISchema, output_dir: str, prefix: str, - opt_unmask: bool) -> None: - vis =3D QAPISchemaGenIntrospectVisitor(prefix, opt_unmask) + schema_types: QAPISchemaUsedTypes) -> None: + vis =3D QAPISchemaGenIntrospectVisitor(prefix, schema_types) schema.visit(vis) vis.write(output_dir) diff --git a/scripts/qapi/schema_analysis.py b/scripts/qapi/schema_analysis= .py new file mode 100644 index 000000000000..7e42abbc14e1 --- /dev/null +++ b/scripts/qapi/schema_analysis.py @@ -0,0 +1,164 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +""" +Collect introspectable types from a QAPI schema and assign masked names. + +Copyright (C) 2015-2026 Red Hat, Inc. + +Authors: + Markus Armbruster + John Snow + Marc-Andr=C3=A9 Lureau +""" + +from typing import ( + Dict, + List, + Optional, + Sequence, + Set, +) + +from .schema import ( + QAPISchema, + QAPISchemaAlternatives, + QAPISchemaArrayType, + QAPISchemaBranches, + QAPISchemaBuiltinType, + QAPISchemaEntity, + QAPISchemaFeature, + QAPISchemaIfCond, + QAPISchemaObjectType, + QAPISchemaObjectTypeMember, + QAPISchemaType, + QAPISchemaVisitor, +) +from .source import QAPISourceInfo + + +class QAPISchemaUsedTypes(QAPISchemaVisitor): + """Collect the set of QMP-reachable types from a schema. + + Types are discovered transitively starting from commands and events. + Each type is also given a masked introspection name (an integer + string). + """ + + def __init__(self, unmask: bool): + self._unmask =3D unmask + self._schema: Optional[QAPISchema] =3D None + # Ordered list + set: insert during iteration + O(1) check + self._used_types: List[QAPISchemaType] =3D [] + self._used_types_set: Set[QAPISchemaType] =3D set() + self._name_map: Dict[str, str] =3D {} + + def visit_begin(self, schema: QAPISchema) -> None: + self._schema =3D schema + self._used_types =3D [] + self._used_types_set =3D set() + self._name_map =3D {} + + def visit_end(self) -> None: + assert self._schema is not None + # Discover transitively-used types; the list grows as + # visiting each type registers the types it references. + for typ in self._used_types: + typ.visit(self) + # Assign stable masked names now that all types are known + counter =3D 0 + for typ in self._used_types: + if isinstance(typ, (QAPISchemaBuiltinType, QAPISchemaArrayType= )): + continue + self._name_map[typ.name] =3D ( + typ.name if self._unmask else str(counter)) + counter +=3D 1 + + def visit_needed(self, entity: QAPISchemaEntity) -> bool: + # Skip types during main traversal; visit_end() handles them + return not isinstance(entity, QAPISchemaType) + + def visit_command(self, name: str, info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + features: List[QAPISchemaFeature], + arg_type: Optional[QAPISchemaObjectType], + ret_type: Optional[QAPISchemaType], gen: bool, + success_response: bool, boxed: bool, allow_oob: bool, + allow_preconfig: bool, coroutine: bool) -> None: + assert self._schema is not None + self._register_type(arg_type or self._schema.the_empty_object_type) + self._register_type(ret_type or self._schema.the_empty_object_type) + + def visit_event(self, name: str, info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + features: List[QAPISchemaFeature], + arg_type: Optional[QAPISchemaObjectType], + boxed: bool) -> None: + assert self._schema is not None + self._register_type(arg_type or self._schema.the_empty_object_type) + + def visit_object_type_flat( + self, name: str, info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + features: List[QAPISchemaFeature], + members: List[QAPISchemaObjectTypeMember], + branches: Optional[QAPISchemaBranches]) -> None: + for m in members: + self._register_type(m.type) + if branches: + for v in branches.variants: + self._register_type(v.type) + + def visit_array_type(self, name: str, info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + element_type: QAPISchemaType) -> None: + self._register_type(element_type) + + def visit_alternate_type( + self, name: str, info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + features: List[QAPISchemaFeature], + alternatives: QAPISchemaAlternatives) -> None: + for m in alternatives.variants: + self._register_type(m.type) + + def _register_type(self, typ: QAPISchemaType) -> None: + """Record a type as QMP-reachable (idempotent).""" + typ =3D self._canonicalize_type(typ) + if typ not in self._used_types_set: + self._used_types.append(typ) + self._used_types_set.add(typ) + if isinstance(typ, QAPISchemaArrayType): + self._register_type(typ.element_type) + + def _canonicalize_type(self, typ: QAPISchemaType) -> QAPISchemaType: + """Canonicalize integer types to plain int.""" + assert self._schema is not None + if typ.json_type() =3D=3D 'int': + type_int =3D self._schema.lookup_type('int') + assert type_int + return type_int + if (isinstance(typ, QAPISchemaArrayType) and + typ.element_type.json_type() =3D=3D 'int'): + type_intlist =3D self._schema.lookup_type('intList') + assert type_intlist + return type_intlist + return typ + + def masked_name(self, name: str) -> str: + """Return the masked name for a non-builtin, non-array type.""" + assert name in self._name_map, \ + f"type '{name}' was not registered or is builtin/array" + return self._name_map[name] + + def introspection_name(self, typ: QAPISchemaType) -> str: + """Return the introspection name for a type.""" + typ =3D self._canonicalize_type(typ) + if isinstance(typ, QAPISchemaBuiltinType): + return typ.name + if isinstance(typ, QAPISchemaArrayType): + return '[' + self.introspection_name(typ.element_type) + ']' + assert typ in self._used_types_set + return self.masked_name(typ.name) + + def used_types(self) -> Sequence[QAPISchemaType]: + """Return the types to include in QAPI introspection.""" + return self._used_types --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051621; cv=none; d=zohomail.com; s=zohoarc; b=krTqBFEpPJL7J4SG38pcguCC1gkZvdsDX7zz2c18keLBPOH4nUT5cIRgkoY/qHtfecHe5gsODEsyNOUkFGBjAwpN+ycjtJHSUgy2p+RrUorHggFh8jMhAB1/TahNRXW3P/iFcltMyonfLCIn7zYRqjb0aYia8m0clVoQwRKh6Js= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051621; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=w8m95gEWA5U3jbTNceNdKWBzcxPjyCwUAePZf6sjHEs=; b=hEr8+uc3wU4l9Hw0TvyoBX1qnlI7iaG9+KC2ur5wNOJrW23n9SjklLqeFkRMqAKeQ3uUN3vl7FnzTh0OJksODIp3Jecxsr7dCH13n/UIYMyE4Uqp0R5U2P3EO5o6W9FXcmfYI4fKlGopDsmTo14cStAUgAd2NcxMZpJV9tK2280= 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 1787051621725642.9980577318911; Tue, 18 Aug 2026 04:13:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHky-0003jn-Fw; Tue, 18 Aug 2026 07:13:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHkw-0003j8-8B for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:13:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHku-0004uQ-Hn for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:13:22 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-680-cuu_w6L6MjOrHtrz4EAYzA-1; Tue, 18 Aug 2026 07:13:06 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6A2171955EB4; Tue, 18 Aug 2026 11:13:05 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0D061195608A; Tue, 18 Aug 2026 11:13:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051599; 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=w8m95gEWA5U3jbTNceNdKWBzcxPjyCwUAePZf6sjHEs=; b=iNsEsZ9FU1zKDXJghWprprQ273l4+meAP2pmAFm8wTHf1+IYsNtcB5h9QcapXUUVdM+lLV AILIxlhlILiRJXgmoxOuG9/WFRjbiJcdUghIMo+cAOc01Gg9W95LybcYfLNUWSedRHzlF+ fCALL1714Wgwx/uV1nG75uJqDgh/JPM= X-MC-Unique: cuu_w6L6MjOrHtrz4EAYzA-1 X-Mimecast-MFC-AGG-ID: cuu_w6L6MjOrHtrz4EAYzA_1787051585 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:31 +0400 Subject: [PATCH v3 04/74] qapi: register all introspectable types, not just QMP-reachable ones MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-4-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=7834; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=+ugXkl0/59jlcWQDIp9PvCnhUKa9x6JqLEfbZx+Dfds=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD22I5Ce6QS4qw6llQRH4segGsYDLOY2Dnrh/ Vahz5dqDJuJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9tgAKCRDa6OEJdZac 5eNGD/4gRzlSaZtiBEDTl757rOwp43apozYfhlvItycxgkZwS0xF3H8KijZN3Vc7qp5YETPMClb MoByMqX/AG3NGoXNB79SJ9bjz59shI4vuyo3IRdXU2cSTd+2GAxudpd0F7VVoGsQOUF9xbZMjx/ FaN1AVJX6EdAevM93zlkoai+9ezFDAoEVHsr+kAXnUB/BxceYesmeEaYdVWHDa0mY8+rMORY5mw z6UGJtRfW1XjaIkeYXu8QLhI129dCu9KWSP7XbiY838xjCU0U9JnnUEhTgsmcIkjqGNLskkxMM7 SH8jHHezFwUwywSDNcRyXtvwJWh+9ImIcUNMtxIGvhNFW3plDwOgK5QemjiKABBrRPKMZVn2bzu X0W4ITIXKjakKF/HgYozU2OFcao0bOWBugfQoo5xDIPeIfVLnAEeEKMhawVR+mmN5zhSToqFb8A i+1H38esRo7UKUb/NZRKuN9AemIdqRQuzltoFeKS+gR4/eOO1xOuP2zZPrMZ9OkMtjbKI5kWHTg shCVX6X8Wa+DyXWNjBtMQkMNNOMuOUHBxPe3T3caYdJHlBgURPAsWgKC/vkjgny5JohIDedPnzl 9tmT3/xwXZGO4jDFlk+d+gnjV/7tHZUOsjnoDTVu2ojk+CzAx98bGjeuy9FoSpIz+Sj5qFPE/ax qkv3uS1Ev3Fpexw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787051627809158500 Rename QAPISchemaUsedTypes to QAPISchemaTypeAnalysis and broaden type collection: instead of discovering types transitively from commands and events, register every non-implicit type upfront in visit_needed() and let visit_end() resolve their dependencies. This is needed so that QOM property types that are defined in the QAPI schema but not referenced by any command or event still appear in query-qmp-schema output, making them introspectable by management tools. Commands and events still register their (often implicit) argument and return types, which visit_needed() intentionally skips. This makes the x86-64 schema grow from 244K to 265K. Signed-off-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi/backend.py | 4 +-- scripts/qapi/introspect.py | 6 ++--- scripts/qapi/schema_analysis.py | 55 +++++++++++++++++++++----------------= ---- 3 files changed, 33 insertions(+), 32 deletions(-) diff --git a/scripts/qapi/backend.py b/scripts/qapi/backend.py index 59329965890f..24717be48c3c 100644 --- a/scripts/qapi/backend.py +++ b/scripts/qapi/backend.py @@ -8,7 +8,7 @@ from .features import gen_features from .introspect import gen_introspect from .schema import QAPISchema -from .schema_analysis import QAPISchemaUsedTypes +from .schema_analysis import QAPISchemaTypeAnalysis from .types import gen_types from .visit import gen_visit =20 @@ -58,7 +58,7 @@ def generate(self, =20 :raise QAPIError: On failures. """ - schema_types =3D QAPISchemaUsedTypes(unmask) + schema_types =3D QAPISchemaTypeAnalysis(unmask) schema.visit(schema_types) gen_types(schema, output_dir, prefix, builtins) gen_features(schema, output_dir, prefix) diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 9e76e3aa38a9..77c29425c42d 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -38,7 +38,7 @@ QAPISchemaType, QAPISchemaVariant, ) -from .schema_analysis import QAPISchemaUsedTypes +from .schema_analysis import QAPISchemaTypeAnalysis from .source import QAPISourceInfo =20 =20 @@ -168,7 +168,7 @@ def to_c_string(string: str) -> str: =20 class QAPISchemaGenIntrospectVisitor(QAPISchemaMonolithicCVisitor): =20 - def __init__(self, prefix: str, schema_types: QAPISchemaUsedTypes): + def __init__(self, prefix: str, schema_types: QAPISchemaTypeAnalysis): super().__init__( prefix, 'qapi-introspect', ' * QAPI/QMP schema introspection', __doc__) @@ -187,7 +187,7 @@ def visit_begin(self, schema: QAPISchema) -> None: =20 def visit_end(self) -> None: # visit the types that are actually used - for typ in self._schema_types.used_types(): + for typ in self._schema_types.types(): typ.visit(self) # generate C name =3D c_name(self._prefix, protect=3DFalse) + 'qmp_schema_qlit' diff --git a/scripts/qapi/schema_analysis.py b/scripts/qapi/schema_analysis= .py index 7e42abbc14e1..1d12306f61e2 100644 --- a/scripts/qapi/schema_analysis.py +++ b/scripts/qapi/schema_analysis.py @@ -35,37 +35,37 @@ from .source import QAPISourceInfo =20 =20 -class QAPISchemaUsedTypes(QAPISchemaVisitor): - """Collect the set of QMP-reachable types from a schema. +class QAPISchemaTypeAnalysis(QAPISchemaVisitor): + """Analyze types from a QAPI schema. =20 - Types are discovered transitively starting from commands and events. - Each type is also given a masked introspection name (an integer - string). + Every non-builtin, non-array type is given a masked introspection + name (an integer string). """ =20 def __init__(self, unmask: bool): self._unmask =3D unmask self._schema: Optional[QAPISchema] =3D None # Ordered list + set: insert during iteration + O(1) check - self._used_types: List[QAPISchemaType] =3D [] - self._used_types_set: Set[QAPISchemaType] =3D set() + self._types: List[QAPISchemaType] =3D [] + self._types_set: Set[QAPISchemaType] =3D set() self._name_map: Dict[str, str] =3D {} =20 def visit_begin(self, schema: QAPISchema) -> None: self._schema =3D schema - self._used_types =3D [] - self._used_types_set =3D set() + self._types =3D [] + self._types_set =3D set() self._name_map =3D {} =20 def visit_end(self) -> None: assert self._schema is not None - # Discover transitively-used types; the list grows as + # Discover type dependencies; the list grows as # visiting each type registers the types it references. - for typ in self._used_types: + for typ in self._types: typ.visit(self) - # Assign stable masked names now that all types are known + + # Assign masked names now that all introspected types are known. counter =3D 0 - for typ in self._used_types: + for typ in self._types: if isinstance(typ, (QAPISchemaBuiltinType, QAPISchemaArrayType= )): continue self._name_map[typ.name] =3D ( @@ -73,8 +73,14 @@ def visit_end(self) -> None: counter +=3D 1 =20 def visit_needed(self, entity: QAPISchemaEntity) -> bool: - # Skip types during main traversal; visit_end() handles them - return not isinstance(entity, QAPISchemaType) + # Side effect: register all introspectable types now, so that + # visit_end() can traverse them to discover type dependencies. + if isinstance(entity, QAPISchemaType): + if (not entity.is_implicit() or + isinstance(entity, QAPISchemaArrayType)): + self._register_type(entity) + return False + return True =20 def visit_command(self, name: str, info: Optional[QAPISourceInfo], ifcond: QAPISchemaIfCond, @@ -107,11 +113,6 @@ def visit_object_type_flat( for v in branches.variants: self._register_type(v.type) =20 - def visit_array_type(self, name: str, info: Optional[QAPISourceInfo], - ifcond: QAPISchemaIfCond, - element_type: QAPISchemaType) -> None: - self._register_type(element_type) - def visit_alternate_type( self, name: str, info: Optional[QAPISourceInfo], ifcond: QAPISchemaIfCond, @@ -121,11 +122,11 @@ def visit_alternate_type( self._register_type(m.type) =20 def _register_type(self, typ: QAPISchemaType) -> None: - """Record a type as QMP-reachable (idempotent).""" + """Record a type for introspection (idempotent).""" typ =3D self._canonicalize_type(typ) - if typ not in self._used_types_set: - self._used_types.append(typ) - self._used_types_set.add(typ) + if typ not in self._types_set: + self._types.append(typ) + self._types_set.add(typ) if isinstance(typ, QAPISchemaArrayType): self._register_type(typ.element_type) =20 @@ -156,9 +157,9 @@ def introspection_name(self, typ: QAPISchemaType) -> st= r: return typ.name if isinstance(typ, QAPISchemaArrayType): return '[' + self.introspection_name(typ.element_type) + ']' - assert typ in self._used_types_set + assert typ in self._types_set return self.masked_name(typ.name) =20 - def used_types(self) -> Sequence[QAPISchemaType]: + def types(self) -> Sequence[QAPISchemaType]: """Return the types to include in QAPI introspection.""" - return self._used_types + return self._types --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051637; cv=none; d=zohomail.com; s=zohoarc; b=ZnblpKKPQow5nVQ8LtOOhJvPXrjsrygoJyG7NAZvUml1Rjd4g+0uQwQf2dscOmduNRZzR0hMs8wEePAllp93ezwznoZuk398bRBGnBtnwFSWWNnatK0QhQrXlRlPwIpXklnewpCYwRWeL9DpA5pgIszDkfGIvV923pnfrJfyKKY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051637; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zQF4Qx0Ioq7pe1q6T76hGhnUHwMBIHLfs7Wyso1fy8E=; b=GgpCdi51auzS02BqcbvoA7TcybzRe/EUf/iRT8cye1I/YodCe+gr5imEm4X5n+zlrkcq6+Xq+r0Ues/eRXT3rXmufHjyIg3wwvJBwaCFISpSSRkh4fpZlqtLhXNEsIMPZNGd1WP7zzO5Kb4xTPAKbmb7dwFNw+unfHkMX6+sZW8= 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 1787051637268712.4612774018983; Tue, 18 Aug 2026 04:13:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHky-0003k3-TW; Tue, 18 Aug 2026 07:13:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHkx-0003jI-3i for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:13:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHku-0004uZ-V4 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:13:22 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-396-9xojHLNOONq1oGqx4OJ16Q-1; Tue, 18 Aug 2026 07:13:18 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7BC9C195609D; Tue, 18 Aug 2026 11:13:17 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 02CBB195608A; Tue, 18 Aug 2026 11:13:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051600; 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=zQF4Qx0Ioq7pe1q6T76hGhnUHwMBIHLfs7Wyso1fy8E=; b=IDcIW0mTzo2D+Q2dLlSAyRn9MVVfrTAqHIvrhFjQ+9n3eYWfN4tUmgG/nfI+jXIQhv/FZe DFGiMHCGwFqjZ3EvjZqqtGUxX2in+YP1Q7GFN5iHnEQJC8VYuEtkokXeA2+cIw+LNlc8t3 Q12EMtIfslHua1qsSBeVjzhGD60nVjw= X-MC-Unique: 9xojHLNOONq1oGqx4OJ16Q-1 X-Mimecast-MFC-AGG-ID: 9xojHLNOONq1oGqx4OJ16Q_1787051597 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:32 +0400 Subject: [PATCH v3 05/74] qapi: add type-infos generator MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-5-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=14217; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=isWreerEomTksMJrxaU5p2n2CsBAy4FB3bQl4aD12Gs=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD22tuoGcyPoHmmhs5WRhfg4HGPV527Zxbk4T X29xRP95baJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9tgAKCRDa6OEJdZac 5afoD/46AriBWiaBPIRpVeXtR9/hKuH72rLnWksEXIFzQkA+wmcH8cRmUL+63yY4AUaVs3S+l9G HsLNP8qD5x2o+RiiaqOI62ew3zZQKr08DaVz9I5MPjziLoU/qoy9+1+YHnbnwH09Jj9G8d/TGC+ jhHBhkOj4RXXH0te+5utcTMkCdS5uhpPguSYtuusFMaU1/PCN4Q6DSA1mIGVQ75gqBtkrVY23ab 71DI/3ejEno9q62L1LvMOJWHF/UN4NQgykXLGc1Si+UJ+HVohOiDEMFm+FaGLV2yC+nCPlET/TW bdK8beq5HN9PH96KwL8wwpxw/QkBjPcsH8mTuHsVVKgz/xtyhFfcs2GNSKfCWlkL1XRAE+zPL/9 bfSUYpP/soaO+NtgINXZftoK9+02nRFUxaezwe69jFwRi1L6lanRDOd4jNTPS1/kb+DwE7pJhD8 ZFSHUhHPgNz+nq9dONs3sJnIx08qIXV5mPm9tu0tGC3vOxbtsQ8/kPWAABvwdHD6oQIJxze1cD+ TDEyIatyYJ8scrDyWtrtdjPmdTOGeNwbj8dpSgkE4F9BfbrxpBgQtOolgR+naWmWQyJxr+MhFyJ Z/Dug+EbtuX9H538/nB7JFlwyMr8bcj05mLqsTB4luDMsSv+HUYgQNw/oRSkdYY1mC5RN4b74C9 6l38/V1rlmGTUSw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787051639708158500 New QAPISchemaGenTypeInfoVisitor produces per-module qapi-type-infos-*.h/c files. Each file declares QAPITypeInfo constants pairing the QAPI type name with its masked introspection name. Signed-off-by: Marc-Andr=C3=A9 Lureau --- docs/devel/qapi-code-gen.rst | 107 +++++++++++++++++++++++++- meson.build | 1 + scripts/qapi/backend.py | 2 + scripts/qapi/introspect.py | 2 +- scripts/qapi/type_infos.py | 178 +++++++++++++++++++++++++++++++++++++++= ++++ 5 files changed, 285 insertions(+), 5 deletions(-) diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst index b1cc5b5f0db1..d176238fc2ef 100644 --- a/docs/devel/qapi-code-gen.rst +++ b/docs/devel/qapi-code-gen.rst @@ -1247,10 +1247,10 @@ meaningful type names instead. Optional member "features" exposes the entity's feature strings as a JSON array of strings. =20 -To examine a type, start with a command or event using it, then follow -references by name. - -QAPI schema definitions not reachable that way are omitted. +To examine a type used by QMP, start with a command or event using it, +then follow references by name. User-defined and array types are also +included when they are not reachable from a command or event, as they +may also be used by QOM. =20 The SchemaInfo for a command has meta-type "command", and variant members "arg-type", "ret-type" and "allow-oob". On the wire, the @@ -2101,3 +2101,102 @@ Example:: })); =20 [Uninteresting stuff omitted...] + + +Code generated for type information +----------------------------------- + +Type info is generated for user-defined and array types. With option +``--builtins``, it is also generated for built-in types and the internal +``QType`` enum. Other implicit types are skipped. + +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"``). QOM uses this as the + property type string. + +``masked_name`` + For user-defined types, the masked name used in + ``query-qmp-schema`` output. For array types, the corresponding + bracketed introspection name. Built-in types use their QAPI name; + note that introspection canonicalizes the integer built-in types + to ``int``. Internal types not present in introspection use + ``NULL``. + +``lookup`` + For enum types, a pointer to the corresponding ``QEnumLookup`` + table. ``NULL`` for non-enum types. + +``list`` + For types that have an array variant, a pointer to the array type's + ``QAPITypeInfo``. ``NULL`` when no array type exists. + +These type info instances are used by QOM property registration +functions (``object_property_add_qapi()``, +``object_class_property_add_qapi_enum()``, etc.) to associate each +property with its QAPI type. The ``qom-list`` and +``device-list-properties`` QMP commands then expose the ``qapi-type`` +field, giving management tools a formal type reference they can look +up in the introspection schema. + +All user-defined and array types are included in introspection, even when +they are not reachable from a command or event. Their type info therefore +always provides the introspection cross-reference. + +Example:: + + $ cat qapi-generated/example-qapi-type-infos.h + [Uninteresting stuff omitted...] + + #ifndef EXAMPLE_QAPI_TYPE_INFOS_H + #define EXAMPLE_QAPI_TYPE_INFOS_H + + #include "qapi/qapi-builtin-type-infos.h" + + extern const QAPITypeInfo UserDefOne_type_info; + + extern const QAPITypeInfo UserDefOneList_type_info; + + #endif /* EXAMPLE_QAPI_TYPE_INFOS_H */ + $ cat qapi-generated/example-qapi-type-infos.c + [Uninteresting stuff omitted...] + + const QAPITypeInfo UserDefOne_type_info =3D { + .name =3D "UserDefOne", + .masked_name =3D "1", + .list =3D &UserDefOneList_type_info, + }; + + const QAPITypeInfo UserDefOneList_type_info =3D { + .name =3D "UserDefOneList", + .masked_name =3D "[1]", + }; + + [Uninteresting stuff omitted...] + +For a modular QAPI schema (see section `Include directives`_), code for +each sub-module SUBDIR/SUBMODULE.json is actually generated into :: + + SUBDIR/$(prefix)qapi-type-infos-SUBMODULE.h + SUBDIR/$(prefix)qapi-type-infos-SUBMODULE.c + +If qapi-gen.py is run with option --builtins, additional files are +created: + + ``qapi-builtin-type-infos.h`` + Type info instances for built-in types + + ``qapi-builtin-type-infos.c`` + Definitions for the above type info instances diff --git a/meson.build b/meson.build index 6ddb323c13f5..adefc773c329 100644 --- a/meson.build +++ b/meson.build @@ -3501,6 +3501,7 @@ qapi_gen_depends =3D [ meson.current_source_dir() / '= scripts/qapi/__init__.py', meson.current_source_dir() / 'scripts/qapi/schema.py', meson.current_source_dir() / 'scripts/qapi/schema_ana= lysis.py', meson.current_source_dir() / 'scripts/qapi/source.py', + meson.current_source_dir() / 'scripts/qapi/type_infos= .py', meson.current_source_dir() / 'scripts/qapi/types.py', meson.current_source_dir() / 'scripts/qapi/visit.py', meson.current_source_dir() / 'scripts/qapi-gen.py' diff --git a/scripts/qapi/backend.py b/scripts/qapi/backend.py index 24717be48c3c..7c2b47a41ae6 100644 --- a/scripts/qapi/backend.py +++ b/scripts/qapi/backend.py @@ -9,6 +9,7 @@ from .introspect import gen_introspect from .schema import QAPISchema from .schema_analysis import QAPISchemaTypeAnalysis +from .type_infos import gen_type_infos from .types import gen_types from .visit import gen_visit =20 @@ -66,3 +67,4 @@ def generate(self, gen_commands(schema, output_dir, prefix, gen_tracing) gen_events(schema, output_dir, prefix) gen_introspect(schema, output_dir, prefix, schema_types) + gen_type_infos(schema, output_dir, prefix, builtins, schema_types) diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 77c29425c42d..ce37ce787567 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -351,7 +351,7 @@ def visit_event(self, name: str, info: Optional[QAPISou= rceInfo], =20 =20 def gen_introspect(schema: QAPISchema, output_dir: str, prefix: str, - schema_types: QAPISchemaUsedTypes) -> None: + schema_types: QAPISchemaTypeAnalysis) -> None: vis =3D QAPISchemaGenIntrospectVisitor(prefix, schema_types) schema.visit(vis) vis.write(output_dir) diff --git a/scripts/qapi/type_infos.py b/scripts/qapi/type_infos.py new file mode 100644 index 000000000000..b9e249584e72 --- /dev/null +++ b/scripts/qapi/type_infos.py @@ -0,0 +1,178 @@ +""" +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 .schema_analysis import QAPISchemaTypeAnalysis +from .source import QAPISourceInfo + + +class QAPISchemaGenTypeInfoVisitor(QAPISchemaModularCVisitor): + + def __init__(self, prefix: str, schema_types: QAPISchemaTypeAnalysis): + super().__init__( + prefix, 'qapi-type-infos', + ' * Schema-defined QAPI type info', + ' * Built-in QAPI type info', __doc__) + self._schema_types =3D schema_types + 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 _gen_type_info(self, name: str, + ifcond: Optional[QAPISchemaIfCond] =3D None, + with_lookup: bool =3D False, + with_list: bool =3D False, + masked_name: Optional[str] =3D None) -> None: + c_id =3D c_name(name + '_type_info') + if masked_name is not None: + masked_name_str =3D '"%s"' % masked_name + else: + masked_name_str =3D 'NULL' + with ifcontext(ifcond or QAPISchemaIfCond(), + self._genh, self._genc): + self._genh.add(mcgen(''' + +extern const QAPITypeInfo %(c_id)s; +''', + c_id=3Dc_id)) + self._genc.add(mcgen(''' + +const QAPITypeInfo %(c_id)s =3D { + .name =3D "%(name)s", + .masked_name =3D %(masked_name)s, +''', + c_id=3Dc_id, name=3Dname, + masked_name=3Dmasked_name_str)) + if with_lookup: + self._genc.add(mcgen(''' + .lookup =3D &%(c_name)s_lookup, +''', + c_name=3Dc_name(name))) + if with_list: + self._genc.add(mcgen(''' + .list =3D &%(list_id)s, +''', + list_id=3Dc_name(name + 'List_type_in= fo'))) + self._genc.add(mcgen(''' +}; +''')) + + def _has_list(self, name: str) -> bool: + assert self._schema is not None + return self._schema.lookup_type(name + 'List') is not None + + def _masked_name(self, name: str) -> Optional[str]: + assert self._schema is not None + typ =3D self._schema.lookup_type(name) + assert typ is not None + if typ.is_implicit(): + return None + return self._schema_types.masked_name(name) + + def visit_builtin_type(self, + name: str, + info: Optional[QAPISourceInfo], + json_type: str) -> None: + assert self._schema is not None + typ =3D self._schema.lookup_type(name) + assert typ is not None + masked_name =3D self._schema_types.introspection_name(typ) + self._gen_type_info(name, with_list=3Dself._has_list(name), + masked_name=3Dmasked_name) + + def visit_enum_type(self, + name: str, + info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + features: List[QAPISchemaFeature], + members: List[QAPISchemaEnumMember], + prefix: Optional[str]) -> None: + self._gen_type_info(name, ifcond, with_lookup=3DTrue, + with_list=3Dself._has_list(name), + masked_name=3Dself._masked_name(name)) + + 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: + if name.startswith('q_'): + return + self._gen_type_info(name, ifcond, + with_list=3Dself._has_list(name), + masked_name=3Dself._masked_name(name)) + + def visit_array_type(self, + name: str, + info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + element_type: QAPISchemaType) -> None: + elem_schema =3D self._schema_types.introspection_name(element_type) + masked_name =3D '[' + elem_schema + ']' + self._gen_type_info(name, ifcond, masked_name=3Dmasked_name) + + def visit_alternate_type(self, + name: str, + info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + features: List[QAPISchemaFeature], + alternatives: QAPISchemaAlternatives) -> None: + self._gen_type_info(name, ifcond, + with_list=3Dself._has_list(name), + masked_name=3Dself._masked_name(name)) + + +def gen_type_infos(schema: QAPISchema, + output_dir: str, + prefix: str, + opt_builtins: bool, + schema_types: QAPISchemaTypeAnalysis) -> None: + vis =3D QAPISchemaGenTypeInfoVisitor(prefix, schema_types) + schema.visit(vis) + vis.write(output_dir, opt_builtins) --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051637; cv=none; d=zohomail.com; s=zohoarc; b=Z7P567tbf4ugjwktNwvN0vj0AUIUpq4MxGqd2MH1z7tZq5vOET3ONK3viB/R5XSkHXe7se4rmyFKTbDHsjOENEcpIMsfjfoWb8le8NaKFfYOXUojDGjgrNlLKKq1S0xStiilzcElqV3y/+QqnJmrGPiridZJY7b2q+lsAzdvxF4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051637; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yNEk1n7QaEsB/EokKQrQ90XI1es9YIJRLBYftwaIuBg=; b=Eopk5r0BoBVosCYx/RKTuwYndMYwcaoniRj9RUsgsOEptMy/xqS0sIwve5Kuq3EZiLhleO0J+Wge99m/pvsqq5l6gznQaXY2EDgqoec45Pw1xRvFVzSWXHfq4OE1jYXHb1cwxs2FJrGdxkwkqeN9guXOBifwBVEgzu3Fdenvr+8= 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 1787051637205983.0919653188548; Tue, 18 Aug 2026 04:13:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHlA-0003wI-Bm; Tue, 18 Aug 2026 07:13:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHl9-0003se-2p for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:13:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHl7-0004vc-IJ for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:13:34 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-81-4ujubpflO2-_LaPadV0crg-1; Tue, 18 Aug 2026 07:13:24 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8F61119560AA; Tue, 18 Aug 2026 11:13:23 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 348F71944DD5; Tue, 18 Aug 2026 11:13:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051612; 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=yNEk1n7QaEsB/EokKQrQ90XI1es9YIJRLBYftwaIuBg=; b=SZYH9ma/IQUiZs4YjwPWcQvx9ZQDZyuvOf3YyrnumB/I9g7YMbERK3yEjq3CfnfzPV7bEa +dIU4nxsMKFv8ciglS9t6QhXOBMxgbBW9vAelPwyrrF2JIh8jNP4TARSJFazbVdcuefNEe sGI3jvQNXpwM7t+9SsgilW9SAH8kH5Y= X-MC-Unique: 4ujubpflO2-_LaPadV0crg-1 X-Mimecast-MFC-AGG-ID: 4ujubpflO2-_LaPadV0crg_1787051603 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:33 +0400 Subject: [PATCH v3 06/74] meson: add qapi-type-infos-*.c/h to build MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-6-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Kostiantyn Kostiuk X-Developer-Signature: v=1; a=openpgp-sha256; l=3917; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=6uTNIwu4jC9miI8Tx4Z46QMi+uYbRrSCGCnWsQfZIEo=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD23lP0Vc6DLb/RdleVCZg7bKIadVEWSJHn0e SEUhe6rhW+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9twAKCRDa6OEJdZac 5b2gEACidNg0PnZl1UEnfftn/Oj5EFZ1hnztIVh8UMkZwXa8oGFCYdGd3A4a8ddgeqTdF4cfBQN ykRb+bhjXCA31GCC6jfa4ibM3Jk2gDmj5AZLtazqz/Z1eyZne6i1OQ6hbS60qCe88uAWdqCXC2G vRL83g8zaAYmVCjSIji9S1pmEhY7FWw2bbIRqxNL/fbRk5rsFdb+GalPFnyuAmgaRzyFRsTgx7/ NhqGDKPnknIQvMNz88blxANuNGMYWXzMhGpR1641WLJ3wZCuc5fynJ+PT70EAZAntcqODW8QdZ9 t4VRthmtVOmqHC7gAAXQj0coaiuN6C8YjZwuPAmHu6MyTMtCg6N1j6/0hHjQVqCpWUcskGORgls usT+muEZbSjS4kpXnUYTUpIflLquBIJEk622qd8mNAGCqS4sAZtHtXKg8GaCtVP1M/CgOL4gu24 ta8iJAudiMn2VlVGvV7LV9y+9TW4zkjY3COrsd62bDZbsXPxi7vyrM2Djw/VxeAFduu37mN2X6d C56imC2OBXSqVlBvljElGeYJi6GDdZ2i7CvoSBFpsQ9Eyc/IZXlom3vpnnnwUt/7mHl8YqoqHs9 eTlp17ZmL9fvOqxDTXpqsP3iGW9/j4n3Z1Za0PKcB7f5TFs4GSbb0L7Op4gnSSeR0/8NuA4LGb6 Gch2hMqZUTIW/BA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787051639576158501 Add the per-module type-infos output files so they are compiled into the build. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Kostiantyn Kostiuk --- qapi/meson.build | 4 ++++ qga/meson.build | 2 ++ tests/include/meson.build | 2 ++ tests/meson.build | 6 ++++++ tests/qapi-schema/meson.build | 1 + 5 files changed, 15 insertions(+) diff --git a/qapi/meson.build b/qapi/meson.build index a46269b5a0c9..7477953492ad 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -79,6 +79,7 @@ endif =20 qapi_nonmodule_outputs =3D [ 'qapi-introspect.c', 'qapi-introspect.h', + 'qapi-type-infos.c', 'qapi-type-infos.h', 'qapi-types.c', 'qapi-types.h', 'qapi-visit.h', 'qapi-visit.c', 'qapi-commands.h', 'qapi-commands.c', @@ -88,6 +89,7 @@ qapi_nonmodule_outputs =3D [ ] =20 qapi_outputs =3D qapi_nonmodule_outputs + [ + 'qapi-builtin-type-infos.c', 'qapi-builtin-type-infos.h', 'qapi-builtin-types.c', 'qapi-builtin-visit.c', 'qapi-builtin-types.h', 'qapi-builtin-visit.h', ] @@ -96,6 +98,8 @@ qapi_inputs =3D [] foreach module : qapi_all_modules qapi_inputs +=3D [ files(module + '.json') ] qapi_module_outputs =3D [ + 'qapi-type-infos-@0@.c'.format(module), + 'qapi-type-infos-@0@.h'.format(module), 'qapi-types-@0@.c'.format(module), 'qapi-types-@0@.h'.format(module), 'qapi-visit-@0@.c'.format(module), diff --git a/qga/meson.build b/qga/meson.build index cfa2157efb23..79163b7d8e93 100644 --- a/qga/meson.build +++ b/qga/meson.build @@ -39,6 +39,8 @@ qga_qapi_outputs =3D [ 'qga-qapi-init-commands.h', 'qga-qapi-introspect.c', 'qga-qapi-introspect.h', + 'qga-qapi-type-infos.c', + 'qga-qapi-type-infos.h', 'qga-qapi-types.c', 'qga-qapi-types.h', 'qga-qapi-visit.c', diff --git a/tests/include/meson.build b/tests/include/meson.build index 8e8d1ec4e692..026480d96851 100644 --- a/tests/include/meson.build +++ b/tests/include/meson.build @@ -4,6 +4,8 @@ test_qapi_outputs_extra =3D [ 'test-qapi-commands-sub-module.h', 'test-qapi-events-sub-module.c', 'test-qapi-events-sub-module.h', + 'test-qapi-type-infos-sub-module.c', + 'test-qapi-type-infos-sub-module.h', 'test-qapi-types-sub-module.c', 'test-qapi-types-sub-module.h', 'test-qapi-visit-sub-module.c', diff --git a/tests/meson.build b/tests/meson.build index 9ba04bbedd30..71dc4ac8bf99 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -2,6 +2,8 @@ subdir('bench') subdir('qemu-iotests') =20 test_qapi_outputs =3D [ + 'qapi-builtin-type-infos.c', + 'qapi-builtin-type-infos.h', 'qapi-builtin-types.c', 'qapi-builtin-types.h', 'qapi-builtin-visit.c', @@ -22,6 +24,10 @@ test_qapi_outputs =3D [ 'test-qapi-init-commands.h', 'test-qapi-introspect.c', 'test-qapi-introspect.h', + 'test-qapi-type-infos-sub-sub-module.c', + 'test-qapi-type-infos-sub-sub-module.h', + 'test-qapi-type-infos.c', + 'test-qapi-type-infos.h', 'test-qapi-types-sub-sub-module.c', 'test-qapi-types-sub-sub-module.h', 'test-qapi-types.c', diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build index debff633ac17..392b59d8dccd 100644 --- a/tests/qapi-schema/meson.build +++ b/tests/qapi-schema/meson.build @@ -231,6 +231,7 @@ custom_target('QAPI doc', 'doc-good-qapi-events.c', 'doc-good-qapi-events.h', 'doc-good-qapi-init-commands.c', 'doc-good-qapi-ini= t-commands.h', 'doc-good-qapi-introspect.c', 'doc-good-qapi-intros= pect.h', + 'doc-good-qapi-type-infos.c', 'doc-good-qapi-type-i= nfos.h', 'doc-good-qapi-types.c', 'doc-good-qapi-types.h', 'doc-good-qapi-visit.c', 'doc-good-qapi-visit.h' ], input: files('doc-good.json'), --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051637; cv=none; d=zohomail.com; s=zohoarc; b=cJKLhRFCVFGkmUTZp2Nd96uJ48OZZ6jT3iqMgWCkB+/j36oQjJ5Hp5C/mKdXTXELwByWZdcPMuOx2R/Dm8XkC/aBnabMLNZeTUXdtAmIM9BfXCrEdWXV4dtmts5Jtz9thakC4c3dNwnNS3+2dTvNzgoav6ynZXAtD0ghSjlZQYQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051637; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Am3fRUJN9WuS7yqX+JPuhH7t6tfc338MroN3poph0bA=; b=nuAE0MWWfmNxJtj6uwsTQwgcGW99qe7NKCaD+FUK4MCQ62t5ynKJJVJU+suLbWY7rB7nncMsQvnpVuce6hoTcHFYr0tTtyImSLDNaTfa2thaaVpDAjJE9K8psjz8drUk5yZrraxiZheTyD75KtYQSAqCcRnk1TYZEAJ/8aN0sEY= 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 1787051637303147.00807317722308; Tue, 18 Aug 2026 04:13:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHlH-0004Ly-L4; Tue, 18 Aug 2026 07:13:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHlG-0004LK-4h for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:13:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHlE-0004wA-N4 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:13:41 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-646-z8XOwSgsNGeqJbjhuHlJdw-1; Tue, 18 Aug 2026 07:13:37 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BB908195605E; Tue, 18 Aug 2026 11:13:36 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 486FD195608A; Tue, 18 Aug 2026 11:13:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051620; 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=Am3fRUJN9WuS7yqX+JPuhH7t6tfc338MroN3poph0bA=; b=Op4/u9siMBv5vG4CgciHictbsR1C+fAZHgu2CRVRRZ11U6CyhN+E39LZ/qJKeKEppLkSXv tc1rVI0EjeanJt63WJiDC+deBBhJ76FchKnlk9pML+q7xwv94D82FwodRrqZwe4DdlrbJT eZMJHFj6po25wQlnUpk9L8AI/lSVLvM= X-MC-Unique: z8XOwSgsNGeqJbjhuHlJdw-1 X-Mimecast-MFC-AGG-ID: z8XOwSgsNGeqJbjhuHlJdw_1787051616 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:34 +0400 Subject: [PATCH v3 07/74] qom: add qapi_type field to ObjectProperty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-7-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1476; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=TtVEytUTXDdPuJzkoYiSuVYrieRCBIflozR8YGeFf14=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD238vDavSvw7DI2BCywQMQa+BPMvgwUON0g2 ihsOmKuKKWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9twAKCRDa6OEJdZac 5X9ID/9oHV/poerUJfecOrjnpJRwJGs/WIZEQUn4nwJsFAObv2IMK9BM1EnUZHgPRYKk6A8fdz8 L+69j+Ovi30dTmMAhIOrA6Ejrx8jIS8oTo2AYo0ZFaX+Gp1s9V0Fe11d6BaCxkFJ8xBBYV/Gg5B 46n5QHqgL3aEkAQYRWm9SLDt+NPO/hvxNevQ6k3zniUfwHX7ARLTf1lTWdj2wjU8gK1GmNu/g+Y 0UHcJMf9pNC9LE2DA35bSD1VcOQvgWfwwS+W7WrDC87jPMQg0moXjAhjEx/S+WCUEfkQtp33+ZJ Rc98AGLcUZtNfCFXS6m9dGYBjhH1fJXXxhWSQhL+PiMOUGlC0b57HSygZuc6IX+ZTouLqrUejWc 0adGAKnBCdn74GzdbXnqYypgfcdvOqpCb87Pox1stWS108aNtk54IZNGMWldX16f8XqMYvNPooj ntYl76pY1olsVLs80TmwTUi1+75yyHa9K0/5oI19tXBTkUfd4CG+ZnwLsWp37D3kwniK1hD0IRW 4tPx58MnJh/+PmN2CIE/oJykai5/2Cvh9kLEzOBqI8sH/rXjZTaX0gpdQlhmrExPSTP+xbclP5B 1SQ0TJfu7vjhRjle5k8knMDu/wsV2yuR7x22FYzRcE6fvuHLlt/WadzrL1woXPROQ66ErYdphH9 MNXQIcaKf9WWDWA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787051639595158500 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 --- 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 11b1c9d2dc8a..a262eda8de2c 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 47977b1f440b..6224e643000b 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2937,6 +2937,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.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051652; cv=none; d=zohomail.com; s=zohoarc; b=Rf9TVTaQL0Em7Sik06zIlBf3Bfmz4WDUa64G4DWbBPmLhILbVk8teuaCJovptESLYs3RiOVfYB6cxfFewObu96KIbmlgB3wYfm+zH0RlDWDxfnHUfJ/AuUM4JKR0jmCyLeRJVdB6qDX9Al55HRUFlH6Lws6vzKQBcarGEBQWA38= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051652; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HWfb3HG3+W4tkcJynLR/LZbFs83QHxlL1plph+SgWBc=; b=knNyMeIDTVdoRIdYK75HAyk/LsyLg/dmLN9H3itHj42B/QG0Nmck00HUZhlYnLocIjHw5hmNoYDx51xQ40DLVvi1cG8NYQHWHwZ+LGrzbOyAbfS9inFRvjEoqXfdE9Gd9dCNV3vrwKbiOq0g+0EC6EpgcnDeV7+3pS7oPqHml7o= 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 1787051652247910.4237987956545; Tue, 18 Aug 2026 04:14:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHlY-0004up-SU; Tue, 18 Aug 2026 07:14:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHlX-0004u2-Kn for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:13:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHlW-0004yT-78 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:13:59 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-439-v-9G3kbbOjSCdMX-bUiLuQ-1; Tue, 18 Aug 2026 07:13:54 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 468A31800650; Tue, 18 Aug 2026 11:13:53 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BA07C180034C; Tue, 18 Aug 2026 11:13:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051637; 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=HWfb3HG3+W4tkcJynLR/LZbFs83QHxlL1plph+SgWBc=; b=H3bNZKmWQRZduVPSS0/bJCVcVKtRX/amAGKaISk2GgKuddnmkouCPb8C7Av5z5BZuRIfiA me+iiz8nMYzCP6C0CgF787lA5vHm/WHhrh1btCqwfaR5bvVpCVxcJyV3G3BMF6vP9JQUHY /tKDiPOe3oP+W3DfZJu+1DIZq2TT/ks= X-MC-Unique: v-9G3kbbOjSCdMX-bUiLuQ-1 X-Mimecast-MFC-AGG-ID: v-9G3kbbOjSCdMX-bUiLuQ_1787051633 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:35 +0400 Subject: [PATCH v3 08/74] qapi/qom: add qapi-type field to ObjectPropertyInfo MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-8-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eric Blake X-Developer-Signature: v=1; a=openpgp-sha256; l=1815; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=Moqbshqs7TdOyUn7Ki/+8cl0Smbi3S9Y/fdTWeej+dc=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD23PuJQcPTApRk7N8jwrvQwMxtzkppnO4S1D x8O8WOApBSJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9twAKCRDa6OEJdZac 5VlgD/4vxspmkLZjciQHNTjFvkBWikfgzL8/Jqkx39Tdy+1Wo6gRbw/AHbBTKj6DkN1/fbGppnS 84UJktgXH1/jTkgfLyoZ46lphNV6WifW1zuVhxNEA18LY1awbU8QiwJxpC+Ibe8o/S0f/MRSegJ /0PqmR1XkbkoEHu2fe7TJKGKfmhv479gSEtu4yMyLzyjjc36lcXxvVfdJV6zWdht6hhJjlgx3jI gt4TS8z/BexLHlbd3TR+3Ior9bvxbrUva9afqU/Ctgd/G6NsMVvYbuNf8QdPvUMjgnrwwu6wHQ/ tNy6IObgm87dTmD16rOiNpXATr5Lvj9TIA4T2tvTqt8l56u6c34aqG34S2VkqjekjIiCv/7HEof hAfYI9Rp84A+2OaqUK/dIYNVQOC+2VcmQBfVJh9hzaNzNu8yU3yIqbF54BIjK+uSoyrrtS885U9 SYZTbn3EPpy4u/0G69ols5HuL00mRJGXZL8ezg+3Rt+3m1YHRZPRr01VrWxP3FoHJaCFMBB77zA oFpBMJff8LccdpJXeAOCGIxDv2N44BS+moVJYr7+nbpE1IVNsKBP6CqwtSO4njvQIOVdlqmd1Xh Atdk0sfrIInYCrqS/twtFUTKpBYbI69gEivfB9QLfqspnSmGzy9O4+Q6CkjtF5/UzNrXNTgCeY8 dtMSaQZdBDhd8ww== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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: 1787051653671158500 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. Signed-off-by: Marc-Andr=C3=A9 Lureau --- qapi/qom.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qapi/qom.json b/qapi/qom.json index c55776af7d35..8cd417e512fc 100644 --- a/qapi/qom.json +++ b/qapi/qom.json @@ -35,6 +35,10 @@ # qdev device type name. Link properties form the device model # graph. # +# @qapi-type: the name of the property's type as it appears in the +# output of ``query-qmp-schema``. Absent if the type does not +# occur there. (since 11.2) +# # @description: if specified, the description of the property. # # @default-value: the default value, if any (since 5.0) @@ -44,6 +48,7 @@ { 'struct': 'ObjectPropertyInfo', 'data': { 'name': 'str', 'type': 'str', + '*qapi-type': 'str', '*description': 'str', '*default-value': 'any' } } =20 @@ -55,6 +60,10 @@ # @type: the type of the property, as described in # `ObjectPropertyInfo`. # +# @qapi-type: the name of the property's type as it appears in the +# output of ``query-qmp-schema``. Absent if the type does not +# occur there. (since 11.2) +# # @value: the value of the property. Absent when the property cannot # be read. # @@ -63,6 +72,7 @@ { 'struct': 'ObjectPropertyValue', 'data': { 'name': 'str', 'type': 'str', + '*qapi-type': 'str', '*value': 'any' } } =20 ## --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051668; cv=none; d=zohomail.com; s=zohoarc; b=YEi/hR38raL2qb9ZKAVlJzVU3O+syFb3CjNWaNUu6l2MoJRdhzmpdLD8sgIjinc/cydAuPsA7wC/yZ4oZfx5QGx6FgFq+QiRMqdiWsT7Dzy4Gl5g0Gt6FCItdd2KWajYhQceVRRD2YcDW1lq5LeK+B0deXFdfvEc6b/eQfzBQoM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051668; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=K50ZWGwg+nOOOt1h7W1bQ4V8OqkzKi0lDblUcZD8UUs=; b=Ppm3/DnaOEWFhLim5wDxGKN3kehI6P2yzYHPasKDt+QZIQbE7Rz9DbG8t0ICbI7hkiVLZsNjUY+LfgHyhWLUXzEhDbl9AnxTZqwK2Sgy7uTMELVicTv5u5v6ck5jEwNm+TkMX2WCw3IbfmaPErbNs84F4KKmbNOjCiqFyBENinE= 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 1787051668253967.8192920536302; Tue, 18 Aug 2026 04:14:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHlv-0005p8-9B; Tue, 18 Aug 2026 07:14:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHlt-0005oq-Ow for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:14:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHls-00052M-6v for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:14:21 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-246-3hXRANe-MQu0PJ7JSypADA-1; Tue, 18 Aug 2026 07:14:15 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C05751955DC6; Tue, 18 Aug 2026 11:14:14 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 612871956042; Tue, 18 Aug 2026 11:13:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051659; 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=K50ZWGwg+nOOOt1h7W1bQ4V8OqkzKi0lDblUcZD8UUs=; b=ATBXWIsb5Sbpsjpvsc4ZixW3UO35YKE273ZBMagMb9trTkEcgx+kA37w48KUXtzFHvoJPo 5e9ILCDMDWtuUkBSeJuhI72LStKfgdiFskVZbeWU8pwDvRgrpBmWSQaZKjsuZ521MtVhHN OOth/Dm1xfVUCKNmE9+Ab1cgmttHMkU= X-MC-Unique: 3hXRANe-MQu0PJ7JSypADA-1 X-Mimecast-MFC-AGG-ID: 3hXRANe-MQu0PJ7JSypADA_1787051654 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:36 +0400 Subject: [PATCH v3 09/74] qom/qmp: populate qapi-type in QMP handlers MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-9-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=3382; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=+8tJKKMSqC8bFdqLXJxWJDTuj8Fy49U/fprYdWbqUWM=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD23zALu+CUNfu6VQ9HS23JsG1PvBWHQM7JLI zWR+TkttciJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9twAKCRDa6OEJdZac 5TqNEACkLIwYkojdSjC4Zj2UaHL/MH+4u7UTi+on71lVylAKDFxuNk3Gm+Bxpmd1ISYYFUfmY3E FWNEAZJJEMPCcHErC6z8sQQtLRxG4YkPo51JJE2xJU5fdivhfxSesOKcY6vVoIewgXfwl0IvTKD WETo3G4Mn8tsmPh5bEWZ7GqjnRY2u/1S8y9vlwJPqOgWVS8mzlMrlyaCzTTeGPVaoHvVTgPPAaT 1+QUlQKYZc7S7AfzIgn487tU8tg5HMAAQ9oP89TPoBx/fSDnHh/sWT/JMUSgz3LEzmlaVZPi+in lBs2USpc1yphjj/clH+YL/iRkRCZ50GNBCHnlllZJkCWLLyDibFQ0dp+mDWHb+nmzepYCNrOopC aGsSKVRWMI/SwHyJdtoyFh09+/hBiOqJwfiwEWPmlFJa1IVOwrm15S6LbQpRnmLJQMJEIccpT+r 4x7cqfLJcv7WlA2scX9OhVMjGm456ath8FFQaNmLnhksPnpjg7qr2u0On0gwFCuBDVeeANg49Eq CkwjFs2BoyBt6nLBui3lJSMN6Ab8Gx2D1QFr5pWr8nQTJ3psOuL9AEs7UwOCqp3vFV8rXRPwVH/ FlsWCfROlZwZoNSKEbrv4Qt5V+wnqWZUhOG8L90JjnxyU2GWE9bzlv4+sqlivlnDeyEmb3ugN46 pcrCnY/By4gEpGA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787051669537158500 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 --- qom/qom-qmp-cmds.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c index 330895361d47..f9e6d4371cc5 100644 --- a/qom/qom-qmp-cmds.c +++ b/qom/qom-qmp-cmds.c @@ -25,9 +25,22 @@ #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) { + 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 +71,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 +86,9 @@ static void qom_list_add_property_value(Object *obj, Obje= ctProperty *prop, =20 item->name =3D g_strdup(prop->name); item->type =3D g_strdup(prop->type); + if (prop->qapi_type) { + item->qapi_type =3D g_strdup(prop->qapi_type->masked_name); + } item->value =3D object_property_get_qobject(obj, prop->name, NULL); } =20 @@ -218,9 +229,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 @@ -261,11 +270,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.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051685; cv=none; d=zohomail.com; s=zohoarc; b=cnUvcCq2TnNTadLBe9hKES/3bGRVcOLTVO07vQ7ypd2+gOHr3f90et07g3pdKeMwUzwEbf7bil+iLu9EyGEZEozsEHq/JFXwjnTw1LwGBpwy4XRAwlSmHGrV7lnPuQe27R+URRQhIGEMhsQTndCOR+nOEzQkXPBmjjuYMXipk78= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051685; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=rUwogfZT8j66U+wmRNHB8GMYVd8uC9R3Hcxqc0YDI2k=; b=FEe8xzT1Yr/XPl499IPvGtpZSeYORc28aPnUM9hGbO/WS0n1riyYzjyQEDrdJU+vX/3EWLMWdwKlWx2cdrcXk28kP4ts85g4JtEl6OfCEHM5jlR4nczBcOYsutqnG1Rxrx9UuOSWoXGjCXeDEjL/1eVWRSuGsvrO78NJIrJJaFw= 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 1787051685507176.32534113805002; Tue, 18 Aug 2026 04:14:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHm9-0006C4-Dy; Tue, 18 Aug 2026 07:14:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHm5-000670-Fo for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:14:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHm4-00053a-1g for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:14:33 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-78-rPsbQ03ZNbm_sUodry4Jig-1; Tue, 18 Aug 2026 07:14:30 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D46F0180064B; Tue, 18 Aug 2026 11:14:28 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9238D1800346; Tue, 18 Aug 2026 11:14:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051671; 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=rUwogfZT8j66U+wmRNHB8GMYVd8uC9R3Hcxqc0YDI2k=; b=grBfIIj0SggHwrHKYzx5IYwACyNJ9kIB1755ivF9Rr/sP41tFnbCZXIKOJ4lMtffRa9M+Q bYtR5RFc8LBdnsh+0NoHL5Ow6iPdZZuly3am1MJoqwkdwa9kg6MN+UdIGfR26me4WamDG1 rwthnhuLVD/Kvt/KyU2CX55Vue5aad8= X-MC-Unique: rPsbQ03ZNbm_sUodry4Jig-1 X-Mimecast-MFC-AGG-ID: rPsbQ03ZNbm_sUodry4Jig_1787051669 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:37 +0400 Subject: [PATCH v3 10/74] qom: add object_property_set_default_enum() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-10-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1687; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=x2uoAD3RQmtcaAsu3VGc35pkyHzqtUK9RVDnHeUy4Ag=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD23SnDoOGbUQivR3hvLnJcoawAVV/R9FKDEA jfvdlWHYc2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9twAKCRDa6OEJdZac 5cpRD/9cIW3r9sYG7GY4bY5cS+3inowhrBVEOUViFLeSdbsykkAhfkR2DDe9//5Qhsp8WA2LTiR /C/JevAGjTOeYH0Ribzq5VJV4xHqgeSAwnzz+UYeceUoFvsinbWxMxRQ7zpOp2+OrKOcXQkr3Id N7OK+FjFdTviHvAAhsFkjMjiVe5SsTjk2SRV0pGfCEPBr/bbV8Jl9St6TZu4eXFKDGdbUJDBqK+ IDpxCvCKZFWZEuYZ1ICThttYHeGw6VlOhe3/8s1tlpXCwWzH0rGqAD2ViM3u/WLxlqLIptfK2nj cCXe6VvEfC5WlvONhJRh7wXeudnwgOUCk4/jz9raIcjyJa+j9fki9ak56wZL+aajTwrTpTASM4F 3WNguav8y3GWmTTwwRuHGeuhFGhzvlrqXeYL1vcYZjpq5JXrYwTe4DV1gfh126+Y22JJU+3PUvf Uvvu03zvhr1ZbJnNAwwC+F6V+gqeFCUr902d4aedexLG9oGJbbY0k5qZguRL9kq9RE9+TLpy8xB HE/oV+Zg4NSU6JmhB3iM6sPY7omw5KSqAjxdMnIicZ3eHTlDO6lv8xtonHNJVBtIF2WRn3Rbv8/ CZfcKKHHpeAite8KL20T15BPpGx49S4AEqZMx66SvrUsL2NOfpaU6ouEZ0uNFnQ21/QCOsynFbo CZvXPElsCapB+Zg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=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: 1787051686086158500 A simple helper to set the default enum value from the integer value. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/qom/object.h | 9 +++++++++ qom/object.c | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/include/qom/object.h b/include/qom/object.h index a262eda8de2c..271d736956da 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1223,6 +1223,15 @@ void object_property_set_default_bool(ObjectProperty= *prop, bool value); */ void object_property_set_default_str(ObjectProperty *prop, const char *val= ue); =20 +/** + * object_property_set_default_enum: + * @prop: the property to set + * @value: the value to be written to the property + * + * Set the property default value. + */ +void object_property_set_default_enum(ObjectProperty *prop, int value); + /** * object_property_set_default_list: * @prop: the property to set diff --git a/qom/object.c b/qom/object.c index 6224e643000b..93d44a9444ca 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1705,6 +1705,15 @@ void object_property_set_default_str(ObjectProperty = *prop, const char *value) object_property_set_default(prop, QOBJECT(qstring_from_str(value))); } =20 +void object_property_set_default_enum(ObjectProperty *prop, int value) +{ + assert(prop && prop->qapi_type && prop->qapi_type->lookup); + + object_property_set_default(prop, QOBJECT(qstring_from_str( + qapi_enum_lookup(prop->qapi_type->lookup, value) + ))); +} + void object_property_set_default_list(ObjectProperty *prop) { object_property_set_default(prop, QOBJECT(qlist_new())); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051693; cv=none; d=zohomail.com; s=zohoarc; b=J8L6ikaU1CAP3Aid8SLnfpIVbooUZj7IekdPKnq/dPJY2/mjmDxlJ9wCTuzemyHeuIxnnPBQuhrlGwW3c969bASkSrtvKNATSVDu2NECuUfd3b5w7K/K9gjI6tgsmnRkVr2emrXoq3IgOCnRxefPueGAdpGrYkWfMrjfrBghkec= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051693; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iBJ7ecg3IKoBQz7Cp0OVJ2rCmSSayPdHFEZlTN1fmvs=; b=U+JLQJ28HwsvKRnrJk1k67BmAWdWSzRCEb+Y20MBHOf4TDK7oNLhLhYzt6qXkmTKJmKmRiozAPbPt9B1kUqQ3SIxr4yu2EdqyzsUjOTLXZe0t2DduUYid7QAet5FyRftF55hUSf33wlRn8Jgsr61u0xRaZjlGifzVLiilTPHlwM= 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 1787051693659192.37106094689773; Tue, 18 Aug 2026 04:14:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHmK-0006Kx-Rg; Tue, 18 Aug 2026 07:14:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHmJ-0006Kh-6b for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:14:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHmH-00054I-Me for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:14:46 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-343-Uq0nRu67PiC7pOmBnccIkg-1; Tue, 18 Aug 2026 07:14:40 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8848C18001E3; Tue, 18 Aug 2026 11:14:39 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D803A195608A; Tue, 18 Aug 2026 11:14:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051685; 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=iBJ7ecg3IKoBQz7Cp0OVJ2rCmSSayPdHFEZlTN1fmvs=; b=EkOfeQvG7wq9mjVoKWpR2+X537uJn6u+B3adV3wJoTMGx/hfMGCYmHnIpwbXweh8kGrBnd kTeasO0UX5HLLEJ1Rz6fSnQgM88pwoXAWYMmjN7BkOCszSINyTKDHxjDiWWIeW+417oALr W7w1hLuv8nWMv9XwrcsIoaNMxRRh3Pw= X-MC-Unique: Uq0nRu67PiC7pOmBnccIkg-1 X-Mimecast-MFC-AGG-ID: Uq0nRu67PiC7pOmBnccIkg_1787051679 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:38 +0400 Subject: [PATCH v3 11/74] qom: add object_{class_}property_add_qapi MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-11-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=3919; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=gii/hC7btqS6U6ZmKFMo/0UoglBZKcLAMcXlmfdep8Q=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD232X0xMZD0j3JIkrA12U+qzLfqKWrwDVLiE xmwVXVbxCOJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9twAKCRDa6OEJdZac 5SX0D/0TE/HvnOhW5iVwhncH32vWZc3tR5HghZHNNIGDaLWcI8Vg3tMxp7+R/3CTE89UzwBKB5W 2Osjq9JUNM3VJMdDsJa5MyXUHJwssaaBEeWsZgWHycHBj5Vup1rAvlRmC+a1CMWdn5hOgizDeNs Rp5AyB/hLAYKC/5a2PUqdzKmBZGE/on4Krycr+5bkVY+HRVArHQHNcFxfqZP+HJubEZULuBDqfx 9jR9TkXYCmUbnqLLvgvYQElHfTJPpbzE/PoR7VxElgmHZ16AUqv6JANsu7YpAvxR8hpdIINYzwZ neFiVlnv1uTZbhLx6ZHLOg7Q053qvZ3YWuKGHHf2mWmkHfVuVL5A/zZ83SqwWIEJcfVNYfMbD60 q5QZmx6xUw/kRRF4K/7D3ynInKZOKapt0CH2nQb497sSdRnwfwdLKQkmy040ohyq0JfHIPGnpjC 41FDE3FUI3BkKCf79UTSWgzC6rd1k0IqJ5w/h7k0IC+gZRruDmb+Hr58D3yXH3NQJmeVmBR2X3C k/H1z6Q4oAIvHnPgZ5XMnkBFkB1715itB6KFLmh93xPPNNqVrqCcQKdbjOG/owdnQrZwflS46fO 6WVY0xW+Od1DTLgrN1+58tlctkEbNE4/9n9X2vuZoyiy3cjl9Ei5jvpu04U+xUUpWwLXUJkANUi 4P+Kc8TScPtAcsQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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: 1787051695718158500 Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/qom/object.h | 36 ++++++++++++++++++++++++++++++++++++ qom/object.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/include/qom/object.h b/include/qom/object.h index 271d736956da..9684db935d23 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1990,6 +1990,42 @@ ObjectProperty *object_class_property_add_enum(Objec= tClass *klass, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)); =20 +/** + * object_property_add_qapi: + * @obj: the object to add a property to + * @name: the name of the property + * @qapi_type: QAPI type info descriptor + * @get: The getter to be called to read a property. If this is NULL, then + * the property cannot be read. + * @set: the setter to be called to write a property. If this is NULL, + * then the property cannot be written. + * @release: called when the property is removed from the object. This is + * meant to allow a property to free its opaque upon object + * destruction. This may be NULL. + * @opaque: an opaque pointer to pass to the callbacks for the property + * + * Add a property with a QAPI type association. The property type name + * is derived from @qapi_type->name. + * + * Returns: The newly added property on success, or %NULL on failure. + */ +ObjectProperty * +object_property_add_qapi(Object *obj, const char *name, + const QAPITypeInfo *qapi_type, + ObjectPropertyAccessor *get, + ObjectPropertyAccessor *set, + ObjectPropertyRelease *release, + void *opaque); + +ObjectProperty * +object_class_property_add_qapi(ObjectClass *klass, + const char *name, + const QAPITypeInfo *qapi_type, + ObjectPropertyAccessor *get, + ObjectPropertyAccessor *set, + ObjectPropertyRelease *release, + void *opaque); + /** * object_property_add_tm: * @obj: the object to add a property to diff --git a/qom/object.c b/qom/object.c index 93d44a9444ca..1bfb6b933339 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2595,6 +2595,38 @@ object_class_property_add_enum(ObjectClass *klass, c= onst char *name, prop); } =20 +ObjectProperty * +object_property_add_qapi(Object *obj, const char *name, + const QAPITypeInfo *qapi_type, + ObjectPropertyAccessor *get, + ObjectPropertyAccessor *set, + ObjectPropertyRelease *release, + void *opaque) +{ + ObjectProperty *prop; + + prop =3D object_property_add(obj, name, qapi_type->name, + get, set, release, opaque); + prop->qapi_type =3D qapi_type; + return prop; +} + +ObjectProperty * +object_class_property_add_qapi(ObjectClass *klass, const char *name, + const QAPITypeInfo *qapi_type, + ObjectPropertyAccessor *get, + ObjectPropertyAccessor *set, + ObjectPropertyRelease *release, + void *opaque) +{ + ObjectProperty *prop; + + prop =3D object_class_property_add(klass, name, qapi_type->name, + get, set, release, opaque); + prop->qapi_type =3D qapi_type; + return prop; +} + typedef struct TMProperty { void (*get)(Object *, struct tm *, Error **); } TMProperty; --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051830; cv=none; d=zohomail.com; s=zohoarc; b=h/YddnKUt/wRokXi22Pcb6vjlBGKvS1akr3ICoOy8j8yp7zzZhsAwVVeaHhYTIudDexfSJqSD2QgHYi8XTo76MxoBAhDX4G55ZS9gHp+tOMJgc7WBbW3ILXEoZbnpEQ884o5EyR4sBTVvoyqXUGdsLviyy6YMkRAwZz05ZR5AcA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051830; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=geAxzwWzCqnvRTHj+zaFdvrGdVNHEUNtRmAOO42h0qQ=; b=Xr8iB/154dR3t2NmsurefsaDpk3N0mBIZJGCr20YEP8EZo1exTXd39ZX+YFexF9P0yqO6MmEWNF/E9zuYYtk0Am37tBu/as/pBCI9H0JvkG5qO9S38pucS/z/QcQBoDX0UBFV7zhr7WumEGnLk+SkwBSm5sxgg2b6HPUkIUKZao= 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 1787051830468172.0866573292809; Tue, 18 Aug 2026 04:17:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHoF-0007QS-Sx; Tue, 18 Aug 2026 07:16:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHoF-0007Q3-03 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:16:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHoD-0005TG-A0 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:16:46 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-537-3r-5S9fNM0OTSZw55Hz85Q-1; Tue, 18 Aug 2026 07:16:41 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1F3071954B07; Tue, 18 Aug 2026 11:16:40 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A591630002E9; Tue, 18 Aug 2026 11:16:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051804; 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=geAxzwWzCqnvRTHj+zaFdvrGdVNHEUNtRmAOO42h0qQ=; b=hvHpzkLMx0dZt9a6dQ/02SY5xOohyxxdCZ/DqBn4DYszL9ZtNRSrpAiXunKKAvnLPrSGm3 dykoEYaTPJf01EQKsUOsQ2r7DD+2zIQtsPRHOCaidKHSLxs9eLYkZh1a+ofY8RiFJ1WA2t f4k1Jt/Ns1Oe5SsE83cfeq8NMLfiDVI= X-MC-Unique: 3r-5S9fNM0OTSZw55Hz85Q-1 X-Mimecast-MFC-AGG-ID: 3r-5S9fNM0OTSZw55Hz85Q_1787051800 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:39 +0400 Subject: [PATCH v3 12/74] qom: add object_{class_}property_add_qapi_enum MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-12-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=7253; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=wcgqrsFY697MpF1aOWpauni1B+DwPa5waKS53/E14F0=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD23jE9eua/C0OUUDPPKpmlAzud/FvIv0Mqqp 7X6d04/UfeJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9twAKCRDa6OEJdZac 5d2KEACrNihkF+FeD9O8S93BmE9SVKYjpD595VmhQ2J4VW2jmPU/G+gBcmabmus0CXj+ycyW2MV 7inInz+/n9tTvwg1U6LBulmt5rByUy0P75qlH+B8LC83k3NanY1dl4brOd7t27m4Bc/XIBGDq1q yV67tS5OLykH7BWc3cCX2dlaw6AK3QN6wbqjr1W9QNHjECuTua90eA7f6k7I6BJ53fCWRlmZTb+ 7B74OwSvv/iInapvpWxyT31mXy9LNxyp4EKsOM/7ZSvYDNldafvKBuVnwajC2xKM5U0HP5y7Z6f AnkQ7IozMeyN2ZSDh4AARuy19669zSO5P2N6Crdr6173O3EAO5c0mbATgcmCecJuVp6hIJxdZzf XWdtYShmSm7Dz770pPC0LMWb2PSP4wXiV/PJSE/iYA6etJu8vOmaJJmXERF8sveOzvmKbLyxR6b +Z4jOZ5cTeVW/jI2wECaErg3EMKgza1hb6asR4N1FHpmM80+DIl/mQ5D6af81MYkE4/UjdUheMN Y+nXp0lJETVwC/wnhAvowY7f3ngGFcOLpUkVG2KxD2BMgVSeWbX1GlvpHW4zcNgQ5JT4bKUiUM5 ljVLsxL0DB3REiiwJ0L6G1maOU/gnUm0Aghy+sCNO44SmYGdRWSWLtJ8upcMULyrKoMiDEivaf4 +gIROxSy1qtbvpA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787051833074158500 Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/qom/object.h | 64 +++++++++++++++++++++++++++++++++++++ qom/object.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++= +--- 2 files changed, 148 insertions(+), 5 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 9684db935d23..a03f4bf8f7cf 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1990,6 +1990,70 @@ ObjectProperty *object_class_property_add_enum(Objec= tClass *klass, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)); =20 +/** + * struct QapiEnumProp - Descriptor for a QOM property backed by a QAPI en= um type + * + * Binds a QOM object property to a QAPI enum, providing automatic + * string<->int conversion through QAPI visitors and optional + * default-value initialization during object instance init. + * + * Use the QAPI_ENUM_PROP() macro to construct instances inline. + * + * @name: property name exposed on the QOM object + * @description: human-readable description (shown in ``-device help``, et= c.) + * @default_value: initial enum value applied via @set during instance ini= t, + * or -1 (the QAPI_ENUM_PROP default) to skip initializati= on + * @qapi_type: pointer to the generated QAPITypeInfo for the enum + * (provides the string<->int lookup table) + * @get: getter that returns the current enum value as int, or -1 on error + * @set: setter that receives the enum value as int; %NULL for read-only p= rops + */ +typedef struct QapiEnumProp { + const char *name; + const char *description; + const int default_value; + const QAPITypeInfo *qapi_type; + int (*get)(Object *, Error **); + void (*set)(Object *, int, Error **); +} QapiEnumProp; + +#define QAPI_ENUM_PROP(...) ({ \ + static const QapiEnumProp _prop =3D { = \ + .default_value =3D -1, __VA_ARGS__ = \ + }; \ + &_prop; }) + +/** + * object_property_add_qapi_enum: + * @obj: the object to add a property to + * @prop: property descriptor + * + * Add an enum property with QAPI type association. + * + * Use the QAPI_ENUM_PROP() macro to construct the property descriptor + * inline. If .default_value is not set, the property is not initialized + * (default_value is -1). Otherwise, the setter is called with + * default_value during object instance init. + * + * Example:: + * + * object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + * .name =3D "policy", + * .description =3D "Set the NUMA policy", + * .default_value =3D HOST_MEM_POLICY_DEFAULT, + * .qapi_type =3D &HostMemPolicy_type_info, + * .get =3D my_get_policy, + * .set =3D my_set_policy, + * )); + * + * Returns: The newly added property on success, or %NULL on failure. + */ +ObjectProperty * +object_property_add_qapi_enum(Object *obj, const QapiEnumProp *prop); + +ObjectProperty * +object_class_property_add_qapi_enum(ObjectClass *klass, const QapiEnumProp= *prop); + /** * object_property_add_qapi: * @obj: the object to add a property to diff --git a/qom/object.c b/qom/object.c index 1bfb6b933339..f5568b9f9790 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1206,7 +1206,7 @@ static void object_class_foreach_tramp(gpointer key, = gpointer value, return; } =20 - if (data->implements_type &&=20 + if (data->implements_type && !object_class_dynamic_cast(k, data->implements_type)) { return; } @@ -1772,7 +1772,6 @@ int object_property_get_enum(Object *obj, const char = *name, char *str; int ret; ObjectProperty *prop =3D object_property_find_err(obj, name, errp); - EnumProperty *enumprop; =20 if (prop =3D=3D NULL) { return -1; @@ -1785,14 +1784,17 @@ int object_property_get_enum(Object *obj, const cha= r *name, return -1; } =20 - enumprop =3D prop->opaque; - str =3D object_property_get_str(obj, name, errp); if (!str) { return -1; } =20 - ret =3D qapi_enum_parse(enumprop->lookup, str, -1, errp); + if (prop->qapi_type) { + ret =3D qapi_enum_parse(prop->qapi_type->lookup, str, -1, errp); + } else { + EnumProperty *enumprop =3D prop->opaque; + ret =3D qapi_enum_parse(enumprop->lookup, str, -1, errp); + } g_free(str); =20 return ret; @@ -2595,6 +2597,83 @@ object_class_property_add_enum(ObjectClass *klass, c= onst char *name, prop); } =20 +static void get_qapi_enum(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + const QapiEnumProp *prop =3D opaque; + int value; + Error *err =3D NULL; + + value =3D prop->get(obj, &err); + if (err) { + error_propagate(errp, err); + return; + } + + visit_type_enum(v, name, &value, prop->qapi_type->lookup, errp); +} + +static void set_qapi_enum(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + const QapiEnumProp *prop =3D opaque; + int value; + + if (!visit_type_enum(v, name, &value, prop->qapi_type->lookup, errp)) { + return; + } + prop->set(obj, value, errp); +} + +static void init_qapi_enum(Object *obj, ObjectProperty *prop) +{ + const QapiEnumProp *e =3D prop->opaque; + + if (e->set && e->default_value >=3D 0) { + e->set(obj, e->default_value, &error_abort); + } +} + +ObjectProperty * +object_property_add_qapi_enum(Object *obj, const QapiEnumProp *e) +{ + ObjectProperty *prop; + + assert(e && e->qapi_type && e->qapi_type->lookup); + + prop =3D object_property_add_qapi(obj, e->name, e->qapi_type, + e->get ? get_qapi_enum : NULL, + e->set ? set_qapi_enum : NULL, + NULL, + (void *)e); + prop->description =3D g_strdup(e->description); + if (e->default_value >=3D 0) { + prop->init =3D init_qapi_enum; + } + + return prop; +} + +ObjectProperty * +object_class_property_add_qapi_enum(ObjectClass *klass, const QapiEnumProp= *e) +{ + ObjectProperty *prop; + + assert(e && e->qapi_type && e->qapi_type->lookup); + + prop =3D object_class_property_add_qapi(klass, e->name, e->qapi_type, + e->get ? get_qapi_enum : NULL, + e->set ? set_qapi_enum : NULL, + NULL, + (void *)e); + prop->description =3D g_strdup(e->description); + if (e->default_value >=3D 0) { + prop->init =3D init_qapi_enum; + } + + return prop; +} + ObjectProperty * object_property_add_qapi(Object *obj, const char *name, const QAPITypeInfo *qapi_type, --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051847; cv=none; d=zohomail.com; s=zohoarc; b=ikU7YlOimpsl+qNApoMf7SUaNHs3JgioUKS3fqzHSskMUwMh2qJuUPg68yDBamuk6mDr/+b46lEFxgAMyZA8wnS95Ds+3TCHOO8WUZvdoN4qBOLMP+umPPrN9474jf7wbv4kI3MuJdD/i3eM2qtleBvjSi6MJ1sd6foHJVaS3wA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051847; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zNYgOyjpFTHomWvYcWcSOyR0E+fcnEjS4LB5n8XH++I=; b=AAL0lMWy2fhgVASuhmWN03L6JCdE7B7SP+ea0pm7cGtJjne0WfShNYYKnSXnSE4OuiZmjm7/qrt1+mtLKdNv1eTBFYo4kPIlRkrtwNYerpWl2Tzaj/uNONFFygRTqmo6g9ZTKo81bbdBAfFrKJtvh8lDe8JyFcG21VGTouv625c= 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 1787051847632722.1085187470221; Tue, 18 Aug 2026 04:17:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHoK-0007Ri-S8; Tue, 18 Aug 2026 07:16:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHoI-0007Qx-KD for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:16:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHoH-0005TX-0r for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:16:50 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-279-plEIMmryOcm8zjg2XbHelQ-1; Tue, 18 Aug 2026 07:16:46 -0400 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 2DB121956041; Tue, 18 Aug 2026 11:16:45 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D98E530002EA; Tue, 18 Aug 2026 11:16:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051808; 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=zNYgOyjpFTHomWvYcWcSOyR0E+fcnEjS4LB5n8XH++I=; b=I0BHUTQHyzQ7nhfZSnDKGrU4B12tuDwNr+trBRqpJtiKcfL4LHPCO5Kn4YWLnYDuLhPb0z swJo2uCb3M47MlaK1s5l1mCodfNJR+v8EMEo6mKXk5JJ5IIxDev3B2NZy6S3zmvp23S8/9 P9xs42c7eiR2269p46f0b9O0senLexc= X-MC-Unique: plEIMmryOcm8zjg2XbHelQ-1 X-Mimecast-MFC-AGG-ID: plEIMmryOcm8zjg2XbHelQ_1787051805 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:40 +0400 Subject: [PATCH v3 13/74] tests: update check-qom-proplist for QAPI-aware property registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-13-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=5370; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=q2n1PS8TB3xj4XT1NZQ4agWLWhftpKvEUnO0GIyvQS8=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD23iHQ55OOHCltD6utioO3bVy6BLBD1QeO+/ Zciswu3IteJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9twAKCRDa6OEJdZac 5S4sD/9Xwow+RYxX4gfgFROZ8QHaAKpVy/XtsvFpQ5riR4bfXREX9gW5FJRegaCXUKUMkAhOzwt sO+RmqCIMhTAUNdKJAY8az/2pixz7YGEKcRupAnbi1gUWpxZ/oq5Q4URh6XrCoj1qYl3FT2bfdA 97n3KjriQ4MC1p4RzdqaW2Ad+brutttci5w+bvbqumY5rCoXVlqI4xj0E8BLuQbXaoGY/9iQchB qyg8HGXYzDwJNSP5Imawf6B70bNK1H/s8VMM6SrtAeTMMs8n4/PnIEBByPhotmWHNowFEIxwocr b9JP1uCFxhRHQ8reVAcJjTR6yp9VIJWaguSU6zR2ntDqSmmYUqhUQIZUH4Xxjl4L9I3wn7LYHkL 8cgxcmhnkpshQR5y0IGJzGKkmLnyu9O9ebc5BCHjvCDhzqAmnLbYv9yowtBzUSsPQwa+43f+L/D NBl4s3zqQj6uUGuG667p4KQ3fgHkJjfq6f4CjE8/QzmMGHjkGeWc68zLKWtYMlLsgQt10BrfWEW 8kJ9spa/FY2mHtf4sj5aDNlH2J8GF+1mDPANj23aQ8z0IebLLoTQwuDRIt6S1eHz/HtqN6mMR+N /oU5oNJ6/7BbVv3AhelfMs7VwrNWiONF4cNJC6XShTruBiIryOswrOPzKMbPPPkT1sL1dyo/QWA ykovDcc+nI+M7SQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787051848780158500 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 --- tests/unit/check-qom-proplist.c | 93 ++++++++++++++++++++++++++++++++++---= ---- 1 file changed, 77 insertions(+), 16 deletions(-) diff --git a/tests/unit/check-qom-proplist.c b/tests/unit/check-qom-proplis= t.c index 89de92b7d91f..69155e720751 100644 --- a/tests/unit/check-qom-proplist.c +++ b/tests/unit/check-qom-proplist.c @@ -108,22 +108,21 @@ static int dummy_get_av(Object *obj, } =20 =20 -static void dummy_set_sv(Object *obj, - const char *value, - Error **errp) +static void dummy_set_sv(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DummyObject *dobj =3D DUMMY_OBJECT(obj); =20 - g_free(dobj->sv); - dobj->sv =3D g_strdup(value); + g_clear_pointer(&dobj->sv, g_free); + visit_type_str(v, name, &dobj->sv, errp); } =20 -static char *dummy_get_sv(Object *obj, - Error **errp) +static void dummy_get_sv(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DummyObject *dobj =3D DUMMY_OBJECT(obj); =20 - return g_strdup(dobj->sv); + visit_type_str(v, name, &dobj->sv, errp); } =20 =20 @@ -135,16 +134,28 @@ static void dummy_init(Object *obj) } =20 =20 +static const QAPITypeInfo dummy_animal_qapi_type_info =3D { + .name =3D "DummyAnimal", + .masked_name =3D "DummyAnimalSchema", + .lookup =3D &dummy_animal_map, +}; + +static const QAPITypeInfo dummy_str_qapi_type_info =3D { + .name =3D "str", + .masked_name =3D "StrSchema", +}; + static void dummy_class_init(ObjectClass *cls, const void *data) { - object_class_property_add_str(cls, "sv", - dummy_get_sv, - dummy_set_sv); - object_class_property_add_enum(cls, "av", - "DummyAnimal", - &dummy_animal_map, - dummy_get_av, - dummy_set_av); + object_class_property_add_qapi(cls, "sv", &dummy_str_qapi_type_info, + dummy_get_sv, dummy_set_sv, + NULL, NULL); + object_class_property_add_qapi_enum(cls, QAPI_ENUM_PROP( + .name =3D "av", + .qapi_type =3D &dummy_animal_qapi_type_info, + .get =3D dummy_get_av, + .set =3D dummy_set_av, + )); } =20 =20 @@ -703,6 +714,54 @@ static void test_qom_partial_path(void) object_unparent(cont1); } =20 +static void test_dummy_qapi_enum(void) +{ + ObjectProperty *prop; + Object *parent =3D object_get_objects_root(); + DummyObject *dobj =3D DUMMY_OBJECT( + object_new_with_props(TYPE_DUMMY, + parent, + "dummy0", + &error_abort, + "av", "platypus", + NULL)); + + g_assert(dobj->av =3D=3D DUMMY_PLATYPUS); + + prop =3D object_property_find(OBJECT(dobj), "av"); + g_assert(prop); + g_assert(prop->qapi_type =3D=3D &dummy_animal_qapi_type_info); + g_assert_cmpstr(prop->qapi_type->name, =3D=3D, "DummyAnimal"); + g_assert_cmpstr(prop->qapi_type->masked_name, =3D=3D, "DummyAnimalSche= ma"); + g_assert(prop->qapi_type->lookup =3D=3D &dummy_animal_map); + + object_unparent(OBJECT(dobj)); +} + +static void test_dummy_qapi_prop(void) +{ + ObjectProperty *prop; + Object *parent =3D object_get_objects_root(); + DummyObject *dobj =3D DUMMY_OBJECT( + object_new_with_props(TYPE_DUMMY, + parent, + "dummy0", + &error_abort, + "sv", "hello", + NULL)); + + g_assert_cmpstr(dobj->sv, =3D=3D, "hello"); + + prop =3D object_property_find(OBJECT(dobj), "sv"); + g_assert(prop); + g_assert(prop->qapi_type =3D=3D &dummy_str_qapi_type_info); + g_assert_cmpstr(prop->qapi_type->name, =3D=3D, "str"); + g_assert_cmpstr(prop->qapi_type->masked_name, =3D=3D, "StrSchema"); + g_assert(prop->qapi_type->lookup =3D=3D NULL); + + object_unparent(OBJECT(dobj)); +} + int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); @@ -727,6 +786,8 @@ int main(int argc, char **argv) g_test_add_func("/qom/proplist/iterator", test_dummy_iterator); g_test_add_func("/qom/proplist/class_iterator", test_dummy_class_itera= tor); g_test_add_func("/qom/proplist/delchild", test_dummy_delchild); + g_test_add_func("/qom/proplist/qapi_enum", test_dummy_qapi_enum); + g_test_add_func("/qom/proplist/qapi_prop", test_dummy_qapi_prop); g_test_add_func("/qom/resolve/partial", test_qom_partial_path); =20 return g_test_run(); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051863; cv=none; d=zohomail.com; s=zohoarc; b=jSNu2+aYpwSpydrUGRUu9GMkJmvmjldcdV1qxNYp9xt8gR5o6OxDlkloSIh1lmb6bQkAyd2iBy1B1BPQymWHYRcd7bespP3UxADMVbQUs7zJs76NRNRUkSFT2rnaupd5WZs2hKS52Q6Tbsv6Vv8okbYE1aP3OHLcfKVSGzZ2ACg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051863; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4cZ9k2zlRVPI/Q6eV5gYzrkbNceMJYmuC0St6Zr3WMc=; b=nuzXVRlqTmVkM9SqtRxy1cXABjdGIdCLVAmOdVRhDm/OB0NC8SMN5eMWKyrf8zJzLELGgLl0/FRSGmcUae16YlncvRn88sqOWPc+tVmt3JnvUjg06Q9oXKsGaKQfnYoCdgsoa5ZUEBLCBkrAFf8Wb82SEMaBWfx+LoYhEYbcMzM= 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 1787051862884214.73283727539297; Tue, 18 Aug 2026 04:17:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHoY-0007o2-4e; Tue, 18 Aug 2026 07:17:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHoX-0007nZ-5i for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:17:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHoU-0005Zy-M3 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:17:04 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-381-DRLVw6ODOo6ihC76v5Hkaw-1; Tue, 18 Aug 2026 07:16:58 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E8A68180028A; Tue, 18 Aug 2026 11:16:56 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1EB4C180049F; Tue, 18 Aug 2026 11:16:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051822; 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=4cZ9k2zlRVPI/Q6eV5gYzrkbNceMJYmuC0St6Zr3WMc=; b=TX+ChfaCW7TO/wRO9vy9OAMCvJHLuzIK/PxtRHCBuHKdw8nbMjx3q7T7FTZMLWTfDYmdW6 Cl+gwn4yGbT8MHpw6FMpIhYUjTgGx9rrHq/pn86PBWGguM1+0VrzTexab7Ixrnf+Erttbr LhDEA0zfEYK1ZQKOORzmdfNIxOAMD98= X-MC-Unique: DRLVw6ODOo6ihC76v5Hkaw-1 X-Mimecast-MFC-AGG-ID: DRLVw6ODOo6ihC76v5Hkaw_1787051817 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:41 +0400 Subject: [PATCH v3 14/74] qom: convert enum properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-14-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Hildenbrand , Igor Mammedov , Richard Henderson , "Michael S. Tsirkin" , "Edgar E. Iglesias" , Jason Wang , Marcelo Tosatti , kvm@vger.kernel.org X-Developer-Signature: v=1; a=openpgp-sha256; l=19408; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=h2pcHj9oFV8Njk3sExkn4qFLcuQDW0GdsVpOdDGzDpI=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD2353BQDuJlpjVNxRM8XiMll48+R69kWBq3R rrsqYwxs9WJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9twAKCRDa6OEJdZac 5f5tD/4o3q6pQY+uFzmNiVxdfmfV1WfyhsB+p8Re34rmBzeBA+1nCtN4tFYeEtp/0AD+CKuUgQS j/AgDSGfolRdh9IpymAnmvuKxgfBVeRxNNXY1v3km6kzUI8bF0+xVO/xwdb9Q7xR6VTR5xzuFZZ wwYNRRgq+jVa1+GNvnB57/stJvHVfYmBJ5vUhUZ64cvPA5uXNWALdkUxz07KYQ5jVu+CFsSscFs /wOPilThG375Sb3/gkoH5tgJr96+k6B+sD1XvNclpTSCRboyX7ukeqO3D56+b9KxGi6Z4+HwFyZ d3lH4chmIBZ44Y1klSAaabZKwFSWOdnuApowRKO5lqaMEFxGROVwdqyuHmV98YZsP38NtL31HhW J4b1rT/1km/iDMIcEp4G0VDL5eI3KEImQ6cU7YV1/ZAIZJRgS6k2FrpjHHuVBxBIw60DWfS4pPg tVQMfl+ZETPwyvWJmJhP+LCr4I7TdCCiyCgXS0+DY83lasu8is19jVogGVEgfrJrCu0E3COvnFM 2wKrR/ut2LKjiBDLozUjXQoDIwOIPSA9RZQnH7RycxquB7zGIJzp0fIlZ+OnwrMAIK6PHmXB898 5lhdfIe+GceQnuQrqchPnJ1yyyhE3mP7Mxlw77gDAIzoFANLTlNWGzgT7iwnyTiiEf//0sM507U OIfN4Y0gzPdOQXA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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: 1787051864889158500 Convert all callers of object_class_property_add_enum() to use the new object_class_property_add_qapi_enum() with the QAPI_ENUM_PROP() macro, which provides type information via QAPITypeInfo instead of raw lookup tables and string type names. This enables QMP introspection to report accurate QAPI type names for enum properties. Where a separate set_description call was used, the description is now embedded in the QAPI_ENUM_PROP initializer. Signed-off-by: Marc-Andr=C3=A9 Lureau --- authz/list.c | 12 +++++++----- backends/hostmem.c | 14 ++++++++------ crypto/secret_common.c | 12 +++++++----- crypto/tlscreds.c | 12 +++++++----- hw/i386/pc_piix.c | 18 ++++++++++++------ hw/microblaze/petalogix_s3adsp1800_mmu.c | 19 +++++++++++-------- include/chardev/char.h | 8 -------- monitor/qmp.c | 12 +++++++----- net/filter.c | 10 +++++++--- target/i386/kvm/kvm.c | 30 +++++++++++++++++-----------= -- ui/console-vc.c | 8 +++++++- ui/dbus.c | 18 ++++++++++++++---- ui/input-linux.c | 11 +++++++---- 13 files changed, 111 insertions(+), 73 deletions(-) diff --git a/authz/list.c b/authz/list.c index 17aa0efd80e8..363b2ee12c98 100644 --- a/authz/list.c +++ b/authz/list.c @@ -22,6 +22,7 @@ #include "authz/list.h" #include "trace.h" #include "qom/object_interfaces.h" +#include "qapi/qapi-type-infos-authz.h" #include "qapi/qapi-visit-authz.h" #include "qemu/module.h" =20 @@ -120,11 +121,12 @@ qauthz_list_class_init(ObjectClass *oc, const void *d= ata) { QAuthZClass *authz =3D QAUTHZ_CLASS(oc); =20 - object_class_property_add_enum(oc, "policy", - "QAuthZListPolicy", - &QAuthZListPolicy_lookup, - qauthz_list_prop_get_policy, - qauthz_list_prop_set_policy); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "policy", + .qapi_type =3D &QAuthZListPolicy_type_info, + .get =3D qauthz_list_prop_get_policy, + .set =3D qauthz_list_prop_set_policy, + )); =20 object_class_property_add(oc, "rules", "QAuthZListRule", qauthz_list_prop_get_rules, diff --git a/backends/hostmem.c b/backends/hostmem.c index 5dd5fb155c47..ce82958050e2 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -16,6 +16,7 @@ #include "hw/core/boards.h" #include "qapi/error.h" #include "qapi/qapi-builtin-visit.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/visitor.h" #include "qemu/config-file.h" #include "qom/compat-properties.h" @@ -551,12 +552,13 @@ host_memory_backend_class_init(ObjectClass *oc, const= void *data) NULL, NULL); object_class_property_set_description(oc, "host-nodes", "Binds memory to the list of NUMA host nodes"); - object_class_property_add_enum(oc, "policy", "HostMemPolicy", - &HostMemPolicy_lookup, - host_memory_backend_get_policy, - host_memory_backend_set_policy); - object_class_property_set_description(oc, "policy", - "Set the NUMA policy"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "policy", + .description =3D "Set the NUMA policy", + .qapi_type =3D &HostMemPolicy_type_info, + .get =3D host_memory_backend_get_policy, + .set =3D host_memory_backend_set_policy, + )); object_class_property_add_bool(oc, "share", host_memory_backend_get_share, host_memory_backend_set_share); object_class_property_set_description(oc, "share", diff --git a/crypto/secret_common.c b/crypto/secret_common.c index a5ecb876aeba..381d23ecc8e0 100644 --- a/crypto/secret_common.c +++ b/crypto/secret_common.c @@ -22,6 +22,7 @@ #include "crypto/secret_common.h" #include "crypto/cipher.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-crypto.h" #include "qom/object_interfaces.h" #include "qemu/base64.h" #include "qemu/module.h" @@ -269,11 +270,12 @@ qcrypto_secret_class_init(ObjectClass *oc, const void= *data) =20 ucc->complete =3D qcrypto_secret_complete; =20 - object_class_property_add_enum(oc, "format", - "QCryptoSecretFormat", - &QCryptoSecretFormat_lookup, - qcrypto_secret_prop_get_format, - qcrypto_secret_prop_set_format); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "format", + .qapi_type =3D &QCryptoSecretFormat_type_info, + .get =3D qcrypto_secret_prop_get_format, + .set =3D qcrypto_secret_prop_set_format, + )); object_class_property_add_str(oc, "keyid", qcrypto_secret_prop_get_keyid, qcrypto_secret_prop_set_keyid); diff --git a/crypto/tlscreds.c b/crypto/tlscreds.c index fb09e295a65c..54859720bf74 100644 --- a/crypto/tlscreds.c +++ b/crypto/tlscreds.c @@ -20,6 +20,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-crypto.h" #include "qapi-types-crypto.h" #include "qemu/module.h" #include "qemu/error-report.h" @@ -221,11 +222,12 @@ qcrypto_tls_creds_class_init(ObjectClass *oc, const v= oid *data) object_class_property_add_str(oc, "dir", qcrypto_tls_creds_prop_get_dir, qcrypto_tls_creds_prop_set_dir); - object_class_property_add_enum(oc, "endpoint", - "QCryptoTLSCredsEndpoint", - &QCryptoTLSCredsEndpoint_lookup, - qcrypto_tls_creds_prop_get_endpoint, - qcrypto_tls_creds_prop_set_endpoint); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "endpoint", + .qapi_type =3D &QCryptoTLSCredsEndpoint_type_info, + .get =3D qcrypto_tls_creds_prop_get_endpoint, + .set =3D qcrypto_tls_creds_prop_set_endpoint, + )); object_class_property_add_str(oc, "priority", qcrypto_tls_creds_prop_get_priority, qcrypto_tls_creds_prop_set_priority); diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index a929cc4decd6..dac2bee88a2e 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -336,6 +336,11 @@ static const QEnumLookup PCSouthBridgeOption_lookup = =3D { .size =3D PC_SOUTH_BRIDGE_OPTION_MAX }; =20 +static const QAPITypeInfo PCSouthBridgeOption_type_info =3D { + .name =3D "PCSouthBridgeOption", + .lookup =3D &PCSouthBridgeOption_lookup, +}; + static int pc_get_south_bridge(Object *obj, Error **errp) { PCMachineState *pcms =3D PC_MACHINE(obj); @@ -418,12 +423,13 @@ static void pc_i440fx_machine_options(MachineClass *m) machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE); machine_class_allow_dynamic_sysbus_dev(m, TYPE_UEFI_VARS_X64); =20 - object_class_property_add_enum(oc, "x-south-bridge", "PCSouthBridgeOpt= ion", - &PCSouthBridgeOption_lookup, - pc_get_south_bridge, - pc_set_south_bridge); - object_class_property_set_description(oc, "x-south-bridge", - "Use a different south bridge than PI= IX3"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "x-south-bridge", + .description =3D "Use a different south bridge than PIIX3", + .qapi_type =3D &PCSouthBridgeOption_type_info, + .get =3D pc_get_south_bridge, + .set =3D pc_set_south_bridge, + )); compat_props_add(m->compat_props, pc_piix_compat_defaults, pc_piix_compat_defaults_len); } diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petal= ogix_s3adsp1800_mmu.c index c5f64319009b..9a8fcc667812 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -27,6 +27,7 @@ #include "qemu/target-info.h" #include "qemu/units.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "target/microblaze/cpu.h" #include "hw/core/sysbus.h" #include "net/net.h" @@ -174,14 +175,16 @@ static void petalogix_s3adsp1800_machine_class_init(O= bjectClass *oc, mc->init =3D petalogix_s3adsp1800_init; mc->is_default =3D true; =20 - prop =3D object_class_property_add_enum(oc, "endianness", "EndianMode", - &EndianMode_lookup, - machine_get_endianness, - machine_set_endianness); - object_property_set_default_str(prop, target_big_endian() ? "big" - : "little"); - object_class_property_set_description(oc, "endianness", - "Defines whether the machine runs in big or little endian mode= "); + prop =3D object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "endianness", + .description =3D + "Defines whether the machine runs in big or little endian mode= ", + .qapi_type =3D &EndianMode_type_info, + .get =3D machine_get_endianness, + .set =3D machine_set_endianness, + )); + object_property_set_default_enum(prop, + target_big_endian() ? ENDIAN_MODE_BIG : ENDIAN_MODE_LITTLE); } =20 static const TypeInfo petalogix_s3adsp1800_machine_types[] =3D { diff --git a/include/chardev/char.h b/include/chardev/char.h index 7377d8e60a08..f5e53b3867a3 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -343,12 +343,4 @@ static void set_encoding(Object *obj, int value, Error= **errp) \ cast_func(obj)->encoding =3D value; \ } =20 -static inline void chardev_vc_add_encoding_prop(ObjectClass *oc, - int (*get)(Object *, Error **), - void (*set)(Object *, int, Error **)) -{ - object_class_property_add_enum(oc, "encoding", "ChardevVCEncoding", - &ChardevVCEncoding_lookup, get, set); -} - #endif diff --git a/monitor/qmp.c b/monitor/qmp.c index aec03157750c..728a58bfd5e9 100644 --- a/monitor/qmp.c +++ b/monitor/qmp.c @@ -30,6 +30,7 @@ #include "qapi/error.h" #include "qapi/qapi-commands-control.h" #include "qapi/qapi-commands-char.h" +#include "qapi/qapi-type-infos-qom.h" #include "qobject/qdict.h" #include "qobject/qjson.h" #include "qobject/qlist.h" @@ -133,11 +134,12 @@ static void monitor_qmp_class_init(ObjectClass *cls, = const void *data) object_class_property_add_bool(cls, "pretty", monitor_qmp_get_pretty, monitor_qmp_set_pretty); - object_class_property_add_enum(cls, "close-action", - "MonitorQMPCloseAction", - &MonitorQMPCloseAction_lookup, - monitor_qmp_get_close_action, - monitor_qmp_set_close_action); + object_class_property_add_qapi_enum(cls, QAPI_ENUM_PROP( + .name =3D "close-action", + .qapi_type =3D &MonitorQMPCloseAction_type_info, + .get =3D monitor_qmp_get_close_action, + .set =3D monitor_qmp_set_close_action, + )); =20 moncls->emit_event =3D monitor_qmp_emit_event; moncls->requires_iothread =3D monitor_qmp_requires_iothread; diff --git a/net/filter.c b/net/filter.c index 389f3b0bfefb..79883af22a54 100644 --- a/net/filter.c +++ b/net/filter.c @@ -8,6 +8,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qmp/qerror.h" #include "qemu/error-report.h" =20 @@ -342,9 +343,12 @@ static void netfilter_class_init(ObjectClass *oc, cons= t void *data) =20 object_class_property_add_str(oc, "netdev", netfilter_get_netdev_id, netfilter_set_n= etdev_id); - object_class_property_add_enum(oc, "queue", "NetFilterDirection", - &NetFilterDirection_lookup, - netfilter_get_direction, netfilter_set_= direction); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "queue", + .qapi_type =3D &NetFilterDirection_type_info, + .get =3D netfilter_get_direction, + .set =3D netfilter_set_direction, + )); object_class_property_add_str(oc, "status", netfilter_get_status, netfilter_set_stat= us); object_class_property_add_str(oc, "position", diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 644c45fb0a02..601b78df5363 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -14,6 +14,8 @@ =20 #include "qemu/osdep.h" #include "qapi/qapi-events-run-state.h" +#include "qapi/qapi-type-infos-common.h" +#include "qapi/qapi-type-infos-run-state.h" #include "qapi/error.h" #include "qapi/visitor.h" #include @@ -7089,12 +7091,13 @@ static void kvm_arch_set_honor_guest_pat(Object *ob= j, int value, Error **errp) =20 void kvm_arch_accel_class_init(ObjectClass *oc) { - object_class_property_add_enum(oc, "notify-vmexit", "NotifyVMexitOptio= n", - &NotifyVmexitOption_lookup, - kvm_arch_get_notify_vmexit, - kvm_arch_set_notify_vmexit); - object_class_property_set_description(oc, "notify-vmexit", - "Enable notify VM exit"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "notify-vmexit", + .description =3D "Enable notify VM exit", + .qapi_type =3D &NotifyVmexitOption_type_info, + .get =3D kvm_arch_get_notify_vmexit, + .set =3D kvm_arch_set_notify_vmexit, + )); =20 object_class_property_add(oc, "notify-window", "uint32", kvm_arch_get_notify_window, @@ -7127,13 +7130,14 @@ void kvm_arch_accel_class_init(ObjectClass *oc) object_class_property_set_description(oc, "xen-evtchn-max-pirq", "Maximum number of Xen PIRQs"); =20 - object_class_property_add_enum(oc, "honor-guest-pat", "OnOffAuto", - &OnOffAuto_lookup, - kvm_arch_get_honor_guest_pat, - kvm_arch_set_honor_guest_pat); - object_class_property_set_description(oc, "honor-guest-pat", - "Disable KVM quirk that ignores = guest PAT " - "memory type settings (default: = auto)"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "honor-guest-pat", + .description =3D "Disable KVM quirk that ignores guest PAT " + "memory type settings (default: auto)", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D kvm_arch_get_honor_guest_pat, + .set =3D kvm_arch_set_honor_guest_pat, + )); } =20 void kvm_set_max_apic_id(uint32_t max_apic_id) diff --git a/ui/console-vc.c b/ui/console-vc.c index 53d9e9d39b36..1e46eceeded2 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" @@ -318,7 +319,12 @@ static void char_vc_class_init(ObjectClass *oc, const = void *data) cc->supports_size_opts =3D true; cc->supports_encoding_opts =3D true; =20 - chardev_vc_add_encoding_prop(oc, get_encoding, set_encoding); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "encoding", + .qapi_type =3D &ChardevVCEncoding_type_info, + .get =3D get_encoding, + .set =3D set_encoding, + )); } =20 static void char_vc_init(Object *obj) diff --git a/ui/dbus.c b/ui/dbus.c index 7be0f8e26119..afc321514c68 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -38,6 +38,8 @@ #include "qemu/audio.h" #include "audio/audio_int.h" /* FIXME: use QOM dynamic cast instead of drv= ->name */ #include "qapi/error.h" +#include "qapi/qapi-type-infos-char.h" +#include "qapi/qapi-type-infos-ui.h" #include "trace.h" =20 #include "dbus.h" @@ -508,9 +510,12 @@ dbus_display_class_init(ObjectClass *oc, const void *d= ata) object_class_property_add_bool(oc, "p2p", get_dbus_p2p, set_dbus_p2p); object_class_property_add_str(oc, "addr", get_dbus_addr, set_dbus_addr= ); object_class_property_add_str(oc, "audiodev", get_audiodev, set_audiod= ev); - object_class_property_add_enum(oc, "gl-mode", - "DisplayGLMode", &DisplayGLMode_lookup, - get_gl_mode, set_gl_mode); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "gl-mode", + .qapi_type =3D &DisplayGLMode_type_info, + .get =3D get_gl_mode, + .set =3D set_gl_mode, + )); } =20 #define TYPE_CHARDEV_VC "chardev-vc" @@ -602,7 +607,12 @@ dbus_vc_class_init(ObjectClass *oc, const void *data) cc->chr_open =3D dbus_vc_open; cc->supports_encoding_opts =3D true; =20 - chardev_vc_add_encoding_prop(oc, get_encoding, set_encoding); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "encoding", + .qapi_type =3D &ChardevVCEncoding_type_info, + .get =3D get_encoding, + .set =3D set_encoding, + )); } =20 static void diff --git a/ui/input-linux.c b/ui/input-linux.c index f4eee1ffd7ec..715d1f589297 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -6,6 +6,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "qemu/config-file.h" #include "qemu/main-loop.h" #include "qemu/module.h" @@ -506,10 +507,12 @@ static void input_linux_class_init(ObjectClass *oc, c= onst void *data) object_class_property_add_bool(oc, "repeat", input_linux_get_repeat, input_linux_set_repeat); - object_class_property_add_enum(oc, "grab-toggle", "GrabToggleKeys", - &GrabToggleKeys_lookup, - input_linux_get_grab_toggle, - input_linux_set_grab_toggle); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "grab-toggle", + .qapi_type =3D &GrabToggleKeys_type_info, + .get =3D input_linux_get_grab_toggle, + .set =3D input_linux_set_grab_toggle, + )); } =20 static const TypeInfo input_linux_info =3D { --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051836; cv=none; d=zohomail.com; s=zohoarc; b=EHK0R9Mn4iU1VY3qat1gQs9HG5yFp6YrCLbjYcIyjZPHErjqzec8ltJBq5h6FktfKXQd6S869yad+K183inPMMBjIxiur80EQ2J2oFbMJvvoD7zoggeBQLreJHc1rP7iE+O/Cz+ocwBGJItsAZ7ac1tAcGh0vP0W/g6WEQ8G7b8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051836; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LsvPrTgS8tdV9aTud991lnbFdQQ3wSya/r00TxNZZ+U=; b=GpFde0WmAqGlXYAvTsvLxV6uelMd9oGVPvW8Wykx44n+1iOMNK4SmeC/IyFJjIXqNaUBLVY1fV/a+L3O/vaYuTxMWcwrFPxmvnJpipP95icD+lQfF1yr5cGIuqGXs/hX2tMx2JeEKgGmAb7SWKTpHt+Jb92QEKudnxpUly4rZeI= 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 1787051836281278.29742848840624; Tue, 18 Aug 2026 04:17:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHob-0007pk-9X; Tue, 18 Aug 2026 07:17:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHoa-0007pM-0U for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:17:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHoY-0005cy-Av for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:17:07 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-173-GmTI3PKgOvic2bCmXGN-Qg-1; Tue, 18 Aug 2026 07:17:02 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 286781955DAF; Tue, 18 Aug 2026 11:17:01 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DB155434; Tue, 18 Aug 2026 11:16:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051825; 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=LsvPrTgS8tdV9aTud991lnbFdQQ3wSya/r00TxNZZ+U=; b=YQKnaud0gCzXmvQzisRutP1Oe8Ct/Vx+2YWe1FjiUoQ6Gm8NFDeQCjmRt/L7sz1qZtMRKA SqTUhagF2xrgbL9Q9Ja+Pmbh2eGuy+BaEZIdlddBCJJZJLKqIxOp374IC/4QgGDZJZbWtN smhKVtHCEf3KNB1DL2E8WAsHfBksJ6Y= X-MC-Unique: GmTI3PKgOvic2bCmXGN-Qg-1 X-Mimecast-MFC-AGG-ID: GmTI3PKgOvic2bCmXGN-Qg_1787051821 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:42 +0400 Subject: [PATCH v3 15/74] qom: remove old enum property registration API MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-15-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=7293; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=3Buk5MkZXpfyktSUfJO3M2SHccWczby/wCrxSqXUO24=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD23l0OGthAjWqkXsc7e+t/EedbdVJDPesT13 SmbofbnRAGJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9twAKCRDa6OEJdZac 5QmNEAC2DdHpoWnuTySa4pBZ2BqW+XCBkkT4J6ATnvLHRsxiLYoJiLIY7PfgORVlQAjE8zxEt6V truGPmQ+x0R3p0OvEqfwjI6DDsEfSho1zGEmlwks59JmwBqlx65xSZuAKDAxlWROuGvNatffl/a Gj61bt/TVzEaDEI41G0Dj0XUNputOhuSzCze6CgDQf3w2Swt2cU51SLAQQYFtYbDxTzX7dKulIW CeoU0+0/R4RqUmJrgKo7VTEbLngnQ+q6nba6RZO8IHhQSrENcqEu1rIRQf3fmONynboHlh9Zp7G Y5Fv7SxB140qs22ONZUOZHwLYKkX6xhjBQE2724RqLKQJ4Jk3aE4kpTktZYVEb4K8DwdPNyL/8E TsP1ad83Rwyk9vJ8Jwsw11oG8RT/vFLFvnnwGP3JP3HOA6B2ghP/b8+g/F2PVskkgSWGskMgoog +PxsfG9k0D5XJp/J6PBebqRBrwpETUCpLoXLWzjk3ssb4/eSBqSVbO8cghqR6iNKexoBiENCP6v sRDbsNq2b72apqjxfeE+nCCdcW4ZmUTsDLB4/JPe3GKadPkbIDnB45H7ibWHe0dtKxXduN4B1ZV RwXeqDn7gtb4sahHK/wv5BphYLsJvtxuiG22CLRweFrLBZ9B+Fm+XHycPOidFQhsgnV7Ur2uSoh R1faKt1tsBC0uxw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787051838690158500 Now that all callers use object_class_property_add_qapi_enum(), remove the legacy object_property_add_enum() and object_class_property_add_enum() functions along with their EnumProperty struct and property_get_enum / property_set_enum helpers. Simplify object_property_get_enum() to assert on qapi_type rather than falling back to the old EnumProperty opaque data. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/qom/object.h | 45 ++-------------------------- qom/object.c | 82 ++----------------------------------------------= ---- 2 files changed, 4 insertions(+), 123 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index a03f4bf8f7cf..70217eba1473 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1660,12 +1660,12 @@ char *object_get_canonical_path(const Object *obj); * because it was ambiguous, or %NULL. Set to %false on success. * * There are two types of supported paths--absolute paths and partial path= s. - *=20 + * * Absolute paths are derived from the root object and can follow child<> = or * link<> properties. Since they can follow link<> properties, they can be * arbitrarily long. Absolute paths look like absolute filenames and are * prefixed with a leading slash. - *=20 + * * Partial paths look like relative filenames. They do not begin with a * prefix. The matching rules for partial paths are subtle but designed t= o make * specifying objects easy. At each level of the composition tree, the pa= rtial @@ -1949,47 +1949,6 @@ ObjectProperty *object_class_property_add_bool(Objec= tClass *klass, bool (*get)(Object *, Error **), void (*set)(Object *, bool, Error **)); =20 -/** - * object_property_add_enum: - * @obj: the object to add a property to - * @name: the name of the property - * @typename: the name of the enum data type - * @lookup: enum value namelookup table - * @get: the getter or %NULL if the property is write-only. - * @set: the setter or %NULL if the property is read-only - * - * Add an enum property using getters/setters. This function will add a - * property of type '@typename'. - * - * Returns: The newly added property on success, or %NULL on failure. - */ -ObjectProperty *object_property_add_enum(Object *obj, const char *name, - const char *typename, - const QEnumLookup *lookup, - int (*get)(Object *, Error **), - void (*set)(Object *, int, Error **)); - -/** - * object_class_property_add_enum: - * @klass: the object class to add a property to - * @name: the name of the property - * @typename: the name of the enum data type - * @lookup: enum value namelookup table - * @get: the getter or %NULL if the property is write-only. - * @set: the setter or %NULL if the property is read-only - * - * Add an enum property using getters/setters. This function will add a - * property of type '@typename'. - * - * Returns: The newly added property on success, or %NULL on failure. - */ -ObjectProperty *object_class_property_add_enum(ObjectClass *klass, - const char *name, - const char *typename, - const QEnumLookup *lookup, - int (*get)(Object *, Error **), - void (*set)(Object *, int, Error **)); - /** * struct QapiEnumProp - Descriptor for a QOM property backed by a QAPI en= um type * diff --git a/qom/object.c b/qom/object.c index f5568b9f9790..89a5ea04ab2e 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1760,12 +1760,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) { @@ -1789,12 +1783,8 @@ int object_property_get_enum(Object *obj, const char= *name, return -1; } =20 - if (prop->qapi_type) { - ret =3D qapi_enum_parse(prop->qapi_type->lookup, str, -1, errp); - } else { - EnumProperty *enumprop =3D prop->opaque; - ret =3D qapi_enum_parse(enumprop->lookup, str, -1, errp); - } + assert(prop->qapi_type); + ret =3D qapi_enum_parse(prop->qapi_type->lookup, str, -1, errp); g_free(str); =20 return ret; @@ -2529,74 +2519,6 @@ object_class_property_add_bool(ObjectClass *klass, c= onst char *name, prop); } =20 -static void property_get_enum(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - EnumProperty *prop =3D opaque; - int value; - Error *err =3D NULL; - - value =3D prop->get(obj, &err); - if (err) { - error_propagate(errp, err); - return; - } - - visit_type_enum(v, name, &value, prop->lookup, errp); -} - -static void property_set_enum(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - EnumProperty *prop =3D opaque; - int value; - - if (!visit_type_enum(v, name, &value, prop->lookup, errp)) { - return; - } - prop->set(obj, value, errp); -} - -ObjectProperty * -object_property_add_enum(Object *obj, const char *name, - const char *typename, - const QEnumLookup *lookup, - int (*get)(Object *, Error **), - void (*set)(Object *, int, Error **)) -{ - EnumProperty *prop =3D g_malloc(sizeof(*prop)); - - prop->lookup =3D lookup; - prop->get =3D get; - prop->set =3D set; - - return object_property_add(obj, name, typename, - get ? property_get_enum : NULL, - set ? property_set_enum : NULL, - property_release_data, - prop); -} - -ObjectProperty * -object_class_property_add_enum(ObjectClass *klass, const char *name, - const char *typename, - const QEnumLookup *lookup, - int (*get)(Object *, Error **), - void (*set)(Object *, int, Error **)) -{ - EnumProperty *prop =3D g_malloc(sizeof(*prop)); - - prop->lookup =3D lookup; - prop->get =3D get; - prop->set =3D set; - - return object_class_property_add(klass, name, typename, - get ? property_get_enum : NULL, - set ? property_set_enum : NULL, - NULL, - prop); -} - static void get_qapi_enum(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051888; cv=none; d=zohomail.com; s=zohoarc; b=SflwWd8HoQE2aywgJuWwJft0Cl3dxw8+WWvydRdDoeUy5Vo0ETtn3veFFClhCyIV6QIsTSmXuUegQ4zfeAPWLtQr3tMC/V3npIwe1RfTiUrtQjg77fc09tdu+8ZgSCbtSHaELnKoiH8shcUtlSzdAKmeac5Q2DzvL3cRjvWbeUA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051888; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=k7sLgcKy46Y8uZwm/mabjfqolsaFuLha8cI618N0WKg=; b=SIn1QZd9UEFXhhBBCUJlAqBpxArbheTkUHEM8vQ3wsvJOc+QJbyfLE9SDjwfcHfgSN991mo4kZdo1FYOGD4xnZKyCCKQjbwq7WWkZotjUc88NtYWYYptON6BeU16LqyBM8khKwLxs4GuvbMn7P7SW6U+oxuDuZmM22tEzGWQevo= 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 1787051888484930.8292939966577; Tue, 18 Aug 2026 04:18:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHpD-0000JA-9u; Tue, 18 Aug 2026 07:17:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHp8-00005P-Pn for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:17:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHp6-0005i4-1i for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:17:42 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-104-PFydJzvqO2Kquw0fUJmyfw-1; Tue, 18 Aug 2026 07:17:29 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 60EB31955F39; Tue, 18 Aug 2026 11:17:26 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 942EB1800347; Tue, 18 Aug 2026 11:17:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051859; 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=k7sLgcKy46Y8uZwm/mabjfqolsaFuLha8cI618N0WKg=; b=ham4v7Anh07gWAvChhKgmr1Unt5l+Q9dEbNQw0NvFIBU8LUi6xF5JZZi0qyZLysYUXG0QM lsdxUyHuXuOGfUOhEpD2GtpCDQ9qMWx6y1rVxGC7wrVkXPqJUpUx3rQ2EXVD8lQHcDH78z UIjq2+XWv0YgtCD35NHXr03e4KWCwfA= X-MC-Unique: PFydJzvqO2Kquw0fUJmyfw-1 X-Mimecast-MFC-AGG-ID: PFydJzvqO2Kquw0fUJmyfw_1787051846 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:43 +0400 Subject: [PATCH v3 16/74] qom: convert struct properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-16-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alberto Garcia , Kevin Wolf , Hanna Reitz , Zhao Liu , Jonathan Cameron , Elena Ufimtseva , Jagannathan Raman , John Levon , Thanos Makatos , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Marcelo Tosatti , Cornelia Huck , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , David Hildenbrand , qemu-block@nongnu.org, linux-cxl@vger.kernel.org, kvm@vger.kernel.org, qemu-s390x@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=12033; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=kkDsnTyWfv1u+mGY4BN2EV0C8BxZN84pizHSkLa2WqU=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD24aTxEXASPhT+Osx3ZXljnXs+K5N+lIjrFO JZnhfyDCXGJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uAAKCRDa6OEJdZac 5fj2D/wOz5pK10GoilZo307skGZSzhYILjrPVsLZlvKfm8i8P4yGV6PUhHEENfTDD0riQcDbsAN 6zIJF6vTg8VubfY6yJMdrAvBv6YDePkxKGOJKLywVobZjXGUx39WoSh0NeLBktQ29h8ajtJaZE/ pE9tLF1LyY22iCvSwLhJ207gi2Mz9JONpJGnvSr+ZPdK7NxRw4pW8FSgvINKDhs42QYKmjt40DS iActFKKIHRwKqkcTGgTLmwhCasljLgs5ouAgEYaCPkWEDsHAyIXGwLR2DoM870FjZbgMXRv0zQQ iOyCmtQ6+Hc92Cvyqwlmn28X2JmwT3zfCpi1oiVvn7AsxrXO/BrUajqgmeiCGt6l1D0zEi+Wd/6 2fLXS5bIwwHy6IuYhwU1JG8W6oxQKFozLdHM5e9B7G5fzMk1CXEKC9HjSMFBj1xG6slzlhCxtO4 8CYw5I+kAdYacQBVaGs67lD2kHSgPsQe/w4nP6RYKiKNQ4WuNnT8f7sAsRM93HHuRz9mA5hiB2/ uQXyX/u5zrnduhg3kBkkj+fQVZRL+rz5RboMiPb/p6ODyLuCLEL+KXIzCWNzb8lRskQQUkmJBzS GaPXlail/PBUxFkYwyDtdhPbPmdHhN0cP7UdamvLuLKKpWHLvrzKZdteSywzJVlL0TulwsVgItA 9urkE1e0xoDnBgQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787051890010158500 Convert all callers of object_property_add() and object_class_property_add() that register struct-typed properties with QAPI visitor-based getters/setters to use object_property_add_qapi() and object_class_property_add_qapi() instead. This replaces the manual string type name with a reference to the generated QAPITypeInfo constant, enabling QMP introspection to report accurate QAPI type information for struct properties. Existing getters/setters are preserved unchanged. The cxl-fmw property type is corrected from "CXLFixedMemoryWindow" (not a real QAPI type) to "CXLFixedMemoryWindowOptions". Signed-off-by: Marc-Andr=C3=A9 Lureau --- authz/list.c | 2 +- block/throttle-groups.c | 5 +++-- chardev/char-socket.c | 3 ++- hw/core/machine.c | 11 +++++++---- hw/cxl/cxl-host.c | 4 +++- hw/remote/vfio-user-obj.c | 5 +++-- hw/vfio-user/pci.c | 5 +++-- target/i386/cpu.c | 11 ++++++++--- target/i386/kvm/tdx.c | 4 +++- target/s390x/cpu-system.c | 4 +++- 10 files changed, 36 insertions(+), 18 deletions(-) diff --git a/authz/list.c b/authz/list.c index 363b2ee12c98..ed3d346004c2 100644 --- a/authz/list.c +++ b/authz/list.c @@ -128,7 +128,7 @@ qauthz_list_class_init(ObjectClass *oc, const void *dat= a) .set =3D qauthz_list_prop_set_policy, )); =20 - object_class_property_add(oc, "rules", "QAuthZListRule", + object_class_property_add_qapi(oc, "rules", &QAuthZListRule_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 805e47270c7e..a9d3aea3b54e 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,8 +992,8 @@ static void throttle_group_obj_class_init(ObjectClass *= klass, } =20 /* ThrottleLimits */ - object_class_property_add(klass, - "limits", "ThrottleLimits", + object_class_property_add_qapi(klass, + "limits", &ThrottleLimits_type_info, throttle_group_get_limits, throttle_group_set_limits, NULL, NULL); diff --git a/chardev/char-socket.c b/chardev/char-socket.c index b629575fcf80..99173d9f3e6e 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" @@ -1573,7 +1574,7 @@ static void char_socket_class_init(ObjectClass *oc, c= onst void *data) cc->chr_listener_cleanup =3D tcp_chr_listener_cleanup; cc->chr_get_filename =3D tcp_chr_get_filename; =20 - object_class_property_add(oc, "addr", "SocketAddress", + object_class_property_add_qapi(oc, "addr", &SocketAddress_type_info, char_socket_get_addr, NULL, NULL, NULL); =20 diff --git a/hw/core/machine.c b/hw/core/machine.c index e617f7804d4e..cd9636dde6e6 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" @@ -1114,19 +1115,20 @@ static void machine_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, "dumpdtb", "Dump current dtb to a file and quit"); =20 - object_class_property_add(oc, "boot", "BootConfiguration", + object_class_property_add_qapi(oc, "boot", &BootConfiguration_type_inf= o, machine_get_boot, machine_set_boot, NULL, NULL); object_class_property_set_description(oc, "boot", "Boot configuration"); =20 - object_class_property_add(oc, "smp", "SMPConfiguration", + object_class_property_add_qapi(oc, "smp", &SMPConfiguration_type_info, machine_get_smp, machine_set_smp, NULL, NULL); object_class_property_set_description(oc, "smp", "CPU topology"); =20 - object_class_property_add(oc, "smp-cache", "SmpCachePropertiesWrapper", + object_class_property_add_qapi(oc, "smp-cache", + &SmpCachePropertiesWrapper_type_info, machine_get_smp_cache, machine_set_smp_cache, NULL, NULL); object_class_property_set_description(oc, "smp-cache", "Cache properties list for SMP machine"); @@ -1208,7 +1210,8 @@ static void machine_class_init(ObjectClass *oc, const= void *data) "Set RAM backend" "Valid value is ID of hostmem ba= sed backend"); =20 - object_class_property_add(oc, "memory", "MemorySizeConfiguration", + object_class_property_add_qapi(oc, "memory", + &MemorySizeConfiguration_type_info, machine_get_mem, machine_set_mem, NULL, NULL); object_class_property_set_description(oc, "memory", diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index eba13c9e7cba..7592c4ac6c7b 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" @@ -570,7 +571,8 @@ void cxl_machine_init(Object *obj, CXLState *state) "Set on/off to enable/disable " "CXL instantiation"); =20 - object_property_add(obj, "cxl-fmw", "CXLFixedMemoryWindow", + object_property_add_qapi(obj, "cxl-fmw", + &CXLFixedMemoryWindowOptions_type_info, machine_get_cfmw, machine_set_cfmw, NULL, state); object_property_set_description(obj, "cxl-fmw", diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c index a0498d218faf..7e6819f670b5 100644 --- a/hw/remote/vfio-user-obj.c +++ b/hw/remote/vfio-user-obj.c @@ -47,6 +47,7 @@ #include "hw/core/boards.h" #include "hw/remote/machine.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-sockets.h" #include "qapi/qapi-visit-sockets.h" #include "qapi/qapi-events-misc.h" #include "qemu/notify.h" @@ -931,8 +932,8 @@ static void vfu_object_class_init(ObjectClass *klass, c= onst void *data) =20 k->nr_devs =3D 0; =20 - object_class_property_add(klass, "socket", "SocketAddress", NULL, - vfu_object_set_socket, NULL, NULL); + object_class_property_add_qapi(klass, "socket", &SocketAddress_type_in= fo, + NULL, vfu_object_set_socket, NULL, NULL); object_class_property_set_description(klass, "socket", "SocketAddress " "(ex: type=3Dunix,path=3D/tmp/so= ck). " diff --git a/hw/vfio-user/pci.c b/hw/vfio-user/pci.c index e7573d4a9f08..246bd5a90925 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 @@ -466,8 +467,8 @@ static void vfio_user_pci_class_init(ObjectClass *klass= , const void *data) device_class_set_legacy_reset(dc, vfio_user_pci_reset); device_class_set_props(dc, vfio_user_pci_properties); =20 - object_class_property_add(klass, "socket", "SocketAddress", NULL, - vfio_user_pci_set_socket, NULL, NULL); + object_class_property_add_qapi(klass, "socket", &SocketAddress_type_in= fo, + NULL, vfio_user_pci_set_socket, NULL, NULL); object_class_property_set_description(klass, "socket", "SocketAddress (UNIX sockets onl= y)"); =20 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index e5ffb10d1565..3b30ded0cc02 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" @@ -10514,10 +10516,12 @@ static void x86_cpu_initfn(Object *obj) =20 x86_cpu_init_default_topo(cpu); =20 - object_property_add(obj, "feature-words", "X86CPUFeatureWordInfo", + object_property_add_qapi(obj, "feature-words", + &X86CPUFeatureWordInfo_type_info, x86_cpu_get_feature_words, NULL, NULL, (void *)env->features); - object_property_add(obj, "filtered-features", "X86CPUFeatureWordInfo", + object_property_add_qapi(obj, "filtered-features", + &X86CPUFeatureWordInfo_type_info, x86_cpu_get_feature_words, NULL, NULL, (void *)cpu->filtered_features); =20 @@ -10977,7 +10981,8 @@ static void x86_cpu_common_class_init(ObjectClass *= oc, const void *data) NULL, NULL); =20 #if !defined(CONFIG_USER_ONLY) - object_class_property_add(oc, "crash-information", "GuestPanicInformat= ion", + object_class_property_add_qapi(oc, "crash-information", + &GuestPanicInformation_type_info, x86_cpu_get_crash_info_qom, NULL, NULL, NULL= ); #endif =20 diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c index 8294dbde3aa8..81c5ba3a1b54 100644 --- a/target/i386/kvm/tdx.c +++ b/target/i386/kvm/tdx.c @@ -14,6 +14,7 @@ #include "qemu/base64.h" #include "qemu/mmap-alloc.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-sockets.h" #include "qapi/qapi-visit-sockets.h" #include "qom/object_interfaces.h" #include "crypto/hash.h" @@ -1586,7 +1587,8 @@ static void tdx_guest_init(Object *obj) tdx_guest_get_mrownerconfig, tdx_guest_set_mrownerconfig); =20 - object_property_add(obj, "quote-generation-socket", "SocketAddress", + object_property_add_qapi(obj, "quote-generation-socket", + &SocketAddress_type_info, tdx_guest_get_qgs, tdx_guest_set_qgs, NULL, NULL); diff --git a/target/s390x/cpu-system.c b/target/s390x/cpu-system.c index cc9685221ae8..4c2a91d0ff51 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 @@ -130,7 +131,8 @@ void s390_cpu_system_init(Object *obj) S390CPU *cpu =3D S390_CPU(obj); =20 cs->start_powered_off =3D true; - object_property_add(obj, "crash-information", "GuestPanicInformation", + object_property_add_qapi(obj, "crash-information", + &GuestPanicInformation_type_info, s390_cpu_get_crash_info_qom, NULL, NULL, NULL); cpu->env.tod_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_tod_timer, cpu); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051872; cv=none; d=zohomail.com; s=zohoarc; b=FaYR0nDzD5AfRIcbmwyiMRLykUU6Zp9iuTLj3tC4x/B3TClQA9mKNVQbKuhFtm6yeZ5ynPQq9B2MOFAYTRre6yxbodwRNTm3t+bKtsYNFpKdNIXFIvyl9mbqKGEORBi0oqViLufKSGRuCopwjBannB4IffSqn1Kkqzjn4bOu7B8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051872; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VscR/iIW0mIAkyA8JHrPI5JG+q0xz3TzuUhYEBv6Obk=; b=hvCENXmHquJUDmCebX3Qjo3mfskF1FO7oat8LUIJhzzy/F4P8udj096p/mBCTAVNLwRoLu8F3ShmCBJUiGJWR85g8r8Nysx0kWlJiIFv/3A6WmNTqfLmcQ50Ttkr/jgHSaZvSSEgb/P7NhmS0jNMsTVz+75CnOUXzqaMHInIrQM= 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 1787051872888810.9996991450327; Tue, 18 Aug 2026 04:17:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHpF-0000Rc-7p; Tue, 18 Aug 2026 07:17:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHpB-0000Eo-LI for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:17:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHp9-0005ie-LG for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:17:45 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-468-JWRvrGG-Naax3gnfxT95Sw-1; Tue, 18 Aug 2026 07:17:38 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 031AD1955DEA; Tue, 18 Aug 2026 11:17:37 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9158430002E9; Tue, 18 Aug 2026 11:17:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051862; 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=VscR/iIW0mIAkyA8JHrPI5JG+q0xz3TzuUhYEBv6Obk=; b=XWcJWlDss3cxDaHIw8EatbXnLKjjMRFLZXmcmS5YtQLjSmaENUaYXxFuMxPfVUBM975Tex x+rajYKNDlAFFoCXyze0NrNUqU/vhUzhoRenwXhnfG3R9gAZG2RwsyTkyhjpqSnab2qq1O +u9DQeDlwp8e4d4laLCkYHoWtZFC6DY= X-MC-Unique: JWRvrGG-Naax3gnfxT95Sw-1 X-Mimecast-MFC-AGG-ID: JWRvrGG-Naax3gnfxT95Sw_1787051857 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:44 +0400 Subject: [PATCH v3 17/74] x86: convert OnOffAuto properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-17-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , "Michael S. Tsirkin" X-Developer-Signature: v=1; a=openpgp-sha256; l=6518; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=SgZyvSyb89GMp5FbVLfodHDTHOL+fqH6tT2LZO1GJws=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD24WWzVM6qFkskaUHqxWUevhNu6Nfv9IjUnw Z75J9He1PyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uAAKCRDa6OEJdZac 5YTMD/4+OIeuy9cG1MwBjbIRBqgCt8XZRAYwF6YFrUNllb3Af//TfpYLfTXS85JMYOABw1YIKUk ytBT3RXdzx4R43wbtOzuOPZEqFOEvELRPhr8K6gbAUWpuVaqfXtvCzAZdCVC/BN4/90ieBsryBs K+STZx8PZQrI5HMVSwaeRlo4EhFJpLXxGjgYvHUvFUhY41ByOr2AX3L3tF4pMx5K7Pd2x4re2mx mR8nwmdbgfN5/+d++9kgPid1QAjeXxmN9oHPKwrKYwSXkFM/GGRI8lUIagU+7Kd/nCvKrFxzxT/ W2AfVByUzdENZniZOi2hbF/z8XJF1EC5Q3gxyW9b0wxwLQldW+sLxXot5++7PTj5qm+/lGrD3jL YpHSsEwz3oRmGOguJ2vxybpZfCW+b1pzvURDAi3tSlcU+lPITTaHjMiFA/HzF2PxdHO868uWA0M pXSHM+pwp8OfL6jhuz1UagvLHOy64W9GS3T9J8DkTedZLkxwVd7FcrFMvnySQyEmLSJjoOjIitL IlNB23Wmjz7GzfqVym+CQHxXvkJOuNZ/lVZOPM++4aZK22YDAUfIZ0uGB6xkvz0fW7Am3n6ZO6k a7z1iYS4yI3yAi0veCFJ2At6rJd9pU2JV3wxuiF8hfYfj/Tib1iBo67PhMEX7OXQZXVSAaExeko ZiS93wi57WfHSfA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787051875149158500 Convert the smm, acpi, pit, and pic OnOffAuto properties from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/i386/x86.c | 104 +++++++++++++++++++++++++-----------------------------= ---- 1 file changed, 45 insertions(+), 59 deletions(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index f8ba3244e221..63f297a10532 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -24,7 +24,7 @@ #include "qemu/error-report.h" #include "qemu/units.h" #include "qapi/error.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qapi-visit-machine.h" #include "qapi/visitor.h" #include "system/qtest.h" @@ -188,21 +188,16 @@ bool x86_machine_is_smm_enabled(const X86MachineState= *x86ms) return false; } =20 -static void x86_machine_get_smm(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int x86_machine_get_smm(Object *obj, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - OnOffAuto smm =3D x86ms->smm; - - visit_type_OnOffAuto(v, name, &smm, errp); + return x86ms->smm; } =20 -static void x86_machine_set_smm(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void x86_machine_set_smm(Object *obj, int value, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &x86ms->smm, errp); + x86ms->smm =3D value; } =20 bool x86_machine_is_acpi_enabled(const X86MachineState *x86ms) @@ -213,55 +208,40 @@ bool x86_machine_is_acpi_enabled(const X86MachineStat= e *x86ms) return true; } =20 -static void x86_machine_get_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int x86_machine_get_acpi(Object *obj, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - OnOffAuto acpi =3D x86ms->acpi; - - visit_type_OnOffAuto(v, name, &acpi, errp); + return x86ms->acpi; } =20 -static void x86_machine_set_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void x86_machine_set_acpi(Object *obj, int value, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &x86ms->acpi, errp); + x86ms->acpi =3D value; } =20 -static void x86_machine_get_pit(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int x86_machine_get_pit(Object *obj, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - OnOffAuto pit =3D x86ms->pit; - - visit_type_OnOffAuto(v, name, &pit, errp); + return x86ms->pit; } =20 -static void x86_machine_set_pit(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void x86_machine_set_pit(Object *obj, int value, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &x86ms->pit, errp); + x86ms->pit =3D value; } =20 -static void x86_machine_get_pic(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int x86_machine_get_pic(Object *obj, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - OnOffAuto pic =3D x86ms->pic; - - visit_type_OnOffAuto(v, name, &pic, errp); + return x86ms->pic; } =20 -static void x86_machine_set_pic(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void x86_machine_set_pic(Object *obj, int value, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &x86ms->pic, errp); + x86ms->pic =3D value; } =20 static char *x86_machine_get_oem_id(Object *obj, Error **errp) @@ -391,31 +371,37 @@ static void x86_machine_class_init(ObjectClass *oc, c= onst void *data) mc->kvm_type =3D x86_kvm_type; nc->raise_nmi =3D x86_nmi; =20 - object_class_property_add(oc, X86_MACHINE_SMM, "OnOffAuto", - x86_machine_get_smm, x86_machine_set_smm, - NULL, NULL); - object_class_property_set_description(oc, X86_MACHINE_SMM, - "Enable SMM"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D X86_MACHINE_SMM, + .description =3D "Enable SMM", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D x86_machine_get_smm, + .set =3D x86_machine_set_smm, + )); =20 - object_class_property_add(oc, X86_MACHINE_ACPI, "OnOffAuto", - x86_machine_get_acpi, x86_machine_set_acpi, - NULL, NULL); - object_class_property_set_description(oc, X86_MACHINE_ACPI, - "Enable ACPI"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D X86_MACHINE_ACPI, + .description =3D "Enable ACPI", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D x86_machine_get_acpi, + .set =3D x86_machine_set_acpi, + )); =20 - object_class_property_add(oc, X86_MACHINE_PIT, "OnOffAuto", - x86_machine_get_pit, - x86_machine_set_pit, - NULL, NULL); - object_class_property_set_description(oc, X86_MACHINE_PIT, - "Enable i8254 PIT"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D X86_MACHINE_PIT, + .description =3D "Enable i8254 PIT", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D x86_machine_get_pit, + .set =3D x86_machine_set_pit, + )); =20 - object_class_property_add(oc, X86_MACHINE_PIC, "OnOffAuto", - x86_machine_get_pic, - x86_machine_set_pic, - NULL, NULL); - object_class_property_set_description(oc, X86_MACHINE_PIC, - "Enable i8259 PIC"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D X86_MACHINE_PIC, + .description =3D "Enable i8259 PIC", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D x86_machine_get_pic, + .set =3D x86_machine_set_pic, + )); =20 object_class_property_add_str(oc, X86_MACHINE_OEM_ID, x86_machine_get_oem_id, --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051888; cv=none; d=zohomail.com; s=zohoarc; b=nYP1zNqz3rc6qQi+GT4DYWndp7GJjj2I4Ou6UTnFkEsjjQfbEphq+bXs6hVznkZVjfp+elmwhbZokXOGoK4hU4uzK14aiMOoj4i7wKhFfHQ0d/aBjmdY3N2twPfiNUKQtIxdorBvnJ6UKC91je67Kbx226ZefvCI0TEpBIJ7L/I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051888; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=giWvSJES9Am74xj7Gxo9BvxGBNVPmhOKyYmXMRbmmxg=; b=K/4+YLoRLv1+Flfppm1xNZkh1HG+9Te3IcYX/t9KCThedngiw7dHCPAn9eJSIlQEu4KPkY69AmE3zkMADpP+qjRpjrCbA0IK0LmuH1V0X8XYaMBPC3LsD0kGTMWk9/yRAh1NWxeSCPRHef/N+SwGwPi0+nCaM9q66THCVAOYQNg= 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 1787051888528590.482050857395; Tue, 18 Aug 2026 04:18:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHpK-0000k5-Ag; Tue, 18 Aug 2026 07:17:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHpH-0000bC-DM for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:17:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHpF-0005k5-N4 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:17:51 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-617-BuvvfWZnOU-70v5x8OuBVg-1; Tue, 18 Aug 2026 07:17:43 -0400 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 7620A18002C0; Tue, 18 Aug 2026 11:17:42 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 078DD30002E9; Tue, 18 Aug 2026 11:17:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051868; 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=giWvSJES9Am74xj7Gxo9BvxGBNVPmhOKyYmXMRbmmxg=; b=anKjU00geoBvO7N7kB2J9uF6dQGJiFbgTI1zrDErPYg1AkV1v86UlrmcYaIbtHEQJPoccj WqpSgk9y3nAix/BcM+r9tMmmeSHGta1i+pfb3PcpbgMqFx8cLBHxjBjEPNnFyQ7sGjnZE9 5ynEbt5I3ZEJ0VoV2fX2KUosMtw7ITk= X-MC-Unique: BuvvfWZnOU-70v5x8OuBVg-1 X-Mimecast-MFC-AGG-ID: BuvvfWZnOU-70v5x8OuBVg_1787051862 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:45 +0400 Subject: [PATCH v3 18/74] microvm: convert OnOffAuto properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-18-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Sergio Lopez , Richard Henderson , "Michael S. Tsirkin" X-Developer-Signature: v=1; a=openpgp-sha256; l=5502; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=SY82PLEWc9Gc3m055Lm7iyiVVRaR86gDnyc0DsDmtbo=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD24lF3n+bDfhXTRTlvqbOKZYj5AwxoumeN16 8X5sT66X9OJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uAAKCRDa6OEJdZac 5ZSzD/0RlcM3fREvQYoAswtU194WHHOdSCi9GmjaeDVBcW//dbotYsYueqHpHmbAEhEJXU759Kx hL8Dh9qvqvd91ozYCgosXeZPMZvInDIB78p4EFLkcNrRc/s8WA0yEvYFas0EynASXW2jljFCOzl CfL3QTpElkYKWrmw/atQ0Q5x941V+FfHRZ7ZXgfkfUTmtVHbOFoui8lPYacq1RH5y9wDjnFsoZP mjDUyLvra9DZUUPNtkwbe+eaR311k+mxcBPJ2yucIvZJ8PsJZU5gtAXpki0YK0ENk+PNy/X7q4f 512AklyiwWo0jK/BuViI/mho0bfXPG4GgFiHJ/2UH06oEwLB00m6rsYGs3vSCdalOhLwxCF6T3j OwZ+fxE6VCdeM7wIZIEDd6T2H/vyv6TNF+bXtZfkrE2eDVTcQoxkQlIPru2r9X6QnrQx20KpWYJ sRuy5IP16eVOuU8eHkhJhZM/26BuvZCVgHqHTgq/dsrMQBXfXNiGINN0AHsCZePebot/wRGHzfb IV/nxx68TarB3Sg54lq3AhkvAqYJxo51yFHkhv8zOKoggono4LbYoJbWt5V6Cp/utWDQYvJMCCg QSaNFfVsecf06GvkB7lzXxny0AYh12dDUIS4QJScH/+L43Xqp04zEtq1noJMhn0Y5V4vIL3JNL0 /3pTow2G446y3QQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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: 1787051888902158500 Convert the rtc, pcie, and ioapic2 OnOffAuto properties from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/i386/microvm.c | 80 +++++++++++++++++++++++----------------------------= ---- 1 file changed, 34 insertions(+), 46 deletions(-) diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index e7adab7d2ef7..3366f3b933f8 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -21,7 +21,7 @@ #include "qemu/units.h" #include "qapi/error.h" #include "qapi/visitor.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "system/system.h" #include "system/cpus.h" #include "system/numa.h" @@ -519,55 +519,40 @@ static void microvm_machine_reset(MachineState *machi= ne, ResetType type) } } =20 -static void microvm_machine_get_rtc(Object *obj, Visitor *v, const char *n= ame, - void *opaque, Error **errp) +static int microvm_machine_get_rtc(Object *obj, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - OnOffAuto rtc =3D mms->rtc; - - visit_type_OnOffAuto(v, name, &rtc, errp); + return mms->rtc; } =20 -static void microvm_machine_set_rtc(Object *obj, Visitor *v, const char *n= ame, - void *opaque, Error **errp) +static void microvm_machine_set_rtc(Object *obj, int value, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &mms->rtc, errp); + mms->rtc =3D value; } =20 -static void microvm_machine_get_pcie(Object *obj, Visitor *v, const char *= name, - void *opaque, Error **errp) +static int microvm_machine_get_pcie(Object *obj, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - OnOffAuto pcie =3D mms->pcie; - - visit_type_OnOffAuto(v, name, &pcie, errp); + return mms->pcie; } =20 -static void microvm_machine_set_pcie(Object *obj, Visitor *v, const char *= name, - void *opaque, Error **errp) +static void microvm_machine_set_pcie(Object *obj, int value, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &mms->pcie, errp); + mms->pcie =3D value; } =20 -static void microvm_machine_get_ioapic2(Object *obj, Visitor *v, const cha= r *name, - void *opaque, Error **errp) +static int microvm_machine_get_ioapic2(Object *obj, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - OnOffAuto ioapic2 =3D mms->ioapic2; - - visit_type_OnOffAuto(v, name, &ioapic2, errp); + return mms->ioapic2; } =20 -static void microvm_machine_set_ioapic2(Object *obj, Visitor *v, const cha= r *name, - void *opaque, Error **errp) +static void microvm_machine_set_ioapic2(Object *obj, int value, Error **er= rp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &mms->ioapic2, errp); + mms->ioapic2 =3D value; } =20 static bool microvm_machine_get_isa_serial(Object *obj, Error **errp) @@ -673,26 +658,29 @@ static void microvm_class_init(ObjectClass *oc, const= void *data) hc->unplug_request =3D microvm_device_unplug_request_cb; hc->unplug =3D microvm_device_unplug_cb; =20 - object_class_property_add(oc, MICROVM_MACHINE_RTC, "OnOffAuto", - microvm_machine_get_rtc, - microvm_machine_set_rtc, - NULL, NULL); - object_class_property_set_description(oc, MICROVM_MACHINE_RTC, - "Enable MC146818 RTC"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D MICROVM_MACHINE_RTC, + .description =3D "Enable MC146818 RTC", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D microvm_machine_get_rtc, + .set =3D microvm_machine_set_rtc, + )); =20 - object_class_property_add(oc, MICROVM_MACHINE_PCIE, "OnOffAuto", - microvm_machine_get_pcie, - microvm_machine_set_pcie, - NULL, NULL); - object_class_property_set_description(oc, MICROVM_MACHINE_PCIE, - "Enable PCIe"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D MICROVM_MACHINE_PCIE, + .description =3D "Enable PCIe", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D microvm_machine_get_pcie, + .set =3D microvm_machine_set_pcie, + )); =20 - object_class_property_add(oc, MICROVM_MACHINE_IOAPIC2, "OnOffAuto", - microvm_machine_get_ioapic2, - microvm_machine_set_ioapic2, - NULL, NULL); - object_class_property_set_description(oc, MICROVM_MACHINE_IOAPIC2, - "Enable second IO-APIC"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D MICROVM_MACHINE_IOAPIC2, + .description =3D "Enable second IO-APIC", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D microvm_machine_get_ioapic2, + .set =3D microvm_machine_set_ioapic2, + )); =20 object_class_property_add_bool(oc, MICROVM_MACHINE_ISA_SERIAL, microvm_machine_get_isa_serial, --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051889; cv=none; d=zohomail.com; s=zohoarc; b=HS2x1yKEuLvNkBd3UeLc2E0w8yCJIpCia1dR2hFq8V5wzpBipEkkmN10YvkYjpEexo8atPGQvS/b7JQ8YpF9uKvZpCZm22MeyCx2/rGM6U0URslAWp1T45KJi1SYuT1NEVEJxK2ZLSmO2qX6D+8h0mgWwOuDg8uGs4+Jy3zpD1M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051889; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Jpy8BYiyeQ1/xM+bCFKZLs5qW5++vmmopKZQaqcqzvg=; b=HJt8q6zV7UMGmCBU/1e/STfbTCu22G7pJXXKDaoTMR1utpM21W0EmRdPSIvYXsZkG7UCEy/+s72GSiDVarGanHKzAnKCvWBNQRSrV27Lhs8dOiCbBI2NcbgIviTMZ5vGLsvgkizzF/rtgxrAelxYHHqAc+yQZvSZTJ607BOngNk= 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 1787051889877882.5169064705066; Tue, 18 Aug 2026 04:18:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHpP-0000zF-0Q; Tue, 18 Aug 2026 07:17:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHpN-0000wF-4G for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:17:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHpL-0005kR-6x for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:17:56 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-607-RVZsg778PLSCebFl5eyEZQ-1; Tue, 18 Aug 2026 07:17:49 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8952C180074B; Tue, 18 Aug 2026 11:17:48 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 882EB1953944; Tue, 18 Aug 2026 11:17:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051874; 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=Jpy8BYiyeQ1/xM+bCFKZLs5qW5++vmmopKZQaqcqzvg=; b=S8WXgF2Lz93gj1DUIMl3Js4LTz4DiR/6zscl9xbOAw54lsJKRvWIFEDNidMQIp1PusCt8u 6ZlDBxndtr0FWmYDZcDo4pynVV0bbVEElRt9i1knEKnEt60JnVK6mIKsXCB1aaq8m6fw3k OMcfrE62OcSZ71Ew+FEylfCCAgoUr7U= X-MC-Unique: RVZsg778PLSCebFl5eyEZQ-1 X-Mimecast-MFC-AGG-ID: RVZsg778PLSCebFl5eyEZQ_1787051868 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:46 +0400 Subject: [PATCH v3 19/74] pc: convert OnOffAuto vmport property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-19-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Richard Henderson X-Developer-Signature: v=1; a=openpgp-sha256; l=2492; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=p6+EX45jD1DvPE7aHMiqR5ww7Y9deovLVheC6sjhUUY=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD240Lmq3q5CB0zDyukr2NcD2yPssiG29Loms hyptd0Cv4+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uAAKCRDa6OEJdZac 5fpID/oDOzh9JB/ZR0pgP7EiSbkGiXzTqp/cpWUW2U2zbG8S6Rdwu+skEQ/v1rzZIb8L1QyUq78 64A1A8Ue/MTm5Cu2I7ulq4FkUcOBdbUTfoudN0GaAItzbQu6+K7zH7GkoXkbLOHmPtf8RS/QhcW rMeowgcyeHeLV+6I+eLzycPf663LTLbtLUcO5bEs4NvBFSF0mGkXB/twhTsyZQo9VwAUjW9Raah Iyqq9ZeyKtJHCInpDBQX+UWa6Z87EDW3rCReOKY+v4wiC3rszZKS52Zt4VonGtDJ5Id6DBBxRKs tqsmGoL/cKyDEgcCD5pTM7QA/G54KFJ02r2SktXUy4rON/e30ODi6lbXZlWCLzZOiyFWmeCFLT+ hNlZX3UEIu9aCftsjEpbq2uejmbpOs5y6p5XCKhGZAB8SchkN0SLGLb+TSI6CQjFHKHeccgTn0d LYdoYyMd+7POvHL5LTZvYb+NzkjXyph+pZ27d+2yZCzId4lgf3V34nCpmyzBod1/qDHe8YsTzkI 5y4U3T7GUrCPtyP7brNCZnwL0kuZzOwYuzIh+4VyuWVOmdenEfykfGR2EVIa/ic6pwvn6L7nHVq Tp8qZS7OA4EK0n8w3TEJAI7fmHeOpJ+aSPTNj00HNs4T0iemVqxdnntbPOHgRQ+rh6JoR3t/TvE 0q8HoOhGMJM6tOw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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: 1787051890933158501 Convert the vmport OnOffAuto property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/i386/pc.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index e9e4fc262b83..18b5dc169ab7 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" @@ -1419,21 +1420,16 @@ static HotplugHandler *pc_get_hotplug_handler(Machi= neState *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) @@ -1730,11 +1726,13 @@ static void pc_machine_class_init(ObjectClass *oc, = const void *data) object_class_property_set_description(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "Maximum ram below the 4G boundary (32bit boundary)"); =20 - object_class_property_add(oc, PC_MACHINE_VMPORT, "OnOffAuto", - pc_machine_get_vmport, pc_machine_set_vmport, - NULL, NULL); - object_class_property_set_description(oc, PC_MACHINE_VMPORT, - "Enable vmport (pc & q35)"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D PC_MACHINE_VMPORT, + .description =3D "Enable vmport (pc & q35)", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D pc_machine_get_vmport, + .set =3D pc_machine_set_vmport, + )); =20 object_class_property_add_bool(oc, PC_MACHINE_SMBUS, pc_machine_get_smbus, pc_machine_set_smbus); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051897; cv=none; d=zohomail.com; s=zohoarc; b=AITOZ3Tt4l+gv0FNI1ztKT2bNiKZ22lFScMrh1KTlgtm6pkg9eH9Ys+8pJlWn5RAf88qpF5CmJJSMgQRCSbhzbTBW8gS3znfvTlT/eG7TpknXUE+OjF/bMFwjn0kbIF+TeBo/q0Dv0c603Dxm8SwpBe0ZUKy6qCXMFPzM4cIvTo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051897; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SdKbOEmdbXNIMEb1ABKJlXk0e2Ws94+O7ONv/67mPi4=; b=ONIIVqDEjULnp0vhRZ34Liyjs1XGdc+2CUZ4yerppxYXuyuQOzq12r2CIYZr2paUZWFlW51nYOFN6doXkd5bwNrMYqiN8RvammUbkS1BtjmeIT8Hu2mDqGC1cmz9Mdt/0f5+oIagf5hAqLEs30KJkVS26EAL3WgL4JIIr2O18SM= 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 1787051897525208.33144082238118; Tue, 18 Aug 2026 04:18:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHpZ-0001iH-FO; Tue, 18 Aug 2026 07:18:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHpX-0001Ta-IY for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:18:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHpV-0005ll-WB for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:18:07 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-353-KRxyMqn4ObOuXru_FS3Rxg-1; Tue, 18 Aug 2026 07:17:59 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B93961956088; Tue, 18 Aug 2026 11:17:57 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5B24C1800347; Tue, 18 Aug 2026 11:17:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051885; 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=SdKbOEmdbXNIMEb1ABKJlXk0e2Ws94+O7ONv/67mPi4=; b=am4XRpaZ7gwM3b3+Yt1nHNRwM3OGnxbpxbsZwNDw/PaUW9uE5O8aUdMTnbRdYTQIyNbKa4 /Kko0TyneH4lSnGZ576I04XZZNmSLQemW2kHRh4nTvLdiEzDgK1sblN8kNq9JEsZDi+HWy tp6PqgmjAYEH+fI+HJbe5+2Dm6J6MGE= X-MC-Unique: KRxyMqn4ObOuXru_FS3Rxg-1 X-Mimecast-MFC-AGG-ID: KRxyMqn4ObOuXru_FS3Rxg_1787051878 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:47 +0400 Subject: [PATCH v3 20/74] arm/virt: convert OnOffAuto acpi property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-20-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , qemu-arm@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=2389; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=c6HLhb1f9WKODsN9+9U7nvCHldQkpSmUDUODJkZ99eM=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD24c1D6cxO6voScMEotQ39eX0CxxaL9LKcwr Ben8lgqUSSJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uAAKCRDa6OEJdZac 5Xv3D/9Dc0Dh83DxDaPMC3GEi/zrcZSEk/kpa8jvSDYQCMn0ZWQ6ourD6svQ3hxLxKnLPkUoM07 MMHZqCfs0Q46brninctPUGOmR5SX42vZInZnxtIEEG6qTdf7HKHy7KJcQ7h6XrJ+05Kb7iEHONo BVb95btw1S0IVFwWInNIAriPKyKE5vQy1YEvLCv2LDPLTVQXqtJ3AkKZJaMjArlJXHRvSAvXFDk lI5OptF4Lq+Zk2cMQSz1i4ski0PjC4/FIOl8Z7pKnEY7PXd98UYyvzN7+emNqo0FGNOU6VuWZEm VwrnhtPUHmKUtoPjSrptU61IscjijDh06yqqIHxSVtPw5zsCJO6rGcd7jZ89J3mHlTYFct9FYnJ s+Qqv8s6S2/WpqOaRhiBKcYGc/PD2BhC9m6GcGxfW+IYaNCuD1PZNWxwWjZU2qS359yvohQ1mXL wfUFcNL3bcouxVFHDcpSkmY34tZ4RDdCbkEOPFdUp/ma0w7YGImYfYy/+nkOyeBjo4/ETStaews /O0ca6Imo9P1sFTZbzSgkriANkSyyJtv/sS/UD8UNS9UBiWEHMgSTwwkqD5/wZiwAEoMFth9c3K marFXT2vRw4dqk3MP6keMh4oQpfZ7J4tkkqa7liB1uZvEtjCAPgzDTZ88gchhlJe9cgYYwKaRmX i4TnWuAnozzateg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787051898988158500 Convert the acpi OnOffAuto property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/arm/virt.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index e7a56e37f731..f283703fb002 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -74,7 +74,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" @@ -3569,21 +3569,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) @@ -4208,11 +4203,13 @@ static void virt_machine_class_init(ObjectClass *oc= , const void *data) mc->default_ram_id =3D "mach-virt.ram"; mc->default_nic =3D "virtio-net-pci"; =20 - object_class_property_add(oc, "acpi", "OnOffAuto", - virt_get_acpi, virt_set_acpi, - NULL, NULL); - object_class_property_set_description(oc, "acpi", - "Enable ACPI"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "acpi", + .description =3D "Enable ACPI", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D virt_get_acpi, + .set =3D virt_set_acpi, + )); object_class_property_add_bool(oc, "secure", virt_get_secure, virt_set_secure); object_class_property_set_description(oc, "secure", --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051907; cv=none; d=zohomail.com; s=zohoarc; b=aKJU5souGktbW08Y8EjQCzQuhUn+CoIdK9dP3Gi+cLHL8W6HEC1vKWXZk2Gnj5Czc4scj9MDh3Nep9dGqZNuQKdvSneGo+Yu3Zl0EG6/n+KzrOmLgsTynKEYzsXUUeLJjLszq6mym4ZCjU6MDMOFoxxW4vr1KrN7kzoBUDuY9r0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051907; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=w1p0wsYe7wILmnAsGR4qYZN8ofy2xkguhRxrrZLXdfA=; b=eKsPV7JJ/m6mVIdA4i9fAEhxmBkA61C149ARGaiq47i68Hnl7C77CuAo64Y50C8zxzAtPTQhIMV2sS7+Slyz1OInnlPfEEHVUJmT7ZbC2Oys5QxMfNCg+6XdqA4ZpF2FkcfApKjBfTM+y9zOHISn948D4JdiuI6TGnGWopEFJXM= 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 1787051907302355.5894278462589; Tue, 18 Aug 2026 04:18:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHpf-0001pw-BT; Tue, 18 Aug 2026 07:18:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHpd-0001mm-S8 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:18:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHpc-0005mM-BV for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:18:13 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-127-RQMl-zzHPIirTArsAxtdhA-1; Tue, 18 Aug 2026 07:18:10 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 611611955BC5; Tue, 18 Aug 2026 11:18:08 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 940371800347; Tue, 18 Aug 2026 11:18:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051891; 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=w1p0wsYe7wILmnAsGR4qYZN8ofy2xkguhRxrrZLXdfA=; b=ZEHC5X0vjn/zNS6JuMDmZR559EztGwt3hg8t9maKCMwIxR7cpCK8Sue4XvAS8+Xd6N8pZB mYqjPI9cUPUK7vRmyxCT7zZ/Rhnz+xopsaigABg81Qh6aSCAhRvbmeli8Qc2IBjc+2qlLH +8viuNHyzPaRbefpBPUCpIOOuZhwBp8= X-MC-Unique: RQMl-zzHPIirTArsAxtdhA-1 X-Mimecast-MFC-AGG-ID: RQMl-zzHPIirTArsAxtdhA_1787051888 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:48 +0400 Subject: [PATCH v3 21/74] riscv/virt: convert OnOffAuto properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-21-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alistair Francis , Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=3984; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=Mvmbn+YpXxLPFQ3gkFotdxJS6BhWegqsWmBOu8ZuxEc=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD241ugGadiTWVsKPuYJyMR+D5sEhA/L1YZO7 48fe9Xz5i6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uAAKCRDa6OEJdZac 5X8GD/45sKv79Nk2Swc6iLiavySW+TwiLBWgPevmhGT4anAWpfHIWKjcjldirlK1xjeyGKi9ZK8 nOodKsBHqpZmdx9yLuFQJRjWqze5M8D9p04M4cFtxY7b9RH8JhNmcRok+9iw+b1ubGMi4NmOFF1 WHxfC5wQ21WbObyvURB24rEw/5ETVdCCNz72W2f90wfs1yqmbpekDRrVoz92LpCHRkhaOisXM7M MMq5I+HT+bPYaK1NUkd7OxpyvSNvCqckEbkilsIw7+YtabxPGeD6KdnK9MGrK7EiNWn3GG3CxXf EpFjNhVjo1/ZSFs9tUa29pGxsH3PRrmhvLppqC8hH353ypjGHoXmoqfT16jyJA3M4Fy6JmEMT79 m1vKFoqPlMBtyFZ6fNh2CsysfF/Saeu7XfPL932DaryzcAp61J4W9ZokoId0BNwYSOVpZZl2beS G0L76IyCoLi0KCyfK8IARQVjZug6J8pyAPXs1bmiA8MV2e1iZc7mEyNcBBqWbObHoVd05nuR/EB dEQ7RCCZ5p54JQWDXJRekKFw3PgSBKsnaUnOGZrJdu5NPWbO0gXbX+Nxs7g4i5eq4quAndNv8x8 YmDC4D/6Nd2PD6fG3F4AQP0ohuHshotwnpXOv9rYy9py6/e5Nf8ZsGuky2l9NVSTyZ5X6TH5XhD 6iHb32Z5VRB1fFA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787051909068158500 Convert the acpi and iommu-sys OnOffAuto properties from manual visitor-based callbacks to property_add_qapi_enum(). Acked-by: Alistair Francis Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/riscv/virt.c | 52 +++++++++++++++++++++++----------------------------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 51bac47a91d8..5ebce4a3efc9 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -56,7 +56,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 @@ -1635,21 +1635,16 @@ bool virt_is_iommu_sys_enabled(RISCVVirtState *s) return s->iommu_sys =3D=3D ON_OFF_AUTO_ON; } =20 -static void virt_get_iommu_sys(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int virt_get_iommu_sys(Object *obj, Error **errp) { RISCVVirtState *s =3D RISCV_VIRT_MACHINE(obj); - OnOffAuto iommu_sys =3D s->iommu_sys; - - visit_type_OnOffAuto(v, name, &iommu_sys, errp); + return s->iommu_sys; } =20 -static void virt_set_iommu_sys(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void virt_set_iommu_sys(Object *obj, int value, Error **errp) { RISCVVirtState *s =3D RISCV_VIRT_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &s->iommu_sys, errp); + s->iommu_sys =3D value; } =20 bool virt_is_acpi_enabled(RISCVVirtState *s) @@ -1657,21 +1652,16 @@ bool virt_is_acpi_enabled(RISCVVirtState *s) return s->acpi !=3D ON_OFF_AUTO_OFF; } =20 -static void virt_get_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int virt_get_acpi(Object *obj, Error **errp) { RISCVVirtState *s =3D RISCV_VIRT_MACHINE(obj); - OnOffAuto acpi =3D s->acpi; - - visit_type_OnOffAuto(v, name, &acpi, errp); + return s->acpi; } =20 -static void virt_set_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void virt_set_acpi(Object *obj, int value, Error **errp) { RISCVVirtState *s =3D RISCV_VIRT_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &s->acpi, errp); + s->acpi =3D value; } =20 static HotplugHandler *virt_machine_get_hotplug_handler(MachineState *mach= ine, @@ -1769,17 +1759,21 @@ static void virt_machine_class_init(ObjectClass *oc= , const void *data) object_class_property_set_description(oc, "aia-guests", str); } =20 - object_class_property_add(oc, "acpi", "OnOffAuto", - virt_get_acpi, virt_set_acpi, - NULL, NULL); - object_class_property_set_description(oc, "acpi", - "Enable ACPI"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "acpi", + .description =3D "Enable ACPI", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D virt_get_acpi, + .set =3D virt_set_acpi, + )); =20 - object_class_property_add(oc, "iommu-sys", "OnOffAuto", - virt_get_iommu_sys, virt_set_iommu_sys, - NULL, NULL); - object_class_property_set_description(oc, "iommu-sys", - "Enable IOMMU platform device"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "iommu-sys", + .description =3D "Enable IOMMU platform device", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D virt_get_iommu_sys, + .set =3D virt_set_iommu_sys, + )); } =20 static const TypeInfo virt_machine_typeinfo =3D { --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051929; cv=none; d=zohomail.com; s=zohoarc; b=kMmIC0UYJe8nH19OJu0di/WT693pVt4joOXVCCfiIcVJpGod1wtCEtMY6xmT3qRyETBR8AunZS7eVEovPiQOWf9ziNNIz+dwQeiu1Srkc4deyQxYe1eet3C9jUMNQwBuPpI1c32hY2JLvrEKcUteOHrP+fdnwlGpj6R6nZgHTqk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051929; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NqfpP6+T+mMqhutT80shj/MSxHjc1FnuwFPkDl4SbWs=; b=GXS86j4Co1I3gp4zqW96hbRmzrR/XYaTs2E2jnJFEdyl8/yDOXgU4P+gZj/U5yZTUxrRSV+grZPrrOsVg3E834Asj0gx47N83opfSQTHn5ohz+Ej2NjfFjRQrN6IH2j/QeTlyFMixTQIYfeGCn/Wl49xPtoMLxg2kyBrioXmg+s= 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 1787051929494764.2757572563677; Tue, 18 Aug 2026 04:18:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHq9-0002sv-LJ; Tue, 18 Aug 2026 07:18:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHq7-0002rE-On for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:18:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHq5-0005zd-L4 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:18:43 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-217-03Erat5CP1ykaAVLz228Kg-1; Tue, 18 Aug 2026 07:18:30 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E336A18001CD; Tue, 18 Aug 2026 11:18:28 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 84CAB180049F; Tue, 18 Aug 2026 11:18:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051921; 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=NqfpP6+T+mMqhutT80shj/MSxHjc1FnuwFPkDl4SbWs=; b=bBLqDEx/L78a56Np86+la8st0gwaJVQir+L/dG5S3/EDEuOZ34R1gVAmHZx24GhFchk3BG K29elGTEz69S3ijUg7X8R4robthU0qUjStWckS7cbe3CLb6cNZ5Pfw34wvbAR8r2EVD4RS G03bg4pJ0pRo5eUJAA6K/FdMpU9z8Zk= X-MC-Unique: 03Erat5CP1ykaAVLz228Kg-1 X-Mimecast-MFC-AGG-ID: 03Erat5CP1ykaAVLz228Kg_1787051909 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:49 +0400 Subject: [PATCH v3 22/74] loongarch/virt: convert OnOffAuto properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-22-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang X-Developer-Signature: v=1; a=openpgp-sha256; l=5919; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=nfckD088YpF8IH5Vqc/iq59Hc1wNBUsrHYJUB8Qf1+k=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD24FMaL9/uPDmfoY5+832a8ikLmR68wTMa81 vNDcEBiDP+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uAAKCRDa6OEJdZac 5YAWD/9UrkdR3/gZiZ8i/jnvk+HWJ1Uqcr0i1icu2cKj+3SlDWee6C+VzJeEDrb72JgMzrFm0LH z+e0OnJk8D6qxP8nQMqd3UYyKPW65Z6ZHpKHLe9F7tofxhjl+mO8RAp96muWo9j9Imlmzil45Ib IkQsZJZgIZag69qTvqcVbeF6Rb5O69Ku9QOUdeYGm2jIv78APN/lKD+nx48optGd7KPqzDJXhmg KuhseCwgfLZxGROnYuEd6/mP58DgnH3IIjCi0Df1cMK78cX/QXUm+WaEacTFVo3jJnCaHt9LtCo HfnCed1OgWzgLrBP2YvB2RI/F1Bwj1iyv2zJpEJ5rf60LTn5nzzTva29rByZDV2J2D+0qGmkIsF e0KxfwnD+XB6c5ehKDTQu+SzenZXTCoGRg6eVPf4hW+Ei8p8+xVRTY2hjTrkJGEwgoR0QidSFgM WpTPI6Pj9OhdMHFPupnhbj79SECfnUAQw0cqAJlgE12yovpRg2Em8HUMjSWwxhOnNR2rSl2QtM0 KXwKKXQzfMBvOnu3gYOR3o1GkgzUwVtZ5BHndTb5or2gkV9eGmNJ98vwKyita7gRinEO5LBElRN aj877LdbXPtdjme1xJWyH5cuh4iF78JeQAb3bqd/RPyrgteSMKsXh3570Sz81WsHCvB9gx8QoLf c9bReTfq29rUPVw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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: 1787051931475158500 Convert the acpi, v-eiointc, and dmsi OnOffAuto properties from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/loongarch/virt.c | 85 +++++++++++++++++++++++++------------------------= ---- 1 file changed, 40 insertions(+), 45 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 9cc79929a8ab..750ce2dbe5fc 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -36,7 +36,8 @@ #include "target/loongarch/cpu.h" #include "target/loongarch/cpu-mmu.h" #include "hw/firmware/smbios.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" +#include "qapi/visitor.h" #include "hw/acpi/generic_event_device.h" #include "hw/mem/nvdimm.h" #include "hw/core/platform-bus.h" @@ -51,26 +52,21 @@ #include "qemu/log.h" #include "kvm/kvm_loongarch.h" =20 -static void virt_get_dmsi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int virt_get_dmsi(Object *obj, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(obj); - OnOffAuto dmsi =3D lvms->dmsi; - - visit_type_OnOffAuto(v, name, &dmsi, errp); - + return lvms->dmsi; } -static void virt_set_dmsi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) + +static void virt_set_dmsi(Object *obj, int value, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(obj); + lvms->dmsi =3D value; =20 - visit_type_OnOffAuto(v, name, &lvms->dmsi, errp); - - if (lvms->dmsi =3D=3D ON_OFF_AUTO_OFF) { + if (value =3D=3D ON_OFF_AUTO_OFF) { lvms->misc_feature &=3D ~BIT(IOCSRF_DMSI); lvms->misc_status &=3D ~BIT_ULL(IOCSRM_DMSI_EN); - } else if (lvms->dmsi =3D=3D ON_OFF_AUTO_ON) { + } else if (value =3D=3D ON_OFF_AUTO_ON) { lvms->misc_feature =3D BIT(IOCSRF_DMSI); } } @@ -78,21 +74,16 @@ static void virt_set_dmsi(Object *obj, Visitor *v, cons= t char *name, #define DEFAULT_HIGH_PCIE_MMIO_SIZE_GB 64 #define DEFAULT_HIGH_PCIE_MMIO_SIZE (DEFAULT_HIGH_PCIE_MMIO_SIZE_GB * GiB) =20 -static void virt_get_veiointc(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int virt_get_veiointc(Object *obj, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(obj); - OnOffAuto veiointc =3D lvms->veiointc; - - visit_type_OnOffAuto(v, name, &veiointc, errp); + return lvms->veiointc; } =20 -static void virt_set_veiointc(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void virt_set_veiointc(Object *obj, int value, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &lvms->veiointc, errp); + lvms->veiointc =3D value; } =20 static bool virt_get_highmem_mmio(Object *obj, Error **errp) @@ -1025,21 +1016,16 @@ static void virt_init(MachineState *machine) loongarch_load_kernel(machine, &lvms->bootinfo, phys_addr_mask); } =20 -static void virt_get_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int virt_get_acpi(Object *obj, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(obj); - OnOffAuto acpi =3D lvms->acpi; - - visit_type_OnOffAuto(v, name, &acpi, errp); + return lvms->acpi; } =20 -static void virt_set_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void virt_set_acpi(Object *obj, int value, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &lvms->acpi, errp); + lvms->acpi =3D value; } =20 static char *virt_get_oem_id(Object *obj, Error **errp) @@ -1483,20 +1469,29 @@ static void virt_class_init(ObjectClass *oc, const = void *data) hc->unplug_request =3D virt_device_unplug_request; hc->unplug =3D virt_device_unplug; =20 - object_class_property_add(oc, "acpi", "OnOffAuto", - virt_get_acpi, virt_set_acpi, - NULL, NULL); - object_class_property_set_description(oc, "acpi", - "Enable ACPI"); - object_class_property_add(oc, "v-eiointc", "OnOffAuto", - virt_get_veiointc, virt_set_veiointc, - NULL, NULL); - object_class_property_set_description(oc, "v-eiointc", - "Enable Virt Extend I/O Interrupt Controller."= ); - object_class_property_add(oc, "dmsi", "OnOffAuto", - virt_get_dmsi, virt_set_dmsi, NULL, NULL); - object_class_property_set_description(oc, "dmsi", - "Enable direct Message-interrupts Controller."= ); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "acpi", + .description =3D "Enable ACPI", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D virt_get_acpi, + .set =3D virt_set_acpi, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "v-eiointc", + .description =3D "Enable Virt Extend I/O Interrupt Controller.", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D virt_get_veiointc, + .set =3D virt_set_veiointc, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "dmsi", + .description =3D "Enable direct Message-interrupts Controller.", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D virt_get_dmsi, + .set =3D virt_set_dmsi, + )); machine_class_allow_dynamic_sysbus_dev(mc, TYPE_RAMFB_DEVICE); machine_class_allow_dynamic_sysbus_dev(mc, TYPE_UEFI_VARS_SYSBUS); #ifdef CONFIG_TPM --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051938; cv=none; d=zohomail.com; s=zohoarc; b=c6gYOFUBN4PfLqXjaErM2o+dKG5qaIizMpemeGPRlGO9cJ+OHft9JvoIHxzeC4gEdG7lxxdUfkFCyRGsa26IEamsvpZ4Gq7e8JftorjUC97nS8Slri0kSc8/bf/pKNwjyh99LYLmkB+J8Hvi9PONuqr10r86k0FdAYwb45ahMOE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051938; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DOkU7q0xcLJ9xK7CvuM4Ad4dMtqmoGyTkqHMZwunjcU=; b=lTDRVA7YwjVf25qyh2N5PXGJcuuY8qfew5iBKyBMNSuAnVdnyui1poiaGpHKQ4qolbarznuwM7+Szca6GXWJqkYvZvQWgbNmIqh0N7rlxbzaLPrY0eH5HuViuEKOT57BQ4AosN9yv27rtjc3lYQvtrqvp1d/dUxYoot5+Zdr904= 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 1787051938845913.765768833022; Tue, 18 Aug 2026 04:18:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHqB-0002uu-0p; Tue, 18 Aug 2026 07:18:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHq9-0002t7-PN for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:18:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHq8-00061o-4f for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:18:45 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-261-UoKskeY8OqqqbOYcRznDOA-1; Tue, 18 Aug 2026 07:18:42 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 46C4F19560A2; Tue, 18 Aug 2026 11:18:41 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D03221956042; Tue, 18 Aug 2026 11:18:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051923; 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=DOkU7q0xcLJ9xK7CvuM4Ad4dMtqmoGyTkqHMZwunjcU=; b=P0m7y0mJMwISojxldH8v24yZ2pc9RcO9Fv3Iuxh/ThZpmTwqXVpMPieZ1vZe0WY1iPZ5YT 1In2RoBudAZe4ZhywdMsfzj5YoUyHj/rk3+HudjUVPcdzpLV65Fc8jlN++zv8ySuLdyJe4 QgnOIRLMMXx7+x3nk4R6I+PI2Tfj9As= X-MC-Unique: UoKskeY8OqqqbOYcRznDOA-1 X-Mimecast-MFC-AGG-ID: UoKskeY8OqqqbOYcRznDOA_1787051921 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:50 +0400 Subject: [PATCH v3 23/74] hostmem-file: convert OnOffAuto rom property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-23-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Hildenbrand , Igor Mammedov X-Developer-Signature: v=1; a=openpgp-sha256; l=2963; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=JNLqfIMCYBOz/tg8GWZhShisq3K0syh9AaTWFqpB/+o=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD24ODRXXCPYxKAUBU0ZwTpB8cyiXbB4Bv7r0 RgWVS3VEjWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uAAKCRDa6OEJdZac 5QdKD/9+j+u7yR8Q6iLxXHozEOf7TDCXMkHmb0AwE9r1uLYsYjKOqV2nTQMQL7thuJR/cGm1JaM mjZKFvqlve/b/FFg4gd4LOK4B1bWuNejpnsQ+Ja0cpJYMBM8pXCtxGFBP4Hw4O8J5ht8g1s02UQ 8zS/Xji1ZvpJdoZHId4+LMITg+66MGOyzCYCTsP1hDHLNocS9OEVFTmV7er7qq53NsVuIXJHy1g vcvY9JWTZYPZeRO2AfCBQP8HlGwyVCG6uSIcLqm9pDDgv0K3gBX3q+dIe7oG8uqpc24i9Vgj0No QYhaYRA8r1vSU9uFJs46CQdVZpBquyyxvhD/QpXc/eKMy84yE8HVbKTS4GqOBPNTWeBPCIGxhiO PiqLaIQ5AjOaPfvd/ddgrqpqxSq3y9T78qvdS2FnfR14h1H/vxEt4RT1lm/bLMkqSSLVwXkRFoL cKFt6Up+a/klRGotzivamEA2FznH1ZtPzjH3v4aA2M2HRbUU+DUxbKPwAYbgpfSrU5iAmqobZA2 w2Pi+b4olgn3BwNzaiP2qjkki+gWYkHDEEzyCR+h8AjPP5ubtg8vvImRwE+Stj8+kg1gbAvssdB oug7EuzKfZictNE8q574ZPsBUfEM/iBJktG0rDiO/zdQFdQ3iuD9+Y0UNLRhtTDhkdQ6ifx8zJs C82BmfP6g80h3Tg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787051939256158500 Convert the rom OnOffAuto property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- backends/hostmem-file.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 8e3219c06172..52b62f715334 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -19,7 +19,7 @@ #include "qom/object_interfaces.h" #include "qom/object.h" #include "qapi/visitor.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" =20 OBJECT_DECLARE_SIMPLE_TYPE(HostMemoryBackendFile, MEMORY_BACKEND_FILE) =20 @@ -230,30 +230,24 @@ static void file_memory_backend_set_readonly(Object *= obj, bool value, fb->readonly =3D value; } =20 -static void file_memory_backend_get_rom(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static int file_memory_backend_get_rom(Object *obj, Error **errp) { HostMemoryBackendFile *fb =3D MEMORY_BACKEND_FILE(obj); - OnOffAuto rom =3D fb->rom; - - visit_type_OnOffAuto(v, name, &rom, errp); + return fb->rom; } =20 -static void file_memory_backend_set_rom(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void file_memory_backend_set_rom(Object *obj, int value, Error **er= rp) { HostMemoryBackend *backend =3D MEMORY_BACKEND(obj); HostMemoryBackendFile *fb =3D MEMORY_BACKEND_FILE(obj); =20 if (host_memory_backend_mr_inited(backend)) { - error_setg(errp, "cannot change property '%s' of %s.", name, + error_setg(errp, "cannot change property 'rom' of %s.", object_get_typename(obj)); return; } =20 - visit_type_OnOffAuto(v, name, &fb->rom, errp); + fb->rom =3D value; } =20 static void file_backend_unparent(Object *obj) @@ -298,10 +292,13 @@ file_backend_class_init(ObjectClass *oc, const void *= data) object_class_property_add_bool(oc, "readonly", file_memory_backend_get_readonly, file_memory_backend_set_readonly); - object_class_property_add(oc, "rom", "OnOffAuto", - file_memory_backend_get_rom, file_memory_backend_set_rom, NULL, NU= LL); - object_class_property_set_description(oc, "rom", - "Whether to create Read Only Memory (ROM)"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "rom", + .description =3D "Whether to create Read Only Memory (ROM)", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D file_memory_backend_get_rom, + .set =3D file_memory_backend_set_rom, + )); } =20 static void file_backend_instance_finalize(Object *o) --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051942; cv=none; d=zohomail.com; s=zohoarc; b=AuOhfOfWMSQ+03qp2qQYrqToF7GlB5AJ4eswhcdT4apbsP4XA+DFFgfAOspAtSNJ7B88ffbwiIP/lsbsG6RKW/Vwui8Xsj0OhI7zjqPUBXzGswZgCmAGv8x9l2YlXg4lTJCCnsr4OASPDNpylv8rj/Imuqf3w9AKrAiACTXf0dc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051942; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BsmdlaFnrsY3I+1UFAW3E5SehDcZ9lldQlqYb3G66HE=; b=VhIi81voaDI7FUg/mXKTbhP7eS7SiwlVoTC8NVOTOGaTDtIioH76U3487O+zxHeGEj8e+zPF30yTBMIVRTNzM4V4yJVBEcSMt9CKjl/iYuXfayOG1RiWMDYyMDvTQhIMrTeHVuP0dHgHr35XDs/WPtNY+IK7gGf7jjOgIT4PyUk= 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 1787051942963659.4924483245659; Tue, 18 Aug 2026 04:19:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHqK-0003Ec-45; Tue, 18 Aug 2026 07:18:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHqI-0003AQ-GW for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:18:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHqG-000661-UN for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:18:54 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-142-g4lL4Jx5PtWwzWiWBlHIBg-1; Tue, 18 Aug 2026 07:18:50 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 920E61955F3D; Tue, 18 Aug 2026 11:18:49 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 98A44180049F; Tue, 18 Aug 2026 11:18:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051932; 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=BsmdlaFnrsY3I+1UFAW3E5SehDcZ9lldQlqYb3G66HE=; b=S2Wn0O1/7RIstf7Qzi3rCZM6sYNkCorNH4frJ/duhJqgOnOl/w9fwPC2OPqaPZ/x9EXg47 mnvG1Uni5WfaBEj4QcXHL4fmK7a/l+z3ITYN0L5AcjTU8bI8MNb3NJeqNCZ2Zc31qhohBI aEj2tqZgQ6Hh97aUnobkEDXxYnlzocI= X-MC-Unique: g4lL4Jx5PtWwzWiWBlHIBg-1 X-Mimecast-MFC-AGG-ID: g4lL4Jx5PtWwzWiWBlHIBg_1787051929 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:51 +0400 Subject: [PATCH v3 24/74] sev: convert OnOffAuto legacy-vm-type property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-24-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Marcelo Tosatti , Zhao Liu , kvm@vger.kernel.org X-Developer-Signature: v=1; a=openpgp-sha256; l=2878; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=nkdSCroCL4rc/fXglavopKUEFdlDWMM9nOCJlhTw/EI=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD24pvx3ql+ZkehN6RSLvFPXUC4lRQL0xUxPC Wn6w7rAZMaJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uAAKCRDa6OEJdZac 5Uu3EACZbJeifRZ/wBI4hxZp9Pmq1hD/nshXm+OLnCOjvOmtwgiluUSPXlR7CwzA3qIGiYC7kuE GXEZ+9kJ8wZJ+uz53SoLyYRpXz2nYo6t7yux8jSF4W/YP8J1gisT2qhd2OAOpnwldg89SAv+48k ecUim5oFdTsK+PeVHOoWelPilMT8KOuStGcnUYvSVlyK674pekPbWouyDg/Vw9XQRk0+skjaC4c lkZKLX259HbG1EQ+c0o3bRmbEC6Cu4M7Lrs1LHVqH6MqjOSkMPXhbhd5bKiKr+aV1QdjUV2nZ0f B4JdfqVtEMFguc37IzrFTHrzvHp5TwM+aAXcrqS3pauB5Tp4F2zXz+DQxMvs5EagKwqZwYZTPkp E67vg0vakMYvcRZIp9UOUAEJyYm2mrGw+ymRFwGApcqF//VrD7ITpZ7bmiD5U23mRA0gIMHWL7d whkMdZZWYz+eYsEERiGTpS4MMt0QQCvEiiKCICwOUjWgV0+D43ZJvgH+8tKmoAA7N1ur+2QWmMK HdE3NVteRTqgJ7Y4hSaoD+A/PKDVZFMQPue/ajwcn1D/vpHAkcfloD7XRkLL8qUYONKuuzF2ZVe i4YhNibDRiDrTGxq0Ihv1DvzpO1vI5bQaK0LddS+pSOlcXgIPGXF0QJQe2kz1zTjjvwRItYoRLs ytHCUr7G4yLNzIQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787051943392158500 Convert the legacy-vm-type OnOffAuto property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- target/i386/sev.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index d7dcefc8ecf5..335a504af4db 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" @@ -2880,23 +2881,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 @@ -2922,11 +2916,14 @@ sev_guest_class_init(ObjectClass *oc, const void *d= ata) sev_guest_set_session_file); object_class_property_set_description(oc, "session-file", "guest owners session parameters (encoded with base64)"); - object_class_property_add(oc, "legacy-vm-type", "OnOffAuto", - sev_guest_get_legacy_vm_type, - sev_guest_set_legacy_vm_type, NULL, NULL); - object_class_property_set_description(oc, "legacy-vm-type", - "use legacy VM type to maintain measurement compatibility with= older QEMU or kernel versions."); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "legacy-vm-type", + .description =3D "use legacy VM type to maintain measurement " + "compatibility with older QEMU or kernel versions.", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D sev_guest_get_legacy_vm_type, + .set =3D sev_guest_set_legacy_vm_type, + )); } =20 static void --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051958; cv=none; d=zohomail.com; s=zohoarc; b=e3htle+Z7SBJzBnOXwAwIBb4Dpl9e/1biAygLL0tqZcgZjn2l07JqHyPZVxZXx1ExH7GDYnf9+dvzxZtPKTBbjpuYNyoF64qH1+WTRrWaGN2zWBvVEkg36yYkbineotNmkjvnXejUxZYAWCd8oIJGvDFUXlTaQeZosLT3XiZ5C8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051958; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7J5rDG5/EYHfs0elw1VWOZICe1bhAnDOgdsBA4H/iS4=; b=Xj/ew0/Uq1Vixwq8FLzanb6Rpf1AoVVVKHkRAqoCKbsy7VR7a3OxY5TP633cJvJoI//eYILpSsGkeMJPdcRFYPaSoQ4nnZKM4NtzUwIU+xsOgrVGcMebtdP0gs53wrWXRiT/tEPOUgdKCSKy8Vm8+KaW5qGCX9nC0HmTgUv6kgc= 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 1787051958049771.9776060105007; Tue, 18 Aug 2026 04:19:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHqT-0003PC-4z; Tue, 18 Aug 2026 07:19:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHqR-0003Ob-Bg for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:19:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHqP-00066q-Sx for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:19:03 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-252-LfwU2R4YO-eyPqoH7JQ8-Q-1; Tue, 18 Aug 2026 07:18:59 -0400 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 2AA561955F29; Tue, 18 Aug 2026 11:18:58 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7E3143000239; Tue, 18 Aug 2026 11:18:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051941; 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=7J5rDG5/EYHfs0elw1VWOZICe1bhAnDOgdsBA4H/iS4=; b=C3E8qJnP8flBn530D4yf5mAFc3cYLgsPgl2eduJkXNBe6X1Gy42kpxWa6jT+Q3MSmEMaN2 JGNFQH18FowoN8Gd+qM274tQbCBqo5e0tJhfM9UO4T6Gt5LafPQUQ2ZLajrRyIHZ0Ldzae YBYWcb6oujCXSGH2sJmICstNw6xZpmQ= X-MC-Unique: LfwU2R4YO-eyPqoH7JQ8-Q-1 X-Mimecast-MFC-AGG-ID: LfwU2R4YO-eyPqoH7JQ8-Q_1787051938 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:52 +0400 Subject: [PATCH v3 25/74] whpx: convert OnOffAuto hyperv property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-25-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Pedro Barbuda , Mohamed Mediouni X-Developer-Signature: v=1; a=openpgp-sha256; l=2570; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=Mn+NBGd5O+Kz+F0i6rOpINobPupnBt+Vn6TD6qzoVJo=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD25/XIwTzrnexCY/7PRcLCO8GpGWV9ylHeZ8 FYCKmkFnG6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uQAKCRDa6OEJdZac 5XWrD/9IzPJ3KtiGMwGUjmI7kRXLMJ1fBSRHr5cyWkE6zId68MozjBL2VbraZoaEqmahkjr66c5 lpa5SBq9kzXOLRNeG5JbSdAI4ALqhCHeO4J/yEVPIzqLWYbFDWEW+76PErxchuZfj2D1mbU38zf 4yn5lMIjwtL8C7f9+fBkHy7FYlSFBAXuG1IzZ5r1Hln8mpkVtsxCgMRmd+cYCIGVBcMzVHSJHxD zJlHH2pnm/Q0hCT/DatEsQnlgKfcxED7e0P2xkdqWV0Sy5e5iThAtrnuVdap0lKwJFxvKu+y/Sv u4KCLQZKT2+g9M+bxfXjjKEu6nqFLDn0/Y5qQ7Nzk8DVT+BE7vtLrsJ6F6KUwGodT8Gaa7/jCDk h86huSuDQurcHdhbi+IRmeD602fflJYrcb4VI/fV6L0US+UBty0WkvT19caDqjbK2EnRhsLwVjX 37gYRwEom8SKv+Tyj6bSdWI8NVA20h6ntnaj2T+cTvuVtwEDcKLukycX2Bk1wF2ZTkWE5IwgH/I mPbfhOHggZjOTFVv3QYx2JSRsW4RTdeKZfolnoCOxrwGyB1lE3Kq75VwNLrxnsnm+5G3ivqS9sD RcBqWGEXjf6ALNjgKh77D4ZfUFX7W7TnWNVBWetRXPFyN2kHUG9Z1nnS8wZNwTmvO4BKRRiwdD7 nodVP1nG5qLAEkQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787051959352158500 Convert the hyperv OnOffAuto property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- accel/whpx/whpx-common.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c index 247e12db8128..187938c02b51 100644 --- a/accel/whpx/whpx-common.c +++ b/accel/whpx/whpx-common.c @@ -22,6 +22,7 @@ #include "qemu/error-report.h" #include "qapi/error.h" #include "qapi/qapi-types-common.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qapi-visit-common.h" #include "migration/blocker.h" #include "accel/accel-cpu-target.h" @@ -470,18 +471,11 @@ static void whpx_set_kernel_irqchip(Object *obj, Visi= tor *v, } } =20 -static void whpx_set_hyperv(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_hyperv(Object *obj, int value, Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffAuto mode; =20 - if (!visit_type_OnOffAuto(v, name, &mode, errp)) { - return; - } - - switch (mode) { + switch (value) { case ON_OFF_AUTO_ON: whpx->hyperv_enlightenments_allowed =3D true; whpx->hyperv_enlightenments_required =3D true; @@ -497,11 +491,7 @@ static void whpx_set_hyperv(Object *obj, Visitor *v, whpx->hyperv_enlightenments_required =3D false; break; default: - /* - * The value was checked in visit_type_OnOffAuto() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 @@ -533,11 +523,12 @@ static void whpx_accel_class_init(ObjectClass *oc, co= nst void *data) NULL, NULL); object_class_property_set_description(oc, "kernel-irqchip", "Configure WHPX in-kernel irqchip"); - object_class_property_add(oc, "hyperv", "OnOffAuto", - NULL, whpx_set_hyperv, - NULL, NULL); - object_class_property_set_description(oc, "hyperv", - "Configure Hyper-V enlightenments"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "hyperv", + .description =3D "Configure Hyper-V enlightenments", + .qapi_type =3D &OnOffAuto_type_info, + .set =3D whpx_set_hyperv, + )); =20 whpx_arch_accel_class_init(oc); } --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787051986; cv=none; d=zohomail.com; s=zohoarc; b=dRzMNg5DGHo5XTUauryKn69dsknn8MrDKu/E9JcQ4PewexDPRFaGoxPX7x1epTgfBOixoWwahI7Mp2le+k9/x8bvHGYZiZpqc57H4z2XTvlj/RSQJVJi1z4sJYYfb9U2uueLPFrygniNPBbLvtkhNI9KCbgIY6+5WVuaQqVZD8U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787051986; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=s5rVYWY9iCmv8W08CTUV/9fUk2iuJasytXKRmh76tf4=; b=EEsc4ySaVW9JwAtNOJu6l++6epRWC0NdGspcT3YgEIlDGRVJu844sK9tl32o5Fr0PW2TCZMQkIsf8R06oDVamiC8+/D19e3h0iMQJ0zDfd7lKPVvwr7HvjE9ow7dp+Qna6b10bAq8SxCLE+WQBrSbt51H4oVluZHe6scUuPfetw= 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 17870519859051005.6941282507852; Tue, 18 Aug 2026 04:19:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHqr-0004PI-GF; Tue, 18 Aug 2026 07:19:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHqq-0004P7-OW for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:19:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHqp-0006IQ-3e for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:19:28 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-45-3t_QcM2VOdSoloUN9S170g-1; Tue, 18 Aug 2026 07:19:17 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EC8DF18011FE; Tue, 18 Aug 2026 11:19:15 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2E5221956044; Tue, 18 Aug 2026 11:19:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051966; 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=s5rVYWY9iCmv8W08CTUV/9fUk2iuJasytXKRmh76tf4=; b=blQ38+0Y+v7fLf8Nog+17EqX/Ca9hftXt7LeyBIXEnS30ubkp6Cxpj6A45yv+sZzADCYv8 n8VwXV0vYH8fjPejQ0xMClYfWtmoioxnP2WuQnhwaHcLs10q0Bh01aIlUfdYU84ll0K49n VDwYrpxfCSAo4u9vbm0YHyUZzuSIUdA= X-MC-Unique: 3t_QcM2VOdSoloUN9S170g-1 X-Mimecast-MFC-AGG-ID: 3t_QcM2VOdSoloUN9S170g_1787051956 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:53 +0400 Subject: [PATCH v3 26/74] whpx: convert OnOffAuto arch properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-26-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Pedro Barbuda , Mohamed Mediouni X-Developer-Signature: v=1; a=openpgp-sha256; l=6648; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=FZYNtwQM6zNrQ3eLAAobvVrCX2NhQNihp1W+SoVn5H8=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD25ZV7Or6DBPGZP2BCcVzweRBrRKcWxlo+Zp UopNhAxRteJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uQAKCRDa6OEJdZac 5RCOD/kBmHPzCCUG580wNmuBobLl+gw340ga+nSGsY+tBa45Dk6B7Eoe3rA+XbyNZ3g8XAE45dw Vfobqh1zpgDLClybPr2FbQjkffoU0jct2DHbOYRgv2sfpXE3OgfTeIJI+9Gpicjm21h0ChUjFut 1X48+Y8+cOweTlK4rsYeaB3YLjJ+6nYgpDwgUCUmwjuCDa3OR+hc5GywlXYlyHqXpx/Ryzprm/s rEA6vmSFdxZafLk/NJ577BArr9uQiEfjO+KDwlRiWMvuXuqo1uW+S/1ZDlhkMJ3PHtvelahHpkf mdODvzubDxAqhpBtvQG3VnUuhlBsnQYUtrFYC0zb1mJHX5MK4NLxmwyigHeUjcsuguZk/+4XXs5 s9z2iE4rABoMspf+yXsnq87lr3YqQx+jGsHEXyTrlKp4jIEqhnJV52PNKVdQgGx8gkUoYu0ug77 a3+waRC1sl5DL95yZkb8HFmG6EJIbwqtF5fGw5TxH/SGXZC7WW2k7rH+lHKJhvOeixMcsocAfp6 ULQ+L2Ev03aaJKOWqoAw0EB1mV+4U/sbGNEQVv9oxyF2/Yi9kNHxx/qkMF8uN5yoTdP963cPI2O kaEUc3th2lor5N4rDRWPf4zA3GBx1okM+AjWVmoSCKoCT9Lu5xbY8GkpTPuI5YbFZ3KP/xM3R2L 1h943h97HXFsdPA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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: 1787051987614158500 Convert the ignore-unknown-msr, intercept-msr-gp, and ssd OnOffAuto properties from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- target/i386/whpx/whpx-all.c | 101 +++++++++++++++-------------------------= ---- 1 file changed, 34 insertions(+), 67 deletions(-) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 634d5428219a..bfaa7ace7f7d 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" @@ -1853,6 +1853,7 @@ void whpx_apply_breakpoints( } } =20 + void whpx_arch_destroy_vcpu(CPUState *cpu) { X86CPU *x86cpu =3D X86_CPU(cpu); @@ -1933,7 +1934,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, ®); @@ -2037,7 +2038,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. @@ -2337,7 +2338,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 @@ -2893,120 +2894,86 @@ void whpx_cpu_instance_init(CPUState *cs) * Partition support */ =20 -static void whpx_set_unknown_msr(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_unknown_msr(Object *obj, int value, Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffAuto mode; =20 - if (!visit_type_OnOffAuto(v, name, &mode, errp)) { - return; - } - - switch (mode) { + switch (value) { case ON_OFF_AUTO_ON: whpx->ignore_unknown_msr =3D true; break; - case ON_OFF_AUTO_OFF: whpx->ignore_unknown_msr =3D false; break; - case ON_OFF_AUTO_AUTO: whpx->ignore_unknown_msr =3D true; break; default: - /* - * The value was checked in visit_type_OnOffAuto() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 -static void whpx_set_intercept_msr_gp(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_intercept_msr_gp(Object *obj, int value, Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffAuto mode; =20 - if (!visit_type_OnOffAuto(v, name, &mode, errp)) { - return; - } - - switch (mode) { + switch (value) { case ON_OFF_AUTO_ON: whpx->intercept_msr_gp =3D true; break; - case ON_OFF_AUTO_OFF: whpx->intercept_msr_gp =3D false; break; - case ON_OFF_AUTO_AUTO: whpx->intercept_msr_gp =3D false; break; default: - /* - * The value was checked in visit_type_OnOffAuto() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 -static void whpx_set_ssd(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_ssd(Object *obj, int value, Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffAuto mode; =20 - if (!visit_type_OnOffAuto(v, name, &mode, errp)) { - return; - } - - switch (mode) { + switch (value) { case ON_OFF_AUTO_ON: whpx->separate_security_domain =3D true; break; - case ON_OFF_AUTO_OFF: whpx->separate_security_domain =3D false; break; - case ON_OFF_AUTO_AUTO: whpx->separate_security_domain =3D true; break; default: - /* - * The value was checked in visit_type_OnOffAuto() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 =20 void whpx_arch_accel_class_init(ObjectClass *oc) { - object_class_property_add(oc, "ignore-unknown-msr", "OnOffAuto", - NULL, whpx_set_unknown_msr, - NULL, NULL); - object_class_property_set_description(oc, "ignore-unknown-msr", - "Configure unknown MSR behavior"); - object_class_property_add(oc, "intercept-msr-gp", "OnOffAuto", - NULL, whpx_set_intercept_msr_gp, - NULL, NULL); - object_class_property_set_description(oc, "intercept-msr-gp", - "Intercept #GP to log erroring MSR accesses."); - object_class_property_add(oc, "ssd", "OnOffAuto", - NULL, whpx_set_ssd, - NULL, NULL); - object_class_property_set_description(oc, "ssd", - "Separate security domain"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "ignore-unknown-msr", + .description =3D "Configure unknown MSR behavior", + .qapi_type =3D &OnOffAuto_type_info, + .set =3D whpx_set_unknown_msr, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "intercept-msr-gp", + .description =3D "Intercept #GP to log erroring MSR accesses.", + .qapi_type =3D &OnOffAuto_type_info, + .set =3D whpx_set_intercept_msr_gp, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "ssd", + .description =3D "Separate security domain", + .qapi_type =3D &OnOffAuto_type_info, + .set =3D whpx_set_ssd, + )); } =20 int whpx_accel_init(AccelState *as, MachineState *ms) --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052004; cv=none; d=zohomail.com; s=zohoarc; b=j0h+j/SlPFDlr7d0r1j0b/Sije7KnMfWo0TYORe6nnwCQ9g82ScBe5Kjjfv4wGTDlwJnD3BjL3f3NS2Aei1UCX6a349LyZWqQBc5iF9/WMCufXfCiQdWmuQLbFiK7MYmx+vWO4Y+8gII+jZHlvvvEMZjX4x3azZcx0RPsze7dOg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052004; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QDNDYwMd+sicJrNeQLwCkPpcMo5x0mg7HS77Hu2tB3c=; b=IR1NWLtJRfscYlPWCjk1YZwBjyGnouMKj0ri4rX+YZ5BTmFeiyxuNfAi65gW+W4QBmPEMwfO+WonmeGBXtIs5uxuzp3oKoItctMtrazTB7AYTQU7Zj6lpU7HJWWKFaph7NTwWboj30wld0c6edAsoBKGsubxB6K7Ob+FYz8k9go= 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 1787052004550746.2809432277317; Tue, 18 Aug 2026 04:20:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHr1-0004aZ-KY; Tue, 18 Aug 2026 07:19:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHqz-0004VL-O8 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:19:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHqy-0006Pp-9V for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:19:37 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-615-4NXOhBfKOTm6EoHIlCxb1A-1; Tue, 18 Aug 2026 07:19:27 -0400 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 443121955E78; Tue, 18 Aug 2026 11:19:26 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0B1C43000239; Tue, 18 Aug 2026 11:19:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051975; 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=QDNDYwMd+sicJrNeQLwCkPpcMo5x0mg7HS77Hu2tB3c=; b=hxuSRaKXEMhsQN7wK5x6pjoWsoPoD0hm5bcSuQEQK7K+MVubfjb8xyjWnf3GizW2OD28EF 0sh4JS/YmJ7sQzBu8A4i0UmvO5OYLuG1n/EfrYPK8Kn9tZILfK+yZ9UsZJ7PqcxdRi83Om Hm2ywuus20gld/PfgatkUgPcIQVhI1c= X-MC-Unique: 4NXOhBfKOTm6EoHIlCxb1A-1 X-Mimecast-MFC-AGG-ID: 4NXOhBfKOTm6EoHIlCxb1A_1787051966 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:54 +0400 Subject: [PATCH v3 27/74] accel/kvm: convert OnOffSplit property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-27-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org X-Developer-Signature: v=1; a=openpgp-sha256; l=2729; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=zjd5b/7UtrJcexJ7ZEgc0BXA9ixM3XyWJFnBq9YLcUU=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD2575Wv1PRV/gstnzfaIV8DJyMX6f4BnA0o2 V0T081AAymJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uQAKCRDa6OEJdZac 5f5SD/9mmwoFmzGtRA41397kAHEq0c1NilgNCXg1k6hedDceKppZtBTWOsIL1QMajESJYKSDJtc EBhG0OgSiba22sLy1GIMQ/e39fi9nfqSob+JR247jCNqXs4XL51vh0qm653yZLzW23Ivmy70/VC la/UTJ1Py5jk/S0aG0+8R9fX0A3H8MJdcqWVPKudMagTPuCds6R8i80Vxpu0DIlIdZaC/itgTp2 w3xSmtXVMSQj8FivhFbOjNflUxlAo2rqS5s0uYgj8dmzrMvbhPR4NanB1Qr+cagx5Es96jXBhPQ mMJcmXgAaJQxd6Sy2cC46CIfcieezsjV5YdWe4PCYNbyywiU9cDqEWnSlQkZ4ZatJjXG/LgoDKK D5fXH/riDybjGsNVccRa2oADqz/2I44VyVVKv4qZF0uwRvmzAipJmpnlG2H++nPIdtK01CWEG+B OjEPOFWin/WsybgIyeoZEB9fDfMQnn99GVfOBY7vsn9qPekmODRuFECuWcswRIMkB0GRunzPNAN jzV9tsm0rtY/uy2JZSFK++w0lGhUFK+ORz9q5fY/eJBcyy7fvw52ar7zLhKLNC7LFdsWFTLBLg1 t9qSqTDECNgQbiNIbyrmrC3wKjR+db3NKyJMxGrMK+fdUsoWymij2DabujvrE10WW/RhZT2Khxj zdOZH2TGYaPWf5g== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787052005755158500 Convert the OnOffSplit property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- accel/kvm/kvm-all.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 83cbd120a847..e2cfbcf44046 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" @@ -4126,22 +4127,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; @@ -4158,10 +4154,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 @@ -4278,11 +4271,12 @@ static void kvm_accel_class_init(ObjectClass *oc, c= onst void *data) ac->has_memory =3D kvm_accel_has_memory; ac->allowed =3D &kvm_allowed; =20 - object_class_property_add(oc, "kernel-irqchip", "on|off|split", - NULL, kvm_set_kernel_irqchip, - NULL, NULL); - object_class_property_set_description(oc, "kernel-irqchip", - "Configure KVM in-kernel irqchip"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "kernel-irqchip", + .qapi_type =3D &OnOffSplit_type_info, + .set =3D kvm_set_kernel_irqchip, + .description =3D "Configure KVM in-kernel irqchip", + )); =20 object_class_property_add(oc, "kvm-shadow-mem", "int", kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_mem, --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052019; cv=none; d=zohomail.com; s=zohoarc; b=c72oomtjV2aisk1fz9vC0LbujJM+gOt1c/Wx+F3Qej2vmPibDECVHsmjqbYi0wmn4z2Er8H1Y2D9PvH8s+2P38sFOAjxvMK34WWpYfZUDn7T40qYU7k+cuuI4pFwruOl1ygdx/cxHLDk5SKp5uqliRWDC+tr3aJLYMKFUU2bHCI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052019; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BgmINsOfsOg8avUK0DI3pyw4m6ampH+tq1kvfcER51g=; b=R6AwwCigm4lqIfSVhpqQ+eYTHsdI3fOSNbaXerGyoXJiJ0EQUeiVgqtVLqhbjp1FAwskNUn7LGZCEuXPHB4PmxKD/Pc7ElevzZ/snDU4AI6/eqGiHrJj6MibyjKwVA/ZKvtOG7Q72P0ZD0vFFakqE5kskzUbQV8SByaZxGWrkAg= 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 17870520198921015.355882862807; Tue, 18 Aug 2026 04:20:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHr6-0004ts-7R; Tue, 18 Aug 2026 07:19:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHr4-0004jY-SR for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:19:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHr1-0006Qh-9c for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:19:42 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-111-ozXh-sCWNsKkhnWra_JkqQ-1; Tue, 18 Aug 2026 07:19:35 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4230618002F8; Tue, 18 Aug 2026 11:19:34 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1DA5318005BC; Tue, 18 Aug 2026 11:19:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051978; 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=BgmINsOfsOg8avUK0DI3pyw4m6ampH+tq1kvfcER51g=; b=PGIge7hMDA3J4BUrMGC3WbL9Gffuq9Mc3bXe1UZGYnu5fK1oQWqNtsTxzSC+hKA22WsgGO juo9Mggj1x9W2kGvnySANCOMVZoR+cCBcdDYZ0qdgl/rdHZ/DhXj+lAxgPXYWc6/okSFQw dULTBnpYHA4i+VCawJO1P2vCxCUmL+M= X-MC-Unique: ozXh-sCWNsKkhnWra_JkqQ-1 X-Mimecast-MFC-AGG-ID: ozXh-sCWNsKkhnWra_JkqQ_1787051974 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:55 +0400 Subject: [PATCH v3 28/74] whpx: convert OnOffSplit property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-28-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Pedro Barbuda , Mohamed Mediouni X-Developer-Signature: v=1; a=openpgp-sha256; l=2351; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=65zE86SlpLyxllbMtWWTTzs6HGNGESGG/p9K0JvZjvc=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD257B9I+yL3XL+jdy2Fxp0z7hrUuijwmOOqn YjhulIz1JKJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uQAKCRDa6OEJdZac 5bhbEACfeRhpA+yB82AcG00h15lFvVBS0upoPApnUrXYpXNMPlr1viqsrF08E6eWSuwNJ/AAikx WLYGsyv06bhAg4ctp3dkDgFowVeFoKWU4PUHQOFN5bwYsU8Bn/D2KPucpkz784sn8aqQ3kHth3F hQOgmBobaNoobQaU+zW818tfY47HBsz8kLP9R7FMVvPQhq6KMMzgNhhd8hHhRFFD1wEOG3XZ0Fi 08CdXgp3EiXrPUcil+OaOfoeNORIJMThO6A3xo+xHk/j0ZJk4kBrOHXLiqSWbSEb7QaTf2Wboby gUraRwX/H4ew37RuFzvK1ghZiUfEijBsRQxvPXR6NoJilIoEWC4LwPfTQcfX+GY4MCoKJ+4qQ2S wX7kPh5i8ru+n/ptKy4FLx/TG2TKEGcVALmllfRxMKSq2/4Lr/Xah4tkGfd+mVD5IDWUSZ41XtA 1+cMNh661ev4er67vmec1yX2/tTwR4kHloSM4YQVFqvW7AxpAt2yUHQn7lcjAHfnv6kO7OAOFVl reHsf4fWcIF0zHVGyLItbJat+wjaQi2Y/xPfPZG3qw4hjfTq35shLAoev0J/yTsnCB5IeMz4fgF 5h5pv7OyI+BsGx0Qjoja0L1EsAj0u2q5CNyPG0VGBzthC68EIGysrNZeR6FYE9DwTmACNDFaTLv H7Fyaqa6blIFu1Q== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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: 1787052021801158500 Convert the OnOffSplit property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- accel/whpx/whpx-common.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c index 187938c02b51..5d4b405e56d3 100644 --- a/accel/whpx/whpx-common.c +++ b/accel/whpx/whpx-common.c @@ -434,18 +434,12 @@ error: return false; } =20 -static void whpx_set_kernel_irqchip(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_kernel_irqchip(Object *obj, int value, + Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffSplit mode; =20 - if (!visit_type_OnOffSplit(v, name, &mode, errp)) { - return; - } - - switch (mode) { + switch (value) { case ON_OFF_SPLIT_ON: whpx->kernel_irqchip_allowed =3D true; whpx->kernel_irqchip_required =3D true; @@ -463,11 +457,7 @@ static void whpx_set_kernel_irqchip(Object *obj, Visit= or *v, break; =20 default: - /* - * The value was checked in visit_type_OnOffSplit() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 @@ -518,11 +508,12 @@ static void whpx_accel_class_init(ObjectClass *oc, co= nst void *data) ac->pre_resume_vm =3D whpx_pre_resume_vm; ac->allowed =3D &whpx_allowed; =20 - object_class_property_add(oc, "kernel-irqchip", "on|off|split", - NULL, whpx_set_kernel_irqchip, - NULL, NULL); - object_class_property_set_description(oc, "kernel-irqchip", - "Configure WHPX in-kernel irqchip"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "kernel-irqchip", + .qapi_type =3D &OnOffSplit_type_info, + .set =3D whpx_set_kernel_irqchip, + .description =3D "Configure WHPX in-kernel irqchip", + )); object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( .name =3D "hyperv", .description =3D "Configure Hyper-V enlightenments", --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052018; cv=none; d=zohomail.com; s=zohoarc; b=ABcN0SB12MjJ9lPPW4RLM0DHD6l8LuYUEkpLN5ywzt8jip+vA+apvJvxrlCdJFtxgHkYhd2CDAswfPyuaZ/HaB+k6dsxkfSE57wlt/fwUYu8A8kQBK8S3Tw+fd2wmU5eI+sgoHYGrSuYGPz8OIB45KRNtUBrbIs0ciPdmW7Oomc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052018; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RPcruoiWfQb//Iziqzwy/I1OFm7hs2mQYcnU85gOfKE=; b=Q71kAoTAckF9ON8waDH7fUAd04yCI/xk9lPDJre7xb7SHhfuhAgQYheMALs6ei8CKiB5yZ6edy9oF/Q2wPTwFFk54Y+18/eXqHNS2J8/rLEpOyIQhMtNmMS+jgHqqTKxipU2ObG+KSaxTbxJfZ6HyKrEd4DiicjUL/uCkV2WTjY= 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 1787052018677382.7930784777128; Tue, 18 Aug 2026 04:20:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHrF-0005Vo-0R; Tue, 18 Aug 2026 07:19:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHrD-0005Ml-Bj for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:19:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHrB-0006Rs-GT for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:19:51 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-496--4WA-pPjNvyx08r9Mi5Wug-1; Tue, 18 Aug 2026 07:19:45 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 516DF1800848; Tue, 18 Aug 2026 11:19:44 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CF4D5434; Tue, 18 Aug 2026 11:19:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787051989; 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=RPcruoiWfQb//Iziqzwy/I1OFm7hs2mQYcnU85gOfKE=; b=cIcqH35F7T8it2YGoZ0dClMRp2TUHAgRdaG5foGY8hZLOK6xJnGkqNy/M/LPqsbPoC9XS1 /7pUKaUA2U1kXW3cH4YQhAStOfXHP/Qlow2Xz1edUlEKu7yik9E3lhn3de+QoP7W3EGT9K +yLBWuUphVA/ML6yAgQTP46babbwADI= X-MC-Unique: -4WA-pPjNvyx08r9Mi5Wug-1 X-Mimecast-MFC-AGG-ID: -4WA-pPjNvyx08r9Mi5Wug_1787051984 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:56 +0400 Subject: [PATCH v3 29/74] ppc/spapr-caps: convert to QAPI-aware property registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-29-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Nicholas Piggin , Harsh Prateek Bora , qemu-ppc@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=6665; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=MtxWpL3jS0tdQScwSXFQevx3JX5MXkf3XyZVu0dDl2A=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD25jZ7WsY131VjwGBtmLX3X/GYVlhUtgCset uZhJrIpvm6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uQAKCRDa6OEJdZac 5TQuEACuKEsnufgLrsGUd88zqzZG2J7GOmY0I6pzudN94/vv2zAFk6xFN/Oq9GrIxul6c7GLdNx bvocmxovi9zgCbd1J/fx+cjrNHfkX5g6OqjYjJ+lDpCM9kCRfc8hqh+JAQ8M3kH1R7DirhZ3ZjR BCPvMb+nhjBgXrYtO6vBbGsHDKVk8O+p+4NcmMKP1zIOY9de8EX1UBlfMHLte2Szm9NL8mANY8p sO+k424iTnEfnLfGjQVZyQMDHNDRmHpf1xI3Ks2Ai7JD+WaMT+sQHbSDUrgABrTMnwJ+NZke6/S 1YjMagieSTZQBjv+4EBgzH/WiL8RAvsClkKvypIteWJIirl45e5WfyPdtBQ0cUoy3K3LvBtFtNk /3VRT4pzBS2vM0zE42XBunbuCzPL8cbRZIHTqXZBjAFe0FX/xq8OUw/br73MfsJFO8uwqk5MD34 BPoG/kET63x48RjHjEFQ9h71yu5jQYDdg+VYsPnq6PYTj7kdTrgEkFoIAOYIcfT3xOCuEZGQtWP 0OPd4DRD6AUlaMbOVLSELxEjQHrDd6Zeg12PIDvjZ4CWHbSrNgmBlK7W7eaXOoLrs1hI9pwm7Ld UU7UIT+tiW9ThG5pTJBYQJP/ZsGjuxW0XcZNyJQFqRA4+rbmBZrCOKb1kCj2O7aU7HrwXSrf1lR JTDw1kMiR4omMjg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=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: 1787052019938158500 Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/ppc/spapr_caps.c | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index f4a26a85b504..779a5605a8ff 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu/error-report.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "system/hw_accel.h" @@ -59,7 +60,7 @@ typedef struct SpaprCapabilityInfo { /* Getter and Setter Function Pointers */ ObjectPropertyAccessor *get; ObjectPropertyAccessor *set; - const char *type; + const QAPITypeInfo *type; /* Possible values if this is a custom string type */ SpaprCapPossible *possible; /* Make sure the virtual hardware can support this capability */ @@ -725,7 +726,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_HTM, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_htm_apply, }, [SPAPR_CAP_VSX] =3D { @@ -734,7 +735,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_VSX, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_vsx_apply, }, [SPAPR_CAP_DFP] =3D { @@ -743,7 +744,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_DFP, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_dfp_apply, }, [SPAPR_CAP_CFPC] =3D { @@ -752,7 +753,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_CFPC, .get =3D spapr_cap_get_string, .set =3D spapr_cap_set_string, - .type =3D "string", + .type =3D &str_type_info, .possible =3D &cap_cfpc_possible, .apply =3D cap_safe_cache_apply, }, @@ -762,7 +763,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_SBBC, .get =3D spapr_cap_get_string, .set =3D spapr_cap_set_string, - .type =3D "string", + .type =3D &str_type_info, .possible =3D &cap_sbbc_possible, .apply =3D cap_safe_bounds_check_apply, }, @@ -774,7 +775,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_IBS, .get =3D spapr_cap_get_string, .set =3D spapr_cap_set_string, - .type =3D "string", + .type =3D &str_type_info, .possible =3D &cap_ibs_possible, .apply =3D cap_safe_indirect_branch_apply, }, @@ -784,7 +785,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_HPT_MAXPAGESIZE, .get =3D spapr_cap_get_pagesize, .set =3D spapr_cap_set_pagesize, - .type =3D "int", + .type =3D &size_type_info, .apply =3D cap_hpt_maxpagesize_apply, .cpu_apply =3D cap_hpt_maxpagesize_cpu_apply, }, @@ -794,7 +795,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_NESTED_KVM_HV, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_nested_kvm_hv_apply, }, [SPAPR_CAP_NESTED_PAPR] =3D { @@ -803,7 +804,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_NESTED_PAPR, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_nested_papr_apply, }, [SPAPR_CAP_LARGE_DECREMENTER] =3D { @@ -812,7 +813,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_LARGE_DECREMENTER, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_large_decr_apply, .cpu_apply =3D cap_large_decr_cpu_apply, }, @@ -822,7 +823,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_CCF_ASSIST, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_ccf_assist_apply, }, [SPAPR_CAP_FWNMI] =3D { @@ -831,7 +832,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_FWNMI, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_fwnmi_apply, }, [SPAPR_CAP_RPT_INVALIDATE] =3D { @@ -840,7 +841,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_RPT_INVALIDATE, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_rpt_invalidate_apply, }, [SPAPR_CAP_AIL_MODE_3] =3D { @@ -849,7 +850,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_AIL_MODE_3, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_ail_mode_3_apply, }, [SPAPR_CAP_DAWR1] =3D { @@ -858,7 +859,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_DAWR1, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_dawr1_apply, }, }; @@ -1069,9 +1070,9 @@ void spapr_caps_add_properties(SpaprMachineClass *smc) g_autofree char *name =3D g_strdup_printf("cap-%s", cap->name); g_autofree char *desc =3D g_strdup(cap->description); =20 - object_class_property_add(klass, name, cap->type, - cap->get, cap->set, - NULL, cap); + object_class_property_add_qapi(klass, name, cap->type, + cap->get, cap->set, + NULL, cap); =20 object_class_property_set_description(klass, name, desc); } --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052031; cv=none; d=zohomail.com; s=zohoarc; b=RgLfv8NLNZtLUnDqM8WKwtbMHMh1rpSFYYNI+JLqujEEzzocEBjWfGjkDU+nXrabFQZHqCOJsK1EgWt22bZcy02w5RtS8//J3JQJtOzn20zfXFuH/Jo/ZPsudq6lTLLMQ316TbL4+jboFwO3+Hym/F/+7Ur6Lkyzlp5EVAiY5gI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052031; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SeRCGmLRaLKDeH+pxowsENnVfHdji1qJ2jHp+Q9raIk=; b=BmSJQsNi1cLfpQAFvHrNnohtGkTnZW79ZMwlBo4X04KBQYeGRW2uLAcLXZeIS3/hViXSWOxwNIbAWnUZX+nlZCiA2doyY+jkK8lIYu3kTKxDTTDBpENWQqTk3b3OqsnIIxfvAS9/uhSC7kjbLRKSSnH5K+ZGzRuMDaAJkSLasWQ= 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 1787052031043868.9033417250466; Tue, 18 Aug 2026 04:20:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHrf-0006Su-EE; Tue, 18 Aug 2026 07:20:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHrd-0006Nj-5a for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:20:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHrb-0006hh-QN for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:20:16 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-688-p9xpunObMz-G2Hn4M_G40Q-1; Tue, 18 Aug 2026 07:20:03 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0B6E7180049D; Tue, 18 Aug 2026 11:20:02 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2CDCD1956042; Tue, 18 Aug 2026 11:19:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052015; 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=SeRCGmLRaLKDeH+pxowsENnVfHdji1qJ2jHp+Q9raIk=; b=CYUPM5xAazB3dDAVtU9eTXGf94UJcSQsvL3FBdlZW7zDzXJPVfTe/XRM6d7s90fomGT/Pl LeGuUgSBTUe73W6lWsf/7gzDYzysEvgpa16BbtZLBRTaMmPK6m8Xs2KGlRn0IAVSTy1U6P ss58snT5ZI2WoaWwAkSlBfw9lJ48Ea0= X-MC-Unique: p9xpunObMz-G2Hn4M_G40Q-1 X-Mimecast-MFC-AGG-ID: p9xpunObMz-G2Hn4M_G40Q_1787052002 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:57 +0400 Subject: [PATCH v3 30/74] system/memory: fix "priority" property typename MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-30-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu X-Developer-Signature: v=1; a=openpgp-sha256; l=908; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=mI2IUxmCqF4Ty2FSFGECDQoj8Lj8y7mQsMNWDLxQYuk=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD2540DO57Mpjuj5UDbwpmwJGgctHxkop4VnA UTgRPr7ZjKJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uQAKCRDa6OEJdZac 5eaiD/9/AJ1KWHseMwQ6hX00FHhOu5bFtPsY9dqxDkrZzjvrHyzz+KRqezVHpXUWgth3dFNgKhO haMoA1ZvPdWI8nIjMN2WORFuiebCtf9ryVBtoULLPGVFInBPht6KgXh11kRVR9yYg9IGX6tGkjM BP/gF0whWx5ULVqGWU72+GyfS0ZCZV/tWh5ttLmzgISrA56ih1g2bPjiCInUe2TSp4ru4xPs2cq 2Ih3LK5otg/LI8uhAIjN2mBG9dLXsoIegafLhoGoloRNs0t25oA0+5/slHWN8RAgnzMhnh2B6+n z7IsQ/+JCJpEjbrR/SFUueOYleVe27zVWvYeaV+itowzpobjETgAuucbNt8989ZBwz6DDoviHGY /1nZ+ytWx6pJ8sHDSLzlgNKNhG0yui+ypXXt/ZlOihTDFtV/++AFmIxFYAh1VAEzp+JB0OUkIMy rzyo5vhWFhf5oLznpkJ4Kynng/E5GM3zmcTIXGGihCuClk3SGnvMHevbzkHkg0VgPgp8t3taow1 WaZ5j2ppLf+LFi38ljj5vGPqHzN4UjR01ICbg2by3MfYSwq1FiA/j5na8MiHM0qmQ+OvmsuF8Im O+EpiPBmdbzmbFdPxsBCoyinYVi16Zdty8djCEgAVoaEu6JkRu+wNfdZc3+rbseCFf3SITecoc8 VQnOz2CuZ4msvFA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=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: 1787052031786158500 The value and the getter are int32. Fixes: d33382da9ab ("memory: MemoryRegion: Add may-overlap and priority pro= ps") Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Mark Cave-Ayland --- system/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/memory.c b/system/memory.c index da710bbade1b..164c18757f8f 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1318,7 +1318,7 @@ 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", "uint32", + object_property_add(OBJECT(mr), "priority", "int32", memory_region_get_priority, NULL, /* memory_region_set_priority */ NULL, NULL); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052035; cv=none; d=zohomail.com; s=zohoarc; b=g9DtGvJdXmMjl7mJgmBy2v8ku5sKpZpxO2j95bZ7YPmcoP2ktjMrmi2333PTWxOIPoBdatq0hhI2RzIG8zFJ+f6Fcrhm5cVJeZ59Pep28ZAe/okKSFaMtH3VQmHGiXQ0AiEaLMav8FqBiRuS7GGW+sype+9iUR886ExqgzNzOdY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052035; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gbpKbIyL8tSDevf3zlwRUlxseo4SZM5m4N1usht1sFM=; b=LSFbCg+1ChnLcHSAMDUFXLeItvixtvhGCSlDYHiPAFiWTajccH7J8L6wHk5SLjdjTpKzKP39sAKkSsQZuWqhbI7iBqLolhrRjZN6+4xgC/qweBbdvGTxlVtBmIrvA4lGM/wn+8Tg475+T0eDKpV8Vv+UAlDaWVQAnggpuwiE2c0= 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 1787052035682433.95114806777235; Tue, 18 Aug 2026 04:20:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHri-0006ZG-Ob; Tue, 18 Aug 2026 07:20:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHrg-0006Xx-N0 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:20:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHrf-0006id-Am for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:20:20 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-644-gJ86pOdZP8W_GO4c7v1Lkw-1; Tue, 18 Aug 2026 07:20:07 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4D302195608E; Tue, 18 Aug 2026 11:20:06 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5019C434; Tue, 18 Aug 2026 11:20:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052018; 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=gbpKbIyL8tSDevf3zlwRUlxseo4SZM5m4N1usht1sFM=; b=XupvfaBGfWSv75UEKm7m1pXP7YOt0NZHKeQ0D8crjyrEZkYqAHqoZtmv4Fgg55+1z7FIIP aLX/KOhgbBPk8udOpyX/vFCU2T4gBq9A3Ee8cRvwRVP7OdkVKOygpB5ve5BSh/CBE/4yjt 7+m+v5mE+G1LqZwc7Gghfgfb5Jl6K0U= X-MC-Unique: gJ86pOdZP8W_GO4c7v1Lkw-1 X-Mimecast-MFC-AGG-ID: gJ86pOdZP8W_GO4c7v1Lkw_1787052006 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:58 +0400 Subject: [PATCH v3 31/74] backends/hostmem: fix property typenames MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-31-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Hildenbrand , Igor Mammedov X-Developer-Signature: v=1; a=openpgp-sha256; l=1407; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=C/Qe1xmfvc0qQvmF4aSB0ZNKceuJzHRadp8hB488LIw=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD25vxuX7hdpSaM0QLo1sokwbhi/FfduiZIv8 MP4rKszpG2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uQAKCRDa6OEJdZac 5VdTD/9xVRATWB8+1QgwOaz3qKuZ+eOTqc6r0yEnZmFUiC5lFnSw2eiWa2rFpVOa6ODJmMGrktE TM/qaJYk805pfa4bWArMP/IL3UP5I4oAz3bluGADCUimVNZ5b8ZjsfHdtEXYgFLFXOlVApjF5oz fdJ8nGna/0BSvNuChXZ5vlYjlmOT275iskAMYu0VTR4Rkk6NtFWnSnL+crTR72qXZ1IF4RzRj1l B548wOWhuEG899BxInbhdZ1fA9C+JqDBUeo8OPHtyADxzD1zkRf3XKrPv7sZmLYNuPnCUus31Ph ZQTH+lN1wfIY7B+YSp2yXW+4KbpqaTSPTjJ/qruDXiCZrvfVacwWZjtMdbggRKKCYLyaRMBS7xH XTclbcQILzT5YDT31tZ0XfHGCGfqUGS1B3h59xxYkzd5+D4pBGB/OIjWWWBNMtIWILsriuFsb9k IeEIVRi8mAfq+oQV7wWgCBKXtNrGPp7qn3kJkcXRs9+jiHCFdG9/31dK629wbZtVxhTwQQ+YM6m NxVF4Q8y5o4JrfSKYhR8IYi2RURBkZiSXBaU5dLzdLUscXOnRX30Br9L9yOYNnQqhYj451Vos6K DPs15IkBRZgXwCVxBCTXFMm0TbhOdeLoTKFRc5tXyU8q7Q/iCNWSUd6f+ml3FnqumLybpKo0/Ke OI62Mh7eoNw5Pxw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787052035791158500 The "size" property uses visit_type_size, not visit_type_int. The "host-nodes" property uses visit_type_uint16List, not visit_type_int. Fixes: e62834ca62a8 ("hostmem: Register TYPE_MEMORY_BACKEND properties as c= lass properties") Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Mark Cave-Ayland --- backends/hostmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backends/hostmem.c b/backends/hostmem.c index ce82958050e2..e7f9b436a459 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -540,13 +540,13 @@ host_memory_backend_class_init(ObjectClass *oc, const= void *data) object_property_allow_set_link, OBJ_PROP_LINK_STRONG); object_class_property_set_description(oc, "prealloc-context", "Context to use for creating CPU threads for preallocation"); - object_class_property_add(oc, "size", "int", + object_class_property_add(oc, "size", "size", 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", "int", + object_class_property_add(oc, "host-nodes", "[uint16]", host_memory_backend_get_host_nodes, host_memory_backend_set_host_nodes, NULL, NULL); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052027; cv=none; d=zohomail.com; s=zohoarc; b=hplqQU3GKjxyAU62cUXlAYhWd7Sqp3aFWEgtYoVKTupyyH4cWY7VaRDjBzJ1ONMOM7Jd7Bmhq0dyS9p/bMEQQXRGoGap8KJboreqOKMHq4GSYj/Y/sh3JnB3DxgnncEJsQdU39k4G9V/H2aKpbbrfcd/SqR7mcy1AeBo2svO4Gk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052027; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3EeAJceYlgEHPn5rZ7Ch0GVKDUfnI9lHjds0xq0+jCA=; b=TNFSa57q1KR3GVAlkP55OtfzdIMBOX6yzZaOc/6T7nic9U0oRkWeCkYPwrirYoF1LjnLBAcbN7wrx/Gn1X9liTvOF91JOaWpN/Wmr6B3XkYNup21hrMXN73/8Fv5KRq2Vj376QLnvpL/ODxHWNt9b8SRDByRJxbbwJ8VRl1/PJc= 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 1787052027763159.61307115654665; Tue, 18 Aug 2026 04:20:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHri-0006Yp-98; Tue, 18 Aug 2026 07:20:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHrg-0006Xm-Ij for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:20:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHre-0006iQ-Iw for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:20:20 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-686-Dy7mJQhaNiGoXbpIh5te1g-1; Tue, 18 Aug 2026 07:20:14 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3C66519560B4; Tue, 18 Aug 2026 11:20:13 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B8A1A434; Tue, 18 Aug 2026 11:20:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052018; 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=3EeAJceYlgEHPn5rZ7Ch0GVKDUfnI9lHjds0xq0+jCA=; b=X2rgbX+SdowRYHvKglzcn6u5a5UilMdLJa2o2yN+zMgm/HAu2hAgziUbXwdMXek8C3I8hG YZRo2zE8TQ22ajl4g3NqQOoOMRxf+EjvDUQmsgXDH+VY63w4ksENCxinwanTEeddgyntb3 QT1HvcQ9hbb8uNrC/eBzKrEUuZVVaWY= X-MC-Unique: Dy7mJQhaNiGoXbpIh5te1g-1 X-Mimecast-MFC-AGG-ID: Dy7mJQhaNiGoXbpIh5te1g_1787052013 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:10:59 +0400 Subject: [PATCH v3 32/74] backends/hostmem-file: fix "align" property typename MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-32-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Hildenbrand , Igor Mammedov X-Developer-Signature: v=1; a=openpgp-sha256; l=945; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=3OAzBeiuJnoEej4d65hGPxt8kwJF0iyloYN1xTb4Trk=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD25gzgRDSOTcq3hns33Ic0VataMAJNfqb1zG dDAhU/yuHaJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uQAKCRDa6OEJdZac 5TV9D/98irIfyj53vsu4CQQ9BahT4qXupV7apnywBJMrJ75jaAJfej+vzqg17PsPDyKFb+cqytd a3MJtZxpfxsHlQRg0nmKmeBIPtl7Tqv2g6mTRABUQJh3YJHXAp4q7IsF00JTwkYWUPmN7ftfahm Od1eoR/WNAbXvtLoDoCNpasZncmBCZV90Tz4cmTl8CElWo5SbIU9y6j6om4zKjx249aUsprVVBj FiIofNkPo/lHv2HgTnxTYefIa3WHNlM8G6Fi/0PRK1tp4nIUxAQK9YAteYTdT7yjUYyFi9a5ufb 6DDsdYOew8emG6w0LRNXIBUAiAUIpDG5y2+zt+PnDcl/FbuQ9T0TnbxdZSH6vI+3lCTfAo0ZH7y FoejoMdmib9zRmFqZZliIfEjTxus0k64L5OmPF6IDXvOOZ/aocLgrdO7P75ciesfrdCfMN94xVf ft8Ex9FfovY1M8OcmWs1Npsp756mkkkjuFU+H/JBsTKnnC3uS02n/Jx7M2uCvomzbbaJMZUWYQG vm/jSCDhIIQzuBep43gok4KCjpJBrHctGO5SrdK9YImK5Yj+XycOVs4MyxGLbC1OIuzYtynUeaK 56E4N0jpPmMyHi5u0kAvgzv7xQAX48c3G1vkIk5+Z5vpB5sOOCOwm1yEIcrjvSYCXuMJJGtZJ+S /oQG0jfmVEHpJKQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787052029744158500 The getter and setter use visit_type_size, not visit_type_int. Fixes: 983768431676 ("hostmem-file: add "align" option") Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Mark Cave-Ayland --- backends/hostmem-file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 52b62f715334..39a46d353839 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -275,7 +275,7 @@ file_backend_class_init(ObjectClass *oc, const void *da= ta) 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", "int", + object_class_property_add(oc, "align", "size", file_memory_backend_get_align, file_memory_backend_set_align, NULL, NULL); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052077; cv=none; d=zohomail.com; s=zohoarc; b=MeWRWYx4vCR+mf9bdsYlrG3bhG3Or1/gcqdpkzXQvy5rls9NqCVEtmxSgIVXzKPSXAV04pBsSqL2a3a8HobMZLw/bSHdqbHIZnUrlZgJPKhxCjOL5Oxbsod2dxOiEQAT7uCjQtseNLdYdjMYpaTns7LUS02ZpV0bn+QTMTjCVEI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052077; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=S8eiDleDtfrhAgkertOjCf3whXAGLIviACpGTa46lzg=; b=RO6iUp0MGqSN4Q7bbqac31Zd4dB31eh5V9zxjrfR9gQexKn3tdk6DzFL2pKJdNKdOc1DgPzplhQsWsMp+H3x1xzl3DDjx+CyOQfxuCRfQq2/Q0pnZgfTvJFPu52LgSjTdin9KJm7JAYqPxwXvZEZ0a1LKZ/7XbOQfd1N+4BBWV4= 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 1787052077516747.5724761654335; Tue, 18 Aug 2026 04:21:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHsQ-00087h-Vb; Tue, 18 Aug 2026 07:21:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHsP-00082Y-3s for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:21:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHsM-0006r2-Hr for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:21:03 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-662-Ura1zaYuOe2bIq2ByB5IXA-1; Tue, 18 Aug 2026 07:20:58 -0400 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 8248C1800876; Tue, 18 Aug 2026 11:20:57 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BC0DA3000239; Tue, 18 Aug 2026 11:20:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052062; 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=S8eiDleDtfrhAgkertOjCf3whXAGLIviACpGTa46lzg=; b=GUbx4MW9O6/YK751EtlAKdTSGuVmEmzhEygruClvRRpPHtmWGwGL+S+sLFy53H7SlGSB13 bfu2iVY8u8wbTP8k246AvwdML9RlPE2vL7l9hKzPqFOPbSLWzaxpe8n/L30JLM5sH/u/Un eTeCYpP1LDK8Z6B8ABS2zAuCKpxYIFE= X-MC-Unique: Ura1zaYuOe2bIq2ByB5IXA-1 X-Mimecast-MFC-AGG-ID: Ura1zaYuOe2bIq2ByB5IXA_1787052057 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:00 +0400 Subject: [PATCH v3 33/74] accel/tcg: fix "tb-size" property typename MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-33-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson X-Developer-Signature: v=1; a=openpgp-sha256; l=915; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=r7jOmDM2VfKk4c7CwaQ+PlJRgw9qCSE15EwVLQ1TMuE=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD25Q4pW8nt8zaG+gYoKqelk1XnPAWTyng9Ac h9FNWL9LWeJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uQAKCRDa6OEJdZac 5feWD/9t7gx2BowdvKHH2Kwjro0NpFzvHK4a0FtiFaHP9LVhs3/+N386onWPLOnGiwtkP38Ui6m UKzSBTc86p0Tvyeq1iUcZG/RGNN1vWwFmk9vHr85mCnHTmX/0jLuZ9mTj0Anm042zEQT7YLxBMm j2Fw7rWWFVyW7PBQUebyPfggRgAUb4abEd13TRMKvmg5Z8vpyHIax/5iv28g2BWNfDK276gywg0 8yA1rJbVRWp1Ln5OdADM/D41SrmGGXq2UOFWUP9ODbn+tNMOS+MNeHmHOaudTonQXHZkPf0yrWo c1Wac7nGVJJ5ev5XWaIYrbNvH9AsPI2BEnoSNyALQZq8w2nqnToAbFEneydN2TlBzzqN7AL0UsR ffF8ILFjvPGzf6/KNEjPAFp+CWhJgiAxA7ulcPNwmYMB+i3xXVNys5QDIyWs5YRqTIr9mk/B3xG sj6SsmvnXX+x/stLicmtHRHekADdybbni4EwzQW7Zj9AJ8p+5YxnXrkXWnGRF6EvGHztpmq7zuB EqWp2njgvKcoXvG8lQVdaTlBmkW1yKKkDrmJedsr9FYsvLkNu/GBreXeg2ZcfA5DUCLe3+lCc+R GAjKEBiNSnY+1ILUP5UJ/C4jZ23341nQ06Qzd63FtNWZcFTraFfcfSx8q5jIjksPbeqZCorvqPz p9HKtpebyW37zZA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=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: 1787052078080158500 The getter and setter use visit_type_uint32, not visit_type_int. Fixes: fe174132478b ("tcg: add "-accel tcg,tb-size" and deprecate "-tb-size= "") Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Mark Cave-Ayland --- accel/tcg/tcg-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 7186c10cf022..767e8805552f 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -270,7 +270,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", "int", + object_class_property_add(oc, "tb-size", "uint32", tcg_get_tb_size, tcg_set_tb_size, NULL, NULL); object_class_property_set_description(oc, "tb-size", --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052077; cv=none; d=zohomail.com; s=zohoarc; b=BJ6sTzmh50f4y0sLRQ4/hTmyip6AfYq7lEayKbTp+DovOv4lJZ+Sw7crHmANylFlkGmCCnSmFsD5tdqC0uWNmNkO03p2h0c3f7/BfSMfSvJtenKH5fJqf4RG0rTwCz1kLWZjnY7TJYl3hSdzxWbRDonIrrNEx2MxbPgL/LnDevo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052077; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0URW6lR2/KJPf73MAYrbfLbEJWbW2eS1XoTE23ePLqs=; b=I0JZlnzh0F7ifLvEmsNpBOeIKAvUE7Y6UqLkxL95yEpV02lfLKAWIjByAjyyrs7Sd94EnfGZb3FCdhYBzrM8O4xEJD9KHjRF+IsQiuLq33Muyv90ydRAl8zVmJfi5+al0AFRUGlOT0RsDBqxsWtGY0nJ5qXzYy9TRe4RDhKUlYY= 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 1787052077552219.01428804854982; Tue, 18 Aug 2026 04:21:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHsU-00089M-Om; Tue, 18 Aug 2026 07:21:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHsT-00088S-92 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:21:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHsR-0006rb-UM for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:21:09 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-690-yZ3h20rNPZmfMtqInUUAYg-1; Tue, 18 Aug 2026 07:21:04 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id ABBDF1955EBC; Tue, 18 Aug 2026 11:21:02 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8CC041956042; Tue, 18 Aug 2026 11:21:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052067; 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=0URW6lR2/KJPf73MAYrbfLbEJWbW2eS1XoTE23ePLqs=; b=Xi1FKE9d/RzF9MqA/OOm3AsG+/7yn09cD2Y86Y4vbHye2+GZNL0au85HN77kayoMOBk9+e LoPGPigZ3XdgNxGr0KD/2Kd92dcmyipFdVIUFT0W+KP4QIVGJbC+pbTqMEANJN27JurFtw FkR1citBu7wVsRM7cD1cXmAUeBVpKjU= X-MC-Unique: yZ3h20rNPZmfMtqInUUAYg-1 X-Mimecast-MFC-AGG-ID: yZ3h20rNPZmfMtqInUUAYg_1787052063 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:01 +0400 Subject: [PATCH v3 34/74] block/throttle-groups: fix throttle properties typename MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-34-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alberto Garcia , Kevin Wolf , Hanna Reitz , qemu-block@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=1011; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=evReDyRfw8wz//025H9xYi0Yy1YbciYVBB+xcZMl5Ls=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD26uQNtSFkmTM8ZcCLfmBI1tngz0+bI4gqDd v9ruaOr1OGJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9ugAKCRDa6OEJdZac 5X7MD/0Wa+/YtIf7IUoDU8HFQFQD6dyz0wno+CtLkzVNydFBfAjxafr3igytJPNRFnSYKMbplIg GOFhxv56S8vgWwI2E+7aHFB6HRLBPqfreWrx3vPWgG+Sklf4SnRXo3mfyUZOGwZ9SEo5BfPH5DT /Rtz5F2hb02g6cMgizsE86+GzYr45GGbArG6TipmjZ8yzklCoU7unjOdzG8QvYm99UwOsE3/DkB Y8kGYzCz9d1MZHmppRXLe6L4E/Uk74XJUxQW9i9HT97OH7P32ynZVmV9zKW62LbNbk2Li1C9yEX Im0hPBd6L9NnAw4AfKrDe+kEfTn7+I4KIMRsAqRJricRufbMy99+yx1bh9ri+9dhY3GNsZhKRQp IBiFrkHaSEoVKNg2+MuIvCnt2es824WFji6huLBosp029Fg9dmaLdYNWaJA2+K8OqVhnbCsorzi zlDtjZS3y4oQ2X601F2X6yJipd29fGyaaadx2fGYdwxydpLDUNxW8QuVbR3jgjV4GpQvGNZKWBk W5RqS5nzoVTm8E+D6kXnkHa/m2+AiqCpmVvb72gu0ZlYxNoKduI3Z5dKPVg3cwK5LJzp4I2mTx3 bidWgfMIdTCY5yvPCR+I59nWCag14fY+sMTWiDvarf16gahpyAT9FZQ5vmUZnp0DkZ6Y3mnGa1c ZS2tRXRUGutGuTA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787052078267158500 The getter and setter use visit_type_int64, not visit_type_int. Fixes: 432d889e55e2 ("block: convert ThrottleGroup to object with QOM") Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Mark Cave-Ayland --- block/throttle-groups.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/throttle-groups.c b/block/throttle-groups.c index a9d3aea3b54e..6312157802da 100644 --- a/block/throttle-groups.c +++ b/block/throttle-groups.c @@ -985,7 +985,7 @@ static void throttle_group_obj_class_init(ObjectClass *= klass, for (i =3D 0; i < sizeof(properties) / sizeof(ThrottleParamInfo); i++)= { object_class_property_add(klass, properties[i].name, - "int", + "int64", throttle_group_get, throttle_group_set, NULL, &properties[i]); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052098; cv=none; d=zohomail.com; s=zohoarc; b=hF9vhrSC0OeuMo29bKMBDU5L6unCacQfR9/a/HENXb3Aik/ltmphDwnOdzKn6VbBXb4ethmmbOTg+4tnM+nPTksulNfl5shVl9txBvO0iU9J8MmYqh01Gqq53YF/jdm/pGaJuFThrooaEv94yJoNhhLD/Jqde2jcOvzeTC/EIww= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052098; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EZA3KPMz1QXwmqifrxmnrE29bxYgKf9Omr/fvy5gJgs=; b=EKRLlcbRJ2lWIhlJchINBSnXI1OB/ToISURbOKPLGryaGcX4sDaRfQXT2dASy0rgS1J9P5kuvOzHYjBelz66m4fupIgtoFANtVZSQYeOz95MtHw5YiivSO7uk0KN8/k0OwB0ooUI+aAy5Co8fPizfWVow3DahmyTHpYuZGfs+eQ= 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 1787052098455165.4884776125857; Tue, 18 Aug 2026 04:21:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHsp-0000Ui-T1; Tue, 18 Aug 2026 07:21:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHso-0000U1-SB for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:21:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHsn-0006ta-Di for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:21:30 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-5-tyrdwvFyNVyg5QJlIbTYUw-1; Tue, 18 Aug 2026 07:21:13 -0400 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 66CAC1956045; Tue, 18 Aug 2026 11:21:12 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9458F3000239; Tue, 18 Aug 2026 11:21:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052088; 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=EZA3KPMz1QXwmqifrxmnrE29bxYgKf9Omr/fvy5gJgs=; b=OyyZvYTl7H85mBdJw7JEqjzO9GV9ZG1OU7b+e/zuC63o6ZD3d+JRKjp9zPF77wY7oLtNxT Lp+JTdcSnen5V8xG8tgeu3yX4mIDehNwPjRzNhUWUsCBLZZCWpJoMe6LoMWOcHggakSdg2 MCED8+2wvo52bg6QrI/hT84js0eY4YU= X-MC-Unique: tyrdwvFyNVyg5QJlIbTYUw-1 X-Mimecast-MFC-AGG-ID: tyrdwvFyNVyg5QJlIbTYUw_1787052072 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:02 +0400 Subject: [PATCH v3 35/74] event-loop-base: fix property typenames MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-35-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1585; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=RblZf+pyuoem1W7YPJoezx9g55FQPa9o/5iSTsZYsn0=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD26e1wvNfwalMPuqlHXHVDXDby5vp74X4ff+ lv2t0o+lfOJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9ugAKCRDa6OEJdZac 5frUEAC2x6ELzJKIJS6poWM7SsB9KlI4+pHfJ7FOaXJFJxyE7eS/5wUyQZVYShXOE8PwLQIopDP fKL2Ljk/Y6kvxO3HokBsmh+X5nJztvfjod8l8MhvU6QZp/lK56UoeNpESG0vziuffbyaAzOAIyE aqKFhib5dMW5DHtcorcH74nlgepSzU519QRnx2NIVVbr2u/mQYw9kmkHttJ5kxDuQZIBZ1YHcYA 9ODl//VyitcQ8pV9yE7SAwgFF/1bWxQd4Hbooe3KdsZVZkhjedaSsSuHyhmxEZYhMTj/QRrc8OP 5u6SJ7+epwrz/5jZSLJLPt9HTQKchPged+FjA0/eSjqeRePELAHmhsf6h0Fe7mvkqx7A36ebRUc /O6DhPbMkm98EKtIGYmw99+V4o7h1AJUbk6VSYp1Ko4yRgHyHWYO+g+fWiGRcW1kmfV3niivxBu 4XMrHqgqglLz1JmVcat7T6zYetL2IDTNDrt1gtBv1bGiRVWKR25ydSxWSf504KyJ3zZeUtsVa+0 fRtO/fnqleZCfGoAE9JTQkt3R5ww6Vr5kwkdKl20AI0C9gG7F10zytgUyq7i/KsnwuzCZzpOVIM onm/4Q9bDIAfgqcjYZHTPZlscLFukB0zpBYh2rlh5LkinN/qodA952pqqcaE5eie0c8TzSzvQ4E 16kWbGLg01yW+Iw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787052100214158500 The getter and setter use visit_type_int64, not visit_type_int. Fixes: 7d5983e3c8c4 ("Introduce event-loop-base abstract class") Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Mark Cave-Ayland --- event-loop-base.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/event-loop-base.c b/event-loop-base.c index ee5987ddbf64..23f554d92ce8 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", "int", + object_class_property_add(klass, "aio-max-batch", "int64", event_loop_base_get_param, event_loop_base_set_param, NULL, &aio_max_batch_info); - object_class_property_add(klass, "thread-pool-min", "int", + object_class_property_add(klass, "thread-pool-min", "int64", event_loop_base_get_param, event_loop_base_set_param, NULL, &thread_pool_min_info); - object_class_property_add(klass, "thread-pool-max", "int", + object_class_property_add(klass, "thread-pool-max", "int64", event_loop_base_get_param, event_loop_base_set_param, NULL, &thread_pool_max_info); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052092; cv=none; d=zohomail.com; s=zohoarc; b=cQ9yuxrNYYQ9uV9rKB+nJ4jLJbHYb/5ogCDsehekujplygoJBStsTXDW+ROuKHYCUygBGpxX8Yf+C0dy8JsalazKnEnQPdtOlNQiltoHsrrKjTzYop6ZS2Jd/dTzKiKWB3ruPgFuFNYTJFEvu4dOChBmIiHLIqAx5h3UFY1UAcw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052092; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=52B+cezrQHzT0zd35ucqxSU8iLa7FBbZbRVCJ0ZJ2ig=; b=M0fll9v6wr9tWL0lB6C3E5czRvLoR4KGkXcx0mZsxKvQBjq1l//keEVbdW2gE/NYXvjMsCnMOwauyPsklUQu6CM3m+G57irvLETjuly9Z8zdz56e+WVe7yCoAwrhfOLaZvyghn/FlyAeIpGHgSPUXggkHC4rwmdft8KjtLEw7Kk= 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 1787052092911367.25159465589206; Tue, 18 Aug 2026 04:21:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHsn-0000T2-GD; Tue, 18 Aug 2026 07:21:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHsm-0000Rj-70 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:21:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHsk-0006tI-T1 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:21:27 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-684-uzK2xJKUOom0G9WtHCffoA-1; Tue, 18 Aug 2026 07:21:22 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B1AAB1956088; Tue, 18 Aug 2026 11:21:21 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A24FE1800346; Tue, 18 Aug 2026 11:21:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052086; 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=52B+cezrQHzT0zd35ucqxSU8iLa7FBbZbRVCJ0ZJ2ig=; b=CFIKMG5KWMDkSFgi4v5mo3pBlYGKIje86GT4PMS+6e/Z0EzidiYc66uvGw+dWIJ4GKKxNe Xm7Q20hP95THxlG+EfwFqalDweHvmt5yKP4xeqifUuQb2jCfL7Z1lj0aeXwEimHGBtzFzE 5JV6NPE9TB40qPyockwzVkyjpLyO9sM= X-MC-Unique: uzK2xJKUOom0G9WtHCffoA-1 X-Mimecast-MFC-AGG-ID: uzK2xJKUOom0G9WtHCffoA_1787052081 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:03 +0400 Subject: [PATCH v3 36/74] iothread: fix poll properties typename MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-36-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1792; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=yUhjsAWjAjI4UlFAo1X5XNJdCst9OFyK65nGBG7/6jU=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD26NIta3Uq7OL25Ayo6C8UwGyH2ojOi7AgFH qYPeUZ3us2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9ugAKCRDa6OEJdZac 5YXWD/oDSq8Aw08vOn5JX/33YY7IO6wXjo9g1xV8VaAvhVK0iHKK1FzkoleSrCqMyoV3ykUpaYz cpbJu56nLVTej32NeEoVot+1+Kt4O0B/ARNl7Rge6QtNEYB9Q4Kzsdd+07NGZXXB02rQjA/V9g9 8r4ONuLRLl+lLLUnBCMIgnQq4PlyouWmJnVe2MQvBBlRblZkmgRum6C8cSvARFFOP3MgyuewCHW 0c3OpZU+pdQ0tBTCTvCxM3eZOM4t/+SLCsdRSwvEBr4oy8UTHHybMIocAVxyxip5hCZODAMXY3u XsFA+xu3FN1nAaIsjONC5dvlka3vSM7UZIkaZtdu2lF1j6SuSXqaeNxiG3MmvIBxwKkmXdsUZ6W vF2WcBjQiJ0cH68URcznsmPB3EShf1RzqhaqSfVEM6HSQFM2nKaNDOYkOPceLeAAtro+98r42Jv fhhYPDhyCC1IUXgXf14p0nnFNcKnPcHZzZBKbIJeGBT0/9d8g65nN4jEWB/3mF+sRs2eN34Ju38 Xx+YDsKtoKhL1BbrJsdFLzpD1D00krunJYfHussnhxIlQ56dxk7YhLP6tbsEKFPkVKiyGIwevJt S8MoOxKV0aI6KwZEc5Bnsju3h3CkWqirtl3o4YxqhklRCUyvXO8dwGdB0RbyTfnsNYDDBRIg5Cj hWEq0F4iY/Ojmeg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787052094218158500 The getter and setter use visit_type_int64, not visit_type_int. Fixes: 0d9d86fb4df4 ("iothread: add polling parameters") Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Mark Cave-Ayland --- iothread.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iothread.c b/iothread.c index 3558535b40f5..76eea6df3861 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", "int", + object_class_property_add(klass, "poll-max-ns", "int64", iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_max_ns_info); - object_class_property_add(klass, "poll-grow", "int", + object_class_property_add(klass, "poll-grow", "int64", iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_grow_info); - object_class_property_add(klass, "poll-shrink", "int", + object_class_property_add(klass, "poll-shrink", "int64", iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_shrink_info); - object_class_property_add(klass, "poll-weight", "int", + object_class_property_add(klass, "poll-weight", "int64", iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_weight_info); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052111; cv=none; d=zohomail.com; s=zohoarc; b=AU+2BqzDvZf+OBvVAFXKGKaOR/CvfcvMhKunGtCQxntuQDCTFgYJPKZdGXi7qmDI2bBTys8IOyFcBk6QarA1ftdGUJWxD/gyyIqf2hkfUFlvQa4CW29rV0Tknx7yGJFlvX0N8FNe+TzTPECwdr/PbtS/mSDmBMvg8XzFlAYJazk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052111; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=rxfcwqLSIv13a5eubiOp32qB49quLWiBMCO9bEGm5wc=; b=XZ/zoHb8FKg6P94uMyRC0acSrXPtUQx0F/tKqJkJaowGURYbFUtVvGnWasCKxC1B3PogC0HvD88bAOB31RIi+e8VEpffuk/mOocimrtmHYu3lidyiriiukRffje3jbj7bWkVvd60b+2PIJbRbgFYigH/Gi+ViopebxM/trpUp6U= 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 1787052111490200.22121898385763; Tue, 18 Aug 2026 04:21:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHsz-0000uv-Ap; Tue, 18 Aug 2026 07:21:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHsy-0000uF-CF for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:21:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHsw-0006uJ-Vt for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:21:40 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-353-5JmYgCiWP_OhVsZcO7wG1g-1; Tue, 18 Aug 2026 07:21:30 -0400 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 16E351800879; Tue, 18 Aug 2026 11:21:29 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7FCF030002E9; Tue, 18 Aug 2026 11:21:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052098; 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=rxfcwqLSIv13a5eubiOp32qB49quLWiBMCO9bEGm5wc=; b=CsU5SbyAFjQzjpYdUs1Ym//GP6zrdstgy3LGEd0uyyecaXBgnW7H9BdXGMS1axZDEvvVwC WltkHO3bBIMjVa2l6/oAxUG8LLVLsso/bFmp/2UQwKbI5XRzcZ8X+RYmEc7kvZQq0L6wNX Z5ltYZE6/pyMm5cgrWM98lGZjmPJ2CM= X-MC-Unique: 5JmYgCiWP_OhVsZcO7wG1g-1 X-Mimecast-MFC-AGG-ID: 5JmYgCiWP_OhVsZcO7wG1g_1787052089 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:04 +0400 Subject: [PATCH v3 37/74] util/thread-context: fix property typenames MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-37-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1478; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=1CfAaStCFv0hN2KF9G0PH/YVSk9/tPyTQC7lgrOUIEI=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD269vUdsrmRY24anjPThu7pmJzyTUbLT8UDo mAwHmCONbSJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9ugAKCRDa6OEJdZac 5dmhD/sFw+G7pz/ziCP8b8dy+DCvPEfpk9Ih0XVsRWAYVKY9jQ4a1fp8Ewerwp/RD12EbvWUEFC wQC5j2yLsE8cnP/RR4qyVwftC7YpmFw8mD5BhhznmPL10jjROvW6sROCTO2C0hcyT8p631oYWy9 slZaSThXP9ntm7QyImcSrp+uFm5QnSdld6c04GkCB56ym24MluuIiRamIvu9s6dI5h87JDO6cQ1 IW52J8vBnNg76YqbBZzKy2hY9jumvrO6YjNnQsraNnaYLYfmsAeKKtCJAtm4h4nRZLUnXpO03sl 5BdOmSlN6Xp+G0Ha7VwAFhsItdP2BW0NVEQGnl4tZFViOQePQ5ZBZZclclafIRpLedb3/T1hf7V fly2M57rIvMU7k40KNP+m+GitfzBb0NtrJN82hLBIKCj9t0XK8y2XBJrZsydQ76eYSqeSZjOwel UUROVTiiRxplRVOTYf5PEQMwo5UNOHnJ+v+DliVCAyCY3yxGRcGpnxEfNuOmpOyHVvnhzqoOuru oMkbeL4GGrUVx5ivDqBhmjxY1QNKo8GxEjeS3MHQo8eHyi3MpUmAziSbfpUudaN45ZnVzqRVZSS TH5xSLJ9vD3oXXvVvW3Hcm5BpkSuxVgxJ+WlYZft0UQ6dOgKeHOkAfNbNdM0lqikfav4BOFkpbK ipCHsINpod1rNtA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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: 1787052112594158500 "thread-id" uses visit_type_uint64, "cpu-affinity" and "node-affinity" use visit_type_uint16List, not visit_type_int. Fixes: e2de2c497e57 ("util: Introduce ThreadContext user-creatable object") Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Mark Cave-Ayland --- util/thread-context.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/thread-context.c b/util/thread-context.c index 0146154fa56b..88d8f0a55a4e 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", "int", + object_class_property_add(oc, "thread-id", "uint64", thread_context_get_thread_id, NULL, NULL, NULL); - object_class_property_add(oc, "cpu-affinity", "int", + object_class_property_add(oc, "cpu-affinity", "[uint16]", thread_context_get_cpu_affinity, thread_context_set_cpu_affinity, NULL, NULL); - object_class_property_add(oc, "node-affinity", "int", NULL, + object_class_property_add(oc, "node-affinity", "[uint16]", NULL, thread_context_set_node_affinity, NULL, NULL= ); } =20 --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052114; cv=none; d=zohomail.com; s=zohoarc; b=lVWU6EO0zie05VfMgzn8X1FrpwM1NDTFzBmMIrACWa8+ge4GcWcrxXmDeGFKwNbUFmGroB4sF+sh3BuSy8Jcoyz8E90mLzrPkLV5rIC1U346u2vkRlazfamexrj+XxMWTIQ0UhpRuqAtrt/g+kvsBrz6DjwM0/P8WvrQHfRPsHw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052114; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=41+zTX9PYewEXCgoj+8i1yGWshCEvT30KUKjAlCzF0c=; b=KIcdmM6wOCwI4I96PSRjlQvfbA5UuqS6fst6XIg/78F4DQff9dSpjzEQtD5HpEONM98NHQk9XKkcrsxL/ynJFKlvOQctA3ltxLbPjoc30P9r6Fka0hgbGeTQUJw1AuIk/PawYMxzrz9QJNnZcGj3FtbVeBNNMqrrjv7RsRGxRqc= 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 1787052114095424.94887073306666; Tue, 18 Aug 2026 04:21:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHt8-0001CG-AZ; Tue, 18 Aug 2026 07:21:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHt5-00018x-4N for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:21:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHt3-0006vL-Nq for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:21:46 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-189-SCPr_m96OrqVDVyMjOLvtw-1; Tue, 18 Aug 2026 07:21:40 -0400 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 A6ABA18001DE; Tue, 18 Aug 2026 11:21:39 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 34C363000239; Tue, 18 Aug 2026 11:21:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052105; 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=41+zTX9PYewEXCgoj+8i1yGWshCEvT30KUKjAlCzF0c=; b=KH1T46EYesMMLkewW6Pivi0kR+VmXQiEFUsZkebKEEkKiLMLEwb2SCem5UXipyRqKgU5qA WNUS5Hs11kP4M+L+ft7UaPDcy3uVzY8tO9gP881bqU+S6ThCdwotyIb0CES5yRGCwuNUWO 10ABet/1F8pl3a3n9+jPov5TyH9bS4E= X-MC-Unique: SCPr_m96OrqVDVyMjOLvtw-1 X-Mimecast-MFC-AGG-ID: SCPr_m96OrqVDVyMjOLvtw_1787052099 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:05 +0400 Subject: [PATCH v3 38/74] target/i386: fix CPUID version properties typename MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-38-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu X-Developer-Signature: v=1; a=openpgp-sha256; l=1408; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=583Lvb2dPvaGuNJ8Al1TkNvjTaOLls8qtGDI3WwoRPE=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD26Yju7JmQaDh5z+b+hhhUQwi8gmk1ScJeLF wnp/WuOYi+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9ugAKCRDa6OEJdZac 5WHpEACQczrDSymzqfLyqC/nthj7Q7FerypqMZ3/TyxeFDQ7OXgDtAKGKCO3oyAoGw1BdhuN5Vz J39Mg+rXbx4r6H5DQq06nHc0W9ceT+inVk7AjQPtYll7lPES7WfSjYWPJOvtvt+XWxHgWrH9MNf qvVLExlk40q1/lxjPGcRxQBCIgRJ/G+Lc6T0E8Fv3t3ELKxnAyhX2qJwX/P9uziUVh+NDu6InRh S7fDBsPDD3gFvZyZOZvyo/G65TkmgGK/tPMudtzjBHG8jXxIDT9/8dOE8UWc0itAON2qj7DUTBW UriZiyz3X8COxKfNRnlEp1GPUQpEUnN+RgqzvrHm+Ads7emSrUisn/zpHYCkz02IeAcu92katxH mhlK82aDZI/88mMIZ7wmEovavJXIRRIxk5/DQ1keQbtKKS914MYX5zPGsVyZ9om+j6FShPTgCDr hYl6NWrYGGIgmqjgeRSsC8DCSQcwfKKV9yDz3QzWJ67gSa6/W1iX3FEqtXwpFTh4qo6sVa9a1ea xfaLNwvCFmEHpvEsVHlp/ylcMzX9IeDJtB9VFPqajGTftzyuZePE/Xi+t1BWPRN9YpJQDQH1xM8 RKPzVwLiHNDJhw3v164eZRaS0qR1T3AYOGp8bULzWa3FVa/LCWIs9vLt2hN4UCQbKoEJYTsJ6ae dQZ28nXi/oGJqlg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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: 1787052114299158500 The getter and setter use visit_type_uint64, not visit_type_int. Fixes: 3e0dceaf9450 ("i386: Register most CPU properties as class propertie= s") Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Mark Cave-Ayland --- target/i386/cpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 3b30ded0cc02..567cbf04ca75 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -10947,13 +10947,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", "int", + object_class_property_add(oc, "family", "uint64", x86_cpuid_version_get_family, x86_cpuid_version_set_family, NULL, NULL); - object_class_property_add(oc, "model", "int", + object_class_property_add(oc, "model", "uint64", x86_cpuid_version_get_model, x86_cpuid_version_set_model, NULL, NULL); - object_class_property_add(oc, "stepping", "int", + object_class_property_add(oc, "stepping", "uint64", x86_cpuid_version_get_stepping, x86_cpuid_version_set_stepping, NULL, NULL); object_class_property_add_str(oc, "vendor", --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052136; cv=none; d=zohomail.com; s=zohoarc; b=MY5dTmjQc3WqmXCLikhG49hbga/Ol0GetNKccO+/CuPvlT6L+GLkq76U15+sRPUid7hA7THfMXuZ/vpHcOrYrINGEWfnJ5374DDFHYB0PuLaHOH1hVTl3kCF26Dz+/xZWQ/uFjAfddL3dhXJCPqxgaAklbATwqfUDfdiVtdSCEI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052136; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2y7ZoLqrQvj5JiO96UdrTHJb4VNDOERoPvd/37XGTss=; b=i0HlLf7JNGden0ZccWPpCXhcqjBYI5VLrpd4ovfbwZhwwhy2dOHn1Cp5boGHWstAmbdHHgI8khX/cLAbQI3xOy2eXEB+czY555Nc2gDflpX3Zs2l2J7s9nKxQ2wh4c2hFcDJPdkL+G6a6VNCQVSQO4W90jeDlvgYntTjqxpRQD8= 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 1787052136716449.8520328377057; Tue, 18 Aug 2026 04:22:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHtT-0001fr-PV; Tue, 18 Aug 2026 07:22:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHtN-0001b6-NE for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:22:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHtL-0006xQ-TB for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:22:05 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-641-zYNRnFPtPz6aRNxuyHaRig-1; Tue, 18 Aug 2026 07:21:54 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EAD4F18001CD; Tue, 18 Aug 2026 11:21:52 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 262A61956042; Tue, 18 Aug 2026 11:21:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052123; 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=2y7ZoLqrQvj5JiO96UdrTHJb4VNDOERoPvd/37XGTss=; b=BVZXoYbnFbTypHVoQtQ91m78ejsI5sxmBI7nkgdAqNi5ITjddhknL4pP52H4kmqecUhQXT qXo5YMT34FSp2WaAS9ruDPTTR4XfeSELPR/KKB679XDMuANvEFmdPlmrzlfh0wai5bg+wm A3lrbvIiBnwXR8AeqOiqRPwvD4t21Nw= X-MC-Unique: zYNRnFPtPz6aRNxuyHaRig-1 X-Mimecast-MFC-AGG-ID: zYNRnFPtPz6aRNxuyHaRig_1787052113 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:06 +0400 Subject: [PATCH v3 39/74] ppc/pnv: fix phb-id and chip-id properties typename MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-39-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Nicholas Piggin , Aditya Gupta , Glenn Miles , Harsh Prateek Bora , qemu-ppc@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=2194; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=KuOcq19I+P/sJeJ1xp8d6ZSTzh2ez12rQGMJ3NMg204=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD26OP8NHlU//glh6Y/TiS6C4LWMdM1Mp1PE4 N73VUTAjYCJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9ugAKCRDa6OEJdZac 5Z3zD/9gWU7pfMt92jOlAo2RZAEXkHDRGKqEx2ICdvTyWX8zleuysTpxTkfShdtSN6S9ztfTciS SYmWsYMEAjGrRG15PVWwYDuP2aZvFF+BEprhAXUxt7sw3/kvto08o1uF3PQsywv3rKxgYVwRVeG zVLCJ3YxelFRUJM3/4iOyKZz9cGcp2NHW5on7S930p64Eondnf2iDwKtGvcnqUkEw7PTFGTzJf7 qhn2p97AOH4bbAnliiEuZXHZtcHDZYGErAq/s04Id3Hb6btno10wKyS4GskHdIrzmCoFPOoXO1f Af0dRZmrGsDNl/6TuAdl32BIGSmbWCbi0hbH5RHmMJz/1BkzzVbb6f2ZiRc4wnxJEJKwGq3btXE /jDGGwRF3eOmxGacI0rGn9CysH1ZHhE3liF5Z24uVSbgKNXXO1DUEp5Ea4Y5TvRcjLOgTDXAiIQ UULsnsFFqzvfvLkgg8sze0JCc0XKq3WLJgAM+MT8/Q9XFTIyj7VKJqi6zQvAR4QzMFLmEufd3cb q0Ga2ftJJBd6/NwkwPpk0I3O8FMQJrSMcttRLEMuJOZnJGTcWybz8f12RnWGL1K6udGtbo2wO8F +CbnHf4Vg4/klvHf0dzS9PZ51VjpnRKIb2wzMLAiqvNF3uft2oHkAA0FB7HDY+G+BnNE0LuiqHX ikrh1I8Md22i/Sw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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: 1787052138523158500 The getter and setter use visit_type_size, not visit_type_int. Fixes: 8ec1e4f1ef97 ("ppc/pnv: add phb-id/chip-id PnvPHB3RootBus properties= ") Fixes: b7c1750dc440 ("ppc/pnv: add phb-id/chip-id PnvPHB4RootBus properties= ") Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Mark Cave-Ayland --- hw/pci-host/pnv_phb3.c | 4 ++-- hw/pci-host/pnv_phb4.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/pci-host/pnv_phb3.c b/hw/pci-host/pnv_phb3.c index 4ffdb4ce31ae..0471b009ec2f 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", "int", + object_class_property_add(klass, "phb-id", "size", pnv_phb3_root_bus_get_prop, pnv_phb3_root_bus_set_prop, NULL, NULL); =20 - object_class_property_add(klass, "chip-id", "int", + object_class_property_add(klass, "chip-id", "size", 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 705a5bcf074f..510edebc40de 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -1761,12 +1761,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", "int", + object_class_property_add(klass, "phb-id", "size", pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop, NULL, NULL); =20 - object_class_property_add(klass, "chip-id", "int", + object_class_property_add(klass, "chip-id", "size", pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop, NULL, NULL); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052169; cv=none; d=zohomail.com; s=zohoarc; b=mKLlV4IInDz7SnLtGcS7hJZiGTGzveXyBBvM1AIomRdTh0q83E9oQyEJZlMjzA3IF34qqOXutzV0OszYTQBDblqWDpsq8Z4afqGxjfDfuqXfzZ7IJmNIdHtyW6o3Ua9CWT8caHh8cssSis4q4MaA+176feJYmbW6CMLarSMxQms= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052169; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=upABZVt3TfdZce8AYOa3jKo5LaXazAetV9qjSdghA5E=; b=fZStIIDU/rMO2ZPRm35XPJbLfHgvw5Xf0vvx8dD3QJn6fYqy7rbak8J7ORrfZ1dtkQfbhTxJlXIKF3RyznZ66ZTV3O2t4INGyKRRn8p8JRm0Yo/4C5vZ4Nd/5HQVZFTF0T8XSuugvm1AgrKarS67rNPwa49oJ8c8bye+BUgL79Y= 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 1787052169817871.5823422120893; Tue, 18 Aug 2026 04:22:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHtV-0001pi-PD; Tue, 18 Aug 2026 07:22:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHtQ-0001eO-T0 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:22:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHtP-0006y1-JI for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:22:08 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-228-FD7FXlZENpeDkCoIcg-PQg-1; Tue, 18 Aug 2026 07:22:02 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7D9F6195609F; Tue, 18 Aug 2026 11:22:01 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DBA78195608A; Tue, 18 Aug 2026 11:21:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052127; 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=upABZVt3TfdZce8AYOa3jKo5LaXazAetV9qjSdghA5E=; b=NFBtmOy73zF3yom59Z8DE3DZ7oBGxumxzvxUuS672Byvr8H8KykUUllUunvRcMwwWZHLkV tcNR+Wtx2bX/IOyD6rivV13h9wgMvJsaqG2mWt8jf3XfF5XYzNlmK6+0DLKKaOV1MhDMh/ v8izCk81pwIDfWC5bTfsc1ayXbZAoUU= X-MC-Unique: FD7FXlZENpeDkCoIcg-PQg-1 X-Mimecast-MFC-AGG-ID: FD7FXlZENpeDkCoIcg-PQg_1787052121 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:07 +0400 Subject: [PATCH v3 40/74] backends/hostmem-memfd: fix "hugetlbsize" property typename MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-40-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Hildenbrand , Igor Mammedov X-Developer-Signature: v=1; a=openpgp-sha256; l=1104; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=yQQ41cp2PPxrzqYx6smXKcd2PGq9TgrY23dLiOx59og=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD26R8p52L+EJzJzIYsE14kOQbzix+l4p8AvM NkJUYnie4uJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9ugAKCRDa6OEJdZac 5b+qD/9Os9IrLx3YmHS7RBI2gzun/U7Vr8Ub6QUIsjnQmB8h8M94wrwdYAUAU2M03NKY8QBvMk1 SFIm3c4dQKMEPt/MxRLokDrTKVi1QgXPBno+uF9th37AuV08pAUIPzk5zr7B3OE6pAOk5eRfSZe 1z2+uOH+5MpM1ROrOLH7IDeme5gn6wDZZsuaZKBtduxEJ6w43q7dc2kr0wbZgEbX0xQKawYif42 gS6Z3EtVTePApTukWmE1rI0f8qY9qBvSzUWrFTEyNgdP0zC2mL764f0SYbNhKd0xa/AIQJWG/fm HMe+cy5PxjQnF2Q/K/vCI4NudiAOmFy+mPIIDOCSiU5oSe4CaKimyK49Zz8tOHeUmVRTWaEJUTe hI8e09NYeZGM9ZVzkZrr3nB/E5ndqxp66PjugGORq9kHqSrJRqM65Z7wlK9T3h9zackETqloVoC 1tJ7hsj+TUXaD93gHNB69qzSP/k4YB2vxm/mz/AA7MOYt0gyVX4rn0f9v6nq+ZINNayblOwfe1E dIW/9LP7Wp/R63IPCOWpPLld4ftEBfR82PVVvH4T1xktfXP0NnCeYUAy9Pw7jGYpfjn06TmSwKt +TZ2s9CYBjRRtS99mJ7TUqJkETXimr/HhzVTlC79Aj+OFxA4nPTpkFbm9iGqxiOUYsfVaPgI4oF 9hLr2c3Mohv9IiA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787052170712158500 The getter and setter use visit_type_size, not visit_type_int. Fixes: 3829640049cf ("hostmem-memfd: add checks before adding hostmem-memfd= & properties") Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Mark Cave-Ayland --- backends/hostmem-memfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index 923239f9cf69..77f7eab40fe0 100644 --- a/backends/hostmem-memfd.c +++ b/backends/hostmem-memfd.c @@ -145,7 +145,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", "int", + object_class_property_add(oc, "hugetlbsize", "size", memfd_backend_get_hugetlbsize, memfd_backend_set_hugetlbsize, NULL, NULL); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052145; cv=none; d=zohomail.com; s=zohoarc; b=m5fI35MXrdQRCBpxXP/SuO5beYnsVKIMMh4RGuFwx6bAOlJRX22xKy88qaflDaDokP1HAi9fDK6YJQaUGfgNiUFYiy6kPYlOEvxzLoFF/keKuJ9DmazadfR9rGNX+I7ZfbR5r+QtofydrAxp7HrFlzYUfxNmQW+Zr1+VyzmtrYI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052145; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6JcxfkZ237zfdcOtdcEivBYWWxF/TrulB/dckEQCvYM=; b=CGeyNAGx9Q3Tc+cryCbWC04ZSj3GWFmRJeJ8JO163fJc4PlPfF9jU8Rc3DOR9hAIW6j2nh3V25NF7Xl30DgeP6bcAL0co6I5lnoqnVbvu1qZHW9ZcgGu7cVukUwPp73VdP/tze6O9G3OeoCvV6ufsjsyzGZuZaqvpvj5KJsOobQ= 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 1787052145233991.3593782940843; Tue, 18 Aug 2026 04:22:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHtY-0001tM-90; Tue, 18 Aug 2026 07:22:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHtW-0001qT-Hb for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:22:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHtV-0006yh-6a for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:22:14 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-164-u53nJ6pWPAe31a0xiXXF5Q-1; Tue, 18 Aug 2026 07:22:09 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1D5831800646; Tue, 18 Aug 2026 11:22:08 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 72139180034F; Tue, 18 Aug 2026 11:22:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052132; 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=6JcxfkZ237zfdcOtdcEivBYWWxF/TrulB/dckEQCvYM=; b=IjvPRRJsmaHF+uHfbWuL/Cbdkjefi9mKHMyQEOu7699oozTdUWlQedV+o+crKq5NcOGduF CIoz12mHwNyDJfCU4enW9Kms3I0ziyfinEGhExP2vcELFd3CJ9bzx3k6+Qg2n4RsC/TQxY +kydjT8tsyCfSV8d42e57q3vkGs/VAY= X-MC-Unique: u53nJ6pWPAe31a0xiXXF5Q-1 X-Mimecast-MFC-AGG-ID: u53nJ6pWPAe31a0xiXXF5Q_1787052128 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:08 +0400 Subject: [PATCH v3 41/74] hw/acpi: fix "node" properties typename MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-41-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha X-Developer-Signature: v=1; a=openpgp-sha256; l=1664; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=pc3526WxzWWGflYPva+gEUQR9wKHaqhJ+UYHvMwFRZw=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD262AvPSPp71kl+0gJ8I9EiKJvdFrT81WDkU rg4Nj275f2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9ugAKCRDa6OEJdZac 5aRrD/kB4mciJbag+mCWEbGxgkQYtUbhjJsN17TAebszLgb1eNaBD+fkac4gEaBzXK01qSKsB0f J49hAH4esVdeA2Pd33t2mmw1t+fvjDt/GwrNgyeN/LjpgVGe1bqm5OIT2dMYkSYi/rSCRTCILY4 984trFVK/Gay8Cw8fb2XOYmCRBWA+vYRWMsopLi9kIZA7kmG3O6jDfjTKmzcJJIs1Pt1xnxoz0s K5BSu3iF8xRx72saHOBuOvFEit8hu9jcSGbt1CPgB8gnuDRHGrSHtILGbFN/eqhoTFTkWf1OjzF /sXrBcgXCbUFPBCa3BSLaDxLkHBs3Bu/v243Yt2GZ4r1pqc+mLBV4z+FffdWywVb09mahu6rXjy Q9tUdTwSVgeEjl2meY2vSV9WS1xaSvUMB6C7QCbTrOgmr87jojvKvM3y4AuonaPhsnr0/f/Podu nVwPk3lUAIDjPpQmtsiqSlagnkxobpnvxlP3P8f/DHClO8XsycV75YFHPwz7kL9LCE+A/sci++y scTYh56VxeprBJJVY22Dm1J+VpoJoOywvGx67II2NXr0xsj9gs9f2YHCdk8qljWsEKcTjtLpKlS 8XTqUi0DmQ4vmSuT2+bAT7Vs91BfaUUPAY8HaciP/EOshAwS9CYULV5zwcEPjHs53lLm5GWksXc i+aQW0pKNfPIwPg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=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: 1787052150647158500 The setter uses visit_type_uint32, not visit_type_int. Fixes: f74e78220dbf ("acpi/pci: Move Generic Initiator object handling into= acpi/pci.*") Fixes: a82fe8291643 ("hw/acpi: Generic Port Affinity Structure support") Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Mark Cave-Ayland --- hw/acpi/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/acpi/pci.c b/hw/acpi/pci.c index 8c7ed104796d..c82924be8620 100644 --- a/hw/acpi/pci.c +++ b/hw/acpi/pci.c @@ -139,7 +139,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", "int", NULL, + object_class_property_add(oc, "node", "uint32", NULL, acpi_generic_initiator_set_node, NULL, NULL); object_class_property_set_description(oc, "node", "NUMA node associated with the PCI device"); @@ -253,7 +253,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", "int", NULL, + object_class_property_add(oc, "node", "uint32", 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"); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052171; cv=none; d=zohomail.com; s=zohoarc; b=TxoLbZXAvHnIPGW6lL/MdQdxl9iWmiG5pG9FQ0wYSgoH4OHiXCj2kXh8xRKnVypBjJUeuzHgm69PW9YSz8WJ8z1K1x7mU4m9ne0Tu7XTIcDskqXz0tXHiJzbbsK8NJSFFj9a4t3FbNkxYr1CyCZGpLTAzvcYmLNS985O34wjoYU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052171; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ToLJhQPMRz6Q1MKU2Z1nPk0uHGyHQ2rzehLqFuMaRso=; b=gmFLwSL45Q6TKTwk54Od50mPWgWehkBKtWZp3tPeoJcmXB7EPbRZdjt/+yq57AH+K2r6vPAp3IRUgjZxe/dY7AW99toYfJODbasi+3JYfC//kgfXd8WicpXRZbS86aN5zoBi5JPsTddmFCYhZ7rUAPO4Gx3jnq8ZtgiYGGTSwRs= 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 1787052171662426.9007405435242; Tue, 18 Aug 2026 04:22:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHtj-000257-Eo; Tue, 18 Aug 2026 07:22:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHth-00021v-MN for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:22:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHtg-00070H-A7 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:22:25 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-319-AeENLKZmNhOn3l0n3WJApg-1; Tue, 18 Aug 2026 07:22:19 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A1F7E180034C; Tue, 18 Aug 2026 11:22:17 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DE14D1800347; Tue, 18 Aug 2026 11:22:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052143; 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=ToLJhQPMRz6Q1MKU2Z1nPk0uHGyHQ2rzehLqFuMaRso=; b=Xf4svSUgM5Q1MRyTVOImGIwqANae0xA1xebAzpSh+eK0++L19lYiD3MjcnEnF1nqM25fjv pI/J0OGNHK3CALw8j24gwrlid/EYPFn9KqzgQ2NIdn7D6uPnGHb4STgc/vJh442Dy31+2h VYclvH4wFiCFcQTnN38EpNzphCg//MQ= X-MC-Unique: AeENLKZmNhOn3l0n3WJApg-1 X-Mimecast-MFC-AGG-ID: AeENLKZmNhOn3l0n3WJApg_1787052138 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:09 +0400 Subject: [PATCH v3 42/74] net/colo-compare: fix compare_timeout setter visitor type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-42-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhang Chen , Li Zhijian , Jason Wang X-Developer-Signature: v=1; a=openpgp-sha256; l=932; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=rEFhsqDOs12Ay0m8ssGFoc+f7fZzJv5d/VfvFSaHnOw=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD26WBf/1aSTl/iuEMzJuQ5JH8nRzKnA6dSWZ CO0rSqkJPyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9ugAKCRDa6OEJdZac 5W0WEACjKW6D+x344FCJ0p6h4npvogFXqIGegGaYkfBRT8S2hNlX5TD1si6Y+ywfDIl/yijhfo1 7bKPIBFS/PLzL9iw/y2yKyqZ2tpuZnvM+BmUnzkIfWswU8f08KkIyqgcg1e4EWDg/RJi3xAAzwS nGSFmbEirP8PrVAAfH0cQutwveOjhlwqEj75epW+BckvDnGYi518XPhBuLMkzS91UCCx48mtB5R rO4rwuFhFa4aw8JFoKIZJjhuGykc58Fc/6nhartMsCGmjMm9FD50kRA1D0++VnbD98z6/FDGFQi Cd39ItDQrkKSbZdAQ/nTnWf3UsEbeW5OKbowJKijdU3UwF48ug+9yvnp9spTL1SbGwRvSDEuYsL ddEKxDHTgoecJS8E75a/FH48G3z8k4HJ1KLS5I1Qwe9HBe+MQX1j/8N1+mvP6t7aimlFxn9KL1m 2DU30fJ1YHKe0kJ7fOr3BdzgYWEtuYW2Z8OY+fV8fWf5FLNya2l0/rFGHEjh2C31hAVQ3CvvTWm WPB+3Zj67rN8buPQKV2KI6NwXcobTJvqG7TFvs8tOmHUN5v+3vKLDLsGeTSpsp8rJ+govFPxs/q 8jRKM+teJVWUvNW0ptQNmuIMTe9MzgwMDUTXoyn3YMhO79NFE8TbLyUJwKdSteZu23/yjQSnoNX VwI/Azvmax34MGA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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: 1787052172614158500 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 --- net/colo-compare.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 5986fb1e8800..948a2f7f9e4b 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -1075,9 +1075,9 @@ static void compare_set_timeout(Object *obj, Visitor = *v, Error **errp) { CompareState *s =3D COLO_COMPARE(obj); - uint32_t value; + uint64_t value; =20 - if (!visit_type_uint32(v, name, &value, errp)) { + if (!visit_type_uint64(v, name, &value, errp)) { return; } if (!value) { --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052170; cv=none; d=zohomail.com; s=zohoarc; b=VsHkKR1VQRL1KWgmoH/m+m6A7s6oM59o1riiRYG4+lMveKenqw98z/aIoL/hoMwsg/FikmvXbYtiwSxn2Raouhk0U/DbIQWtoRdqxEmedOLMMoU4xvclYzprewwYUeqXFRNDCic4feetNRxrBVnsfG6o7dgyVF3PJijkRPybANs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052170; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Emw5udw/hAqZHIGzxhMNpVnsgLj93r4j1DXVLXU5PSI=; b=fx8qUixMsfPIp9foBbzvKVQvHgul6VcpdVgreeOgmP/9f6Ug473uJ7ZPpzl7kXNC66hXyBjtp70QJggOkHeo4JNdRRemOo1owytOPiCUOODKqZJhbsa5tkPBrWBGnhHvaY2Iwx5nC/nU4FimoQKT+M4SnaSJxkAyT2MJFTZDCuo= 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 1787052170769649.5290163706445; Tue, 18 Aug 2026 04:22:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHtp-00029r-Gt; Tue, 18 Aug 2026 07:22:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHtn-000295-Rz for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:22:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHtm-00070i-CT for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:22:31 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-393-XBXP2tDpNyiR3Oe5am23PQ-1; Tue, 18 Aug 2026 07:22:28 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3548E18004A9; Tue, 18 Aug 2026 11:22:27 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A58D81800346; Tue, 18 Aug 2026 11:22:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052149; 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=Emw5udw/hAqZHIGzxhMNpVnsgLj93r4j1DXVLXU5PSI=; b=dupi1NFTD+sNCr80spReZkTaw+2Ztu9H7jYGZlixfKbDcc3sKdMBABPRT5+8ywCmJ22zMd cyzS4bXrkxSDbRAiFHDyBBXzMoe5wliI1FpRkNU/OO57DidVNd9tlMi71OxTjV7WXS1KuG ZbCGcFxigNd6b/oAyfZfFW6VmlXz6Nk= X-MC-Unique: XBXP2tDpNyiR3Oe5am23PQ-1 X-Mimecast-MFC-AGG-ID: XBXP2tDpNyiR3Oe5am23PQ_1787052147 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:10 +0400 Subject: [PATCH v3 43/74] net/colo-compare: fix max_queue_size setter visitor type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-43-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhang Chen , Li Zhijian , Jason Wang X-Developer-Signature: v=1; a=openpgp-sha256; l=965; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=gH4V4GYmKlKV9gTVHip9VTPSlJHQiKGxkIO6FkOUkhE=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD26J7EnTwT2uQYpSXIHW+Ri85+PSSzm5nXD1 PNg4qM5s2OJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9ugAKCRDa6OEJdZac 5Xd6EAC618iIyG7EaGYElR99ogtlQfb6yVfzHWp3YsOhP06nX4FZHXN5Z5KHC42j+K57WmpXwRm Wxyop92wbbQwM7Ebbhk8W4gXGuNIpYC6ceuC0QeYMM2KwK4ECUBy3Dru+mqQcYf1GE5zQJl2ECb E9y2oa4kvOZ4Fg1DFkgza0QJZZXhZtlyuPvG/n8TnlRKKt5gJweg3yH/0PZRqSt4vu0fAwiJPgR yWzt5jIYhKsZsokgMkyvrsFli/BhDjRyQBMkcJ/bBNQrDdJUuO9Q/6RNfm6xcBwtJ425yk5KFb6 uFfbcxXJcVmiuaT/vwfOi8N1VKKDxNUanwxrv1dyCNDerXeysW0Zqz9exlS7Ge1jazSQNFtEZMD J6MvQlr4hJad6o1GbGG9YD+c2vZk40isppNHoVOqlzgPH0wCfa8cb0Xm7CTqysikFhvLoYwDCTz qth1EN0vASCfGwYMVC+4sVywGYLiILnfHwO/ircojvxWmdbwWXB/bpcnfqQrQY3J0i0pNCvZ6Vo ROHtwnO2Of5V5MdMWF8roxXQTDPPDY6Lo8U50jH+iBpWtjeo8kXHYFBQUNp2jQdAKhn7rJEnSBe uugrETiEwDhJ9lRuNuHQWNi3n/8mUIsa409xl/MxbbEURJgTCeAhP9MPDmmLFbPJf6WpZsOHDtC QMwIh5k1fRMyl+g== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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: 1787052172613158500 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 --- net/colo-compare.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 948a2f7f9e4b..a6910de869ff 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -1129,9 +1129,9 @@ static void set_max_queue_size(Object *obj, Visitor *= v, const char *name, void *opaque, Error **errp) { - uint64_t value; + uint32_t value; =20 - if (!visit_type_uint64(v, name, &value, errp)) { + if (!visit_type_uint32(v, name, &value, errp)) { return; } if (!value) { --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052169; cv=none; d=zohomail.com; s=zohoarc; b=ayfenuJWkyaCADT9F4CfdERQsYr7m4IJjvpuSjvocajYWZKbSxJC5Z8qyQBG0rYMHXk/8jhKG23P9G1AehH0pONkxskDI6lax1qwnSRUU/Jyi/3+GqtxPkvTBWpBd3aKcnHCsgtRt5jQP/jZfMuUc6qEEtNkAodO81fCeP/61GA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052169; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zrBI6APmfni1eZ8vuc+OAu7+inaV3ylbVMAHuz3FiqY=; b=nWGP/xfIRveIbQ3V41kYSjXcLgK9t23zan8XU/6D1cgIenOJdJW9oMRLSkL2wirEfxuCK3WjvTRNq9Fb9tvZONZRdvW+soiTTAmaYXTH8rVgHYcOYVmtrFDkYDlHAu9Rfx5d0HlDEPPULxphG+4qVrsFuhyyGEv8nWyNaPbeVLU= 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 1787052169859572.8532733131788; Tue, 18 Aug 2026 04:22:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHu2-0003Q6-45; Tue, 18 Aug 2026 07:22:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHu0-0003Fd-Nn for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:22:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHty-00078L-Uc for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:22:44 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-413-Pkk-yAHYPNWUPAqSvitp8g-1; Tue, 18 Aug 2026 07:22:38 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5DBFD1800747; Tue, 18 Aug 2026 11:22:36 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A10301800348; Tue, 18 Aug 2026 11:22:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052162; 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=zrBI6APmfni1eZ8vuc+OAu7+inaV3ylbVMAHuz3FiqY=; b=Q7k9g5brFKmetVUukaYhPATQO8A/WmL4GibfXy/9Dq5YS/fy7SqoqP1Da5h3nVUKAIrYi/ D9dBfBqbzcf3SjbLgRhagHafqBDapUQV8muVFyezm+21JbtDSTePHkceRDKaKG7LCZpRd/ k0I+P6cNIByZz7TLgjziJTBXn6OianI= X-MC-Unique: Pkk-yAHYPNWUPAqSvitp8g-1 X-Mimecast-MFC-AGG-ID: Pkk-yAHYPNWUPAqSvitp8g_1787052156 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:11 +0400 Subject: [PATCH v3 44/74] hw/misc/xlnx-versal-trng: add missing getter for fips-fault-events MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-44-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alistair Francis , "Edgar E. Iglesias" , Peter Maydell , qemu-arm@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=1168; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=tocXDybXXj46+RW2LpIpFFkqPlAIhRzMx+5fSJL7tHQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD27a94OtGLPXejqmTwHa0Su4TY2h4pHF9JdX aiUKqOKhZyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uwAKCRDa6OEJdZac 5eoJD/9SLKJk6rETdOTcxpYX07josALCDZOHIJ9wHrJfSYa9lbsnXVqHi8FyEx7wG4aqt3SKzsk WzUJpJyXdqzZMg2hqIP3mS/Pob85Pu+mepobGt9F5gcvKZYw5C/HkuUHURSeZmkb65aEaNzDojf VLfCR1PgezqTG/ITTH2Lji2JQXxVsTkDIEoAKpkRPTZeck/tkdzRs28oeGZs9uFKVogAMopNGtU 5hL/BSWtpgq4Wqe3axqQltdLSGn6vLXdacCHwYwUF6l00bz+NOw054P6D4vmtvyo0aBX3mN6s8K VG4cM5RvE+ThNRT0g8V9rd17jBRpU/AC8o2FiWSTma8bzMwab/8ZgXWGxbo5DJjcYQ7lyVU/pzU 32E+JY8z+yNIUKvtqpu3XirTlE7FFLIL0G4CW+hGRRhb61kwtP9oOHNglH1GorkQFuaZL1Aagzs 1WPTWqyuyku3zKvmWrVi3vunCQuX+EOU4t5FGOZ2yY729l5uB9ToqA4Bfn1BmLBDvkTMF05BGh8 SSRqBcrq6xePBuSUdK5DLSIa3wxUkWxYXaSDLAbbwStXQPHvs7guyew0+8EQee5UbEj1rwDBU9x lZE5rteG0gATeEziwSMPrTLl6vcE9xXChNwn+bTy0OsNhn4pNxTG6MV1WiJMw/vVjjCS3m/ThcZ a7InWtfOgEIYujQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787052170722158500 Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/misc/xlnx-versal-trng.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/misc/xlnx-versal-trng.c b/hw/misc/xlnx-versal-trng.c index aa1d65de7b70..0584ee089e3c 100644 --- a/hw/misc/xlnx-versal-trng.c +++ b/hw/misc/xlnx-versal-trng.c @@ -650,10 +650,22 @@ static void trng_prop_fault_event_set(Object *obj, Vi= sitor *v, trng_fault_event_set(XLNX_VERSAL_TRNG(obj), *events); } =20 +static void trng_prop_fault_event_get(Object *obj, Visitor *v, + const char *name, + void *opaque, + Error **errp) +{ + const Property *prop =3D opaque; + uint32_t *events =3D object_field_prop_ptr(obj, prop); + + visit_type_uint32(v, name, events, errp); +} + static const PropertyInfo trng_prop_fault_events =3D { .type =3D "uint32", .description =3D "Set to trigger TRNG fault events", .set =3D trng_prop_fault_event_set, + .get =3D trng_prop_fault_event_get, .realized_set_allowed =3D true, }; =20 --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052285; cv=none; d=zohomail.com; s=zohoarc; b=hrbbuPsskC0qx8f7raGIfCtlxImkTZq8KgQwGx8a4hQikv6IvVw9JSv09XVTpJ8Pz3WJD+ItvI6vLvm1PX65H6QmdttqQYPB+8lKost6DKaDJiaqL+Wv64Rd3ZwB+3QpLQk6zCDD25ChRrju8MtW9sbjrFcdp75vhPekghy0+vo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052285; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=h64XN1WLxAYWIvGPaSy4g9mn7J0U93E0Dk0P5R8MRfI=; b=FMNsftROyzWdcSLGwyDCmMzldvHEnIfZckY1qEdklXBEAdJMyGc69BLN14g6sXYmDPIJlMGtmTyCaNu1nSGAoQwct4OPtUPvrEMqj7k5b8KjqJoVjicEHa2fLpT2Eox5nxu/aXTLfz+t1JomGVhWk1uAy1d3CV9WO5Fo07nP0Jw= 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 1787052285026523.9405377207795; Tue, 18 Aug 2026 04:24:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHvS-0004CD-NO; Tue, 18 Aug 2026 07:24:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHvQ-0004C3-MU for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:24:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHvJ-0007ES-Vr for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:24:12 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-412-GYkMi4RYMJq2ufqbrR-sEg-1; Tue, 18 Aug 2026 07:23:50 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B78BA19560A2; Tue, 18 Aug 2026 11:23:46 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 41DF81800346; Tue, 18 Aug 2026 11:22:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052245; 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=h64XN1WLxAYWIvGPaSy4g9mn7J0U93E0Dk0P5R8MRfI=; b=hDKT1+PpzyImsSpya2Ip6ARWaY7U6MUZ6BCcTINK/Cfmwa4XGcG5X8/hcLXcaiiLyXk2MQ BRrg5xVr3ZT6W6fHfOHjS2u4y7cQVt8osfdrVXUvcRxZyeHprmA28q0rVOwJ1HTnrH1+uK R4vtMzo/vVz3flERnGlCZ960X7mZbaw= X-MC-Unique: GYkMi4RYMJq2ufqbrR-sEg-1 X-Mimecast-MFC-AGG-ID: GYkMi4RYMJq2ufqbrR-sEg_1787052227 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:12 +0400 Subject: [PATCH v3 45/74] qom: convert scalar properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-45-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alexander Graf , Richard Henderson , "Gonglei (Arei)" , zhenwei pi , David Hildenbrand , Igor Mammedov , Alberto Garcia , Kevin Wolf , Hanna Reitz , "Michael S. Tsirkin" , Ani Sinha , Peter Maydell , Luc Michel , Zhao Liu , Jonathan Cameron , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Steven Lee , Troy Lee , Jamin Lin , Kane Chen , Andrew Jeffery , Joel Stanley , Samuel Tardieu , Marcelo Tosatti , John Snow , "Denis V. Lunev" , Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Jiaxun Yang , FangSheng Huang , Tyrone Ting , Hao Wu , Jason Wang , Keith Busch , Klaus Jensen , Jesper Devantier , Nicholas Piggin , Aditya Gupta , Glenn Miles , Harsh Prateek Bora , Conor Dooley , Sebastian Huber , Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , Halil Pasic , Christian Borntraeger , Jason Herne , Eric Farman , Matthew Rosato , Ilya Leoshkevich , Cornelia Huck , Titus Rwantare , Stefano Stabellini , Anthony PERARD , "Edgar E. Iglesias" , Zhang Chen , Li Zhijian , Peter Xu , Chinmay Rath , Hendrik Brueckner , kvm@vger.kernel.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, linux-cxl@vger.kernel.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org, xen-devel@lists.xenproject.org X-Developer-Signature: v=1; a=openpgp-sha256; l=108245; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=I3ngOK474uG6L8GlTGihBDhFs2IbouaKgNqts0SQpbQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD27wd29pCZcsiZN03D0ycgqgojx2bU9GopVv C90fLkj/FCJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uwAKCRDa6OEJdZac 5S0wD/4tOtd+QWL4mGBf2P80sHbQkFktxXaQZRJKRpTkzh7Fpp9zfrEraWOIn9DSqcYvW5VM7dj bWIXfKGHMAn1ILiAMeo3OaQAYbvBYuM1e+/fQ0AGwbq2wtyXwS+FOsHsd7+JInX321/3wrNlbUZ tZsoX74l+HP6MpHTe/GgHi2hDTtghOI9prYfQD514FyAq+TGCZx7NH9Jiam58DA9Y9D0klPFX1J 1TJqXIlpaNbpNXBGg8dU0N9E+1YindXkWO9qSMrJerQkHmeU4Y8C+kDj4GWV84FpjckGNEyCkzk b8WK1tMB4lIfEdMrUD8wyxySUZ32VazRBK6VKwjlwNTA5Ntv3zeW0mDHNAgSVNoAMBX7yxfOnI9 B0yNNAhW1WbPFFJZwy0nl/6WDwITj4q8qxaJ8bSfXNZOggnPilvsPEx88R4nh0rQzE1Vtdf/KVr qHTSkaDYrZA6q2vC045maGcwLTjDjh8WLlBgnrkRyDnLJqmHjgNwpmlwd7RrEk0v6BP9Ci9H7zo F7H4EilJ8Z1A+2RobTvqFPe8S2EO2/4RcL+8SZaVtXJQyhigGwoBOBspynSXwuNcwBhP6tXTsxu RBDau6l90HwMSPIVRaUE7NTSe3B9C3+mwtOGpM7K0hWIX+tgcNO1hEbYtPP22qeA7mWxzHi12QH LhVJJ0MKBj+Zbtg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787052288840158500 Signed-off-by: Marc-Andr=C3=A9 Lureau --- accel/kvm/kvm-all.c | 5 ++- accel/nitro/nitro-accel.c | 3 +- accel/tcg/tcg-all.c | 3 +- backends/cryptodev.c | 7 ++-- backends/hostmem-file.c | 4 +- backends/hostmem-memfd.c | 3 +- backends/hostmem.c | 6 +-- block/throttle-groups.c | 5 ++- crypto/secret_keyring.c | 9 +++-- event-loop-base.c | 7 ++-- hw/acpi/ich9.c | 3 +- hw/acpi/pci.c | 7 ++-- hw/arm/virt.c | 4 +- hw/core/clock.c | 3 +- hw/core/machine.c | 2 +- hw/cpu/core.c | 10 +++-- hw/cxl/cxl-host.c | 2 +- hw/gpio/aspeed_gpio.c | 5 ++- hw/gpio/aspeed_sgpio.c | 3 +- hw/gpio/stm32l4x5_gpio.c | 5 ++- hw/i386/pc.c | 6 +-- hw/i386/sgx-epc.c | 3 +- hw/i386/x86.c | 6 +-- hw/ide/ide-dev.c | 3 +- hw/intc/apic_common.c | 3 +- hw/loongarch/virt.c | 2 +- hw/mem/nvdimm.c | 7 ++-- hw/mem/pc-dimm.c | 3 +- hw/misc/aspeed_lpc.c | 73 +++++++++++++++++++++++++--------= ---- hw/misc/aspeed_sdmc.c | 3 +- hw/misc/npcm7xx_mft.c | 3 +- hw/net/ne2000-isa.c | 3 +- hw/nvme/ctrl.c | 3 +- hw/pci-bridge/pci_expander_bridge.c | 3 +- hw/pci-host/i440fx.c | 29 +++++++++------ hw/pci-host/pnv_phb3.c | 5 ++- hw/pci-host/pnv_phb4.c | 5 ++- hw/pci-host/q35.c | 9 +++-- hw/ppc/spapr_drc.c | 3 +- hw/riscv/microchip_pfsoc.c | 3 +- hw/s390x/sclpcpi.c | 8 ++-- hw/s390x/virtio-ccw-mem.c | 3 +- hw/sensor/adc128d818.c | 16 +++++--- hw/sensor/adm1266.c | 3 +- hw/sensor/adm1272.c | 9 +++-- hw/sensor/emc141x.c | 9 +++-- hw/sensor/isl_pmbus_vr.c | 19 +++++----- hw/sensor/lsm303dlhc_mag.c | 9 +++-- hw/sensor/max34451.c | 5 ++- hw/sensor/tmp105.c | 3 +- hw/sensor/tmp421.c | 9 +++-- hw/usb/dev-storage-classic.c | 3 +- hw/virtio/virtio-balloon.c | 3 +- hw/virtio/virtio-mem-pci.c | 3 +- hw/virtio/virtio-mem.c | 18 +++++---- hw/xen/xen-pvh-common.c | 9 +++-- iothread.c | 9 +++-- net/colo-compare.c | 7 ++-- net/dump.c | 6 ++- net/filter-buffer.c | 3 +- qom/object.c | 42 ++++++++++----------- system/bootdevice.c | 3 +- system/memory.c | 5 ++- target/arm/cpu64.c | 11 +++--- target/arm/kvm.c | 3 +- target/arm/tcg/cpu64.c | 5 ++- target/i386/cpu.c | 12 +++--- target/i386/kvm/kvm.c | 8 ++-- target/i386/sev.c | 2 +- target/ppc/compat.c | 3 +- target/riscv/cpu.c | 15 ++++---- target/riscv/kvm/kvm-cpu.c | 7 ++-- target/riscv/tcg/tcg-cpu.c | 13 ++++--- target/s390x/cpu_models.c | 5 ++- tests/unit/test-qdev-global-props.c | 11 ++++-- ui/console.c | 3 +- util/thread-context.c | 7 ++-- 77 files changed, 341 insertions(+), 239 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index e2cfbcf44046..ff9db3ca8b3d 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" @@ -4278,13 +4279,13 @@ static void kvm_accel_class_init(ObjectClass *oc, c= onst void *data) .description =3D "Configure KVM in-kernel irqchip", )); =20 - object_class_property_add(oc, "kvm-shadow-mem", "int", + object_class_property_add_qapi(oc, "kvm-shadow-mem", &int_type_info, kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_mem, NULL, NULL); object_class_property_set_description(oc, "kvm-shadow-mem", "KVM shadow MMU size"); =20 - object_class_property_add(oc, "dirty-ring-size", "uint32", + object_class_property_add_qapi(oc, "dirty-ring-size", &uint32_type_inf= o, kvm_get_dirty_ring_size, kvm_set_dirty_ring_size, NULL, NULL); object_class_property_set_description(oc, "dirty-ring-size", diff --git a/accel/nitro/nitro-accel.c b/accel/nitro/nitro-accel.c index a1e97a9162e9..05841c1277dc 100644 --- a/accel/nitro/nitro-accel.c +++ b/accel/nitro/nitro-accel.c @@ -29,6 +29,7 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qemu/rcu.h" @@ -238,7 +239,7 @@ static void nitro_accel_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, "debug-mode", "Start enclave in debug mode (enables console output)"); =20 - object_class_property_add(oc, "enclave-cid", "uint64", + object_class_property_add_qapi(oc, "enclave-cid", &uint64_type_info, nitro_get_enclave_cid, nitro_set_enclave_cid, NULL, NULL); diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 767e8805552f..277cf0e2d012 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -29,6 +29,7 @@ #include "exec/icount.h" #include "tcg/startup.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/error-report.h" #include "qemu/accel.h" #include "qemu/atomic.h" @@ -270,7 +271,7 @@ static void tcg_accel_class_init(ObjectClass *oc, const= void *data) tcg_get_thread, tcg_set_thread); =20 - object_class_property_add(oc, "tb-size", "uint32", + object_class_property_add_qapi(oc, "tb-size", &uint32_type_info, tcg_get_tb_size, tcg_set_tb_size, NULL, NULL); object_class_property_set_description(oc, "tb-size", diff --git a/backends/cryptodev.c b/backends/cryptodev.c index e8f2b18f2017..a69adb70440c 100644 --- a/backends/cryptodev.c +++ b/backends/cryptodev.c @@ -25,6 +25,7 @@ #include "system/cryptodev.h" #include "system/stats.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-commands-cryptodev.h" #include "qapi/qapi-types-stats.h" #include "qapi/visitor.h" @@ -622,15 +623,15 @@ cryptodev_backend_class_init(ObjectClass *oc, const v= oid *data) ucc->prepare_delete =3D cryptodev_backend_prepare_delete; =20 QTAILQ_INIT(&crypto_clients); - object_class_property_add(oc, "queues", "uint32", + object_class_property_add_qapi(oc, "queues", &uint32_type_info, cryptodev_backend_get_queues, cryptodev_backend_set_queues, NULL, NULL); - object_class_property_add(oc, "throttle-bps", "uint64", + object_class_property_add_qapi(oc, "throttle-bps", &uint64_type_info, cryptodev_backend_get_bps, cryptodev_backend_set_bps, NULL, NULL); - object_class_property_add(oc, "throttle-ops", "uint64", + object_class_property_add_qapi(oc, "throttle-ops", &uint64_type_info, cryptodev_backend_get_ops, cryptodev_backend_set_ops, NULL, NULL); diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 39a46d353839..5d339ca426cb 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", "size", + object_class_property_add_qapi(oc, "align", &size_type_info, file_memory_backend_get_align, file_memory_backend_set_align, NULL, NULL); - object_class_property_add(oc, "offset", "int", + object_class_property_add_qapi(oc, "offset", &int_type_info, file_memory_backend_get_offset, file_memory_backend_set_offset, NULL, NULL); diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index 77f7eab40fe0..8fa77b3429eb 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" =20 @@ -145,7 +146,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", "size", + object_class_property_add_qapi(oc, "hugetlbsize", &size_type_info, memfd_backend_get_hugetlbsize, memfd_backend_set_hugetlbsize, NULL, NULL); diff --git a/backends/hostmem.c b/backends/hostmem.c index e7f9b436a459..d05ab53ab662 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -529,7 +529,7 @@ host_memory_backend_class_init(ObjectClass *oc, const v= oid *data) host_memory_backend_set_prealloc); object_class_property_set_description(oc, "prealloc", "Preallocate memory"); - object_class_property_add(oc, "prealloc-threads", "int", + object_class_property_add_qapi(oc, "prealloc-threads", &int_type_info, host_memory_backend_get_prealloc_threads, host_memory_backend_set_prealloc_threads, NULL, NULL); @@ -540,13 +540,13 @@ host_memory_backend_class_init(ObjectClass *oc, const= void *data) object_property_allow_set_link, OBJ_PROP_LINK_STRONG); object_class_property_set_description(oc, "prealloc-context", "Context to use for creating CPU threads for preallocation"); - object_class_property_add(oc, "size", "size", + object_class_property_add_qapi(oc, "size", &size_type_info, host_memory_backend_get_size, host_memory_backend_set_size, NULL, NULL); object_class_property_set_description(oc, "size", "Size of the memory region (ex: 500M)"); - object_class_property_add(oc, "host-nodes", "[uint16]", + object_class_property_add_qapi(oc, "host-nodes", &uint16List_type_info, host_memory_backend_get_host_nodes, host_memory_backend_set_host_nodes, NULL, NULL); diff --git a/block/throttle-groups.c b/block/throttle-groups.c index 6312157802da..851617237f80 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" @@ -983,9 +984,9 @@ static void throttle_group_obj_class_init(ObjectClass *= klass, =20 /* individual properties */ for (i =3D 0; i < sizeof(properties) / sizeof(ThrottleParamInfo); i++)= { - object_class_property_add(klass, + object_class_property_add_qapi(klass, properties[i].name, - "int64", + &int64_type_info, throttle_group_get, throttle_group_set, NULL, &properties[i]); diff --git a/crypto/secret_keyring.c b/crypto/secret_keyring.c index 78d7f09b3b97..de813e79d8d6 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" @@ -108,10 +109,10 @@ qcrypto_secret_keyring_class_init(ObjectClass *oc, co= nst void *data) QCryptoSecretCommonClass *sic =3D QCRYPTO_SECRET_COMMON_CLASS(oc); sic->load_data =3D qcrypto_secret_keyring_load_data; =20 - object_class_property_add(oc, "serial", "int32_t", - qcrypto_secret_prop_get_key, - qcrypto_secret_prop_set_key, - NULL, NULL); + object_class_property_add_qapi(oc, "serial", &int32_type_info, + qcrypto_secret_prop_get_key, + qcrypto_secret_prop_set_key, + NULL, NULL); } =20 =20 diff --git a/event-loop-base.c b/event-loop-base.c index 23f554d92ce8..c16c5366f680 100644 --- a/event-loop-base.c +++ b/event-loop-base.c @@ -14,6 +14,7 @@ #include "qemu/osdep.h" #include "qom/object_interfaces.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "block/thread-pool.h" #include "system/event-loop-base.h" =20 @@ -104,15 +105,15 @@ static void event_loop_base_class_init(ObjectClass *k= lass, ucc->complete =3D event_loop_base_complete; ucc->prepare_delete =3D event_loop_base_prepare_delete; =20 - object_class_property_add(klass, "aio-max-batch", "int64", + object_class_property_add_qapi(klass, "aio-max-batch", &int64_type_inf= o, event_loop_base_get_param, event_loop_base_set_param, NULL, &aio_max_batch_info); - object_class_property_add(klass, "thread-pool-min", "int64", + object_class_property_add_qapi(klass, "thread-pool-min", &int64_type_i= nfo, event_loop_base_get_param, event_loop_base_set_param, NULL, &thread_pool_min_info); - object_class_property_add(klass, "thread-pool-max", "int64", + object_class_property_add_qapi(klass, "thread-pool-max", &int64_type_i= nfo, event_loop_base_get_param, event_loop_base_set_param, NULL, &thread_pool_max_info); diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 5e8f8a7eafa3..3bf895672d50 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" @@ -409,7 +410,7 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs = *pm) (Object **)&pm->acpi_pci_hotplug.root, object_property_allow_set_link, OBJ_PROP_LINK_STRONG); - object_property_add(obj, ACPI_PM_PROP_GPE0_BLK, "uint32", + object_property_add_qapi(obj, ACPI_PM_PROP_GPE0_BLK, &uint32_type_info, ich9_pm_get_gpe0_blk, NULL, NULL, pm); object_property_add_uint32_ptr(obj, ACPI_PM_PROP_GPE0_BLK_LEN, diff --git a/hw/acpi/pci.c b/hw/acpi/pci.c index c82924be8620..71d01307e141 100644 --- a/hw/acpi/pci.c +++ b/hw/acpi/pci.c @@ -27,6 +27,7 @@ #include "qemu/error-report.h" #include "qom/object_interfaces.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "hw/core/boards.h" #include "hw/acpi/aml-build.h" #include "hw/acpi/pci.h" @@ -139,7 +140,7 @@ static void acpi_generic_initiator_class_init(ObjectCla= ss *oc, const void *data) acpi_generic_initiator_set_pci_device); object_class_property_set_description(oc, "pci-dev", "PCI device to associate with the node"); - object_class_property_add(oc, "node", "uint32", NULL, + object_class_property_add_qapi(oc, "node", &uint32_type_info, NULL, acpi_generic_initiator_set_node, NULL, NULL); object_class_property_set_description(oc, "node", "NUMA node associated with the PCI device"); @@ -253,8 +254,8 @@ static void acpi_generic_port_class_init(ObjectClass *o= c, const void *data) acpi_generic_port_set_pci_bus); object_class_property_set_description(oc, "pci-bus", "PCI Bus of the host bridge associated with this GP affinity struct= ure"); - object_class_property_add(oc, "node", "uint32", NULL, - acpi_generic_port_set_node, NULL, NULL); + object_class_property_add_qapi(oc, "node", &uint32_type_info, NULL, + acpi_generic_port_set_node, NULL, NULL); object_class_property_set_description(oc, "node", "The NUMA node like ID to index HMAT/SLIT NUMA properties involving= GP"); } diff --git a/hw/arm/virt.c b/hw/arm/virt.c index f283703fb002..8ec51f3b1a00 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -4258,7 +4258,7 @@ static void virt_machine_class_init(ObjectClass *oc, = const void *data) "Set on/off to enable/disable hi= gh " "memory region for PCI MMIO"); =20 - object_class_property_add(oc, "highmem-mmio-size", "size", + object_class_property_add_qapi(oc, "highmem-mmio-size", &size_type_inf= o, virt_get_highmem_mmio_size, virt_set_highmem_mmio_size, NULL, NULL); @@ -4266,7 +4266,7 @@ static void virt_machine_class_init(ObjectClass *oc, = const void *data) "Set the high memory region size= " "for PCI MMIO"); =20 - object_class_property_add(oc, "virtio-mmio-transports", "uint8", + object_class_property_add_qapi(oc, "virtio-mmio-transports", &uint8_ty= pe_info, virt_get_virtio_transports, virt_set_virtio_transports, NULL, NULL); diff --git a/hw/core/clock.c b/hw/core/clock.c index 3fc98a0c65d5..f55cb17af77e 100644 --- a/hw/core/clock.c +++ b/hw/core/clock.c @@ -13,6 +13,7 @@ =20 #include "qemu/osdep.h" #include "qemu/cutils.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "system/qtest.h" #include "hw/core/clock.h" @@ -185,7 +186,7 @@ static void clock_initfn(Object *obj) QLIST_INIT(&clk->children); =20 if (qtest_enabled()) { - object_property_add(obj, "qtest-clock-period", "uint64", + object_property_add_qapi(obj, "qtest-clock-period", &uint64_type_i= nfo, clock_period_prop_get, NULL, NULL, NULL); } } diff --git a/hw/core/machine.c b/hw/core/machine.c index cd9636dde6e6..85a9d428473f 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1133,7 +1133,7 @@ static void machine_class_init(ObjectClass *oc, const= void *data) object_class_property_set_description(oc, "smp-cache", "Cache properties list for SMP machine"); =20 - object_class_property_add(oc, "phandle-start", "int", + object_class_property_add_qapi(oc, "phandle-start", &int_type_info, machine_get_phandle_start, machine_set_phandle_start, NULL, NULL); object_class_property_set_description(oc, "phandle-start", diff --git a/hw/cpu/core.c b/hw/cpu/core.c index 26e488f3d8e3..d7c89f47ab04 100644 --- a/hw/cpu/core.c +++ b/hw/cpu/core.c @@ -12,6 +12,7 @@ #include "hw/core/boards.h" #include "hw/cpu/core.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" =20 static void core_prop_get_core_id(Object *obj, Visitor *v, const char *nam= e, @@ -82,10 +83,11 @@ static void cpu_core_class_init(ObjectClass *oc, const = void *data) DeviceClass *dc =3D DEVICE_CLASS(oc); =20 set_bit(DEVICE_CATEGORY_CPU, dc->categories); - object_class_property_add(oc, "core-id", "int", core_prop_get_core_id, - core_prop_set_core_id, NULL, NULL); - object_class_property_add(oc, "nr-threads", "int", core_prop_get_nr_th= reads, - core_prop_set_nr_threads, NULL, NULL); + object_class_property_add_qapi(oc, "core-id", &int_type_info, core_pro= p_get_core_id, + core_prop_set_core_id, NULL, NULL); + object_class_property_add_qapi(oc, "nr-threads", &int_type_info, + core_prop_get_nr_threads, core_prop_set= _nr_threads, + NULL, NULL); } =20 static const TypeInfo cpu_core_type_info =3D { diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index 7592c4ac6c7b..4133398fec48 100644 --- a/hw/cxl/cxl-host.c +++ b/hw/cxl/cxl-host.c @@ -565,7 +565,7 @@ static void machine_set_cfmw(Object *obj, Visitor *v, c= onst char *name, =20 void cxl_machine_init(Object *obj, CXLState *state) { - object_property_add(obj, "cxl", "bool", machine_get_cxl, + object_property_add_qapi(obj, "cxl", &bool_type_info, machine_get_cxl, machine_set_cxl, NULL, state); object_property_set_description(obj, "cxl", "Set on/off to enable/disable " diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c index 1cf6f5df5505..0c90bcd723da 100644 --- a/hw/gpio/aspeed_gpio.c +++ b/hw/gpio/aspeed_gpio.c @@ -12,6 +12,7 @@ #include "hw/gpio/aspeed_gpio.h" #include "hw/misc/aspeed_scu.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/irq.h" #include "migration/vmstate.h" @@ -1481,7 +1482,7 @@ static void aspeed_gpio_init(Object *obj) int pin_idx =3D j % GPIOS_PER_GROUP; const char *group =3D &props->group_label[group_idx][0]; char *name =3D g_strdup_printf("gpio%s%d", group, pin_idx); - object_property_add(obj, name, "bool", aspeed_gpio_get_pin, + object_property_add_qapi(obj, name, &bool_type_info, aspeed_gp= io_get_pin, aspeed_gpio_set_pin, NULL, NULL); g_free(name); } @@ -1489,7 +1490,7 @@ static void aspeed_gpio_init(Object *obj) =20 for (int i =3D 0; i < agc->nr_gpio_sets; i++) { g_autofree char *name =3D g_strdup_printf("gpio-set[%d]", i); - object_property_add(obj, name, "uint32", aspeed_gpio_get_set, + object_property_add_qapi(obj, name, &uint32_type_info, aspeed_gpio= _get_set, aspeed_gpio_set_set, NULL, NULL); } } diff --git a/hw/gpio/aspeed_sgpio.c b/hw/gpio/aspeed_sgpio.c index 7d2f73699520..67b0c10d79fa 100644 --- a/hw/gpio/aspeed_sgpio.c +++ b/hw/gpio/aspeed_sgpio.c @@ -11,6 +11,7 @@ #include "qemu/log.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/irq.h" #include "hw/core/qdev-properties.h" @@ -300,7 +301,7 @@ static void aspeed_sgpio_init(Object *obj) { for (int i =3D 0; i < ASPEED_SGPIO_MAX_PIN_PAIR * 2; i++) { g_autofree char *name =3D g_strdup_printf("sgpio%03d", i); - object_property_add(obj, name, "bool", aspeed_sgpio_get_pin, + object_property_add_qapi(obj, name, &bool_type_info, aspeed_sgpio_= get_pin, aspeed_sgpio_set_pin, NULL, NULL); } } diff --git a/hw/gpio/stm32l4x5_gpio.c b/hw/gpio/stm32l4x5_gpio.c index 92fa397fbafe..d349d41e41a1 100644 --- a/hw/gpio/stm32l4x5_gpio.c +++ b/hw/gpio/stm32l4x5_gpio.c @@ -25,6 +25,7 @@ #include "hw/core/qdev-properties.h" #include "qapi/visitor.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "migration/vmstate.h" #include "trace.h" =20 @@ -409,10 +410,10 @@ static void stm32l4x5_gpio_init(Object *obj) =20 s->clk =3D qdev_init_clock_in(DEVICE(s), "clk", NULL, s, 0); =20 - object_property_add(obj, "disconnected-pins", "uint16", + object_property_add_qapi(obj, "disconnected-pins", &uint16_type_info, disconnected_pins_get, disconnected_pins_set, NULL, &s->disconnected_pins); - object_property_add(obj, "clock-freq-hz", "uint32", + object_property_add_qapi(obj, "clock-freq-hz", &uint32_type_info, clock_freq_get, NULL, NULL, NULL); } =20 diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 18b5dc169ab7..24c4c589ed04 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1720,7 +1720,7 @@ static void pc_machine_class_init(ObjectClass *oc, co= nst void *data) mc->default_ram_id =3D "pc.ram"; pcmc->default_smbios_ep_type =3D SMBIOS_ENTRY_POINT_TYPE_AUTO; =20 - object_class_property_add(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "size", + object_class_property_add_qapi(oc, PC_MACHINE_MAX_RAM_BELOW_4G, &size_= type_info, pc_machine_get_max_ram_below_4g, pc_machine_set_max_ram_below_4g, NULL, NULL); object_class_property_set_description(oc, PC_MACHINE_MAX_RAM_BELOW_4G, @@ -1758,13 +1758,13 @@ static void pc_machine_class_init(ObjectClass *oc, = const void *data) pc_machine_get_default_bus_bypass_iommu, pc_machine_set_default_bus_bypass_iommu); =20 - object_class_property_add(oc, PC_MACHINE_MAX_FW_SIZE, "size", + object_class_property_add_qapi(oc, PC_MACHINE_MAX_FW_SIZE, &size_type_= info, pc_machine_get_max_fw_size, pc_machine_set_max_fw_size, NULL, NULL); object_class_property_set_description(oc, PC_MACHINE_MAX_FW_SIZE, "Maximum combined firmware size"); =20 - object_class_property_add(oc, PC_MACHINE_SMBIOS_EP, "str", + object_class_property_add_qapi(oc, PC_MACHINE_SMBIOS_EP, &str_type_inf= o, pc_machine_get_smbios_ep, pc_machine_set_smbios_ep, NULL, NULL); object_class_property_set_description(oc, PC_MACHINE_SMBIOS_EP, diff --git a/hw/i386/sgx-epc.c b/hw/i386/sgx-epc.c index d3fe10028c51..d9b9ab3f7a96 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" @@ -43,7 +44,7 @@ static void sgx_epc_get_size(Object *obj, Visitor *v, con= st char *name, =20 static void sgx_epc_init(Object *obj) { - object_property_add(obj, SGX_EPC_SIZE_PROP, "uint64", sgx_epc_get_size, + object_property_add_qapi(obj, SGX_EPC_SIZE_PROP, &uint64_type_info, sg= x_epc_get_size, NULL, NULL, NULL); } =20 diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 63f297a10532..d0c782ec8544 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -420,9 +420,9 @@ static void x86_machine_class_init(ObjectClass *oc, con= st void *data) "in ACPI table header." "The string may be up to 8 bytes= in size"); =20 - object_class_property_add(oc, X86_MACHINE_BUS_LOCK_RATELIMIT, "uint64_= t", - x86_machine_get_bus_lock_ratelimit, - x86_machine_set_bus_lock_ratelimit, NULL, = NULL); + object_class_property_add_qapi(oc, X86_MACHINE_BUS_LOCK_RATELIMIT, &ui= nt64_type_info, + x86_machine_get_bus_lock_ratelimit, + x86_machine_set_bus_lock_ratelimit, NUL= L, NULL); object_class_property_set_description(oc, X86_MACHINE_BUS_LOCK_RATELIM= IT, "Set the ratelimit for the bus locks acquired in VMs"); =20 diff --git a/hw/ide/ide-dev.c b/hw/ide/ide-dev.c index 5d478588c614..e2dd2439991f 100644 --- a/hw/ide/ide-dev.c +++ b/hw/ide/ide-dev.c @@ -19,6 +19,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-types-block.h" #include "qemu/error-report.h" #include "qemu/module.h" @@ -174,7 +175,7 @@ out: =20 static void ide_dev_instance_init(Object *obj) { - object_property_add(obj, "bootindex", "int32", + object_property_add_qapi(obj, "bootindex", &int32_type_info, ide_dev_get_bootindex, ide_dev_set_bootindex, NULL, NULL); object_property_set_int(obj, "bootindex", -1, NULL); diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c index 0f0f37d45734..dc0517ceea90 100644 --- a/hw/intc/apic_common.c +++ b/hw/intc/apic_common.c @@ -22,6 +22,7 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/i386/apic.h" #include "hw/i386/apic_internal.h" @@ -442,7 +443,7 @@ static void apic_common_initfn(Object *obj) APICCommonState *s =3D APIC_COMMON(obj); =20 s->id =3D s->initial_apic_id =3D -1; - object_property_add(obj, "id", "uint32", + object_property_add_qapi(obj, "id", &uint32_type_info, apic_common_get_id, apic_common_set_id, NULL, NULL); } diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 750ce2dbe5fc..209a0feddd80 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -1520,7 +1520,7 @@ static void virt_class_init(ObjectClass *oc, const vo= id *data) object_class_property_set_description(oc, "highmem-mmio", "Set on/off to enable/disable hi= gh " "memory region for PCI MMIO"); - object_class_property_add(oc, "highmem-mmio-size", "size", + object_class_property_add_qapi(oc, "highmem-mmio-size", &size_type_inf= o, virt_get_highmem_mmio_size, virt_set_highmem_mmio_size, NULL, NULL); diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index cf8a4d8c5f2a..123ddc938546 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -26,6 +26,7 @@ #include "qemu/module.h" #include "qemu/pmem.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/mem/nvdimm.h" #include "hw/core/qdev-properties.h" @@ -99,9 +100,9 @@ static void nvdimm_set_uuid(Object *obj, Visitor *v, con= st char *name, =20 static void nvdimm_init(Object *obj) { - object_property_add(obj, NVDIMM_LABEL_SIZE_PROP, "size", - nvdimm_get_label_size, nvdimm_set_label_size, NULL, - NULL); + object_property_add_qapi(obj, NVDIMM_LABEL_SIZE_PROP, &size_type_info, + nvdimm_get_label_size, nvdimm_set_label_size,= NULL, + NULL); =20 object_property_add(obj, NVDIMM_UUID_PROP, "QemuUUID", nvdimm_get_uuid, nvdimm_set_uuid, NULL, NULL); diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 68862926ee2d..ee586ecc0c7d 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -26,6 +26,7 @@ #include "hw/mem/nvdimm.h" #include "hw/mem/memory-device.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "system/hostmem.h" @@ -176,7 +177,7 @@ static void pc_dimm_get_size(Object *obj, Visitor *v, c= onst char *name, =20 static void pc_dimm_init(Object *obj) { - object_property_add(obj, PC_DIMM_SIZE_PROP, "uint64", pc_dimm_get_size, + object_property_add_qapi(obj, PC_DIMM_SIZE_PROP, &uint64_type_info, pc= _dimm_get_size, NULL, NULL, NULL); } =20 diff --git a/hw/misc/aspeed_lpc.c b/hw/misc/aspeed_lpc.c index 7f7e4f1a0985..e2d9b7572f27 100644 --- a/hw/misc/aspeed_lpc.c +++ b/hw/misc/aspeed_lpc.c @@ -12,6 +12,7 @@ #include "qemu/error-report.h" #include "hw/misc/aspeed_lpc.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/irq.h" #include "hw/core/qdev-properties.h" @@ -417,30 +418,54 @@ static void aspeed_lpc_realize(DeviceState *dev, Erro= r **errp) =20 static void aspeed_lpc_init(Object *obj) { - object_property_add(obj, "idr1", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr1", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str1", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr2", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr2", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str2", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr3", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr3", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str3", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr4", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr4", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str4", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); + object_property_add_qapi(obj, "idr1", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "odr1", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "str1", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "idr2", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "odr2", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "str2", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "idr3", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "odr3", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "str3", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "idr4", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "odr4", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "str4", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); } =20 static const VMStateDescription vmstate_aspeed_lpc =3D { diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c index f8fbaebee6ab..d096cc88f5c5 100644 --- a/hw/misc/aspeed_sdmc.c +++ b/hw/misc/aspeed_sdmc.c @@ -15,6 +15,7 @@ #include "hw/core/qdev-properties.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "trace.h" #include "qemu/units.h" #include "qemu/cutils.h" @@ -259,7 +260,7 @@ static void aspeed_sdmc_set_ram_size(Object *obj, Visit= or *v, const char *name, =20 static void aspeed_sdmc_initfn(Object *obj) { - object_property_add(obj, "ram-size", "int", + object_property_add_qapi(obj, "ram-size", &int_type_info, aspeed_sdmc_get_ram_size, aspeed_sdmc_set_ram_size, NULL, NULL); } diff --git a/hw/misc/npcm7xx_mft.c b/hw/misc/npcm7xx_mft.c index 742166c4e828..99e9e49788c0 100644 --- a/hw/misc/npcm7xx_mft.c +++ b/hw/misc/npcm7xx_mft.c @@ -23,6 +23,7 @@ #include "hw/core/registerfields.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/bitops.h" #include "qemu/error-report.h" @@ -491,7 +492,7 @@ static void npcm7xx_mft_init(Object *obj) s->clock_2 =3D qdev_init_clock_out(dev, "clock2"); =20 for (int i =3D 0; i < NPCM7XX_PWM_PER_MODULE; ++i) { - object_property_add(obj, "max_rpm[*]", "uint32", + object_property_add_qapi(obj, "max_rpm[*]", &uint32_type_info, npcm7xx_mft_get_max_rpm, npcm7xx_mft_set_max_rpm, NULL, &s->max_rpm[i]); diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c index 673c785abc94..63e0d40ee726 100644 --- a/hw/net/ne2000-isa.c +++ b/hw/net/ne2000-isa.c @@ -29,6 +29,7 @@ #include "ne2000.h" #include "system/system.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qom/object.h" @@ -131,7 +132,7 @@ out: =20 static void isa_ne2000_instance_init(Object *obj) { - object_property_add(obj, "bootindex", "int32", + object_property_add_qapi(obj, "bootindex", &int32_type_info, isa_ne2000_get_bootindex, isa_ne2000_set_bootindex, NULL, NULL); object_property_set_int(obj, "bootindex", -1, NULL); diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 4893cf7e7418..e4549aa9e534 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" @@ -10578,7 +10579,7 @@ static void nvme_instance_init(Object *obj) "bootindex", "/namespace@1,0", DEVICE(obj)); =20 - object_property_add(obj, "smart_critical_warning", "uint8", + object_property_add_qapi(obj, "smart_critical_warning", &uint8_type_in= fo, nvme_get_smart_warning, nvme_set_smart_warning, NULL, NULL); } diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expand= er_bridge.c index 40ffbc4e0821..9bb7d3c9debe 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -12,6 +12,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "hw/pci/pci.h" #include "hw/pci/pci_bus.h" #include "hw/pci/pci_host.h" @@ -103,7 +104,7 @@ static void pxb_bus_class_init(ObjectClass *class, cons= t void *data) pbc->bus_num =3D pxb_bus_num; pbc->numa_node =3D pxb_bus_numa_node; =20 - object_class_property_add(class, "acpi_uid", "uint32", + object_class_property_add_qapi(class, "acpi_uid", &uint32_type_info, prop_pxb_uid_get, NULL, NULL, NULL); object_class_property_set_description(class, "acpi_uid", "ACPI Unique ID used to distinguish this PCI Host Bridge / ACPI000= 16"); diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index c1982f7962a6..feafa6a72fe4 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -32,6 +32,7 @@ #include "hw/core/qdev-properties.h" #include "hw/core/sysbus.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "migration/vmstate.h" #include "qapi/visitor.h" #include "qemu/error-report.h" @@ -387,21 +388,25 @@ static void i440fx_pcihost_class_init(ObjectClass *kl= ass, const void *data) /* Reason: needs to be wired up by pc_init1 */ dc->user_creatable =3D false; =20 - object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_START, "uint32= ", - i440fx_pcihost_get_pci_hole_start, - NULL, NULL, NULL); + object_class_property_add_qapi(klass, PCI_HOST_PROP_PCI_HOLE_START, + &uint32_type_info, + i440fx_pcihost_get_pci_hole_start, + NULL, NULL, NULL); =20 - object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_END, "uint32", - i440fx_pcihost_get_pci_hole_end, - NULL, NULL, NULL); + object_class_property_add_qapi(klass, PCI_HOST_PROP_PCI_HOLE_END, + &uint32_type_info, + i440fx_pcihost_get_pci_hole_end, + NULL, NULL, NULL); =20 - object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE64_START, "uint= 64", - i440fx_pcihost_get_pci_hole64_start, - NULL, NULL, NULL); + object_class_property_add_qapi(klass, PCI_HOST_PROP_PCI_HOLE64_START, + &uint64_type_info, + i440fx_pcihost_get_pci_hole64_start, + NULL, NULL, NULL); =20 - object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE64_END, "uint64= ", - i440fx_pcihost_get_pci_hole64_end, - NULL, NULL, NULL); + object_class_property_add_qapi(klass, PCI_HOST_PROP_PCI_HOLE64_END, + &uint64_type_info, + i440fx_pcihost_get_pci_hole64_end, + NULL, NULL, NULL); } =20 static const TypeInfo i440fx_pcihost_info =3D { diff --git a/hw/pci-host/pnv_phb3.c b/hw/pci-host/pnv_phb3.c index 0471b009ec2f..0ea5e695a688 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", "size", + object_class_property_add_qapi(klass, "phb-id", &size_type_info, pnv_phb3_root_bus_get_prop, pnv_phb3_root_bus_set_prop, NULL, NULL); =20 - object_class_property_add(klass, "chip-id", "size", + object_class_property_add_qapi(klass, "chip-id", &size_type_info, pnv_phb3_root_bus_get_prop, pnv_phb3_root_bus_set_prop, NULL, NULL); diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index 510edebc40de..6ca16158575d 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -11,6 +11,7 @@ #include "qemu/bswap.h" #include "qapi/visitor.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "target/ppc/cpu.h" #include "hw/pci-host/pnv_phb4_regs.h" #include "hw/pci-host/pnv_phb4.h" @@ -1761,12 +1762,12 @@ static void pnv_phb4_root_bus_class_init(ObjectClas= s *klass, const void *data) { BusClass *k =3D BUS_CLASS(klass); =20 - object_class_property_add(klass, "phb-id", "size", + object_class_property_add_qapi(klass, "phb-id", &size_type_info, pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop, NULL, NULL); =20 - object_class_property_add(klass, "chip-id", "size", + object_class_property_add_qapi(klass, "chip-id", &size_type_info, pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop, NULL, NULL); diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index f4556ad03a04..6eba30e06811 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -35,6 +35,7 @@ #include "hw/core/qdev-properties.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" =20 @@ -226,19 +227,19 @@ static void q35_host_initfn(Object *obj) qdev_prop_set_uint64(DEVICE(s), PCI_HOST_PROP_PCI_HOLE64_SIZE, Q35_PCI_HOST_HOLE64_SIZE_DEFAULT); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE_START, &uint32_ty= pe_info, q35_host_get_pci_hole_start, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE_END, &uint32_type= _info, q35_host_get_pci_hole_end, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE64_START, &uint64_= type_info, q35_host_get_pci_hole64_start, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE64_END, &uint64_ty= pe_info, q35_host_get_pci_hole64_end, NULL, NULL, NULL); =20 diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 5c2150b71c86..64f9ca29b02e 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -12,6 +12,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qobject/qnull.h" #include "qemu/cutils.h" #include "hw/ppc/spapr_drc.h" @@ -584,7 +585,7 @@ static void spapr_dr_connector_instance_init(Object *ob= j) SpaprDrcClass *drck =3D SPAPR_DR_CONNECTOR_GET_CLASS(drc); =20 object_property_add_uint32_ptr(obj, "id", &drc->id, OBJ_PROP_FLAG_READ= ); - object_property_add(obj, "index", "uint32", prop_get_index, + object_property_add_qapi(obj, "index", &uint32_type_info, prop_get_ind= ex, NULL, NULL, NULL); object_property_add(obj, "fdt", "struct", prop_get_fdt, NULL, NULL, NULL); diff --git a/hw/riscv/microchip_pfsoc.c b/hw/riscv/microchip_pfsoc.c index 4017129c8304..19788590cddc 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" @@ -742,7 +743,7 @@ static void microchip_icicle_kit_machine_class_init(Obj= ectClass *oc, */ mc->default_ram_size =3D 1537 * MiB; =20 - object_class_property_add(oc, "clint-timebase-frequency", "uint32_t", + object_class_property_add_qapi(oc, "clint-timebase-frequency", &uint32= _type_info, microchip_icicle_kit_get_clint_timebase_freq, microchip_icicle_kit_set_clint_timebase_freq, NULL, NULL); diff --git a/hw/s390x/sclpcpi.c b/hw/s390x/sclpcpi.c index ec4bdf23509b..97d37ae4b932 100644 --- a/hw/s390x/sclpcpi.c +++ b/hw/s390x/sclpcpi.c @@ -53,6 +53,7 @@ #include "qemu/timer.h" #include "hw/s390x/event-facility.h" #include "hw/s390x/ebcdic.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-visit-machine.h" #include "qapi/qapi-events-machine-s390x.h" #include "migration/vmstate.h" @@ -195,12 +196,13 @@ static void cpi_class_init(ObjectClass *klass, const = void *data) "name of the cluster which the VM belongs to, if any" " e.g. \"PLEX \""); =20 - object_class_property_add(klass, "system_level", "uint64", get_system_= level, - NULL, NULL, NULL); + object_class_property_add_qapi(klass, "system_level", + &uint64_type_info, get_system_level, + NULL, NULL, NULL); object_class_property_set_description(klass, "system_level", "distribution and kernel version in Linux e.g. 748723438054305= 28"); =20 - object_class_property_add(klass, "timestamp", "uint64", get_timestamp, + object_class_property_add_qapi(klass, "timestamp", &uint64_type_info, = get_timestamp, NULL, NULL, NULL); object_class_property_set_description(klass, "timestamp", "latest update of CPI data in nanoseconds since the UNIX EPOCH= "); diff --git a/hw/s390x/virtio-ccw-mem.c b/hw/s390x/virtio-ccw-mem.c index dea30aacfb32..046dfd544cf3 100644 --- a/hw/s390x/virtio-ccw-mem.c +++ b/hw/s390x/virtio-ccw-mem.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "hw/core/qdev-properties.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/module.h" #include "virtio-ccw-mem.h" #include "hw/mem/memory-device.h" @@ -205,7 +206,7 @@ static void virtio_ccw_mem_instance_init(Object *obj) OBJECT(&dev->vdev), VIRTIO_MEM_BLOCK_SIZE_PR= OP); object_property_add_alias(obj, VIRTIO_MEM_SIZE_PROP, OBJECT(&dev->vdev= ), VIRTIO_MEM_SIZE_PROP); - object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", + object_property_add_qapi(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, &size_ty= pe_info, virtio_ccw_mem_get_requested_size, virtio_ccw_mem_set_requested_size, NULL, NULL); } diff --git a/hw/sensor/adc128d818.c b/hw/sensor/adc128d818.c index c65508cba144..b0f93e28d19f 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-builtin-type-infos.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "qom/object.h" @@ -642,15 +643,18 @@ static void adc128d818_initfn(Object *obj) for (unsigned ch =3D 0u; ch < ADC128D818_NUM_CHANNELS; ch++) { char *name =3D g_strdup_printf("ain%u", ch); =20 - object_property_add(obj, name, "int", adc128d818_get_ain, - adc128d818_set_ain, NULL, NULL); + object_property_add_qapi(obj, name, &int_type_info, + adc128d818_get_ain, + adc128d818_set_ain, NULL, NULL); g_free(name); } =20 - object_property_add(obj, "temperature", "int", adc128d818_get_temperat= ure, - adc128d818_set_temperature, NULL, NULL); - object_property_add(obj, "ext-vref-mv", "int", adc128d818_get_ext_vref, - adc128d818_set_ext_vref, NULL, NULL); + object_property_add_qapi(obj, "temperature", &int_type_info, + adc128d818_get_temperature, + adc128d818_set_temperature, NULL, NULL); + object_property_add_qapi(obj, "ext-vref-mv", &int_type_info, + adc128d818_get_ext_vref, + adc128d818_set_ext_vref, NULL, NULL); } =20 static void adc128d818_realize(DeviceState *dev, Error **errp) diff --git a/hw/sensor/adm1266.c b/hw/sensor/adm1266.c index 37d1cffd57a9..62f563af7a7a 100644 --- a/hw/sensor/adm1266.c +++ b/hw/sensor/adm1266.c @@ -14,6 +14,7 @@ #include "hw/core/irq.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h" @@ -217,7 +218,7 @@ static void adm1266_init(Object *obj) for (int i =3D 0; i < ADM1266_NUM_PAGES; i++) { pmbus_page_config(pmdev, i, flags); =20 - object_property_add(obj, "vout[*]", "uint16", + object_property_add_qapi(obj, "vout[*]", &uint16_type_info, adm1266_get, adm1266_set, NULL, &pmdev->pages[i].read_vout); } diff --git a/hw/sensor/adm1272.c b/hw/sensor/adm1272.c index 0aa2a8655683..e1c1bf1c54de 100644 --- a/hw/sensor/adm1272.c +++ b/hw/sensor/adm1272.c @@ -12,6 +12,7 @@ #include "hw/core/irq.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h" @@ -493,19 +494,19 @@ static void adm1272_init(Object *obj) =20 pmbus_page_config(pmdev, 0, flags); =20 - object_property_add(obj, "vin", "uint16", + object_property_add_qapi(obj, "vin", &uint16_type_info, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_vin); =20 - object_property_add(obj, "vout", "uint16", + object_property_add_qapi(obj, "vout", &uint16_type_info, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_vout); =20 - object_property_add(obj, "iout", "uint16", + object_property_add_qapi(obj, "iout", &uint16_type_info, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_iout); =20 - object_property_add(obj, "pin", "uint16", + object_property_add_qapi(obj, "pin", &uint16_type_info, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_pin); =20 diff --git a/hw/sensor/emc141x.c b/hw/sensor/emc141x.c index a51fc44395ab..5efe94643ca0 100644 --- a/hw/sensor/emc141x.c +++ b/hw/sensor/emc141x.c @@ -22,6 +22,7 @@ #include "hw/i2c/i2c.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qom/object.h" @@ -251,16 +252,16 @@ static void emc141x_reset(DeviceState *dev) =20 static void emc141x_initfn(Object *obj) { - object_property_add(obj, "temperature0", "int", + object_property_add_qapi(obj, "temperature0", &int_type_info, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature1", "int", + object_property_add_qapi(obj, "temperature1", &int_type_info, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature2", "int", + object_property_add_qapi(obj, "temperature2", &int_type_info, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature3", "int", + object_property_add_qapi(obj, "temperature3", &int_type_info, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); } diff --git a/hw/sensor/isl_pmbus_vr.c b/hw/sensor/isl_pmbus_vr.c index 0fad04def773..8923e9e87510 100644 --- a/hw/sensor/isl_pmbus_vr.c +++ b/hw/sensor/isl_pmbus_vr.c @@ -9,6 +9,7 @@ #include "qemu/osdep.h" #include "hw/sensor/isl_pmbus_vr.h" #include "hw/core/qdev-properties.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h" @@ -136,63 +137,63 @@ static void isl_pmbus_vr_add_props(Object *obj, uint6= 4_t *flags, uint8_t pages) PMBusDevice *pmdev =3D PMBUS_DEVICE(obj); for (int i =3D 0; i < pages; i++) { if (flags[i] & PB_HAS_VIN) { - object_property_add(obj, "vin[*]", "uint16", + object_property_add_qapi(obj, "vin[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_vin); } =20 if (flags[i] & PB_HAS_VOUT) { - object_property_add(obj, "vout[*]", "uint16", + object_property_add_qapi(obj, "vout[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_vout); } =20 if (flags[i] & PB_HAS_IIN) { - object_property_add(obj, "iin[*]", "uint16", + object_property_add_qapi(obj, "iin[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_iin); } =20 if (flags[i] & PB_HAS_IOUT) { - object_property_add(obj, "iout[*]", "uint16", + object_property_add_qapi(obj, "iout[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_iout); } =20 if (flags[i] & PB_HAS_PIN) { - object_property_add(obj, "pin[*]", "uint16", + object_property_add_qapi(obj, "pin[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_pin); } =20 if (flags[i] & PB_HAS_POUT) { - object_property_add(obj, "pout[*]", "uint16", + object_property_add_qapi(obj, "pout[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_pout); } =20 if (flags[i] & PB_HAS_TEMPERATURE) { - object_property_add(obj, "temp1[*]", "uint16", + object_property_add_qapi(obj, "temp1[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_temperature_1); } =20 if (flags[i] & PB_HAS_TEMP2) { - object_property_add(obj, "temp2[*]", "uint16", + object_property_add_qapi(obj, "temp2[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_temperature_2); } =20 if (flags[i] & PB_HAS_TEMP3) { - object_property_add(obj, "temp3[*]", "uint16", + object_property_add_qapi(obj, "temp3[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_temperature_3); diff --git a/hw/sensor/lsm303dlhc_mag.c b/hw/sensor/lsm303dlhc_mag.c index cd5773ae64e8..c8085739ca47 100644 --- a/hw/sensor/lsm303dlhc_mag.c +++ b/hw/sensor/lsm303dlhc_mag.c @@ -25,6 +25,7 @@ #include "hw/i2c/i2c.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qemu/log.h" @@ -509,19 +510,19 @@ static void lsm303dlhc_mag_reset(DeviceState *dev) */ static void lsm303dlhc_mag_initfn(Object *obj) { - object_property_add(obj, "mag-x", "int", + object_property_add_qapi(obj, "mag-x", &int_type_info, lsm303dlhc_mag_get_x, lsm303dlhc_mag_set_x, NULL, NULL); =20 - object_property_add(obj, "mag-y", "int", + object_property_add_qapi(obj, "mag-y", &int_type_info, lsm303dlhc_mag_get_y, lsm303dlhc_mag_set_y, NULL, NULL); =20 - object_property_add(obj, "mag-z", "int", + object_property_add_qapi(obj, "mag-z", &int_type_info, lsm303dlhc_mag_get_z, lsm303dlhc_mag_set_z, NULL, NULL); =20 - object_property_add(obj, "temperature", "int", + object_property_add_qapi(obj, "temperature", &int_type_info, lsm303dlhc_mag_get_temperature, lsm303dlhc_mag_set_temperature, NULL, NULL); } diff --git a/hw/sensor/max34451.c b/hw/sensor/max34451.c index 4d64434f3af4..3c8fa3d4a861 100644 --- a/hw/sensor/max34451.c +++ b/hw/sensor/max34451.c @@ -11,6 +11,7 @@ #include "hw/core/irq.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h" @@ -727,7 +728,7 @@ static void max34451_init(Object *obj) =20 /* get and set the voltage in millivolts, max is 32767 mV */ for (int i =3D 0; i < MAX34451_NUM_PWR_DEVICES; i++) { - object_property_add(obj, "vout[*]", "uint16", + object_property_add_qapi(obj, "vout[*]", &uint16_type_info, max34451_get, max34451_set, NULL, &pmdev->pages[i].read_vout= ); } @@ -737,7 +738,7 @@ static void max34451_init(Object *obj) * centidegrees Celsius i.e.: 2500 -> 25.00 C, max is 327.67 C */ for (int i =3D 0; i < MAX34451_NUM_TEMP_DEVICES; i++) { - object_property_add(obj, "temperature[*]", "uint16", + object_property_add_qapi(obj, "temperature[*]", &uint16_type_info, max34451_get, max34451_set, NULL, diff --git a/hw/sensor/tmp105.c b/hw/sensor/tmp105.c index c5089d74f4bf..ce4ff4856afb 100644 --- a/hw/sensor/tmp105.c +++ b/hw/sensor/tmp105.c @@ -24,6 +24,7 @@ #include "migration/vmstate.h" #include "hw/sensor/tmp105.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "hw/core/registerfields.h" @@ -308,7 +309,7 @@ static void tmp105_realize(DeviceState *dev, Error **er= rp) =20 static void tmp105_initfn(Object *obj) { - object_property_add(obj, "temperature", "int", + object_property_add_qapi(obj, "temperature", &int_type_info, tmp105_get_temperature, tmp105_set_temperature, NULL, NULL); } diff --git a/hw/sensor/tmp421.c b/hw/sensor/tmp421.c index 127edd0ba568..60844e76b21f 100644 --- a/hw/sensor/tmp421.c +++ b/hw/sensor/tmp421.c @@ -28,6 +28,7 @@ #include "hw/i2c/i2c.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qom/object.h" @@ -350,16 +351,16 @@ static void tmp421_class_init(ObjectClass *klass, con= st void *data) dc->vmsd =3D &vmstate_tmp421; sc->dev =3D (DeviceInfo *) data; =20 - object_class_property_add(klass, "temperature0", "int", + object_class_property_add_qapi(klass, "temperature0", &int_type_info, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature1", "int", + object_class_property_add_qapi(klass, "temperature1", &int_type_info, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature2", "int", + object_class_property_add_qapi(klass, "temperature2", &int_type_info, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature3", "int", + object_class_property_add_qapi(klass, "temperature3", &int_type_info, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); } diff --git a/hw/usb/dev-storage-classic.c b/hw/usb/dev-storage-classic.c index 977151c4a087..06584092bcae 100644 --- a/hw/usb/dev-storage-classic.c +++ b/hw/usb/dev-storage-classic.c @@ -9,6 +9,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/usb/usb.h" #include "hw/usb/desc.h" @@ -122,7 +123,7 @@ out: =20 static void usb_msd_instance_init(Object *obj) { - object_property_add(obj, "bootindex", "int32", + object_property_add_qapi(obj, "bootindex", &int32_type_info, usb_msd_get_bootindex, usb_msd_set_bootindex, NULL, NULL); object_property_set_int(obj, "bootindex", -1, NULL); diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 4c5f486ba238..9e43948128f7 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" @@ -1022,7 +1023,7 @@ static void virtio_balloon_instance_init(Object *obj) object_property_add(obj, "guest-stats", "guest statistics", balloon_stats_get_all, NULL, NULL, NULL); =20 - object_property_add(obj, "guest-stats-polling-interval", "int", + object_property_add_qapi(obj, "guest-stats-polling-interval", &int_typ= e_info, balloon_stats_get_poll_interval, balloon_stats_set_poll_interval, NULL, NULL); diff --git a/hw/virtio/virtio-mem-pci.c b/hw/virtio/virtio-mem-pci.c index f592eb1a7849..80e9bfedd9f5 100644 --- a/hw/virtio/virtio-mem-pci.c +++ b/hw/virtio/virtio-mem-pci.c @@ -14,6 +14,7 @@ #include "virtio-mem-pci.h" #include "hw/mem/memory-device.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-events-machine.h" #include "qapi/qapi-events-misc.h" =20 @@ -211,7 +212,7 @@ static void virtio_mem_pci_instance_init(Object *obj) OBJECT(&dev->vdev), VIRTIO_MEM_BLOCK_SIZE_PR= OP); object_property_add_alias(obj, VIRTIO_MEM_SIZE_PROP, OBJECT(&dev->vdev= ), VIRTIO_MEM_SIZE_PROP); - object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", + object_property_add_qapi(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, &size_ty= pe_info, virtio_mem_pci_get_requested_size, virtio_mem_pci_set_requested_size, NULL, NULL); } diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c index 7130ed852d9c..42dc028e3bdc 100644 --- a/hw/virtio/virtio-mem.c +++ b/hw/virtio/virtio-mem.c @@ -26,6 +26,7 @@ #include "hw/virtio/virtio-bus.h" #include "hw/virtio/virtio-mem.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "migration/misc.h" #include "hw/core/boards.h" @@ -1533,14 +1534,15 @@ static void virtio_mem_instance_init(Object *obj) =20 notifier_list_init(&vmem->size_change_notifiers); =20 - object_property_add(obj, VIRTIO_MEM_SIZE_PROP, "size", virtio_mem_get_= size, - NULL, NULL, NULL); - object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", - virtio_mem_get_requested_size, - virtio_mem_set_requested_size, NULL, NULL); - object_property_add(obj, VIRTIO_MEM_BLOCK_SIZE_PROP, "size", - virtio_mem_get_block_size, virtio_mem_set_block_si= ze, - NULL, NULL); + object_property_add_qapi(obj, VIRTIO_MEM_SIZE_PROP, &size_type_info, + virtio_mem_get_size, + NULL, NULL, NULL); + object_property_add_qapi(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, &size_ty= pe_info, + virtio_mem_get_requested_size, + virtio_mem_set_requested_size, NULL, NULL); + object_property_add_qapi(obj, VIRTIO_MEM_BLOCK_SIZE_PROP, &size_type_i= nfo, + virtio_mem_get_block_size, virtio_mem_set_blo= ck_size, + NULL, NULL); } =20 static void virtio_mem_instance_finalize(Object *obj) diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c index cca37202ffb2..7b4fd933a8fb 100644 --- a/hw/xen/xen-pvh-common.c +++ b/hw/xen/xen-pvh-common.c @@ -9,6 +9,7 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qemu/units.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/boards.h" #include "hw/core/irq.h" @@ -413,7 +414,7 @@ void xen_pvh_class_setup_common_props(XenPVHMachineClas= s *xpc) =20 #define OC_MEMMAP_PROP_BASE(c, prop_name, name) \ do { \ - object_class_property_add(c, prop_name "-base", "uint64_t", \ + object_class_property_add_qapi(c, prop_name "-base", &uint64_type_info= ,\ xen_pvh_get_ ## name ## _base, \ xen_pvh_set_ ## name ## _base, NULL, NULL); \ object_class_property_set_description(oc, prop_name "-base", \ @@ -422,7 +423,7 @@ do { = \ =20 #define OC_MEMMAP_PROP_SIZE(c, prop_name, name) \ do { \ - object_class_property_add(c, prop_name "-size", "uint64_t", \ + object_class_property_add_qapi(c, prop_name "-size", &size_type_info, \ xen_pvh_get_ ## name ## _size, \ xen_pvh_set_ ## name ## _size, NULL, NULL); \ object_class_property_set_description(oc, prop_name "-size", \ @@ -458,7 +459,7 @@ do { = \ OC_MEMMAP_PROP(oc, "pci-mmio", pci_mmio); OC_MEMMAP_PROP(oc, "pci-mmio-high", pci_mmio_high); =20 - object_class_property_add(oc, "pci-intx-irq-base", "uint32_t", + object_class_property_add_qapi(oc, "pci-intx-irq-base", &uint32_ty= pe_info, xen_pvh_get_pci_intx_irq_base, xen_pvh_set_pci_intx_irq_base, NULL, NULL); @@ -468,7 +469,7 @@ do { = \ =20 #ifdef CONFIG_TPM if (xpc->has_tpm) { - object_class_property_add(oc, "tpm-base-addr", "uint64_t", + object_class_property_add_qapi(oc, "tpm-base-addr", &uint64_type_i= nfo, xen_pvh_get_tpm_base, xen_pvh_set_tpm_base, NULL, NULL); diff --git a/iothread.c b/iothread.c index 76eea6df3861..7285135d40a8 100644 --- a/iothread.c +++ b/iothread.c @@ -20,6 +20,7 @@ #include "system/event-loop-base.h" #include "system/iothread.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-commands-misc.h" #include "qemu/error-report.h" #include "qemu/rcu.h" @@ -315,19 +316,19 @@ static void iothread_class_init(ObjectClass *klass, c= onst void *class_data) bc->init =3D iothread_init; bc->update_params =3D iothread_set_aio_context_params; =20 - object_class_property_add(klass, "poll-max-ns", "int64", + object_class_property_add_qapi(klass, "poll-max-ns", &int64_type_info, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_max_ns_info); - object_class_property_add(klass, "poll-grow", "int64", + object_class_property_add_qapi(klass, "poll-grow", &int64_type_info, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_grow_info); - object_class_property_add(klass, "poll-shrink", "int64", + object_class_property_add_qapi(klass, "poll-shrink", &int64_type_info, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_shrink_info); - object_class_property_add(klass, "poll-weight", "int64", + object_class_property_add_qapi(klass, "poll-weight", &int64_type_info, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_weight_info); diff --git a/net/colo-compare.c b/net/colo-compare.c index a6910de869ff..4b237a59d120 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -16,6 +16,7 @@ #include "qemu/error-report.h" #include "trace.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "net/net.h" #include "net/eth.h" #include "qom/object_interfaces.h" @@ -1373,15 +1374,15 @@ static void colo_compare_init(Object *obj) object_property_add_str(obj, "notify_dev", compare_get_notify_dev, compare_set_notify_dev= ); =20 - object_property_add(obj, "compare_timeout", "uint64", + object_property_add_qapi(obj, "compare_timeout", &uint64_type_info, compare_get_timeout, compare_set_timeout, NULL, NULL); =20 - object_property_add(obj, "expired_scan_cycle", "uint32", + object_property_add_qapi(obj, "expired_scan_cycle", &uint32_type_info, compare_get_expired_scan_cycle, compare_set_expired_scan_cycle, NULL, NULL); =20 - object_property_add(obj, "max_queue_size", "uint32", + object_property_add_qapi(obj, "max_queue_size", &uint32_type_info, get_max_queue_size, set_max_queue_size, NULL, NULL); =20 diff --git a/net/dump.c b/net/dump.c index 0c39f09892c2..3d7bb36182ec 100644 --- a/net/dump.c +++ b/net/dump.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include "clients.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/error-report.h" #include "qemu/iov.h" #include "qemu/module.h" @@ -238,8 +239,9 @@ static void filter_dump_class_init(ObjectClass *oc, con= st void *data) { NetFilterClass *nfc =3D NETFILTER_CLASS(oc); =20 - object_class_property_add(oc, "maxlen", "uint32", filter_dump_get_maxl= en, - filter_dump_set_maxlen, NULL, NULL); + object_class_property_add_qapi(oc, "maxlen", &uint32_type_info, + filter_dump_get_maxlen, + filter_dump_set_maxlen, NULL, NULL); object_class_property_add_str(oc, "file", file_dump_get_filename, file_dump_set_filename); =20 diff --git a/net/filter-buffer.c b/net/filter-buffer.c index 427da24097f2..9d7a9f5cb2c7 100644 --- a/net/filter-buffer.c +++ b/net/filter-buffer.c @@ -10,6 +10,7 @@ #include "net/filter.h" #include "net/queue.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/timer.h" #include "qemu/iov.h" #include "qapi/qapi-builtin-visit.h" @@ -182,7 +183,7 @@ static void filter_buffer_class_init(ObjectClass *oc, c= onst void *data) { NetFilterClass *nfc =3D NETFILTER_CLASS(oc); =20 - object_class_property_add(oc, "interval", "uint32", + object_class_property_add_qapi(oc, "interval", &uint32_type_info, filter_buffer_get_interval, filter_buffer_set_interval, NULL, NULL); =20 diff --git a/qom/object.c b/qom/object.c index 89a5ea04ab2e..65e640d1b7d1 100644 --- a/qom/object.c +++ b/qom/object.c @@ -22,9 +22,9 @@ #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 "qobject/qdict.h" -#include "qobject/qjson.h" #include "qemu/id.h" #include "qapi/qmp/qerror.h" #include "trace.h" @@ -2425,7 +2425,7 @@ object_property_add_str(Object *obj, const char *name, prop->get =3D get; prop->set =3D set; =20 - return object_property_add(obj, name, "string", + return object_property_add_qapi(obj, name, &str_type_info, get ? property_get_str : NULL, set ? property_set_str : NULL, property_release_data, @@ -2443,7 +2443,7 @@ object_class_property_add_str(ObjectClass *klass, con= st char *name, prop->get =3D get; prop->set =3D set; =20 - return object_class_property_add(klass, name, "string", + return object_class_property_add_qapi(klass, name, &str_type_info, get ? property_get_str : NULL, set ? property_set_str : NULL, NULL, @@ -2495,7 +2495,7 @@ object_property_add_bool(Object *obj, const char *nam= e, prop->get =3D get; prop->set =3D set; =20 - return object_property_add(obj, name, "bool", + return object_property_add_qapi(obj, name, &bool_type_info, get ? property_get_bool : NULL, set ? property_set_bool : NULL, property_release_data, @@ -2512,7 +2512,7 @@ object_class_property_add_bool(ObjectClass *klass, co= nst char *name, prop->get =3D get; prop->set =3D set; =20 - return object_class_property_add(klass, name, "bool", + return object_class_property_add_qapi(klass, name, &bool_type_info, get ? property_get_bool : NULL, set ? property_set_bool : NULL, NULL, @@ -2761,8 +2761,8 @@ object_property_add_uint8_ptr(Object *obj, const char= *name, setter =3D property_set_uint8_ptr; } =20 - return object_property_add(obj, name, "uint8", - getter, setter, NULL, (void *)v); + return object_property_add_qapi(obj, name, &uint8_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -2782,8 +2782,8 @@ object_class_static_property_add_uint8_ptr(ObjectClas= s *klass, setter =3D property_set_uint8_ptr; } =20 - return object_class_property_add(klass, name, "uint8", - getter, setter, NULL, (void *)v); + return object_class_property_add_qapi(klass, name, &uint8_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -2802,8 +2802,8 @@ object_property_add_uint16_ptr(Object *obj, const cha= r *name, setter =3D property_set_uint16_ptr; } =20 - return object_property_add(obj, name, "uint16", - getter, setter, NULL, (void *)v); + return object_property_add_qapi(obj, name, &uint16_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -2823,8 +2823,8 @@ object_class_static_property_add_uint16_ptr(ObjectCla= ss *klass, setter =3D property_set_uint16_ptr; } =20 - return object_class_property_add(klass, name, "uint16", - getter, setter, NULL, (void *)v); + return object_class_property_add_qapi(klass, name, &uint16_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -2843,8 +2843,8 @@ object_property_add_uint32_ptr(Object *obj, const cha= r *name, setter =3D property_set_uint32_ptr; } =20 - return object_property_add(obj, name, "uint32", - getter, setter, NULL, (void *)v); + return object_property_add_qapi(obj, name, &uint32_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -2864,8 +2864,8 @@ object_class_static_property_add_uint32_ptr(ObjectCla= ss *klass, setter =3D property_set_uint32_ptr; } =20 - return object_class_property_add(klass, name, "uint32", - getter, setter, NULL, (void *)v); + return object_class_property_add_qapi(klass, name, &uint32_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -2884,8 +2884,8 @@ object_property_add_uint64_ptr(Object *obj, const cha= r *name, setter =3D property_set_uint64_ptr; } =20 - return object_property_add(obj, name, "uint64", - getter, setter, NULL, (void *)v); + return object_property_add_qapi(obj, name, &uint64_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -2905,8 +2905,8 @@ object_class_static_property_add_uint64_ptr(ObjectCla= ss *klass, setter =3D property_set_uint64_ptr; } =20 - return object_class_property_add(klass, name, "uint64", - getter, setter, NULL, (void *)v); + return object_class_property_add_qapi(klass, name, &uint64_type_info, + getter, setter, NULL, (void *)v); } =20 typedef struct { diff --git a/system/bootdevice.c b/system/bootdevice.c index 9538b08983f5..7789e464186a 100644 --- a/system/bootdevice.c +++ b/system/bootdevice.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "system/system.h" #include "qapi/visitor.h" #include "qemu/error-report.h" @@ -336,7 +337,7 @@ void device_add_bootindex_property(Object *obj, int32_t= *bootindex, prop->suffix =3D suffix; prop->dev =3D dev; =20 - object_property_add(obj, name, "int32", + object_property_add_qapi(obj, name, &int32_type_info, device_get_bootindex, device_set_bootindex, property_release_bootindex, diff --git a/system/memory.c b/system/memory.c index 164c18757f8f..46a0dbaf6859 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" @@ -1318,11 +1319,11 @@ static void memory_region_initfn(Object *obj) =20 object_property_add_uint64_ptr(OBJECT(mr), "addr", &mr->addr, OBJ_PROP_FLAG_READ); - object_property_add(OBJECT(mr), "priority", "int32", + object_property_add_qapi(OBJECT(mr), "priority", &int32_type_info, memory_region_get_priority, NULL, /* memory_region_set_priority */ NULL, NULL); - object_property_add(OBJECT(mr), "size", "uint64", + object_property_add_qapi(OBJECT(mr), "size", &uint64_type_info, memory_region_get_size, NULL, /* memory_region_set_size, */ NULL, NULL); diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 28167355773b..62c0fa5a9e51 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" @@ -320,7 +321,7 @@ static void prop_bool_set_false(Object *obj, Visitor *v= , const char *name, =20 static void prop_add_stub_bool(Object *obj, const char *name) { - object_property_add(obj, name, "bool", prop_bool_get_false, + object_property_add_qapi(obj, name, &bool_type_info, prop_bool_get_fal= se, prop_bool_set_false, NULL, NULL); } =20 @@ -510,13 +511,13 @@ void aarch64_add_sve_properties(Object *obj) for (vq =3D 1; vq <=3D ARM_MAX_VQ; ++vq) { char name[8]; snprintf(name, sizeof(name), "sve%d", vq * 128); - object_property_add(obj, name, "bool", cpu_arm_get_vq, + object_property_add_qapi(obj, name, &bool_type_info, cpu_arm_get_v= q, cpu_arm_set_vq, NULL, &cpu->sve_vq); } =20 #ifdef CONFIG_USER_ONLY /* Mirror linux /proc/sys/abi/sve_default_vector_length. */ - object_property_add(obj, "sve-default-vector-length", "int32", + object_property_add_qapi(obj, "sve-default-vector-length", &int32_type= _info, cpu_arm_get_default_vec_len, cpu_arm_set_default_vec_len, NULL, &cpu->sve_default_vq); @@ -535,13 +536,13 @@ void aarch64_add_sme_properties(Object *obj) for (vq =3D 1; vq <=3D ARM_MAX_VQ; vq <<=3D 1) { char name[8]; snprintf(name, sizeof(name), "sme%d", vq * 128); - object_property_add(obj, name, "bool", cpu_arm_get_vq, + object_property_add_qapi(obj, name, &bool_type_info, cpu_arm_get_v= q, cpu_arm_set_vq, NULL, &cpu->sme_vq); } =20 #ifdef CONFIG_USER_ONLY /* Mirror linux /proc/sys/abi/sme_default_vector_length. */ - object_property_add(obj, "sme-default-vector-length", "int32", + object_property_add_qapi(obj, "sme-default-vector-length", &int32_type= _info, cpu_arm_get_default_vec_len, cpu_arm_set_default_vec_len, NULL, &cpu->sme_default_vq); diff --git a/target/arm/kvm.c b/target/arm/kvm.c index d40a6a985914..96531e8c28a8 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" @@ -1776,7 +1777,7 @@ static void kvm_arch_set_eager_split_size(Object *obj= , Visitor *v, =20 void kvm_arch_accel_class_init(ObjectClass *oc) { - object_class_property_add(oc, "eager-split-size", "size", + object_class_property_add_qapi(oc, "eager-split-size", &size_type_info, kvm_arch_get_eager_split_size, kvm_arch_set_eager_split_size, NULL, NULL); =20 diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c index 24f34947eca8..c47aaa9df65f 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" @@ -1438,10 +1439,10 @@ void aarch64_max_tcg_initfn(Object *obj) aarch64_add_pauth_properties(obj); aarch64_add_sve_properties(obj); aarch64_add_sme_properties(obj); - object_property_add(obj, "sve-max-vq", "uint32", cpu_max_get_sve_max_v= q, + object_property_add_qapi(obj, "sve-max-vq", &uint32_type_info, cpu_max= _get_sve_max_vq, cpu_max_set_sve_max_vq, NULL, NULL); object_property_add_bool(obj, "x-rme", cpu_arm_get_rme, cpu_arm_set_rm= e); - object_property_add(obj, "x-l0gptsz", "uint32", cpu_max_get_l0gptsz, + object_property_add_qapi(obj, "x-l0gptsz", &uint32_type_info, cpu_max_= get_l0gptsz, cpu_max_set_l0gptsz, NULL, NULL); qdev_property_add_static(DEVICE(obj), &arm_cpu_lpa2_property); } diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 567cbf04ca75..472c33736f36 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -10431,7 +10431,7 @@ static void x86_cpu_register_bit_prop(X86CPUClass *= xcc, fp =3D g_new0(BitProperty, 1); fp->w =3D w; fp->mask =3D mask; - object_class_property_add(oc, prop_name, "bool", + object_class_property_add_qapi(oc, prop_name, &bool_type_info, x86_cpu_get_bit_prop, x86_cpu_set_bit_prop, NULL, fp); @@ -10947,13 +10947,13 @@ static void x86_cpu_common_class_init(ObjectClass= *oc, const void *data) =20 dc->user_creatable =3D true; =20 - object_class_property_add(oc, "family", "uint64", + object_class_property_add_qapi(oc, "family", &uint64_type_info, x86_cpuid_version_get_family, x86_cpuid_version_set_family, NULL, NULL); - object_class_property_add(oc, "model", "uint64", + object_class_property_add_qapi(oc, "model", &uint64_type_info, x86_cpuid_version_get_model, x86_cpuid_version_set_model, NULL, NULL); - object_class_property_add(oc, "stepping", "uint64", + object_class_property_add_qapi(oc, "stepping", &uint64_type_info, x86_cpuid_version_get_stepping, x86_cpuid_version_set_stepping, NULL, NULL); object_class_property_add_str(oc, "vendor", @@ -10962,7 +10962,7 @@ static void x86_cpu_common_class_init(ObjectClass *= oc, const void *data) object_class_property_add_str(oc, "model-id", x86_cpuid_get_model_id, x86_cpuid_set_model_id); - object_class_property_add(oc, "tsc-frequency", "int", + object_class_property_add_qapi(oc, "tsc-frequency", &int_type_info, x86_cpuid_get_tsc_freq, x86_cpuid_set_tsc_freq, NULL, NULL); /* @@ -10975,7 +10975,7 @@ static void x86_cpu_common_class_init(ObjectClass *= oc, const void *data) x86_cpu_get_unavailable_features, NULL, NULL, NULL); =20 - object_class_property_add(oc, "avx10-version", "uint8", + object_class_property_add_qapi(oc, "avx10-version", &uint8_type_info, x86_cpuid_get_avx10_version, x86_cpuid_set_avx10_version, NULL, NULL); diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 601b78df5363..6824af33bd32 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -7099,7 +7099,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc) .set =3D kvm_arch_set_notify_vmexit, )); =20 - object_class_property_add(oc, "notify-window", "uint32", + object_class_property_add_qapi(oc, "notify-window", &uint32_type_info, kvm_arch_get_notify_window, kvm_arch_set_notify_window, NULL, NULL); @@ -7107,7 +7107,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc) "Clock cycles without an event w= indow " "after which a notification VM e= xit occurs"); =20 - object_class_property_add(oc, "xen-version", "uint32", + object_class_property_add_qapi(oc, "xen-version", &uint32_type_info, kvm_arch_get_xen_version, kvm_arch_set_xen_version, NULL, NULL); @@ -7116,14 +7116,14 @@ void kvm_arch_accel_class_init(ObjectClass *oc) "(in XENVER_version form " "e.g. 0x4000a for 4.10)"); =20 - object_class_property_add(oc, "xen-gnttab-max-frames", "uint16", + object_class_property_add_qapi(oc, "xen-gnttab-max-frames", &uint16_ty= pe_info, kvm_arch_get_xen_gnttab_max_frames, kvm_arch_set_xen_gnttab_max_frames, NULL, NULL); object_class_property_set_description(oc, "xen-gnttab-max-frames", "Maximum number of grant table f= rames"); =20 - object_class_property_add(oc, "xen-evtchn-max-pirq", "uint16", + object_class_property_add_qapi(oc, "xen-evtchn-max-pirq", &uint16_type= _info, kvm_arch_get_xen_evtchn_max_pirq, kvm_arch_set_xen_evtchn_max_pirq, NULL, NULL); diff --git a/target/i386/sev.c b/target/i386/sev.c index 335a504af4db..01bd9eceaedc 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -3175,7 +3175,7 @@ sev_snp_guest_class_init(ObjectClass *oc, const void = *data) x86_klass->adjust_cpuid_features =3D sev_snp_adjust_cpuid_features; x86_klass->kvm_type =3D sev_snp_kvm_type; =20 - object_class_property_add(oc, "policy", "uint64", + object_class_property_add_qapi(oc, "policy", &uint64_type_info, sev_snp_guest_get_policy, sev_snp_guest_set_policy, NULL, NULL); object_class_property_add_str(oc, "guest-visible-workarounds", diff --git a/target/ppc/compat.c b/target/ppc/compat.c index 55de3bd5d5de..4d81225de37f 100644 --- a/target/ppc/compat.c +++ b/target/ppc/compat.c @@ -23,6 +23,7 @@ #include "kvm_ppc.h" #include "system/cpus.h" #include "qemu/error-report.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "cpu-models.h" @@ -335,7 +336,7 @@ void ppc_compat_add_property(Object *obj, const char *n= ame, gchar *names, *desc; int i; =20 - object_property_add(obj, name, "string", + object_property_add_qapi(obj, name, &str_type_info, ppc_compat_prop_get, ppc_compat_prop_set, NULL, compat_pvr); =20 diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 23b5023dd37e..6116d6da7685 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -27,6 +27,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" @@ -1306,20 +1307,20 @@ void riscv_add_satp_mode_properties(Object *obj) { RISCVCPU *cpu =3D RISCV_CPU(obj); =20 - object_property_add(obj, "svbare", "bool", cpu_riscv_get_satp, - cpu_riscv_set_satp, NULL, &cpu->satp_modes); + object_property_add_qapi(obj, "svbare", &bool_type_info, cpu_riscv_get= _satp, + cpu_riscv_set_satp, NULL, &cpu->satp_modes); =20 if (cpu->env.misa_mxl =3D=3D MXL_RV32) { - object_property_add(obj, "sv32", "bool", cpu_riscv_get_satp, + object_property_add_qapi(obj, "sv32", &bool_type_info, cpu_riscv_g= et_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); } else { - object_property_add(obj, "sv39", "bool", cpu_riscv_get_satp, + object_property_add_qapi(obj, "sv39", &bool_type_info, cpu_riscv_g= et_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv48", "bool", cpu_riscv_get_satp, + object_property_add_qapi(obj, "sv48", &bool_type_info, cpu_riscv_g= et_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv57", "bool", cpu_riscv_get_satp, + object_property_add_qapi(obj, "sv57", &bool_type_info, cpu_riscv_g= et_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv64", "bool", cpu_riscv_get_satp, + object_property_add_qapi(obj, "sv64", &bool_type_info, cpu_riscv_g= et_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); } } diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c index 97069bf597a7..90660643da59 100644 --- a/target/riscv/kvm/kvm-cpu.c +++ b/target/riscv/kvm/kvm-cpu.c @@ -24,6 +24,7 @@ =20 #include "qemu/timer.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qapi/visitor.h" @@ -532,7 +533,7 @@ static void riscv_cpu_add_kvm_unavail_prop(Object *obj,= const char *prop_name) * unknown to KVM and error out if the user attempts * to enable any of them. */ - object_property_add(obj, prop_name, "bool", + object_property_add_qapi(obj, prop_name, &bool_type_info, cpu_get_cfg_unavailable, cpu_set_cfg_unavailable, NULL, (void *)prop_name); @@ -552,7 +553,7 @@ static void kvm_riscv_add_cpu_user_properties(Object *c= pu_obj) misa_cfg->name =3D riscv_get_misa_ext_name(bit); misa_cfg->description =3D riscv_get_misa_ext_description(bit); =20 - object_property_add(cpu_obj, misa_cfg->name, "bool", + object_property_add_qapi(cpu_obj, misa_cfg->name, &bool_type_info, kvm_cpu_get_misa_ext_cfg, kvm_cpu_set_misa_ext_cfg, NULL, misa_cfg); @@ -568,7 +569,7 @@ static void kvm_riscv_add_cpu_user_properties(Object *c= pu_obj) for (i =3D 0; i < ARRAY_SIZE(kvm_multi_ext_cfgs); i++) { KVMCPUConfig *multi_cfg =3D &kvm_multi_ext_cfgs[i]; =20 - object_property_add(cpu_obj, multi_cfg->name, "bool", + object_property_add_qapi(cpu_obj, multi_cfg->name, &bool_type_info, kvm_cpu_get_multi_ext_cfg, kvm_cpu_set_multi_ext_cfg, NULL, multi_cfg); diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c index 9e3cc87f8a31..92e03a386832 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" @@ -1438,7 +1439,7 @@ static void riscv_cpu_add_misa_properties(Object *cpu= _obj) continue; } =20 - object_property_add(cpu_obj, name, "bool", + object_property_add_qapi(cpu_obj, name, &bool_type_info, cpu_get_misa_ext_cfg, cpu_set_misa_ext_cfg, NULL, (void *)misa_cfg); @@ -1492,7 +1493,7 @@ static void riscv_cpu_add_profiles(Object *cpu_obj) for (int i =3D 0; riscv_profiles[i] !=3D NULL; i++) { RISCVCPUProfile *profile =3D riscv_profiles[i]; =20 - object_property_add(cpu_obj, profile->name, "bool", + object_property_add_qapi(cpu_obj, profile->name, &bool_type_info, cpu_get_profile, cpu_set_profile, NULL, (void *)profile); =20 @@ -1568,10 +1569,10 @@ static void riscv_cpu_add_user_properties(Object *o= bj) =20 for (edata =3D isa_edata_arr; edata && edata->name; edata++) { if (edata->prop_name) { - object_property_add(obj, edata->prop_name, "bool", - cpu_get_multi_ext_cfg, - cpu_set_multi_ext_cfg, - NULL, (void *)&edata->ext_enable_offset); + object_property_add_qapi(obj, edata->prop_name, &bool_type_inf= o, + cpu_get_multi_ext_cfg, + cpu_set_multi_ext_cfg, + NULL, (void *)&edata->ext_enable_offs= et); } } =20 diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index f292af7ad01c..f12634234352 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" @@ -908,13 +909,13 @@ void s390_cpu_model_class_register_props(ObjectClass = *oc) =20 for (feat =3D 0; feat < S390_FEAT_MAX; feat++) { const S390FeatDef *def =3D s390_feat_def(feat); - object_class_property_add(oc, def->name, "bool", get_feature, + object_class_property_add_qapi(oc, def->name, &bool_type_info, get= _feature, set_feature, NULL, (void *) feat); object_class_property_set_description(oc, def->name, def->desc); } for (group =3D 0; group < S390_FEAT_GROUP_MAX; group++) { const S390FeatGroupDef *def =3D s390_feat_group_def(group); - object_class_property_add(oc, def->name, "bool", get_feature_group, + object_class_property_add_qapi(oc, def->name, &bool_type_info, get= _feature_group, set_feature_group, NULL, (void *) group); object_class_property_set_description(oc, def->name, def->desc); } diff --git a/tests/unit/test-qdev-global-props.c b/tests/unit/test-qdev-glo= bal-props.c index 8ea362cbb902..204436fb7276 100644 --- a/tests/unit/test-qdev-global-props.c +++ b/tests/unit/test-qdev-global-props.c @@ -27,6 +27,7 @@ #include "hw/core/qdev-properties.h" #include "qom/object.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" =20 =20 @@ -171,10 +172,12 @@ static void prop2_accessor(Object *obj, Visitor *v, c= onst char *name, =20 static void dynamic_instance_init(Object *obj) { - object_property_add(obj, "prop1", "uint32", prop1_accessor, prop1_acce= ssor, - NULL, NULL); - object_property_add(obj, "prop2", "uint32", prop2_accessor, prop2_acce= ssor, - NULL, NULL); + object_property_add_qapi(obj, "prop1", &uint32_type_info, + prop1_accessor, prop1_accessor, + NULL, NULL); + object_property_add_qapi(obj, "prop2", &uint32_type_info, + prop2_accessor, prop2_accessor, + NULL, NULL); } =20 static void dynamic_class_init(ObjectClass *oc, const void *data) diff --git a/ui/console.c b/ui/console.c index a8a2a247d8f4..b4345b06d012 100644 --- a/ui/console.c +++ b/ui/console.c @@ -28,6 +28,7 @@ #include "ui/vgafont.h" #include "hw/core/qdev.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-commands-ui.h" #include "qapi/visitor.h" #include "qemu/coroutine.h" @@ -535,7 +536,7 @@ qemu_graphic_console_class_init(ObjectClass *oc, const = void *data) offsetof(QemuGraphicConsole, device), object_property_allow_set_link, OBJ_PROP_LINK_STRONG); - object_class_property_add(oc, "head", "uint32", + object_class_property_add_qapi(oc, "head", &uint32_type_info, qemu_graphic_console_prop_get_head, NULL, NULL, NULL); =20 diff --git a/util/thread-context.c b/util/thread-context.c index 88d8f0a55a4e..7fa6840dd401 100644 --- a/util/thread-context.c +++ b/util/thread-context.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "qemu/thread-context.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-builtin-visit.h" #include "qapi/visitor.h" #include "qemu/config-file.h" @@ -278,13 +279,13 @@ static void thread_context_class_init(ObjectClass *oc= , const void *data) UserCreatableClass *ucc =3D USER_CREATABLE_CLASS(oc); =20 ucc->complete =3D thread_context_instance_complete; - object_class_property_add(oc, "thread-id", "uint64", + object_class_property_add_qapi(oc, "thread-id", &uint64_type_info, thread_context_get_thread_id, NULL, NULL, NULL); - object_class_property_add(oc, "cpu-affinity", "[uint16]", + object_class_property_add_qapi(oc, "cpu-affinity", &uint16List_type_in= fo, thread_context_get_cpu_affinity, thread_context_set_cpu_affinity, NULL, NULL); - object_class_property_add(oc, "node-affinity", "[uint16]", NULL, + object_class_property_add_qapi(oc, "node-affinity", &uint16List_type_i= nfo, NULL, thread_context_set_node_affinity, NULL, NULL= ); } =20 --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052282; cv=none; d=zohomail.com; s=zohoarc; b=NQXhThDPhnQu6FtEZYtqECL6Mw0V+8xkv9kX1LYdiB7iXtmKsp751Ps5KbSZ5xMR50nLq4LC4LKxN3e6SHdNNixkjXo8V4ZOvW4CC275EN0/RSrXkTJCNdIOsJrC1Y1pyH3ovhh2Y3icR10vbkkz1YKKlirvRz212KsikKf6y/8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052282; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3dPhzg57AIP/b/5RABXJ4M7IQXJ/WdHSh89Rr6LInl4=; b=ed+eoBSvKrqENgts+cyiUwsegYPHebcYGkBroN4hDHWDmMFO+SsZslCo3ij+/gsbcZBvfaKZeS6ELDsTJ6w2DtLopXqsPjkT4LUN3moBLScbXMq+QDDDLA8aYxxtHLUqbagPQNDZ36aGjIN6TdbmJ85jFeFoxXfdhVJqFrS5zc8= 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 1787052282887982.4466057951544; Tue, 18 Aug 2026 04:24:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHvP-0004BE-8U; Tue, 18 Aug 2026 07:24:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHvO-0004AS-2f for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:24:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHvM-0007Ee-FS for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:24:09 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-121-JjBuxMZ0PByHAWTmMQydZg-1; Tue, 18 Aug 2026 07:23:58 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0641118004A9; Tue, 18 Aug 2026 11:23:56 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 474B2180034C; Tue, 18 Aug 2026 11:23:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052246; 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=3dPhzg57AIP/b/5RABXJ4M7IQXJ/WdHSh89Rr6LInl4=; b=VL1zpzOW/qUaLfJQCXBFTslg+AzqmQHF21PotIpOVzT+AdFrn7iSEOIYun5M1z/FiWVPA1 fg5lwlE0T9tB+Amv0BQazIf8xn0lNBwKaffEp9Wr24nW+DudFoahOvKWpB15OIRKbfWBi3 wuv+47y8nGSY2ipuFhMnxW8K3fDKjhg= X-MC-Unique: JjBuxMZ0PByHAWTmMQydZg-1 X-Mimecast-MFC-AGG-ID: JjBuxMZ0PByHAWTmMQydZg_1787052236 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:13 +0400 Subject: [PATCH v3 46/74] i386/cpu: convert strList property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-46-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu X-Developer-Signature: v=1; a=openpgp-sha256; l=873; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=P0mpI4GCVHWe5iSgcj52/XLJiYVktGNENom8IUSaw8w=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD27tV2r9GWHObbNRtWkx88Kjg5gjmRpO0yAN Z7g5862tHeJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uwAKCRDa6OEJdZac 5XXfD/4ngHtxPMSQDPV1UM6/6C+KiwoDsBiFO4eXrCy3HfkXMS5Gtg2KyrFrZ7MABDxtEKFwBO5 eOiRcRGHNQjyVMAG7CCkGYZif5qm5Gq5KsHoFgXFJmzB84B5z0WfBVcaBO8bu4lu+EFfZxbYXPg ah8YqOGOOokq9CIvVvPjFesAd5i+v5ZJ4X4BxPfuTGOtGj+KcQdMiYcblf2Y/XNJzhE3hikQ88F 3LkF8zPOHqwjU7zwws7xlQN1qa6j3sRY96qk1lSfNAKiqD2v9pH2EVEPgEYKKxAOlw3Dvf8N6Lr //Aw3mER4VBEdiO1e0S4dhJjIwYg2LC+owlcV4v3EqQ6eeeuS88z+MrOrVxyVS0GWqAYJDjivpb tgtxWh+62Hz/S/QowaDaAnfFHvlv35IvRz6E++3cTHPs+/WoFM5uvWz2YqsEUYalLxOLu1GVEzd 9rxs1fAhcjsMzW63Nii8YRED7k2MQkvKPNJq4l7KS9HQKE8XgmQX6is05HGl3zRhHahRvdtiIOa +M/ca11V0UnmkoQuHN0YH42l03vW3IxAqddcNEqCKtXgscQC6mKMDfYluWrhc+7rSTwulr0aDwD 4noRIx6mwxc+pIoCEJVVrnIEq3FCg2yObLrbmEYiTnXG4E3HXblW+qkNRQ6Pz++yMQm7IctAqbL o4KCqS5/yieGhXA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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: 1787052283561158500 Signed-off-by: Marc-Andr=C3=A9 Lureau --- target/i386/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 472c33736f36..24bb4512ae8e 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -10971,7 +10971,8 @@ static void x86_cpu_common_class_init(ObjectClass *= oc, const void *data) * QMP command: they list the features that would have prevented the * CPU from running if the "enforce" flag was set. */ - object_class_property_add(oc, "unavailable-features", "strList", + object_class_property_add_qapi(oc, "unavailable-features", + &strList_type_info, x86_cpu_get_unavailable_features, NULL, NULL, NULL); =20 --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052304; cv=none; d=zohomail.com; s=zohoarc; b=IHys95gD2J+zmcnriAJhHpp4X4iNEFl2eRkqeWgplM0shXk6k9OfdjGwbTitFfUl6aXHwzLTKQg1rJp1FTCpMbu27bkYx9EGGbxyoV2Q4cmwTeYHeT/yd0aU/2BGw6Da9IwwjO0+GY+Dke7FMl8NQ35u/eo3uQPFtUH+dK5Fm/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052304; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bjQUeWzB+URGNhy51pTY8kngaMPVjWJKxA5gkx975Fc=; b=Vg9NAk8RWeGKdc+arqATD/j6C3FmthvSkj20Gy1hNPXAH4raATAlwC0d4eYkBEFBF+sUi9wlIOTWS/0YI2q9Q6JID1kqR2Iae6HxJ54XOmknjFmE9Z24699E/7WyG3DlvpFs8otuXP61YEg7+OeYdpo5sOtr2F/8OilwgmNhIPg= 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 1787052304552483.1392648406801; Tue, 18 Aug 2026 04:25:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHvZ-0004DP-KD; Tue, 18 Aug 2026 07:24:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHvY-0004Cv-Eq for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:24:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHvW-0007GP-Ot for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:24:20 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-646-N1daW5HWNVOjkVnoRXQwtw-1; Tue, 18 Aug 2026 07:24:06 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 472CB195608B; Tue, 18 Aug 2026 11:24:05 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 37FBE3000239; Tue, 18 Aug 2026 11:23:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052258; 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=bjQUeWzB+URGNhy51pTY8kngaMPVjWJKxA5gkx975Fc=; b=Jxf76+JGQo4Qb0+8HKz424+nJyc67T2jCFBaRDVxBj5ORGointcPr0+wSmWz4ljtKevYzh stW7u2veuU1AOkZgqYZGeYFNVlsmEbjbLUkj7g/0EFsy7tVaiGjO8cy3bxVsiGhNh/1RVV 4qZ9PB6/z+dKOmdd37rBTcYtZ/PzWl0= X-MC-Unique: N1daW5HWNVOjkVnoRXQwtw-1 X-Mimecast-MFC-AGG-ID: N1daW5HWNVOjkVnoRXQwtw_1787052245 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:14 +0400 Subject: [PATCH v3 47/74] accel/hvf: convert OnOffSplit property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-47-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Roman Bolshakov , Phil Dennis-Jordan X-Developer-Signature: v=1; a=openpgp-sha256; l=2469; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=oWCHQCOKOr/KE6g1VOAN6Z+R3g0iOTOZVDDieDqKREY=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD27DC8PogTLZ7Zc1KXnwkiMMjdQC1+ZsyfD6 Ywzp0RI37iJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uwAKCRDa6OEJdZac 5fhRD/9G+E5r5X6fVAD76RpukOc8Mqqd5hfUwJcWdCdlNqYnGZVNy+PuBvNtIBvsadTjtNGhOIL 15aYL2FE1qJwT4VXklCB5jDNuSTuCHj/4l2DyO8bhdhqFFWHew2hASqZicV5kSSWc3YHi0rz+AZ nJUZ0HFz/nGoyItnjq+gwgR5lahIJU7Zhlm7jF4NdoS2BelbPXNaK3PTVClmdATnjrRBjMvHL+1 rywFQRp2qwM/EXW0BDr0DPwNuc1/chJxRdcP1Ka9mGGF/vGEwrGFhb3+GDMB8Q/zbTbOdakyShe q1wH+X9kUBolz/fDB/W9CXUIHwGpVLSSAGA2ORYNemuBXyiRePb/UfK08eyN27Ni70qXj2SXe3U bvNHl4HvIyieyn0SMtvP+WNAvqcv4KQXWy0CNM+JXaObPB0Brn60VzR6VaQQzhQaU6h/stZc6yL GHANJDNNDbsxPe8jqCkh3sGIjwb8lpfweC+OKBAwKf0XL/yBmTiYTS6GYvahL4USzimYP8PHBJM y67SNXPYXfLNVnr76x2r0c+RgIcD76u2dG6jEZ8b8Y2Nmhj0uM8H8AuXBMSAcNTVhns2QUFpCVN uU3UWITPwXruGY/7nl6sIGbJ3dCclIiQ5BLVkE7mwwsg+bpnDFAb1c6SPZg3iqZYCFrYpFp3unR SoPd9idj/Uvf60Q== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787052305774158500 Convert the OnOffSplit property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- accel/hvf/hvf-all.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 8bd9154a50b6..2fd594ad156f 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -11,6 +11,7 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qapi-visit-common.h" #include "accel/accel-ops.h" #include "exec/cpu-common.h" @@ -230,18 +231,12 @@ static int hvf_accel_init(AccelState *as, MachineStat= e *ms) return hvf_arch_init(); } =20 -static void hvf_set_kernel_irqchip(Object *obj, Visitor *v, - const char *name, void *opaque, +static void hvf_set_kernel_irqchip(Object *obj, int value, Error **errp) { - OnOffSplit mode; - hvf_kernel_irqchip_override =3D true; - if (!visit_type_OnOffSplit(v, name, &mode, errp)) { - return; - } =20 - switch (mode) { + switch (value) { case ON_OFF_SPLIT_ON: #ifdef HOST_X86_64 /* macOS 12 onwards exposes an HVF virtual APIC. */ @@ -261,11 +256,7 @@ static void hvf_set_kernel_irqchip(Object *obj, Visito= r *v, break; =20 default: - /* - * The value was checked in visit_type_OnOffSplit() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 @@ -277,11 +268,13 @@ static void hvf_accel_class_init(ObjectClass *oc, con= st void *data) ac->allowed =3D &hvf_allowed; hvf_kernel_irqchip_override =3D false; hvf_kernel_irqchip =3D false; - object_class_property_add(oc, "kernel-irqchip", "on|off|split", - NULL, hvf_set_kernel_irqchip, - NULL, NULL); - object_class_property_set_description(oc, "kernel-irqchip", - "Configure HVF irqchip"); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "kernel-irqchip", + .qapi_type =3D &OnOffSplit_type_info, + .set =3D hvf_set_kernel_irqchip, + .description =3D "Configure HVF irqchip", + )); } =20 static const TypeInfo hvf_accel_type =3D { --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052307; cv=none; d=zohomail.com; s=zohoarc; b=G24uA/Ttoncs9BhXQErdM29eZ2ggmrtPypeqwBZ7haCmrXvmrHBb6Jd3Vq6BTKok1LrD+oACa0eSwOJgnAsF2BeWnLyjeRxOUPW3nYGIt+5agddioKcyR6AkmPD1VmvCn5w94hb4i79oeA540GFEzzex+6bVVGWvy5yy69bWXv0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052307; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=oIiDAG2jKPc8trfxeDzWrsYVGy/FtqWuSjPzxQy4+IM=; b=LHEEopy/ud2zKZObAWxb5cZTCbZp81SQq3iPf82GkMjxuxA3QJtvXXFFYiJAuwzEMO3FMWQVoJMzb1WpXOCtw/dsRxKfutOroYdj5PMS+YFn1hlm86WOB6qvZ+LsMLKnkDMx4TFtGV3PdLNL8fJEmZaY+i/aY83bJsCZ1U10FV4= 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 1787052307726999.2786430075059; Tue, 18 Aug 2026 04:25:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHva-0004Dm-PF; Tue, 18 Aug 2026 07:24:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHvZ-0004D9-4M for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:24:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHvX-0007GU-H8 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:24:20 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-616-5Ml62bQSO3u-tRqpTeh9Kg-1; Tue, 18 Aug 2026 07:24:15 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 65D6F1956047; Tue, 18 Aug 2026 11:24:14 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 299511800347; Tue, 18 Aug 2026 11:24:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052258; 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=oIiDAG2jKPc8trfxeDzWrsYVGy/FtqWuSjPzxQy4+IM=; b=dZ32JPMcaqWHwkDnSmHIYn0Dm41ETdC274/9VUUpLYY+Yt3NH6GEpUl6XC5V09xuN6KIEU TvUyms+qY1Y6GNUTqAuFwyNP9aSOCw08sEbeMTKFx5HIGZrD1GUlW8I2BKYxSZik5oFAe7 amlJLSE9F/Ncw3pzrXLFX9UW4aNrDH8= X-MC-Unique: 5Ml62bQSO3u-tRqpTeh9Kg-1 X-Mimecast-MFC-AGG-ID: 5Ml62bQSO3u-tRqpTeh9Kg_1787052254 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:15 +0400 Subject: [PATCH v3 48/74] i386/x86: convert SgxEPCList property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-48-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Richard Henderson X-Developer-Signature: v=1; a=openpgp-sha256; l=1068; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=cnTGm8gLgIdGgYxLJNoo6ULUUXiyoyqTdIIMx4XVumw=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD27i5h6WdjbgKQJFbRnX7zbgFQfLjcM96c1Z ud+a0WrkuaJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uwAKCRDa6OEJdZac 5ZHbD/9SMXkD6jEZ1nvLQMhr2h14XUnX1XL7EAC/Qkitl90HAkH8B5p+GnfHDzHTOWzUIK/ADBa BJvjkK8p48GCjIBCC/d8zw9vh6LmRQL4qEKYQmu97R6DvfypV5bqNd1cMY/dRN5P3fNqiSG7Ya/ 8OU7znsWTO3L5m+MzUNRWnXzEU8GxKBSTli34cQY5MNKlf70qAAFZGauEA6v8rerRNrQhbwlohk yAIFHkdWXXjzU63YquRT+LvLq6LyfCOvLJ3PN+XGcGVAZybOTEMRy5DY+cRDY1ijuVYZdSgxIYv bptHGcvTqscI7LiuPHPdaQ/lTONdZQLy2AMzoCSBzHayKY4YGLDFjnTMk/X5NYv+eFUf4GZSp4q IQNf1qrqemAKtewLrprB0DPMiMWNG3wr5UUWUibmV4qSo5bn7oj2N3TBK6SkeCcHvf4eq3KjyPo QihNCdpbvkpgUr7Hl5MxjcecvIKM3whbNBL6JF79snV5Q2lHC7bZIopFV5bUzA9u5B17d0+ea0y hX2aqIIoS4r817azZJ/s34v5qv64a3zlM7fdi/SHQ4xg7ok1+JuRG1KEsrRs8YCcjd1m7X1SLxT 8N4WMA/FbD4iAS12rjIFA9a78i7SYMtXo6P+TOFI3YWC3Zyqs4+lEHOkZM0ELVcKHewNTjuIHYU oiPs9oUGvj490Pg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787052309473158500 Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/i386/x86.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index d0c782ec8544..ed38760d798d 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -25,6 +25,7 @@ #include "qemu/units.h" #include "qapi/error.h" #include "qapi/qapi-type-infos-common.h" +#include "qapi/qapi-type-infos-machine.h" #include "qapi/qapi-visit-machine.h" #include "qapi/visitor.h" #include "system/qtest.h" @@ -426,7 +427,7 @@ static void x86_machine_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, X86_MACHINE_BUS_LOCK_RATELIM= IT, "Set the ratelimit for the bus locks acquired in VMs"); =20 - object_class_property_add(oc, "sgx-epc", "SgxEPC", + object_class_property_add_qapi(oc, "sgx-epc", &SgxEPCList_type_info, machine_get_sgx_epc, machine_set_sgx_epc, NULL, NULL); object_class_property_set_description(oc, "sgx-epc", --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052312; cv=none; d=zohomail.com; s=zohoarc; b=QHLZ8Q50rEGd4D89dvVEk9kY/TQX6V/KNcE89nFcvGe3oQNBNmJJRBosCYUp/UIXVpq8loPP+r0tqtbCt1eytE6u5BjOAPsGCgBGA+IPS+kzyjPgBOnJ0boESs+uJRm12jwDHmnwBDkph7GvwkNhApErqWUrkucvGvAd3HPt8ho= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052312; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AW3x7UFETjhbxcBvJveET4/kYyJB8eslOj8OPFxXamY=; b=I0LEHV7Fkjj1smgXa3fH8obwUKxR6IryZpMot9vwfHjRQr7J/Ms6hYGO1qx5LLYMt/b3Kr9ANxtetMTWm7+2CbVM8ZXQVtamqOB/xH1/NksQ54BA/2LSRHc0WngfaudfBzU6wp1cU4TttOqdz5VGfX+wrZaVkcslhZQyVFJ5GfU= 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 1787052312924309.5578228186349; Tue, 18 Aug 2026 04:25:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHvs-0004kC-6O; Tue, 18 Aug 2026 07:24:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHvp-0004jE-HE for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:24:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHvl-0007IF-K4 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:24:35 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-326-WeyFG8VgN2aC-LGpYuw8iA-1; Tue, 18 Aug 2026 07:24:29 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CBDC21800344; Tue, 18 Aug 2026 11:24:27 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6A600180034C; Tue, 18 Aug 2026 11:24:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052272; 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=AW3x7UFETjhbxcBvJveET4/kYyJB8eslOj8OPFxXamY=; b=DnG4q6pbaoSDEV8JpB05VDRH9+J+seyImtYdgZriba4x2iawu7UgVmtuoTTRMybreI1RjA oXDsXzBcEjZIpOkAmFVl+rUlPIl6wRd74dppPtAQxIVVwrNQbkwhGrz6k+g0RTCeMfU+95 4ZG9YaCdSHP6GGAbaIKh6UWelK7Dsc0= X-MC-Unique: WeyFG8VgN2aC-LGpYuw8iA-1 X-Mimecast-MFC-AGG-ID: WeyFG8VgN2aC-LGpYuw8iA_1787052267 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:16 +0400 Subject: [PATCH v3 49/74] virtio-balloon: convert guest-stats property to QAPI type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-49-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , David Hildenbrand , Eric Blake , Zhao Liu X-Developer-Signature: v=1; a=openpgp-sha256; l=10078; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=wAG3gHYjMgKsDKDJ91QsQeDsDiDGOctuzZ3U1NVRvyY=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD27OFDqlHr5+zpQEfVxVrB0ViY+tS9za866m MNvHcFNcmaJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uwAKCRDa6OEJdZac 5V3zEAC33PtAa1olxke/FwCPvU34ZtuBi1CjJH7B5EqLbtn7u31B8JMrq0b+b1GA+XPBCmq/kDi F5vJp7sU3zgiif1NrsN7cp+r9MZCU6jT+RKwlH/lnCuYzMKj5YKQJsA7DPah4mjLTjSOjLX4o6k kei12WL5L2dv2iMdbSY6zCGlAiysQwlycF9SyIjuSssAIcmw0ueMFv0xnYuGg6m2+W0fMAF4f5B XuGttiXFRnNefET/jgksJCBU2LQKEWil2we0MagZPp4FwtZ5GoGB3Efu3i5vE2uuXIYst9pZXgD WjUyk57wwvHulBfxe28pnzSoMV5Jqs2108L+cCvyhSkJofaSjXgSh82oH2ju7sdjY6W4Grxoqa/ ZTT7krKc4YZROQv5+22vNKwksXNqbEKp0TklqTKSngVpfIYSEOj3lds0PbPt6opa1LLbQINaWOq 1OYB1GrhkPX6sBzevMcEEJJ+sTjHiCUpNkNH1eLF41FcM1LvwDHRueDRkS3bQGRxH/u/83vIWc+ WymFIOofp7bkdV+G5XdSmqMep9BVm/JcWdhgycWzdw63hpvXLkjW7RSzN/Ddyf8sqaSZQZsUQ69 l8hUNMWqXGZcSdFev8zklhYw+QFOzeNfCKqIZAYaj/BQA7iTL/Ge1MimLkZrMHoveuPdIRDisHV TH9IR++C7NZWEUA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=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: 1787052313589158500 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 --- docs/interop/virtio-balloon-stats.rst | 22 +-------- hw/virtio/virtio-balloon.c | 84 ++++++++++++-------------------- qapi/machine.json | 92 +++++++++++++++++++++++++++++++= ++++ 3 files changed, 123 insertions(+), 75 deletions(-) diff --git a/docs/interop/virtio-balloon-stats.rst b/docs/interop/virtio-ba= lloon-stats.rst index b9a6a6edb229..88d3271bbb02 100644 --- a/docs/interop/virtio-balloon-stats.rst +++ b/docs/interop/virtio-balloon-stats.rst @@ -22,27 +22,7 @@ polling the guest's balloon driver for new stats in the = specified time interval. =20 To retrieve those stats, clients have to query the guest-stats property, -which will return a dictionary containing: - - * A key named 'stats', containing all available stats. If the guest - doesn't support a particular stat, or if it couldn't be retrieved, - its value will be -1. Currently, the following stats are supported: - - - stat-swap-in - - stat-swap-out - - stat-major-faults - - stat-minor-faults - - stat-free-memory - - stat-total-memory - - stat-available-memory - - stat-disk-caches - - stat-htlb-pgalloc - - stat-htlb-pgfail - - * A key named last-update, which contains the last stats update - timestamp in seconds. Since this timestamp is generated by the host, - a buggy guest can't influence its value. The value is 0 if the guest - has not updated the stats (yet). +which will return a VirtioBalloonGuestStats (see QAPI documentation). =20 It's also important to note the following: =20 diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 9e43948128f7..c9873f8cf0c2 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" @@ -169,33 +171,8 @@ static void balloon_deflate_page(VirtIOBalloon *balloo= n, } } =20 -/* - * All stats upto VIRTIO_BALLOON_S_NR /must/ have a - * non-NULL name declared here, since these are used - * as keys for populating the QDict with stats - */ -static const char *balloon_stat_names[] =3D { - [VIRTIO_BALLOON_S_SWAP_IN] =3D "stat-swap-in", - [VIRTIO_BALLOON_S_SWAP_OUT] =3D "stat-swap-out", - [VIRTIO_BALLOON_S_MAJFLT] =3D "stat-major-faults", - [VIRTIO_BALLOON_S_MINFLT] =3D "stat-minor-faults", - [VIRTIO_BALLOON_S_MEMFREE] =3D "stat-free-memory", - - [VIRTIO_BALLOON_S_MEMTOT] =3D "stat-total-memory", - [VIRTIO_BALLOON_S_AVAIL] =3D "stat-available-memory", - [VIRTIO_BALLOON_S_CACHES] =3D "stat-disk-caches", - [VIRTIO_BALLOON_S_HTLB_PGALLOC] =3D "stat-htlb-pgalloc", - [VIRTIO_BALLOON_S_HTLB_PGFAIL] =3D "stat-htlb-pgfail", - - [VIRTIO_BALLOON_S_OOM_KILL] =3D "stat-oom-kills", - [VIRTIO_BALLOON_S_ALLOC_STALL] =3D "stat-alloc-stalls", - [VIRTIO_BALLOON_S_ASYNC_SCAN] =3D "stat-async-scans", - [VIRTIO_BALLOON_S_DIRECT_SCAN] =3D "stat-direct-scans", - [VIRTIO_BALLOON_S_ASYNC_RECLAIM] =3D "stat-async-reclaims", - - [VIRTIO_BALLOON_S_DIRECT_RECLAIM] =3D "stat-direct-reclaims", -}; -G_STATIC_ASSERT(G_N_ELEMENTS(balloon_stat_names) =3D=3D VIRTIO_BALLOON_S_N= R); +/* Update VirtioBalloonStats QAPI type when new stats are added */ +G_STATIC_ASSERT(VIRTIO_BALLOON_S_NR =3D=3D 16); =20 /* * reset_stats - Mark all items in the stats array as unset @@ -257,33 +234,31 @@ static void balloon_stats_get_all(Object *obj, Visito= r *v, const char *name, void *opaque, Error **errp) { VirtIOBalloon *s =3D VIRTIO_BALLOON(obj); - bool ok =3D false; - int i; + VirtioBalloonStats stats =3D { + .stat_swap_in =3D s->stats[VIRTIO_BALLOON_S_SWAP_IN], + .stat_swap_out =3D s->stats[VIRTIO_BALLOON_S_SWAP_OUT], + .stat_major_faults =3D s->stats[VIRTIO_BALLOON_S_MAJFLT], + .stat_minor_faults =3D s->stats[VIRTIO_BALLOON_S_MINFLT], + .stat_free_memory =3D s->stats[VIRTIO_BALLOON_S_MEMFREE], + .stat_total_memory =3D s->stats[VIRTIO_BALLOON_S_MEMTOT], + .stat_available_memory =3D s->stats[VIRTIO_BALLOON_S_AVAIL], + .stat_disk_caches =3D s->stats[VIRTIO_BALLOON_S_CACHES], + .stat_htlb_pgalloc =3D s->stats[VIRTIO_BALLOON_S_HTLB_PGALLOC], + .stat_htlb_pgfail =3D s->stats[VIRTIO_BALLOON_S_HTLB_PGFAIL], + .stat_oom_kills =3D s->stats[VIRTIO_BALLOON_S_OOM_KILL], + .stat_alloc_stalls =3D s->stats[VIRTIO_BALLOON_S_ALLOC_STALL], + .stat_async_scans =3D s->stats[VIRTIO_BALLOON_S_ASYNC_SCAN], + .stat_direct_scans =3D s->stats[VIRTIO_BALLOON_S_DIRECT_SCAN], + .stat_async_reclaims =3D s->stats[VIRTIO_BALLOON_S_ASYNC_RECLAIM], + .stat_direct_reclaims =3D s->stats[VIRTIO_BALLOON_S_DIRECT_RECLAIM= ], + }; + VirtioBalloonGuestStats guest_stats =3D { + .last_update =3D s->stats_last_update, + .stats =3D &stats, + }; + VirtioBalloonGuestStats *argp =3D &guest_stats; =20 - if (!visit_start_struct(v, name, NULL, 0, errp)) { - return; - } - if (!visit_type_int(v, "last-update", &s->stats_last_update, errp)) { - goto out_end; - } - - if (!visit_start_struct(v, "stats", NULL, 0, errp)) { - goto out_end; - } - for (i =3D 0; i < VIRTIO_BALLOON_S_NR; i++) { - if (!visit_type_uint64(v, balloon_stat_names[i], &s->stats[i], err= p)) { - goto out_nested; - } - } - ok =3D visit_check_struct(v, errp); -out_nested: - visit_end_struct(v, NULL); - - if (ok) { - visit_check_struct(v, errp); - } -out_end: - visit_end_struct(v, NULL); + visit_type_VirtioBalloonGuestStats(v, name, &argp, errp); } =20 static void balloon_stats_get_poll_interval(Object *obj, Visitor *v, @@ -1020,7 +995,8 @@ static void virtio_balloon_instance_init(Object *obj) s->free_page_hint_cmd_id =3D VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN; s->free_page_hint_notify.notify =3D virtio_balloon_free_page_hint_noti= fy; =20 - object_property_add(obj, "guest-stats", "guest statistics", + object_property_add_qapi(obj, "guest-stats", + &VirtioBalloonGuestStats_type_info, balloon_stats_get_all, NULL, NULL, NULL); =20 object_property_add_qapi(obj, "guest-stats-polling-interval", &int_typ= e_info, diff --git a/qapi/machine.json b/qapi/machine.json index 2d63c1bac3b4..d418b34a8643 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1132,6 +1132,98 @@ ## { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } } =20 +## +# @VirtioBalloonStats: +# +# VirtIO balloon device guest memory statistics. +# +# If the guest doesn't support a particular stat, or if it couldn't +# be retrieved, its value will be -1. +# +# @stat-swap-in: The amount of memory that has been +# swapped in (in bytes). +# +# @stat-swap-out: The amount of memory that has been +# swapped out to disk (in bytes). +# +# @stat-major-faults: The number of major page faults +# that have occurred. +# +# @stat-minor-faults: The number of minor page faults +# that have occurred. +# +# @stat-free-memory: The amount of memory not being used +# for any purpose (in bytes). +# +# @stat-total-memory: The total amount of memory available +# (in bytes). +# +# @stat-available-memory: An estimate of how much memory is available +# (in bytes) for starting new applications, without pushing the +# system to swap. +# +# @stat-disk-caches: The amount of memory, in bytes, that can be +# quickly reclaimed without additional I/O. Typically these pages +# are used for caching files from disk. +# +# @stat-htlb-pgalloc: The number of successful hugetlb page +# allocations +# +# @stat-htlb-pgfail: The number of failed hugetlb page +# allocations +# +# @stat-oom-kills: The number of OOM killer invocations +# +# @stat-alloc-stalls: The number of memory allocation stalls +# +# @stat-async-scans: The number of memory scanned asynchronously +# +# @stat-direct-scans: The number of memory scanned directly +# +# @stat-async-reclaims: The number of memory reclaimed asynchronously +# +# @stat-direct-reclaims: The number of memory reclaimed directly +# +# Since: 11.2 +## +{ 'struct': 'VirtioBalloonStats', + 'data': { + 'stat-swap-in': 'uint64', + 'stat-swap-out': 'uint64', + 'stat-major-faults': 'uint64', + 'stat-minor-faults': 'uint64', + 'stat-free-memory': 'uint64', + 'stat-total-memory': 'uint64', + 'stat-available-memory': 'uint64', + 'stat-disk-caches': 'uint64', + 'stat-htlb-pgalloc': 'uint64', + 'stat-htlb-pgfail': 'uint64', + 'stat-oom-kills': 'uint64', + 'stat-alloc-stalls': 'uint64', + 'stat-async-scans': 'uint64', + 'stat-direct-scans': 'uint64', + 'stat-async-reclaims': 'uint64', + 'stat-direct-reclaims': 'uint64' } } + +## +# @VirtioBalloonGuestStats: +# +# Guest statistics from the VirtIO balloon device. +# +# @last-update: timestamp in seconds of the last stats +# update from the guest (since this timestamp is generated +# by the host, a buggy guest can't influence its value), +# or 0 if no update has been received yet. +# +# @stats: balloon memory statistics +# +# Since: 11.2 +## +{ 'struct': 'VirtioBalloonGuestStats', + 'data': { + 'last-update': 'int', + 'stats': 'VirtioBalloonStats' } } + ## # @query-balloon: # --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052324; cv=none; d=zohomail.com; s=zohoarc; b=EUPeh7an2ctJsUh0Sp/NPYIebbHdGi4bq374MgCH8bHNSCPFIBT6hgIKt+EFVbBQ+pV2fS6eDe9MMiWUWGnQlFCe88nzfQ8+fYjKsh0wRscnM/RaxLGTSt6NBJJg6SDctVO/h1Neu6RR4E85hzR95tmKHRCSaCBX1GltjjcnJwU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052324; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=a97ESGSAB+LtBGl3FtsUreZlvYs5zsUazQpPMiETlic=; b=MNxFnN4wJL0AwsWfFQ3aV1iP97wAR8GVPpPAPy4Yym14HHENKlrYUb29aerchcvGxKIm1T/NgLdADWmD/lR9YX18y+E91JMvjHhEt3RaF/fvPFadn3YE8bV9dH8m/YP1ZJllDqHfovZd1PQzzScMM8ptbBVer/EDEr5Tot76s4A= 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 1787052324724949.6230473704521; Tue, 18 Aug 2026 04:25:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHwL-0005fQ-Kt; Tue, 18 Aug 2026 07:25:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHwF-0005N7-D9 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:25:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHwC-0007PC-WE for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:25:03 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-479-DU68lctEOHiGighbdHHRrA-1; Tue, 18 Aug 2026 07:24:57 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C529718001E6; Tue, 18 Aug 2026 11:24:55 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9BEEC423; Tue, 18 Aug 2026 11:24:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052300; 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=a97ESGSAB+LtBGl3FtsUreZlvYs5zsUazQpPMiETlic=; b=Uu+I6hc/wcCfjjS85B5/l9USznJkODLX6UvQFESEYz5Cl4uhBT1vjype31+FN7SBdEMCWV UCjoAeXXmGFPoG4+AujGbJp72f1ekPI7sa5o7S+btZGVJEjPjoc48IqZIVS+X/pyMTG9i0 VnuxlYwQhFHvIBHvuHktn7xbLk/ytu8= X-MC-Unique: DU68lctEOHiGighbdHHRrA-1 X-Mimecast-MFC-AGG-ID: DU68lctEOHiGighbdHHRrA_1787052295 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:17 +0400 Subject: [PATCH v3 50/74] qom: replace object_property_add_tm with StructTm QAPI type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-50-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Nicholas Piggin , Harsh Prateek Bora , "Michael S. Tsirkin" , Eric Blake , qemu-ppc@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=9797; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=tPMgw++FP90dtkmxKsUhd+GjqMKYCwj6bdRmikAYVpY=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD276+IBV6gJKDXq7McSfEBvIXClDQKD2f6Ox blAStM9+4SJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uwAKCRDa6OEJdZac 5bl+D/9JRjbSDlU+ng/Je9buvfCyvSNDC0u59KPxGvmtdfNw4DP3mH6jGlQtod8smzleCNuv8OD IhiexdW4wP1iZF2lBTmw6NyuNwfRvGOm8flPhblyi0ix28cGmlVZ3wq0S6+GqygcRvGDHGbai4y pjS+1kEK0Flnr4cl9hDEWHIpeIQq5n+rS1P4OgaeT+Fu7T9hj3B+tRw3841Wdl61dJwOiZVgBKB g/9ICwUYjDRhb0cMj51+k7FsrjYQh7d/gNN4Ie9NqDBYwNTeJi0yAhW2s8ERvfoFnmneZjEno5D Abd/OXpBuyoCreHNup8++qD97PXjq2hvvLLIszuwkSbIqnIzJaDBJx2GOj13VEMkgAZ5n1C5WaS 6Yf3sPWwXPEwsd+dTAaqdoHMdAJVeXXz1KRTf+zui5xdQWpRVRvL3eEDRq8HqaTAFCsp+W2t+P5 cWBDHhKVMnfos1/63rw3VO71QmU15G92m9v2EOzdwVRQdLooEaHAZm8LHKCVC5DeLmO84ml/iSJ Fb+GxkxuywuRH4rjF3NuDvXZmKN5Fz3+kbthf8VQYKuLQa70J6l3vIkHdtX7PmrfB39FXxvgpQT /ukZPQ85ANhS/6/AXkF4kcMzySxqkxUHHjk/eep06qaDuvrXWJjQLbKQDTEIpM8950Fke4VWlGi w8j1rdhCaoM/0Zw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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: 1787052325519158500 Define a StructTm QAPI struct in common.json matching the existing "struct tm" property wire format (tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec as int32). Convert the two callers (mc146818rtc and spapr_rtc) to use object_property_add_qapi() with a standard ObjectPropertyAccessor that populates a StructTm and calls the generated visitor. Remove object_property_add_tm(), object_class_property_add_tm(), the TMProperty type, and the property_get_tm() helper from qom/object.c, along with their declarations in object.h. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/ppc/spapr_rtc.c | 18 +++++++++++--- hw/rtc/mc146818rtc.c | 16 +++++++++--- include/qom/object.h | 29 ---------------------- qapi/common.json | 28 +++++++++++++++++++++ qapi/pragma.json | 1 + qom/object.c | 69 ------------------------------------------------= ---- 6 files changed, 57 insertions(+), 104 deletions(-) diff --git a/hw/ppc/spapr_rtc.c b/hw/ppc/spapr_rtc.c index 1f7d2d8f898b..a4a2b3237e26 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,17 @@ 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) { value.tm_year, value.tm_mon, value.tm_mday, + value.tm_hour, value.tm_min, value.tm_sec }; + visit_type_StructTm(v, name, &tmp, errp); } =20 static void spapr_rtc_realize(DeviceState *dev, Error **errp) @@ -150,7 +161,8 @@ static void spapr_rtc_realize(DeviceState *dev, Error *= *errp) rtc_ns =3D qemu_clock_get_ns(rtc_clock); rtc->ns_offset =3D host_s * NANOSECONDS_PER_SECOND - rtc_ns; =20 - object_property_add_tm(OBJECT(rtc), "date", spapr_rtc_qom_date); + object_property_add_qapi(OBJECT(rtc), "date", &StructTm_type_info, + spapr_rtc_qom_date, NULL, NULL, NULL); } =20 static const VMStateDescription vmstate_spapr_rtc =3D { diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index ba396435d1af..328dd038f167 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,19 @@ 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) { value.tm_year, value.tm_mon, value.tm_mday, + value.tm_hour, value.tm_min, value.tm_sec }; + visit_type_StructTm(v, name, &tmp, errp); } =20 static void rtc_realizefn(DeviceState *dev, Error **errp) @@ -1019,7 +1028,8 @@ static void rtc_class_initfn(ObjectClass *klass, cons= t void *data) device_class_set_props(dc, mc146818rtc_properties); set_bit(DEVICE_CATEGORY_MISC, dc->categories); =20 - object_class_property_add_tm(klass, "date", rtc_get_date); + object_class_property_add_qapi(klass, "date", &StructTm_type_info, + rtc_get_date, NULL, NULL, NULL); } =20 static const TypeInfo mc146818rtc_info =3D { diff --git a/include/qom/object.h b/include/qom/object.h index 70217eba1473..db4972294e39 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -2049,35 +2049,6 @@ object_class_property_add_qapi(ObjectClass *klass, ObjectPropertyRelease *release, void *opaque); =20 -/** - * object_property_add_tm: - * @obj: the object to add a property to - * @name: the name of the property - * @get: the getter or NULL if the property is write-only. - * - * Add a read-only struct tm valued property using a getter function. - * This function will add a property of type 'struct tm'. - * - * Returns: The newly added property on success, or %NULL on failure. - */ -ObjectProperty *object_property_add_tm(Object *obj, const char *name, - void (*get)(Object *, struct tm *, Error **)); - -/** - * object_class_property_add_tm: - * @klass: the object class to add a property to - * @name: the name of the property - * @get: the getter or NULL if the property is write-only. - * - * Add a read-only struct tm valued property using a getter function. - * This function will add a property of type 'struct tm'. - * - * Returns: The newly added property on success, or %NULL on failure. - */ -ObjectProperty *object_class_property_add_tm(ObjectClass *klass, - const char *name, - void (*get)(Object *, struct tm *, Error **)); - typedef enum { /* Automatically add a getter to the property */ OBJ_PROP_FLAG_READ =3D 1 << 0, diff --git a/qapi/common.json b/qapi/common.json index af7e3d618a7c..928ba0ba2c63 100644 --- a/qapi/common.json +++ b/qapi/common.json @@ -228,3 +228,31 @@ ## { 'enum': 'EndianMode', 'data': [ 'unspecified', 'little', 'big' ] } + +## +# @StructTm: +# +# Broken-down time. Field semantics match C ``struct tm``. +# +# @tm_year: years since 1900 +# +# @tm_mon: months since January (0-11) +# +# @tm_mday: day of the month (1-31) +# +# @tm_hour: hours since midnight (0-23) +# +# @tm_min: minutes after the hour (0-59) +# +# @tm_sec: seconds after the minute (0-59, 60-61 for leap seconds) +# +# Since: 11.2 +## +{ 'struct': 'StructTm', + 'data': { + 'tm_year': 'int32', + 'tm_mon': 'int32', + 'tm_mday': 'int32', + 'tm_hour': 'int32', + 'tm_min': 'int32', + 'tm_sec': 'int32' } } diff --git a/qapi/pragma.json b/qapi/pragma.json index 24aebbe8f5fc..8283149693d8 100644 --- a/qapi/pragma.json +++ b/qapi/pragma.json @@ -108,6 +108,7 @@ 'QKeyCode', # send-key, input-sent-event 'QapiErrorClass', # QMP error replies 'SshHostKeyCheckMode', # blockdev-add, -blockdev + 'StructTm', # qom-get of RTC date property 'SysEmuTarget', # query-cpu-fast, query-target 'UuidInfo', # query-uuid 'VncClientInfo', # query-vnc, query-vnc-servers, ... diff --git a/qom/object.c b/qom/object.c index 65e640d1b7d1..4d7c9181fb6e 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2628,75 +2628,6 @@ object_class_property_add_qapi(ObjectClass *klass, c= onst char *name, return prop; } =20 -typedef struct TMProperty { - void (*get)(Object *, struct tm *, Error **); -} TMProperty; - -static void property_get_tm(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - TMProperty *prop =3D opaque; - Error *err =3D NULL; - struct tm value; - - prop->get(obj, &value, &err); - if (err) { - error_propagate(errp, err); - return; - } - - if (!visit_start_struct(v, name, NULL, 0, errp)) { - return; - } - if (!visit_type_int32(v, "tm_year", &value.tm_year, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_mon", &value.tm_mon, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_mday", &value.tm_mday, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_hour", &value.tm_hour, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_min", &value.tm_min, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_sec", &value.tm_sec, errp)) { - goto out_end; - } - visit_check_struct(v, errp); -out_end: - visit_end_struct(v, NULL); -} - -ObjectProperty * -object_property_add_tm(Object *obj, const char *name, - void (*get)(Object *, struct tm *, Error **)) -{ - TMProperty *prop =3D g_malloc0(sizeof(*prop)); - - prop->get =3D get; - - return object_property_add(obj, name, "struct tm", - get ? property_get_tm : NULL, NULL, - property_release_data, - prop); -} - -ObjectProperty * -object_class_property_add_tm(ObjectClass *klass, const char *name, - void (*get)(Object *, struct tm *, Error **)) -{ - TMProperty *prop =3D g_malloc0(sizeof(*prop)); - - prop->get =3D get; - - return object_class_property_add(klass, name, "struct tm", - get ? property_get_tm : NULL, - NULL, NULL, prop); -} =20 static char *object_get_type(Object *obj, Error **errp) { --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052340; cv=none; d=zohomail.com; s=zohoarc; b=hK2vHP4jv4Q6SJ9J5Zz9P/CU5C0uoYw/opsyBY/0WCCGtuwPKnTX85ld/hsdgElEBPwg3fuE655aVe0Ddv7jcdt+I0MIIf6CDz24bPHv443w5V1CSMZKeOisEJ+9X1Gfc+rnxj15Ca9wP82ecGaPGFnTk6CYIPlmJBLzCynHvus= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052340; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=q1pBm4JIf/lwRiA1/QfhUtOlQUt1nuvI50NpLc2soGA=; b=L3Oyn5Cs1qFne6UQE1rYHOI4Utz7CP/M3FJog27UMAh4vIZ9PQFQW9+FMhaaehtMM3KQlggZRTGUZJSEBgmEdJOcM89ouPWYqAiy5ibt0/nWytpu3hBVZcFkmYN6W/4cCJspzUYheN1jG4kF6rUq2PjnFb2F9iKitjYBtd4jNj8= 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 1787052340314821.8864579840063; Tue, 18 Aug 2026 04:25:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHwg-000720-CT; Tue, 18 Aug 2026 07:25:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHwb-0006gF-SZ for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:25:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHwa-0007pq-Dg for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:25:25 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-632-7D1jSQEZMguh8fpZDEFISQ-1; Tue, 18 Aug 2026 07:25:15 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1CD5919560AA; Tue, 18 Aug 2026 11:25:06 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DACFC422; Tue, 18 Aug 2026 11:25:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052323; 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=q1pBm4JIf/lwRiA1/QfhUtOlQUt1nuvI50NpLc2soGA=; b=BMOO9BA7ppsQosg0jikXpD1s0FqBgTMZLca6QoVOB5OgBLlfcZQCZ0FMZ9/SecVGIg7UMy 2g5owyoO2gh3VLvSnENTMKgrYf7v4nc0NxHYgMq7ShCDUij7zYkAyW+MXwqEUIjJX/t7ng r2xyEF6h03N2astFkb5KaxoSFx56FDo= X-MC-Unique: 7D1jSQEZMguh8fpZDEFISQ-1 X-Mimecast-MFC-AGG-ID: 7D1jSQEZMguh8fpZDEFISQ_1787052306 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:18 +0400 Subject: [PATCH v3 51/74] hw/nvdimm: convert UUID property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-51-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Hildenbrand , Igor Mammedov , FangSheng Huang , Fam Zheng X-Developer-Signature: v=1; a=openpgp-sha256; l=2344; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=wdkmnzVqdE+H1nVJim++EcOuJVmDwXZEbt7GE3F4KZ8=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD27Pe8W+7nzO7gOgaUrwPZQISBKIjEJor9uL voDb0vQ6TOJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uwAKCRDa6OEJdZac 5VytD/wL0UiNF74hveu6Wr9+XVSz21hKcYMA9GO8gdUkKwUkKX/59oNQDt3qo/k/gKtFPQVaqC/ lqHKljHtjUb90wBYnUi5jUHDJUZAtnq/lXAzgi45wK74nYdB/6oGjPnFBZ3ngIdBPjMBXLzfrQ1 yqhsCPBcTb6fb2TjtPxXpKasNHqQWdgM0XuO1pUuUGdYDpaB/QJVSi1Q7bHQUj3GEKMg+15ZnJs e9zZ0ga+sC6YltJUV0nEp/ztfP7xibtJdgSu9CRSntEm49gozONGNUEJVxmXN9ClQvcubt4p4N5 yE5v+DuQQnq6C/SVzu5wLluH+5oKgjiOPn1Tx/ZrLkCrfwdK2+mWvJSEptUwItFyaINYAJYTBpd q4oILHJCWALEHjRtd8AL1WmrSfb0ftRKZhnksQ63z9WW9kTp+QCU9nUczHqgIiak3rO3JfWRrid IkwJyOQI/z5D/7gTAFcFqoE0+OZwNZn4tHV3q7nnsLGouD0ko5Jkvd9HyD6uQ4YVBoxm66PpQ4S b/jj0noUoZw+UlHHQM+6oM5yKDU+Mxxl88fMzIytBRJG35aAZ07uqgBLcznckyNpwmMlDgP38J3 QaLJ53BeAoN5+cT14sAwzPCx+SbmoPdSeBpttMZvGocPYK40jx+fYEzSZNiU8FKa4I0ezvDEMT8 ZVf4P6cF7Kgt1yQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787052341782158500 Add a QemuUUID_type_info and use object_property_add_qapi() instead of object_property_add() for the nvdimm UUID property. The type info is defined manually in uuid.c rather than generated, since QAPI does not yet support string typedefs. An alternative would be to extend the QAPI schema language with a 'typedef' construct (e.g. { 'typedef': 'UUID', 'data': 'str' }), which would let the generator produce the type info, C typedef, and introspection entry automatically. Alternatively, the exposed type being a string, we could change the property to be str_type_info. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/mem/nvdimm.c | 4 ++-- include/qemu/uuid.h | 4 ++++ util/uuid.c | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index 123ddc938546..b7ccb5c93678 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -104,8 +104,8 @@ static void nvdimm_init(Object *obj) nvdimm_get_label_size, nvdimm_set_label_size,= NULL, NULL); =20 - object_property_add(obj, NVDIMM_UUID_PROP, "QemuUUID", nvdimm_get_uuid, - nvdimm_set_uuid, NULL, NULL); + object_property_add_qapi(obj, NVDIMM_UUID_PROP, &QemuUUID_type_info, + nvdimm_get_uuid, nvdimm_set_uuid, NULL, NULL); } =20 static void nvdimm_finalize(Object *obj) diff --git a/include/qemu/uuid.h b/include/qemu/uuid.h index 869f84af09dd..ed0c62327d4d 100644 --- a/include/qemu/uuid.h +++ b/include/qemu/uuid.h @@ -16,6 +16,8 @@ #ifndef QEMU_UUID_H #define QEMU_UUID_H =20 +#include "qapi/qapi-type-info.h" + =20 /* Version 4 UUID (pseudo random numbers), RFC4122 4.4. */ =20 @@ -99,4 +101,6 @@ QemuUUID qemu_uuid_bswap(QemuUUID uuid); =20 uint32_t qemu_uuid_hash(const void *uuid); =20 +extern const QAPITypeInfo QemuUUID_type_info; + #endif diff --git a/util/uuid.c b/util/uuid.c index 234619dd5e69..363a03051aba 100644 --- a/util/uuid.c +++ b/util/uuid.c @@ -17,6 +17,11 @@ #include "qemu/uuid.h" #include "qemu/bswap.h" =20 +const QAPITypeInfo QemuUUID_type_info =3D { + .name =3D "QemuUUID", + .masked_name =3D "str", +}; + void qemu_uuid_generate(QemuUUID *uuid) { int i; --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052327; cv=none; d=zohomail.com; s=zohoarc; b=myPCU1PGs61W4UojgzRXGfmMgJ0pL02KWmpoN6WYg8UQxvA5L6vApeZ00k0IjbrgVRp9QKHlFQscGC44jivJyD2PC1gvHsTxb9uAME7/aR0W92o0HhRvNzd72jv2j5AWPsdINdKgvyVIFL0wI8EeNu2mp7nyHM1kT7QWyHhy7U0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052327; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DlOPStXdEIjyGF0oiytCfRyliZf4DuDKBTVkvMdaihc=; b=Gevq+CfeMcE+Jg8E8SosRDukJuEo6enGGrYNRpm4WvXKAE0GFQC1SRfm2ns2IyP1mjApRc9WkHI5fYrd4Eh8FJIwEkiIeU70Nu4SpeC+HMRHaVfDtRW9zq34/D0aXG7yLIkj9m8/ccjWciaO/hVBNb4+b6nRb6/N8moVCiO9rhE= 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 1787052326911804.4683632113694; Tue, 18 Aug 2026 04:25:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHwY-0006Rt-OL; Tue, 18 Aug 2026 07:25:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHwW-0006NI-NX for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:25:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHwU-0007oE-T5 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:25:20 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-218-eXDyrJ9mNyq7RDsTxd46Jw-1; Tue, 18 Aug 2026 07:25:14 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AB5A9195608F; Tue, 18 Aug 2026 11:25:11 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A9A2C1800348; Tue, 18 Aug 2026 11:25:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052318; 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=DlOPStXdEIjyGF0oiytCfRyliZf4DuDKBTVkvMdaihc=; b=Xb00PxBTx7zrDhJOrSGMK82boKI8N08MohmZ0aAC5MttvnWfzNQotCz252gxFUMUPtZyzi XHwRa6y6Bqrh5r0rbaT35YqE59jWqTf2SKLf2V79cSU6N9HQAiaZNP6ZBAmQ82Jj6tPdMx lGVdcqQDvTSxUvdoOrAhDJzSM5qP/bg= X-MC-Unique: eXDyrJ9mNyq7RDsTxd46Jw-1 X-Mimecast-MFC-AGG-ID: eXDyrJ9mNyq7RDsTxd46Jw_1787052311 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:19 +0400 Subject: [PATCH v3 52/74] hw/s390-virtio-ccw: convert loadparm property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-52-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Halil Pasic , Christian Borntraeger , Eric Farman , Matthew Rosato , Cornelia Huck , Richard Henderson , Ilya Leoshkevich , David Hildenbrand , qemu-s390x@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=1368; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=8KK4K4ulUWwzD0z52eof8cDeeeOb611fRZTz6Eqmcsw=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD27KkgyIoz261EYLE7UCpEP9J2RjTTLQpX6P DxARhJFr8uJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9uwAKCRDa6OEJdZac 5W5kEACo387VbvsRALkvYZPF1k9fFzXsX+G3JvAsFSyr6NkJJjEKM7tok4CvtvAjuGs3o6Ct1Q5 c0dkIP2XRpmi492gEBqUFnxsPBHROe3IX55q6vRjf9ZxpHF3gfm6zHeuDCt531Zq7RSbT8JFg6I 5Qjy1B/Xj10vCi+lAwwKyvFhUolyTg5UIYNUXhAA5W1Ix1LI9qyZReYmqG0YJVgcv6GQ9q+Tv5G nMbEIdj44QvalVzap4r9FSntgCUlgtilZHl4NYBFKmIQ6Muvi/PzrNpMNfq4pSO4FLkXyPFXzF2 pCD5sZTxGmTwkaI+TP9CCHdWUza9WdLIk9feyg9vlLdkrMN6ZhCzDuE8RN6ogSLhW+SDxCuZnyE wLzQ+zpLEfCob37MeGmIZlBKjIn6PkjgSIrWZNoetsVYF1YmmSMPmT14wvbrlkq6OA6WW2U41Ac WdvXT4WBQP5DIr13btFI9sjZqbOvzOwtIF05n8AZtvDMjwo+jgx5VSNuTdNlvQ8wFvT0kzoaGWQ d60gWPZ1CY2PXmahqLpOF0UXg0Mu5GYm7hqilxpsuQsFHVsb7MMQJsoEhinBM36qZ/cTZDqzjfu 0o0ZlWrPVBuVPUIkVMOiGnIqumG/IDrKyTABYIzOWjgRmH240nVRZKKNlDrYeJCJ7tIYrxF7Ijs NQvqvPVNq4uiMOQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787052327883158500 The QAPI type is actually a string. Here also, if we had typedef support we could expose a more specific type. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/s390x/s390-virtio-ccw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 06e5def9092b..c80d7ac92b22 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 "hw/s390x/cpu-topology.h" #include "kvm/kvm_s390x.h" @@ -847,7 +848,8 @@ static void ccw_machine_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, "dea-key-wrap", "enable/disable DEA key wrapping using the CPACF wrapping key"= ); =20 - object_class_property_add(oc, "loadparm", "loadparm", + /* if QAPI learns to typedef str, we could expose a more specific type= */ + object_class_property_add_qapi(oc, "loadparm", &str_type_info, machine_get_loadparm, machine_set_loadparm, NULL, NULL); object_class_property_set_description(oc, "loadparm", --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052329; cv=none; d=zohomail.com; s=zohoarc; b=JJxiND0s4e6OX/Nc2lnl6ufREu6yz1T+29qHggTPRgdWUBeN5KAsd2Sx3zPCzMb4yBi63n1c5t3y5nHnL+iLj+m4nRq3IG0NBbBO9pU+6QO0aYXnzbhn6Y3E9EeDMIGWaMBPy0K3mvLIptj7yurXvSDucxNHV5ZqDHeLS0I2Epc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052329; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tz/am8znVea0EH/I3yKmAvS/zTKGWDHDy5Io0oDOs84=; b=k23FsWL0q00UFWTbiMuak4ltB7p3UuTnt74SdgB3i7jCNhop4yLx7shSI+9tKbYGrG16YsdzVTW132A4yo1bAWM2LDLzfZ5NKS+cXR9GViUoVZjE8zB+V9NbIucgugoSiUdT7POg0oweMJMHfrfgNhavyBRCcpV9XTQ/0lSF98g= 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 17870523293611004.7958870351847; Tue, 18 Aug 2026 04:25:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHwd-0006pZ-QF; Tue, 18 Aug 2026 07:25:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHwb-0006f2-Ih for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:25:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHwa-0007po-7t for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:25:25 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-266-kXAxSYTMOemP6hKK59RQYQ-1; Tue, 18 Aug 2026 07:25:20 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 187FD1956040; Tue, 18 Aug 2026 11:25:19 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5FB501800346; Tue, 18 Aug 2026 11:25:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052323; 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=tz/am8znVea0EH/I3yKmAvS/zTKGWDHDy5Io0oDOs84=; b=SGSih2SsKgMsR2axG8SN8x5y5b9sqKzYHJoMbQuwWmgQzn2trsVQNEqaXLWRUe8gyvyiv5 iOPduRjXClIV2QKOUKVJIcGG0I4fI10ISk7o0hZjAMjnRaxjcuEyZgkn1MU5xoLF/KW5JL 4SKkZi2LyKP62Z40O5mKn0hUoNAHhuM= X-MC-Unique: kXAxSYTMOemP6hKK59RQYQ-1 X-Mimecast-MFC-AGG-ID: kXAxSYTMOemP6hKK59RQYQ_1787052319 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:20 +0400 Subject: [PATCH v3 53/74] hw/ppc/spapr_drc: convert fdt property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-53-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Nicholas Piggin , Harsh Prateek Bora , qemu-ppc@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=1018; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=p8JanILoeFCoElHoPfG5YjLfU2MyrEO5wI6M3UiSSaA=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD283AQfTXMR2X55zc8+lmc+34xEZQjh2uVQU DjFJuOFaVSJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9vAAKCRDa6OEJdZac 5W11D/9CAZMQrsluoisevZOYsaQ8dEYBXl0MAANzxTu57azcxKhGDwnJQyxCWv7HQwGdsRn/HQv 4dltKfWK9j6o38hNzOZ+orAE5BD7n/EP3mSpMfB9IqTyZhk0n8vclcROvBsgOmDdj8QUZwJmMYX zvh5XJ66UV9pGO3KPbzqmC+PV3l5VmY0koJatKHPAyPhMl8uD/dlY1VRUbwfnKms9lswdYZmwXK A6rTgZJIZsETswcDQgHvhUtozdSkKpde3UjGeRbYRIQgrQmeNvrUKdtWWuA0cdLHuwrl6uBxzNE +tuSbuzg/Ohj9c+nqZlplKDVcqt1CvnTBY62xX0+gDVNmRI9dSFlSVFZUfOzeL5Xa4B+wqw3IkY nPeWpHqif3cqTzbfj4BNy8kTr1jswxGn37NgapBaAJEQ1LKsaKiJPKBqznxq9XPw8HXJCczC9PC gMzfrtKfkPfk/odbSGJj50LyzcXgDGGns6BjG5zseHnNwIo1qbJR564rBsxZ22LiTmwU8f6NRST CXuU/AyEZLLhouWqsPphqA96tHFidRM+uMHx+UiViiAvOa9TNm4fEW4i0Tjz8g4ZnZZAEcKD+T6 ziF5hTDoTfs9Cz2DCvTfrycym0+3ElltNCTVPoFLK+2cN+T3bi3dew3O3GhywPvzk38cO/s+0vj NhJUqn/6+gjougg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787052329565158500 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. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/ppc/spapr_drc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 64f9ca29b02e..740149ffdf3e 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -587,7 +587,7 @@ static void spapr_dr_connector_instance_init(Object *ob= j) object_property_add_uint32_ptr(obj, "id", &drc->id, OBJ_PROP_FLAG_READ= ); object_property_add_qapi(obj, "index", &uint32_type_info, prop_get_ind= ex, NULL, NULL, NULL); - object_property_add(obj, "fdt", "struct", prop_get_fdt, + object_property_add_qapi(obj, "fdt", &any_type_info, prop_get_fdt, NULL, NULL, NULL); drc->state =3D drck->empty_state; } --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052358; cv=none; d=zohomail.com; s=zohoarc; b=YuT82SydElw/xOr4yCKJfnGrOsC37EQ0CaO8C6+AwobSR/dVya7zsEA+dEXNHXVFBaO4egcRLajpijBkLhlv9kzzTrPHMMZk/L0RJZ02EZvT17ra9n3sdmLaMGGrfnWyyJIscq+rAH9ElzwHp1JHBT7OjAk6YRSHkQPJNhhtlLo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052358; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6RnNIG73GhCm93MI2AvxWTLvo6ga6neONIfVM8F4bkg=; b=LvDA34aY80NfkBQ+fE2HxlUzcxsM98REeNRUk2IY7znWPvkp1Jp6Qx3ubIRSyjgq4Rdd9SDtXvQoLyKXVgL5X+fPBYAvqf0+KefGzi3/slxn+yQP3/WnAYnxRk+TiDqNj+zQMuWAu7nx6HCbNcOsIWDubEJ0wdQh+MtJKOIFVnw= 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 1787052358327423.7837480275117; Tue, 18 Aug 2026 04:25:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHwy-0007y5-E2; Tue, 18 Aug 2026 07:25:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHww-0007xI-Ih for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:25:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHwu-0007u3-8U for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:25:46 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-74-F3BHRxEQO1i7WMGwo51pVQ-1; Tue, 18 Aug 2026 07:25:40 -0400 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 1ABFE18005B2; Tue, 18 Aug 2026 11:25:38 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B54C43000239; Tue, 18 Aug 2026 11:25:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052343; 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=6RnNIG73GhCm93MI2AvxWTLvo6ga6neONIfVM8F4bkg=; b=amNHiaJ7zPS0qT9cn7tLIq/0iQ1KyUoJ/6JoEaqI6wiezpJE9og3kFm9+W7hP8RBk0IFOT 9HXjkCelF/GPuJ5y7kUXp/ZQ1KbnMAZi0XlRH60BZUVaKS+asxJz8S0aT++vHGS+20Gusm MK+USSEQRdg/N8CcfVOl1MsIAPNWfng= X-MC-Unique: F3BHRxEQO1i7WMGwo51pVQ-1 X-Mimecast-MFC-AGG-ID: F3BHRxEQO1i7WMGwo51pVQ_1787052338 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:21 +0400 Subject: [PATCH v3 54/74] spdm-socket: convert SpdmTransportType to QAPI enum MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-54-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alistair Francis , Alistair Francis , Tao Tang , Keith Busch , Klaus Jensen , Jesper Devantier , Eric Blake , qemu-block@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=13661; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=2t7ZhUyuk17hw1y5P7exFCww1yHYtKSdGomgYFbnNoI=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD28uf9Qm6njHlp/+a6m7aBR0hIl0PLEw9ENc psQ3d5nv9OJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9vAAKCRDa6OEJdZac 5VOKD/4rzAcTCOpNSsIFKBgKH5aPdh8HRrB51NG9O/zX3dulxRTw4yEzzF07eKIdZ1h85Jx+O4N k6E091WwTKmKBWcOpsIlxRjlUXLPVIstTY4KFdsSqxg0DLQ2LkAI2YrsYhEXd5UMZhjTVbgChqb Ic3xSOmGpH0u0TaMxjhMN+a8zsc+GSth1Q72zB9Ij6XrG3jdZMJi6zsrBrX49XS3OMXzT9IWeDv zlU1BrAybCtxp/1Z/ePad2J7UaeOBMuCp5vFnMheuo7KvTX3S3IxJQLrxCudyjtabf5msWpOFYa tanXDYVsUCoS909AJh+omBoFcPaD4LvyqjA7oBgntVaPDGdPFZBVZT+EtK+w/PrwzHlbZkxU17A qQLC7XW+UDASHeH6Bv/CSEK9SsROZhUXSUZo+Cz+YFqIVxAmPlALrrWIBcs72YS9uLVgJ6JVWN2 qKb3CyIulVjc4QCugrKuy99yf4hlXpe+hsifj2nVpYZMGwWFnevj6/neZWpP3+sLPnvoWkid1s0 KBurZ0gS5urpZg86X6XYuleeycyuNCX6vnz9erXhWeCBPjF+/+GETE4PUtHhJVWdi2x+8iJfOka RXRp+7p7Klh6mqBOrF+jJrkkvd+Gm0zO0M1Mnd1bcxEwxQzx9Xi6lN7a5OsWDFyjNdvRuS8t/ur siSNCPRTW6NWlhQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=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: 1787052361428158500 Replace the hand-written SpdmTransportType C enum and QEnumLookup table with a QAPI schema definition in qapi/sockets.json. Update all users in hw/nvme/ctrl.c to use the QAPI-generated enum constants (SPDM_TRANSPORT_TYPE_* instead of SPDM_SOCKET_TRANSPORT_TYPE_*). Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Signed-off-by: Marc-Andr=C3=A9 Lureau --- backends/spdm-socket.c | 23 +++++++---------------- hw/nvme/ctrl.c | 26 +++++++++++++------------- include/system/spdm-socket.h | 28 +++++++++++----------------- qapi/sockets.json | 20 ++++++++++++++++++++ 4 files changed, 51 insertions(+), 46 deletions(-) diff --git a/backends/spdm-socket.c b/backends/spdm-socket.c index b625a65d28f7..826efc276dcd 100644 --- a/backends/spdm-socket.c +++ b/backends/spdm-socket.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "system/spdm-socket.h" #include "qapi/error.h" +#include "qapi/qapi-types-sockets.h" #include "hw/core/qdev-properties.h" #include "hw/core/qdev-properties-system.h" #include "hw/core/qdev-prop-internal.h" @@ -205,7 +206,7 @@ static bool spdm_socket_command_valid(uint32_t command) } } =20 -uint32_t spdm_socket_receive(const int socket, uint32_t transport_type, +uint32_t spdm_socket_receive(const int socket, SpdmTransportType transport= _type, void *rsp, uint32_t rsp_len) { uint32_t command; @@ -223,13 +224,14 @@ uint32_t spdm_socket_receive(const int socket, uint32= _t transport_type, } =20 bool spdm_socket_send(const int socket, uint32_t socket_cmd, - uint32_t transport_type, void *req, uint32_t req_len) + SpdmTransportType transport_type, void *req, + uint32_t req_len) { return send_platform_data(socket, transport_type, socket_cmd, req, req_len); } =20 -uint32_t spdm_socket_rsp(const int socket, uint32_t transport_type, +uint32_t spdm_socket_rsp(const int socket, SpdmTransportType transport_typ= e, void *req, uint32_t req_len, void *rsp, uint32_t rsp_len) { @@ -244,27 +246,16 @@ uint32_t spdm_socket_rsp(const int socket, uint32_t t= ransport_type, return spdm_socket_receive(socket, transport_type, rsp, rsp_len); } =20 -void spdm_socket_close(const int socket, uint32_t transport_type) +void spdm_socket_close(const int socket, SpdmTransportType transport_type) { send_platform_data(socket, transport_type, SPDM_SOCKET_COMMAND_SHUTDOWN, NULL, 0); } =20 -const QEnumLookup SpdmTransport_lookup =3D { - .array =3D (const char *const[]) { - [SPDM_SOCKET_TRANSPORT_TYPE_UNSPEC] =3D "unspecified", - [SPDM_SOCKET_TRANSPORT_TYPE_MCTP] =3D "mctp", - [SPDM_SOCKET_TRANSPORT_TYPE_PCI_DOE] =3D "doe", - [SPDM_SOCKET_TRANSPORT_TYPE_SCSI] =3D "scsi", - [SPDM_SOCKET_TRANSPORT_TYPE_NVME] =3D "nvme", - }, - .size =3D SPDM_SOCKET_TRANSPORT_TYPE_MAX -}; - const PropertyInfo qdev_prop_spdm_trans =3D { .type =3D "SpdmTransportType", .description =3D "Spdm Transport, doe/nvme/mctp/scsi/unspecified", - .enum_table =3D &SpdmTransport_lookup, + .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/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index e4549aa9e534..a72189e0a63c 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -7490,14 +7490,14 @@ static uint16_t nvme_sec_prot_spdm_send(NvmeCtrl *n= , NvmeRequest *req) } =20 spdm_res =3D spdm_socket_send(n->spdm_socket, SPDM_SOCKET_STORAGE_CMD_= IF_SEND, - SPDM_SOCKET_TRANSPORT_TYPE_NVME, sec_buf, + SPDM_TRANSPORT_TYPE_NVME, sec_buf, transport_transfer_len); if (!spdm_res) { return NVME_DATA_TRAS_ERROR | NVME_DNR; } =20 /* The responder shall ack with message status */ - recvd =3D spdm_socket_receive(n->spdm_socket, SPDM_SOCKET_TRANSPORT_TY= PE_NVME, + recvd =3D spdm_socket_receive(n->spdm_socket, SPDM_TRANSPORT_TYPE_NVME, &nvme_cmd_status, SPDM_SOCKET_MAX_MSG_STATUS_LEN); =20 @@ -7553,14 +7553,14 @@ static uint16_t nvme_sec_prot_spdm_receive(NvmeCtrl= *n, NvmeRequest *req) =20 /* Forward if_recv to the SPDM Server with SPSP0 */ spdm_res =3D spdm_socket_send(n->spdm_socket, SPDM_SOCKET_STORAGE_CMD_= IF_RECV, - SPDM_SOCKET_TRANSPORT_TYPE_NVME, + SPDM_TRANSPORT_TYPE_NVME, &hdr, sizeof(hdr)); if (!spdm_res) { return NVME_DATA_TRAS_ERROR | NVME_DNR; } =20 /* The responder shall ack with message status */ - recvd =3D spdm_socket_receive(n->spdm_socket, SPDM_SOCKET_TRANSPORT_TY= PE_NVME, + recvd =3D spdm_socket_receive(n->spdm_socket, SPDM_TRANSPORT_TYPE_NVME, &nvme_cmd_status, SPDM_SOCKET_MAX_MSG_STATUS_LEN); if (recvd < SPDM_SOCKET_MAX_MSG_STATUS_LEN) { @@ -7580,7 +7580,7 @@ static uint16_t nvme_sec_prot_spdm_receive(NvmeCtrl *= n, NvmeRequest *req) } =20 recvd =3D spdm_socket_receive(n->spdm_socket, - SPDM_SOCKET_TRANSPORT_TYPE_NVME, + SPDM_TRANSPORT_TYPE_NVME, rsp_spdm_buf, alloc_len); if (!recvd) { return NVME_DATA_TRAS_ERROR | NVME_DNR; @@ -9098,7 +9098,7 @@ static bool pcie_doe_spdm_rsp(DOECap *doe_cap) uint32_t rsp_len =3D SPDM_SOCKET_MAX_MESSAGE_BUFFER_SIZE; =20 uint32_t recvd =3D spdm_socket_rsp(doe_cap->spdm_socket, - SPDM_SOCKET_TRANSPORT_TYPE_PCI_DOE, + SPDM_TRANSPORT_TYPE_DOE, req, req_len, rsp, rsp_len); doe_cap->read_mbox_len +=3D DIV_ROUND_UP(recvd, 4); =20 @@ -9200,7 +9200,7 @@ static bool nvme_init_pci(NvmeCtrl *n, PCIDevice *pci= _dev, Error **errp) uint16_t doe_offset =3D PCI_CONFIG_SPACE_SIZE; =20 switch (pci_dev->spdm_trans) { - case SPDM_SOCKET_TRANSPORT_TYPE_PCI_DOE: + case SPDM_TRANSPORT_TYPE_DOE: if (n->params.sriov_max_vfs) { doe_offset +=3D PCI_ARI_SIZEOF; } @@ -9215,7 +9215,7 @@ static bool nvme_init_pci(NvmeCtrl *n, PCIDevice *pci= _dev, Error **errp) return false; } break; - case SPDM_SOCKET_TRANSPORT_TYPE_NVME: + case SPDM_TRANSPORT_TYPE_NVME: n->spdm_socket =3D spdm_socket_connect(pci_dev->spdm_port, err= p); if (n->spdm_socket < 0) { return false; @@ -9717,10 +9717,10 @@ static void nvme_exit(PCIDevice *pci_dev) assert(!(pci_dev->doe_spdm.spdm_socket > 0 && n->spdm_socket >=3D 0)); if (pci_dev->doe_spdm.spdm_socket > 0) { spdm_socket_close(pci_dev->doe_spdm.spdm_socket, - SPDM_SOCKET_TRANSPORT_TYPE_PCI_DOE); + SPDM_TRANSPORT_TYPE_DOE); } else if (n->spdm_socket >=3D 0) { spdm_socket_close(pci_dev->doe_spdm.spdm_socket, - SPDM_SOCKET_TRANSPORT_TYPE_NVME); + SPDM_TRANSPORT_TYPE_NVME); } =20 if (n->pmr.dev) { @@ -9779,7 +9779,7 @@ static const Property nvme_props[] =3D { DEFINE_PROP_UINT16("mqes", NvmeCtrl, params.mqes, 0x7ff), DEFINE_PROP_UINT16("spdm_port", PCIDevice, spdm_port, 0), DEFINE_PROP_SPDM_TRANS("spdm_trans", PCIDevice, spdm_trans, - SPDM_SOCKET_TRANSPORT_TYPE_PCI_DOE), + SPDM_TRANSPORT_TYPE_DOE), DEFINE_PROP_BOOL("ctratt.mem", NvmeCtrl, params.ctratt.mem, false), DEFINE_PROP_BOOL("atomic.dn", NvmeCtrl, params.atomic_dn, 0), DEFINE_PROP_UINT16("atomic.awun", NvmeCtrl, params.atomic_awun, 0), @@ -9857,7 +9857,7 @@ static void nvme_pci_write_config(PCIDevice *dev, uin= t32_t address, =20 /* DOE is only initialised if SPDM over DOE is used */ if (pcie_find_capability(dev, PCI_EXT_CAP_ID_DOE) && - dev->spdm_trans =3D=3D SPDM_SOCKET_TRANSPORT_TYPE_PCI_DOE) { + dev->spdm_trans =3D=3D SPDM_TRANSPORT_TYPE_DOE) { pcie_doe_write_config(&dev->doe_spdm, address, val, len); } pci_default_write_config(dev, address, val, len); @@ -9870,7 +9870,7 @@ static uint32_t nvme_pci_read_config(PCIDevice *dev, = uint32_t address, int len) uint32_t val; =20 if (dev->spdm_port && pcie_find_capability(dev, PCI_EXT_CAP_ID_DOE) && - (dev->spdm_trans =3D=3D SPDM_SOCKET_TRANSPORT_TYPE_PCI_DOE)) { + (dev->spdm_trans =3D=3D SPDM_TRANSPORT_TYPE_DOE)) { if (pcie_doe_read_config(&dev->doe_spdm, address, len, &val)) { return val; } diff --git a/include/system/spdm-socket.h b/include/system/spdm-socket.h index 00cb0e97f36e..b5a68d3d60b6 100644 --- a/include/system/spdm-socket.h +++ b/include/system/spdm-socket.h @@ -23,6 +23,8 @@ #ifndef SPDM_REQUESTER_H #define SPDM_REQUESTER_H =20 +#include "qapi/qapi-types-sockets.h" + /** * spdm_socket_connect: connect to an external SPDM socket * @port: port to connect to @@ -37,7 +39,7 @@ int spdm_socket_connect(uint16_t port, Error **errp); /** * spdm_socket_rsp: send and receive a message to a SPDM server * @socket: socket returned from spdm_socket_connect() - * @transport_type: SPDM_SOCKET_TRANSPORT_TYPE_* macro + * @transport_type: the SPDM transport type * @req: request buffer * @req_len: request buffer length * @rsp: response buffer @@ -46,14 +48,14 @@ int spdm_socket_connect(uint16_t port, Error **errp); * Send platform data to a SPDM server on socket and then receive * a response. */ -uint32_t spdm_socket_rsp(const int socket, uint32_t transport_type, +uint32_t spdm_socket_rsp(const int socket, SpdmTransportType transport_typ= e, void *req, uint32_t req_len, void *rsp, uint32_t rsp_len); =20 /** * spdm_socket_rsp: Receive a message from an SPDM server * @socket: socket returned from spdm_socket_connect() - * @transport_type: SPDM_SOCKET_TRANSPORT_TYPE_* macro + * @transport_type: the SPDM transport type * @rsp: response buffer * @rsp_len: response buffer length * @@ -61,14 +63,14 @@ uint32_t spdm_socket_rsp(const int socket, uint32_t tra= nsport_type, * received or 0 on failure. This can be used to receive a message from th= e SPDM * server without sending anything first. */ -uint32_t spdm_socket_receive(const int socket, uint32_t transport_type, +uint32_t spdm_socket_receive(const int socket, SpdmTransportType transport= _type, void *rsp, uint32_t rsp_len); =20 /** * spdm_socket_rsp: Sends a message to an SPDM server * @socket: socket returned from spdm_socket_connect() * @socket_cmd: socket command type (normal/if_recv/if_send etc...) - * @transport_type: SPDM_SOCKET_TRANSPORT_TYPE_* macro + * @transport_type: the SPDM transport type * @req: request buffer * @req_len: request buffer length * @@ -77,16 +79,17 @@ uint32_t spdm_socket_receive(const int socket, uint32_t= transport_type, * spdm_socket_receive(). */ bool spdm_socket_send(const int socket, uint32_t socket_cmd, - uint32_t transport_type, void *req, uint32_t req_len= ); + SpdmTransportType transport_type, void *req, + uint32_t req_len); =20 /** * spdm_socket_close: send a shutdown command to the server * @socket: socket returned from spdm_socket_connect() - * @transport_type: SPDM_SOCKET_TRANSPORT_TYPE_* macro + * @transport_type: the SPDM transport type * * This will issue a shutdown command to the server. */ -void spdm_socket_close(const int socket, uint32_t transport_type); +void spdm_socket_close(const int socket, SpdmTransportType transport_type); =20 /* * Defines the transport encoding for SPDM, this information shall be pass= ed @@ -115,15 +118,6 @@ typedef struct { #define SPDM_SOCKET_MAX_MESSAGE_BUFFER_SIZE 0x1200 #define SPDM_SOCKET_MAX_MSG_STATUS_LEN 0x02 =20 -typedef enum SpdmTransportType { - SPDM_SOCKET_TRANSPORT_TYPE_UNSPEC =3D 0, - SPDM_SOCKET_TRANSPORT_TYPE_MCTP, - SPDM_SOCKET_TRANSPORT_TYPE_PCI_DOE, - SPDM_SOCKET_TRANSPORT_TYPE_SCSI, - SPDM_SOCKET_TRANSPORT_TYPE_NVME, - SPDM_SOCKET_TRANSPORT_TYPE_MAX -} SpdmTransportType; - extern const PropertyInfo qdev_prop_spdm_trans; =20 #define DEFINE_PROP_SPDM_TRANS(_name, _state, _field, _default) \ diff --git a/qapi/sockets.json b/qapi/sockets.json index 473be2ac58a2..a9a8006c2274 100644 --- a/qapi/sockets.json +++ b/qapi/sockets.json @@ -252,3 +252,23 @@ 'unix': 'UnixSocketAddress', 'vsock': 'VsockSocketAddress', 'fd': 'FdSocketAddress' } } + +## +# @SpdmTransportType: +# +# SPDM transport type +# +# @unspecified: Unspecified transport +# +# @mctp: MCTP transport +# +# @doe: PCI Data Object Exchange (DOE) transport +# +# @scsi: SCSI transport +# +# @nvme: NVMe transport +# +# Since: 11.2 +## +{ 'enum': 'SpdmTransportType', + 'data': [ 'unspecified', 'mctp', 'doe', 'scsi', 'nvme' ] } --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787052379; cv=none; d=zohomail.com; s=zohoarc; b=jZoN44i3chrJ/iExvGP6kTsr0R47BeFRoh8fSFOtv7fFtDOf/mhquTNPgfYoadoWSmFH3/3+mjaHSw7rR+wynZZSdWEcyv/4tbCpTcrS0BU4YZDGP7UCAuulSRGkLfWuzPucA/+oHKabXvdo+/HToeS5fOaF7di95h9ZpyEl42w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787052379; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qREL4rLqmsKjsuOlLljdIaMwFLp75inzgflxtWc4AuE=; b=PXndSb98+44RcVtTeF3AKvMtldG3zrxTE8pEkDbtAYlpxhjWyOkRxaMvMH7oOuhFqYeGAEaHDFbCbslMI5f4HFU9NzxbJws84BO6lpIhe/2B9W1sV/t9YbR5VsbafDae+4Xv+ZUhxqSPnWC534wT0PYHiw++CT2kiQAAPFkGV8k= 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 1787052379287966.0569399160779; Tue, 18 Aug 2026 04:26:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwHx9-0008Dg-5v; Tue, 18 Aug 2026 07:25:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHx7-00085h-3q for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:25:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwHx4-0007vH-R6 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 07:25:56 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-638-6z3cy_ARO26Kezz0pddE0g-1; Tue, 18 Aug 2026 07:25:48 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 760B11956046; Tue, 18 Aug 2026 11:25:46 +0000 (UTC) Received: from localhost (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EDCAA1956044; Tue, 18 Aug 2026 11:25:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787052354; 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=qREL4rLqmsKjsuOlLljdIaMwFLp75inzgflxtWc4AuE=; b=LNmBY+L3LEryuhRbRMK4QGSGNX2dUkpM3GcbeV3AyV4HBPVK5HpPJ0BzifVHTU0W5aRIQF A3vXuN7NMh9Fi4HAsWerer4/leueiVoT7b97JAZyEPcRBBSQL2LMwGUT+drvA5QqxNxZlM T+YxS9/iodxgH+30gFAaE59o3eNbVSM= X-MC-Unique: 6z3cy_ARO26Kezz0pddE0g-1 X-Mimecast-MFC-AGG-ID: 6z3cy_ARO26Kezz0pddE0g_1787052346 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 15:11:22 +0400 Subject: [PATCH v3 55/74] hw/gpio/pca955x: use QAPI enums for led and pin properties MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-55-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Glenn Miles , Eric Blake , Zhao Liu , qemu-ppc@nongnu.org, qemu-arm@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=14925; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=XlkmyZuB8ML4Dwyx9HhUYqfHoTK+rV9hfdym0B0GJhw=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhD28epQmIr7mH6ucmmukF8I7u8rV8FvT80VR/ 0RLBOEr+/qJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoQ9vAAKCRDa6OEJdZac 5Sr6D/0Z6H7lF0oo2hbMoznh5zOsWomhxLFsslJuLukvKEsCPH9XydIObGNSxMepK7R/VM/qPNh X5VE0ApEK6aMlz1cfZ3DtzBEhcmdLELX2z/4aLJ+5R6bRuBsm2HVcVjQr7dddGe8Y+9oyYv4q+s gRdAkyM+bGZuf0JnkiA6BieEMea8/Z7abBbo9LZB7fcwgVzsvHfgEnRxx24a/1WszIC+pcujq/P 0ollLZXXVIFbbJmMji1Ph0BS2qTtta3l6TspUmWZgRMZrFetdOWq6ocH/Ht6dSaR1Eb3Q02GXnp Vzx/q2LLg10ZxNhm/AqXIRbeUUKoFCHbPrkQO4sdgCmXt5QGU/lw+Q/5qdsASgIhKH3nSpRrADd ML2fj2mB6pqUbabB1f09jc+ZtQVq8rIE3qesRylXQ9+YwN9jD3xHeejtk0KHoF+2dKb8HL7DyL6 m7uFryNtAR0iZAVbBX1sD7oFCRvZSdEc2wYjrKCiEKLdBBqxW4oa9DmAH3dutqfb9/KOZYntnDn RnnH+VHlWmuGppD7R00sXoqJ9CZaqIzbO224LjBYTufBrodkiQwJiQa8eOIWiZE878RLN9Z8bk1 z72aJmBbEn8RWnS5NbnulPeLA+kJN91q6XRxjt6skdg4hLYEIr42U4aXhWja2907L0I0eHO5S3g Gt85lIYYDicNx3Q== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787052379926158500 Replace hand-rolled string lookup tables with QAPI enums Pca9552LedState and Pca955{2,4}PinState for the led%d and pin%d QOM properties. This fixes the incorrect property type ("bool" for LEDs, "str" for pins) and lets QAPI handle string-to-enum conversion in the visitor, removing the manual string matching in the setters. Add QEMU_BUILD_BUG_ON guards to ensure the QAPI-generated enum values stay in sync with the hardware register encoding. I kept Pca9552PinState & @Pca9554PinState separate types, because I don't know if they could diverge. We could eventually merge those. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/gpio/pca9552.c | 82 +++++++++++++++++++++------------------------------= ---- hw/gpio/pca9554.c | 39 ++++++++++---------------- qapi/machine.json | 46 +++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+), 75 deletions(-) diff --git a/hw/gpio/pca9552.c b/hw/gpio/pca9552.c index 719149b7174b..16741c22dea3 100644 --- a/hw/gpio/pca9552.c +++ b/hw/gpio/pca9552.c @@ -23,7 +23,8 @@ #include "hw/core/irq.h" #include "migration/vmstate.h" #include "qapi/error.h" -#include "qapi/visitor.h" +#include "qapi/qapi-types-machine.h" +#include "qapi/qapi-visit-machine.h" #include "trace.h" #include "qom/object.h" =20 @@ -59,16 +60,15 @@ struct PCA955xClass { /* * Note: The LED_ON and LED_OFF configuration values for the PCA955X * chips are the reverse of the PCA953X family of chips. + * + * The QAPI enums must match the hardware register values. */ -#define PCA9552_LED_ON 0x0 -#define PCA9552_LED_OFF 0x1 -#define PCA9552_LED_PWM0 0x2 -#define PCA9552_LED_PWM1 0x3 -#define PCA9552_PIN_LOW 0x0 -#define PCA9552_PIN_HIZ 0x1 - -static const char *led_state[] =3D {"on", "off", "pwm0", "pwm1"}; -static const char *pin_state[] =3D {"low", "high"}; +QEMU_BUILD_BUG_ON(PCA9552_LED_STATE_ON !=3D 0x0); +QEMU_BUILD_BUG_ON(PCA9552_LED_STATE_OFF !=3D 0x1); +QEMU_BUILD_BUG_ON(PCA9552_LED_STATE_PWM0 !=3D 0x2); +QEMU_BUILD_BUG_ON(PCA9552_LED_STATE_PWM1 !=3D 0x3); +QEMU_BUILD_BUG_ON(PCA9552_PIN_STATE_LOW !=3D 0x0); +QEMU_BUILD_BUG_ON(PCA9552_PIN_STATE_HIGH !=3D 0x1); =20 static uint8_t pca955x_pin_get_config(PCA955xState *s, int pin) { @@ -142,24 +142,24 @@ static void pca955x_update_pin_input(PCA955xState *s) uint8_t config =3D pca955x_pin_get_config(s, i); =20 switch (config) { - case PCA9552_LED_ON: + case PCA9552_LED_STATE_ON: /* Pin is set to 0V to turn on LED */ s->regs[input_reg] &=3D ~bit_mask; break; - case PCA9552_LED_OFF: + case PCA9552_LED_STATE_OFF: /* * Pin is set to Hi-Z to turn off LED and * pullup sets it to a logical 1 unless * external device drives it low. */ - if (s->ext_state[i] =3D=3D PCA9552_PIN_LOW) { + if (s->ext_state[i] =3D=3D PCA9552_PIN_STATE_LOW) { s->regs[input_reg] &=3D ~bit_mask; } else { s->regs[input_reg] |=3D bit_mask; } break; - case PCA9552_LED_PWM0: - case PCA9552_LED_PWM1: + case PCA9552_LED_STATE_PWM0: + case PCA9552_LED_STATE_PWM1: /* TODO */ default: break; @@ -176,7 +176,7 @@ static void pca955x_update_pin_input(PCA955xState *s) */ if (s->regs[config_reg] & bit_mask) { /* Input mode - reflect external state */ - if (s->ext_state[i] =3D=3D PCA9552_PIN_LOW) { + if (s->ext_state[i] =3D=3D PCA9552_PIN_STATE_LOW) { s->regs[input_reg] &=3D ~bit_mask; } else { s->regs[input_reg] |=3D bit_mask; @@ -360,7 +360,7 @@ static void pca955x_get_led(Object *obj, Visitor *v, co= nst char *name, PCA955xClass *k =3D PCA955X_GET_CLASS(obj); PCA955xState *s =3D PCA955X(obj); int led, rc, reg; - uint8_t state; + Pca9552LedState state; =20 rc =3D sscanf(name, "led%2d", &led); if (rc !=3D 1) { @@ -378,7 +378,7 @@ static void pca955x_get_led(Object *obj, Visitor *v, co= nst char *name, */ reg =3D PCA9552_LS0 + led / 4; state =3D (pca955x_read(s, reg) >> ((led % 4) * 2)) & 0x3; - visit_type_str(v, name, (char **)&led_state[state], errp); + visit_type_Pca9552LedState(v, name, &state, errp); } =20 /* @@ -397,10 +397,9 @@ static void pca955x_set_led(Object *obj, Visitor *v, c= onst char *name, PCA955xClass *k =3D PCA955X_GET_CLASS(obj); PCA955xState *s =3D PCA955X(obj); int led, rc, reg, val; - uint8_t state; - g_autofree char *state_str =3D NULL; + Pca9552LedState state; =20 - if (!visit_type_str(v, name, &state_str, errp)) { + if (!visit_type_Pca9552LedState(v, name, &state, errp)) { return; } rc =3D sscanf(name, "led%2d", &led); @@ -413,16 +412,6 @@ static void pca955x_set_led(Object *obj, Visitor *v, c= onst char *name, return; } =20 - for (state =3D 0; state < ARRAY_SIZE(led_state); state++) { - if (!strcmp(state_str, led_state[state])) { - break; - } - } - if (state >=3D ARRAY_SIZE(led_state)) { - error_setg(errp, "%s invalid led state %s", __func__, state_str); - return; - } - reg =3D PCA9552_LS0 + led / 4; val =3D pca955x_read(s, reg); val =3D pca955x_ledsel(val, led % 4, state); @@ -437,7 +426,8 @@ static void pca955x_get_pin(Object *obj, Visitor *v, co= nst char *name, PCA955xClass *k =3D PCA955X_GET_CLASS(obj); PCA955xState *s =3D PCA955X(obj); int pin, rc; - uint8_t input_reg, state; + uint8_t input_reg; + Pca9552PinState state; =20 rc =3D sscanf(name, "pin%2d", &pin); if (rc !=3D 1) { @@ -455,7 +445,7 @@ static void pca955x_get_pin(Object *obj, Visitor *v, co= nst char *name, */ input_reg =3D PCA9535_INPUT0 + (pin / 8); state =3D (s->regs[input_reg] >> (pin % 8)) & 0x1; - visit_type_str(v, name, (char **)&pin_state[state], errp); + visit_type_Pca9552PinState(v, name, &state, errp); } =20 static void pca955x_set_pin(Object *obj, Visitor *v, const char *name, @@ -464,10 +454,10 @@ static void pca955x_set_pin(Object *obj, Visitor *v, = const char *name, PCA955xClass *k =3D PCA955X_GET_CLASS(obj); PCA955xState *s =3D PCA955X(obj); int pin, rc; - uint8_t state, config_reg; - g_autofree char *state_str =3D NULL; + Pca9552PinState state; + uint8_t config_reg; =20 - if (!visit_type_str(v, name, &state_str, errp)) { + if (!visit_type_Pca9552PinState(v, name, &state, errp)) { return; } rc =3D sscanf(name, "pin%2d", &pin); @@ -480,16 +470,6 @@ static void pca955x_set_pin(Object *obj, Visitor *v, c= onst char *name, return; } =20 - for (state =3D 0; state < ARRAY_SIZE(pin_state); state++) { - if (!strcmp(state_str, pin_state[state])) { - break; - } - } - if (state >=3D ARRAY_SIZE(pin_state)) { - error_setg(errp, "%s invalid pin state %s", __func__, state_str); - return; - } - /* Only input-configured pins can be driven by an external device. */ config_reg =3D PCA9535_CONFIG0 + (pin / 8); if (!((s->regs[config_reg] >> (pin % 8)) & 0x1)) { @@ -499,7 +479,7 @@ static void pca955x_set_pin(Object *obj, Visitor *v, co= nst char *name, return; } =20 - pca955x_set_ext_state(s, pin, state !=3D PCA9552_PIN_LOW); + pca955x_set_ext_state(s, pin, state !=3D PCA9552_PIN_STATE_LOW); } =20 static const VMStateDescription pca9552_vmstate =3D { @@ -529,7 +509,7 @@ static void pca9552_reset_hold(Object *obj, ResetType t= ype) s->regs[PCA9552_LS2] =3D 0x55; s->regs[PCA9552_LS3] =3D 0x55; =20 - memset(s->ext_state, PCA9552_PIN_HIZ, PCA955X_PIN_COUNT_MAX); + memset(s->ext_state, PCA9552_PIN_STATE_HIGH, PCA955X_PIN_COUNT_MAX); pca955x_update_pin_input(s); =20 s->pointer =3D 0xFF; @@ -549,7 +529,7 @@ static void pca9535_reset_hold(Object *obj, ResetType t= ype) s->regs[PCA9535_CONFIG0] =3D 0xFF; /* All pins as inputs */ s->regs[PCA9535_CONFIG1] =3D 0xFF; /* All pins as inputs */ =20 - memset(s->ext_state, PCA9552_PIN_HIZ, PCA955X_PIN_COUNT_MAX); + memset(s->ext_state, PCA9552_PIN_STATE_HIGH, PCA955X_PIN_COUNT_MAX); pca955x_update_pin_input(s); =20 s->pointer =3D 0xFF; @@ -567,12 +547,12 @@ static void pca955x_initfn(Object *obj) if (k->has_led_support) { /* LED variant: expose the LED selector state as led%d. */ name =3D g_strdup_printf("led%d", ix); - object_property_add(obj, name, "bool", + object_property_add(obj, name, "Pca9552LedState", pca955x_get_led, pca955x_set_led, NULL, NU= LL); } else { /* GPIO variant: expose the pin logic level as pin%d. */ name =3D g_strdup_printf("pin%d", ix); - object_property_add(obj, name, "str", + object_property_add(obj, name, "Pca9552PinState", pca955x_get_pin, pca955x_set_pin, NULL, NU= LL); } g_free(name); diff --git a/hw/gpio/pca9554.c b/hw/gpio/pca9554.c index 904698cdce85..e4eddc829ef7 100644 --- a/hw/gpio/pca9554.c +++ b/hw/gpio/pca9554.c @@ -16,6 +16,8 @@ #include "hw/core/irq.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-types-machine.h" +#include "qapi/qapi-visit-machine.h" #include "qapi/visitor.h" #include "trace.h" #include "qom/object.h" @@ -32,10 +34,8 @@ typedef struct PCA9554Class PCA9554Class; DECLARE_CLASS_CHECKERS(PCA9554Class, PCA9554, TYPE_PCA9554) =20 -#define PCA9554_PIN_LOW 0x0 -#define PCA9554_PIN_HIZ 0x1 - -static const char *pin_state[] =3D {"low", "high"}; +QEMU_BUILD_BUG_ON(PCA9554_PIN_STATE_LOW !=3D 0x0); +QEMU_BUILD_BUG_ON(PCA9554_PIN_STATE_HIGH !=3D 0x1); =20 static void pca9554_update_pin_input(PCA9554State *s) { @@ -54,7 +54,7 @@ static void pca9554_update_pin_input(PCA9554State *s) * Input: the pin is Hi-Z with a pull-up, so it reads high * unless an external device drives it low. */ - if (s->ext_state[i] =3D=3D PCA9554_PIN_LOW) { + if (s->ext_state[i] =3D=3D PCA9554_PIN_STATE_LOW) { s->regs[PCA9554_INPUT] &=3D ~bit_mask; } else { s->regs[PCA9554_INPUT] |=3D bit_mask; @@ -156,7 +156,7 @@ static void pca9554_get_pin(Object *obj, Visitor *v, co= nst char *name, { PCA9554State *s =3D PCA9554(obj); int pin, rc; - uint8_t state; + Pca9554PinState state; =20 rc =3D sscanf(name, "pin%2d", &pin); if (rc !=3D 1) { @@ -175,7 +175,7 @@ static void pca9554_get_pin(Object *obj, Visitor *v, co= nst char *name, * holds the wire level regardless of the configured direction. */ state =3D (s->regs[PCA9554_INPUT] >> pin) & 0x1; - visit_type_str(v, name, (char **)&pin_state[state], errp); + visit_type_Pca9554PinState(v, name, &state, errp); } =20 static void pca9554_set_pin(Object *obj, Visitor *v, const char *name, @@ -183,10 +183,10 @@ static void pca9554_set_pin(Object *obj, Visitor *v, = const char *name, { PCA9554State *s =3D PCA9554(obj); int pin, rc, val; - uint8_t state, mask; - g_autofree char *state_str =3D NULL; + uint8_t mask; + Pca9554PinState state; =20 - if (!visit_type_str(v, name, &state_str, errp)) { + if (!visit_type_Pca9554PinState(v, name, &state, errp)) { return; } rc =3D sscanf(name, "pin%2d", &pin); @@ -199,16 +199,6 @@ static void pca9554_set_pin(Object *obj, Visitor *v, c= onst char *name, return; } =20 - for (state =3D 0; state < ARRAY_SIZE(pin_state); state++) { - if (!strcmp(state_str, pin_state[state])) { - break; - } - } - if (state >=3D ARRAY_SIZE(pin_state)) { - error_setg(errp, "%s invalid pin state %s", __func__, state_str); - return; - } - if (s->hw_dir) { /* Warn and ignore if the guest has configured this pin as output = */ if (!((s->regs[PCA9554_CONFIG] >> pin) & 0x1)) { @@ -219,13 +209,13 @@ static void pca9554_set_pin(Object *obj, Visitor *v, = const char *name, return; } /* Drive the external input level */ - pca9554_set_ext_state(s, pin, state !=3D PCA9554_PIN_LOW); + pca9554_set_ext_state(s, pin, state !=3D PCA9554_PIN_STATE_LOW); } else { /* Legacy behavior: force output mode and drive */ /* First, modify the output register bit */ val =3D pca9554_read(s, PCA9554_OUTPUT); mask =3D 0x1 << pin; - if (state =3D=3D PCA9554_PIN_LOW) { + if (state =3D=3D PCA9554_PIN_STATE_LOW) { val &=3D ~(mask); } else { val |=3D mask; @@ -264,7 +254,7 @@ static void pca9554_reset(DeviceState *dev) s->regs[PCA9554_POLARITY] =3D 0x0; /* No pins are inverted */ s->regs[PCA9554_CONFIG] =3D pin_mask; /* All pins are inputs */ =20 - memset(s->ext_state, PCA9554_PIN_HIZ, pc->pin_count); + memset(s->ext_state, PCA9554_PIN_STATE_HIGH, pc->pin_count); pca9554_update_pin_input(s); =20 s->pointer =3D 0x0; @@ -280,7 +270,8 @@ static void pca9554_initfn(Object *obj) char *name; =20 name =3D g_strdup_printf("pin%d", pin); - object_property_add(obj, name, "str", pca9554_get_pin, pca9554_set= _pin, + object_property_add(obj, name, "Pca9554PinState", + pca9554_get_pin, pca9554_set_pin, NULL, NULL); g_free(name); } diff --git a/qapi/machine.json b/qapi/machine.json index d418b34a8643..0e0d85d0a76d 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -429,6 +429,52 @@ { 'enum': 'LostTickPolicy', 'data': ['discard', 'delay', 'slew' ] } =20 +## +# @Pca9552LedState: +# +# LED state for PCA9552. +# +# @on: LED on +# +# @off: LED off +# +# @pwm0: LED controlled by PWM0 +# +# @pwm1: LED controlled by PWM1 +# +# Since: 11.2 +## +{ 'enum': 'Pca9552LedState', + 'data': ['on', 'off', 'pwm0', 'pwm1'] } + +## +# @Pca9552PinState: +# +# Pin state for PCA9552. +# +# @low: Pin low +# +# @high: Pin high +# +# Since: 11.2 +## +{ 'enum': 'Pca9552PinState', + 'data': ['low', 'high'] } + +## +# @Pca9554PinState: +# +# Pin state for PCA9554. +# +# @low: Pin low +# +# @high: Pin high +# +# Since: 11.2 +## +{ 'enum': 'Pca9554PinState', + 'data': ['low', 'high'] } + ## # @inject-nmi: # --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787061456; cv=none; d=zohomail.com; s=zohoarc; b=jBzdkRu5+vOjuAfmfrWc5TEkXOcy79glUpK84uBaZx2vH0R83eymyWP6ZHP1Ewws8aip52yHA0qAAo5lnpDO57F4jHAopdGbms8S5dejSE2uEENqM9DgojMEkpQH9tuAtBYpSVy2VDFaHCeOW4OuyxT8A4fR4ROCWULW+cp8MbU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787061456; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=oPypAJmHalIuZO8Qh6uXAHLk6oL+F+SAlk4t9kCAeHs=; b=HZ7IZkFdCATg3sHH8W/VpHR+eqqnxmxuTwguKp4sdiEfh5fsgLrWuT8NZwuJYkjmYCvDW8hWmmCFq9Fm6LYlKtT2tqeWz7ydt9CNrO3OkGkqYshRairpSsVB6y/CqQlqcmQWr8MEuln7tQJDy2yKnQ/e0pWubmGz+mO3tPLNRsk= 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 1787061456398754.036831206765; Tue, 18 Aug 2026 06:57:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwJ36-0002Nq-7r; Tue, 18 Aug 2026 08:36:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJ34-0002Mx-Tg for qemu-devel@nongnu.org; Tue, 18 Aug 2026 08:36:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJ31-0006wq-UX for qemu-devel@nongnu.org; Tue, 18 Aug 2026 08:36:10 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-634-Y_ijdr2nNtC_CScHp-b_tA-1; Tue, 18 Aug 2026 08:36:02 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3FBBA1800614; Tue, 18 Aug 2026 12:35:58 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9C2F91800348; Tue, 18 Aug 2026 12:35:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787056566; 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=oPypAJmHalIuZO8Qh6uXAHLk6oL+F+SAlk4t9kCAeHs=; b=jEI5oXJTWITlerXRow6mdiS2tfqfSQZz0sk9BM2bvYiNfsxAOa4xstvvmtytwggU6EB0ja Uxeafn47In9PXg3pkxSdOQEHjdnmwp0ilFg1eWDkP8SYaHzsUHd+WvLnnVKVK8lJpKVpNQ r+KAyRzbzp/ilRSwUOOcwy2jk0qxncY= X-MC-Unique: Y_ijdr2nNtC_CScHp-b_tA-1 X-Mimecast-MFC-AGG-ID: Y_ijdr2nNtC_CScHp-b_tA_1787056561 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 16:36:35 +0400 Subject: [PATCH v3 56/74] include: add QEMU_REPEAT helper macro MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-56-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Elena Ufimtseva , Jagannathan Raman , Jonathan Cameron , qemu-arm@nongnu.org, linux-cxl@vger.kernel.org X-Developer-Signature: v=1; a=openpgp-sha256; l=5015; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=EAQeZe1XEuAWHJARuU6IDW2Xx2TnIuJB2OqRLsbMlaA=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhFGnIFCFCjBNBLIxXO88uv5+j5DzvPiijQDit xHxgw2SJouJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoRRpwAKCRDa6OEJdZac 5TG7EACuj1vgznisdZxviv8gWC681BPf8BdVNMsXxXxIqHqInI7KHkNkZZiD4GTaK97CkHkPJqN xrgrwTIN3sVKh9tccIWgYXwwkWYZVUccnmzjqpeVMhRfZ305EeK8WGECendXg+sqBirQAYHbBNy rtpTJQDKqSR3z0XVe7WCSqmmQyBRc5a2TM70VA7WZrYQxKlH3ry4BY+7siXXHZmPxELek5gGDlI FR1BNsCG4KPMdaxKgufqb0wUTat0NoX+OL7/jtlDL542Z1LN6EGPohqtKrW+pXCO46a+13/XbJr SqZC0IUZr8ujWzEpfHVRRZ8q4mi9Alqxo2AgRo+abvmA/JRYKgbK+vVHoEz+lUdlj72SuwbHjHf b1eQy4UhGYUjR+b4QKOpTtFCckpFTfOaNQxotlSXyr/RcfuNCJeOB6/SaUGGy3X3p1K+VJaXIL3 S/mg5CRG5d9SI8MO+66sffHPkZexnfQTsZdWQGusdnkfgX6h87X3Q7aQMse0XSE3fWuq5BHY2QZ 6hPc7yNkt3tVvFDjaxU/lRzirQRgC/f/lxT4HA5FfA8Of3vnBu5U4Dx4qoaMBXIZUIFyklcc7FU 3O4HWq18W3viUixS8SbzWD1Zu3rkqooMbk2eT67ruS0oHhFGe4DOHNMunQMwz6MnFxZ9LtZLHYB GhwzPiluITXlIzg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787061458838158500 Introduce a macro used in following commit, and convert a few existing candidates. Inspired by a similar macro in Linux kernel/trace/bpf_trace.c Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/misc/tz-ppc.c | 19 ++----------------- hw/remote/vfio-user-obj.c | 17 +++-------------- include/hw/cxl/cxl_component.h | 5 +---- include/qemu/osdep.h | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 35 deletions(-) diff --git a/hw/misc/tz-ppc.c b/hw/misc/tz-ppc.c index 6f820430eed8..5f09ce164c19 100644 --- a/hw/misc/tz-ppc.c +++ b/hw/misc/tz-ppc.c @@ -303,26 +303,11 @@ static const VMStateDescription tz_ppc_vmstate =3D { =20 #define DEFINE_PORT(N) \ DEFINE_PROP_LINK("port[" #N "]", TZPPC, port[N].downstream, \ - TYPE_MEMORY_REGION, MemoryRegion *) + TYPE_MEMORY_REGION, MemoryRegion *), =20 static const Property tz_ppc_properties[] =3D { DEFINE_PROP_UINT32("NONSEC_MASK", TZPPC, nonsec_mask, 0), - DEFINE_PORT(0), - DEFINE_PORT(1), - DEFINE_PORT(2), - DEFINE_PORT(3), - DEFINE_PORT(4), - DEFINE_PORT(5), - DEFINE_PORT(6), - DEFINE_PORT(7), - DEFINE_PORT(8), - DEFINE_PORT(9), - DEFINE_PORT(10), - DEFINE_PORT(11), - DEFINE_PORT(12), - DEFINE_PORT(13), - DEFINE_PORT(14), - DEFINE_PORT(15), + QEMU_REPEAT(TZ_NUM_PORTS, DEFINE_PORT) }; =20 static void tz_ppc_class_init(ObjectClass *klass, const void *data) diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c index 7e6819f670b5..84c3ff05cfb8 100644 --- a/hw/remote/vfio-user-obj.c +++ b/hw/remote/vfio-user-obj.c @@ -496,22 +496,11 @@ static size_t vfu_object_bar_rw(PCIDevice *pci_dev, i= nt pci_bar, buf, count, is_write); = \ } = \ =20 -VFU_OBJECT_BAR_HANDLER(0) -VFU_OBJECT_BAR_HANDLER(1) -VFU_OBJECT_BAR_HANDLER(2) -VFU_OBJECT_BAR_HANDLER(3) -VFU_OBJECT_BAR_HANDLER(4) -VFU_OBJECT_BAR_HANDLER(5) -VFU_OBJECT_BAR_HANDLER(6) +QEMU_REPEAT(PCI_NUM_REGIONS, VFU_OBJECT_BAR_HANDLER) =20 +#define VFU_OBJECT_BAR_HANDLER_PTR(BAR_NO) vfu_object_bar##BAR_NO##_handle= r, static vfu_region_access_cb_t *vfu_object_bar_handlers[PCI_NUM_REGIONS] = =3D { - &vfu_object_bar0_handler, - &vfu_object_bar1_handler, - &vfu_object_bar2_handler, - &vfu_object_bar3_handler, - &vfu_object_bar4_handler, - &vfu_object_bar5_handler, - &vfu_object_bar6_handler, + QEMU_REPEAT(PCI_NUM_REGIONS, VFU_OBJECT_BAR_HANDLER_PTR) }; =20 /** diff --git a/include/hw/cxl/cxl_component.h b/include/hw/cxl/cxl_component.h index ffc82202206c..fca8b7055ccd 100644 --- a/include/hw/cxl/cxl_component.h +++ b/include/hw/cxl/cxl_component.h @@ -186,10 +186,7 @@ REG32(CXL_HDM_DECODER_GLOBAL_CONTROL, CXL_HDM_REGISTER= S_OFFSET + 4) /* Support 4 decoders at all levels of topology */ #define CXL_HDM_DECODER_COUNT 4 =20 -HDM_DECODER_INIT(0); -HDM_DECODER_INIT(1); -HDM_DECODER_INIT(2); -HDM_DECODER_INIT(3); +QEMU_REPEAT(CXL_HDM_DECODER_COUNT, HDM_DECODER_INIT) =20 /* * CXL r3.1 Section 8.2.4.21: CXL Extended Security Capability Structure diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 1ec5b42230be..a5e7ff99cb89 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -191,6 +191,39 @@ extern "C" { =20 #include "qemu/typedefs.h" =20 +/* + * QEMU_REPEAT(n, m) - invoke m(0) m(1) ... m(n-1) + * + * Expands to n invocations of m, each with a literal integer argument. + * n must be a compile-time constant in 0..16. + * + * Example - generate 4 per-index function definitions: + * + * #define DEFINE_GETTER(i) \ + * static int get_##i(void) { return values[i]; } + * + * QEMU_REPEAT(4, DEFINE_GETTER) + */ +#define QEMU_REPEAT_0(m) +#define QEMU_REPEAT_1(m) QEMU_REPEAT_0(m) m(0) +#define QEMU_REPEAT_2(m) QEMU_REPEAT_1(m) m(1) +#define QEMU_REPEAT_3(m) QEMU_REPEAT_2(m) m(2) +#define QEMU_REPEAT_4(m) QEMU_REPEAT_3(m) m(3) +#define QEMU_REPEAT_5(m) QEMU_REPEAT_4(m) m(4) +#define QEMU_REPEAT_6(m) QEMU_REPEAT_5(m) m(5) +#define QEMU_REPEAT_7(m) QEMU_REPEAT_6(m) m(6) +#define QEMU_REPEAT_8(m) QEMU_REPEAT_7(m) m(7) +#define QEMU_REPEAT_9(m) QEMU_REPEAT_8(m) m(8) +#define QEMU_REPEAT_10(m) QEMU_REPEAT_9(m) m(9) +#define QEMU_REPEAT_11(m) QEMU_REPEAT_10(m) m(10) +#define QEMU_REPEAT_12(m) QEMU_REPEAT_11(m) m(11) +#define QEMU_REPEAT_13(m) QEMU_REPEAT_12(m) m(12) +#define QEMU_REPEAT_14(m) QEMU_REPEAT_13(m) m(13) +#define QEMU_REPEAT_15(m) QEMU_REPEAT_14(m) m(14) +#define QEMU_REPEAT_16(m) QEMU_REPEAT_15(m) m(15) +#define QEMU_REPEAT_(n, m) QEMU_REPEAT_##n(m) +#define QEMU_REPEAT(n, m) QEMU_REPEAT_(n, m) + /** * Mark a function that executes in coroutine context * --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787058794; cv=none; d=zohomail.com; s=zohoarc; b=gQPf6MSO7wB1lh276MhVg1Ossshbawr06oMBmIDINsGCdKwtr/tZG97rZfm4GEOaYPoJt+Q4nXcGtxFCyd+q8snwO2NAR51oKsmMhXZrf0ZYoXskuyg8j0Ai9V09J8bUi+/uWOENVtUiIWU8fgU07rSvJpN0e2Hix0v9MQSKz4g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787058794; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Q+7N6lQaNJ3+ymbHkk8ge+yyGgvBETdQK+dHzHp83lE=; b=nDYEbzSx+DOCtmzYEQJK+FawY8XtmFRhqN/Jc5+p1vZzL385vsa7aF1d90cJILYpaYBm5dso/D3POAWp0rNWVNjpuRQDRo/r7EsdqSnuaRH07+7GkCApyKt2A+s1loerluTCEn6SJlQUrAV4rlKwT3uvD24zmbOiqafeIGCfOUg= 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 1787058794307190.4666987335404; Tue, 18 Aug 2026 06:13:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwJ34-0002Mr-QY; Tue, 18 Aug 2026 08:36:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJ34-0002MO-0j for qemu-devel@nongnu.org; Tue, 18 Aug 2026 08:36:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJ31-0006ws-Mq for qemu-devel@nongnu.org; Tue, 18 Aug 2026 08:36:09 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-6-bfWz4WejOYGDr-p4rKeYhg-1; Tue, 18 Aug 2026 08:36:05 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7816119560AF; Tue, 18 Aug 2026 12:36:03 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E87D5422; Tue, 18 Aug 2026 12:36:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787056566; 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=Q+7N6lQaNJ3+ymbHkk8ge+yyGgvBETdQK+dHzHp83lE=; b=EaF7Jnwkk2Nh0+x8IyTW+Zg+qwHNL2rTQXfiLSuIsG4M0lDQnzIqFoqP+QaY7KofkzFDyy gaB4XR0dulAadA78I1FY8GB3ae3FVwpWQSl6HsR+x2HnqPamVyqdZBIh2JWg+6wvx9QQ0A dXfdUoX9Ss0NkGXBdeZXnjNS0D0aV4M= X-MC-Unique: bfWz4WejOYGDr-p4rKeYhg-1 X-Mimecast-MFC-AGG-ID: bfWz4WejOYGDr-p4rKeYhg_1787056564 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 16:36:36 +0400 Subject: [PATCH v3 57/74] hw/gpio/pca955x: convert pin/led property to QAPI-aware enum MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-57-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Glenn Miles , qemu-ppc@nongnu.org, qemu-arm@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=18122; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=jaJ89zwuq2tH/Z6pbH2n/emoNfh0O7+7mD66hHhyAJk=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhFGnTh5GJ2UR42bx03fo3PUOUiQ7E2kaHl8jg 8NCLfftTwaJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoRRpwAKCRDa6OEJdZac 5VfBD/oCD4BVkXInpbxcN+rlTmU1uXoVuH0rWYUr6WAPHCXXoqgM62e+Zwuo3vLlnYnSjDMglJw FV4cdyTksNIU1Yb6q4aRIZS3jpxT7rsB8sYM0/aX8k2nr5S+YwpB+pRAMEBQnu41P58Q7XdIlKa JVpGsGB4Kq68ZKueAgImZBFQJdMMFerBIR0RxJ3KZHRwQ4jKJ+ehmK2QJ6vZKLdYJS5FKunAqWY ltRlA4T6CuHHfZOt0DPzh8i9tDoym5fQjTYIj+d1TFtDs/Rywr6quDQJ+PM1hMm839RyLWjJQy6 BYNBSWy9ytMkWYFo0XZT74ghfSSPTrZKdMGVKV5J+7ET3p871vRlolAHdKdoAGirhgwVKnNZzkQ P33tcQEc1fbLCoCEaJsv4NPwUHEtKhC9W72RNbpDiqFYhfWL9/3BeWM4FC++wuXXsBLig4YeGJc vNqoYRAbHAb81oVySXeUKUZng50LpgBCv+kNYHt0Jyv5aHFraydH/yLAj7Sx8njPA23FECq1FuI luuv6HpoB13zO2bxsvbDcnPDrE6E2hTeD9EI2RLYSyN3I20cZaZ6E9wn0bqiTDLAV7dbRk+amaP bwr66eBUgeo1QmYUMNnfUS4Gfqi1U4gzFk5NCiMbd14U1QSOcGDEjvUkwBQ2tv1OiqRf6efsY32 ePaa5wiwdAMcMjg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787058796604158500 Replaces the runtime-parsed visitor-based QOM property accessors with compile-time per-pin/per-LED accessor functions using QEMU_REPEAT. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/gpio/pca9552.c | 205 +++++++++++++++++++++-----------------------------= ---- hw/gpio/pca9554.c | 136 ++++++++++++++---------------------- 2 files changed, 131 insertions(+), 210 deletions(-) diff --git a/hw/gpio/pca9552.c b/hw/gpio/pca9552.c index 16741c22dea3..b743a30d80ff 100644 --- a/hw/gpio/pca9552.c +++ b/hw/gpio/pca9552.c @@ -25,6 +25,7 @@ #include "qapi/error.h" #include "qapi/qapi-types-machine.h" #include "qapi/qapi-visit-machine.h" +#include "qapi/qapi-type-infos-machine.h" #include "trace.h" #include "qom/object.h" =20 @@ -354,33 +355,6 @@ static int pca955x_event(I2CSlave *i2c, enum i2c_event= event) return 0; } =20 -static void pca955x_get_led(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - PCA955xClass *k =3D PCA955X_GET_CLASS(obj); - PCA955xState *s =3D PCA955X(obj); - int led, rc, reg; - Pca9552LedState state; - - rc =3D sscanf(name, "led%2d", &led); - if (rc !=3D 1) { - error_setg(errp, "%s: error reading %s", __func__, name); - return; - } - if (led < 0 || led >=3D k->pin_count) { - error_setg(errp, "%s: invalid led %s", __func__, name); - return; - } - /* - * Get the LSx register as the qom interface should expose the device - * state, not the modeled 'input line' behaviour which would come from - * reading the INPUTx reg - */ - reg =3D PCA9552_LS0 + led / 4; - state =3D (pca955x_read(s, reg) >> ((led % 4) * 2)) & 0x3; - visit_type_Pca9552LedState(v, name, &state, errp); -} - /* * Return an LED selector register value based on an existing one, with * the appropriate 2-bit state value set for the given LED number (0-3). @@ -391,97 +365,8 @@ static inline uint8_t pca955x_ledsel(uint8_t oldval, i= nt led_num, int state) ((state & 0x3) << (led_num << 1)); } =20 -static void pca955x_set_led(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - PCA955xClass *k =3D PCA955X_GET_CLASS(obj); - PCA955xState *s =3D PCA955X(obj); - int led, rc, reg, val; - Pca9552LedState state; - - if (!visit_type_Pca9552LedState(v, name, &state, errp)) { - return; - } - rc =3D sscanf(name, "led%2d", &led); - if (rc !=3D 1) { - error_setg(errp, "%s: error reading %s", __func__, name); - return; - } - if (led < 0 || led >=3D k->pin_count) { - error_setg(errp, "%s: invalid led %s", __func__, name); - return; - } - - reg =3D PCA9552_LS0 + led / 4; - val =3D pca955x_read(s, reg); - val =3D pca955x_ledsel(val, led % 4, state); - pca955x_write(s, reg, val); -} - static void pca955x_set_ext_state(PCA955xState *s, int pin, int level); =20 -static void pca955x_get_pin(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - PCA955xClass *k =3D PCA955X_GET_CLASS(obj); - PCA955xState *s =3D PCA955X(obj); - int pin, rc; - uint8_t input_reg; - Pca9552PinState state; - - rc =3D sscanf(name, "pin%2d", &pin); - if (rc !=3D 1) { - error_setg(errp, "%s: error reading %s", __func__, name); - return; - } - if (pin < 0 || pin >=3D k->pin_count) { - error_setg(errp, "%s invalid pin %s", __func__, name); - return; - } - - /* - * Report the raw pin logic level; polarity inversion is a read-time - * transform applied to the INPUT register, not to the pin state itsel= f. - */ - input_reg =3D PCA9535_INPUT0 + (pin / 8); - state =3D (s->regs[input_reg] >> (pin % 8)) & 0x1; - visit_type_Pca9552PinState(v, name, &state, errp); -} - -static void pca955x_set_pin(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - PCA955xClass *k =3D PCA955X_GET_CLASS(obj); - PCA955xState *s =3D PCA955X(obj); - int pin, rc; - Pca9552PinState state; - uint8_t config_reg; - - if (!visit_type_Pca9552PinState(v, name, &state, errp)) { - return; - } - rc =3D sscanf(name, "pin%2d", &pin); - if (rc !=3D 1) { - error_setg(errp, "%s: error reading %s", __func__, name); - return; - } - if (pin < 0 || pin >=3D k->pin_count) { - error_setg(errp, "%s invalid pin %s", __func__, name); - return; - } - - /* Only input-configured pins can be driven by an external device. */ - config_reg =3D PCA9535_CONFIG0 + (pin / 8); - if (!((s->regs[config_reg] >> (pin % 8)) & 0x1)) { - qemu_log_mask(LOG_UNIMP, - "%s: pin %d is configured as output, ignoring set\n", - s->description, pin); - return; - } - - pca955x_set_ext_state(s, pin, state !=3D PCA9552_PIN_STATE_LOW); -} - static const VMStateDescription pca9552_vmstate =3D { .name =3D "PCA9552", .version_id =3D 0, @@ -536,26 +421,92 @@ static void pca9535_reset_hold(Object *obj, ResetType= type) s->len =3D 0; } =20 +/* + * Get the LSx register as the qom interface should expose the device + * state, not the modeled 'input line' behaviour which would come from + * reading the INPUTx reg + */ +#define DEFINE_LED_ACCESSORS(n) = \ +static int prop_get_led##n(Object *obj, Error **errp) = \ +{ = \ + PCA955xState *s =3D PCA955X(obj); = \ + uint8_t reg =3D PCA9552_LS0 + (n) / 4; = \ + return (pca955x_read(s, reg) >> (((n) % 4) * 2)) & 0x3; = \ +} = \ +static void prop_set_led##n(Object *obj, int val, Error **errp) = \ +{ = \ + PCA955xState *s =3D PCA955X(obj); = \ + uint8_t reg =3D PCA9552_LS0 + (n) / 4; = \ + uint8_t old =3D pca955x_read(s, reg); = \ + pca955x_write(s, reg, pca955x_ledsel(old, (n) % 4, val)); = \ +} + +QEMU_REPEAT(PCA955X_PIN_COUNT_MAX, DEFINE_LED_ACCESSORS) + +#define LED_ENUM_PROP(n) { \ + .name =3D "led" #n, \ + .default_value =3D -1, \ + .qapi_type =3D &Pca9552LedState_type_info, \ + .get =3D prop_get_led##n, \ + .set =3D prop_set_led##n, \ +}, + +static const QapiEnumProp led_enum_props[] =3D { + QEMU_REPEAT(PCA955X_PIN_COUNT_MAX, LED_ENUM_PROP) +}; + +/* + * Report the raw pin logic level; polarity inversion is a read-time + * transform applied to the INPUT register, not to the pin state + * itself. + */ +#define DEFINE_PIN_ACCESSORS(n) = \ +static int prop_get_pin##n(Object *obj, Error **errp) = \ +{ = \ + PCA955xState *s =3D PCA955X(obj); = \ + uint8_t input_reg =3D PCA9535_INPUT0 + (n) / 8; = \ + return (s->regs[input_reg] >> ((n) % 8)) & 0x1; = \ +} = \ +static void prop_set_pin##n(Object *obj, int val, Error **errp) = \ +{ = \ + PCA955xState *s =3D PCA955X(obj); = \ + uint8_t config_reg =3D PCA9535_CONFIG0 + (n) / 8; = \ + /* Only input-configured pins can be driven by an external device */ = \ + if (!((s->regs[config_reg] >> ((n) % 8)) & 0x1)) { = \ + qemu_log_mask(LOG_UNIMP, = \ + "%s: pin %d configured as output, ignoring set\n", = \ + s->description, (n)); = \ + return; = \ + } = \ + pca955x_set_ext_state(s, (n), val !=3D PCA9552_PIN_STATE_LOW); = \ +} + +QEMU_REPEAT(PCA955X_PIN_COUNT_MAX, DEFINE_PIN_ACCESSORS) + +#define PIN_ENUM_PROP(n) { \ + .name =3D "pin" #n, \ + .default_value =3D -1, \ + .qapi_type =3D &Pca9552PinState_type_info, \ + .get =3D prop_get_pin##n, \ + .set =3D prop_set_pin##n, \ +}, + +static const QapiEnumProp pin_enum_props[] =3D { + QEMU_REPEAT(PCA955X_PIN_COUNT_MAX, PIN_ENUM_PROP) +}; + static void pca955x_initfn(Object *obj) { PCA955xClass *k =3D PCA955X_GET_CLASS(obj); =20 assert(k->pin_count <=3D PCA955X_PIN_COUNT_MAX); + /* use array/list instead of individual QAPI enum properties */ for (int ix =3D 0; ix < k->pin_count; ix++) { - char *name; - if (k->has_led_support) { - /* LED variant: expose the LED selector state as led%d. */ - name =3D g_strdup_printf("led%d", ix); - object_property_add(obj, name, "Pca9552LedState", - pca955x_get_led, pca955x_set_led, NULL, NU= LL); + object_property_add_qapi_enum(obj, &led_enum_props[ix]); } else { - /* GPIO variant: expose the pin logic level as pin%d. */ - name =3D g_strdup_printf("pin%d", ix); - object_property_add(obj, name, "Pca9552PinState", - pca955x_get_pin, pca955x_set_pin, NULL, NU= LL); + object_property_add_qapi_enum(obj, &pin_enum_props[ix]); } - g_free(name); } } =20 diff --git a/hw/gpio/pca9554.c b/hw/gpio/pca9554.c index e4eddc829ef7..f2a5b94a36d8 100644 --- a/hw/gpio/pca9554.c +++ b/hw/gpio/pca9554.c @@ -18,7 +18,7 @@ #include "qapi/error.h" #include "qapi/qapi-types-machine.h" #include "qapi/qapi-visit-machine.h" -#include "qapi/visitor.h" +#include "qapi/qapi-type-infos-machine.h" #include "trace.h" #include "qom/object.h" =20 @@ -151,83 +151,60 @@ static void pca9554_set_ext_state(PCA9554State *s, in= t pin, int level) } } =20 -static void pca9554_get_pin(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - PCA9554State *s =3D PCA9554(obj); - int pin, rc; - Pca9554PinState state; - - rc =3D sscanf(name, "pin%2d", &pin); - if (rc !=3D 1) { - error_setg(errp, "%s: error reading %s", __func__, name); - return; - } - if (pin < 0 || pin >=3D PCA9554_GET_CLASS(s)->pin_count) { - error_setg(errp, "%s invalid pin %s", __func__, name); - return; - } - - /* - * Report the physical pin level. The input register is kept in sync by - * pca9554_update_pin_input(): output pins mirror the OUTPUT register = and - * input pins reflect the externally driven (or pulled-up) level, so it - * holds the wire level regardless of the configured direction. - */ - state =3D (s->regs[PCA9554_INPUT] >> pin) & 0x1; - visit_type_Pca9554PinState(v, name, &state, errp); +/* + * Report the physical pin level. The input register is kept in sync + * by pca9554_update_pin_input(): output pins mirror the OUTPUT + * register and input pins reflect the externally driven (or + * pulled-up) level, so it holds the wire level regardless of the + * configured direction. + */ +#define DEFINE_PIN_ACCESSORS(n) = \ +static int prop_get_pin##n(Object *obj, Error **errp) = \ +{ = \ + PCA9554State *s =3D PCA9554(obj); = \ + return (s->regs[PCA9554_INPUT] >> (n)) & 0x1; = \ +} = \ +static void prop_set_pin##n(Object *obj, int val, Error **errp) = \ +{ = \ + PCA9554State *s =3D PCA9554(obj); = \ + if (s->hw_dir) { = \ + if (!((s->regs[PCA9554_CONFIG] >> (n)) & 0x1)) { = \ + qemu_log_mask(LOG_UNIMP, = \ + "%s: pin %d configured as output," = \ + " ignoring set\n", = \ + s->description, (n)); = \ + return; = \ + } = \ + pca9554_set_ext_state(s, (n), val !=3D PCA9554_PIN_STATE_LOW); = \ + } else { = \ + /* Legacy behavior: force output mode and drive */ = \ + uint8_t mask =3D 0x1 << (n); = \ + int v =3D pca9554_read(s, PCA9554_OUTPUT); = \ + if (val =3D=3D PCA9554_PIN_STATE_LOW) { = \ + v &=3D ~mask; = \ + } else { = \ + v |=3D mask; = \ + } = \ + pca9554_write(s, PCA9554_OUTPUT, v); = \ + v =3D pca9554_read(s, PCA9554_CONFIG); = \ + v &=3D ~mask; = \ + pca9554_write(s, PCA9554_CONFIG, v); = \ + } = \ } =20 -static void pca9554_set_pin(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - PCA9554State *s =3D PCA9554(obj); - int pin, rc, val; - uint8_t mask; - Pca9554PinState state; +QEMU_REPEAT(PCA9554_PIN_COUNT, DEFINE_PIN_ACCESSORS) =20 - if (!visit_type_Pca9554PinState(v, name, &state, errp)) { - return; - } - rc =3D sscanf(name, "pin%2d", &pin); - if (rc !=3D 1) { - error_setg(errp, "%s: error reading %s", __func__, name); - return; - } - if (pin < 0 || pin >=3D PCA9554_GET_CLASS(s)->pin_count) { - error_setg(errp, "%s invalid pin %s", __func__, name); - return; - } +#define PIN_ENUM_PROP(n) { \ + .name =3D "pin" #n, \ + .default_value =3D -1, \ + .qapi_type =3D &Pca9554PinState_type_info, \ + .get =3D prop_get_pin##n, \ + .set =3D prop_set_pin##n, \ +}, =20 - if (s->hw_dir) { - /* Warn and ignore if the guest has configured this pin as output = */ - if (!((s->regs[PCA9554_CONFIG] >> pin) & 0x1)) { - qemu_log_mask(LOG_UNIMP, - "%s: pin %d is configured as output, " - "ignoring external set\n", - s->description, pin); - return; - } - /* Drive the external input level */ - pca9554_set_ext_state(s, pin, state !=3D PCA9554_PIN_STATE_LOW); - } else { - /* Legacy behavior: force output mode and drive */ - /* First, modify the output register bit */ - val =3D pca9554_read(s, PCA9554_OUTPUT); - mask =3D 0x1 << pin; - if (state =3D=3D PCA9554_PIN_STATE_LOW) { - val &=3D ~(mask); - } else { - val |=3D mask; - } - pca9554_write(s, PCA9554_OUTPUT, val); - - /* Then, clear the config register bit for output mode */ - val =3D pca9554_read(s, PCA9554_CONFIG); - val &=3D ~mask; - pca9554_write(s, PCA9554_CONFIG, val); - } -} +static const QapiEnumProp pin_enum_props[] =3D { + QEMU_REPEAT(PCA9554_PIN_COUNT, PIN_ENUM_PROP) +}; =20 static const VMStateDescription pca9554_vmstate =3D { .name =3D "PCA9554", @@ -264,16 +241,9 @@ static void pca9554_reset(DeviceState *dev) static void pca9554_initfn(Object *obj) { PCA9554Class *pc =3D PCA9554_GET_CLASS(obj); - int pin; =20 - for (pin =3D 0; pin < pc->pin_count; pin++) { - char *name; - - name =3D g_strdup_printf("pin%d", pin); - object_property_add(obj, name, "Pca9554PinState", - pca9554_get_pin, pca9554_set_pin, - NULL, NULL); - g_free(name); + for (int pin =3D 0; pin < pc->pin_count; pin++) { + object_property_add_qapi_enum(obj, &pin_enum_props[pin]); } } =20 --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787058879; cv=none; d=zohomail.com; s=zohoarc; b=dhWdUEwKCyEmBsxAirYJRSZkJ4kd0KFuCxcStcKc9FpgNT/FPWB0jOrQVfd+KRhCKkWe3gnjQzX8hsnOfT2P8fIjXtwDDJSd094x8zs6o58JhGxWGRpUm+L0p9SNsSlijIclRzx6tRS6Whuw4hEQDiW90PVfYHtymVCw1CWg2Tk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787058879; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DD8Iv6mmkRObF2FzIYp6c9s/Kp4YD7Brc7X7K0K/nVM=; b=ZmqRSDaf12Pljw/oMtcO1g24H4FJ373N/miBlU4NRQ8an2X5LyckoxRzCefoYxPrwzdMpzSN9goyIr11/42UgeBtqBL6GyN+a+gObfUbs7zgVARMtSuaMMwCrpD2hMAxYrlo/sFPPcO5BHZmOT79TlluaXENJkkJ4x8+7l9sXSk= 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 1787058879084723.4195373818886; Tue, 18 Aug 2026 06:14:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwJ39-0002P7-NK; Tue, 18 Aug 2026 08:36:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJ38-0002Ot-HH for qemu-devel@nongnu.org; Tue, 18 Aug 2026 08:36:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJ37-0006yE-3K for qemu-devel@nongnu.org; Tue, 18 Aug 2026 08:36:14 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-483-VK792HN4OwSQI7gzExkcqg-1; Tue, 18 Aug 2026 08:36:09 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3170B195608B; Tue, 18 Aug 2026 12:36:08 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BA498423; Tue, 18 Aug 2026 12:36:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787056572; 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=DD8Iv6mmkRObF2FzIYp6c9s/Kp4YD7Brc7X7K0K/nVM=; b=i0W3cFNc4M0rZivaiagIP8VTnKVwhqiZJCOtyTnMEUpUfW9qq/Iua6NwQhG8xPGhp/IMsr VIRPrW8bp9OMf9Zy1m+efoS4xz0hJ+B85LSc5QZ3VVFgnunuzkKZDTIioC87TJjXmxL5Xe wx4lvsFOeDtP2B7zU9AFwKPrBfyII+o= X-MC-Unique: VK792HN4OwSQI7gzExkcqg-1 X-Mimecast-MFC-AGG-ID: VK792HN4OwSQI7gzExkcqg_1787056568 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 16:36:37 +0400 Subject: [PATCH v3 58/74] hw/pci: change the busnr type to uint8 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-58-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" X-Developer-Signature: v=1; a=openpgp-sha256; l=622; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=uZf4Qa+0RX3V6iYvyo4CF/MHfx6e7rZpaQ8DdYGe+hE=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhFGnGiOFzzu/Gop9SM7XbPreSYQGiPqAs7wQH TF7gVZOjuSJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoRRpwAKCRDa6OEJdZac 5epXD/0b3FaS71TvY9jhfQ+iiGrMb4j32jkz4wv+Uehr6X1ptKnorykhT1tTn6XsvEnmT0Hy65I F6QUljXY70ANCdDAgcgfwMFR0qXR3WE+dZbMMyYQZ83CEddrRTK62PzpQPnP+dTmFMIdHZ5YC/E WlG2cfUOgoD3+yz15zywkJsHVZh7CtsG/WYxqXpePDWT+0vBL4E8Z7UNhR64M7kJZGch1OavDgb Y0yJjWmrx7prLc9r6fKjHEiuDvfuWeTwgMc0xKm8zZTsqfL1Rj429301zeCWap6JQ3QZSrafFL3 TcYaM8w21tDgwfVOtjMTdyXpTnpMh2FsjV71kzyLBUd4bsvvrhRS5d1LF7/wprmnfqr0ZhHXrRx ivwJOJ3IyhEy9HquBQWSR2dB3jLYdLmQUld/6VELWd/MDwppcvIjLyIQXk89AJkAaGnBFlgh1XX rI9ygSNQYOEE3yXh6c53CTkvpI8rasaJsYt5320BWLMxWTv8kd9ryWIw6lLNL3Sc4luxQmG9jTb tbs6YPnxzdYxGJrHdrZ2YnOjs0ZQfqAVAs7n9RmT0rzcgtLaURyVQE9U+4alV71m/o3mcaKJri6 7ZsVFhwqIixHeJUoGSWTXKmyb7i2esyuZnP7B10rYtmb8SgumWXc4w704XQkiuHnMbxiQNmJzaA kdjp6W7GgFFPM3Q== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787058880931158500 It is effectively a u8. The next changes are going to use the uint8_type_info for it. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index d3191609e283..be6145a90a9f 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -79,7 +79,7 @@ static void prop_pci_busnr_get(Object *obj, Visitor *v, c= onst char *name, } =20 static const PropertyInfo prop_pci_busnr =3D { - .type =3D "busnr", + .type =3D "uint8", .get =3D prop_pci_busnr_get, }; =20 --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787060632; cv=none; d=zohomail.com; s=zohoarc; b=IXN/C9/bCa9riqPxqIxjGTcAyanDwh8YYdz9vqJ4kHVp7m1/DbKQAi9YdMlMFPM5KEmEmFfnmiBIs1Q9ik7TQf8I2pE/VgA+tyKyzC7zjmuNcKgfPvR+exGQBUkGH4YfF3lRK7tWLq/F/WRzmvV/waPKtMsQkGjUHQ+muegFHHk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787060632; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+U56nlsVf4mgf1W0GndZT5RbL9JsSUbkFD/AB+XKJsA=; b=PyaOVsWIB662AWv9ZhwaYKfBABGJLl9T4kwHO8RVj6pUwnr/6Hs6FkPgiH6732KidxXkOJIawAns4K7Yj9TxbFktf+SvhdwwCt9P86HjOUXiysQ+8DagPgNTYmGviSAKN9xVbviR/IH391tcD1iaeyXqFnjBXodulE0WiGN+Cr4= 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 1787060632853673.1814063040342; Tue, 18 Aug 2026 06:43:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwJ3I-0002QR-B5; Tue, 18 Aug 2026 08:36:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJ3G-0002Q2-7R for qemu-devel@nongnu.org; Tue, 18 Aug 2026 08:36:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJ3E-0006yY-DR for qemu-devel@nongnu.org; Tue, 18 Aug 2026 08:36:21 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-88-V9bzcMOxNDOj3fu6ZwtZzg-1; Tue, 18 Aug 2026 08:36:13 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C4BBD18004BB; Tue, 18 Aug 2026 12:36:11 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DAAB7423; Tue, 18 Aug 2026 12:36:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787056579; 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=+U56nlsVf4mgf1W0GndZT5RbL9JsSUbkFD/AB+XKJsA=; b=JgdnW5SJpkIhDftsgVbK10GUMmQ77z8QsIpjJAU+2mEaMBpg48N50SQXoV4cdom7tmC2lY v/SNswX3ysKrtzn5gul4SK9xHMbKL6ImHvB82AJGnciLwn/1ZFi71sh0X2QznU8sYCx0EL nHGuNq3akLA0tB2XGSoiQtMh6xJm8OI= X-MC-Unique: V9bzcMOxNDOj3fu6ZwtZzg-1 X-Mimecast-MFC-AGG-ID: V9bzcMOxNDOj3fu6ZwtZzg_1787056572 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 16:36:38 +0400 Subject: [PATCH v3 59/74] qdev: add qapi_type field to PropertyInfo with fallback registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-59-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=7097; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=rVgb3lPZcyuxYB6Idtqpd6v6VbibarNVb6IbHBysRPw=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhFGnww5EazEFc5ax6vFOJIIgDUtPcBpua+cGN T+JHb8cqIeJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoRRpwAKCRDa6OEJdZac 5QwVD/9wCRNtkIz8Of+lNkz/sv7vveDsRCmHU62tPXRVJKxKwfspKy7t172VhAlOyW0T+LKxv/8 xPTQDXV5a12zb92OfagUG0l5edstP3hHP10lvQuH7560+qwSKV7kFIhZxb5O7ns/m1KCphw2rkA qBwhoWF11rJmyAoXtyxtavnyyc6s24dUstkRKuIe87V1ZzHXbHsH3LB/fR9xfrgAU//Mw1rtcyS Jb37exDQTwoqxRbiLCP3YPWePhAkpZpZa+O0RIJPBay8kkK6SIGdaNNHyzLB9EqToyE79I8eewX YD06MLon3vXqRgno/Fjutg1eYy0q02kVJGN3VvZYnSPG2U7QFP0eLerFWsOexoza5rUOmQPlCg1 2KQrH6TeuooPq5z8lDZbzP8OnEOgKOuoCl3BoBP9yuAMczVkVpImo5QbzA5miGb305PXIHfW+hc 5CWgnKGxoVuh4CBzGg95rerdXQ6g2G4XCEDt3FMWFGkqcp89OJ5VF6FfvHa8uZdZdVflwE8m5JL zkVJ4GYcz5lMNAZXO+lElLflIG7MYITCQi+q0XZ7UwIyLQ29YYiDKXDMwq5HaD+DZhGKKHtK//3 UjTZM50/Sy6t+M6gWzKrHeKn7ysQvMnSah8f3g2rYaMnT8Jzd9TtA0f3CG9Pls7gFtUz1TuGj+L igLmk0D82HfzIGw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=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: 1787060635352158500 Add a qapi_type field to PropertyInfo to prepare for the transition from string-based type metadata to QAPI type-info. Add a qdev_prop_qapi_type() helper that resolves the QAPI type for a property from .qapi_type. It will be later extended to cope with array types. Update qdev_property_add_static() and qdev_class_add_property() to prefer object_property_add_qapi() when a QAPI type is available, falling back to the old object_property_add() for unconverted properties. Update the shared enum accessor functions to prefer .qapi_type->lookup over .enum_table via a new qdev_propinfo_enum_lookup() helper. No PropertyInfo definitions are changed, all .qapi_type fields default to NULL, so the fallback paths are always taken. This patch is no-op for now. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-properties.c | 67 +++++++++++++++++++++++++++++------= ---- include/hw/core/qdev-properties.h | 1 + 2 files changed, 52 insertions(+), 16 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 34d7b26a7303..b3d5abd5053c 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,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, 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->defv= al.i)); } =20 /* Bit */ @@ -941,8 +950,8 @@ void qdev_prop_set_enum(DeviceState *dev, const char *n= ame, int value) =20 prop =3D qdev_prop_find(dev, name); object_property_set_str(OBJECT(dev), name, - qapi_enum_lookup(prop->info->enum_table, value= ), - &error_abort); + qapi_enum_lookup(qdev_propinfo_enum_lookup(prop->info), value), + &error_abort); } =20 void qdev_prop_set_array(DeviceState *dev, const char *name, QList *values) @@ -1143,18 +1152,33 @@ const PropertyInfo qdev_prop_link =3D { .set =3D set_link, }; =20 +static const QAPITypeInfo *qdev_prop_qapi_type(const Property *prop) +{ + /* this will be later extended to cope with QAPI array properties */ + return prop->info->qapi_type; +} + void qdev_property_add_static(DeviceState *dev, const Property *prop) { Object *obj =3D OBJECT(dev); ObjectProperty *op; + const QAPITypeInfo *qapi_type =3D qdev_prop_qapi_type(prop); =20 assert(!prop->info->create); =20 - op =3D object_property_add(obj, prop->name, prop->info->type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); + if (qapi_type) { + op =3D object_property_add_qapi(obj, prop->name, qapi_type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); + } else { + op =3D object_property_add(obj, prop->name, prop->info->type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); + } =20 object_property_set_description(obj, prop->name, prop->info->description); @@ -1176,12 +1200,23 @@ static void qdev_class_add_property(DeviceClass *kl= ass, const char *name, if (prop->info->create) { op =3D prop->info->create(oc, name, prop); } else { - op =3D object_class_property_add(oc, - name, prop->info->type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); + const QAPITypeInfo *qapi_type =3D qdev_prop_qapi_type(prop); + + if (qapi_type) { + op =3D object_class_property_add_qapi(oc, + name, qapi_type, + field_prop_getter(prop->inf= o), + field_prop_setter(prop->inf= o), + prop->info->release, + (Property *)prop); + } else { + op =3D object_class_property_add(oc, + name, prop->info->type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); + } } if (prop->set_default) { prop->info->set_default_value(op, prop); diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-prope= rties.h index eba5436e53b1..1ea2ba66bb37 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -34,6 +34,7 @@ struct PropertyInfo { const char *type; const char *description; const QEnumLookup *enum_table; + const QAPITypeInfo *qapi_type; bool realized_set_allowed; /* allow setting property on realized devic= e */ char *(*print)(Object *obj, const Property *prop); void (*set_default_value)(ObjectProperty *op, const Property *prop); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787058917; cv=none; d=zohomail.com; s=zohoarc; b=lmoy+AFoJwYZUddGFZUwGXP7m9YtK/ZM1uSJK/wWdD8u8932MmWR8GbE/4SEdqYa1DIFpC0dqTlFb8tvHKxqZiRaPxwYGDeT22XyQ/Wqt7KY5HlTWBuIJ/GqwyQlFtuw2n2wXDvjvsfnO+ya5jN6oeu1HvE43FuSNXJ384UZ0YI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787058917; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yIwJWaK8tsYw5DkqRZdnqVq9NraRNdS/e77Jdg6JGkY=; b=FECtUV4bM/k8+ERUXHy460k0/VDgkQDxTaQncZxtooN4wsOTcsbLyGNYD2yW7D9Wirgd25ZGoZQxOzWKKSzyKJj1jCof9Sm8ykIom7ViS2OO0puae5oud7k8KtHXplPPC2GUzloTvA8Ymq4SLZuIWgAO6XB/MCb2ew+aQyzchRk= 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 1787058917082408.5128647459326; Tue, 18 Aug 2026 06:15:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwJ3O-0002TW-Qf; Tue, 18 Aug 2026 08:36:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJ3O-0002T9-0Z for qemu-devel@nongnu.org; Tue, 18 Aug 2026 08:36:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJ3I-0006zB-L7 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 08:36:29 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-562-csuIWPjUPm6yJk6cWZfMOw-1; Tue, 18 Aug 2026 08:36:17 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5BCD91955E77; Tue, 18 Aug 2026 12:36:16 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2D4FE180049F; Tue, 18 Aug 2026 12:36:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787056584; 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=yIwJWaK8tsYw5DkqRZdnqVq9NraRNdS/e77Jdg6JGkY=; b=MpRSh40YYjt+EkTl0KKeVYZjqH1kXBi/Ih71SzDSn2Y9lqYhl9GFZxQc5lgOlB+4D64dAj 32uD+DSvPOc4bkzbqZJug0dBJAzFaAf/G6y3DkrtAfmIsJZapin0whql9NiviDqUQWigVQ 9k4aAVz/9LURMnMBkP4BVXAbZYeyIOo= X-MC-Unique: csuIWPjUPm6yJk6cWZfMOw-1 X-Mimecast-MFC-AGG-ID: csuIWPjUPm6yJk6cWZfMOw_1787056576 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 16:36:39 +0400 Subject: [PATCH v3 60/74] qdev: convert core PropertyInfo definitions to use qapi_type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-60-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=6905; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=uKd4YrvBJdVeN8+KEVzpNUXVhpVCSGsiMFoSt6/JX4Q=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhFGnYtzF+Hyeh2x0aGQdWSjXc+FZ5/95viYgc uvFHz7fqLCJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoRRpwAKCRDa6OEJdZac 5YrwD/9lqYwmZKYzsLVWG1jVKhTw8Ic9U34499mnR0iTWQ4mlPMrL8OWVg6qc7IfGoMqEYcZCIA wCllSHptK05TjpyNDCflDYMv01+rx9c/gm7iSsw0Acxtgnio/K1B80z+pm98LAKU0ctw1GtHftz iWkIbkAx9cjuOEXmi1yJbuZ0F7HUZftbzRoKRIaS2KErw4gJCBsbHqYdvrvWYG0q0C6gwDwcvQ9 DlLoJE8wMkqsygcVAlVj8K0nogu9q6dHL9tugjL8jrzPl3tM2IZ3z+Ydag4jgd04VrAFdD8Cqg5 XwEvQeqn173JaIn50s117iUQ4fx3mlhAwMStEZVESdcjoCJxG023PLjI4V476cVjQwGwjaIREzJ vOj/E44vDFUmXSHvulImwSGSG54RvY7JKt51HialBS2vn6DTdI9DjevAzYFmCL7BPku5YCYLZSD 7k0KHjyCYJhkxUqe088CJjxwJl7S7e1I91WTFkJl6fPvKPKslYyiHYRP1DwiG8+vc5cMXgVQEAZ OCIrB5RJSxwXccqDedvZA3zqAS0F2i7BoZ/IRX9aRmJjBPQlrFGsCMd8YHXzEdungdLMv1intZ9 d/Fm1GQBZEtirJmi6TzsHMenH02VHAdENjtEPFyJiLzzcnodjSZ4X8rxUhbXoQVqN47Itl6+UQz TMRqJMGX3sDKjPw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787058919305158500 Replace .type string with .qapi_type pointer on all core PropertyInfo definitions in qdev-properties.c. Remove .enum_table from enum definitions, since the lookup is now accessed through .qapi_type->lookup via the qdev_propinfo_enum_lookup() fallback helper. Note that qdev_prop_usize now reports "uint32" or "uint64" depending on the host. If usize is worth preserving, it should be added as a QAPI builtin type. Or perhaps we should simply use "size" everywhere (u64)? It's also strange to use type "size" for both u32 (prop_size32) and u64 (prop_size). Link property are actually strings. The "full type name" is set when the property is added, as "link". Array property will be refactored in a subsequent patch. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-properties.c | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index b3d5abd5053c..e924b040687b 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) @@ -180,7 +182,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, @@ -230,7 +232,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, @@ -292,9 +294,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, @@ -321,7 +322,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, @@ -361,7 +362,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, @@ -388,7 +389,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, @@ -433,14 +434,14 @@ static void set_int32(Object *obj, Visitor *v, const = char *name, void *opaque, } =20 const PropertyInfo qdev_prop_uint32 =3D { - .type =3D "uint32", + .qapi_type =3D &uint32_type_info, .get =3D get_uint32, .set =3D set_uint32, .set_default_value =3D qdev_propinfo_set_default_value_uint, }; =20 const PropertyInfo qdev_prop_int32 =3D { - .type =3D "int32", + .qapi_type =3D &int32_type_info, .get =3D qdev_propinfo_get_int32, .set =3D set_int32, .set_default_value =3D qdev_propinfo_set_default_value_int, @@ -485,14 +486,14 @@ static void set_int64(Object *obj, Visitor *v, const = char *name, } =20 const PropertyInfo qdev_prop_uint64 =3D { - .type =3D "uint64", + .qapi_type =3D &uint64_type_info, .get =3D get_uint64, .set =3D set_uint64, .set_default_value =3D qdev_propinfo_set_default_value_uint, }; =20 const PropertyInfo qdev_prop_int64 =3D { - .type =3D "int64", + .qapi_type =3D &int64_type_info, .get =3D get_int64, .set =3D set_int64, .set_default_value =3D qdev_propinfo_set_default_value_int, @@ -514,7 +515,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, }; @@ -550,7 +551,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, @@ -594,7 +599,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, @@ -603,9 +608,8 @@ const PropertyInfo qdev_prop_string =3D { /* --- on/off/auto --- */ =20 const PropertyInfo qdev_prop_on_off_auto =3D { - .type =3D "OnOffAuto", + .qapi_type =3D &OnOffAuto_type_info, .description =3D "on/off/auto", - .enum_table =3D &OnOffAuto_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -646,7 +650,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, @@ -1059,7 +1063,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, @@ -1141,7 +1145,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.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787060119; cv=none; d=zohomail.com; s=zohoarc; b=XcfMuQUSo9lDHuxMXfclPeTW69DrTPpZV1erV6J94cdXK3EfdFLPZfl54oObMLW+u1Nz3rEXboxvye+aVcIFUuC9ygUDZt+fXunIx3B1ANto6oEjNK68cAjnKcHjJTAabB/zoUG57tPBt9aNVb2AK3d7D4cCL0IfF4nlwPJxIMM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787060119; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+8o3TdsDmTmZflSq3Tpd/g79z8JVPD27QnuhbFbpfBc=; b=RZkio7NrSXiDetmgvnwkJeGoqRH7r8oLPaJ0QO6caCPYgrVyAipgzgxcCM4Uf1jU0F+Z6T5wHFP1oWZqtBdtypRdtD9mVE/W8KCuGTbN4b36Ar0RW5eULxKfsC4juXHXm6C3YPOAsJtFvu6puJnODFf5+yqd0OdNqFCDOv+XKro= 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 1787060119126146.30448350745326; Tue, 18 Aug 2026 06:35:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwJyB-0005sn-UO; Tue, 18 Aug 2026 09:35:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJyB-0005sY-0I for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:35:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJy9-0000Xj-Ig for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:35:10 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-668-liqlYVApN9-xwiD55RNtMg-1; Tue, 18 Aug 2026 09:35:02 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0B5451800847; Tue, 18 Aug 2026 13:35:01 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E9ED7180049F; Tue, 18 Aug 2026 13:34:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787060107; 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=+8o3TdsDmTmZflSq3Tpd/g79z8JVPD27QnuhbFbpfBc=; b=jDj3rt1Wdj7bch14ahtLEHi1Znc2UPWlbtZzzDnwolfq6O2uewuKG5sfO/b3kRefbu+Vj+ 5O8jarMwxykLBke4MH6ATUvXbGfQUVWDZu3s8btAJ4pb9GS/CzXSTC1yozV1VzLr4MXCbS Y98G5q/HGJCHcnfVxnX8npe5ntoGlP8= X-MC-Unique: liqlYVApN9-xwiD55RNtMg-1 X-Mimecast-MFC-AGG-ID: liqlYVApN9-xwiD55RNtMg_1787060101 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 17:29:27 +0400 Subject: [PATCH v3 61/74] qdev: adjust PciDevfn declared type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-61-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1128; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=KhDByEWBnxUC3W2CWL4f0/aEPfmWCB/L9BLd30y2XBI=; b=kA0DAAoB2ujhCXWWnOUByyZiAGqEX3OhUQYZWQQ9WYLcRUE6typV/1Muw8QGkZzz1ScuoEwN1 4kCMwQAAQoAHRYhBIepvZM/h8YG0nb2Ldro4Ql1lpzlBQJqhF9zAAoJENro4Ql1lpzlndIQAKbI VSVo2lZXQldFUou7YmgRCd0brmjcAs3ApiLTK8kfcTBnjUBeq2jOznD9PD6OkD3iWNgAaGU+bTJ Ekrji3GgnPyylfu68Qx2i8oNu1E34uRHMFugvt1+5LPrGJznyeVL6NU/TnVhyBIH4GBSeppbf4c 8eZCFfcqRuUNPFWQXM3pvLEbkVIs6bbyh1wSJtaDgJWjGb8wfYuOvjDipaJiBQrrZlInyOyexHe 3vYIMeKbG/5U70LNFi8jgynzdPIxlnv7jgUe54O3k4kddMfeAhb0HhZCbQwjGQ2bqRyj9sP4OpB rXJVZrKWnIE7nP70QV1uNeKs/VG5UXfJd7/tHRKlOmshAmWMl8BLOcHZ+1lm2yC43D6ChjMkeQX +UHXJSA/ZmbQh4tChvTicWbel8gThLs9w/fZ7cNBvWcv1JCAU8nQ6ZcHYlBy1NhYbpkFtZonHun sOSEl5Le12KTb9J4+cO6thS0QYkU5Ea8001StHd8gV/6WQklB2DVxjD7HFy2Q/DUHudXDokIgGV JEv5XpNdWjkSE5D505iEautpSuBO8x07P3ObxjluqvQ6P+32461hKsRvP4SID719hK3zFbGehjF BpPWiS1UM9C7caw5xbB559rWUazDl404FDRU+M8sVaxt40VUHtzB9uv3f1ylUKkQV2D28NpxJod vOdoN X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=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: 1787060120432158500 PciDevfn is a bit special, since it accepts integer and string as setter, but only output integer as getter. Unfortunately, we can't declare an alternate str|int QAPI type for it, since: branch 'string' can't be distinguished from 'integer' Rather than declaring it as "str", use the common type instead. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-properties-system.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 5bfdfe1ab9d9..3381de1144d6 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -904,7 +904,8 @@ static char *print_pci_devfn(Object *obj, const Propert= y *prop) } =20 const PropertyInfo qdev_prop_pci_devfn =3D { - .type =3D "str", + /* The formatted string accepted by the setter is a CLI convenience. */ + .type =3D "int32", .description =3D "Slot and optional function number, example: 06.0 or = 06", .print =3D print_pci_devfn, .get =3D qdev_propinfo_get_int32, --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787060135; cv=none; d=zohomail.com; s=zohoarc; b=mVtWK06V84VPm4Xt8DSQDwY3EU/kV9rOsYCbnglzahunhoQybkVyvj0KNUvgSmczReD7xE34a0Dq3GTRgmt7zkwbvDm2MWEivrNXSSLUjC8du2zXgKnkSQNM6ABYEVPzzHLpIhQAxhnlaX8ze8Pfptd3iSCrRMd9WOOerSwu+vE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787060135; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hrL77UiYk/Zget/e8RSL9xHwWkdSA8I3FunFDzEsRdA=; b=T0LlHxK5T53fiiGF4u8lFZCppxM65BEylircbretsAAyrSCYOD+Wg9hzlkW03uR7K5wyGMMnZc67RcJ7iH79KUeSoHGqW5vhgI+XYI3GQ4e6oKPUDTRj5goT1dAwlRCOyLyv/tA70AsAbjydPbHwTTf5jsBl2HhnHa5EowG4nGg= 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 1787060135535537.1654589528736; Tue, 18 Aug 2026 06:35:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwJyP-0005xF-DV; Tue, 18 Aug 2026 09:35:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJyN-0005wu-L7 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:35:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJyI-0000Z2-D4 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:35:23 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-596-h1bf6oEoP72DhDAubH6PrQ-1; Tue, 18 Aug 2026 09:35:09 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 141E11955E85; Tue, 18 Aug 2026 13:35:08 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BAF841956042; Tue, 18 Aug 2026 13:35:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787060117; 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=hrL77UiYk/Zget/e8RSL9xHwWkdSA8I3FunFDzEsRdA=; b=NGKStUlVtie9GRXK5SvwSwAYGWgA2rmhXwGKXnB3zrHYSMcYrwNJgRSriABnXA52xhIFTR WTi+LY2eiGp5mVm+RwpwHENHyPjkJRgEng20A7+VoF3VDmesQZN3HaU24YYmKedxOp721P L1zNe4G9Ef+S+p3qOeDj4lfGw+ceOXE= X-MC-Unique: h1bf6oEoP72DhDAubH6PrQ-1 X-Mimecast-MFC-AGG-ID: h1bf6oEoP72DhDAubH6PrQ_1787060108 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 17:29:28 +0400 Subject: [PATCH v3 62/74] qdev: convert system PropertyInfo definitions to use qapi_type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-62-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=16434; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=4Bo/cyQSFiYV2QeJZcz34wORXEtPo4YqPhxF9F/nwuo=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhF9zvlJJ82ZfFXTW9vcvo9MbMKz3PrGbQYOGA RfMQgarA3qJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoRfcwAKCRDa6OEJdZac 5UC8D/0fsmMVVH+NxUx/0nFh+IhAc+wFli9OHNmMuD/Mu8uXBvFzv7bW4W2TmFTPZFiLPq5dOEt oB2Jy4nJ9hXMkirMeyMdseCSs49giypGQLykd5L6fn7Yhu8MraNh7G+w7lM607W1w44xvzlnxNg jXNoBOT8Wp4SIgt8WnXGEkPV/mlbty7RyApgs7Ztn3OG5T3UrWVCVAhWfdbDSHSkojZ/xI4FbEy DBygmiviXb2z1+he9Cq+G5B4IcyioVNQft2p3nJ/VAptZIbL2KpNCT1X39h/iISjTYbDsJ04Buc Tl+LTCwaqnTefx8pN5ER+mmllCCv33kUFO5ksO3+iAbQoBtHHzNEci5GBJGAtUtIz+4qv0aNh2d ivv1bHm8K8gAy7pk/eDD7ewNWeqAwV/C1cxRU3wGS4EDnsNJls9OC5Rra6ySlxWcBAy7WB2x1Fu u4XxUpav80o+ihC5mkkngvtFFmgxYZDTMRs+INslpOZ7qsxqubTkFBzSvktVwjel2QpB15djNBX fL1Nb1rRZ3qsAUAq8re6OIrqRmN6fqX5TWxo7M05olTwMTsI6BNEaAwuDpnSfA1uzcScVg7fGNT 7DrKTg5cW+5tuCNnWRDRChiX4vq/Vwc8D4FKicmsJT+Q4MQmcfh8eag2kxyvG73u3yrWrGI5l7Z MdWEemjRx0a+OPQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787060137336158500 Replace .type string and .enum_table pointer with .qapi_type in all PropertyInfo definitions in qdev-properties-system.c Update file-private enum accessor functions to use .qapi_type->lookup instead of .enum_table. Note, this should be a faithful conversion, but it would be worth to consider better types than just "str" for references (block node names, chardev/netdev IDs, MAC addrs, etc) Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-prop-internal.h | 2 + hw/core/qdev-properties-system.c | 93 +++++++++++++++++-------------------= ---- hw/core/qdev-properties.c | 2 +- 3 files changed, 43 insertions(+), 54 deletions(-) diff --git a/hw/core/qdev-prop-internal.h b/hw/core/qdev-prop-internal.h index d7b77844fe0b..c190b7b88cf4 100644 --- a/hw/core/qdev-prop-internal.h +++ b/hw/core/qdev-prop-internal.h @@ -8,6 +8,8 @@ #ifndef HW_CORE_QDEV_PROP_INTERNAL_H #define HW_CORE_QDEV_PROP_INTERNAL_H =20 +const QEnumLookup *qdev_propinfo_enum_lookup(const PropertyInfo *info); + void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp); void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name, diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 3381de1144d6..8819a9a0b748 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -27,6 +27,7 @@ #include "qemu/uuid.h" #include "qemu/error-report.h" #include "qdev-prop-internal.h" +#include "qapi/qapi-type-infos.h" =20 #include "qemu/audio.h" #include "chardev/char-fe.h" @@ -238,7 +239,7 @@ static void release_drive(Object *obj, const char *name= , void *opaque) } =20 const PropertyInfo qdev_prop_drive =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Node name or ID of a block device to use as a backen= d", .realized_set_allowed =3D true, .get =3D get_drive, @@ -247,7 +248,7 @@ const PropertyInfo qdev_prop_drive =3D { }; =20 const PropertyInfo qdev_prop_drive_iothread =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Node name or ID of a block device to use as a backen= d", .realized_set_allowed =3D true, .get =3D get_drive, @@ -315,7 +316,7 @@ static void release_chr(Object *obj, const char *name, = void *opaque) } =20 const PropertyInfo qdev_prop_chr =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "ID of a chardev to use as a backend", .get =3D get_chr, .set =3D set_chr, @@ -389,7 +390,7 @@ inval: } =20 const PropertyInfo qdev_prop_macaddr =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Ethernet 6-byte MAC Address, example: 52:54:00:12:34= :56", .get =3D get_mac, .set =3D set_mac, @@ -477,7 +478,7 @@ out: } =20 const PropertyInfo qdev_prop_netdev =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "ID of a netdev to use as a backend", .get =3D get_netdev, .set =3D set_netdev, @@ -514,7 +515,7 @@ static void set_audiodev(Object *obj, Visitor *v, const= char* name, } =20 const PropertyInfo qdev_prop_audiodev =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "ID of an audiodev to use as a backend", /* release done on shutdown */ .get =3D get_audiodev, @@ -584,7 +585,8 @@ static void qdev_propinfo_set_losttickpolicy(Object *ob= j, Visitor *v, int *ptr =3D object_field_prop_ptr(obj, prop); int value; =20 - if (!visit_type_enum(v, name, &value, prop->info->enum_table, errp)) { + if (!visit_type_enum(v, name, &value, + qdev_propinfo_enum_lookup(prop->info), errp)) { return; } =20 @@ -604,9 +606,8 @@ static void qdev_propinfo_set_losttickpolicy(Object *ob= j, Visitor *v, QEMU_BUILD_BUG_ON(sizeof(LostTickPolicy) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_losttickpolicy =3D { - .type =3D "LostTickPolicy", + .qapi_type =3D &LostTickPolicy_type_info, .description =3D "Policy for handling lost ticks (discard/delay/slew)", - .enum_table =3D &LostTickPolicy_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_losttickpolicy, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -631,7 +632,7 @@ static void set_blocksize(Object *obj, Visitor *v, cons= t char *name, } =20 const PropertyInfo qdev_prop_blocksize =3D { - .type =3D "size", + .qapi_type =3D &size_type_info, .description =3D "A power of two between " MIN_BLOCK_SIZE_STR " and " MAX_BLOCK_SIZE_STR, .get =3D qdev_propinfo_get_size32, @@ -644,9 +645,8 @@ const PropertyInfo qdev_prop_blocksize =3D { QEMU_BUILD_BUG_ON(sizeof(BlockdevOnError) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_blockdev_on_error =3D { - .type =3D "BlockdevOnError", + .qapi_type =3D &BlockdevOnError_type_info, .description =3D "Error handling policy (report/ignore/enospc/stop/aut= o)", - .enum_table =3D &BlockdevOnError_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -657,10 +657,9 @@ const PropertyInfo qdev_prop_blockdev_on_error =3D { QEMU_BUILD_BUG_ON(sizeof(BiosAtaTranslation) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_bios_chs_trans =3D { - .type =3D "BiosAtaTranslation", + .qapi_type =3D &BiosAtaTranslation_type_info, .description =3D "Logical CHS translation algorithm " " (auto/none/lba/large/rechs)", - .enum_table =3D &BiosAtaTranslation_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -669,9 +668,8 @@ const PropertyInfo qdev_prop_bios_chs_trans =3D { /* --- FDC default drive types */ =20 const PropertyInfo qdev_prop_fdc_drive_type =3D { - .type =3D "FloppyDriveType", + .qapi_type =3D &FloppyDriveType_type_info, .description =3D "Floppy drive type (144/288/120/none/auto)", - .enum_table =3D &FloppyDriveType_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -680,10 +678,9 @@ const PropertyInfo qdev_prop_fdc_drive_type =3D { /* --- MultiFDCompression --- */ =20 const PropertyInfo qdev_prop_multifd_compression =3D { - .type =3D "MultiFDCompression", + .qapi_type =3D &MultiFDCompression_type_info, .description =3D "multifd compression method" " (none/zlib/zstd/qpl/uadk/qatzip)", - .enum_table =3D &MultiFDCompression_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -694,9 +691,8 @@ const PropertyInfo qdev_prop_multifd_compression =3D { QEMU_BUILD_BUG_ON(sizeof(MigMode) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_mig_mode =3D { - .type =3D "MigMode", + .qapi_type =3D &MigMode_type_info, .description =3D "Migration mode (normal/cpr-reboot)", - .enum_table =3D &MigMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -707,18 +703,16 @@ const PropertyInfo qdev_prop_mig_mode =3D { QEMU_BUILD_BUG_ON(sizeof(GranuleMode) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_granule_mode =3D { - .type =3D "GranuleMode", + .qapi_type =3D &GranuleMode_type_info, .description =3D "Granule page size (4k/8k/16k/64k/host)", - .enum_table =3D &GranuleMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, }; =20 const PropertyInfo qdev_prop_zero_page_detection =3D { - .type =3D "ZeroPageDetection", + .qapi_type =3D &ZeroPageDetection_type_info, .description =3D "Zero page detection (none/legacy/multifd)", - .enum_table =3D &ZeroPageDetection_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -729,9 +723,8 @@ const PropertyInfo qdev_prop_zero_page_detection =3D { QEMU_BUILD_BUG_ON(sizeof(SsidSizeMode) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_ssidsize_mode =3D { - .type =3D "SsidSizeMode", + .qapi_type =3D &SsidSizeMode_type_info, .description =3D "ssidsize mode: auto, 0-20", - .enum_table =3D &SsidSizeMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -742,9 +735,8 @@ const PropertyInfo qdev_prop_ssidsize_mode =3D { QEMU_BUILD_BUG_ON(sizeof(OasMode) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_oas_mode =3D { - .type =3D "OasMode", + .qapi_type =3D &OasMode_type_info, .description =3D "oas mode: auto, 32, 36, 40, 42, 44, 48, 52, 56", - .enum_table =3D &OasMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -824,7 +816,7 @@ out: } =20 const PropertyInfo qdev_prop_reserved_region =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Reserved Region, example: 0xFEE00000:0xFEEFFFFF:0", .get =3D get_reserved_region, .set =3D set_reserved_region, @@ -904,8 +896,7 @@ static char *print_pci_devfn(Object *obj, const Propert= y *prop) } =20 const PropertyInfo qdev_prop_pci_devfn =3D { - /* The formatted string accepted by the setter is a CLI convenience. */ - .type =3D "int32", + .qapi_type =3D &int32_type_info, .description =3D "Slot and optional function number, example: 06.0 or = 06", .print =3D print_pci_devfn, .get =3D qdev_propinfo_get_int32, @@ -1011,7 +1002,7 @@ inval: } =20 const PropertyInfo qdev_prop_pci_host_devaddr =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Address (bus:device.function) of " "the host device, example: 04:10.0", .get =3D get_pci_host_devaddr, @@ -1021,9 +1012,8 @@ const PropertyInfo qdev_prop_pci_host_devaddr =3D { /* --- OffAutoPCIBAR off/auto/bar0/bar1/bar2/bar3/bar4/bar5 --- */ =20 const PropertyInfo qdev_prop_off_auto_pcibar =3D { - .type =3D "OffAutoPCIBAR", + .qapi_type =3D &OffAutoPCIBAR_type_info, .description =3D "off/auto/bar0/bar1/bar2/bar3/bar4/bar5", - .enum_table =3D &OffAutoPCIBAR_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1062,7 +1052,8 @@ static void get_prop_pcielinkspeed(Object *obj, Visit= or *v, const char *name, abort(); } =20 - visit_type_enum(v, name, &speed, prop->info->enum_table, errp); + visit_type_enum(v, name, &speed, + qdev_propinfo_enum_lookup(prop->info), errp); } =20 static void set_prop_pcielinkspeed(Object *obj, Visitor *v, const char *na= me, @@ -1072,8 +1063,8 @@ static void set_prop_pcielinkspeed(Object *obj, Visit= or *v, const char *name, PCIExpLinkSpeed *p =3D object_field_prop_ptr(obj, prop); int speed; =20 - if (!visit_type_enum(v, name, &speed, prop->info->enum_table, - errp)) { + if (!visit_type_enum(v, name, &speed, + qdev_propinfo_enum_lookup(prop->info), errp)) { return; } =20 @@ -1103,9 +1094,8 @@ static void set_prop_pcielinkspeed(Object *obj, Visit= or *v, const char *name, } =20 const PropertyInfo qdev_prop_pcie_link_speed =3D { - .type =3D "PCIELinkSpeed", + .qapi_type =3D &PCIELinkSpeed_type_info, .description =3D "2_5/5/8/16/32/64", - .enum_table =3D &PCIELinkSpeed_lookup, .get =3D get_prop_pcielinkspeed, .set =3D set_prop_pcielinkspeed, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1147,7 +1137,8 @@ static void get_prop_pcielinkwidth(Object *obj, Visit= or *v, const char *name, abort(); } =20 - visit_type_enum(v, name, &width, prop->info->enum_table, errp); + visit_type_enum(v, name, &width, + qdev_propinfo_enum_lookup(prop->info), errp); } =20 static void set_prop_pcielinkwidth(Object *obj, Visitor *v, const char *na= me, @@ -1157,8 +1148,8 @@ static void set_prop_pcielinkwidth(Object *obj, Visit= or *v, const char *name, PCIExpLinkWidth *p =3D object_field_prop_ptr(obj, prop); int width; =20 - if (!visit_type_enum(v, name, &width, prop->info->enum_table, - errp)) { + if (!visit_type_enum(v, name, &width, + qdev_propinfo_enum_lookup(prop->info), errp)) { return; } =20 @@ -1191,9 +1182,8 @@ static void set_prop_pcielinkwidth(Object *obj, Visit= or *v, const char *name, } =20 const PropertyInfo qdev_prop_pcie_link_width =3D { - .type =3D "PCIELinkWidth", + .qapi_type =3D &PCIELinkWidth_type_info, .description =3D "1/2/4/8/12/16/32", - .enum_table =3D &PCIELinkWidth_lookup, .get =3D get_prop_pcielinkwidth, .set =3D set_prop_pcielinkwidth, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1241,7 +1231,7 @@ static void set_default_uuid_auto(ObjectProperty *op,= const Property *prop) } =20 const PropertyInfo qdev_prop_uuid =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "UUID (aka GUID) or \"" UUID_VALUE_AUTO "\" for random value (default)", .get =3D get_uuid, @@ -1254,9 +1244,8 @@ const PropertyInfo qdev_prop_uuid =3D { QEMU_BUILD_BUG_ON(sizeof(S390CpuEntitlement) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_cpus390entitlement =3D { - .type =3D "S390CpuEntitlement", + .qapi_type =3D &S390CpuEntitlement_type_info, .description =3D "auto/low/medium/high (default medium)", - .enum_table =3D &S390CpuEntitlement_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1299,7 +1288,7 @@ static void release_iothread_vq_mapping_list(Object *= obj, } =20 const PropertyInfo qdev_prop_iothread_vq_mapping_list =3D { - .type =3D "IOThreadVirtQueueMappingList", + .qapi_type =3D &IOThreadVirtQueueMappingList_type_info, .description =3D "IOThread virtqueue mapping list [{\"iothread\":\"\", " "\"vqs\":[1,2,3,...]},...]", .get =3D get_iothread_vq_mapping_list, @@ -1310,18 +1299,16 @@ const PropertyInfo qdev_prop_iothread_vq_mapping_li= st =3D { /* --- Endian modes */ =20 const PropertyInfo qdev_prop_endian_mode =3D { - .type =3D "EndianMode", + .qapi_type =3D &EndianMode_type_info, .description =3D "Endian mode, big/little/unspecified", - .enum_table =3D &EndianMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, }; =20 const PropertyInfo qdev_prop_vmapple_virtio_blk_variant =3D { - .type =3D "VMAppleVirtioBlkVariant", + .qapi_type =3D &VMAppleVirtioBlkVariant_type_info, .description =3D "unspecified/root/aux", - .enum_table =3D &VMAppleVirtioBlkVariant_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1364,7 +1351,7 @@ static void release_virtio_gpu_output_list(Object *ob= j, } =20 const PropertyInfo qdev_prop_virtio_gpu_output_list =3D { - .type =3D "VirtIOGPUOutputList", + .qapi_type =3D &VirtIOGPUOutputList_type_info, .description =3D "VirtIO GPU output list [{\"name\":\"\"},...]", .get =3D get_virtio_gpu_output_list, .set =3D set_virtio_gpu_output_list, diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index e924b040687b..c2980c36afa2 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.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1787060166; cv=none; d=zohomail.com; s=zohoarc; b=DL/FCUph5+/D/Qz0VJSO9x7/BRLalOLq0xag4UDvrYe+O/S40oWfmhAqtN46p/SUZ7BwyssFKqr2vsNT5Bgbhj2k6O6recyql6Y+2kA4EZAAYW3zsAdCrRL3RQc/qoeGpvfmX06y8ajWnPOmZEbDh5fJ5amII2gvdpLGg9H1iIM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787060166; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NcMcfYcJnP5pSepZPUlbKT/IGaqv3YNUpR9si4mBH+Q=; b=QXXSaz6UKB9Z+W8U8ga0RY1N1bqRwOt5yU4eGd9DZsW4pb8h8otVeOZ8Mx3woVpxny6pEijo5j+tI4pUVjNn9W8e+LlXwLASvpNkpGTqzkkxFq71yY2DOHmEK1Rn0qyRrb+h8xMSxMjfvkkDZT+MbMLNfIjguHHuSq309kficzU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1787060166804632.9034410768571; Tue, 18 Aug 2026 06:36:06 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1394183.1633019 (Exim 4.92) (envelope-from ) id 1wwJyc-0007lG-Px; Tue, 18 Aug 2026 13:35:38 +0000 Received: by outflank-mailman (output) from mailman id 1394183.1633019; Tue, 18 Aug 2026 13:35:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wwJyc-0007l9-Lc; Tue, 18 Aug 2026 13:35:38 +0000 Received: by outflank-mailman (input) for mailman id 1394183; Tue, 18 Aug 2026 13:35:37 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wwJyb-0007l3-Hx for xen-devel@lists.xenproject.org; Tue, 18 Aug 2026 13:35:37 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wwJya-00Bppu-Uh for xen-devel@lists.xenproject.org; Tue, 18 Aug 2026 15:35:36 +0200 Received: from [10.42.69.5] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a845fa8-e002-0a2a0a5209dd-0a2a45058bcc-0 for ; Tue, 18 Aug 2026 15:35:36 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a845fa7-4cb1-0a2a45050019-aa0a817cdb97-3 for ; Tue, 18 Aug 2026 15:35:36 +0200 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-655-0LsnsvebM_iuqnqKt0D47w-1; Tue, 18 Aug 2026 09:35:21 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2A1FC18011C5; Tue, 18 Aug 2026 13:35:14 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D3927180034F; Tue, 18 Aug 2026 13:35:10 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787060135; 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=NcMcfYcJnP5pSepZPUlbKT/IGaqv3YNUpR9si4mBH+Q=; b=UsgJ3vcDg/jEc6Kj6D4UGh+sCDOXeYpgxSAkwBmWKQ41ToaP8lJgQ9Xhd1vo46Jk+sCc0t hZ7kLwxdH2NlhQgVerTB6lQ1hXJXUnHGw7aQqTjYOHh1YsHtva/Z2S7y2ricPgCZDHlXan ZolPkL8MhmOaKx2IocDUemZgQvh/yYQ= X-MC-Unique: 0LsnsvebM_iuqnqKt0D47w-1 X-Mimecast-MFC-AGG-ID: 0LsnsvebM_iuqnqKt0D47w_1787060115 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 17:29:29 +0400 Subject: [PATCH v3 63/74] hw: convert device-local PropertyInfo definitions to use qapi_type MIME-Version: 1.0 Message-Id: <20260818-qom-qapi-v3-63-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefano Stabellini , Anthony PERARD , "Edgar E. Iglesias" , Kevin Wolf , Hanna Reitz , Phil Dennis-Jordan , Alistair Francis , Peter Maydell , Keith Busch , Klaus Jensen , Jesper Devantier , "Michael S. Tsirkin" , Halil Pasic , Christian Borntraeger , Eric Farman , Farhan Ali , Matthew Rosato , Cornelia Huck , Richard Henderson , Ilya Leoshkevich , David Hildenbrand , Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-s390x@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=8761; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=M1ZK58SCDRwPvhT0ecKJ8jMYH52yLNqHGDUugt8emrA=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhF9z4CkZw2HKM6dzp+UwaFJyFhTU2u5rvrSYf BXDoaKYjlqJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoRfcwAKCRDa6OEJdZac 5TOdD/0Q9eYTxC1cXJssQBTteyZwUW7EKCWsS/xXRovKEx+Kktno7QRX7UT2fLJQQIvHlkwM+LH lTxEFpG1pm45KOEQgHwxUP2e7clXlV5ri74lCFTIsYgXuM0wWqJ9FUXZNpM03icIJeVql1Bev9w VcgWpRv8aeBjn0jRvYSyA1qY+nRfUd8KT9SR/9elfGTCFA2LWnu1iFDi2pm42I6+PGmdUrDIn9L eBxdg5XNFKSYJ6iuNNFyc+wn4CAgXD6t4SF1c7YbZPUMEahGoXHtNN7Dyh55F1kmPAPJXlU60Ly QNs7ECUtW+o7mOC+7c07FYFgZGwAtXzgZRP1qrYFaBq3rkNvWTDHz4YIE6HN8n3WzLm0HjJJaLJ /xG/hOfgKpwiEYKhsyZnaWRAugrzFMy3HuAjXNzenokQYpPZbEbbEkcX7ThHth5w/+BBs/53IF1 oMoicdK6lxhlpRpcARnNOH2vgZhUcgQj914/RpTsKKBceYwvG3/w5JRf3nBRlDrsXahjo9BenyA Q+theYaAaOmLZ9BBDU9bKh6U5pOZOaWGiQiDEIO+hc0dQXibHwJmO/NvuUDtDO2VwR8GWGaym9B 2tiD5+1HFd7vv5FAdTQR3sdBm0q2neoHk9GwmWJARYpW9nEOxJUx180AQ9xYvW0vr+PRvMknpHD 0URkHEcRSEyYjmQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-MFC-PROC-ID: whWz0eEuS4WCv6OXIQ8Vz9HeXyeCINJahOT99l2Qw-M_1787060115 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-c201ff/1787060136-F48A62A1-FCE76BB9/0/0 X-purgate-type: clean X-purgate-size: 8763 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787060167656158501 Mechanical conversion of PropertyInfo definitions in device-specific files, replacing .type string with .qapi_type pointer to the corresponding QAPITypeInfo. Except "display_mode" for apple-gfx, which is a string of a specific format. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/block/xen-block.c | 3 ++- hw/display/apple-gfx.m | 3 ++- hw/misc/xlnx-versal-trng.c | 3 ++- hw/nvme/nguid.c | 3 ++- hw/nvram/xlnx-bbram.c | 3 ++- hw/nvram/xlnx-efuse.c | 3 ++- hw/pci/pci.c | 3 ++- hw/s390x/ccw-device.c | 3 ++- hw/s390x/css.c | 5 +++-- hw/s390x/s390-pci-bus.c | 3 ++- hw/vfio/pci-quirks.c | 3 ++- 11 files changed, 23 insertions(+), 12 deletions(-) diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c index 474c12fe4ac8..d9721c565c5f 100644 --- a/hw/block/xen-block.c +++ b/hw/block/xen-block.c @@ -29,6 +29,7 @@ #include "dataplane/xen-block.h" #include "hw/xen/interface/io/xs_wire.h" #include "trace.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #define XVDA_MAJOR 202 #define XVDQ_MAJOR (1 << 20) @@ -663,7 +664,7 @@ invalid: * https://xenbits.xen.org/docs/unstable/man/xen-vbd-interface.7.html */ static const PropertyInfo xen_block_prop_vdev =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Virtual Disk specifier (d*p*/xvd*/hd*/sd*)", .get =3D xen_block_get_vdev, .set =3D xen_block_set_vdev, diff --git a/hw/display/apple-gfx.m b/hw/display/apple-gfx.m index be0061b9db25..77c420b30006 100644 --- a/hw/display/apple-gfx.m +++ b/hw/display/apple-gfx.m @@ -15,6 +15,7 @@ #include "qemu/lockable.h" #include "qemu/cutils.h" #include "qemu/log.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qapi/error.h" #include "qemu/aio-wait.h" @@ -871,7 +872,7 @@ static void apple_gfx_set_display_mode(Object *obj, Vis= itor *v, } =20 const PropertyInfo qdev_prop_apple_gfx_display_mode =3D { - .type =3D "display_mode", + .qapi_type =3D &str_type_info, .description =3D "Display mode in pixels and Hertz, as x@ " "Example: 3840x2160@60", diff --git a/hw/misc/xlnx-versal-trng.c b/hw/misc/xlnx-versal-trng.c index 0584ee089e3c..97bd3c3f8475 100644 --- a/hw/misc/xlnx-versal-trng.c +++ b/hw/misc/xlnx-versal-trng.c @@ -36,6 +36,7 @@ #include "qapi/visitor.h" #include "migration/vmstate.h" #include "hw/core/qdev-properties.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #ifndef XLNX_VERSAL_TRNG_ERR_DEBUG #define XLNX_VERSAL_TRNG_ERR_DEBUG 0 @@ -662,7 +663,7 @@ static void trng_prop_fault_event_get(Object *obj, Visi= tor *v, } =20 static const PropertyInfo trng_prop_fault_events =3D { - .type =3D "uint32", + .qapi_type =3D &uint32_type_info, .description =3D "Set to trigger TRNG fault events", .set =3D trng_prop_fault_event_set, .get =3D trng_prop_fault_event_get, diff --git a/hw/nvme/nguid.c b/hw/nvme/nguid.c index 4cd6fad6ac9b..6eaf90fca88e 100644 --- a/hw/nvme/nguid.c +++ b/hw/nvme/nguid.c @@ -18,6 +18,7 @@ #include "qapi/visitor.h" #include "qemu/ctype.h" #include "nvme.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #define NGUID_SEPARATOR '-' =20 @@ -179,7 +180,7 @@ static void set_nguid(Object *obj, Visitor *v, const ch= ar *name, void *opaque, } =20 const PropertyInfo qdev_prop_nguid =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "NGUID or \"" NGUID_VALUE_AUTO "\" for random value", .get =3D get_nguid, diff --git a/hw/nvram/xlnx-bbram.c b/hw/nvram/xlnx-bbram.c index e336874bdef4..eb032ab8b9c8 100644 --- a/hw/nvram/xlnx-bbram.c +++ b/hw/nvram/xlnx-bbram.c @@ -34,6 +34,7 @@ #include "hw/core/qdev-properties.h" #include "hw/core/qdev-properties-system.h" #include "hw/nvram/xlnx-efuse.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #ifndef XLNX_BBRAM_ERR_DEBUG #define XLNX_BBRAM_ERR_DEBUG 0 @@ -486,7 +487,7 @@ static void bbram_prop_release_drive(Object *obj, const= char *name, } =20 static const PropertyInfo bbram_prop_drive =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Node name or ID of a block device to use as BBRAM ba= ckend", .realized_set_allowed =3D true, .get =3D bbram_prop_get_drive, diff --git a/hw/nvram/xlnx-efuse.c b/hw/nvram/xlnx-efuse.c index 03c9fbc0d076..b1c9ee4980a0 100644 --- a/hw/nvram/xlnx-efuse.c +++ b/hw/nvram/xlnx-efuse.c @@ -34,6 +34,7 @@ #include "system/blockdev.h" #include "hw/core/qdev-properties.h" #include "hw/core/qdev-properties-system.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #define TBIT0_OFFSET 28 #define TBIT1_OFFSET 29 @@ -251,7 +252,7 @@ static void efuse_prop_release_drive(Object *obj, const= char *name, } =20 static const PropertyInfo efuse_prop_drive =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Node name or ID of a block device to use as eFUSE ba= ckend", .realized_set_allowed =3D true, .get =3D efuse_prop_get_drive, diff --git a/hw/pci/pci.c b/hw/pci/pci.c index be6145a90a9f..7cfe6032b915 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -52,6 +52,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" @@ -79,7 +80,7 @@ static void prop_pci_busnr_get(Object *obj, Visitor *v, c= onst char *name, } =20 static const PropertyInfo prop_pci_busnr =3D { - .type =3D "uint8", + .qapi_type =3D &uint8_type_info, .get =3D prop_pci_busnr_get, }; =20 diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c index 25c427327957..fd21a4346522 100644 --- a/hw/s390x/ccw-device.c +++ b/hw/s390x/ccw-device.c @@ -17,6 +17,7 @@ #include "qapi/visitor.h" #include "qemu/ctype.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" =20 static void ccw_device_refill_ids(CcwDevice *dev) { @@ -74,7 +75,7 @@ static void ccw_device_set_loadparm(Object *obj, Visitor = *v, } =20 const PropertyInfo ccw_loadparm =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Up to 8 chars in set of [A-Za-z0-9. ] to select" " a guest kernel", .get =3D ccw_device_get_loadparm, diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 3a67b6705319..152687da7820 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; @@ -2519,7 +2520,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, @@ -2527,7 +2528,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 eff980fdfe92..f77632810b76 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -33,6 +33,7 @@ #include "system/runstate.h" =20 #include "trace.h" +#include "qapi/qapi-builtin-type-infos.h" =20 S390pciState *s390_get_phb(void) { @@ -1541,7 +1542,7 @@ static void s390_pci_set_fid(Object *obj, Visitor *v,= const char *name, } =20 static const PropertyInfo s390_pci_fid_propinfo =3D { - .type =3D "uint32", + .qapi_type =3D &uint32_type_info, .description =3D "zpci_fid", .get =3D s390_pci_get_fid, .set =3D s390_pci_set_fid, diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index c5b4f9091d49..4a3fd374a211 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -26,6 +26,7 @@ #include "pci.h" #include "pci-quirks.h" #include "trace.h" +#include "qapi/qapi-builtin-type-infos.h" =20 /* * List of device ids/vendor ids for which to disable @@ -1436,7 +1437,7 @@ static void set_nv_gpudirect_clique_id(Object *obj, V= isitor *v, } =20 const PropertyInfo qdev_prop_nv_gpudirect_clique =3D { - .type =3D "uint8", + .qapi_type =3D &uint8_type_info, .description =3D "NVIDIA GPUDirect Clique ID (0 - 15)", .get =3D get_nv_gpudirect_clique_id, .set =3D set_nv_gpudirect_clique_id, --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787060293; cv=none; d=zohomail.com; s=zohoarc; b=gUqypdH63s/xsmYsYNvQaxsEObfz3YpSC16xLU2C1pTQTZTljxYmgC9mEbIyA7WeNTP6WG9VyKBSUXiqJAoHzQ9x5cajGAA/4yZqERg9ZkXWh8XXBIUJFWtDXYS29b3J9HI1UoOffkFh2GWd+KXXSScvFPJqMEqOIiKUVKzWha4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787060293; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KcP90JOveGYGun6oJJcYdEjRtcUXrnPo6AGQudaLO1U=; b=FtIUgEb0z24Zo83+92/WRtRR/F2lqZjjUADXpvzJKHevkSYxb2xd5riK/IZxpGZsAQK52trJefJeCYarU5sKM5F4CblCrJLCINJNhdQRMg5RLG/UX4uzYj6Z3H0YVrJ/4zYriiWPAqQyIKn8jHdpaMlyKbd+vFuaJip9NMkT9v8= 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 1787060293214116.48843371696216; Tue, 18 Aug 2026 06:38:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwJye-0006hl-3X; Tue, 18 Aug 2026 09:35:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJyc-0006b4-Bt for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:35:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJya-0000b9-GI for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:35:38 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-601-tIn4V-VnP068aJ6RNWgw4g-1; Tue, 18 Aug 2026 09:35:30 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 830F81955DC1; Tue, 18 Aug 2026 13:35:26 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EEE8C434; Tue, 18 Aug 2026 13:35:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787060135; 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=KcP90JOveGYGun6oJJcYdEjRtcUXrnPo6AGQudaLO1U=; b=f1qDixT3pMLBmVQy4D2LAWApjsDqY9wpcXKwOEOApYmP5+/9wEreAqlrNffTexz+UkxNt0 yw+1RphdeozL/qrr1rUcEg3fJlw7mOnL69A0itHfQdsNA+ESYvkyR5FgZqtnwTKgFtnCmQ wfHs6HJKtwZiAN/aYONzNlEfRJS8xls= X-MC-Unique: tIn4V-VnP068aJ6RNWgw4g-1 X-Mimecast-MFC-AGG-ID: tIn4V-VnP068aJ6RNWgw4g_1787060127 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 17:29:30 +0400 Subject: [PATCH v3 64/74] target/riscv: fix incorrect QAPI types and u8 casting MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-64-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alistair Francis , Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=1696; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=dkobR/sb7kIFkme1f+t2YY0mapzjM2VuRmtv0YHZc4Y=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhF9z/mxKriTXxlI9hoyr4dTxPRQG0JUZ/m6Bw ZJv3UUfkDSJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoRfcwAKCRDa6OEJdZac 5ZnMD/9DQW3NVpCu5clFFJ9r5PcGwKr42soaSn59YFoF3vws+G3JokDff/3LC7JUxJxoChdQOsP yyoWwZQ2ho37s85P/giLNrF/IGAqjh279Q5zPqdWBiuGGQZFysGCzbSUH4jq37T/uv8K9cW22uo rBpl1H0/9DZd6CwZYhZgCZYkneuyul5cWLWeb6oVFk1r0uusHf+xOMGWlCI5wB1ZG190JqycZm0 iJkD0yoXsdL6nUhT/IWIr/J/QoN7I6kIR3o3mcbfz1Zvoy5+AJFys6YxdO9WJuq+4hnes23oV8H CSqqrXEuht177ww4z3mv9gffOxEZpvQ+xUsn3lSvKax/GtxFoDazHgRTbYkU1xSu/Olda8AwIbF CAciPJTwDb5WnS2FLHb6mBxz4wkzcNh+A9HEQpdXTHhFXp0GrnFVuSE1+3jiQZBhYtteYbt2nnM yQY4xXA/6UDCqNpjcqrBykWcrF0EcDuC1mwvEm8ae1omf9aZIQ/zudUpNIyux92IZYBc3jVXwyG V5au/H5oH5/I5Jiq8meMSIgrRlDyqTVVWwHQOrqIK7+cMkay6mAUX6ubkMtilUBRmAN7/Scacvq 8qE57OTeH3rdV9sUo9fE0qcsgv9Y+4XAeOCazVItemHiIZHnTJMLgRfCbJUdj9/+yIfyAEi4qFy wPtvb3H1lZt/Zzg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787060294535158500 "pmu_num" is u8, "pmu_mask" is u32, so is "pmp-granularity" Reviewed-by: Alistair Francis Signed-off-by: Marc-Andr=C3=A9 Lureau --- target/riscv/cpu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 6116d6da7685..0c0730f08026 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1598,7 +1598,7 @@ static void prop_pmu_num_get(Object *obj, Visitor *v,= const char *name, } =20 static const PropertyInfo prop_pmu_num =3D { - .type =3D "int8", + .type =3D "uint8", .description =3D "pmu-num", .get =3D prop_pmu_num_get, .set =3D prop_pmu_num_set, @@ -1634,13 +1634,13 @@ static void prop_pmu_mask_set(Object *obj, Visitor = *v, const char *name, static void prop_pmu_mask_get(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { - uint8_t pmu_mask =3D RISCV_CPU(obj)->cfg.pmu_mask; + uint32_t pmu_mask =3D RISCV_CPU(obj)->cfg.pmu_mask; =20 - visit_type_uint8(v, name, &pmu_mask, errp); + visit_type_uint32(v, name, &pmu_mask, errp); } =20 static const PropertyInfo prop_pmu_mask =3D { - .type =3D "int8", + .type =3D "uint32", .description =3D "pmu-mask", .get =3D prop_pmu_mask_get, .set =3D prop_pmu_mask_set, @@ -1783,6 +1783,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", .description =3D "pmp-granularity", .get =3D prop_pmp_granularity_get, .set =3D prop_pmp_granularity_set, --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787060393; cv=none; d=zohomail.com; s=zohoarc; b=ewUm/KJDCUhJHrNuBPPl4wbb7lKgcV0ONVxBqVWp2XiCRe8Lqd5lGE+RweIsfgAsEpZhe4F0bqJWXMEx92JPVp+WjsSzSGOfK10XeQyLKpnQ8O+IPZlbluwfeZPBScQt1beYCIi2nfGAMh0gL2nXiYKGWipGKSe8b4iD+75X5R8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787060393; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+ehqD/PDGKvvrUvq4xzQ/yZJoPOu9bHBHzLO+Hsg0fY=; b=hods62JPXz1YltLDLQ81u3JxoSacIgBtDiLHBqHa8/TFlcczz3SIwQSsFA067MfBdg2d9WZLp/DG5Jk3yUdHhjNiglMQKbXVwllw1b46hf3b95Py+xSsPPMJQzwac4Wp6UgbRc6nTfCoYIZQBlO69U1F1zdrqA9B4p+g36BTfQM= 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 1787060393104838.3515567082003; Tue, 18 Aug 2026 06:39:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwJym-0006k2-FW; Tue, 18 Aug 2026 09:35:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJyk-0006jb-JH for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:35:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJyi-0000cx-TY for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:35:46 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-384-xt9Ilbt3NDKT4UA1mPJdoQ-1; Tue, 18 Aug 2026 09:35:40 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7090C18009D0; Tue, 18 Aug 2026 13:35:37 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 48289423; Tue, 18 Aug 2026 13:35:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787060144; 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=+ehqD/PDGKvvrUvq4xzQ/yZJoPOu9bHBHzLO+Hsg0fY=; b=CU/8XVFPKVYZNFM7VpVSt/d6Ng8wRqgN4Vf02Shxv9IOxHQD5UeB/WhOzV4m8rD2XNML6g ZKTscZ3GVnH6RlI2ZVlIJNvPiPGxhgUPMEi7jROw+im5D3q73yAaFyODu70l4v0vFcVnBZ HLSUbDV50zY2yhzc52XCEpNhawlZRwY= X-MC-Unique: xt9Ilbt3NDKT4UA1mPJdoQ-1 X-Mimecast-MFC-AGG-ID: xt9Ilbt3NDKT4UA1mPJdoQ_1787060137 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 17:29:31 +0400 Subject: [PATCH v3 65/74] target/riscv: convert PropertyInfo definitions to use qapi_type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-65-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=5376; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=hRQ8Rl96kKWFMr1wn1Vk/W1lY/vdJO3cmW0CSkOCSEI=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhF90kub225oYjAANcsTHorcCGmVwpDzyNVK6Q P22rf8f6ZqJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoRfdAAKCRDa6OEJdZac 5c45EACrzNMMFBxAtiO6nQBwlMegKsza/YFd46ldyqyDCquUyR9R0CFRITxc3XTDTmksyU89W52 aICKiuqCTCdEjDEdd/iz9rviWfnTiN4AVVWtxKrSW6bk+Ntx9g9Q7vjF4yEGwJLUQHWOhzxEFkl E5IjScmfsLNFQhgk+Rnl6u9WqN5mQHKh8YvtltGP4t/ZjEjSCM0qjKU73MnEKLOuNcbmxgJhM35 XWlocd+dNV9GZ1Cu1zG1YvOou8C3dC2CABnL/j8FoD2Yf2bGjWicERXlAxeVYLIcIBCUK74eR10 fplUo1mKgdAE/QgF3LCs91wRDHRt19F0HoBEiOa6I6vme6fmLQzkg6gcpfu5+QEBQN60cU5YkAZ 9T91NhRcfbLiH0/hagOFAHKMPTW5IgFoHunqzygX54ESj1zS160BSJP56KdZIb3SSIhEaK9GsGS XY+j+3+2F/VauY4NyJR9aGQyB06PaU5E7HLbM/11OCbns7yU9yojKB9yopbrOubfyzqkwbi1kt1 ph3NkjSZX3sdk11oDDzvizFuwJPpe9g53uZ5BvBaHQWnZyfv3QBcqhDF/zewqk9Mf2/uFsfWG8g S93dJjov03Lww+uLcAuW4+f9bvYIrr/zCRSPxHA4dO+ABf+/JKS4Hc+VPUYiK/q2nfH5QIEcaS9 5hXSu3DCY241BVg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=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: 1787060395380158501 Mechanical conversion of all local PropertyInfo definitions in target/riscv/cpu.c Signed-off-by: Marc-Andr=C3=A9 Lureau --- target/riscv/cpu.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 0c0730f08026..b54ba400fd3c 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1598,7 +1598,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, @@ -1640,7 +1640,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, @@ -1672,7 +1672,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, @@ -1705,7 +1705,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, @@ -1745,7 +1745,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, @@ -1783,7 +1783,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, @@ -1859,7 +1859,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, @@ -1892,7 +1892,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, @@ -1935,7 +1935,7 @@ static void prop_vlen_get(Object *obj, Visitor *v, co= nst char *name, } =20 static const PropertyInfo prop_vlen =3D { - .type =3D "uint16", + .qapi_type =3D &uint16_type_info, .description =3D "vlen", .get =3D prop_vlen_get, .set =3D prop_vlen_set, @@ -1976,7 +1976,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, @@ -2012,7 +2012,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, @@ -2048,7 +2048,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, @@ -2084,7 +2084,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, @@ -2120,7 +2120,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, @@ -2156,7 +2156,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, @@ -2213,7 +2213,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.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787060190; cv=none; d=zohomail.com; s=zohoarc; b=FATuR+wtrs3QSqJfybWxU+5MJffEGMl34Pg9TC1gbMgxRVSEggqng14AuT6MqumxIlDTss6QBg0YDLeHzIDBLHFeYYP+CRtZbxePwukzxKcxXDms2L+xGw2jU+cp0LeKcrjByiLhKldS7INONoDn+325W4tMoomI9JtBoZMybEQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787060190; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WWtT2FBu8fU/f+8cfPqP3BZp2M4SRwV/1kiMbq49xMA=; b=Z/9djXf2loY4DHkTQB71+55R9Q1zGKAzNkuHOKxlnbayAWOfWPRsPSc23ghFNAVuzxxkG0SbvhWaemIfd+G6fzZbAdROa115GfCeAxqMMLvNe8kYwbf0mt/ztLtDSBMUrN3LuqpeIlA7zkN8YssjxJyKbaXNJ4obUEwHv+S0dw8= 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 1787060190524369.4287749097293; Tue, 18 Aug 2026 06:36:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwJzC-00077G-BC; Tue, 18 Aug 2026 09:36:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJz0-0006so-Nx for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:36:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJyy-0000ef-VO for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:36:02 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-486-vwm8c_TFN1iQuwylgYd5gQ-1; Tue, 18 Aug 2026 09:35:55 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EC3691800642; Tue, 18 Aug 2026 13:35:50 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6EB79180034C; Tue, 18 Aug 2026 13:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787060160; 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=WWtT2FBu8fU/f+8cfPqP3BZp2M4SRwV/1kiMbq49xMA=; b=QdjW1T9KoUkhWPJrdsyQVI3xEyU/1gBBA9wbSw8g4YAsrLneLztHqudqWGPHJBa7nWZHgN O4NNv+5I2SAUYZffgGvVgcEP4BabyBZseaJNhJpHML/eCh4eSihiRKdQtkakjnNGmuFJtB FM+iQWY0liULQgYB3bJCLef0qh8dBBg= X-MC-Unique: vwm8c_TFN1iQuwylgYd5gQ-1 X-Mimecast-MFC-AGG-ID: vwm8c_TFN1iQuwylgYd5gQ_1787060153 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 17:29:32 +0400 Subject: [PATCH v3 66/74] qdev: convert PropertyInfo definitions to use qapi_type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-66-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alistair Francis , Tao Tang , Stefan Berger , Peter Xu , Fabiano Rosas , Mark Cave-Ayland , Artyom Tarasenko X-Developer-Signature: v=1; a=openpgp-sha256; l=3558; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=ka7csaCetuiG0h2fD1YQn/AGpCVbXaLLIGetqL2rt/I=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhF90JSY+R9wfF4OcwF1Rn1KL2BUt4qm4vGFVL MLIj50JkH2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoRfdAAKCRDa6OEJdZac 5Q/1D/9tD7ItCNsPju0Ep3SnB3MM3SxXkj1M6oB4UpBv0zTRwCPI1QyI/Woke1RbG3SwQ9EsJ0o WK2n+ZkykZT0x/ILzjRZLfEISAdfiKlU8fRPuGSLwF7bo0wJyzFWbuCfxaO+4YNAoFblbru9eHD 70MtZrgQeBUWXAp6p6TrAIwbsDOjYrNorhlcS1kr7TF65C4ApZ0hpVKvgZbQhujUncGJY7BmWWA wtePL7s/zDiZsSMfW6S0VmYWsOu2FYB1g/sH8tXBUwJh6LRbGv2P3biJlyNXHhnQ7r0KY0sm+6l l2I9qxrn17B261sspe27tfg9m3yArLDYqFp1LYav0PzZi5qkqc7B8xCzNdvYuriIKSt68BLGt+I rw2IUIUALV2wp/BPGZv2Eq/hcmunCcD+Ddf+YyUGFEJZOco9xGrDEOdiaMZm1mlhd3BCkf2OLWc 9SORTy1nRHjVQyRRlqe4dZss5Uf2dtV4NqkcV5HfdyN284bKgeRb5dkDA9UP6iNdLDjUxz4ANXz 5EyfDCup7eDUBO+6I1XxFZrBGKdB/N4c6/gb3birj/VM6PPiaw2qJ80Me/5iLzsnePSREAkSg1R TeJNCLWsEGm3FkqdXQRhZAse5xcQAI2eMdtrrGanlUT/quA2WplXsm6SzbLP6WgM4EJ8u0DV8v6 gENmp46ZOuyI2jA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=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: 1787060194087158501 Convert the remaining PropertyInfo definitions outside hw/ After this patch, all PropertyInfo definitions have .qapi_type set, except qdev_prop_link (uses .create) and qdev_prop_array (refactored in the next patches). Signed-off-by: Marc-Andr=C3=A9 Lureau --- backends/spdm-socket.c | 4 ++-- backends/tpm/tpm_util.c | 3 ++- migration/options.c | 4 +++- target/sparc/cpu.c | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/backends/spdm-socket.c b/backends/spdm-socket.c index 826efc276dcd..4a4307975965 100644 --- a/backends/spdm-socket.c +++ b/backends/spdm-socket.c @@ -17,6 +17,7 @@ #include "hw/core/qdev-properties.h" #include "hw/core/qdev-properties-system.h" #include "hw/core/qdev-prop-internal.h" +#include "qapi/qapi-type-infos-sockets.h" =20 static bool read_bytes(const int socket, uint8_t *buffer, size_t number_of_bytes) @@ -253,9 +254,8 @@ void spdm_socket_close(const int socket, SpdmTransportT= ype transport_type) } =20 const PropertyInfo qdev_prop_spdm_trans =3D { - .type =3D "SpdmTransportType", + .qapi_type =3D &SpdmTransportType_type_info, .description =3D "Spdm Transport, doe/nvme/mctp/scsi/unspecified", - .enum_table =3D &SpdmTransportType_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, diff --git a/backends/tpm/tpm_util.c b/backends/tpm/tpm_util.c index 264bff22a91a..ecbc771baa6f 100644 --- a/backends/tpm/tpm_util.c +++ b/backends/tpm/tpm_util.c @@ -30,6 +30,7 @@ #include "system/tpm_backend.h" #include "system/tpm_util.h" #include "trace.h" +#include "qapi/qapi-builtin-type-infos.h" =20 /* tpm backend property */ =20 @@ -77,7 +78,7 @@ static void release_tpm(Object *obj, const char *name, vo= id *opaque) } =20 const PropertyInfo qdev_prop_tpm =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "ID of a tpm to use as a backend", .get =3D get_tpm, .set =3D set_tpm, diff --git a/migration/options.c b/migration/options.c index dfce19405d45..0e6c8d30088e 100644 --- a/migration/options.c +++ b/migration/options.c @@ -31,6 +31,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 @@ -287,7 +289,7 @@ static void set_default_value_tls_opt(ObjectProperty *o= p, const Property *prop) * TYPE_MIGRATION's TLS options. */ const PropertyInfo qdev_prop_StrOrNull =3D { - .type =3D "StrOrNull", + .qapi_type =3D &StrOrNull_type_info, .get =3D get_StrOrNull, .set =3D set_StrOrNull, .release =3D release_StrOrNull, diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 1bc14b586bb9..1581079e4f74 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -30,6 +30,7 @@ #include "tcg/tcg.h" #include "fpu/softfloat.h" #include "target/sparc/translate.h" +#include "qapi/qapi-builtin-type-infos.h" =20 //#define DEBUG_FEATURES =20 @@ -948,7 +949,7 @@ static void sparc_set_nwindows(Object *obj, Visitor *v,= const char *name, } =20 static const PropertyInfo qdev_prop_nwindows =3D { - .type =3D "int", + .qapi_type =3D &int_type_info, .description =3D "Number of register windows", .get =3D sparc_get_nwindows, .set =3D sparc_set_nwindows, --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787060241; cv=none; d=zohomail.com; s=zohoarc; b=Xhm+RHZZ7pOyG12/Apu4FtfcMlfdwjWdcdwbTY1aHE44N8Oh9lzJR3s6umaIsWbd8gmjZ/iRvnQ5WheBv0drIv140sejqJ5I9iQ5Giisv3u1JQrhKJoMcYzq7ROYIKdwuYBJLT9mqqR2beuWYl+GRHxZF4i+1QJnNSL7rjGl1dY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787060241; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7LpeINFUNTZ5koNm091QNo6sDDf+Ig7OOqg3hQ3pSY8=; b=kgcOgXIP7C9VO1OqbEa+xWuIhYydWIDW0vcUQeWLiqBrGwdOsxlacF1l31Xux0kR5kE9j+H7ZmNVPZK8qjWzKlIxiPuBILVtj+Q+zXKf6rx/YV3URu7dVBFyatDYHPJxm5/jGbmGbja8Gxhj1zw1CtPD3isYaTVFove0epl9xI4= 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 1787060240974168.80922239755898; Tue, 18 Aug 2026 06:37:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwJzc-0007ZR-Oz; Tue, 18 Aug 2026 09:36:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJzR-0007Rj-7N for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:36:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJzO-0000jO-4Z for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:36:28 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-212-Vb6me6ruP5qP4J9Ah4neLA-1; Tue, 18 Aug 2026 09:36:22 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B3EA61800D88; Tue, 18 Aug 2026 13:36:20 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B4FCD1953948; Tue, 18 Aug 2026 13:36:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787060185; 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=7LpeINFUNTZ5koNm091QNo6sDDf+Ig7OOqg3hQ3pSY8=; b=MWGC/x+KLvaVS+dCboJmnL2qkHm1gr087U/pQovvMD9w0DGnFowyGkxnKK/bS7644sHLPN /1ECYSAqUiQwBlQv2AxQs2Q9jLW9RGMPRgObsvX3/yHu4C8x107Ukx2OfURaSaQo/msOMF qwtsDVpQgeAyjaEnGso6fF8KHIQXZBg= X-MC-Unique: Vb6me6ruP5qP4J9Ah4neLA-1 X-Mimecast-MFC-AGG-ID: Vb6me6ruP5qP4J9Ah4neLA_1787060180 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 17:29:33 +0400 Subject: [PATCH v3 67/74] qdev: introduce typed array PropertyInfos MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-67-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=14553; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=DNY5OZOHcpCb+SjkUHihp/hTEf88oXTox51j/sLmNQc=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhF90B4LfSu4VFnZX03P4wkiaDdQwaMFQli8a0 pkKdbYNZ5uJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoRfdAAKCRDa6OEJdZac 5ZwGEACxzYGc3Tjg6aOkTUZAiEbAJjDgT8UEZbs81Wa+fAXK5fYYiG4qfXbhLpQC5YT1qnM0THi tXF96DkagUzeWbrbnqQ8SBLDr++47lqgUar7B5M7fSIeYEtpDBU9B+9uoCjVX8ExF9wRNJ4cw5h zcfXKW6D33EknGH1Pl0naSoRnXpB2y4GwGC+9ERt/zWuALZR3yKECDkNk1/Lu8Thp7LyfG6MA17 y6RqlJuzGo83Bh46+y+KsSDXjOrofld4ARFFcGZt7fUbqBKqRn27dLBLOf+YjXZS4qYsl8rVai3 DvGxDFd9R7IKDtCIZycsdiAm+DMa23Pkt3mIAf4uDCKQusKIoezUuy3Twv2dhtrA5d/hG8k/A81 lrMSpgeWvjzu+uTIbMuwbHa+Vu+bL22hfqeXIRMrE0Lmm1gCQk0xSi3s7KEvo+Sm1glYq72XAuO tNoc/CMk3SNLz5qmWZQAO5N4Y6o351AeLnMnZ+Fm3H1qac1kzew5YFs/q2+JjGo5M/qjzuAJtvq I0h0hk/i8cvJtECUWCNDSg9F78LNIvwlbYOJQaje0qXOfrp3LMxXrylxZb0HbK6v9D/jxLdd/0A LQddHYjnhcLQcF4g6PQ5k4OyX+UFDoCCKjSfn/gdpB97/f5dxnxizF/KNoUfyC6WSxp/n7sq0vi OpJ7TS5fXVEnEWA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=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: 1787060242561158500 Add element_info and element_size fields to PropertyInfo, and extend qdev_prop_qapi_type() to derive QAPI types for array properties via element_info->qapi_type->list. Add typed list PropertyInfo definitions that replace the generic qdev_prop_array. Each typed list PropertyInfo knows its element type at compile time through the element_info and element_size fields, which allows the QAPI type to be derived automatically. Infrastructure changes: - Add prop_array_info() and prop_array_elem_size() helpers that prefer the new element_info/element_size fields with fallback to the old arrayinfo/arrayfieldsize fields for compatibility - Make get_prop_array, set_prop_array, release_prop_array, and default_prop_array non-static so they can be used by DEFINE_PROP_ARRAY_INFO in other translation units - Add DEFINE_PROP_ARRAY_INFO macro in qdev-prop-internal.h The array of links needs special care for its "full type name" to follow the "linkList" pattern used by link properties ("link"). The old qdev_prop_array and DEFINE_PROP_ARRAY macro are preserved for compatibility; they will be replaced in the next patch. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-prop-internal.h | 18 ++++++ hw/core/qdev-properties-system.c | 5 ++ hw/core/qdev-properties.c | 103 ++++++++++++++++++++++++---= ---- include/hw/core/qdev-properties-system.h | 2 + include/hw/core/qdev-properties.h | 8 +++ 5 files changed, 115 insertions(+), 21 deletions(-) diff --git a/hw/core/qdev-prop-internal.h b/hw/core/qdev-prop-internal.h index c190b7b88cf4..b9d9812346d1 100644 --- a/hw/core/qdev-prop-internal.h +++ b/hw/core/qdev-prop-internal.h @@ -27,4 +27,22 @@ void qdev_propinfo_get_int32(Object *obj, Visitor *v, co= nst char *name, void qdev_propinfo_get_size32(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp); =20 +void get_prop_array(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp); +void set_prop_array(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp); +void release_prop_array(Object *obj, const char *name, void *opaque); +void default_prop_array(ObjectProperty *op, const Property *prop); + +/* .qapi_type is derived from element_info->qapi_type->list by qdev_prop_q= api_type() */ +#define DEFINE_PROP_ARRAY_INFO(_elem_prop_info, _elem_type) \ + { \ + .element_info =3D &(_elem_prop_info), \ + .element_size =3D sizeof(_elem_type), \ + .get =3D get_prop_array, \ + .set =3D set_prop_array, \ + .release =3D release_prop_array, \ + .set_default_value =3D default_prop_array, \ + } + #endif diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 8819a9a0b748..ad4a00f776e6 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -484,6 +484,8 @@ const PropertyInfo qdev_prop_netdev =3D { .set =3D set_netdev, }; =20 +const PropertyInfo qdev_prop_netdev_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_netdev, NICPeers); =20 /* --- audiodev --- */ static void get_audiodev(Object *obj, Visitor *v, const char* name, @@ -822,6 +824,9 @@ const PropertyInfo qdev_prop_reserved_region =3D { .set =3D set_reserved_region, }; =20 +const PropertyInfo qdev_prop_reserved_region_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_reserved_region, ReservedRegion); + /* --- pci address --- */ =20 /* diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index c2980c36afa2..a9ca8e4a03db 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -665,6 +665,22 @@ struct ArrayElementList { void *value; }; =20 +static const PropertyInfo *prop_array_info(const Property *prop) +{ + if (prop->info->element_info) { + return prop->info->element_info; + } + return prop->arrayinfo; +} + +static int prop_array_elem_size(const Property *prop) +{ + if (prop->info->element_size) { + return prop->info->element_size; + } + return prop->arrayfieldsize; +} + /* * Given an array property @parent_prop in @obj, return a Property for a * specific element of the array. Arrays are backed by an uint32_t length = field @@ -674,7 +690,7 @@ static Property array_elem_prop(Object *obj, const Prop= erty *parent_prop, const char *name, char *elem) { return (Property) { - .info =3D parent_prop->arrayinfo, + .info =3D prop_array_info(parent_prop), .name =3D name, /* * This ugly piece of pointer arithmetic sets up the offset so @@ -692,19 +708,21 @@ static Property array_elem_prop(Object *obj, const Pr= operty *parent_prop, * underlying element's property release hook for each element and free the * property array. */ -static void release_prop_array(Object *obj, const char *name, void *opaque) +void release_prop_array(Object *obj, const char *name, void *opaque) { const Property *prop =3D opaque; uint32_t *alenptr =3D object_field_prop_ptr(obj, prop); void **arrayptr =3D (void *)obj + prop->arrayoffset; char *elem =3D *arrayptr; int i; + const PropertyInfo *elem_info =3D prop_array_info(prop); + int elem_size =3D prop_array_elem_size(prop); =20 - if (prop->arrayinfo->release) { + if (elem_info->release) { for (i =3D 0; i < *alenptr; i++) { Property elem_prop =3D array_elem_prop(obj, prop, name, elem); - prop->arrayinfo->release(obj, NULL, &elem_prop); - elem +=3D prop->arrayfieldsize; + elem_info->release(obj, NULL, &elem_prop); + elem +=3D elem_size; } } =20 @@ -718,8 +736,8 @@ static void release_prop_array(Object *obj, const char = *name, void *opaque) * (a pointer to which is stored in the additional field described by * prop->arrayoffset). */ -static void set_prop_array(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +void set_prop_array(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { ERRP_GUARD(); const Property *prop =3D opaque; @@ -727,6 +745,8 @@ static void set_prop_array(Object *obj, Visitor *v, con= st char *name, void **arrayptr =3D (void *)obj + prop->arrayoffset; ArrayElementList *list, *elem, *next; const size_t size =3D sizeof(*list); + const PropertyInfo *elem_info =3D prop_array_info(prop); + int elem_size =3D prop_array_elem_size(prop); char *elemptr; bool ok =3D true; =20 @@ -745,9 +765,9 @@ static void set_prop_array(Object *obj, Visitor *v, con= st char *name, while (elem) { Property elem_prop; =20 - elem->value =3D g_malloc0(prop->arrayfieldsize); + elem->value =3D g_malloc0(elem_size); elem_prop =3D array_elem_prop(obj, prop, name, elem->value); - prop->arrayinfo->set(obj, v, NULL, &elem_prop, errp); + elem_info->set(obj, v, NULL, &elem_prop, errp); if (*errp) { ok =3D false; goto out_obj; @@ -769,8 +789,8 @@ out_obj: for (elem =3D list; elem; elem =3D next) { Property elem_prop =3D array_elem_prop(obj, prop, name, elem->value); - if (prop->arrayinfo->release) { - prop->arrayinfo->release(obj, NULL, &elem_prop); + if (elem_info->release) { + elem_info->release(obj, NULL, &elem_prop); } next =3D elem->next; g_free(elem->value); @@ -783,19 +803,19 @@ out_obj: * Now that we know how big the array has to be, move the data over to= a * linear array and free the temporary list. */ - *arrayptr =3D g_malloc_n(*alenptr, prop->arrayfieldsize); + *arrayptr =3D g_malloc_n(*alenptr, elem_size); elemptr =3D *arrayptr; for (elem =3D list; elem; elem =3D next) { - memcpy(elemptr, elem->value, prop->arrayfieldsize); - elemptr +=3D prop->arrayfieldsize; + memcpy(elemptr, elem->value, elem_size); + elemptr +=3D elem_size; next =3D elem->next; g_free(elem->value); g_free(elem); } } =20 -static void get_prop_array(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +void get_prop_array(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { ERRP_GUARD(); const Property *prop =3D opaque; @@ -805,6 +825,8 @@ static void get_prop_array(Object *obj, Visitor *v, con= st char *name, ArrayElementList *list =3D NULL, *elem; ArrayElementList **tail =3D &list; const size_t size =3D sizeof(*list); + const PropertyInfo *elem_info =3D prop_array_info(prop); + int elem_size =3D prop_array_elem_size(prop); int i; bool ok; =20 @@ -812,7 +834,7 @@ static void get_prop_array(Object *obj, Visitor *v, con= st char *name, for (i =3D 0; i < *alenptr; i++) { elem =3D g_new0(ArrayElementList, 1); elem->value =3D elemptr; - elemptr +=3D prop->arrayfieldsize; + elemptr +=3D elem_size; =20 *tail =3D elem; tail =3D &elem->next; @@ -825,7 +847,7 @@ static void get_prop_array(Object *obj, Visitor *v, con= st char *name, elem =3D list; while (elem) { Property elem_prop =3D array_elem_prop(obj, prop, name, elem->valu= e); - prop->arrayinfo->get(obj, v, NULL, &elem_prop, errp); + elem_info->get(obj, v, NULL, &elem_prop, errp); if (*errp) { goto out_obj; } @@ -847,7 +869,7 @@ out_obj: } } =20 -static void default_prop_array(ObjectProperty *op, const Property *prop) +void default_prop_array(ObjectProperty *op, const Property *prop) { object_property_set_default_list(op); } @@ -860,6 +882,38 @@ const PropertyInfo qdev_prop_array =3D { .set_default_value =3D default_prop_array, }; =20 +const PropertyInfo qdev_prop_uint8_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint8, uint8_t); +const PropertyInfo qdev_prop_uint16_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint16, uint16_t); +const PropertyInfo qdev_prop_uint32_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint32, uint32_t); +const PropertyInfo qdev_prop_uint64_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint64, uint64_t); +const PropertyInfo qdev_prop_string_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_string, char *); + +static ObjectProperty *create_link_list_property(ObjectClass *oc, + const char *name, + const Property *prop) +{ + g_autofree char *full_type =3D g_strdup_printf("link<%s>List", prop->l= ink_type); + + return object_class_property_add(oc, name, full_type, + get_prop_array, set_prop_array, + release_prop_array, (Property *)prop); +} + +const PropertyInfo qdev_prop_link_list =3D { + .element_info =3D &qdev_prop_link, + .element_size =3D sizeof(void *), + .create =3D create_link_list_property, + .get =3D get_prop_array, + .set =3D set_prop_array, + .release =3D release_prop_array, + .set_default_value =3D default_prop_array, +}; + /* --- public helpers --- */ =20 static const Property *qdev_prop_walk(DeviceClass *cls, const char *name) @@ -1158,8 +1212,15 @@ const PropertyInfo qdev_prop_link =3D { =20 static const QAPITypeInfo *qdev_prop_qapi_type(const Property *prop) { - /* this will be later extended to cope with QAPI array properties */ - return prop->info->qapi_type; + if (prop->info->qapi_type) { + return prop->info->qapi_type; + } + if (prop->info->element_info) { + assert(prop->info->element_info->qapi_type); + assert(prop->info->element_info->qapi_type->list); + return prop->info->element_info->qapi_type->list; + } + return NULL; } =20 void qdev_property_add_static(DeviceState *dev, const Property *prop) diff --git a/include/hw/core/qdev-properties-system.h b/include/hw/core/qde= v-properties-system.h index 2cbea16d615e..819dce7d5e5d 100644 --- a/include/hw/core/qdev-properties-system.h +++ b/include/hw/core/qdev-properties-system.h @@ -23,6 +23,8 @@ extern const PropertyInfo qdev_prop_fdc_drive_type; extern const PropertyInfo qdev_prop_drive; extern const PropertyInfo qdev_prop_drive_iothread; extern const PropertyInfo qdev_prop_netdev; +extern const PropertyInfo qdev_prop_netdev_list; +extern const PropertyInfo qdev_prop_reserved_region_list; extern const PropertyInfo qdev_prop_pci_devfn; extern const PropertyInfo qdev_prop_blocksize; extern const PropertyInfo qdev_prop_pci_host_devaddr; diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-prope= rties.h index 1ea2ba66bb37..0c067170079d 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -35,6 +35,8 @@ struct PropertyInfo { const char *description; const QEnumLookup *enum_table; const QAPITypeInfo *qapi_type; + const struct PropertyInfo *element_info; + int element_size; bool realized_set_allowed; /* allow setting property on realized devic= e */ char *(*print)(Object *obj, const Property *prop); void (*set_default_value)(ObjectProperty *op, const Property *prop); @@ -75,7 +77,13 @@ extern const PropertyInfo qdev_prop_string; extern const PropertyInfo qdev_prop_on_off_auto; extern const PropertyInfo qdev_prop_size32; extern const PropertyInfo qdev_prop_array; +extern const PropertyInfo qdev_prop_uint8_list; +extern const PropertyInfo qdev_prop_uint16_list; +extern const PropertyInfo qdev_prop_uint32_list; +extern const PropertyInfo qdev_prop_uint64_list; +extern const PropertyInfo qdev_prop_string_list; extern const PropertyInfo qdev_prop_link; +extern const PropertyInfo qdev_prop_link_list; =20 #define DEFINE_PROP(_name, _state, _field, _prop, _type, ...) { \ .name =3D (_name), \ --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787060284; cv=none; d=zohomail.com; s=zohoarc; b=WCK1ZmSJp+LIcarqExgLt8uSISmgv8++vG4aa16pLR7zrKNB1geOvOigc51PoUW0ZXBs9M4FCgnGfuwrAqLOrb1p0soN+xc1bf2oClv0LFFf3y2umKHK3SAjQbbfEIN2dQfgU5ZY51a0pwKTNegLROyTg9ao7A9zRDNOU1jYk+E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787060284; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zZa2wZhOBG8+2TMlvXOdLq9v5ancgW2V56AmVy49/Vs=; b=hjB7Cu1u8DBYoSJSrbKOsz0NMykeHm/7sjiSWr4B0m9WxTtZ9+3WVN2vK9osOLTqqAN+7mSlPPgjFn30WKu4JK1Egqk10urCqR38rhtNz5DLxDRaggmKejrNzREWiBPVWj8ILeJTm3l8AmGAIW9nx/DdHRnpMOdvNMcfkLnOCQU= 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 1787060284347970.7226459886701; Tue, 18 Aug 2026 06:38:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwK0B-0008Nk-V4; Tue, 18 Aug 2026 09:37:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwK00-0007wv-Ow for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:37:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJzy-0000m3-CA for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:37:04 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-637-ndM5C94eNQ6HQsNNknwCRg-1; Tue, 18 Aug 2026 09:36:45 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 051A61800C32; Tue, 18 Aug 2026 13:36:40 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 474541800346; Tue, 18 Aug 2026 13:36:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787060221; 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=zZa2wZhOBG8+2TMlvXOdLq9v5ancgW2V56AmVy49/Vs=; b=QfomRiPDINv4/JxLNU1AOxMxpHbnuIGbi8HSxiGw5gGB9OskJKstG+rQctTt/RqOztlAo3 YSlyNttx69PQ11n8dmhLq5djE0yIdWeVB1ZJOYu7SAAYDF2irUF3zh11iQT+B/AW6VEUlc PHy5PjisjSFFXp05zpGCZZOFiZUVOo8= X-MC-Unique: ndM5C94eNQ6HQsNNknwCRg-1 X-Mimecast-MFC-AGG-ID: ndM5C94eNQ6HQsNNknwCRg_1787060200 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 17:29:34 +0400 Subject: [PATCH v3 68/74] qdev: simplify DEFINE_PROP_ARRAY and remove generic array PropertyInfo MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-68-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Phil Dennis-Jordan , Peter Maydell , Yoshinori Sato , Jiri Pirko , Jason Wang , "Michael S. Tsirkin" , Alistair Francis , "Edgar E. Iglesias" , Palmer Dabbelt , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , Eric Auger , qemu-arm@nongnu.org, qemu-riscv@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=18792; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=PyW5TRg7ZQG9TBHWp10W1XsKvOAHOQvWs33fU8g6Slo=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhF90WwkCHdSwdDjRfhx/vRH/pX2CN0gd7+K6G Ome7FteUQ6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoRfdAAKCRDa6OEJdZac 5WRhEACfJfiS5+ZFjMpf8lCH7eULpUtFqaf4CpQr9GSoTYQqm/tZxSsUT7eFncM+m/cNeHK5Twv zzchkx0e5OepECdbiqSqfNuJnNze+a2tLbCZL5c7GWEA3Cjo3bfLgozvlCXY6vGUVF/YzT0QLtM WrGtAcOt+zayhDALEFisXrtA3PuGEVaz8ArM5cRI+xT1IC/GRiAM4xw9KoSD2mQAYivjY6F8jGj rZKF81NJ08IEnEUXrViMY3WhHec11LaixinA3sBIzuLcOW/q9XH2EmyQKGQDe/o2HV12C9cx0j8 kwmH+AOc9PuAq8Al4hdG0aCKMkxIs9eFSEKxi8uaJhxZNbYw4C0hgrocYUiEvpeLDtw7lq7FKNu FdWiNCqUYNN1CiSZqjxtTaURe4NrC8025Llxe8IpfT9fSafFeOrPG3t4mKHnBVjOb3tUi3lEpgE 6DZIoZ4iqxhWkatEb68wJLZY+zWyhVOWHZEIfjMs093fFlnX6h7oya1KUMPMN/G87HcKXUXhmN2 rHVvJJwcvgoUPTup2MHapsPi+c6UOitPnQkqKNaPjQbfzntkVwgTMZ65kLKI5IyfsMcv8aiVz4e ciPrWBuUTZ0CD9MzkKuf0fR7m0WyegKPsh2cywyPPeRYVBxPCnSoMgjGpHEW9oi7bzJph1XVWY5 qfbGjLd59bl59yQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787060286989158500 Change DEFINE_PROP_ARRAY, the macro now uses _arrayprop##_list to resolve the typed list PropertyInfo (introduced in the previous patch) instead of the generic qdev_prop_array. This means the element type and size information is carried by the PropertyInfo itself rather than duplicated at each callsite. Since the typed list PropertyInfos encode element_info and element_size, the .arrayinfo and .arrayfieldsize fields are no longer set by the macro (they will be removed from the Property struct in the next patch). Remove qdev_prop_array, which is now unused. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-properties.c | 8 -------- hw/display/apple-gfx-mmio.m | 2 +- hw/display/apple-gfx-pci.m | 2 +- hw/display/apple-gfx.h | 1 + hw/display/apple-gfx.m | 4 ++++ hw/input/stellaris_gamepad.c | 2 +- hw/intc/arm_gicv3_common.c | 2 +- hw/intc/arm_gicv5_common.c | 4 ++-- hw/intc/rx_icu.c | 4 ++-- hw/misc/arm_sysctl.c | 4 ++-- hw/misc/mps2-scc.c | 2 +- hw/net/rocker/rocker.c | 2 +- hw/net/virtio-net.c | 2 +- hw/nvram/xlnx-efuse.c | 2 +- hw/nvram/xlnx-versal-efuse-ctrl.c | 2 +- hw/riscv/riscv_hart.c | 6 ++---- hw/virtio/virtio-iommu-pci.c | 2 +- include/hw/block/block.h | 2 +- include/hw/core/qdev-properties.h | 27 ++++++++++----------------- tests/unit/test-qdev.c | 2 +- 20 files changed, 35 insertions(+), 47 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index a9ca8e4a03db..b5a9eb97e7dd 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -874,14 +874,6 @@ void default_prop_array(ObjectProperty *op, const Prop= erty *prop) object_property_set_default_list(op); } =20 -const PropertyInfo qdev_prop_array =3D { - .type =3D "list", - .get =3D get_prop_array, - .set =3D set_prop_array, - .release =3D release_prop_array, - .set_default_value =3D default_prop_array, -}; - const PropertyInfo qdev_prop_uint8_list =3D DEFINE_PROP_ARRAY_INFO(qdev_prop_uint8, uint8_t); const PropertyInfo qdev_prop_uint16_list =3D diff --git a/hw/display/apple-gfx-mmio.m b/hw/display/apple-gfx-mmio.m index 58beaadd1f10..dcd04617eb87 100644 --- a/hw/display/apple-gfx-mmio.m +++ b/hw/display/apple-gfx-mmio.m @@ -258,7 +258,7 @@ static void apple_gfx_mmio_reset(Object *obj, ResetType= type) static const Property apple_gfx_mmio_properties[] =3D { DEFINE_PROP_ARRAY("display-modes", AppleGFXMMIOState, common.num_display_modes, common.display_modes, - qdev_prop_apple_gfx_display_mode, AppleGFXDisplayMod= e), + qdev_prop_apple_gfx_display_mode), }; =20 static void apple_gfx_mmio_class_init(ObjectClass *klass, const void *data) diff --git a/hw/display/apple-gfx-pci.m b/hw/display/apple-gfx-pci.m index b0694f4cb855..74f79c8b157b 100644 --- a/hw/display/apple-gfx-pci.m +++ b/hw/display/apple-gfx-pci.m @@ -118,7 +118,7 @@ static void apple_gfx_pci_reset(Object *obj, ResetType = type) static const Property apple_gfx_pci_properties[] =3D { DEFINE_PROP_ARRAY("display-modes", AppleGFXPCIState, common.num_display_modes, common.display_modes, - qdev_prop_apple_gfx_display_mode, AppleGFXDisplayMod= e), + qdev_prop_apple_gfx_display_mode), }; =20 static void apple_gfx_pci_class_init(ObjectClass *klass, const void *data) diff --git a/hw/display/apple-gfx.h b/hw/display/apple-gfx.h index 3197bd853dab..b7eef7b9b14a 100644 --- a/hw/display/apple-gfx.h +++ b/hw/display/apple-gfx.h @@ -69,6 +69,7 @@ void *apple_gfx_host_ptr_for_gpa_range(uint64_t guest_phy= sical, MemoryRegion **mapping_in_region); =20 extern const PropertyInfo qdev_prop_apple_gfx_display_mode; +extern const PropertyInfo qdev_prop_apple_gfx_display_mode_list; =20 #endif =20 diff --git a/hw/display/apple-gfx.m b/hw/display/apple-gfx.m index 77c420b30006..592d692d793d 100644 --- a/hw/display/apple-gfx.m +++ b/hw/display/apple-gfx.m @@ -16,6 +16,7 @@ #include "qemu/cutils.h" #include "qemu/log.h" #include "qapi/qapi-builtin-type-infos.h" +#include "hw/core/qdev-prop-internal.h" #include "qapi/visitor.h" #include "qapi/error.h" #include "qemu/aio-wait.h" @@ -879,3 +880,6 @@ static void apple_gfx_set_display_mode(Object *obj, Vis= itor *v, .get =3D apple_gfx_get_display_mode, .set =3D apple_gfx_set_display_mode, }; + +const PropertyInfo qdev_prop_apple_gfx_display_mode_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_apple_gfx_display_mode, AppleGFXDispl= ayMode); diff --git a/hw/input/stellaris_gamepad.c b/hw/input/stellaris_gamepad.c index 376d91abad70..20613f649977 100644 --- a/hw/input/stellaris_gamepad.c +++ b/hw/input/stellaris_gamepad.c @@ -80,7 +80,7 @@ static void stellaris_gamepad_reset_enter(Object *obj, Re= setType type) =20 static const Property stellaris_gamepad_properties[] =3D { DEFINE_PROP_ARRAY("keycodes", StellarisGamepad, num_buttons, - keycodes, qdev_prop_uint32, uint32_t), + keycodes, qdev_prop_uint32), }; =20 static void stellaris_gamepad_class_init(ObjectClass *klass, const void *d= ata) diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c index f7ba74e6d52a..1298b6b735e9 100644 --- a/hw/intc/arm_gicv3_common.c +++ b/hw/intc/arm_gicv3_common.c @@ -615,7 +615,7 @@ static const Property arm_gicv3_common_properties[] =3D= { */ DEFINE_PROP_BOOL("force-8-bit-prio", GICv3State, force_8bit_prio, 0), DEFINE_PROP_ARRAY("redist-region-count", GICv3State, nb_redist_regions, - redist_region_count, qdev_prop_uint32, uint32_t), + redist_region_count, qdev_prop_uint32), DEFINE_PROP_LINK("sysmem", GICv3State, dma, TYPE_MEMORY_REGION, MemoryRegion *), DEFINE_PROP_UINT32("first-cpu-index", GICv3State, first_cpu_idx, 0), diff --git a/hw/intc/arm_gicv5_common.c b/hw/intc/arm_gicv5_common.c index b155486af65e..61c8ae493021 100644 --- a/hw/intc/arm_gicv5_common.c +++ b/hw/intc/arm_gicv5_common.c @@ -191,9 +191,9 @@ static void gicv5_common_realize(DeviceState *dev, Erro= r **errp) =20 static const Property arm_gicv5_common_properties[] =3D { DEFINE_PROP_LINK_ARRAY("cpus", GICv5Common, num_cpus, - cpus, TYPE_ARM_CPU, ARMCPU *), + cpus, TYPE_ARM_CPU), DEFINE_PROP_ARRAY("cpu-iaffids", GICv5Common, num_cpu_iaffids, - cpu_iaffids, qdev_prop_uint32, uint32_t), + cpu_iaffids, qdev_prop_uint32), DEFINE_PROP_UINT32("irsid", GICv5Common, irsid, 0), DEFINE_PROP_UINT32("spi-range", GICv5Common, spi_range, 0), DEFINE_PROP_UINT32("spi-base", GICv5Common, spi_base, 0), diff --git a/hw/intc/rx_icu.c b/hw/intc/rx_icu.c index 992b069ae245..125a6dcb6804 100644 --- a/hw/intc/rx_icu.c +++ b/hw/intc/rx_icu.c @@ -356,9 +356,9 @@ static const VMStateDescription vmstate_rxicu =3D { =20 static const Property rxicu_properties[] =3D { DEFINE_PROP_ARRAY("ipr-map", RXICUState, nr_irqs, map, - qdev_prop_uint8, uint8_t), + qdev_prop_uint8), DEFINE_PROP_ARRAY("trigger-level", RXICUState, nr_sense, init_sense, - qdev_prop_uint8, uint8_t), + qdev_prop_uint8), }; =20 static void rxicu_class_init(ObjectClass *klass, const void *data) diff --git a/hw/misc/arm_sysctl.c b/hw/misc/arm_sysctl.c index ebc95b9bb54c..1df85593a5cb 100644 --- a/hw/misc/arm_sysctl.c +++ b/hw/misc/arm_sysctl.c @@ -626,10 +626,10 @@ static const Property arm_sysctl_properties[] =3D { DEFINE_PROP_UINT32("proc_id", arm_sysctl_state, proc_id, 0), /* Daughterboard power supply voltages (as reported via SYS_CFG) */ DEFINE_PROP_ARRAY("db-voltage", arm_sysctl_state, db_num_vsensors, - db_voltage, qdev_prop_uint32, uint32_t), + db_voltage, qdev_prop_uint32), /* Daughterboard clock reset values (as reported via SYS_CFG) */ DEFINE_PROP_ARRAY("db-clock", arm_sysctl_state, db_num_clocks, - db_clock_reset, qdev_prop_uint32, uint32_t), + db_clock_reset, qdev_prop_uint32), }; =20 static void arm_sysctl_class_init(ObjectClass *klass, const void *data) diff --git a/hw/misc/mps2-scc.c b/hw/misc/mps2-scc.c index 554b504c7203..32f9e166feed 100644 --- a/hw/misc/mps2-scc.c +++ b/hw/misc/mps2-scc.c @@ -464,7 +464,7 @@ static const Property mps2_scc_properties[] =3D { * motherboard configuration controller to suit the FPGA image. */ DEFINE_PROP_ARRAY("oscclk", MPS2SCC, num_oscclk, oscclk_reset, - qdev_prop_uint32, uint32_t), + qdev_prop_uint32), }; =20 static void mps2_scc_class_init(ObjectClass *klass, const void *data) diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c index 910dce901b67..afbc32e99d94 100644 --- a/hw/net/rocker/rocker.c +++ b/hw/net/rocker/rocker.c @@ -1466,7 +1466,7 @@ static const Property rocker_properties[] =3D { DEFINE_PROP_UINT64("switch_id", Rocker, switch_id, 0), DEFINE_PROP_ARRAY("ports", Rocker, fp_ports, - fp_ports_peers, qdev_prop_netdev, NICPeers), + fp_ports_peers, qdev_prop_netdev), }; =20 static const VMStateDescription rocker_vmsd =3D { diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 814b99a43d20..a4e633e54392 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -4260,7 +4260,7 @@ static const Property virtio_net_properties[] =3D { DEFINE_PROP_BIT64("hash", VirtIONet, host_features, VIRTIO_NET_F_HASH_REPORT, false), DEFINE_PROP_ARRAY("ebpf-rss-fds", VirtIONet, nr_ebpf_rss_fds, - ebpf_rss_fds, qdev_prop_string, char*), + ebpf_rss_fds, qdev_prop_string), DEFINE_PROP_BIT64("guest_rsc_ext", VirtIONet, host_features, VIRTIO_NET_F_RSC_EXT, false), DEFINE_PROP_UINT32("rsc_interval", VirtIONet, rsc_timeout, diff --git a/hw/nvram/xlnx-efuse.c b/hw/nvram/xlnx-efuse.c index b1c9ee4980a0..99c16ce76f15 100644 --- a/hw/nvram/xlnx-efuse.c +++ b/hw/nvram/xlnx-efuse.c @@ -266,7 +266,7 @@ static const Property efuse_properties[] =3D { DEFINE_PROP_UINT32("efuse-size", XlnxEFuse, efuse_size, 64 * 32), DEFINE_PROP_BOOL("init-factory-tbits", XlnxEFuse, init_tbits, true), DEFINE_PROP_ARRAY("read-only", XlnxEFuse, ro_bits_cnt, ro_bits, - qdev_prop_uint32, uint32_t), + qdev_prop_uint32), }; =20 static void efuse_class_init(ObjectClass *klass, const void *data) diff --git a/hw/nvram/xlnx-versal-efuse-ctrl.c b/hw/nvram/xlnx-versal-efuse= -ctrl.c index f5d5587cb657..101320b82fd9 100644 --- a/hw/nvram/xlnx-versal-efuse-ctrl.c +++ b/hw/nvram/xlnx-versal-efuse-ctrl.c @@ -740,7 +740,7 @@ static const Property efuse_ctrl_props[] =3D { TYPE_XLNX_EFUSE, XlnxEFuse *), DEFINE_PROP_ARRAY("pg0-lock", XlnxVersalEFuseCtrl, extra_pg0_lock_n16, - extra_pg0_lock_spec, qdev_prop_uint16, uint16_t), + extra_pg0_lock_spec, qdev_prop_uint16), }; =20 static void efuse_ctrl_class_init(ObjectClass *klass, const void *data) diff --git a/hw/riscv/riscv_hart.c b/hw/riscv/riscv_hart.c index 747754be6158..a89c87c05623 100644 --- a/hw/riscv/riscv_hart.c +++ b/hw/riscv/riscv_hart.c @@ -48,11 +48,9 @@ static const Property riscv_harts_props[] =3D { * defined by "rnmi-exception-vector". */ DEFINE_PROP_ARRAY("rnmi-interrupt-vector", RISCVHartArrayState, - num_rnmi_irqvec, rnmi_irqvec, qdev_prop_uint64, - uint64_t), + num_rnmi_irqvec, rnmi_irqvec, qdev_prop_uint64), DEFINE_PROP_ARRAY("rnmi-exception-vector", RISCVHartArrayState, - num_rnmi_excpvec, rnmi_excpvec, qdev_prop_uint64, - uint64_t), + num_rnmi_excpvec, rnmi_excpvec, qdev_prop_uint64), }; =20 static void riscv_harts_cpu_reset(void *opaque) diff --git a/hw/virtio/virtio-iommu-pci.c b/hw/virtio/virtio-iommu-pci.c index 7b5ffddc1e97..1f3a07c5d119 100644 --- a/hw/virtio/virtio-iommu-pci.c +++ b/hw/virtio/virtio-iommu-pci.c @@ -38,7 +38,7 @@ static const Property virtio_iommu_pci_properties[] =3D { DEFINE_PROP_UINT32("class", VirtIOPCIProxy, class_code, 0), DEFINE_PROP_ARRAY("reserved-regions", VirtIOIOMMUPCI, vdev.nr_prop_resv_regions, vdev.prop_resv_regions, - qdev_prop_reserved_region, ReservedRegion), + qdev_prop_reserved_region), }; =20 static void virtio_iommu_pci_realize(VirtIOPCIProxy *vpci_dev, Error **err= p) diff --git a/include/hw/block/block.h b/include/hw/block/block.h index df941df19f26..70bf03a8de73 100644 --- a/include/hw/block/block.h +++ b/include/hw/block/block.h @@ -83,7 +83,7 @@ static inline unsigned int get_physical_block_exp(BlockCo= nf *conf) _conf.account_failed, ON_OFF_AUTO_AUTO), \ DEFINE_PROP_ARRAY("stats-intervals", _state, \ _conf.num_stats_intervals, _conf.stats_intervals, \ - qdev_prop_uint32, uint32_t) + qdev_prop_uint32) =20 #define DEFINE_BLOCK_PROPERTIES(_state, _conf) \ DEFINE_PROP_DRIVE("drive", _state, _conf.blk), \ diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-prope= rties.h index 0c067170079d..39f95ce7a3c6 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -76,7 +76,6 @@ extern const PropertyInfo qdev_prop_size; extern const PropertyInfo qdev_prop_string; extern const PropertyInfo qdev_prop_on_off_auto; extern const PropertyInfo qdev_prop_size32; -extern const PropertyInfo qdev_prop_array; extern const PropertyInfo qdev_prop_uint8_list; extern const PropertyInfo qdev_prop_uint16_list; extern const PropertyInfo qdev_prop_uint32_list; @@ -148,15 +147,15 @@ extern const PropertyInfo qdev_prop_link_list; * @_name: name of the array * @_state: name of the device state structure type * @_field: uint32_t field in @_state to hold the array length - * @_arrayfield: field in @_state (of type '@_arraytype *') which - * will point to the array - * @_arrayprop: PropertyInfo defining what property the array elements have - * @_arraytype: C type of the array elements + * @_arrayfield: field in @_state which will point to the array + * @_arrayprop: PropertyInfo for the array elements (e.g. qdev_prop_uint32= ); + * a corresponding list PropertyInfo named @_arrayprop##_list + * must exist * * Define device properties for a variable-length array _name. The array = is * represented as a list in the visitor interface. * - * @_arraytype is required to be movable with memcpy(). + * The element type must be movable with memcpy(). * * When the array property is set, the @_field member of the device * struct is set to the array length, and @_arrayfield is set to point @@ -166,12 +165,10 @@ extern const PropertyInfo qdev_prop_link_list; * @_arrayfield memory. */ #define DEFINE_PROP_ARRAY(_name, _state, _field, \ - _arrayfield, _arrayprop, _arraytype) \ - DEFINE_PROP(_name, _state, _field, qdev_prop_array, uint32_t, \ + _arrayfield, _arrayprop) \ + DEFINE_PROP(_name, _state, _field, _arrayprop##_list, uint32_t, \ .set_default =3D true, \ .defval.u =3D 0, \ - .arrayinfo =3D &(_arrayprop), \ - .arrayfieldsize =3D sizeof(_arraytype), \ .arrayoffset =3D offsetof(_state, _arrayfield)) =20 #define DEFINE_PROP_LINK(_name, _state, _field, _type, _ptr_type) \ @@ -183,10 +180,8 @@ extern const PropertyInfo qdev_prop_link_list; * @_name: name of the array * @_state: name of the device state structure type * @_field: uint32_t field in @_state to hold the array length - * @_arrayfield: field in @_state (of type '@_arraytype *') which - * will point to the array + * @_arrayfield: field in @_state which will point to the array * @_linktype: QOM type name of the link type - * @_arraytype: C type of the array elements * * Define device properties for a variable-length array _name of links * (i.e. this is the array version of DEFINE_PROP_LINK). @@ -195,12 +190,10 @@ extern const PropertyInfo qdev_prop_link_list; * where each string is the QOM path of the object to be linked. */ #define DEFINE_PROP_LINK_ARRAY(_name, _state, _field, _arrayfield, \ - _linktype, _arraytype) \ - DEFINE_PROP(_name, _state, _field, qdev_prop_array, uint32_t, \ + _linktype) \ + DEFINE_PROP(_name, _state, _field, qdev_prop_link_list, uint32_t, \ .set_default =3D true, \ .defval.u =3D 0, \ - .arrayinfo =3D &qdev_prop_link, \ - .arrayfieldsize =3D sizeof(_arraytype), \ .arrayoffset =3D offsetof(_state, _arrayfield), \ .link_type =3D _linktype) =20 diff --git a/tests/unit/test-qdev.c b/tests/unit/test-qdev.c index 77c3eee71713..8cd004b1efab 100644 --- a/tests/unit/test-qdev.c +++ b/tests/unit/test-qdev.c @@ -23,7 +23,7 @@ static const Property my_dev_props[] =3D { DEFINE_PROP_UINT32("u32", MyDev, prop_u32, 100), DEFINE_PROP_STRING("string", MyDev, prop_string), DEFINE_PROP_ARRAY("array-u32", MyDev, prop_array_u32_nb, prop_array_u3= 2, - qdev_prop_uint32, uint32_t), + qdev_prop_uint32), }; =20 static void my_dev_class_init(ObjectClass *oc, const void *data) --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787060244; cv=none; d=zohomail.com; s=zohoarc; b=FRk4+p04kabEV0OmUUfDgcJABvJK/i4dBgYMGs9YFj3y4uKpcke4Q58H2SH2TKGXzbv6wOSbeCTu8k1DmOQQf1EVgxFcfs0UfUjnwqbCXWXeYMtvZJ4HpKHqL6YFULdD6PX4KlkbMOjCFt6A8O8NkGB8yl5msotYhh4s8Dn14ZY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787060244; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tH/IVOUnn1QB2ho+AwTZr7qddaicqiut7xSXNWVfk8U=; b=hbYNYXqICZI+k/Zh3Zv0QIJZLB5vWjCXxZ1jqTEmOkwG3BU+pX35FEZT9kU8XSqp0xYjFVDdwTcNxxqndGuCgWQBJTUXAK7KSCndnw1ET5Ht1H+Vk08Tf8H5OgDaYK9G7yV7qyoZPqRit7XFQbNQ04CrgRrOrYMrfVYW022/Itg= 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 1787060244473375.51650940344894; Tue, 18 Aug 2026 06:37:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwK09-00084k-ME; Tue, 18 Aug 2026 09:37:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJzq-0007qX-Rz for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:36:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwJzp-0000l0-9y for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:36:54 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-315-btIdfDvbP4ydOPAob3vl6w-1; Tue, 18 Aug 2026 09:36:49 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DBF741955E79; Tue, 18 Aug 2026 13:36:47 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DED8E1800577; Tue, 18 Aug 2026 13:36:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787060212; 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=tH/IVOUnn1QB2ho+AwTZr7qddaicqiut7xSXNWVfk8U=; b=U8lcrhHpJkl635ojj1E8cgW9LsG4c9OppXYxQA1l7cxXxprFQQ3K2051ynvTmVYoKzA6wE 0bTAzxGNXJ10h/F8A2xHXAP1c0OicYZ2eM96YFul0mWY4sQRrKy+YuXBLDawBc3UEndqCM yVrue5SRSmNPa8cSB5WqzXnI/ifr43w= X-MC-Unique: btIdfDvbP4ydOPAob3vl6w-1 X-Mimecast-MFC-AGG-ID: btIdfDvbP4ydOPAob3vl6w_1787060208 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 17:29:35 +0400 Subject: [PATCH v3 69/74] qdev: remove deprecated PropertyInfo.type and .enum_table fields MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-69-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=5602; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=sOu4pogNVK6NpFHufCV3RH9LgNGQmgLKUI48lJjnLyQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhF90dWdppFaDwBm3+iGMpaLyn1C2tn/h67RIq pPaicntHuKJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoRfdAAKCRDa6OEJdZac 5XeHEAClpChYW1DyMyyZiAhu3YAc2oR51wu23JnOWcELq5hnjpDQQE0KT5il4FC35Tsk1Kovaxx ZG9glrM7VTHnSSectwbZ0t9tQIEmRnLS56H80uPFUdiBJ3d+uh/BFemOpUKG/p7xsDy0uBA2SAE fO8x2BOJsTeJtZx3TLJ4N3BAVb/LHuP34KteqdtoKbody4YVkZR+cUR5l/XJ48ad1SORtivVXdU XIsM9m0/i7C2SQ4VYkA6EUy1X/jpBLP23ZASnaPUe3gKIjjCISo6+N5pV0Rdf7AhIU0Me3VQ7Y6 x0b7nYo+VqGkED3bGBmDFZV6mJ6K3dS1Kh8lc5FAjWaBSn80bfz6WSS1ZScmnX591vUqdeIe7aM uWPGJ1aMTSNX9m+0kAQHCMAnpY7xUVQNd8xwHOk7EPb6Mfbkljag+AK1QRDsnVJaoYLHtK9Y78Q 7tWDn/SNvzWvEx8pmW7ZIXZrtwM190SpWGk91GymgurLfG1UvE+71i+xUTF/IcQ+t1B7P52ytA2 f2/DnpBQPeNRZsyNplOtJskfkj3qQTc4TkRA6RJKAB67i3S60mRfVJ1uqx5qPolMk3rEnRYzsB7 tHk9Py13zGJain6gx2gOXcr7jvSgsmBS1QTUcNQljMey2KmRfHLt5rIF5KUjgweXDn4WsQVqENW unUJ1gUCpYIFYIA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787060246101158500 Now that all PropertyInfo definitions use .qapi_type, remove the legacy .type (string) and .enum_table fields from PropertyInfo, and the .arrayinfo/.arrayfieldsize fields from Property. Remove fallback branches in qdev_property_add_static() and qdev_class_add_property() that used object_property_add() with prop->info->type: these always use the QAPI-aware registration path now. Simplify qdev_propinfo_enum_lookup(), prop_array_info() and prop_array_elem_size() to use the new fields directly. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-properties.c | 58 ++++++++++++-----------------------= ---- include/hw/core/qdev-properties.h | 4 --- 2 files changed, 17 insertions(+), 45 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index b5a9eb97e7dd..585982f60f5a 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -103,11 +103,8 @@ static ObjectPropertyAccessor *field_prop_setter(const= PropertyInfo *info) =20 const QEnumLookup *qdev_propinfo_enum_lookup(const PropertyInfo *info) { - if (info->qapi_type) { - assert(info->qapi_type->lookup); - return info->qapi_type->lookup; - } - return info->enum_table; + assert(info->qapi_type->lookup); + return info->qapi_type->lookup; } =20 void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, @@ -667,18 +664,12 @@ struct ArrayElementList { =20 static const PropertyInfo *prop_array_info(const Property *prop) { - if (prop->info->element_info) { - return prop->info->element_info; - } - return prop->arrayinfo; + return prop->info->element_info; } =20 static int prop_array_elem_size(const Property *prop) { - if (prop->info->element_size) { - return prop->info->element_size; - } - return prop->arrayfieldsize; + return prop->info->element_size; } =20 /* @@ -1222,20 +1213,13 @@ void qdev_property_add_static(DeviceState *dev, con= st Property *prop) const QAPITypeInfo *qapi_type =3D qdev_prop_qapi_type(prop); =20 assert(!prop->info->create); + assert(qapi_type); =20 - if (qapi_type) { - op =3D object_property_add_qapi(obj, prop->name, qapi_type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); - } else { - op =3D object_property_add(obj, prop->name, prop->info->type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); - } + op =3D object_property_add_qapi(obj, prop->name, qapi_type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); =20 object_property_set_description(obj, prop->name, prop->info->description); @@ -1259,21 +1243,13 @@ static void qdev_class_add_property(DeviceClass *kl= ass, const char *name, } else { const QAPITypeInfo *qapi_type =3D qdev_prop_qapi_type(prop); =20 - if (qapi_type) { - op =3D object_class_property_add_qapi(oc, - name, qapi_type, - field_prop_getter(prop->inf= o), - field_prop_setter(prop->inf= o), - prop->info->release, - (Property *)prop); - } else { - op =3D object_class_property_add(oc, - name, prop->info->type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); - } + assert(qapi_type); + op =3D object_class_property_add_qapi(oc, + name, qapi_type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); } if (prop->set_default) { prop->info->set_default_value(op, prop); diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-prope= rties.h index 39f95ce7a3c6..2267e734d1fd 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -23,17 +23,13 @@ struct Property { int64_t i; uint64_t u; } defval; - const PropertyInfo *arrayinfo; int arrayoffset; - int arrayfieldsize; uint8_t bitnr; bool set_default; }; =20 struct PropertyInfo { - const char *type; const char *description; - const QEnumLookup *enum_table; const QAPITypeInfo *qapi_type; const struct PropertyInfo *element_info; int element_size; --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787060370; cv=none; d=zohomail.com; s=zohoarc; b=djYQiZkpa6CM6Q1WCo14XXWtIO68aX9d/JJKWRbfrzSK++5udTb2BHguQ8etLXTnpJNoSMrGiOpsDaMcZJfZTZHrvwLFsFOwxD0f8eGIyPmmQ2o5y8qeg06zMYXjIp6HIxAU68ruh5f6PI8vvyHncHZ2uHgy0481BwGejkGZMU4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787060370; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NV4vU7xJ/sfqVFDKGMhjLy89zJHemxz+WxI8Cc9ZjaA=; b=LmsS53WmVAgZYo9g/WQCfi8YIJ27mDh0jRI4jnzaaipV5bJZZXchIKJpLAd7fjKt/z6baWmTUEZzMJD0RKCQXFkhVaKs/P50Vsg1SzBQiKZCMkhmGeY6Wgy2y6ils/W4EHbjVgSteoZbActv0PwUO1PnSmq5gwBSnZpsaPk5vTg= 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 1787060370003248.75415815535382; Tue, 18 Aug 2026 06:39:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwK0E-0000LG-7L; Tue, 18 Aug 2026 09:37:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwK0A-0008Bk-OZ for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:37:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwK09-0000mq-7h for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:37:14 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-645-eCwZ9M4tN02xeULFm4dFaw-1; Tue, 18 Aug 2026 09:37:04 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 280FC1955E7D; Tue, 18 Aug 2026 13:37:03 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8F76E195608A; Tue, 18 Aug 2026 13:36:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787060232; 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=NV4vU7xJ/sfqVFDKGMhjLy89zJHemxz+WxI8Cc9ZjaA=; b=H0yRnKs5vFJhWonqM8EApRaQzXB2wsIkYYvZJWW7+i4llwry8OYTDIdlFeaUtePe6L1MFo tQg83s024tTydu05+eeXDCSoQx8b4N/97zKf5NSnjfDjoAPlM8C+cjXwZ6W3+k1qmp6VVN a3KUTtgFWIIXtigpEmtKQiKuiBnIWPg= X-MC-Unique: eCwZ9M4tN02xeULFm4dFaw-1 X-Mimecast-MFC-AGG-ID: eCwZ9M4tN02xeULFm4dFaw_1787060223 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 17:29:36 +0400 Subject: [PATCH v3 70/74] memory: use object_property_add_link for container property MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-70-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu X-Developer-Signature: v=1; a=openpgp-sha256; l=2973; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=t5V93ky8AHjt2AWFGdnZjqVczHh1F8gtqhIECiuT7J4=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhF90jZgdg76F7sUgxpqWCrRmOfZma00eaLUVt dEM2zaDRguJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoRfdAAKCRDa6OEJdZac 5bycD/9Sip+2W/rMqUsTwURzYGOdPkjORi+Xy2KYC9c6QCWj4Z8lRYQuWFtDmQ8giicfUOjchfc H2RUbZ3hvDcmWcy6XMkGgjKSGdP/xiMsH1zQthinHqAd+blFkn0NUnFZl4V+ecZmORblfuNzdTJ XyCBMCQAlXmeR5m6htAtt/tJ5br5fTSk8tFcM86D1mnCB9N+JPpq/94L1/B02ToGIOLxCeVBh5I calzBjH0tfQu01+XVbqqxo3C15tLo1NrxCn3san9Bigj7Sg4k4U3GLsRfekQGh+7vvz4mA+lnKP KxqzhXoqAZKOAm9byz9iL/0urrleS45GdR25p85gwYjGs8s7qhZ8y+TtmQ1CPpeU25IPaBsLikB 2C3OZZ5mKCBH+ogSqU+mYDZZQgWmgZwij9qGDghND+guHbo2KCsib/u8GkWe6nfsRDjG+svhbMx zGlILAadeTyGN0ru9vddCIc2bpBbV6czcSePk+Gfbmsf4HnZ5nPW2q0QrqE6aszAAnLxvh6KSNO T0rCSBA0seM1VnUV6Y57B7EkeCmpBd0nAQl77ug8dRvTUheW08XrPkRigqMt2k9pxnvlKhA23hZ ZboNB7luql3xYas1qV2rL668jLxd6eqQISDMjMAX7wpABYkcKJAmzJh8BUB6AuzY0JkOtHZZya9 dl0CQBEIZpd/LFQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787060373047158500 Replace the hand-rolled container property with object_property_add_link(). With check=3DNULL the link has no setter (read-only), matching the existing behaviour. The built-in link getter and resolver are functionally identical to the removed memory_region_get_container() and memory_region_resolve_container(). The non-STRONG flag avoids refcount interference: mr->container is managed externally by memory_region_add/del_subregion(). Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Peter Xu --- system/memory.c | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/system/memory.c b/system/memory.c index 46a0dbaf6859..37660993e847 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1255,29 +1255,6 @@ void memory_region_init(MemoryRegion *mr, memory_region_do_init(mr, owner, name, size); } =20 -static void memory_region_get_container(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) -{ - MemoryRegion *mr =3D MEMORY_REGION(obj); - char *path =3D (char *)""; - - if (mr->container) { - path =3D object_get_canonical_path(OBJECT(mr->container)); - } - visit_type_str(v, name, &path, errp); - if (mr->container) { - g_free(path); - } -} - -static Object *memory_region_resolve_container(Object *obj, void *opaque, - const char *part) -{ - MemoryRegion *mr =3D MEMORY_REGION(obj); - - return OBJECT(mr->container); -} =20 static void memory_region_get_priority(Object *obj, Visitor *v, const char *name, void *opaque, @@ -1301,7 +1278,6 @@ static void memory_region_get_size(Object *obj, Visit= or *v, const char *name, static void memory_region_initfn(Object *obj) { MemoryRegion *mr =3D MEMORY_REGION(obj); - ObjectProperty *op; =20 mr->ops =3D &unassigned_mem_ops; mr->enabled =3D true; @@ -1310,12 +1286,11 @@ static void memory_region_initfn(Object *obj) QTAILQ_INIT(&mr->subregions); QTAILQ_INIT(&mr->coalesced); =20 - op =3D object_property_add(OBJECT(mr), "container", - "link<" TYPE_MEMORY_REGION ">", - memory_region_get_container, - NULL, /* memory_region_set_container */ - NULL, NULL); - op->resolve =3D memory_region_resolve_container; + object_property_add_link(obj, "container", + TYPE_MEMORY_REGION, + (Object **)&mr->container, + NULL, /* read-only: no check means no setter = */ + 0); =20 object_property_add_uint64_ptr(OBJECT(mr), "addr", &mr->addr, OBJ_PROP_FLAG_READ); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787060344; cv=none; d=zohomail.com; s=zohoarc; b=dWbVwu1zzg+GoWTDQX091d5GaXSoJMxszV147YtMDunK38nqzlzP3tPLJV/D/P8vHVvBi6+B2PXLyYphzmPesThCHBzmJ2E3gPS5TQiEk8kHehX1Keow5K0s1npmHyDpyae2aYAFho4bkpMX6/QdWLs3y0pcNgyOdul/J9WAaYU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787060344; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mVgRY8FyaQprluWH3eLEEY/EI8+otfrYvvNCkmcu2Fc=; b=AEhz17abCDcCTI9Gak3MPiZxkltbMECapkXFTRVwREik6jZB0MrmO6JHQQABaC6PhQNstO2s3X5pIxErwgssp8SwOEkbFow4mfMAz+K2+wkG/j+to1xYVqjGeC1rav7UJRF9a91ZWKlBPrDBDK9CBDgXcdvmXRvKUkrzHoXKZEE= 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 1787060344542355.34563755713725; Tue, 18 Aug 2026 06:39:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwK0R-0001SX-7S; Tue, 18 Aug 2026 09:37:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwK0P-0001Ou-H3 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:37:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwK0N-0000oV-S1 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:37:29 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-622-6V8yhu8gPAa7H2MrfVeAxQ-1; Tue, 18 Aug 2026 09:37:24 -0400 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 A19A918009CE; Tue, 18 Aug 2026 13:37:21 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 37DE03000239; Tue, 18 Aug 2026 13:37:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787060247; 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=mVgRY8FyaQprluWH3eLEEY/EI8+otfrYvvNCkmcu2Fc=; b=fCD8TybzOEAtHjt3V+JDqOY0K73AmREVtKC/dFPfJg5DMJTvYjFx53Pr/PvNAtiuqRNaYH 5wRXQutp2cV2uaA3iGZiFQ2u+g/rTqk+cwacmyk7+z63PlMdU/rZOqIE7vnhasJgUy3Omn TnjObfmg5gBzVz1sOgnbJE9/JN6dS+s= X-MC-Unique: 6V8yhu8gPAa7H2MrfVeAxQ-1 X-Mimecast-MFC-AGG-ID: 6V8yhu8gPAa7H2MrfVeAxQ_1787060241 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 17:29:37 +0400 Subject: [PATCH v3 71/74] hw/i386: convert PCSouthBridgeOption to QAPI enum MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-71-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , "Michael S. Tsirkin" , Eric Blake , Zhao Liu X-Developer-Signature: v=1; a=openpgp-sha256; l=5406; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=5rbqnyzNuiXenxsxKA8MfQROzgQKdBBd23brPgSs/+E=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhF90blahqai84RChuX/PiHqUltmExNeQ2Q4W6 +zT3/ak9wCJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoRfdAAKCRDa6OEJdZac 5SInD/93wUSSckPy71+Pl4w4XhAksStuXGm/LOyaXPDUkv3BOC2cS+g9FtCb4LjPivnfx48cQHG m1W9h4p/jQA9WvlG2KhJjEv3XHk45tyQv4PUVfMN7jy+0xSYEvhMvFNe1c47BRhP8PpZBXkLeeI ovGetjDTZnORmV2bIDvz1GrWcihMLaZ27A8QiNgP6WH24+tcKUoAIr03jLLA9mnSh+B9fVrRdwC ywqmrDzH7/EeiXCzNJw+j1Dw1DZtmTUIJ8LL4rc8TsErubNvSUFBcA42tEtHviQWsK06hEYjPpH cgjuTmGnQZGC2/OLNmk0v50lZcmCq6b0Hj33bVqj/Gt3LaoxXTsFu+3biSrRfj66cg7cnYd2j1r RDdZ0YQSp4959LxK6+UxjBhZhxmxVf7dOvEAbPRd7MLdZYXZLsSpIBUV9pB7Fr21Ag+aXIHSUi1 Ozp/T3+u6B2ugO33p7MFhijJ5hHz5xqeL/wLPasrds2N6mr4dRQWa6gaSJztkUN/tzpwxm6knMt khqQMVDxoFznUTdJYYrUZcvtY6j+Bubo2ebKXyqHcrrJU99NWcuOnnsQPcW6XgRuWHFkzZfwS4d 0Weeaa6BdHWEIriwEWPBcenqS1OnbPa2C0GaZnh88SExZSBBXqu8kd74HTuWgbOcdKbI42QA0t1 bbsnZn4dNK8QTdA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=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: 1787060346762158500 Move PCSouthBridgeOption from a hand-rolled C enum with a manually constructed QAPITypeInfo 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. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/i386/pc_piix.c | 53 +++++++++++-------------------------------------= ---- include/hw/i386/pc.h | 4 ++-- qapi/machine.json | 14 ++++++++++++++ 3 files changed, 27 insertions(+), 44 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index dac2bee88a2e..02d0f2917705 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", @@ -322,56 +329,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 const QAPITypeInfo PCSouthBridgeOption_type_info =3D { - .name =3D "PCSouthBridgeOption", - .lookup =3D &PCSouthBridgeOption_lookup, -}; - 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 @@ -408,7 +377,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 diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index ac03da97b645..34806f16e6a6 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -42,7 +42,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; @@ -89,7 +89,7 @@ struct PCMachineClass { =20 /* Device configuration: */ bool pci_enabled; - const char *default_south_bridge; + PCSouthBridgeOption default_south_bridge; =20 /* Compat options: */ =20 diff --git a/qapi/machine.json b/qapi/machine.json index 0e0d85d0a76d..28ecb969bdb6 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -475,6 +475,20 @@ { 'enum': 'Pca9554PinState', 'data': ['low', 'high'] } =20 +## +# @PCSouthBridgeOption: +# +# South bridge chipset option for PC i440FX machines. +# +# @piix3: Intel PIIX3 (default) +# +# @piix4: Intel PIIX4 +# +# Since: 11.2 +## +{ 'enum': 'PCSouthBridgeOption', + 'data': ['piix3', 'piix4'] } + ## # @inject-nmi: # --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787060287; cv=none; d=zohomail.com; s=zohoarc; b=d6+lxjBe7ek1/5g+pWV88r3V97FTbsDLkKtTa/s5yOpn9kRB/3f+j6qokGLS1+uAQ7y5P2f+MVs7pe21ykdM3jSH2D+ubhFRuAFxest+e1Hp+CDw3Irk5GJEidCcXvx+YmHUUb8M2xVs7qGT59ydf6o+TxTwSBILOi5zQk3wnCQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787060287; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/xcTmQPUahfJ134xZYmQZLSB934twH1Et80D5mL4nj0=; b=lY48CXbF+GXcj0Q6wo4/USh5J0ZplL0L24qIgIwRp5xIJ4VItk/WR+twXNM8Jnm1UsSl/9VpMJWXXrnQGDFRbVKEd1ZBjljjO3313VmUSCBXaHKUfibmYiHwUSH/vVNE5EYTegv+bgHNe+MG19VGIXlWFtiBSCPXcalmBu1ftIw= 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 1787060287478725.2355422404154; Tue, 18 Aug 2026 06:38:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwK0f-0002P3-GU; Tue, 18 Aug 2026 09:37:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwK0e-0002KV-An for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:37:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwK0c-0000pd-KW for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:37:44 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-443-orDUT1ZmOZGFCxn_A2S2Zw-1; Tue, 18 Aug 2026 09:37:34 -0400 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 D7DE918009B9; Tue, 18 Aug 2026 13:37:30 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 287303000239; Tue, 18 Aug 2026 13:37:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787060262; 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=/xcTmQPUahfJ134xZYmQZLSB934twH1Et80D5mL4nj0=; b=h3Ohmm8IUCQXhMe4X0x6c6mj6PPfcOGspjpJnIcMhlZGU9v3xEQKVgvXYY8Yp7ygAXI4I6 WV68SwJjmgvHx0mbF5Vsy4Q8OxpIA2tgP9pEANp05uMOvjm4hWc+QziSR1NqHA9BLa5AYU f5EXkbxLrpI/ukjl9aqB2tXb1wz1sJQ= X-MC-Unique: orDUT1ZmOZGFCxn_A2S2Zw-1 X-Mimecast-MFC-AGG-ID: orDUT1ZmOZGFCxn_A2S2Zw_1787060251 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 17:29:38 +0400 Subject: [PATCH v3 72/74] qom: use QAPITypeInfo in object_property_get_enum MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-72-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu X-Developer-Signature: v=1; a=openpgp-sha256; l=4675; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=5s4MLN2op9P8GCk3+gG5r8DgTGpBqvzieEC1NIucyC0=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhF90TfylNqqL6DFnLw7+3WYMNJN87QNFFNPVG N4V2oVhowqJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoRfdAAKCRDa6OEJdZac 5QJvEACFVH/ZFoaFYIu3mCy42rE6YwGHHAjiUm5Car7anWLuE9/7a/dEEJ7tT42+NVwn70KaCN8 IdRlgQ4IrS4aMWSU2qHekFNPv0fZm9Gm2wrtD0KsBhx/rez5I1cNX8BIGcC1WTBW0bz7RWo/jKf DCBnpZKDJ/zd84tvljK/cjWlaVeBce8+inllxHkWpXoIU2wcFXTIH0vS7k6dWGtp/AFANAXCCYI PWNauVERNoqQHsVTEx6rWEy/8Fdv9EBmRMG6Pkif4/uXPTIiknZJ5xOcPemp/G+iMpT+EsWrnkb zqOHZXR1A6onwucZG1+Yat7aBt0EZ9sSQf8JMFTymUb8+NjcyT7Sg21AnZjcdLFwB7hIQUDH06e kARP8fueSeJLy5A2C3uJrRtuHUswgr+guXZr7jj/R5ADLH7x96OIFhCGsUGeT3/gb/5SLSDON7q CGyIhX3Ia5PERyVFsnpXGS3VvK5/CeVDgUJL0pICZvDA4WEXYNc8wFDw+FH+LVxq0oQbebiMBQH yhKGx4mYR1UC/5AXLX59784gvIRd5ZSlW9CXedIvve4SpVmvFSHq7rf1/rFqxO41Zipty7OJ9Sk mycYv2NBRaTs+Z2LA3OBor/N6LmsbcHuTObFHy0H/QLsef+F/7q8FyFjShcW5u9aGyJQT2gp6fb 3HOCF2fEnorqBXA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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: 1787060288353158501 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 --- hw/core/machine-qmp-cmds.c | 3 ++- include/qom/object.h | 4 ++-- qom/object.c | 8 ++++---- tests/unit/check-qom-proplist.c | 6 +++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 1aa5f2622986..f6f3024752b1 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" @@ -219,7 +220,7 @@ 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", &HostMemPoli= cy_type_info, &error_abort); host_nodes =3D object_property_get_qobject(obj, "host-nodes", diff --git a/include/qom/object.h b/include/qom/object.h index db4972294e39..e2f7d546f68f 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1529,7 +1529,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 @@ -1537,7 +1537,7 @@ uint64_t object_property_get_uint(Object *obj, const = char *name, * value is not an enum). */ int object_property_get_enum(Object *obj, const char *name, - const char *typename, Error **errp); + const QAPITypeInfo *type_info, Error **errp); =20 /** * object_property_set: diff --git a/qom/object.c b/qom/object.c index 4d7c9181fb6e..dadeb5d5b991 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1761,7 +1761,7 @@ uint64_t object_property_get_uint(Object *obj, const = char *name, } =20 int object_property_get_enum(Object *obj, const char *name, - const char *typename, Error **errp) + const QAPITypeInfo *type_info, Error **errp) { char *str; int ret; @@ -1771,10 +1771,10 @@ int object_property_get_enum(Object *obj, const cha= r *name, return -1; } =20 - if (!g_str_equal(prop->type, typename)) { + if (prop->qapi_type !=3D type_info) { error_setg(errp, "Property %s on %s is not '%s' enum type", - name, object_class_get_name( - object_get_class(obj)), typename); + name, object_class_get_name(object_get_class(obj)), + type_info->name); return -1; } =20 diff --git a/tests/unit/check-qom-proplist.c b/tests/unit/check-qom-proplis= t.c index 69155e720751..1cb48c7490ef 100644 --- a/tests/unit/check-qom-proplist.c +++ b/tests/unit/check-qom-proplist.c @@ -582,14 +582,14 @@ static void test_dummy_getenum(void) =20 val =3D object_property_get_enum(OBJECT(dobj), "av", - "DummyAnimal", + &dummy_animal_qapi_type_info, &error_abort); g_assert(val =3D=3D DUMMY_PLATYPUS); =20 /* A bad enum type name */ val =3D object_property_get_enum(OBJECT(dobj), "av", - "BadAnimal", + &dummy_str_qapi_type_info, &err); g_assert(val =3D=3D -1); error_free_or_abort(&err); @@ -597,7 +597,7 @@ static void test_dummy_getenum(void) /* A non-enum property name */ val =3D object_property_get_enum(OBJECT(dobj), "iv", - "DummyAnimal", + &dummy_animal_qapi_type_info, &err); g_assert(val =3D=3D -1); error_free_or_abort(&err); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787060287; cv=none; d=zohomail.com; s=zohoarc; b=RJ7i1yCSJYxDWVXBi+jtvtQANpwWSd1vzEOfDF/z6JFxxFNn7XSZPIuGH9awrUvaase0Ap3iTaYYFExqozN2lYNS1snrC7M9IAmdYuGQpjC1lEbIyTqUmDAa96Emfm5i4lVrZsNLIli9tt8F9m6rhhgbcMgMPHZ0Je7Rpmqwzc0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787060287; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lIWD43VFl3TxW9MusC/G2QnK5XBQflgz2T49dLLBGHg=; b=gPYtJRTTYYq4RlPhivpaHIU4rVZukABcE3Zk7+H13Xf0Oo89BZBotVakpRIrUZuX+iwfCGEh3PAkO6RtCzAV3UxytmZOdgG5hyjNqr7U/PLxasKqLzAm6K8IcMCQzjU/B2OxRQzHQYb+hd+fLekgG1mi//ys5j+9MOBzMplPPCU= 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 1787060287799738.3501111300662; Tue, 18 Aug 2026 06:38:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwK0g-0002SJ-Rr; Tue, 18 Aug 2026 09:37:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwK0f-0002Nw-5t for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:37:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwK0d-0000ph-91 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:37:44 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-5-6m38b-sgNEq4vkEE7j4tJA-1; Tue, 18 Aug 2026 09:37:39 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AD099195605E; Tue, 18 Aug 2026 13:37:37 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8623718005BB; Tue, 18 Aug 2026 13:37:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787060262; 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=lIWD43VFl3TxW9MusC/G2QnK5XBQflgz2T49dLLBGHg=; b=eZnIkDYCuHcFD5lZ/ojTZbXKP209FI18GhQdEzczDFa+M5A5RyOLzG9nZ1pBLHw75Gw170 xVVjMwlSnXjZwf8m5CXhDDwMBPGUCK+ZEaAJQnrXmfPDLhR/uA6rQ0GnnIetZImvcjRfKQ 2CPtQ0sYjja9Gac/Uq30b/59iV08Ekg= X-MC-Unique: 6m38b-sgNEq4vkEE7j4tJA-1 X-Mimecast-MFC-AGG-ID: 6m38b-sgNEq4vkEE7j4tJA_1787060257 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 17:29:39 +0400 Subject: [PATCH v3 73/74] qapi: expose integer signedness and width in introspection MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-73-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eric Blake X-Developer-Signature: v=1; a=openpgp-sha256; l=8446; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=LJPllIkg6wKToPmVx8RTOdW0Jstfox64RTLtI3VMjQM=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhF90z9YUnoohhl7L9UtyHvoJHPezg5ymmvumq QPuQnITQwmJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoRfdAAKCRDa6OEJdZac 5QSDEAC1Y+fMnnpCHp+Ic5VX3o5Y/deVKokwjB/BGU+aM0Gq28kQdRAEbiTS24AAEBCaltMzUA5 BJWyB8NMxjcunc3Wa6yX9VpWhnY4B23gzqa5wV7zZUrUHM4pLv+2NAXrFOWiwACrdGfYddw6Wro AElGtB659BFrV3KFal217AZD1/WCXZj8cYhEAKm39mBQSLoOAkDOmlEJl5bxfQqTZpu0W2ZH1h8 gDXIXYIn1tDDaQRdISNnlMFBRVknpt9wBPegiJKnq+1timo/JThKfDjZfj0Aeoe+G/5gu//uUD8 jKeGd9O8t2pUfNBdTlukVWqXkRWWrLBy52BoSQXsuK4hYmaNrRAs7GIgebpmPTGI71kNjKtTQgF wf6LOU8VdlERyC/kilSXyYbyvlD8e7aTaB4CZQMi7KnuZhgmhK6e1Gfr246fpUrcfcMRye0FfNP MyhhDCFPdSCQTbgMK6/ElEGxkZ7goOG7JdBAZ+HsKCH0ap/gId0GnkvxvoMH7uxNg6JybC0YL+r 8gRpB+lOiDz9Qu65I6FkEs6Ozg0eVorFGtIkx/Y5mLknTJ6kWWpoLPWUhNvEkNhl+afx2QEa6Oh PJF+ukqgXHtBipljk3b2HBgidNby6twZQHzjdPbGrlxRdv8xFICieFP6gRl0K71wBg+mQwgVP2D 2j8vpymSGsx6sDw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1787060288413158500 Integer built-in types are currently canonicalized to "int" in query-qmp-schema. Consequently, clients cannot distinguish types such as int8, uint64, and size, even though they accept different ranges. Preserve the individual integer types during schema analysis and add an optional "integer" member to SchemaInfoBuiltin. It reports whether the type is signed and its width in bits. This also preserves the actual element type for arrays of integers. Teach the introspection generator to emit integer values and update the documentation to describe the extended schema information. For example for introspection, for all kind of int, before: {"name": "int", "json-type": "int", "meta-type": "builtin"} After, there are various int types such as: {"name": "int64", "integer": {"bits": 64, "signed": true}, "json-type": "int", "meta-type": "builtin"} Signed-off-by: Marc-Andr=C3=A9 Lureau --- docs/devel/qapi-code-gen.rst | 24 ++++++++++++++---------- qapi/introspect.json | 20 +++++++++++++++++++- scripts/qapi/introspect.py | 29 ++++++++++++++++++++++++++--- scripts/qapi/schema_analysis.py | 16 ---------------- 4 files changed, 59 insertions(+), 30 deletions(-) diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst index d176238fc2ef..a158f017d9a7 100644 --- a/docs/devel/qapi-code-gen.rst +++ b/docs/devel/qapi-code-gen.rst @@ -1400,14 +1400,19 @@ Example: the SchemaInfo for str :: =20 { "name": "str", "meta-type": "builtin", "json-type": "string" } =20 -The QAPI schema supports a number of integer types that only differ in -how they map to C. They are identical as far as SchemaInfo is -concerned. Therefore, they get all mapped to a single type "int" in -SchemaInfo. +The QAPI schema supports a number of integer types with different widths +and signedness. Each has its own SchemaInfo with "json-type" "int" and +variant member "integer" specifying its "signed" flag and width in +"bits". + +Example: the SchemaInfo for uint8 :: + + { "name": "uint8", "meta-type": "builtin", "json-type": "int", + "integer": { "signed": false, "bits": 8 } } =20 As explained above, type names are not part of the wire ABI. Not even -the names of built-in types. Clients should examine member -"json-type" instead of hard-coding names of built-in types. +the names of built-in types. Clients should examine members "json-type" +and "integer" instead of hard-coding names of built-in types. =20 =20 Compatibility considerations @@ -2130,10 +2135,9 @@ Each ``QAPITypeInfo`` struct has the following field= s: ``masked_name`` For user-defined types, the masked name used in ``query-qmp-schema`` output. For array types, the corresponding - bracketed introspection name. Built-in types use their QAPI name; - note that introspection canonicalizes the integer built-in types - to ``int``. Internal types not present in introspection use - ``NULL``. + bracketed introspection name. Built-in types, including the distinct + integer types, use their QAPI name. Internal types not present in + introspection use ``NULL``. =20 ``lookup`` For enum types, a pointer to the corresponding ``QEnumLookup`` diff --git a/qapi/introspect.json b/qapi/introspect.json index c8432c8ed8ec..8b5848862c4e 100644 --- a/qapi/introspect.json +++ b/qapi/introspect.json @@ -117,10 +117,28 @@ # # @json-type: the JSON type used for this type on the wire. # +# @integer: the integer type's representation. Present exactly when +# @json-type is 'int'. (since 11.2) +# # Since: 2.5 ## { 'struct': 'SchemaInfoBuiltin', - 'data': { 'json-type': 'JSONType' } } + 'data': { 'json-type': 'JSONType', + '*integer': 'SchemaInfoBuiltinInteger' } } + +## +# @SchemaInfoBuiltinInteger: +# +# Representation of an integer built-in type. +# +# @signed: whether the integer is signed. +# +# @bits: the integer's width in bits. +# +# Since: 11.2 +## +{ 'struct': 'SchemaInfoBuiltinInteger', + 'data': { 'signed': 'bool', 'bits': 'int' } } =20 ## # @JSONType: diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index ce37ce787567..e3749d38ced5 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -49,7 +49,7 @@ # A complexity over JSON is that our values may or may not be annotated. # # Un-annotated values may be: -# Scalar: str, bool, None. +# Scalar: str, bool, int, None. # Non-scalar: List, Dict # _value =3D Union[str, bool, None, Dict[str, JSONValue], List[JSONValue]] # @@ -59,11 +59,25 @@ # Sadly, mypy does not support recursive types; so the _Stub alias is used= to # mark the imprecision in the type model where we'd otherwise use JSONValu= e. _Stub =3D Any # pylint: disable=3Dinvalid-name -_Scalar =3D Union[str, bool, None] +_Scalar =3D Union[str, bool, int, None] _NonScalar =3D Union[Dict[str, _Stub], List[_Stub]] _Value =3D Union[_Scalar, _NonScalar] JSONValue =3D Union[_Value, 'Annotated[_Value]'] =20 + +_INTEGER_TYPE_INFO =3D { + 'int': (True, 64), + 'int8': (True, 8), + 'int16': (True, 16), + 'int32': (True, 32), + 'int64': (True, 64), + 'uint8': (False, 8), + 'uint16': (False, 16), + 'uint32': (False, 32), + 'uint64': (False, 64), + 'size': (False, 64), +} + # These types are based on structures defined in QEMU's schema, so we # lack precise types for them here. Python 3.6 does not offer # TypedDict constructs, so they are broadly typed here as simple @@ -135,6 +149,8 @@ def indent(level: int) -> str: ret +=3D f"QLIT_QSTR({to_c_string(obj)})" elif isinstance(obj, bool): ret +=3D f"QLIT_QBOOL({str(obj).lower()})" + elif isinstance(obj, int): + ret +=3D f"QLIT_QNUM({obj})" =20 # Non-scalars: elif isinstance(obj, list): @@ -271,7 +287,14 @@ def _gen_variant(self, variant: QAPISchemaVariant =20 def visit_builtin_type(self, name: str, info: Optional[QAPISourceInfo], json_type: str) -> None: - self._gen_tree(name, 'builtin', {'json-type': json_type}) + obj: Dict[str, object] =3D {'json-type': json_type} + if json_type =3D=3D 'int': + signed, bits =3D _INTEGER_TYPE_INFO[name] + obj['integer'] =3D { + 'signed': signed, + 'bits': bits, + } + self._gen_tree(name, 'builtin', obj) =20 def visit_enum_type(self, name: str, info: Optional[QAPISourceInfo], ifcond: QAPISchemaIfCond, diff --git a/scripts/qapi/schema_analysis.py b/scripts/qapi/schema_analysis= .py index 1d12306f61e2..1aad2dc80380 100644 --- a/scripts/qapi/schema_analysis.py +++ b/scripts/qapi/schema_analysis.py @@ -123,27 +123,12 @@ def visit_alternate_type( =20 def _register_type(self, typ: QAPISchemaType) -> None: """Record a type for introspection (idempotent).""" - typ =3D self._canonicalize_type(typ) if typ not in self._types_set: self._types.append(typ) self._types_set.add(typ) if isinstance(typ, QAPISchemaArrayType): self._register_type(typ.element_type) =20 - def _canonicalize_type(self, typ: QAPISchemaType) -> QAPISchemaType: - """Canonicalize integer types to plain int.""" - assert self._schema is not None - if typ.json_type() =3D=3D 'int': - type_int =3D self._schema.lookup_type('int') - assert type_int - return type_int - if (isinstance(typ, QAPISchemaArrayType) and - typ.element_type.json_type() =3D=3D 'int'): - type_intlist =3D self._schema.lookup_type('intList') - assert type_intlist - return type_intlist - return typ - def masked_name(self, name: str) -> str: """Return the masked name for a non-builtin, non-array type.""" assert name in self._name_map, \ @@ -152,7 +137,6 @@ def masked_name(self, name: str) -> str: =20 def introspection_name(self, typ: QAPISchemaType) -> str: """Return the introspection name for a type.""" - typ =3D self._canonicalize_type(typ) if isinstance(typ, QAPISchemaBuiltinType): return typ.name if isinstance(typ, QAPISchemaArrayType): --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Mon Sep 28 00:09:39 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=1787060355; cv=none; d=zohomail.com; s=zohoarc; b=VdEmGR0mtvVwp+7nkYBe/1fhzulIsxwC3/sAzn5fnSeosNRPe9ngjNv5zXsLxdqHDoGyh+BVKRVef/HyYS+6VzTMX6nifwIwNJ6sNROcY1YyCTyQtbTd8EL4N6LDOLUeTnAHj+6atDw+rr10FBGOAymyjnvG66zEPJFOwfHwfUA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787060355; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lNt+NcdfdrXTDAde4gaKYFts/kwAUEfykTyytEmPajw=; b=GQUt1vKxK6ihbpS994pciZr8m5Cx35IGw9yVwfDs2iJmmWXSxd/djE4/ForTbOy4i+hXemj/zlCdRwpSbwzROMCi9XjhfoOy0NTIgzc6+ENyd+GjCr/wUchHBCJZT2Vz7Jmh2OvQsrge71n63JDsGl7upl/+y3K1limNDFutnNc= 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 1787060355340480.96209427566293; Tue, 18 Aug 2026 06:39:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wwK0q-0002rV-L9; Tue, 18 Aug 2026 09:37:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwK0n-0002a2-TL for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:37:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wwK0m-0000qj-A5 for qemu-devel@nongnu.org; Tue, 18 Aug 2026 09:37:53 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-332-_FNUZpgTPrS7foPm1gpzgw-1; Tue, 18 Aug 2026 09:37:50 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0363F1800876; Tue, 18 Aug 2026 13:37:49 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B18511956044; Tue, 18 Aug 2026 13:37:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787060271; 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=lNt+NcdfdrXTDAde4gaKYFts/kwAUEfykTyytEmPajw=; b=SzvPrpBYowW4GkqEWY5lnK4vO0kzm3nS4d+JjkYUdb5hswBDH5ehcAx2CObhsVSzpSlBcm /vv0i/uq7FX7aP609Yf0czgEPWdHyDs1FvHfdQL9ckTlzbcT4Xp05keHM9/Jd56W3qetlI Z3gL4tRu42J+AzrCkYV6avJqcuVhCO4= X-MC-Unique: _FNUZpgTPrS7foPm1gpzgw-1 X-Mimecast-MFC-AGG-ID: _FNUZpgTPrS7foPm1gpzgw_1787060269 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 18 Aug 2026 17:29:40 +0400 Subject: [PATCH v3 74/74] tests/qmp-cmd-test: assert qapi-type resolves in query-qmp-schema MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260818-qom-qapi-v3-74-24b8bbbe3d86@redhat.com> References: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> In-Reply-To: <20260818-qom-qapi-v3-0-24b8bbbe3d86@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Fabiano Rosas , Laurent Vivier X-Developer-Signature: v=1; a=openpgp-sha256; l=3468; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=Mt67E9MU0ECVhSiFdrQC3amyYOINAVoLsnaOA5PKLXU=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqhF91Rtl2ZxK/OQzO2fuNjNLasTJEb97f1abWN PRO2oK7cYGJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCaoRfdQAKCRDa6OEJdZac 5TxFD/91SZBFuZQL9eSnJhw0o1snY85Jdz6E7vKwPShJMuGvMVDA6pi61yeFOYVB4hlTleI5QcN 2iE1DpWRsQfrWA7RKrTId4vWoJIYcz5IPg0DUX15K7ARfPQnwTLNrx/o9A5wO8Q7Lv/vLEVbBKh iWEAXzTvF57cgT909ma596QtqaivhOTrOEGHGIQ6FPxRrmcqTzbGuMyrZSOrkMweaUN7WFpoP6p w0kgd1qhM/alZcbwJWsYHP9bzJYe9US7tofAZOpwiX/AByEN0+DiQk540iRw2lZKTZpgAV0UjK4 ImQk/ciNBFAaPvVw4WU79H3i2Gm9phLm2W5sXliLC5jJaSpdl0qMQnDE5VaIU+wmtgyjpoIBoml we/23KiIEkiETcr+MgtaIeCz7jn1FVDimRqSUHzfRJRNHRPZJaiTir5rNUdFmW9F4FYiDYdV/5L nZDX2+4xcxSu2T1EfmnJ3aOg3F0LXa3UCXtCa6aLTzSne2j67YrJH8XjQCzM9bF4pKiX6rzdqJC tNPRytOlUDcYRXIL1HqbRPPS+DrauosK3XEosAizpLhzSyA/HX+TRWAqBdCYrImyeQMa6aB6xXw QStYu/HyXblTc05YKj1g93lfG3BknTDFjCw4FG/ZgpED7ktg3SN3G1l0zC6MxLE0gyuPSVHhfQb pfo+KHYFyVgvQtw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.343, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=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: 1787060356942158500 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 --- tests/qtest/qmp-cmd-test.c | 55 ++++++++++++++++++++++++++++++++++++++++++= +++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/tests/qtest/qmp-cmd-test.c b/tests/qtest/qmp-cmd-test.c index 279a8f5614e9..acb7b0dd6a9f 100644 --- a/tests/qtest/qmp-cmd-test.c +++ b/tests/qtest/qmp-cmd-test.c @@ -15,6 +15,7 @@ #include "qapi/error.h" #include "qapi/qapi-visit-introspect.h" #include "qobject/qdict.h" +#include "qobject/qlist.h" #include "qapi/qobject-input-visitor.h" =20 const char common_args[] =3D "-nodefaults -machine none"; @@ -131,6 +132,8 @@ typedef struct { GHashTable *hash; } QmpSchema; =20 +static QmpSchema schema; + static void qmp_schema_init(QmpSchema *schema) { QDict *resp; @@ -343,9 +346,56 @@ static void test_object_add_failure_modes(void) qtest_quit(qts); } =20 +static void test_qapi_type(void) +{ + QTestState *qts; + g_autoptr(QDict) resp =3D NULL; + QList *types; + QListEntry *type_entry, *prop_entry; + + qts =3D qtest_init(common_args); + + resp =3D qtest_qmp(qts, + "{ 'execute': 'qom-list-types'," + " 'arguments': { 'abstract': true } }"); + g_assert(qdict_haskey(resp, "return")); + types =3D qdict_get_qlist(resp, "return"); + + QLIST_FOREACH_ENTRY(types, type_entry) { + QDict *type =3D qobject_to(QDict, qlist_entry_obj(type_entry)); + const char *name =3D qdict_get_str(type, "name"); + g_autoptr(QDict) props_resp =3D NULL; + QList *props; + + props_resp =3D qtest_qmp(qts, + "{ 'execute': 'qom-list-properties'," + " 'arguments': { 'typename': %s } }", + name); + if (!qdict_haskey(props_resp, "return")) { + continue; + } + props =3D qdict_get_qlist(props_resp, "return"); + + QLIST_FOREACH_ENTRY(props, prop_entry) { + QDict *prop =3D qobject_to(QDict, qlist_entry_obj(prop_entry)); + const char *qapi_type =3D qdict_get_try_str(prop, "qapi-type"); + const char *propname =3D qdict_get_str(prop, "name"); + const char *ty =3D qdict_get_str(prop, "type"); + + if (qapi_type) { + g_assert_nonnull(qmp_schema_lookup(&schema, qapi_type)); + } else if (!g_str_has_prefix(ty, "child<") && + !g_str_has_prefix(ty, "link<")) { + g_test_message("%s.%s %s has no associated qapi-type", + name, propname, ty); + } + } + } + qtest_quit(qts); +} + int main(int argc, char *argv[]) { - QmpSchema schema; int ret; =20 g_test_init(&argc, &argv, NULL); @@ -355,6 +405,9 @@ int main(int argc, char *argv[]) =20 qtest_add_func("qmp/object-add-failure-modes", test_object_add_failure_modes); + if (g_test_slow()) { + qtest_add_func("qmp/qapi-type", test_qapi_type); + } =20 ret =3D g_test_run(); =20 --=20 2.55.0.543.g5ebe2ebe4ea8