From nobody Sat Sep 26 20:00:45 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=1788552050; cv=none; d=zohomail.com; s=zohoarc; b=iIPtXXnw3ZpviNgimt80pNHl4KvBz1bwbsv8jCX5n2BWbuA+sgOOV0qSQFVXTj5pun7JQbymvdDwDYnnJP3sNjRLEkwboUsSOQjoM/1bvaMyrSb7vmB5EeQWjvJvdzR4K0vU6km0biXtINjftjVhwfZGKMkqRbOpTFmkoXuR1fk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552050; 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=AdfI+Pe+70O6qX5n2+EZZLt3+JsrHYn62iKgj+VDFgYe7488N6plncaLck7jqwHbreOIr9KnjyaNC54GT5OqMVBcihY8PQdUP3KsRF8wQOjMlB2jCJPEj7TbL3vtN6+3ohaQrejzOmKe9rNNKiuz0g04rneAZO1uFrBgXRf9XBI= 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 1788552050204152.28778484008296; Fri, 4 Sep 2026 13:00:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a3I-0005V0-QB; Fri, 04 Sep 2026 15:58:20 -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 1x2a3H-0005UR-5T for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58:19 -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 1x2a3F-0007oo-An for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58:18 -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-464-T6SQEtfmOeeduD-zv1Xz4A-1; Fri, 04 Sep 2026 15:58: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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 210A01955D6B; Fri, 4 Sep 2026 19:58:12 +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 124B0423; Fri, 4 Sep 2026 19:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551896; 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=HeZldCknoqujFr2EOMdPGN4nByd+l6bAJ5yyRpa/s+Rlr64VaYC1mVzLy3zctvoTktTHeo iNPU6WPIO+S9wxTGl51A/lP97aFSWuZ2oEIRkFvcMBeD3WfQ3OkBq/uY21JWFaShGYhP0M mOOz5JsIJyUlp37sR5qLXABvmJrjFWw= X-MC-Unique: T6SQEtfmOeeduD-zv1Xz4A-1 X-Mimecast-MFC-AGG-ID: T6SQEtfmOeeduD-zv1Xz4A_1788551892 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:57:44 +0400 Subject: [PATCH v4 01/75] qapi: add QAPITypeInfo struct definition MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260904-qom-qapi-v4-1-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLIUTG7RIy4KDgCLej3aQxJhAGfPTSzcRHlq rfV2ZSwHIKJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyAAKCRDa6OEJdZac 5TlpEACxAHpagcHNp+UmFUjawdo++yUpz651pi3KhvHMOhSRv338V+Cd1o0z26L0A+7acpx2Zog RAiFgJrvu0ohG0rq6/k1z11+3qVOkK1IZ3VoK1MGAFzHrjdJ/osmNcbPdyVWDFM2jLpooN8DFNA JnlV8n8ICm2O+i8BgrWe1wpos/ba8Ticfs92N6eXZ5e//xgh0hvM9GhVUu71Q8zqgaTlnLpdWxW OtRpqbJQiHzdzI+L5V1+IKBf4lRWi+rh2F+L9z6nIv+Wl2oI62bJlPyc3vyQRSBa22InqAb54mK nCmZjXbsGyJJdpQ95n8LHt68N3or/iclxW9swXc5bEbv+ggGBzwmgahc6WEjslUekp51jIwLjqi Dto1A5dIkkYGaDArQDhhHNDVddWswjNYs0McEu3HH0NggrYKH66J/LV17k1RlzE+Gz1/mkZPIoC 9p+Ka8ncXD4pfdbSifjgNnj//jqb1zoG028Gut7N4vAR9BoLWXEiwpBoNUoS3MzicUk//W0+snY SF7RuWZaNitkqdFnOn9jwd12QkBxv02wNbai0Fa1HgCGWbgL4gaXUAIySOPHY5HRPlamLqeBjMe qF0IlACFwcEOniyZFRNmMWrj+S8XlF8I1cp+CwK0Td1+59wiXCYpgg/WMSNE+uyIJ1cfGbOAca1 0LlGDIEf2QXNgmQ== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552051617158500 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 Sat Sep 26 20:00:45 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=1788551921; cv=none; d=zohomail.com; s=zohoarc; b=BfaS41z/b8e/nY0FAiCl3pfGQBssfO6+LlmtxJV9pYg1aMlYfzawsUGhO410xvhXcyT+J+8CO4hnAd0LbKsY8uNUMJvAlKidQYHvV8DKik0YE6SNptL50pKGqpZOJUnsQRTlXeO6/kPoHdwW7FUj0NTVF+97K6zqdueo8LrZZE8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788551921; 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=MxD71HW2ME+UhxPPlLUyBCSLP97fpVrG7ulYbTX9hldBQYE/PCIo8vAQ6RRuI2kbAnapOy2ilT7vwTFlee28FnFKXJcxuGTN7Or9gUvL1TU3N4OWvYdcNh7n6uwV/zC8JbdS24uEgs2NziCaPD/QdFTYtjkBGtXLhJokRnBof/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 1788551921269893.9444448826312; Fri, 4 Sep 2026 12:58:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a3L-0005VS-LU; Fri, 04 Sep 2026 15:58: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 1x2a3K-0005VI-HF for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58: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 1x2a3J-0007pU-27 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58:22 -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-136-7EEBlolUPNioKHHealAeGQ-1; Fri, 04 Sep 2026 15:58:17 -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 0A0311888F01; Fri, 4 Sep 2026 19:58:16 +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 DC1441800642; Fri, 4 Sep 2026 19:58:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551900; 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=iYmyrdFWCyjCP7luEU79VK+iNrF1rB5fBYeLr+FoF6KafV4wadTRhQFFmGxURvrz0FSVMO QgwQIlIhkEnGjJs0mAyPpB9KhI/qd8gsHi7oI+0kOs9ifh46Q0q7Xg+JDlWDdKV/RWhkqn oNs5CzhiNKSDIZxA5ZPN93d+B4DRqDg= X-MC-Unique: 7EEBlolUPNioKHHealAeGQ-1 X-Mimecast-MFC-AGG-ID: 7EEBlolUPNioKHHealAeGQ_1788551896 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:57:45 +0400 Subject: [PATCH v4 02/75] 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: <20260904-qom-qapi-v4-2-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLIf+XjanGQ7KLk3Tr1HQrk1sfy48u6jtUKR eZX6Huc/6WJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyAAKCRDa6OEJdZac 5SPEEACCIFtd2bfjXgFWJM/8ArvL1dElVcXTWhBt6xVBheyOmEwLJmQJMcr6RcosQcrWU2Elq6J 8pNpBtG/BMPFQyKWpXgver+F8ksJlGl7FRK0lbX4mtQcAr/cXvOEqXMOG2oG9p20/fVK5ry549E ZeFnETWvrARhKDL5Pp6RZKjR2V9ahPXZokPhx7xKigRcJO4RWGxSNQRSP7ZGiSBRPc2GinUvVtb 5f34H4o6/4783hvG+w3lukSdBiBKjyULi6sezj0ly8H6X+ZLL1yS3/yVUG7WOfKyUbG7j/lxgQ1 CTYV30DI0kHW6zzWT9w/7zXSsX02BYglAXzQ0tXIjlhob91vrOtMEZhhQ1aFxsJoAYvKOWyZZVa QsKQvRB0E2E6X8TUTSBURvBK+KOugCKVKY6digd8WmSFeuSTh1QkCCPmuVozctLlIPHAN7oI9qf rkEjOadfEIHtQrrVl2TvixF3zToy7LNfnLjk9YSO4isP4aCrtWqb4GBzlBP1bTa58YMWo7l0C09 6HtHfMNQm+tWcLA7XH5nCy96CroOqeLcJkbDArt689sYLw7cpLJezG0GJ1MboXf1RTS1259yM1o QZobpNmTNbwf+LW++dzfdg8kzIIW+4XayJIs32tH9VMXcLIO2CY7OOHI5niHpJS8yicCjR1hKJw gqDwuNHtksWNx3Q== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788551922987158500 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 Sat Sep 26 20:00:45 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=1788551998; cv=none; d=zohomail.com; s=zohoarc; b=VQzt/DvOj4aCpuex7JRyN7576Y8C7CC+hXvS09PsD4R1rW/NSpJCcaz5ejWmsBCjsyNbL1efxJmYGb7Q3IxmNi595mEX0XWsWg7Qludo2Kd8qRhdixhFKs7lZMfUJ5jDa9EhqA1eKttchzMn+19EcHkAzcbIwmWTsNj9NGv2uwk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788551998; 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=0IyI6tQXCcNeMsf0ck978vGP4A8R508BayNZWAOWYnM=; b=l4qEoECnavZhhsnDcdKsMzx3bpQRog+f6VMgU94VIWxF4YVxMYBZn8+tifu9PAhtKl0N7RcpbOKi8O/KfdBgQGZi97cftxtIRqIiwAEpo02yHzwWygRQxU6LzCJ13CdQ+fAsY8DUYKc22mqrkHv82BqpdsviNleJLXCqZMOHpD4= 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 1788551998259613.6630990850479; Fri, 4 Sep 2026 12:59:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a3S-0005XM-H6; Fri, 04 Sep 2026 15:58: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 1x2a3P-0005Vx-RB for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58:27 -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 1x2a3N-0007pz-B7 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58:27 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-677-elo1RT8BPheZvapTsE5PXQ-1; Fri, 04 Sep 2026 15:58:20 -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 B311E18E9B2B; Fri, 4 Sep 2026 19:58:19 +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 5C24C30002F5; Fri, 4 Sep 2026 19:58:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551904; 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=0IyI6tQXCcNeMsf0ck978vGP4A8R508BayNZWAOWYnM=; b=NjHTzPJJF+nEAMMNU5o/mLaTRPiHXK2xuYqN8Qe1vn+kjHhPaInDqHpWCaXxXlp2Nh/spS MwF3E7/qliZlHKLJIu5F27siEdepWDuW4POv//avC5dbPkYQKu1fYHB/1h6XwZ4qjxM5SS EOsFHtMrlfBHZE2AqA/Syaz+qrbyjS4= X-MC-Unique: elo1RT8BPheZvapTsE5PXQ-1 X-Mimecast-MFC-AGG-ID: elo1RT8BPheZvapTsE5PXQ_1788551899 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:57:46 +0400 Subject: [PATCH v4 03/75] 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: <20260904-qom-qapi-v4-3-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=orSwB5aVnFipZW88PWn4H8cUfTf992qsMca5g88dS5A=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLI2F68UM1CoFwHNFUZLsxrpgTROoHLwMJUM hZgp1TLHFCJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyAAKCRDa6OEJdZac 5V6xD/4mEeWO5g0GfZkQLLUNFlT6W7c6NR2fjniVW6tTJrfVokpn6ogjwnS0qkPCnuwZIMSGIny vE0Hqj6MphcBZJXVt54WUZWxmAH3gKglVNmjGXG4UjNV+TosOIKrJxyCnFrsy4fi86iLHY0pYpc RWwmZMK+Hv/fuirEChoAkTVNYX0l9+hJmhsWl+D4R1kLinx29NqZVyEdhm8R86dPQ5AGdBYVm2n fcuthW3uQ0R3K0CpNSVPoVa0DXG8SKCSYtnQFBu8yK5omgU7mJkQRtBqiWGMl0DakMff6lCOa3n W8nhfLmBEeGBhxiMjO0Fh1qbDnnDjx9sbUJby3qhnzcpK5Xo3mpwLnPYcBguvK9znX5OazqoRgE O3NGU24KP/ZBPAQ2MtrrdXhVcy4OpzfbiNR8W0KAutoNutVtB7DWyuUafLm58jLVVJ1XhPp8K0x H+Yp3Pc7/HUClGnIDfbpwaQMmToONiwShnu4u7uy8Y9VcIu+bif+Rchwr00FISb7J/SZLoms6W2 S8hqzuIXOI9DfsRUTVGdStw6xZ8xmBLJ0PjqtZWwGJbT/9gv3Et6YM5yENu/cjMegj7ArEAkFXW fiELL2b7CdGhQAxAL35V/Bz+WxdQLrJ4rLkzR3fMtSVJgVzYTBux6RDyAaMns/uBkcch/ZDMqp0 oJctONf/6W85YRQ== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788551999380158500 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 5c9de307b081..e797f84a4084 100644 --- a/meson.build +++ b/meson.build @@ -3504,6 +3504,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 Sat Sep 26 20:00:45 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=1788551928; cv=none; d=zohomail.com; s=zohoarc; b=lg0zcJcqE4QVKwyUkgSbwMBhIwIUjPH+2IDvokh2iVOExiRXeSPobTCmgNhNgDZHu4fVa7Scf6NhfV43uDn+RhLxynxHERMJBlielIBrxvj6yNyM3v7NET2wcKtkNlz7Cy3BvqEQ83f21XB6yj8HQyDg9W3mjuzWkcJPumgm+Y8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788551928; 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=C2cFf+YhK2lblvYMs1wIJqtoBAQB2xgU7J8qozesU2vC2bZkubCBwgr5y3IrkBxEr3h+lDArEKuJh8P8A2HkWCEF6I+MOhN3SJ+PLA68ONqPTz6Sut5aFbqkmeysd+Xc/Qu5Ra1SqgS1+yFPLg1lWBnv2hpEn0Yxep9+c8PPT1Y= 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 1788551927970387.45975698224595; Fri, 4 Sep 2026 12:58:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a3d-0005h5-Op; Fri, 04 Sep 2026 15:58: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 1x2a3S-0005We-08 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58: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 1x2a3Q-0007r0-2v for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58:29 -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-664-NCMGYen-POGcogvyyFClEA-1; Fri, 04 Sep 2026 15:58:24 -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 336E21954195; Fri, 4 Sep 2026 19:58:23 +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 65EBB1800641; Fri, 4 Sep 2026 19:58:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551907; 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=d5KGbdQswxOohWqZktMWeQ2ZmC0lX4Ix47PHIglAjdMIa6qfVlfVYaCYxVwornVGOwwjvf qagpjBpjkakvndUM7FFqXoFhdL02Y6jAwuWubiuvIj5kZx/BodWd2KqhluRQcZSH4Hc2+E 9mbgoonZ8lhdDpVCcBHt09JYsSUtVLw= X-MC-Unique: NCMGYen-POGcogvyyFClEA-1 X-Mimecast-MFC-AGG-ID: NCMGYen-POGcogvyyFClEA_1788551903 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:57:47 +0400 Subject: [PATCH v4 04/75] 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: <20260904-qom-qapi-v4-4-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLIKwqk6ovV3dklKJ1Jz/TxvcvcBaAGbSkpt ztlLyimBgOJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyAAKCRDa6OEJdZac 5YiGD/9yLXGmYh9F8WTfXtmEpvwkF8uwJNsF9bXrS6nrG7M2XQWc9NsXbXwZWd47Gebc97T5/Jd ApMoRTmX7hXXHMDcfk6V4dH9H/huQzp304H6R1t6upKxIykJqkczwhZ/viMVsJepOh0aF/q2Z86 4YmstLlHYhuLBrJwSnoLavCY/K0IOYIRbhIRdzEUq3mmbX+g80LFGfYJcJhsT7b5gJNqVrmVFmR xXpgQyMedQpQbgVMMHPgcwFHfwN3grl+Xfghqr20DL+3s7jU2wJjiqkC8n9NvlYBHNSPR50muK+ V4Dvg0AVaS+pfzh5OnVy7qEgXiadhdCqOMqOARTj4XgFu6clv4wx2dYeSeDDK8OY32KsJv2RC4p tJBOBSqdf5KwGSP7MZpAnV9/5PP9eYajGihxj3gnMEhdA/tqM/i/NhqCkENy+ODlCYNCUL7s+9K muKnm1URJbBXRUE6kggo/S2RZIPGIa3VfTkBWwkrhhy9CGVRDX0LrQsOjevdYUW+6zLzKeu4N+d lL1PUyN79aHb0331mWvO4nwdUhNdZTJE/gPdcHoPMrbqhi3qz3k71COkrEm8DKpzpXsJt4OQgge 6TFyY+/0RR/0lA5c8rINaVZNQL0hc+xqdxqK0uRRavUDBYZjlMBOs7JOIHmm+YLxEXjMNjxN+Sp 0Pv5jVD27h7LMMw== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788551930957158500 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 Sat Sep 26 20:00:45 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=1788551984; cv=none; d=zohomail.com; s=zohoarc; b=kzKLNFRI2qVKAKSUexCCR1DngPAjUO0aLih9f0I9oy/R+EZLLHUFdoTjNH0lF9pL4lsvOg799OELer+Bm3VStg429p6rta/KwgqvNMj8IGJXyM9UVIoXEErzU38mTK0egCpyUGEfDmCMa6EU+SQHjFHKMIDttdHA2EvaBvvx2V4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788551984; 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=Ic4EjXgrtSUPuNqFIPI0m7Y2ttLf/6XC/8f9sQ/RUW0=; b=Du482KHh/2RJMtfBav5In4jXls1YWNzHPHbq68a7T1KfZfOYzBlBQi078pwsElET/M78TSFWCa3yW4ur8X2XXYiN5FaALDh7Okyu6TJqEfi92scNyED5NN/9xITD4X4gmENaWHEL89FrBuVGhf7vb2AnaB21aCgmJiuorrBNG8Y= 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 1788551984448331.73477429827506; Fri, 4 Sep 2026 12:59:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a3h-0005jp-5c; Fri, 04 Sep 2026 15:58: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 1x2a3X-0005dY-Ju for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58: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 1x2a3S-0007rD-3o for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58:34 -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-653-b8OprNLfOJ6LkMS5uRWcWQ-1; Fri, 04 Sep 2026 15:58:27 -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 B33D61956047; Fri, 4 Sep 2026 19:58:26 +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 87D571955F01; Fri, 4 Sep 2026 19:58:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551909; 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=Ic4EjXgrtSUPuNqFIPI0m7Y2ttLf/6XC/8f9sQ/RUW0=; b=gcarMcJnHZDCbGkhUflA8+cja7l9G5fppWB03mXPP+heIH14bnDD68x2OzoQeX7i2892AS sF5TezvLm4OPhHSsRwYipzKTC/z0YW42Nt8n0T5yb0PFl9OKGrKazb+2XWqnQXOBBYvb8y Yvdai+6bTV7lo0ySM77ZvDIlOygasZM= X-MC-Unique: b8OprNLfOJ6LkMS5uRWcWQ-1 X-Mimecast-MFC-AGG-ID: b8OprNLfOJ6LkMS5uRWcWQ_1788551906 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:57:48 +0400 Subject: [PATCH v4 05/75] qapi: add type-infos generator MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260904-qom-qapi-v4-5-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=CbKXDoXvTNg6CeWSWHTbKRHrjowq9Jq2cASDIzohR1k=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLIhXTT45QgNeudb0c8k5UgfH0FPPlrz8SKW UV9jvbd752JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyAAKCRDa6OEJdZac 5T04EACiuV/6iqZJBvMH/H3hNq0GvK+ffJHqPf7Fvc1xSb+s9u285Slx419vy4MOPTba7r9EQ3r ongyAE6tteBI223OexU13Tr2CTeV0fm6D0l/aFuW5wGdEJ3jNYC/FEXfVozLQVxAyMigrjCdrsO rRhdDWmjThR3vCdQFwawbiHsBNBpwDpNIsNkir0ZTvOY8Reo0gg750rgarq8K91RgDOGeM9kBye 5gFs851Jd8/GZL+pZbYaNgzwSZTLWQPGYKPB+RoFuFOzODDlUr6fRlak9Si8wZIeYq7S0oIfzOP kut1W8EL+3Qd0IW8uXDEez/XqDHDNwhXanfZuH/gPUM2s4FpxuWxVUKlFtYoVkCq2jDNcL7yjRe ZRCjIWeZ5bOwWDSs+L+RqL32mLAB9Uq0ZFIc7aKDn5JgUDbpl2Yh84Na/vXuzSvxzLg6YPQQDnV WA5fOPBRKoL22iLSR7rtOiNUxCP4EKKBnn5ldRsHfLst6+3jLrw/HAfAlVQYw8yTXLVAT0Uqwv9 3s/yMSHI5rYHjaq6moKpTRL93p0q/+cEXob80gJ6ZiDH8+Wmc7GcWfcFqV0wXkxavHYdjv4CQwX 5R7W6Cm64M4+roRIsMGMDUaV8VpWPpVRvGKz6WQtA6AJ2T98Ark/wEYtYjADh/y9oTExZr0s8Cc GT24pwy8PwHGjWA== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788551987385158500 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 e797f84a4084..201924cc784d 100644 --- a/meson.build +++ b/meson.build @@ -3506,6 +3506,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 Sat Sep 26 20:00:45 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=1788551959; cv=none; d=zohomail.com; s=zohoarc; b=GdVE7zgEpLyNHkt6JTJTsNOw3vUbqt4OpIowYDGMLpmMzEn3w/N3sf4HIrEIhKugiQeoFxGisNRBwlKgnj4lraAQ1dAC9KafX3EoZIZaN2V5+Cq6cvSI8mKUKVy8daRB+hl6AeZpFuXjtOML4vZpFY+YYLsg7mieIWrnLglwPro= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788551959; 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=lpvgvOGWVo9OxK8Ei1cqCyXxJf4Q/kyOC4bgNsQxy+M=; b=hHcwwmDzSENPRPIAChgBd0/c2aakFJF95iCj5yl2iypKz1kLuSEiyfNe9NJ5EP8ikvr+m9idzzx1nlKln2hU22p6ToGp1HFwtQW9u3q7YgsMk1S2OGrpeoytw1FrOOwiKXqM4+Nf+ACPNq8u4s+wu1E+HR4rwen9MAX/sQDctgw= 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 1788551958975510.4902731862521; Fri, 4 Sep 2026 12:59:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a3o-00067E-7c; Fri, 04 Sep 2026 15:58: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 1x2a3b-0005eU-As for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58: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 1x2a3Z-0007rg-6h for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58:38 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-490-nYZ3eszoOPafbUYov-321Q-1; Fri, 04 Sep 2026 15:58:31 -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 5611E188699A; Fri, 4 Sep 2026 19:58:30 +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 784391800641; Fri, 4 Sep 2026 19:58:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551916; 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=lpvgvOGWVo9OxK8Ei1cqCyXxJf4Q/kyOC4bgNsQxy+M=; b=Mc/TOoW0GxQCVDYw5B7vLbwnxfzvpyiOiWgDy4FvsnTYCcp8+5hV/T3xLvAUBLYmz7R5x0 8G7KznIo/D5JdyH8GMhnydjdsNZo0iQcimIK6q5ROBvehA6YXAVkdJXpCsmXquQ7raR11l frEqg3OdZWqcxYjA12LHGSnOPrOT4sU= X-MC-Unique: nYZ3eszoOPafbUYov-321Q-1 X-Mimecast-MFC-AGG-ID: nYZ3eszoOPafbUYov-321Q_1788551910 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:57:49 +0400 Subject: [PATCH v4 06/75] 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: <20260904-qom-qapi-v4-6-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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 , Kostiantyn Kostiuk X-Developer-Signature: v=1; a=openpgp-sha256; l=3972; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=OQFWobNHBlEQPo20iMGdvqBz5u3E9h6m3axk+nNGjfM=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLIg8b6JICpWOLx8ovqDK0g9vzSjl+4X54AO tiZ1Iqt23KJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyAAKCRDa6OEJdZac 5c7JD/9xF/O9+PteGv7paNx+bX96G1qJaVeHchxndbb07A2WXZRainTzFtAHoteR3d+1B2XkPJN +EJDRk+dSinWxWnQalvH5laV7zZQ76p24whOOjrUUjUkFHWJhpowkLo30NFcFqYNvi0vl5db0Zi mrGfBXhrfto4J+p70MoV+OD83XqsYIk2J8EfYF8h1AOc/e27tmZr+5mt8Anv+n552AitiutAKVw /RSKW+Nv4L+GocBk9rDNQMJG2xkE/ZzuDoDu1Zt7nlwqew49+arObsZJCyIpwx/ImMK4vgf6Zg4 bDYSiXFB7Co0gt/poLVyMrAZTQRlHMqWTwbLA/EuIk4xCNIeJhOk1BDCo4EEJCf+d1HyllWaNTE hkbysYB1LK2Z86VTXoWzODLl7DaMa3YgxwmMpd3FuUdReg1eQIFeV7+RvvHE9yancs+3KfDqF4g U3k9Nbtbc0RNiSnx1ClqVVnacmyPfNiryWrhoOToGQ5HOT+imKyq5zJVzNuOdQphT5Hph7YQ+Wz wS1NXvYRu1GaLVX3YWXeKgKqzPM97KoG+2EJY6EMpzufDYllbwcvapnHYVRekgpIwp+rg9riil8 LGhyPZpjnQEjsOzLdFAQCNcIUeHHCEwMZgrYQTgHuRAY4rUPYSvWnG4QZuDcqsmRxonFSCILnwW nCu25X97RsHr79w== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788551969053158500 Add the per-module type-infos output files so they are compiled into the build. Reviewed-by: Kostiantyn Kostiuk Signed-off-by: Marc-Andr=C3=A9 Lureau --- qapi/meson.build | 4 ++++ qga/meson.build | 2 ++ tests/include/meson.build | 2 ++ tests/meson.build | 6 ++++++ tests/qapi-schema/meson.build | 1 + 5 files changed, 15 insertions(+) diff --git a/qapi/meson.build b/qapi/meson.build index a46269b5a0c9..7477953492ad 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -79,6 +79,7 @@ endif =20 qapi_nonmodule_outputs =3D [ 'qapi-introspect.c', 'qapi-introspect.h', + 'qapi-type-infos.c', 'qapi-type-infos.h', 'qapi-types.c', 'qapi-types.h', 'qapi-visit.h', 'qapi-visit.c', 'qapi-commands.h', 'qapi-commands.c', @@ -88,6 +89,7 @@ qapi_nonmodule_outputs =3D [ ] =20 qapi_outputs =3D qapi_nonmodule_outputs + [ + 'qapi-builtin-type-infos.c', 'qapi-builtin-type-infos.h', 'qapi-builtin-types.c', 'qapi-builtin-visit.c', 'qapi-builtin-types.h', 'qapi-builtin-visit.h', ] @@ -96,6 +98,8 @@ qapi_inputs =3D [] foreach module : qapi_all_modules qapi_inputs +=3D [ files(module + '.json') ] qapi_module_outputs =3D [ + 'qapi-type-infos-@0@.c'.format(module), + 'qapi-type-infos-@0@.h'.format(module), 'qapi-types-@0@.c'.format(module), 'qapi-types-@0@.h'.format(module), 'qapi-visit-@0@.c'.format(module), diff --git a/qga/meson.build b/qga/meson.build index cfa2157efb23..79163b7d8e93 100644 --- a/qga/meson.build +++ b/qga/meson.build @@ -39,6 +39,8 @@ qga_qapi_outputs =3D [ 'qga-qapi-init-commands.h', 'qga-qapi-introspect.c', 'qga-qapi-introspect.h', + 'qga-qapi-type-infos.c', + 'qga-qapi-type-infos.h', 'qga-qapi-types.c', 'qga-qapi-types.h', 'qga-qapi-visit.c', diff --git a/tests/include/meson.build b/tests/include/meson.build index 8e8d1ec4e692..026480d96851 100644 --- a/tests/include/meson.build +++ b/tests/include/meson.build @@ -4,6 +4,8 @@ test_qapi_outputs_extra =3D [ 'test-qapi-commands-sub-module.h', 'test-qapi-events-sub-module.c', 'test-qapi-events-sub-module.h', + 'test-qapi-type-infos-sub-module.c', + 'test-qapi-type-infos-sub-module.h', 'test-qapi-types-sub-module.c', 'test-qapi-types-sub-module.h', 'test-qapi-visit-sub-module.c', diff --git a/tests/meson.build b/tests/meson.build index 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 Sat Sep 26 20:00:45 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=1788552142; cv=none; d=zohomail.com; s=zohoarc; b=XpNKiRtVCNWuEcxoPZg3NLOqLe+vK9SLgae3gPUSVqtC7P1AqrxH3p0aIjGLnN7mU2ZMtDWeIeK7gaXWoakhynJ6ujZyujoMeeX+TE+IRKkS/Utr5ubsIzNcQjmjshQWnyVjf6ElYoHkU6faF8H70MhuBfeV6uBJWuijBrjR0Ac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552142; 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=wA5ZYh8MpPrdHBifS5Sy8EfpUvGUk61xfShZ6xpVkIk=; b=VDkbWXKW38Wdy0CDivdStGj996ySMPbaZosLO7wUpIvZf7tWvKic2vHotREbl918MrDWr8szn2j36MRXJGMu2jgJSU4ROTtGSOSRo7KBYnzknNl3f5U7os3JzYb5FZ+eyB4lIpe3e0vPj9i5KGEhshH/EIfeiBNgI+0avhCUk1s= 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 1788552142415854.5299656447756; Fri, 4 Sep 2026 13:02:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a3n-0005xs-7h; Fri, 04 Sep 2026 15:58:51 -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 1x2a3c-0005gv-MG for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58: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 1x2a3b-0007ru-3n for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58:40 -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-357-765msNDrOTWNPddZSZdkFQ-1; Fri, 04 Sep 2026 15:58:34 -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 CC60E18D6358; Fri, 4 Sep 2026 19:58:33 +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 B0ED61955F0D; Fri, 4 Sep 2026 19:58:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551918; 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=wA5ZYh8MpPrdHBifS5Sy8EfpUvGUk61xfShZ6xpVkIk=; b=FefUj7MVK6Bc9VPtacRDWaOhYUvo/0z47lyct21Y+SLVWnO7yRvFZoGW28IDYTvnRsurwq Q0OOeYh9KIXOjVDippw8J7Wze8xrcf0JD/fHaCaOzX0XmmjDOfL9/mm2SiULKl1RZKiYsj IRroYueB4ptAx0NH334IbjRJyjQhWi0= X-MC-Unique: 765msNDrOTWNPddZSZdkFQ-1 X-Mimecast-MFC-AGG-ID: 765msNDrOTWNPddZSZdkFQ_1788551913 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:57:50 +0400 Subject: [PATCH v4 07/75] 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: <20260904-qom-qapi-v4-7-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=rBD21kRNCndFYKRVvLYoL4BXy2V04K02YlZGAo0wzbo=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLIDJzBTlZ4gA0G5vw6qppSU2IsAuGFk5RS8 9pI8sz+r3yJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyAAKCRDa6OEJdZac 5aXfD/9HmV1kikj7tiH/YtVFasTsbncoTk5SeFaG8ScOP+Sxn4w1nwdni8Y6wBOt5ywh4EFD6LB LtP9FrxEBxk5opEYiL75UDUUtZxieY81Ssj0/q5HPDEVM5tZHVIdOamahZ0Xw07RYviYGIM/0fC Jsue4dTPwfHxLIbfdof5qYK5IBq6PJGHgRqeAiCbQcbF5AojCekfiOaePRNoIoAPFrgQhSmb4ED orAv55DZYH9uSGg9cQ9N69klex80dAf74DhRiIJQmKK+FdXVQubOdlYE3IlqwxuXJjDX9CjmCEf VBT+SJp57uAzW84PHGaiNCMwzQ7AkIrNU+rpI8e9wDR8T15Q2fa5ReKNNOf67H/L9k95kgBoQSS mm5OXLFy4wwaTcxnlrSlNGFTUcC/ZrlWe4TCL/7xaUu1RweOLJs/DXfwkXxpB5jLW/Zx1lonHvt voK1s6GVfR26oKjMa51xGf+412SsdLUG3eNOF3AQxjQNpHCRvvUMrQKbPQBBiGt1wEsSUu66Ff8 uWvW4Q5rXx1WTFokG/LILpm/qiTBkY2UZVJnmqj1em7cze/qwBc51XZAXAFb2r/kA3I5qVcFp2o m8S2X3JvBU3ime4p1TyR6sezy9RBWgBXAU6kjI+Q6g+9XMqwtoXwlHz1JKMbh5zffb3oUPclRQc bHj34d0vTQ4vN/g== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552145563154100 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 7ecd0f210fb6..7c7e69a2a1bb 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 b1834a57cc9b..f782e21f1a30 100644 --- a/qom/object.c +++ b/qom/object.c @@ -3112,6 +3112,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 Sat Sep 26 20:00:45 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=1788551972; cv=none; d=zohomail.com; s=zohoarc; b=VorvIEQtS59wxmGCxhBGAbArzANO3Ar7m1aMFmgJ9rn9WkBDyk36QCUQfFQ/TDSghlyqCCiAi4aqgrQAP5RTmZmZtIIYdsxjXIz/jQ9kkuvvf7r8WSsC+wmykrs9SERTGRo2LvmT2XnjZPdWE87Zzt/DU178oNRrANbbfzXTW/o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788551972; 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=8UjKcKZjfqNOztaNAGUvCYkUFXm/hViMltfmNYS5qu0=; b=TCP4xyvMA2MpSg0nEe2Yh4Dcl5SVY6KINJoaCKyXsLPkc5aDMnZwxinLlSdCRbVZG/7XStBt/f0yWKrOU461m7abZF0ddJpaTX0KOdUsQSrJ1r1eRPMOilmEBF7RUe0BomvnipDmtHtNN7rqgCJJ52Dx8ztpdV7UVHS8X8/Eb2E= 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 1788551972204629.845082845798; Fri, 4 Sep 2026 12:59:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a3o-0006D2-V5; Fri, 04 Sep 2026 15:58: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 1x2a3g-0005k5-HZ for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58: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 1x2a3e-0007sW-VV for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58: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-587-xQuCzWotP8mGgqL9D8M91A-1; Fri, 04 Sep 2026 15:58:39 -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 9143D1893ED5; Fri, 4 Sep 2026 19:58: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 803F630002F4; Fri, 4 Sep 2026 19:58:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551921; 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=8UjKcKZjfqNOztaNAGUvCYkUFXm/hViMltfmNYS5qu0=; b=R/Yr4budpjUV3F7sVF4YewFzcU1ENEHBlWPs/xXAmCW/pJPXCxy9xkf4aKXOttGMeMH2+I IO0njtKTv9lucgMV/WvPNFk6D6U1DnQ36oJQue87QbcKrJEGOIBIoG22RHvq97Wd36/Ax0 JlsCUCcfseJeQFgKo9i1mpBA86b/L5E= X-MC-Unique: xQuCzWotP8mGgqL9D8M91A-1 X-Mimecast-MFC-AGG-ID: xQuCzWotP8mGgqL9D8M91A_1788551917 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:57:51 +0400 Subject: [PATCH v4 08/75] 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: <20260904-qom-qapi-v4-8-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=RzrWcye6kOLM0FYws/ink7WuC4CDlZtTRGBMe3pAJb4=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLInlKDa/DZ0YARR3otwfZuK5KqGXTl8SAOY 0uyi83Ld5+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyAAKCRDa6OEJdZac 5Vs+EACIDA7ox74cCtG4JGuhLj28M3/vlRhZ594YjJqG5kCquocdDy3pgZ7x44+NGN+3nAZ9i48 qqwcvqbnIHPlZPo2un4yd7xE6aWLgmfok/o2D2Q9zjwbdGjQJzt/nW3EzoSKOkRNvaUVnpQMnLf f3+z6NDSmDqQ26m5gcIkdzJZOAjOI+rodwE4gfIy0ofWIpnGmOjtuAZvR075ieVdilCguR2SOT8 ClYJeEkHoFRczWNs8LGVshj0OmI0Ke3efZ0s5JKIsUVW2SFTPpgL585l2ml9n3UzG5QPw4ssJNq jAkRPrvfaR4jkyuhLKbHP6ONP4ZK4qKfiD5U8okAqr0RJQmH1pLFGJLP8fGG5T8I/ZPZPL/iaP0 su7T7bypaYDQA4+p7IgwF37CFE0pb+Z+Jn0agV1lsCSpkqP1yiNiWkCCqfi3vyn30VHKQwHru5C 3NQPKiy1wx0nyVaTgQbGcXZR3QQMT8JRaSJ9oEMWe1ssinVhk7Shr2NM6VtqBUuBvcqNocb8lee YYOitn5KUfwB8JMp3sJMZshqmw3fn2ynnKzKqmUHQbXWBCQrzDMClneh7yYhqZ3AlOS+VWlvUVF ntDjyBLaiyNwWUhaDwgBEN4euj3UCY85cZqIl68aBCQcrhGDmwjixIsBFQFWUjO+sJu5TGu+KLv zNDiiAsfP1NcXcw== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788551973143158500 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 4a9b7f908844..06add228151b 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 Sat Sep 26 20:00:45 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=1788552043; cv=none; d=zohomail.com; s=zohoarc; b=ImPbvaMSsl8QWRFMIe21MV9y8fRiAN7rVX0YxkyIo2yrgD9I8L5FaNjmjpcNhhIJINNBRSwp0jdVTRRRl8/VuBMJyNtJLKE8Vsr3j8BxC8cw3RUtcb1tatHmg7xNVQlV8VDOAtJUDejLT/VsoR8wtftKTSw3s0gs7cVw+qc6acU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552043; 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=QrdfrGnFQJWCYTt3lgOYskeQfdWl955TjVR/M0YvXGGq6HIDdxYuRwdyRES/M4MPtSAsMuIo+4BlRQc1MYBCidIyvEpD6FKQ5a57MbSLeL8lSSP7XEsELiaM52cGN9iR98sb5FA5P7aVdR/kmKR9V8tDy2MAJRBQMe2OofjCoiE= 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 1788552043863526.1713339276489; Fri, 4 Sep 2026 13:00:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a3q-0006OH-8c; Fri, 04 Sep 2026 15:58: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 1x2a3j-0005rq-E7 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58:49 -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 1x2a3h-0007sq-Sv for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58:47 -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-679-VYzJrZGrPDKXn91YIBLEqw-1; Fri, 04 Sep 2026 15:58:42 -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 EFF9E19C95C6; Fri, 4 Sep 2026 19:58: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 EFB5030002F5; Fri, 4 Sep 2026 19:58:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551925; 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=br2lvJM0PuzQQux93iKuLws2RfnUHr5srDhHG4Wyw7G3Q+EuXc51+SZLFnd3RxDcaoFDUv 7tbiKLLS8SgxQ0uyGYjGHJPjPae0z3aqI57Fw9x1fPqHzrB9pvMj+fHKWNfHwV4r1adxoy L1RtcgpF7Ar8d2x5m+MzlJ43gnkgK0Y= X-MC-Unique: VYzJrZGrPDKXn91YIBLEqw-1 X-Mimecast-MFC-AGG-ID: VYzJrZGrPDKXn91YIBLEqw_1788551921 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:57:52 +0400 Subject: [PATCH v4 09/75] 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: <20260904-qom-qapi-v4-9-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLIFidck6SdAYxe/wP6OOzoZEoRKMUuj9BXi bd/DT3I5KyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyAAKCRDa6OEJdZac 5YcxD/4pDkBWkOy5ROro0eAmhtsQ2Qho7n3MwFgVo03+PTs+n52cTkLr/w0lJpZLlKbQcLncqID koxlRfh6dPj0NGFJcthCsXSZxoo1AVX50U28o8A9rRJZNV1YVMH32xH3nfYGJZoRJUiJXcu6bX8 KHWyxu6t5SxzgGVdjAUpQJDBAFjKG/5EyK+lJljqUexOenwevcC0hap/m79FbeUVD0jpcnCpNw9 wZNbbw22O23ZTHuqRbbGRK0wodcRKPTIzghXOm7NijWW6LaNedUcrEpG5MWWwIjKSD2Lh5jbRGg LTzLnC4cgzo1ygiyta3V8zXcBHFcK8nlDRA0ZRMouG4wkfuFAANLIJi3XCptFUXROElMsPf5g7Z a2MLOhb+5Mne6U+uV/UZWB0XTDisMuPJR0ML3EQx5QiKd2kWC0F2hy04dY3tql7OMyZpFgfa6V8 ked1SZ5V/ykvDwWeRyXBgy5g+jikfLl79Ta9w6jxsUP4nkZ+9xMYSREzklFzB3TrS3UPEE9QgyD wn5h1GdEagK90wrMd/SK5Dt1rFQr5Q0saTZ+W55xIinbolp01Ir90VojAYGDNaaB4dWMsWxCYPC 6k5XBhrXxCrz2qZKt/jpkI4i+oh51Rg6F0QEaBrYdDQbYnEfpZSq8YlXmeEb5DkgD1TPfBN/2gp zS6q1i3p1s+iWbA== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552045577158500 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 Sat Sep 26 20:00:45 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=1788551959; cv=none; d=zohomail.com; s=zohoarc; b=mmdOm/p6M8zJ93FNOqeQgSoWwXz5f4sEjtlu9MCpilU32IrgFXws3UFP2XcxxQGhjDdQPiKrrP3Kinc7fROVMO+F0Da8StdsO+MXsPCcFucTjCD+p/F0yP52ILmYv844i9JJz3yzfxaAoPpS7EgD7ysTXNEWztROnf9l7CuUwSo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788551959; 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=7SMs4lAmkVoRXQNMq8ERRdBMSlVCwycR0HsXxzfGsJ4=; b=GFEGkx4rK5ES6gFLkbyqOSaF/4m28LdbjVpC1kA/6rnWVyTPyIDWO8GhUVuiFFUaiDEdM79WmIJqtxAVRtitZOGyjvOzYUuEZ3xk5Rx2gwyNDd+B0lzWwCEUrlwiT33E719qEkI7hLAJRpqqv5PlL+dmV3Iu270Z+ABkXCAWQM0= 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 1788551959715911.1937173017863; Fri, 4 Sep 2026 12:59:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a3q-0006Ps-Je; Fri, 04 Sep 2026 15:58: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 1x2a3m-0005tH-12 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58:50 -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 1x2a3k-0007tE-II for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58:49 -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-183-LkKaRcDqMOKMpfK9cseqJg-1; Fri, 04 Sep 2026 15:58:45 -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 9D629188FEF6; Fri, 4 Sep 2026 19:58:44 +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 A06681955F01; Fri, 4 Sep 2026 19:58:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551927; 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=7SMs4lAmkVoRXQNMq8ERRdBMSlVCwycR0HsXxzfGsJ4=; b=jCanim1ya9v8oM6y80//rUQG5qaBTeRN4jJRd+dexESBJjovCXGdAJEZdNsDpVycohSH3y i2ykRCJuC3ToXqT35ok50AgBs8ip7A6LVUPGufdZM6r4bfXJwGFG24pgil5PazAMIfyJzq hHR8ag4VjZQRaNZS/PCq/jQEiK403Ug= X-MC-Unique: LkKaRcDqMOKMpfK9cseqJg-1 X-Mimecast-MFC-AGG-ID: LkKaRcDqMOKMpfK9cseqJg_1788551924 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:57:53 +0400 Subject: [PATCH v4 10/75] qom/qmp: populate description & default-value in qom_property_info() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260904-qom-qapi-v4-10-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=2391; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=8aX4sw0U6wmPskhkshFQH7h3T2tIQFeLMa3pE2ujfQw=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLItjOGlRzimMqjEbdBy7HbatO5wMWlxtyuX lj7+XBsFPuJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyAAKCRDa6OEJdZac 5Xf/D/wKARWoR98eMak93C9HCQ48pXtTvYWjh8rvQkasElicd3TBa/5UVUSPaxjOX5QQ+eUKA/M NRy5eoydOnYtbO6v0mX4klcqzjn72pgUG7QevqyqktESYCcBU7awSgIx7MBbgvY2we5ZTfb1i3K u+E8yE6RqPYKHJwppY2k5OPKAnck1CrfarIxn+IrX8eBwGYgB5WhPoie+vy9nj3ccfPCySg0f8D lJVRRDHqO7kGHiXkn5JdgZu/4T32ZRujupydvbUlhY39GtjxzSNVLW6fr3Am7SR3ReHjPhoVkeT MWsMmtdhJzDhFcNbLo3mvLjDc3JWAJ/mrYfuCWbpMxIiXFOqEgG7n9x5pMXJqGxXDbamA3vOMno AMp7X4d8RXaGKnUffwGamG+N8vHAFmWlghpq+anNGrbCQ9W9tOqYKNhfUq3H2lnHmuLmg6R3GaR mHt+y+CUzvHdVajMDPXje56ha3J5lZ3iE81etFNTjum9wtq7DHmIBE3FxI+9URCh5QERjaeyFf9 9h0dEOowv/7mwWTxwckGX1wRrCyEIE3fF71XzyVGwxpU7UImUsw2mh5nJRWwxCZH2sU274F+s5L w+/8ZrTjgqxFgIPVwHrlFhiMuXzr7xV+XikEvPx10LNx3hh1XxJW2usUo0pVAY30A84FLeyGIEG 8/3J8qBAZY9oCDA== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788551961129158500 Move description and default_value population from the individual QMP handlers into qom_property_info(), so all callers get them. This also adds description and default-value to qom-list responses, which previously only returned name and type. The handler doesn't care. Signed-off-by: Marc-Andr=C3=A9 Lureau --- qom/qom-qmp-cmds.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c index f9e6d4371cc5..782a9af14de5 100644 --- a/qom/qom-qmp-cmds.c +++ b/qom/qom-qmp-cmds.c @@ -35,6 +35,8 @@ static ObjectPropertyInfo *qom_property_info(ObjectProper= ty *prop) =20 info->name =3D g_strdup(prop->name); info->type =3D g_strdup(prop->type); + info->description =3D g_strdup(prop->description); + info->default_value =3D qobject_ref(prop->defval); if (prop->qapi_type) { info->qapi_type =3D g_strdup(prop->qapi_type->masked_name); } @@ -218,8 +220,6 @@ ObjectPropertyInfoList *qmp_device_list_properties(cons= t char *typename, =20 object_property_iter_init(&iter, obj); while ((prop =3D object_property_iter_next(&iter))) { - ObjectPropertyInfo *info; - /* Skip Object and DeviceState properties */ if (strcmp(prop->name, "type") =3D=3D 0 || strcmp(prop->name, "realized") =3D=3D 0 || @@ -229,11 +229,7 @@ ObjectPropertyInfoList *qmp_device_list_properties(con= st char *typename, continue; } =20 - info =3D qom_property_info(prop); - info->description =3D g_strdup(prop->description); - info->default_value =3D qobject_ref(prop->defval); - - QAPI_LIST_PREPEND(prop_list, info); + QAPI_LIST_PREPEND(prop_list, qom_property_info(prop)); } =20 object_unref(obj); @@ -270,12 +266,7 @@ ObjectPropertyInfoList *qmp_qom_list_properties(const = char *typename, object_property_iter_init(&iter, obj); } while ((prop =3D object_property_iter_next(&iter))) { - ObjectPropertyInfo *info =3D qom_property_info(prop); - - info->description =3D g_strdup(prop->description); - info->default_value =3D qobject_ref(prop->defval); - - QAPI_LIST_PREPEND(prop_list, info); + QAPI_LIST_PREPEND(prop_list, qom_property_info(prop)); } =20 object_unref(obj); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Sat Sep 26 20:00:45 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=1788552074; cv=none; d=zohomail.com; s=zohoarc; b=MY6JVB/DYDfv7zsC4jgUuIsBjzTjYpSDapHiZgFtqeEeoF5BecCfnLXiN1eF7fGQnZo/J+649Md+hnbvCOn25hyKiLdEOTP/ZhXOkqjdIrCkivVUghY3qHTBf5+28XQB+p/h6sCzuflvJUDsTB+TBfbPn1KZRdjNZL8nObiyE5o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552074; 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=R3oPXPM3fK4MsUH2z2qdPJuzr1xcfLEKwZWlP2JAH0E=; b=Sk5IZl6/50EIq2u9i8CPR77ZtJ/7iPrT6jesyY6252TftJB+++aHwYQjB9u9Q9bylGPv0NPrf6c3hH1kccV1HfzAwZ27vTkEqszIYoWeDmHgl4kY7odG/QnZYfLIVZmme8/oudQinqsjz1w6KLh3yG5i3szH125j0i/gOFtWEJM= 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 1788552074014604.4850655326678; Fri, 4 Sep 2026 13:01:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a3u-0006rU-0I; Fri, 04 Sep 2026 15:58:58 -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 1x2a3r-0006Z8-MC for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58: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 1x2a3p-0007tP-Og for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:58:55 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-623-mIcxohjQNUesAql44To7sQ-1; Fri, 04 Sep 2026 15:58:48 -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 D1C6918F0F09; Fri, 4 Sep 2026 19:58:47 +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 E06DE1800641; Fri, 4 Sep 2026 19:58:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551933; 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=R3oPXPM3fK4MsUH2z2qdPJuzr1xcfLEKwZWlP2JAH0E=; b=MqAzoJDtpouhVCsQC0KrESr3K2yx96GuD20NmmeSc4V0FY7Q0Vu9HRXjSZE7BFwy4ExY8g Z6ORDAG1f62fln7G8ekrC8hZuWyQ0eIuqXg2SKzdG//UnV2tYj9wia0eRzixQinv1QPaKV 1BPJElTKAqZCCaxHBW2cBk2edd1ErVw= X-MC-Unique: mIcxohjQNUesAql44To7sQ-1 X-Mimecast-MFC-AGG-ID: mIcxohjQNUesAql44To7sQ_1788551927 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:57:54 +0400 Subject: [PATCH v4 11/75] 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: <20260904-qom-qapi-v4-11-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=J24jPq7GnTAmrNH7CcrVSdskD3xIJdz1fXAotCO/yMI=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLI05dgiND+29GaEr/Cf0ZcPCZkAmc7szP0l hAwo6ifxP2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyAAKCRDa6OEJdZac 5U5zEACapYGnE4/3tL3SPBOqFHV90k/GBVSai6GZHH5xqL8h2FVdzSPR+711zmc7Ur7YMolJc+B RSd1JfX7zLjR3UCaIxFcJskPAtXpn+F5lTI5xvMKjznv7cP5h03PXTY9JsrHd33BQdtL9FHp6lY tvJFtDVGj2YuAbNwBCYpUu7Jr9mFK5TwZJTmVz24nZrq2KkFDS0Q0DrryiP2xk5PyS4fEdNfuMp wjkV5lcwVYFKx00tC6nnePyNaG9kIUrCv9waEr5hdi2GpiCyFyOKmh2jeHLXhoJpju/mZxEsruk PhQhPYpq6wEaNRVKYMMbva9EhUAdwMvPDKS9XI/twRklabwuCcdun14vUe1QOgwmL/UH/dWjmkM 7Gra+JkJ1TanXB95Kbr9gZ+7g73ri1ucJPwXtQs4EafYeGGxEpDXuK034pc2230y8iGHoMtRcbE FljXlWppm2lhkk5sYMgmstJNgJibS2+nS/TK6nS85YCHxk+wkSPFLG/njFao47/ETP5w5EHtvLW XOmRr9hxw5Tx/+amylsxnLmH+TdP1g5sfNZeyNbT8qz0d3UG5u3gmV7hc4B2E+oNM9Hhb+4Ul2H atHlLdzJH5aencr9T7p9UCpm5CGGEZ/06UpB4JrFFwpBDmNDuIE3KCj44X/GB5UnVsbptHumoUi fdQCvYb5q57ApLA== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552075777158500 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 7c7e69a2a1bb..c9a5ea4a1bf8 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1226,6 +1226,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 f782e21f1a30..bf9664b53b78 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1709,6 +1709,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 Sat Sep 26 20:00:45 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=1788551962; cv=none; d=zohomail.com; s=zohoarc; b=IwO8X1ymIuONUb6Z2dOp/ayQZ6JFSnZxwDRWaRjhvn/jv/qt2me3Jgo1D6lVejcMqBPxGzC97oj6CnBD/3CT9ckLNbSBIjlAr/1Nyr/Um+taBQ/yGVpRGrU1ysCpINNi7cDiTlT8w5z+zh2bXk332BQiqrpxFsH+xaa8cSC2yyU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788551962; 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=+dTCAe13s+/qe8OyKDq4J7CbBf2JbhGMcn6OfTOaJdM=; b=n57zhxGFulRP4HtDsUyFopjlMtvvnz0L3JChkYLW6YiKmNLLrSSBP5L3s/i/eWgjJa9gZ1tcUT38UnKY7zGRR2Vqyf3FzhSr44oTZfTg7vH83c3+ZZKw0GJWJywC9XjeULJ5fzEaKlMPPZXZzUXWhbl7Dtsr6ydbe9cIGnR1YwQ= 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 1788551962233760.2660928056216; Fri, 4 Sep 2026 12:59:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a3y-0007HP-Cv; Fri, 04 Sep 2026 15:59:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2a3w-00079s-Pr for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2a3u-0007ty-QE for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59:00 -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-496-ur6pQIHFNT-wolPatfKYPg-1; Fri, 04 Sep 2026 15:58:52 -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 96FCB18E9B3D; Fri, 4 Sep 2026 19:58:51 +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 98D8618005B5; Fri, 4 Sep 2026 19:58:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551938; 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=+dTCAe13s+/qe8OyKDq4J7CbBf2JbhGMcn6OfTOaJdM=; b=O8C7iPSVlgWJcSnpbvdB+qcFpZPHpkMlBJqkWT2hxAHaZiUYz4z12nF/gAsBtdpvr8H462 q670laGkGjRvSglq6bwkV44PxTwhlpPF21ccQjt7MbjGVlvcY44l5nhkvWe6Gz4a9nYFNB pYissZnTgvM3Kg+eZqga0dK9dpkCnxw= X-MC-Unique: ur6pQIHFNT-wolPatfKYPg-1 X-Mimecast-MFC-AGG-ID: ur6pQIHFNT-wolPatfKYPg_1788551931 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:57:55 +0400 Subject: [PATCH v4 12/75] 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: <20260904-qom-qapi-v4-12-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=4793; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=l0UXqFVCyU+WDYWA330MIVYIMH08NK/BziNQ4fJo2Po=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLJyYARi9qxEeyuWL+8muVBkj+srFJqCs9Kq ZZkeVCaXryJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyQAKCRDa6OEJdZac 5eqPD/wKJexpYsH0eHwYMTnvmLDv4h+7hHovS176pmoTHtHwnwi7EPj49hyGYsDvZibtLbn/6tn iajuMNI+wKBbfJ7j3uculoVlwjECkw830AYnsGpd4xKm7XyKCrCQLq+1tMUj3eW+oWxautPLCRl cadWIbwMnYwD/Gdrl51pOuLO5EwzbErd5axJoFW/+P2ccaN08McZf3XiVYj/yYJfwpP53CgSE26 rvAvVQcqLovFUxo+H9N8Ccp6nC4hf29Z2YbznD04ejTkZsEzQlrDel2FF3dXwKPgVBLLlijR4Ok O1vAwJVEgQd3+dFnbHNwWH2CqrxMqvu0lUOyP/XJkNbxX0+6hVtlVrGaZZjAPwUVmZonsD0PfNO +Y+1WhNwoIR0HUSRauGKB+7I+JCwnhI7TghPDU+s5A8c/cyLW3febn4JyCl7bnKaHCfmv4Q5Vrd /C8XGLtoC79/rngQevuwunkUKyS53isUGPYV/h+EuRBF+fq2m2bwQIsyzeoBUvZNHxYbhB7UBIA k23xTz0F4Vb90fFgifTvxnk5BSGd3FAvg/XNV6LkCC09V48KzYbE0t5gcigqOEvRyWfxHmHaQ36 yzWm3XJ4NcFyYBnEqofPk6RWklJY6qg+OdK3K2DpokHcM61e4RhozZYRh1zWNlPOJSl6/lvTNiR MFjYN+G2FPgZYPg== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788551963073158500 Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/qom/object.h | 55 ++++++++++++++++++++++++++++++++++++++++++++++++= ++++ qom/object.c | 32 ++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) diff --git a/include/qom/object.h b/include/qom/object.h index c9a5ea4a1bf8..083fe646c390 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1993,6 +1993,61 @@ ObjectProperty *object_class_property_add_enum(Objec= tClass *klass, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)); =20 +/** + * object_property_add_qapi: + * @obj: the object to add a property to + * @name: the name of the property + * @qapi_type: QAPI type info descriptor + * @get: The getter to be called to read a property. If this is NULL, then + * the property cannot be read. + * @set: the setter to be called to write a property. If this is NULL, + * then the property cannot be written. + * @release: called when the property is removed from the object. This is + * meant to allow a property to free its opaque upon object + * destruction. This may be NULL. + * @opaque: an opaque pointer to pass to the callbacks for the property + * + * Add a property with a QAPI type association. The property type name + * is derived from @qapi_type->name. + * + * Returns: The newly added property on success, or %NULL on failure. + */ +ObjectProperty * +object_property_add_qapi(Object *obj, const char *name, + const QAPITypeInfo *qapi_type, + ObjectPropertyAccessor *get, + ObjectPropertyAccessor *set, + ObjectPropertyRelease *release, + void *opaque); + +/** + * object_class_property_add_qapi: + * @klass: the object class to add a property to + * @name: the name of the property + * @qapi_type: QAPI type info descriptor + * @get: The getter to be called to read a property. If this is NULL, then + * the property cannot be read. + * @set: the setter to be called to write a property. If this is NULL, + * then the property cannot be written. + * @release: called when the property is removed from the object. This is + * meant to allow a property to free its opaque upon object + * destruction. This may be NULL. + * @opaque: an opaque pointer to pass to the callbacks for the property + * + * Add a property with a QAPI type association. The property type name + * is derived from @qapi_type->name. + * + * Returns: The newly added property on success, or %NULL on failure. + */ +ObjectProperty * +object_class_property_add_qapi(ObjectClass *klass, + const char *name, + const QAPITypeInfo *qapi_type, + ObjectPropertyAccessor *get, + ObjectPropertyAccessor *set, + ObjectPropertyRelease *release, + void *opaque); + /** * object_property_add_tm: * @obj: the object to add a property to diff --git a/qom/object.c b/qom/object.c index bf9664b53b78..7082bc1c0510 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2599,6 +2599,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 Sat Sep 26 20:00:45 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=1788551975; cv=none; d=zohomail.com; s=zohoarc; b=fm0qTjAb1CyHG8nnbiN4M8rmE5aKMDNHiml4Km49cOJ+b8w2L645oYgX/pjQ1w6BDjW3KZ/jg9VkYAIniQ8yGpTYfGRA09WRQPnqkj1v1WytqVTv33BRc0Be6sMkVwxJrQ8t8VJqkasQBT+vzK+WSL+Lfa1FQftXYvTtHhig/uw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788551975; 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=yJMlo6mxcIkXEJsc7YS6atTu83kQpn233MrgN7DUEYM=; b=GssYHGxAnmnrK846nfz19rTganfBdxLIrENkrghvcIt4NVlUwyVFdV0CdIiowFucGZZN4gXAhjQn8mIX7tCgKdAY5xVlEX3hzVkmQzVdAGA0WJvSOhows0AdZNREBWyO07x81Wk3ImjIfWct87O1bHCz/jhnyeCI+nByvpgihIU= 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 1788551975885661.9913554304477; Fri, 4 Sep 2026 12:59:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a3z-0007KB-Sh; Fri, 04 Sep 2026 15:59:03 -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 1x2a3y-0007Ge-3g for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59: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 1x2a3w-0007u8-1b for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59:01 -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-372-H2SV4zDDOQiMMZ8nsWBlXg-1; Fri, 04 Sep 2026 15:58:56 -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 0EF1118F0F0D; Fri, 4 Sep 2026 19:58:55 +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 2EF5918005B5; Fri, 4 Sep 2026 19:58:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551939; 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=yJMlo6mxcIkXEJsc7YS6atTu83kQpn233MrgN7DUEYM=; b=CysKDijeEZ4quTtf29G8dsREfnujDOYN+lVWOg7r5hB9VtyoPYnta2KqA9JFraxvzeARKW 3tK+J1fBHvQ3HyQBtkhMYIXdcCvah6ukN+1EzStzw5/Je6tME0vgtbF/1MDejGBLJEbUH9 XrGrnMVFK80dqIdgFX7icpdWluZmWqQ= X-MC-Unique: H2SV4zDDOQiMMZ8nsWBlXg-1 X-Mimecast-MFC-AGG-ID: H2SV4zDDOQiMMZ8nsWBlXg_1788551935 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:57:56 +0400 Subject: [PATCH v4 13/75] 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: <20260904-qom-qapi-v4-13-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=7531; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=eXvKRfomXt/JyMlK7fno7quZI2V64Ljk8AMzmdqMY/M=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLJ6OygHndUYtiOTV9b3wF84XSdPF05eVO73 Zrrf+csAAyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyQAKCRDa6OEJdZac 5Se8D/9k8YnPE+hiky0pAi6e2wrL0D14U9SH6UWmOSn8KL+FociFBTSJrpVyx93fKulczG0yNjP Ley8RYQlsYyGhbiwEHcV/nfP08Q0864aApezkU1v3nZ6LBb4OHKtsufWSCbF/yqu3UdI8xPMY64 QgxiPE88D1oh9Ymd30xNKe5M+7n1ZRJQJV+ZFYnqL80E75lxUmnBiWiKjzMB9VgW6jB7VUkoeA7 ny552FGdFNqmZYppRSsJMdodI1bpoqRp9kvmC06hoYyJSfljflszP7E3WnV3ROBnCudd9bS0r5L zvriyZbhoB5K9WnqKHuoPxOleXe5U6xVkmoo1v+EYXybDghXAUE5ZvVVDC6DadlQzdOSw4ZRJ0N 2PfZ6OFWN8woeKXnSjb2rF+nnbO77O6PqzqwoKc8Y6WWsyVTi0ObKhXRPHNgftFWJxprnbKcGz9 ju6F3C8BxrLO+dvE3A0P1tox8hyfycxr0iZOZSIQUm7LpEU1CvQ/wleH1lvesmQt0veP7QgAar1 2iFo6t1J21qP3nqTDYQzRST6W00Cpvx6dl19hZJs0iG5cvrpJwGRZ3SZARHGeD/ZapIXBJ3372c fc3svknQt/VOmqeE+FsxsTvcFeM0ZRcVwm1gHthLyZRstPPHqx/opMcJqBt4PSLVSjOkDYWklWv CTBiJKJv9Wy/mDA== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788551977228158500 Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/qom/object.h | 73 ++++++++++++++++++++++++++++++++++++++++++ qom/object.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++= +--- 2 files changed, 157 insertions(+), 5 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 083fe646c390..c9a5fe4934d0 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1993,6 +1993,79 @@ 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. + * + * Returns: The newly added property on success, or %NULL on failure. + */ +ObjectProperty * +object_property_add_qapi_enum(Object *obj, const QapiEnumProp *prop); + +/** + * object_class_property_add_qapi_enum: + * @klass: the class object to add a property to + * @prop: property descriptor + * + * Add an enum property with QAPI type association. + * + * Use the QAPI_ENUM_PROP() macro to construct the property descriptor + * inline. If .default_value is not set, the property is not initialized + * (default_value is -1). Otherwise, the setter is called with + * default_value during object instance init. + * + * Example:: + * + * object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + * .name =3D "policy", + * .description =3D "Set the NUMA policy", + * .default_value =3D HOST_MEM_POLICY_DEFAULT, + * .qapi_type =3D &HostMemPolicy_type_info, + * .get =3D my_get_policy, + * .set =3D my_set_policy, + * )); + * + * Returns: The newly added property on success, or %NULL on failure. + */ +ObjectProperty * +object_class_property_add_qapi_enum(ObjectClass *klass, const QapiEnumProp= *prop); + /** * object_property_add_qapi: * @obj: the object to add a property to diff --git a/qom/object.c b/qom/object.c index 7082bc1c0510..2d3bd2ae327d 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1210,7 +1210,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; } @@ -1776,7 +1776,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; @@ -1789,14 +1788,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; @@ -2599,6 +2601,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 Sat Sep 26 20:00:45 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=1788552022; cv=none; d=zohomail.com; s=zohoarc; b=EX/EOzhhcNBrb3SbGC8jDnJlkkrvP0TRexQlhTVZ8OEOSR4LYmKZZhq8gUcltK8hVFZ10BQ5j5g7R5I4z4Tfyw2Uhi7sJWm4aDL5Z1+bR0FXq6s8ST2iMa3CWEy4Y+bA/kkRmjfFm8I8QTi8GxGFvMSW4kG1hnZuzSjU2S42Y7Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552022; 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=gW0lo2g1XVoSnS3WxME+Xent9JoJABV8rKcAD/rkRx2tgpoUbyHV5npedLmMMJp2S4R4V1/z66s/yN/CHqFrUR3a1gRBF+azmvtEYPifzOdT34BLOk9KcPVSs+ynPr730A2XXAYT9LlaqRkruBJWfRnxLPIRIntV3omt4znKKXs= 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 17885520220436.747369339992815; Fri, 4 Sep 2026 13:00:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a43-0007No-Bn; Fri, 04 Sep 2026 15:59: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 1x2a41-0007LE-6Z for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59: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 1x2a3z-0007uc-Ga for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59:04 -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-84-7zu6RDq6OuqG0uVD1bBXjA-1; Fri, 04 Sep 2026 15:58: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 9E85118D6343; Fri, 4 Sep 2026 19:58:58 +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 D1A011800577; Fri, 4 Sep 2026 19:58:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551943; 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=RgXgx7mZA1AnQ8YWyqt0wKoyH5JBE/TY6XpX1nLh9mbIopm6OxgFjRJWVlp5/c1/50hsZS DNIL2qIgiUvGHipJHKlD3TeCPHAOpYPYXQg4O3CcQlkN18Kc0P4JTrAEf5pRZnuVRk0XRB fRcDXZIj8m4rRYUQoXqbR8Gu0Gz1d1A= X-MC-Unique: 7zu6RDq6OuqG0uVD1bBXjA-1 X-Mimecast-MFC-AGG-ID: 7zu6RDq6OuqG0uVD1bBXjA_1788551938 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:57:57 +0400 Subject: [PATCH v4 14/75] 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: <20260904-qom-qapi-v4-14-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLJlXILfCMtbAS6Is6kZALU3rDgRvtDzx60N HUR+eVRZ6uJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyQAKCRDa6OEJdZac 5WwbD/0UnXeZ0T/FPCTwygbXZNOJwjk6YFDsIqwUlK6RLUm6ikOa67HyNB8XpbEiVRs6ziWGKB9 uPiO75DW67YxYs1bJd+U4VaydB/aA7YEwBl7W7Whl6aBqvN9A8pk07J28p4aPtfmQ6ifxdZrAwm 7EgspwEtL/H9dLa8snf2Y6s93YIZPe8PpFCAOyTKWpmeZGU/3ys69ZaXUfG2lbtjcGWz9d+XXrg EKSpKYCdUFG6TiIr02QV85l0DCFVzUyBt2NhRUM3iYLQXxq57ypYd4TZuBbPwLh4w6XDlmVNE/u VMP+OGiZzkoC+CVexwV9MdJKUAKksUS8LidYSvf776ODcvG6ac8A3TWKNVJBY3+vgVZQSMEVMyU fkTEt262ZByOXGClmwVx+cn9gScoZ779GTG3zAH1wKqpk+qMCMsdVTQqi4EFtDXJI0CZ6brIEQM KeNQT3RdqMzWZcj1CVYKvBDZfEMF+Yq6nlP5CuvYSj9/njDwiobX0IjWeCpNKlNhEuDYupHLzHs zAIVDOvJTEtezMMFVeS+4Nc8fqLGVSCcZ0gFc+h59NefabFySZ5bz7JYbu4nw/+/pZ7nwN+8z82 c69LcnCjE3+SvpuHEV6CKeZBnZ6stmMcxWwL5vmAmJZ89PsJxDVRRdkoRO/fQK1l4EPKEi0uJY9 qmRYF2cO1+0x5DQ== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552023488158500 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 Sat Sep 26 20:00:45 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=1788551972; cv=none; d=zohomail.com; s=zohoarc; b=bQldqvYW9GF3O2BmFRSqVQNp2J9r8O1JtiuCz3mdjJExjmnb4mzs4KuAf00luzYdEZ1VprlHaOmNVO5w2jXBCJLDwdvd0HFP627scL9yKdxhZJEoJLxTYIdrnIOXxWZlQLmNhX1lOy4rjtTKnezSSzMh6cJHFgkAJqSTs4FjIvM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788551972; 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=gqZptmaizdvAk5ugP8ylt06TdOoUU96wWhAskXzHT7A=; b=Fx5uNNGtQkgfFl2AwPWkcg5Gmtwl3qQhHCqBEOo3tHpSMpqoTCuK2cNWan4VmFdKpLyklYkwkMrvdhFv/tsJoJcmq4wADOJ6DsSjm7X5yCA6Lg3K9g9b4ykGgwOkLgmxUAHnQWFyzQyfbfDih9a61PNt+WTyuKyvo8iHaN943lU= 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 1788551972026661.4172130984039; Fri, 4 Sep 2026 12:59:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a49-0007S2-52; Fri, 04 Sep 2026 15:59: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 1x2a47-0007Ra-ST for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59: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 1x2a45-0007v9-Dh for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59:11 -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-640-drZq3pEsMVevdzQ4GDs_Sw-1; Fri, 04 Sep 2026 15:59:04 -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 AA2B919E5758; Fri, 4 Sep 2026 19:59:02 +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 20A927DD; Fri, 4 Sep 2026 19:59:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551948; 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=gqZptmaizdvAk5ugP8ylt06TdOoUU96wWhAskXzHT7A=; b=JVwCYJv03gs+mevInWyNhRtxkiOyK8I0po9HMHyr5yf5XuwjL0PRZDXJv3vnuBJwulHBet 8FhFL4+ls73ptXloaVbDV2sWDTe64AaOviy/Rb+3kLKin4cD8IvYMYN6d3qXj/NdxbGEik eAnN8B82t7V/sJ+yElx1x4ru9Ak+hV8= X-MC-Unique: drZq3pEsMVevdzQ4GDs_Sw-1 X-Mimecast-MFC-AGG-ID: drZq3pEsMVevdzQ4GDs_Sw_1788551942 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:57:58 +0400 Subject: [PATCH v4 15/75] 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: <20260904-qom-qapi-v4-15-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=0oJvipEyE7ZrlbLOCm1+wHXK5aKzcRUJ6dpaFPnqKAY=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLJ/Ga7J23cz9yd2SL39fclxlIiAbQPwHPCY uVqlkKpCyeJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyQAKCRDa6OEJdZac 5TNDD/9rCel1SsfxGbm4Q293bYLKIvDCtYM6Sdu3XMi8giN3z2zTM0a0Bi9RyhmEwD2pXf/0tDD xrGqyzOU/v/jryj27fqPjGYy2vr8LHH0S3QvDIJhlDRJGiN9hw0IIKxvtciXUNiQ/vSKiperMIX Gtt9TW/uYH7jIBQ5nulL8WlF+RxiSt3BYA8kDs5EbVl98hAgiPDjHwWHidcIHK2c3kJ7SSpGIes qep9cIvnmYtJFaL/SnrI6cbsAixhbJDla3ZhiRfxWw1DtIMidT8q2+/RaMhSLNwdtkowU7tz/f4 W4GqLzn9c2AeXbkdFhrJGodUrTshMXuh/wBbNai//UFxF8DMcEBlxMC0ZBtiCO5zk8Ar1i2GMY8 v9X08rg12e98ii4R9FwW1aLefP9uIPxuT5iQqYO/DsRj7LIvkxowUlU1jBBu70p/42VSsJmBLIe boXTNuZVrsCd7VStjY9mgSPfmS+nh3zk4gF6DvGwtJIO7wfh2NRG9xWoR3RvC7YHxD+eNpVJPak jzuB2pb3/e3Rf9sPXp7FynEggda8rYCyVbGcgiBOS4AdJlWVz6uQMniM5McNsJnL4VcC7k5th+t POVAuycygZUJWcxqpiGLcEBxLZTUZhBIL6b+MPU7NAno18VBejtsL2nyHThhoXiTZGnF6a5qTqZ o2+QZfbfTG08/9g== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788551973239158500 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 1eeadb99adac..9f65419a2c1a 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 Sat Sep 26 20:00:45 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=1788551997; cv=none; d=zohomail.com; s=zohoarc; b=iojelZHZV8CTosHpvghsFNSpdr6EuqRGNHI5mYl+3EXpxFu4xZGMfN1Jsj9GbGmXzlNJpi/evIbsD2fcskqnPm/k7ZqgnpQdPes2cPykLRd269MMMApOuRWnj9u7L7n3mge9M4D0xI3hsjDqaqoprKczXlY28MwxfVH+PxXL7IY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788551997; 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=girJTupFSeQuIQp5Q8w9m8sFCIToXcJFLfuB706GG7E=; b=J8UYpgnYQlDNWA/zlqaFicMS4WTx/to6dxgAMc9DdThWFUk0R5gvzVKaQh4O1SSHH4wMfA6gBgK9cj/j3WULnqKA6INKq/Si81bqLSQOUHhVW2o64WXoKw708w3Jvffey6+bXJS1K5t6o053X4xa/RnhdyV2d1ZidBK+TgJCQ4Q= 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 1788551996963255.47097189479757; Fri, 4 Sep 2026 12:59:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a4B-0007U5-J4; Fri, 04 Sep 2026 15:59: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 1x2a4A-0007SW-5z for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59: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 1x2a48-0007vO-DN for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59: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-646-XmUuvZj6PkKB3gsV_zKhMw-1; Fri, 04 Sep 2026 15:59: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 63F5019540D6; Fri, 4 Sep 2026 19:59: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 96A335BC; Fri, 4 Sep 2026 19:59:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551951; 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=girJTupFSeQuIQp5Q8w9m8sFCIToXcJFLfuB706GG7E=; b=N61shNkyFyguUmeBIn75JT1QNoDj6+GLjY92uzonpyR4Gu8plkkgZv82rFhGxQZgFITKLr 97oRd0RUcs0Q8g1QB3Q2WjkmmRhgXyrwKXHA8jebzhq0U/fK/vLH5vAiV6MpIs29/blGPg pH4ti3150fn2RCQ/YJN7Wi26yUVhVOE= X-MC-Unique: XmUuvZj6PkKB3gsV_zKhMw-1 X-Mimecast-MFC-AGG-ID: XmUuvZj6PkKB3gsV_zKhMw_1788551946 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:57:59 +0400 Subject: [PATCH v4 16/75] 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: <20260904-qom-qapi-v4-16-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=u/jtz0VEJPO7qFKfQaHWT67kjziwn5hqQAMBuiinxLc=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLJ22rzP+80E8Qj8kznDlRhyW3xNXF4ixE4H gdkFLHLvyqJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyQAKCRDa6OEJdZac 5Y0SD/99VCrvEfJPMyENvAcdbtbO4bE+U5dLsO/apQAgtOLe/0IejIxyk0DAXZohFqOUngdFUUy Nua/Hvq+eHDgTYXARJFlm0ePkgZv9NA+Uv0U4bf2qnVXb/V42KNUekg07g0P2CJ+H8m3PF0ZFfJ /NGVspVv4b0HwVJeEGe3zL+zgm5UpLHm2JFTZodTuPXqr646be4PEzA2os5tRvRyFCn+qSrV9/a 3J8/yHLSidnXNvyBK3J+ZnAiUL0h8bBy8UgCXeXAjnHkHuIaZqL1uvqxwMbrTModNE1HpN0bo51 /TuCVU/ZipoJi59mg96Qv5u7AYmtMRrPzi1xJ4K3IMHvL3XMlP7/A6tIN8pVuJUlcyLkA2T20ai SdNPPsmgZ7/VlKO5pjxhMfGcXerXwNoKLoIhuQOHJtLQoGTcJH2fINaD7y3toPUHPAhUG3DLF4u yMWQUxLXNe8ik5y5LJKZazolrlc7/JOkT3RwZhHRclKcghHENe3M8D+u5DA4vK/j0R8OqLQc2JY hPFk0JaPLhTcRarcfdRgNwJlnF5OfB6bE1bu4k6S108v59bjaapXV+o9ZG2UAithkqE8DLW6Acz Nykq6NmxDUcsTGEuE73wBi7ZYbZnCUew8BZReNl+97HS8UT1DPG9QD/EdyO6XhEKe6pYHR6DCPW 1wBuWjWZ6xhpsgA== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552003397158500 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 c9a5fe4934d0..6d84bbb25bb5 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1663,12 +1663,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 @@ -1952,47 +1952,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 2d3bd2ae327d..8e6ca25dc49d 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1764,12 +1764,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) { @@ -1793,12 +1787,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; @@ -2533,74 +2523,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 Sat Sep 26 20:00:45 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=1788552080; cv=none; d=zohomail.com; s=zohoarc; b=NrrSgpWUXkZNGVXH8fxhhmix2jbk8OXv8rIwXM6dD98Kkfnzi5g8gnYUKl1HZoLqOsd/81d2CiyWW9uts6ze6L5L9If5NFL9l0IeuBsIU9H+m9PlxZeNYjusFb5EpMambbL/evnmuxM+Wim9rTqrrZqrPDyDcdCIDI7F/+Owp3U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552080; 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=N8nXlOf33FzZu4Uffx1FIQkjSH+p+ULqjHe80q6rVhY=; b=QRmf5wuicnjvcSSwD7aStMHw5QOfKq6TJ1z+dQexPKKp0l+6MIUzUj6VWI23aFKZUcouc7qYnAp6dQXHNGyRzKGyieYUpf+/p40bkAvgqwaNxG9+f94ko6rjNw/saLvJ2F14sFyVmrs8JuS4BXFpWWHVEYc4xwvSURXv19CDDRQ= 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 1788552080712114.85320224952318; Fri, 4 Sep 2026 13:01:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a4K-00085U-MW; Fri, 04 Sep 2026 15:59: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 1x2a4I-0007w1-DK for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59: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 1x2a4F-0007wD-Tx for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59:22 -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-14-YxeiT9KEM9CL3GLYPFrLFA-1; Fri, 04 Sep 2026 15:59: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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E619A18E9B24; Fri, 4 Sep 2026 19:59:10 +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 04C9030002F4; Fri, 4 Sep 2026 19:59:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551959; 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=N8nXlOf33FzZu4Uffx1FIQkjSH+p+ULqjHe80q6rVhY=; b=a6GCrr5T0Il6OnmiA0YTvSQoi6T1vCiGVBxyeJQnr6TGzGUnLU9kdEF237iCCU1fWpOM0c KxDVyhX7a9w/ZgU9bjQ3gb+YyBmnWUBkbbDSAj0VjEMEQjELc49gjKFwggxlc5qCWkP9YZ sXnA/9ox/tKQrK5DumHaLEJ8kPd3Azk= X-MC-Unique: YxeiT9KEM9CL3GLYPFrLFA-1 X-Mimecast-MFC-AGG-ID: YxeiT9KEM9CL3GLYPFrLFA_1788551951 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:00 +0400 Subject: [PATCH v4 17/75] 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: <20260904-qom-qapi-v4-17-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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 , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , 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=zi3fSX27M23Y9fYFv+SIfAQ4hQmfHUHoyc41kup2lFg=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLJhl6wjdQXv6uRaDpImlq7Y+q7VIayXtIRn CW/XrWnRE2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyQAKCRDa6OEJdZac 5XpDD/9eUxr7UYMoApTDkXoFITjcNVZZQIA3Ikuw1CmKFjrLevYvXdwyCFfGtbAT7y4y1fn80Jp 7yvY2zKMle2IegfAH41gnD3VM1npLzC8gdSZ378Nor0Afp4jLYNTyXZzZPSzjXj26plUjrNo9F4 W2lPtEGdMK5oS5FKOYroBRHrqI8NTWDz/eDNS3Yp3qUbw0RuUPfKm21Hubo59n+wGWo/nwmNNZb t9YF42FUoGSPk8TyRAslEO3rHGWchserfcc83fxp6WiBw0Cq7ODP5G9R0aNkgYwBQtTeStDuQwJ Mr4oH/I4CyqYyi6TumwYJfA2Ini5B65I0vv+aAJgp9TNgDHqnoB10E7jh/A/cUdhQDSS/jCMMe4 hGvsUs5CCjgxeIsl8hKljLsMihAZWcy6fzYyYDwixedaq3mZaIXTar2S1aGS2wcZ/qlViaOWkca 8WHX0PPIKq9Bc85D+VF0A/UxCnYqtGB9OEBQAP5Pfjw26jTAxCoOCUqcGYwearwnpX9OjJm89eQ J16sJc08KgjCo7f6BW0PqN8bOzCDebLd8X8T8GBGZkqRXhklrLnUEyR2biGy8xsK9FvGwUn7fVx QVLv9OhZfvYZAU9ehIUXDzVivO++onAsj3JypFeEVUCQzkRubLC78db2CEJlpfeCZTjIZj9TTgg IKTWfxDkbQil4bg== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552082147158500 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 81bac42a1587..8e0e5d4343aa 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -31,6 +31,7 @@ #include "qemu/option.h" #include "qapi/error.h" #include "qapi/clone-visitor.h" +#include "qapi/qapi-type-infos-sockets.h" #include "qapi/qapi-visit-sockets.h" #include "qemu/yank.h" #include "trace.h" @@ -1568,7 +1569,7 @@ static void char_socket_class_init(ObjectClass *oc, c= onst void *data) cc->chr_listener_cleanup =3D tcp_chr_listener_cleanup; cc->chr_get_filename =3D tcp_chr_get_filename; =20 - object_class_property_add(oc, "addr", "SocketAddress", + object_class_property_add_qapi(oc, "addr", &SocketAddress_type_info, char_socket_get_addr, NULL, NULL, NULL); =20 diff --git a/hw/core/machine.c b/hw/core/machine.c index 8939ae16666c..530fbaeb0b28 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 d01ff1948e5e..7c24eba3e0c3 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 @@ -10980,7 +10984,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 Sat Sep 26 20:00:45 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=1788552190; cv=none; d=zohomail.com; s=zohoarc; b=fZoSmLayWyuz2ZE849dNLfTNMs0qocWLuPwu1G1yrBgRvMhmDZ3Xg2E01J7cwxtDQInWF1epUm0CCG14GjjXTd/dLxokqk18uSHnROhv+35FfYGafIc7lNifFFa6n57fXiVbw0xHptV7iVZQY96ubGJxIHx8PhOVxra3j9KPxXI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552190; 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=ewqAcxhAam/O2V8JRCUoL9x281NvtZ3BSSt5JO5WsOF6dFzJ0b7Gx4DMMIa2BHJlUWS4cjuKGvh3iUrYFlOHGfGk17V2rDQaDz2d0+Vkp3g/iqxDodWAcktcA7BrGJRhNbLhgrnLcvwdq6LQCQeK5uzMr8/ibxr1wDrdQuBV5Js= 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 178855219020538.20257659758522; Fri, 4 Sep 2026 13:03:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a4I-0007vB-3I; Fri, 04 Sep 2026 15:59: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 1x2a4F-0007nK-WA for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59: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 1x2a4D-0007vq-T1 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59:19 -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-AvxiqYkIPvyQ8w-X5qv8dA-1; Fri, 04 Sep 2026 15:59:16 -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 A06DC1944D40; Fri, 4 Sep 2026 19:59:14 +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 93FCB1800641; Fri, 4 Sep 2026 19:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551957; 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=ER//sehtocYJtbwoUNsTAUvN7goQBhVY1lLkeGMQf+zUL5Alffyorr5E6xaYWDHkM5Nt7X P5E8ncxjve828NOxkexH3IuFG2HBtl2As2RIPwMW2PUgqk4nX3tatLsocSQpDIY9z+n0Qz aLfE7PjfITXsNNgXXvk7iM1UyZlyDI4= X-MC-Unique: AvxiqYkIPvyQ8w-X5qv8dA-1 X-Mimecast-MFC-AGG-ID: AvxiqYkIPvyQ8w-X5qv8dA_1788551954 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:01 +0400 Subject: [PATCH v4 18/75] 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: <20260904-qom-qapi-v4-18-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLJwX/Hj9f6oi/9Dto/0NkPn1XbJQZWZHzK4 nbq+Jp8m7WJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyQAKCRDa6OEJdZac 5ef0D/9+yYMattyUmdoVTpQH+EQeUzRqdQ9HNa97gjOWWkIaKyY/5C47TzVrcVDbJQk69vxY6K7 umVy5uxdIxeHYOKmyvRmESnMkVvKiaSiTtBfjnl9HFLpdmDzmbOVofvCQazXjRaSkn2D4JaUrCL 9Jqna+ipP+3HdZ5T/t1IkBDgnvdWSMx9NG8oKoIHhUYd8lecg/Kh0m6/i046SjV5Y7vBRya7IGc CkqAKB38R/2kxctDZwq+OJpB/rLNMKs/bLNk3eo1/SVazfmTSldHiaVc9wj4NjFTVXUXPS3Mz1p qLB7JHZwn6B2YSRGpGxdJXoxhfdmeRFkCKOv7ncPsRCJgYW8mTd/NNoSiIPaQhzbCKxFNUPVvDN H0q1uQWk0X/w2Q0Xk3yiQiJUEGxVgGYr2vA+vy0WVLI5YakQNOb1j/jkk4YyqcuNbgGpYy+3xlT iIG8q7s3uFEG51wJNk3V939lKQfTE2hQzIV4Pm5OV5RE/SXvTPrghQrz2nnj4qds7mUIwjFQ69B Sl6Mo0GJ/Eff/Drnj2oZ5H2MRj83ehueI2djYBlfW77C1HPN1dsPqQ+pKksUTNoDeb8P0/tKdgQ p2wb5HQgwS1n7DyuPVByJZFbxMfl0r+EDsQvPi5NEHv5L2OXJtmbDFXWLLTuBSvCTRroyt7tUok K6ExtMpWOLCC4Hw== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552191985154100 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 Sat Sep 26 20:00:45 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=1788552044; cv=none; d=zohomail.com; s=zohoarc; b=OC4npIKMqUvbr2mvZnffvhIxJyIuRp3qMFiZhlTDEE/vCwkkG9WlgsHnhp2gfwMFjSXIowgj1O5BwevcY3vqdj+yCD2zWS/c4FXKu/Pbjz0NTqxZdaF6NhdfzgN9Xkt1PRpiU5Aoc7d11YUCLJf8nnapxSp6M2bmsazHyuV7QPM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552044; 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=jojlXeYDDL3A0JDUEvmW3VvkL/Y5Yr7VYh8jmZrRlYL81Il9XWK2oYttMT7GX3hJA9A4tVS6+yUXujm81X7ghbz19zyVJ07Ft43e+/kAzeu7SEr34XVCYLvtcYg54HY+naoysPvQAoU11Lk80zMbFq2dTZRFmkLZoZwIzKZBs6w= 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 1788552044583563.0456007178269; Fri, 4 Sep 2026 13:00:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a4M-0008Bm-Bl; Fri, 04 Sep 2026 15:59:26 -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 1x2a4L-00087V-3j for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59: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 1x2a4J-0007wu-C7 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59:24 -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-35-cjExEn7bOL2XFJZIPy3VMw-1; Fri, 04 Sep 2026 15:59:19 -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 1F9E519114BB; Fri, 4 Sep 2026 19:59:18 +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 1E19418001CE; Fri, 4 Sep 2026 19:59:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551962; 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=LFotlQhUoszxdmB3C9ER7awf8IsZh10KbNpKvZgiJtyoLGotJRSh99a/ipH4yDzNbKWrXI yx+ddBKxd9jJhj9g4Lq3PU6fX1m7dDNi0+lUuFuUhIPVtq1IAVMSU4GWZt0kKSo/nBvPRt 9T3BJ6ayc7C2OW7XXmaBikRRWR7PtHU= X-MC-Unique: cjExEn7bOL2XFJZIPy3VMw-1 X-Mimecast-MFC-AGG-ID: cjExEn7bOL2XFJZIPy3VMw_1788551958 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:02 +0400 Subject: [PATCH v4 19/75] 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: <20260904-qom-qapi-v4-19-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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 , "Michael S. Tsirkin" , Richard Henderson X-Developer-Signature: v=1; a=openpgp-sha256; l=5502; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=SY82PLEWc9Gc3m055Lm7iyiVVRaR86gDnyc0DsDmtbo=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLJj7DQU0tYL6mz7aiQXHXbf8ej81i78FpTS /qyh143EliJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyQAKCRDa6OEJdZac 5YGmEACFDLtlnoylhd6yMg6YMcfnme/3JW/TrOQoAQg+QFZ1KLZaYm0axADkYePvHrV3kjHSHvx fITJqY+GK649PnWFWia6zm/Nx9O7WzQbG1yWTDFOT6aqK0FjWNCHIKn5iNVeFu2b4GcwJcCu9Ol aRsRvkFwLIA3ZG0Mb5/kCjOLho8SrbMobf25HFnjADK5F/DvbbdDeGg1XcUVDV0/r9/KQSfjv06 QEpSpqIX05P/pL82qmBWW3vCpPiKWwl5wo70X9141fHuK0JEKor1LE1QFK2lhIXzLrWOj1PQQxO jseQoOyA7KUHj067ZpsQPhb2P/IQ07NS2Ym3TgG1AufiWc6QY+PxtvFWdun5vL8pTNzBBCcllke O2ySPuEUoekRvjHfECtOh4a3RZl9v3sc3v4bAcYdsxucB9DJ8WNZFeibogUPa/ef0IexoGO6PZL 6pD9n0Wug7jsmaO8b6C0aYoy8LMM0fDM88ouu/rf9ZrlcXvrsRGVPOXtB2iW0zEarQIsB5C5j2F s48J/FupYnf/03Cam5swjOfjcF22OOquGBWdlQ3X0fFnq/Y1PQverNvuUgHT8rX3MsYlUiqEmRR RnsUXnmKPOKNfKaC8kEpHBjvYELLw1nHKWMrEoocY7YjK8fcDyAboSi+o7gXS2Dx9fQzFd55WI9 yCeoVnS5MqEq8cQ== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552047606158500 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 Sat Sep 26 20:00:45 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=1788552041; cv=none; d=zohomail.com; s=zohoarc; b=AjnFPcBGuEvIqoSOfRV8p06PspRuP8TdYBanGLol5bteKaJ8byQ2cgWs5P844dF3pgCw6Py7h+NPG+KCFo90AfvBlpcVHUUE1/cbQcbsNFGm5utvjnsetI/RmszrJesWoJ0Vt1NsE4yCtj3hOjUXaUHVaVA5oBT5/PvDV6gFmUI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552041; 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=k21SUDTz3gX7HvryTb2q2PD7Bc1yNwkeuu8pzZrK/EJ9DcsRTnGF6gohp8b8scP03fZ9rwES9q6EEHXRT1A5JWsPUsLi3x5fdlUkGHf5GidNPBz2APBe8HTpF/if5v4t46uZ9GoZAjtEMrUFIL4D7AFDOC+EHnNye5rdWT9mphU= 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 1788552041670482.9493806173364; Fri, 4 Sep 2026 13:00:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a4N-0008CS-PE; Fri, 04 Sep 2026 15:59: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 1x2a4M-0008C9-QD for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59: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 1x2a4L-0007x5-8P for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59:26 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-206-cZVId3KqMKe4Iqewz6LYHw-1; Fri, 04 Sep 2026 15:59:23 -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 13C921893ED4; Fri, 4 Sep 2026 19:59:22 +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 CAB2C5BC; Fri, 4 Sep 2026 19:59:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551964; 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=HWMJf3hsIbRtyqRs6NM2QIng3u8U98QzCMX26xEkSqu3PW3qr66G4QBOWE5fMSY4R1nxn/ OyWaoE5OR9Q3mEbC482pI9G+POITPrGKUTuoQfyKOhZMnfGJM2GLBqwe0Wn4+MeSa6rDGV aWq4+IfvDUqQMr5FUTwi7aO6/JrBhaA= X-MC-Unique: cZVId3KqMKe4Iqewz6LYHw-1 X-Mimecast-MFC-AGG-ID: cZVId3KqMKe4Iqewz6LYHw_1788551962 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:03 +0400 Subject: [PATCH v4 20/75] 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: <20260904-qom-qapi-v4-20-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLJO7XgwdF+tY/VBB+vSZkSkH7TPQCgY1F1I /mn7+VW5wiJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyQAKCRDa6OEJdZac 5R0WD/9zFtEYd7ZAqLBIPDev5Tyl7lxLehWqW1dht7AsbVfVLE90tEYmUKjBYExqFHRDYAhsNGb Tdg7JUhuqwwuIztVgGEykQD6+aaBADGhgUiWW2MjwRsWwgTKPV/zTwybtrvIGBZ0AuG2TxRkxy1 5jUqqaYU4Fsu+lktEeRMNOywSkBjgw/e2OiI7adqoTlpqFLrZ8hqSA6g0mob8gkq++xmx7CXgrp 3VxhhfFOkj+OLdFITwCm9L2riX1jiVwbCK3zmjtgRzoToyxZ/jmilUf+qKHW+1LWRST5Srzpq3t 6kAdEe5IFiDjV5JYEWR+qnyuv5L6FRGxZ2Q3A6fnOCnnBaST/KD1NGCfgmAuPIDrwP5TnhciyaG isUS4xtXrW2BAQpoNURyCbx3GMNvG0hUJF55tc4Z+3TOjpUj7lDjhwX2dNPphbzpa1IDYT+zvCg GY2LOe4ew7aNLDICqtkSte2zl2IL0OzVSdNQ8rOOKdrpRvteLPxSp1u4JQrJS6T4sIG0Uh/Y3ET woZKyWom0Gjl6kHzSbMM+/fU/MYoJ2+6u7n/3OTmD5ALT5QvYQnuUq64QdlNTvZHG88Tsevl1pn bplcSsXuy+84DYuF0QDfn4SQhxKRmXFNc7xB//xo6z/w9gay0a9Ypqs+L5K9fEvA5Z0tcHw7/tX 4R9yIEeJ5D7Ai9Q== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552043557158500 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 Sat Sep 26 20:00:45 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=1788552006; cv=none; d=zohomail.com; s=zohoarc; b=cgSyuVcvM5jipOcyGhoh7Q9VTJxs7pkvd9YrqEl8l/xVistWNEyas+7PqKWPbxHZeVmvdJCv5NCgnbeIWGWHjcOaePJRPIfSGn3fDhdlVGZbkDW32s0cpptDlVgAWaTV6bAC8KoKc2+tPcQDVqvYMb5YQhvQgF6QSbKrbwzTEG4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552006; 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=3lpC35gmliS0QhA1JkmfqWaHkZxlzKVeH5o0OEMIMN4=; b=WykizXye6AVLSlIpiScezZa9vI7zredOLSUYvGYXGvhVtRYDFp15fqaUDXolUX+KovHeQFEuKt5s8z4AEtq6V/Kdk1QhvB5EG/H5SD8tlfDTrJkKD+Wlyp0mjyTbxbYJFDEdJZHIqireaHI1Hfs67vZUWbveGE2TrxiowyuusrQ= 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 1788552006293515.5690966800083; Fri, 4 Sep 2026 13:00:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a4U-0008UR-KQ; Fri, 04 Sep 2026 15:59:34 -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 1x2a4T-0008N9-2F for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59:33 -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 1x2a4R-0007xY-Jh for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59:32 -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-383-8i0tEDf3N3qKvRcq5y3OyQ-1; Fri, 04 Sep 2026 15:59:26 -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 6EB6A1956047; Fri, 4 Sep 2026 19:59:25 +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 672A91955F0D; Fri, 4 Sep 2026 19:59:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551970; 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=3lpC35gmliS0QhA1JkmfqWaHkZxlzKVeH5o0OEMIMN4=; b=UXGlrL9XretG80OIp3Fg0diw0TOlmqhCBJI4wgaIAppZ8yMYB4RlcI0z3uXHIFuZGvGD/X Po+yybNLy4VkUYOdTLfiVxJBaW0IRyujwYou6FKlDUTUio/KDix0BgqwU5V4iRbiSdM/ma zg1K1vwGZ8rXUUQ14RoFROd9ffWmWRs= X-MC-Unique: 8i0tEDf3N3qKvRcq5y3OyQ-1 X-Mimecast-MFC-AGG-ID: 8i0tEDf3N3qKvRcq5y3OyQ_1788551965 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:04 +0400 Subject: [PATCH v4 21/75] 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: <20260904-qom-qapi-v4-21-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=VEvZEB5tSbvTYsPJm20+OtQi7DOxjCPx8lu+wm1r8Ps=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLJ/fLQRfE/vroLpHvG+0f9Rk8Szia1Mg+uW ZLOi25zyV+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyQAKCRDa6OEJdZac 5YbUEACRdNG2sNnnT77kOmUNszO4+GO37PX+dBHqqej/DTyrIzYP8fDRaHHwKm+qjnHcqvqzmda mjvh+fWtIOdhNerJTtVC7E2NSIXG3y+AECQ32jMjDoopNdEUki4VJ0IEh2D92V/l6Q3zZGkD6GN JVReXOOzmU7N1aV3H4+WA8+ziCauJBF7MvnLnGPoSgFmKqQCuVe3YX0RNEcIrKCXZGlT4zpUlI1 v6aHwYRrRWsX87YO4QdImbgSU+eczpb1mcMv0EsCWvUkO+dPmsrr4mKZb1Dxr79cOrIyRTi/tg6 +sKfv1QLYwDcVNdD+EuMN+S3ikPiaSLMCs/HXq64AAOtURFh8bp7xLDQicd3anKHEsadbJJHeeO j2jVXAZNiZZvPVhbs1DdXiCmW1Y+wj2AUJMZLrbEwCyY2pKBBENvauF4fy2PeQN1rh3gHycW3jI 7x86VBZfJqIFarR5eXENAry6tqQlvXSSnFF6sQM7B684u6fFCyezb30oZnEYMAPqjw/OVW2nIlo 3oYXw259aJkf7H8mJceWAdjKPna3pk07no9eKfHUeG0OyTCxv+JJf7ENDdMpxEkOkUxct6wCb8O oCeNZWLHpvLni667VW+brsc0enr7VaHfj2lTnReHvYcCLWb0oebQw/XFSspZj/BMZNbK7NQg1eu LD3FQL1hDq0f1gA== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552013417158500 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 0871a35e11f7..872920b6482b 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -73,7 +73,7 @@ #include "whpx_arm.h" #include "hw/firmware/smbios.h" #include "qapi/visitor.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "qobject/qlist.h" #include "standard-headers/linux/input.h" #include "hw/arm/smmuv3.h" @@ -3567,21 +3567,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 Sat Sep 26 20:00:45 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=1788552119; cv=none; d=zohomail.com; s=zohoarc; b=R7zihbkt2J8ZW6jgK1q79k9VrLe18Og4m3uYaCjmtuIAuYMxywD4rD7Y+lTseFz1psw7dPGIYROHCmzzAXTUPq3FCXVUYouI0el6jtuKOjLebggWPPgMNxb89JG1PgW/brHUrIfZ/ExiGDKnsIVuY4JhlHfiKFsFM0Is1dOWOlE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552119; 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=6rGExF2XabFAuw/4IqtgyCyvZvIzs5mIGAX6kd03iq0=; b=KWs3OlxR+TCzaoJQqY+EW2P2jAu6Aq48NwFGEicg/zd2N1c6lOEHFZKv15WGJd31Hl7YFZoXR3Igo6FnXk4mXtY+0HGl/dLkh2Jwg6EIXLhF7Jea9yHhGHKKOBVeV2urZROZS7krDDLrFoHysB+h2uXNB8CWvDP/ZHHIyRpHlyU= 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 1788552119533674.4313705101811; Fri, 4 Sep 2026 13:01:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a4Y-0000RM-Ce; Fri, 04 Sep 2026 15:59:38 -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 1x2a4W-0000Ja-Sb for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59:36 -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 1x2a4V-0007y4-5T for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59:36 -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-AwuMA9-nMpGfg50kwl1gcA-1; Fri, 04 Sep 2026 15:59:31 -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 5395919B9A86; Fri, 4 Sep 2026 19:59:29 +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 500AE423; Fri, 4 Sep 2026 19:59:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551974; 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=6rGExF2XabFAuw/4IqtgyCyvZvIzs5mIGAX6kd03iq0=; b=L6dB4oOCuj9rIUr71oE3QLlvz/zkgwRDGMaQPkZzE4+ukX712JYthDHDO7rdRGopwP0z4+ q6FZr2W9Q1UzY/ilutzevcsLobAZ5/J63k+a0bOAYXdZ25qy1p1hzV3qwbPpVaQHdorHDL NuD2BSZqvD0WzDVSm9ZpAIFbyrqHxYQ= X-MC-Unique: AwuMA9-nMpGfg50kwl1gcA-1 X-Mimecast-MFC-AGG-ID: AwuMA9-nMpGfg50kwl1gcA_1788551969 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:05 +0400 Subject: [PATCH v4 22/75] 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: <20260904-qom-qapi-v4-22-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=uF9a97y3JMzxdw44lh7+z7RmOm/yX9vHLtEpeXSxK64=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLJcCiOt2ExPe7LJphyJhMVlRzMLhB/7hK3I WJulNUqfDyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyQAKCRDa6OEJdZac 5UH8D/9++YsWKrvJiPWSRA+zOQf3uBPzlChqUPin4HDRFd1Zi5QwVT88OoDJrSDONMDyZ01261C vMmWZaG40YuLxswPcic41oP2r4mm8j+8ftTwhaZ1gzxEuQmsLlgi4sHbzHi8FtjQ/46dms5AfgG 6lGYnXiWqe30FasT+tHZM2Uu3T0dRCNEJXK5DXWSLCxfptvbLGnkB2WUVkXJfiBXaUTnHjlsWpE iQelfiAZO7TeCD6Zh/TJm7FQjNl0XiFbkFtWSJ62CNoXaa6ua4NXsBiC8JTpG7TRrBPmgulv4r8 fcJXzLxdkWy4wDOnQHEzsfxowDrHAiIB01W7rkNA6drwbA7rv3alrEymAzHEoVUs3tZhxwRWagh 3Rej6k/KZCKuI3EdAIpj5sUl5YXCxUJo5ruI34btOpcLtF6tnFztZiCUUBotEb20Oo38rP8fp3v AnKl83vHAmm3kCJ06h7Jhe2i3dV+nF6iQgLrVwglL5+ttzZo2YvU58EuUuYo6Xm0Kli/iAYxxmM Mh9tT+e+XEzsd4pK6aMdw+pCWz0pBkEIKWk4Fl7Qc4yXY/jNsZK41qkj0EuofMgigW1B7EkVrYS wEGAKCXDdtGEvTPqK/ZH72kWHVhcNDv4atSeGaXypQs5ZBwrnfa1T0KX39e4CjX6rBpLl/EOpwX RF4Ud5HzTtYDibw== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552122129158500 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 dd3964101780..a83dec3d626e 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -55,7 +55,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 @@ -1654,21 +1654,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) @@ -1676,21 +1671,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, @@ -1788,17 +1778,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 Sat Sep 26 20:00:45 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=1788552094; cv=none; d=zohomail.com; s=zohoarc; b=E8Ev/NpndK6mSrA5rpp5t9NRkJh/T6BUqiPDtXt58m25bE5XPxlsYYM+KU6QermftmhHUiZzeC4/wXD4EGmZBHOah9PMWDbtLy3Cahmu2zNmB1ZNLbRTekuXtb2QCDPi+okygiZZcZgIik6MTJMN2IRrNUz7c5fnh6con1pt6yQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552094; 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=FZydhHOzVih6rizcpgGuJc3wGETq8Prr/PAHbkDLgKVSXXxFCE7Ui1xVAzYUqA+85u90KO84PadQQwRtFemGQqdu/uaI1mcTLiGMEFLCZBbFRIFzv9XqPV7wkrBbnAxNKzNgf8E9FGHZp11yX13KjXw2Siy4MdFcjm0p/pRVpFg= 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 1788552094440976.5484983227193; Fri, 4 Sep 2026 13:01:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a4d-0000qt-UK; Fri, 04 Sep 2026 15:59: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 1x2a4c-0000gi-GE for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59: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 1x2a4a-0007yU-IW for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59:42 -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-657-JIu4yjkJMymrp4svugnFew-1; Fri, 04 Sep 2026 15:59: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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CEF7D18417EC; Fri, 4 Sep 2026 19:59:33 +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 D3C941800641; Fri, 4 Sep 2026 19:59:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551979; 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=I9+vYnXsLU/QLq3QQN+p7kB5hth6W3gHyXIzyu3+aUYXEWbXW76RXJjymRgCELUpnk4eJ9 fkbCK+BtnmdZS1xVVZpC9X5euBd1TYBGPe1G374vQvkyBAaM0oJ5m+lns+UCYQ/3VL1TbI +2hDMEyAskoH3hcpBauZHXovD+NeKgk= X-MC-Unique: JIu4yjkJMymrp4svugnFew-1 X-Mimecast-MFC-AGG-ID: JIu4yjkJMymrp4svugnFew_1788551974 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:06 +0400 Subject: [PATCH v4 23/75] 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: <20260904-qom-qapi-v4-23-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLJ8T9hniZpQApVkllZEeIrLOQt5C7ofpB1Z lCzqYAR7gqJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyQAKCRDa6OEJdZac 5S9aD/4p19jVcvCIQe4kIQkbvOcs/WlGqDgUQy6a+OwLZFHvYOU0mEwvUWQ9cQjuDNgHDE/9jJl plYhn8oybZXbwvFpgjSZPfAQkIXyWqdDGJgKuMhOnXpqFaIOAiiK9b1BII6QXRD+7acEjztUu9J /aJsnMrD3InEVO0/uROBFhkBDej05OQmjEfjKwWNxNMyc8RJYLrLSzAwzW8yYg5XTKeiBgeUL+3 JGeGV6rIMyekzqVlqW8xukFVjkUjI1oQGqefSJDEfrZnAolkZUjwxKulB+qhJtbSgxhHNRzJ+96 AWN/jzP/Duv3APRvbhFtcpguQzNsYs93y/Yzr0HxortYqIko6AR6qzA5Gyv09WZ+A6/vfpJ8p90 +byDAXQtB6yjlbMhi1coxpZqG4XyU610lmlXOQvpemw93sg0Vqc4hPjIIG5OR988VKQUv/7F7A1 QZolEBnI0ct6iUtrmJgYNiZH/4G8GLSw7J0T91K0cH2UwxAoBIBTUWkVAkCTUsR8Y5XDZhwjHji h5mvkOIwV+hBrOiv/PjZgOHbaJmvXKLndVcMEdCZzzenYVfMujdd3f0+41avKi17/yPmjmHDNC7 JqL5PYXwFO6c5DPGVbOdUPgMti/j+Zr1u9mwaOYxONxUnfRVbGSvIB/IuFLe4PVXjv+zo/meE/Y cbk+V+x/JL2fLCA== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552095952158501 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 Reviewed-by: Bibo Mao --- 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 Sat Sep 26 20:00:45 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=1788552042; cv=none; d=zohomail.com; s=zohoarc; b=VtjCfrKFGrE/n2qirpALYe7MG2ApFQEnm3nIzySCRpQVfkt03vkMydyfo09Bn8N0iMxy17oxHBjAmOuVfVXujAUupQXyM7G/DE7Qzy8BqO5bzQ81seAJSGPHZKEixgIJXdja5fb+afYI9bv+/d2AaHKwL7EUMaJxa5GkZY87ssc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552042; 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=U7O2raq2QypBfb1tKoZv+9G6dAjOZWYF/jU5qP+RusQYn85LT+mnZ8qRxdd/YDOCh9iI/3SQZEfb7UC8aSIdEfjw/BGMbBRrWh+4EsnNPpuNgqs0Zuc9eZWO0CrR65xnE+qcDpHN4I3+biYmCRCCLZyVkOMkeJussHF4i5KXuVI= 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 1788552042097889.9988390188453; Fri, 4 Sep 2026 13:00:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a4g-00015u-Eb; Fri, 04 Sep 2026 15:59: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 1x2a4e-0000vF-HY for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59:44 -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 1x2a4c-0007yf-Ls for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59: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-452-QICGy3RSPsK6CUMWAkl2aA-1; Fri, 04 Sep 2026 15:59: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 847DA19540CA; Fri, 4 Sep 2026 19:59: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 89ED530002F4; Fri, 4 Sep 2026 19:59:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551982; 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=KfiewZfs/WImzSmlHg4OJfytfDHIJZ/raUfXqZ5u5J3go8Ss9agCWlUDRbCXRYgdUZyhdp wNbljwC5o4ztjXsN/Z69jLX4eTc1iFf88rF0fWjsjbD/L3dgswp8V0QkX3e8fjRoTol7+R axDq4hy42HM8tgjGhpvFNfQ8KBdMb6o= X-MC-Unique: QICGy3RSPsK6CUMWAkl2aA-1 X-Mimecast-MFC-AGG-ID: QICGy3RSPsK6CUMWAkl2aA_1788551977 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:07 +0400 Subject: [PATCH v4 24/75] 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: <20260904-qom-qapi-v4-24-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLJH9vR+epp1/UbIDEicRw3fhgZQYqJ1I6HH /Us7OW4fv+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyQAKCRDa6OEJdZac 5e4+D/0UmMbXZwuYWDedkBXrwNU6UXWIEU2kmKg8yIOW3w/SjdLSRrCM0U/YUo1O45qmHIHgV3N lSS4uNq/DEjWwO4mYwD8Da2kdYDWmssHTnPbne/tU6qlxr/bTP7zEe/HgDylcQmXKXN+A5CVOod k9GyRxNh77cIm0hqhFxADYywhARsqqx7u4a71I9Q3qFBB1zlvmbLGB+dH1JHQRnEnhILhXLe3pV EXYCihmOAprp0cw/ps72YUGzW/gba4Xj8ssVtuWcrnZB3gfBu5759PykKMQg2CLD+sv8cZehg3d pU/byeEZ7MhgecByIBuh0LzchzEbJQE8wbjrF+SNm0YVKfJHUeYf82fBy5qMuxIIVI8tE5ECaYu Ip15j+V0uaB2PM0zWZCPsixeVoIiDvthSZEck2XAcbHagiZG0QV3mxhIoV5FnwReUDsQ8TOCUl/ jVZ8xFcS60kRq3qUPGJhiV21pgFWiVBgx7OBtJ6UUJgIiQpIcM5Dbi61Seq53Q35z/K3/mWP1XH DvTUDvHU5iRb3Y8o+o3QTlxMLNGB1RN0sp1MamfN/rtnQ+wy/VKidJddUI2+kn4i9zzdGjiCgMO 4XVg7SYjrjCZLHpGjRkVZ0Xj2Z8NZTm5UFpTfT2DwXfLsFW01VC5sNpBFP8sXYMHqr/hfK1Ladj PSiYllPCWP5iJzQ== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552045615158500 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 Sat Sep 26 20:00:45 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=1788552198; cv=none; d=zohomail.com; s=zohoarc; b=nbja4cKkBH2E95A7n13sKldGltA+qy4KKS1pbZ2oFpCCWyQ1sDydpVsJ7Rvzl2Gsk9HldrwRLkhozPanwpB+Kdr+6Qa0s+HgJAkvcmT59Jhf9KAvhuZGDBttx8CDcEJxUtceegsTn5XVBsl9UZ5H889QkOIhIDq2UESgVKeW+Ug= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552198; 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=774JTQE9fhFJYG5Yl825DuZO/ePui9QPF2Hyr3EDJC0=; b=VQDM6r0Sfcg0REgnFkuLh3mCqWnF3nFMPiXau5NqCMpPFdMk5pK1csos/fZqp/vn01UENCniTRoeLqVrqYnaXfuOsGu5wdf2UGtooEgzDS2225D8dH7YQBp61zaHNOo+raIbjBuTOziHg6oJ7X7HO/PcZTMgi/iGM1xhg/KWzow= 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 1788552198550427.93804618918546; Fri, 4 Sep 2026 13:03:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a4m-0001E1-Ui; Fri, 04 Sep 2026 15:59: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 1x2a4k-0001Cg-Vc for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59:50 -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 1x2a4j-0007zw-Bc for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59:50 -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-262-GKfpf2pXNtGHTkqHkDc73Q-1; Fri, 04 Sep 2026 15:59:42 -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 2164218E9B1F; Fri, 4 Sep 2026 19:59:41 +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 0FC9D18005B5; Fri, 4 Sep 2026 19:59:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551988; 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=774JTQE9fhFJYG5Yl825DuZO/ePui9QPF2Hyr3EDJC0=; b=B8q4N1Xkqdycu3Jgr577y9GRJyk6eCXQfL1NpKGd0jz/7tQkYR2eonGBs9n8C8C3OFSHO9 dzRR7tavrUKQnxNmKG0qWsfuMHVpilgf+krbNy+PCiUf12bfr9Y5gIpFAyBkVHe0IzDm27 WatP2GxmvD1guBfyDfHkT1rXN9XdXyU= X-MC-Unique: GKfpf2pXNtGHTkqHkDc73Q-1 X-Mimecast-MFC-AGG-ID: GKfpf2pXNtGHTkqHkDc73Q_1788551981 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:08 +0400 Subject: [PATCH v4 25/75] 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: <20260904-qom-qapi-v4-25-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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 , Marcelo Tosatti , 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=pBhxWaKYyHBx9ZkVP2bH1ohKdCKTnUGjTGeRf5Z8Jaw=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLJWYqOlOzUsa+tkot3difFdzObGXEd7adbW I6Fk1mLvqeJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyQAKCRDa6OEJdZac 5YRMD/9DXtHutOu6gOoZwXIyIFx1xL19mRPJ1ca6TItIaUXKFteKjmz9GNqI9ZXYv1T4CXKClVH dm9ir9WT2NxpfBxk3UwvPHHn7YCYrtffx3qdAPPfz82aOprdPDZzzl6jDltOvJB2PKJ0yJ//wSm Fc4GJKzovbjPzgAblKcSMAJkcPTIUSGbexQMsVdY2CmF+1HvJh9iUEitdz7LeEsZGZEipzGrK06 wZZ83aVIrxQMG8b6fh/bdD01Y3JG+Rd4xLw9rfSXSofKTA/q/vKOyn4ycqkyjXcPaYHHM9lWPzO 1SUbM77fd/8KLBhcfXtUN9FlGuYVgFb6+z4k7171XSxtrERagKMDK8eyazLCY2Z2xwpIajUTsW2 BIb0n82Cy3CZMqqAfxxRyw/TdcXPecmMDkPu6HAYH4Qhn+tiUPXs6Eqdlyc74is86ksHSXmnHjc aZNTIBM0rLD2wr4jTHr9K68ig8+u1B+pPVVEkaZLOwJj9o+uRzYhu4WfBbY9qC63WyW/piUaUWp wXvehkBvq4Yu9rAOxT9nIBTYq3ZDs3fNZnkikVpH7xkywmX3W6e6QpUIUgmUoLwcddHh3omv984 WDIgcq2Qv85rwhoX+RNfVctIYCfccrtPmVw9HzwMr4qe+AzohR7s4m+I7ArdRmhjGi1eRPXoZKf I7IrISiFTiQT64A== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552200061154100 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 cc16c6b07123..b2c7260c80a4 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -20,6 +20,7 @@ #include =20 #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "qom/object_interfaces.h" #include "qemu/base64.h" #include "qemu/module.h" @@ -2939,23 +2940,16 @@ sev_guest_set_session_file(Object *obj, const char = *value, Error **errp) SEV_GUEST(obj)->session_file =3D g_strdup(value); } =20 -static void sev_guest_get_legacy_vm_type(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static int sev_guest_get_legacy_vm_type(Object *obj, Error **errp) { SevGuestState *sev_guest =3D SEV_GUEST(obj); - OnOffAuto legacy_vm_type =3D sev_guest->legacy_vm_type; - - visit_type_OnOffAuto(v, name, &legacy_vm_type, errp); + return sev_guest->legacy_vm_type; } =20 -static void sev_guest_set_legacy_vm_type(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void sev_guest_set_legacy_vm_type(Object *obj, int value, Error **e= rrp) { SevGuestState *sev_guest =3D SEV_GUEST(obj); - - visit_type_OnOffAuto(v, name, &sev_guest->legacy_vm_type, errp); + sev_guest->legacy_vm_type =3D value; } =20 static void @@ -2981,11 +2975,14 @@ sev_guest_class_init(ObjectClass *oc, const void *d= ata) sev_guest_set_session_file); object_class_property_set_description(oc, "session-file", "guest owners session parameters (encoded with base64)"); - object_class_property_add(oc, "legacy-vm-type", "OnOffAuto", - sev_guest_get_legacy_vm_type, - sev_guest_set_legacy_vm_type, NULL, NULL); - object_class_property_set_description(oc, "legacy-vm-type", - "use legacy VM type to maintain measurement compatibility with= older QEMU or kernel versions."); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "legacy-vm-type", + .description =3D "use legacy VM type to maintain measurement " + "compatibility with older QEMU or kernel versions.", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D sev_guest_get_legacy_vm_type, + .set =3D sev_guest_set_legacy_vm_type, + )); } =20 static void --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Sat Sep 26 20:00:45 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=1788552268; cv=none; d=zohomail.com; s=zohoarc; b=alNzF6dCYU/DYO2od2jSfLNi0dCEyi0T5ph2gqdib7VA2SD7LjyKmxJk9MBZEsQJe8S4ETMLJQJKFKkl657ey8phpaY6sBmjFri0IcB7Bny+Wg4BW2qqf4rCR+cs6XnXFJyCigHUnAx7IOgY2D3uB6DsvUUYYO8DfRdLpYd6Rj0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552268; 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=KL+eAhoZJbiX7IdsYMVOvFCsoSSBKMkUcdOFrnIrCsYhh1FGntv9idOg5HD8dh9UVSMpCh0/nISUkD4nl+MDnqknlClm0SU1LmLwuW+kwcGbOV+SpVA/6ll6MBJ4tssAkN9Ckz4FkKQV67t3qcBNEnVLL/WHto0DsxQc5lnpKdY= 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 1788552268789221.28669076095878; Fri, 4 Sep 2026 13:04:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a4m-0001DU-3G; Fri, 04 Sep 2026 15:59: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 1x2a4k-0001CU-OJ for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59:50 -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 1x2a4i-0007zu-Jw for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59: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-176-2FE-3UltME27Ut6_wWBkpA-1; Fri, 04 Sep 2026 15:59: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 3A8F918AB46B; Fri, 4 Sep 2026 19:59: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 DEB6030002F4; Fri, 4 Sep 2026 19:59:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551988; 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=VRj41Zg2DND/ujwup9BlX8gyUnoLuE8qB268boA2TR8XvnDZ0P1ylTFTVsena+/BmObARc tDEMFSKMM0vHj/7NtA7tsc/XCk6+ZYGdsiQD8e/OgqV6jLzLSG3gzcwlQ9Uto0B2vTfnln uAGeRiv++4K+pZGc7cpM8OzZirseS5w= X-MC-Unique: 2FE-3UltME27Ut6_wWBkpA-1 X-Mimecast-MFC-AGG-ID: 2FE-3UltME27Ut6_wWBkpA_1788551985 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:09 +0400 Subject: [PATCH v4 26/75] 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: <20260904-qom-qapi-v4-26-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLJ8fP+sdFSYt4ONvt0e03KCwESu//GCn+r7 +XlMxilbvOJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyQAKCRDa6OEJdZac 5YpAEACmUWJpN1NIxQYUydZn18rG73a016bgg5lPG9xENOwa/2/4khiGgL5mk5dy891+wktaxEn QShWZp1KQWq7tsaTPn+DQhwH8d2EuiP+XBQnjk2ZmVbsVBO7tCCp9YOSJt0wGlZ01qYnoaGwiOD fy0zt3qppZmFAeo+c/bU84gSvhTl6sKr7dPeg1ChPiH6xkmiLbHqJnsKHmceuDT5iLQQTpoUC64 aI6AZBKdKDuRVFFS6DdIUTkjJWmx+BRklVEDPeZzgGHbms1h0wkiwi3BjqqSK8UKkv+/MN17MQD EjzNSbIO59zrJaw+xut5urS883pyTMtxcCEOnIDaSPh6aXEm2/89kVLFU7R7nAle4UVZGgHWLpC f/8fWeERG9pRdUamS8az+OdR5+aYlDUocEGU4hcxL79xDtaALgQpxOXVwOHrZj4dJS4YNhrXgho PtoUj/LLLh0Xa9HJSTfAglm8lImFEBKUdbga1dKiBrA5Ai4S1Cm2iNFwoYWUf7ECZZVgIjAti1p P7VOB1sXx/QvEjnjewX+sbIPDoQUA0tsC5nZ08EF5LvBf6nJKCgkixPiZyiDJrqWBrZFd8pFjbX pyzRwTEpUSew/WuksYbpjOk/MTaB1ix55rrchWxZTUy+cZ8tOEknHUFFLYZNiDcVrks4H+uwQau nHoGmsJN5AoPE+Q== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552271238154100 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 Sat Sep 26 20:00:45 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=1788552080; cv=none; d=zohomail.com; s=zohoarc; b=fqOnNXJ/zxM5/rvVw5Xv4WgyCbWc25BEJhY3EH38zOjhfFSqzBe/FlyKZpGZ3BOOrv1IYNZSOWKycpH2P9AZBXS0qWDMfqsDvhPJzTGhn0fo3alif4zALA0AcOA5XhvGD3m7aj5/Lz+sLx54q/MwbmaXz0GlhM7pXCz1F1hk9hY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552080; 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=sPgRadxNMCR6rJBX+OgeUWY7AcJNlaEQ9KAIrEOu/Xk=; b=C/gME+Q07OZltsQFFQsVT98z+r/u4lCG5Wo57RpAzHhe2799ssevdgTmjnfTcOjJsZnIxhF6ep9D0qHOxoXqmskec2a9J4Hmlz7FfYuJzvGsOQqtbVN2yM+CjCfUab9hKzQiQkUzBMHfWLCx9vrpnnX5tn4GWT+0SO/+NagNirc= 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 1788552054423350.1876645240417; Fri, 4 Sep 2026 13:00:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a4s-0001jT-TZ; Fri, 04 Sep 2026 15:59:58 -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 1x2a4r-0001cm-Jd for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59: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 1x2a4p-00080e-JG for qemu-devel@nongnu.org; Fri, 04 Sep 2026 15:59:57 -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-518-B79geypfPW-7IytILCd59g-1; Fri, 04 Sep 2026 15:59:50 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 002D51888F22; Fri, 4 Sep 2026 19:59:49 +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 B23211955F0D; Fri, 4 Sep 2026 19:59:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551994; 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=sPgRadxNMCR6rJBX+OgeUWY7AcJNlaEQ9KAIrEOu/Xk=; b=CNfoNSIOPLulejjbMjCQlNOt1TSYKC1XFyxKW7y0siR2Ea9VUxS9QyjGRXXiOdMNwbrm3f 7EN3nTyOUCgBYzO4KX6tn1dwfCtrSSZK7vGqiYa6/Db7XtxW/kgdeih/sCrBa/wJ2DHJZw OoVNx4l5V2n+YjMwPWOajVzwg6WnoDI= X-MC-Unique: B79geypfPW-7IytILCd59g-1 X-Mimecast-MFC-AGG-ID: B79geypfPW-7IytILCd59g_1788551989 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:10 +0400 Subject: [PATCH v4 27/75] 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: <20260904-qom-qapi-v4-27-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=N+U0XEJTrcuE1wu4Sw7QHz4tc0v3EhcfKlq5/Zejm8c=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLJC4YMeKna6UwpJriGtZ4vJGrB7mpyDL6Lj jBzvH4i5GKJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyQAKCRDa6OEJdZac 5YD0D/wLcRc7/VKvpxC1hXsxC0HG2yA+7G+B1yGTqja0jJfTbTWAW9aI24sfTPxaUSPdPMHyyYI iwCHBUOv7s0zlSGIw/D+XB19l2Qztm/5d0vHHrjJA3wrlViO+InWzrETgBhwBj+w2TdoFjnai/c BpqJl/D2tTa6TdRGkCPnydhi6/VS9SXFleRjMw3K/+KAH9DiIQ2EB71IeMTSvrSfbjB+V4qIgNO whcVeM6ARQlKJuUQSSdv/MG9gZWLUMuRhfa7NFR7iIG+meo8uG26X96FBfvD/GiLsW2C4H5wAJ3 ixNv/6VziP+EpQ5LbKUl2grPW99ex51PWu9Dfg0kObM9C9eHGGZZnp1aLIKQ+s9qknDHeA1G9di tUBoP7P1DSjgrdfV0LL0LB0F0cMIT+91b1856xjnbUP0Jbdh268M28obK86R7JRwGKMVDyJWpCE 570u4+uZ3/zrdNQoHNs+v6u9EEz5rqbVUC1/8g84pS9BSiOm7SrytJYMAjlFNEArjLoWlASHDni w6dgdmp5/p/Rzbp6QrWn08nZiarF+9On60SC+Y0OEE4HCGHGWys1yzPAEKXMFtQRBKZ4hIxMTTj lDjbgIE91FN8/d6HCyM1cc+wAnorLIcbt1O2zPVa1F85twVADYUx4rJDoXeyb4xQNw+FLwuECah 2FMknYpVkY3CZNw== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552090087158500 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 113f79afb9ab..64fa389a2f93 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -30,7 +30,7 @@ #include "qemu/error-report.h" #include "qapi/error.h" #include "qapi/qapi-types-common.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "migration/blocker.h" #include "host-cpu.h" #include "accel/accel-cpu-target.h" @@ -1875,6 +1875,7 @@ void whpx_apply_breakpoints( } } =20 + void whpx_arch_destroy_vcpu(CPUState *cpu) { X86CPU *x86cpu =3D X86_CPU(cpu); @@ -1955,7 +1956,7 @@ static int whpx_handle_hyperv_guestidle(CPUState *cpu) return whpx_handle_halt(cpu); } =20 -static void whpx_vcpu_kick_out_of_hlt(CPUState *cpu)=20 +static void whpx_vcpu_kick_out_of_hlt(CPUState *cpu) { WHV_REGISTER_VALUE reg; whpx_get_reg(cpu, WHvRegisterInternalActivityState, ®); @@ -2059,7 +2060,7 @@ static void whpx_vcpu_pre_run(CPUState *cpu) .Vector =3D irq, }; reg_count +=3D 1; - /*=20 + /* * When the Hyper-V APIC is enabled, to get out of HLT we * either have to request an interrupt or manually get it away * from HLT. @@ -2359,7 +2360,7 @@ int whpx_vcpu_run(CPUState *cpu) WHV_REGISTER_VALUE reg_values[3] =3D {0}; WHV_REGISTER_NAME reg_names[3]; UINT32 reg_count; - bool is_known_msr =3D 0;=20 + bool is_known_msr =3D 0; bool raises_gpf =3D false; uint64_t val; =20 @@ -2911,120 +2912,86 @@ void whpx_cpu_instance_init(CPUState *cs) * Partition support */ =20 -static void whpx_set_unknown_msr(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_unknown_msr(Object *obj, int value, Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffAuto mode; =20 - if (!visit_type_OnOffAuto(v, name, &mode, errp)) { - return; - } - - switch (mode) { + switch (value) { case ON_OFF_AUTO_ON: whpx->ignore_unknown_msr =3D true; break; - case ON_OFF_AUTO_OFF: whpx->ignore_unknown_msr =3D false; break; - case ON_OFF_AUTO_AUTO: whpx->ignore_unknown_msr =3D true; break; default: - /* - * The value was checked in visit_type_OnOffAuto() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 -static void whpx_set_intercept_msr_gp(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_intercept_msr_gp(Object *obj, int value, Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffAuto mode; =20 - if (!visit_type_OnOffAuto(v, name, &mode, errp)) { - return; - } - - switch (mode) { + switch (value) { case ON_OFF_AUTO_ON: whpx->intercept_msr_gp =3D true; break; - case ON_OFF_AUTO_OFF: whpx->intercept_msr_gp =3D false; break; - case ON_OFF_AUTO_AUTO: whpx->intercept_msr_gp =3D false; break; default: - /* - * The value was checked in visit_type_OnOffAuto() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 -static void whpx_set_ssd(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_ssd(Object *obj, int value, Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffAuto mode; =20 - if (!visit_type_OnOffAuto(v, name, &mode, errp)) { - return; - } - - switch (mode) { + switch (value) { case ON_OFF_AUTO_ON: whpx->separate_security_domain =3D true; break; - case ON_OFF_AUTO_OFF: whpx->separate_security_domain =3D false; break; - case ON_OFF_AUTO_AUTO: whpx->separate_security_domain =3D true; break; default: - /* - * The value was checked in visit_type_OnOffAuto() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 =20 void whpx_arch_accel_class_init(ObjectClass *oc) { - object_class_property_add(oc, "ignore-unknown-msr", "OnOffAuto", - NULL, whpx_set_unknown_msr, - NULL, NULL); - object_class_property_set_description(oc, "ignore-unknown-msr", - "Configure unknown MSR behavior"); - object_class_property_add(oc, "intercept-msr-gp", "OnOffAuto", - NULL, whpx_set_intercept_msr_gp, - NULL, NULL); - object_class_property_set_description(oc, "intercept-msr-gp", - "Intercept #GP to log erroring MSR accesses."); - object_class_property_add(oc, "ssd", "OnOffAuto", - NULL, whpx_set_ssd, - NULL, NULL); - object_class_property_set_description(oc, "ssd", - "Separate security domain"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "ignore-unknown-msr", + .description =3D "Configure unknown MSR behavior", + .qapi_type =3D &OnOffAuto_type_info, + .set =3D whpx_set_unknown_msr, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "intercept-msr-gp", + .description =3D "Intercept #GP to log erroring MSR accesses.", + .qapi_type =3D &OnOffAuto_type_info, + .set =3D whpx_set_intercept_msr_gp, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "ssd", + .description =3D "Separate security domain", + .qapi_type =3D &OnOffAuto_type_info, + .set =3D whpx_set_ssd, + )); } =20 int whpx_accel_init(AccelState *as, MachineState *ms) --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Sat Sep 26 20:00:45 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=1788552026; cv=none; d=zohomail.com; s=zohoarc; b=Jt5PZWXL2LYo4LV5J5e4Fn5Fo11jh6wGWjQKUygX2vC56iA8Qleq3K3PPbMJ6pdxuYUbwf7XVW73SmeGU88HyfEoMzRIyKVl4DrsbyDNlKqPz/EGuUIRqomxfeYD9W+Upf/kK32UKtOJ1KFlIlLDqkWSLoTnBhZOgmsd5h/2USk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552026; 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=gD9ix7dZTBrQce/aDpIfA8InGcAbu+7cf7jEITWdG11of1XO/k+8u5XXvDZRNf6c4MhD1XaA1SqhIsjdi44DvyQXZZDpFQefRfH3elJh+XfGWmOII1IT4BCWXu4oxEWYHbi4hit5ZRsVykvxf0lqyfGe6Vlk+R/DdJQNnYXg8zM= 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 1788552026298106.16051267124647; Fri, 4 Sep 2026 13:00:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a4w-0001rH-AI; Fri, 04 Sep 2026 16:00:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2a4u-0001ny-7q for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2a4s-00080s-Ne for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:00 -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-411-rlJDg5MPMPyZGvn8kkEQcQ-1; Fri, 04 Sep 2026 15:59: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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CCD4518D727A; Fri, 4 Sep 2026 19:59: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 CD38E1955F01; Fri, 4 Sep 2026 19:59:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551998; 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=EyTKIcec8ecJR04BJm/e/QMXbUKZWrEAtc5vKS5jTfIVK7t+Fd1TZ+qdRBFJ0XHDeLopTJ QAj+++mn6X/u61tuu61y7fhaerRW1gVlDDGajbI0il7REmO531yswO+h/56TR0Qsd9dGfg SckUAQsx4dQQreHlfrycZBFH8g7ZY4M= X-MC-Unique: rlJDg5MPMPyZGvn8kkEQcQ-1 X-Mimecast-MFC-AGG-ID: rlJDg5MPMPyZGvn8kkEQcQ_1788551992 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:11 +0400 Subject: [PATCH v4 28/75] 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: <20260904-qom-qapi-v4-28-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLJuojURDYhHvRBDUrMUtGTzoZLnEHAQllUk 1Ck2hCA8faJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyQAKCRDa6OEJdZac 5cQxD/9+e8yDxxe66LridYHbju1HzMaE86MiJE6LFJoj9ojsTwXY5yawqKNVNo1bap36Os6mLJm GzdCyidHvXTtQ1Sq6oi85PtBcD3/t33yiRIh/dUtQgyT9TO3mUHW2ZOz5zYNllP0AC/W4GHkaYg G2bktrKkQAEQU1NtZIujp7/ooLgsICf3UkrHc99N9ztFGSu8otS2aF0FWRRXhkD+Bd8PM0PYnvE GED+RJgDYeViOFVaxyyLGyI6zQi32KXBqprTHMyfsYl6B/azU9PsnlpT3yQmeEhcRGSdJbccagM 0WsBt6yH9c/ftrkT/8xNEucelIiJDNnE8bJ/4ix7jD6kSeTNjV0l9R3mWk1L1YeHrqYw+ufdaBj Vaj8Fc+mLGtxAk9lLdhcEZNKZaVGfXs+jkEziUVFWw9X3fEwG/DwzS8piqmWheakZeKtPomCPHz o0Xrq1OxOksMRv7N1hgFaaA9ShQl6x/yE4z/Fcc0zgGDtM1MN+reyGjVr6Ys0rgTfsocpP2aY02 AY2CxtOEMtXkDiQ4+pRperW/6pZxpk0Jb7hvqDTrHKShgahiYSZQAnsV8BS+pKQ1SHCAFohIGQy 9y5UiGrhkvVZLz1R8KI/btjJjLTsvmUc5rTX0AyJQIr2ggXdU5wkGG3UaPrkedPxiYQ3iG739zT EY6Ubpe5/IWf/EA== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552027458158501 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 Sat Sep 26 20:00:45 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=1788552027; cv=none; d=zohomail.com; s=zohoarc; b=Qs8YRKv0wzXIjm37AgksF3FU6eLZQPV7v9MV7fgB/I3QusXl+sk3YeI7YuQAJUOnCoAqzhKPmzor8Luqu4ChtEHeQQGqmjxx66ltiyAoLp7ipvq8V9J4EiQ9n93clW3adAOJidNVWoKIy2XegOa+cMs5K65yTlVmikMR/r2nF1k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552027; 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=A2oxPBb6WHNnMlqGM6r044YaA1an1PF2AKmIMVPkd+XtJX2uZnzjOlnDuLJu9ABHaC214aqVCawDOObQdP4cGI3d+gFYx1up7iN/qJ5bpqI+oUNrPIabF1ReqdnW3/DgFwxAilMjiqOc1zF28AjNtHVH8lRkRLHxxNh2Ps3mSQA= 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 1788552020482938.7468109727646; Fri, 4 Sep 2026 13:00:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a4y-0001wR-6m; Fri, 04 Sep 2026 16:00:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2a4u-0001oL-Rq for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2a4t-000810-8R for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:00 -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-509-pajKOWMCPGaYRg5wDocAkA-1; Fri, 04 Sep 2026 15:59:57 -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 0E46E180A9F1; Fri, 4 Sep 2026 19:59: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 41CD618005B5; Fri, 4 Sep 2026 19:59:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788551998; 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=GWxX+N5ZYro6BuKZOhGnDhw/gmeUeBdXJvmRaXGRmgauiR4QMhGa/gGbH/EsG+8s3cyz90 Nyi32bwi3WboVEUcia0nXR/uIvzeMR2BcpcDiT3kzl6xJG8kyTAV1wl0i/BSjkJ0r0cxoR F9b4CqAvPIoKA6ymJ7LYVNMCSwJjC2I= X-MC-Unique: pajKOWMCPGaYRg5wDocAkA-1 X-Mimecast-MFC-AGG-ID: pajKOWMCPGaYRg5wDocAkA_1788551996 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:12 +0400 Subject: [PATCH v4 29/75] 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: <20260904-qom-qapi-v4-29-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=kA0DAAoB2ujhCXWWnOUByyZiAGqbIsmiw2lFCUUh7DQc6knBdr90jSFZOmj5Xe6uEVOkrgGUr IkCMwQAAQoAHRYhBIepvZM/h8YG0nb2Ldro4Ql1lpzlBQJqmyLJAAoJENro4Ql1lpzlL5wQAIYn FI0s46YWbxHZZuKnvrKbqfQiB1SjpMx1qqyezfrJjpVSYXvDXfdHWQwwFqUBsF5cZry15fIJo4c Uq1IDc1wQ84RkgZk4rgi44STrTQ5xn3hXAgmuEjbd5QBdABaEa8gVfn5L56avSL68RMdKxB5POp 2Aqn4vP56lwxVz1nbFHyoUOWImPL066b/gOg8oVVTjtJIB7PofDN489oN6XQ/jotZ2dR5m2bYGh pD/SasYI8g5QY9RlcPgSaDQD35agzxtPy1F866hsv7cnBKjG2ygEsHAFrAIas4POIlu7fY7BIJ/ DGJDbphie8rYcWCZ3aHP5a7YE+zV20/cSAiXOWfqi2Cweo4rNti2s1HkttJQy6k4ZjmMn0XUakn QSZso3FUVp66X7eKcPDWkVssv06r6R7HtiGOVvGr+LgWYhqT5km52WV7JPNduPHpqPHwYEUQv3z F41A/kVJta9sk/yizNFbyHANjNVmPCezHEiTiDOa220ynFqN0LfqYaR45H/5i+UwLgA32ODN5wx qFqxuqJmMkLvDAfctSh7/vjZAvRzT7v885Mn/DnMrnxn5bpkjr0bJp+PtmgjLzlHEjwqaz7p/xu CdSPhtHl7YwZY7djLqp1Ct5AxKcEdA8g/UOJpGH2FyqI2Mw+YiWttxkEmhYfsFb6oXFlHNqnXNm LF2u8 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552033644158500 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 Sat Sep 26 20:00:45 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=1788552083; cv=none; d=zohomail.com; s=zohoarc; b=CI7BeODBTo7jc/Wi8EH2MS3/RQLtLOj+kIQFEk5jbWAprswfA0xq+Xg6Tkjbh2h/4BwCLHmCy2sNXNQN+qsv0B9QFcQN+CSWW9TU+lUAQ+JA8g41Nf/4b+R29iYXnoziduXN5W1VeHAhV9v5VUJ9DBqKEtPn2J3bPJz4vIMOAnI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552083; 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=fIy5L6MZ2eAComYkK2Fb1gRtzJWseYqDPFDIG6vfhF0=; b=Gl7MpWQFCn+Z8bDA1ODIgaJd6diBO3MjcJneTKg80XJ0vbF4mMxuFTW3BuJgsLj9aBOcbhLRdLuvNZWHuGkBT1/Jq1elWTFQnNZpKYE1Kj+UAtbKjpqejCBWSuqtLC9+PZciVW1MNnDgXcQ8xV/xiQTdeca/scemfAc2XeXi/qM= 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 178855206304063.355836770247606; Fri, 4 Sep 2026 13:01:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a54-0002MY-Ha; Fri, 04 Sep 2026 16:00: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 1x2a53-0002I4-C7 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:09 -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 1x2a50-0008Dh-FQ for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00: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-623-gv1EyEoTNgOztiVAIM3dOA-1; Fri, 04 Sep 2026 16:00:02 -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 9339018E9B2C; Fri, 4 Sep 2026 19:59:59 +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 BA9541955F01; Fri, 4 Sep 2026 19:59:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552005; 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=fIy5L6MZ2eAComYkK2Fb1gRtzJWseYqDPFDIG6vfhF0=; b=Fe0eDHxPxzutQL8MieK27lMjvaGjzWoT3BbziJFSIfeG2CjnFpSIimBiK2OVs5SOo1LpSJ VnqSZ/IfHf5cRLzSUhO0IDHD68ubhkQKeWWO0uMOgJxF1EkY4RtTbqNUWi/mTrOuU+X1fU X9YfHppcmOJG8U1BRxLy3y022nn22oQ= X-MC-Unique: gv1EyEoTNgOztiVAIM3dOA-1 X-Mimecast-MFC-AGG-ID: gv1EyEoTNgOztiVAIM3dOA_1788551999 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:13 +0400 Subject: [PATCH v4 30/75] 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: <20260904-qom-qapi-v4-30-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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 , Amit Machhiwal , 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=fKax/bnWammaZosq8mXn1u3ZuVEpU9ijyyuMaCxA/Gg=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLJA7QqSXxUBypbjk7AXG/r7x+48iRsw2039 kAJdsrKbPCJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiyQAKCRDa6OEJdZac 5QfWD/97igbzMNx8aty9ODbtRhW848+/GhTjyyhexWlmer76XWvA/1t/sDQOYrNvD1/u3XuCTcg h8q7FTYYu/L632sA9oGf6GGvdAcaKAvK7vbFeBupFJ4oKvqeEla5Orn+lHIrZtyLZG8jAYRNp1A fQHvN6IcEb4EbmLtwJF+1VeiY4DQlr/9qlehRFCT/Kt09nX4imLD8sEfwNXVnqAS5cjJJ/jFxwX Altq2gauBxFaIYg6mzcSnFtZDGBPelVnTKhLMzTaxlAKv/09H3p1LM/U+qYuj5NRG+W+7R3K9QS saHyAIO5MzFzzNPEYeUqPHNpKKHGOXxYjwsGFnLVCEjRFFMkSDUw/re8tZ4CBmzFSefYpxBKNGz HxASX12H3ySsAKKZv5Ev8KvYi0959pgC1zsmrS3NvK4PgMGyO6mw5hJGspEKr6xGlzuqTB4/6hL k8LoNz6TLUGmNsI3f1Z+7UTPJZ14gfMe86B6W8fdY3J0YU52zhXLGcuyTXU+WQhWxma80IWfR69 LFyXLtYRX+wj1roxHxjBKeltEpg7ce0ki+c3oNPRA18fs6yjG7SqlGTZdak9/2sYu/egUxvhDjb x0a8mzRoP3TXNpFvwONOyDL80eaklq7SNZhdmwQ/TRIgLyl9I6+6nXEFc5J9QBjuMXiIY5+7DE0 RLCUtIgunFKTDew== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552089885158500 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 0d659e9b0251..e622c79eb52a 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu/error-report.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "system/hw_accel.h" @@ -59,7 +60,7 @@ typedef struct SpaprCapabilityInfo { /* Getter and Setter Function Pointers */ ObjectPropertyAccessor *get; ObjectPropertyAccessor *set; - const char *type; + const QAPITypeInfo *type; /* Possible values if this is a custom string type */ SpaprCapPossible *possible; /* Make sure the virtual hardware can support this capability */ @@ -725,7 +726,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_HTM, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_htm_apply, }, [SPAPR_CAP_VSX] =3D { @@ -734,7 +735,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_VSX, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_vsx_apply, }, [SPAPR_CAP_DFP] =3D { @@ -743,7 +744,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_DFP, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_dfp_apply, }, [SPAPR_CAP_CFPC] =3D { @@ -752,7 +753,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_CFPC, .get =3D spapr_cap_get_string, .set =3D spapr_cap_set_string, - .type =3D "string", + .type =3D &str_type_info, .possible =3D &cap_cfpc_possible, .apply =3D cap_safe_cache_apply, }, @@ -762,7 +763,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_SBBC, .get =3D spapr_cap_get_string, .set =3D spapr_cap_set_string, - .type =3D "string", + .type =3D &str_type_info, .possible =3D &cap_sbbc_possible, .apply =3D cap_safe_bounds_check_apply, }, @@ -774,7 +775,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_IBS, .get =3D spapr_cap_get_string, .set =3D spapr_cap_set_string, - .type =3D "string", + .type =3D &str_type_info, .possible =3D &cap_ibs_possible, .apply =3D cap_safe_indirect_branch_apply, }, @@ -784,7 +785,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_HPT_MAXPAGESIZE, .get =3D spapr_cap_get_pagesize, .set =3D spapr_cap_set_pagesize, - .type =3D "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 Sat Sep 26 20:00:45 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=1788552149; cv=none; d=zohomail.com; s=zohoarc; b=UOQ0lDNqdDMguGUrCYPpp2oHkYmmsYkZNH92YniY0+ku9q095hvE2UKxfjzq61FAHhdjGq1o2PA8iNtZCkA/ltHzseJHs1S8zPPdvF1PCg0v83KbC+yEI8z+dViSzk7E823uXOrJv0X/J/0ERUhwuawMorQjazJvJNE+e+QVbJA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552149; 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=dIZOSUIBFOeKlAObuoZGWrKTjcRDczF+V5Zcp7j7AHs=; b=NfINOjDasgggEAbq1ApGwgY9XSwTKMSCxi61qhyJtGKI4P8eFE1en098pzDDBTzaO1z29d7rOmD6pamDyJDAsKoaJvoVUd99laE/gfJBQOTsbEJRz39MkcdL1TKWKL6ToQfOxmrzevbKHVTWRN/HhR44ASR+s50yuZEJErmoSwE= 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 1788552149078376.7670848294156; Fri, 4 Sep 2026 13:02:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a5A-0002dv-7L; Fri, 04 Sep 2026 16:00: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 1x2a56-0002VR-Om for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:12 -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 1x2a55-0008EV-17 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00: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-619-lvUyyXpONKOrmrJUsBLlYw-1; Fri, 04 Sep 2026 16:00:06 -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 CE98619091F0; Fri, 4 Sep 2026 20:00: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 0957D1955F01; Fri, 4 Sep 2026 20:00:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552010; 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=dIZOSUIBFOeKlAObuoZGWrKTjcRDczF+V5Zcp7j7AHs=; b=SMl1eeBaOSeTTkvAH5H/GKv5oY9H2ZXXDQvyvjI6fTIRvijs8Nn4hyjPBnS+T0u5NOLo4f j0EpsJXryRI/YMt+V72Hc2EcU/1CSHYYXIFEdgRw5YCD8TJRZBJeb+j4eAm3+3uos5z/yf le0fSnL4TjizaLf/Xwhghalv/R0f2w0= X-MC-Unique: lvUyyXpONKOrmrJUsBLlYw-1 X-Mimecast-MFC-AGG-ID: lvUyyXpONKOrmrJUsBLlYw_1788552002 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:14 +0400 Subject: [PATCH v4 31/75] system/memory: fix "priority" property typename MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260904-qom-qapi-v4-31-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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?= , Mark Cave-Ayland , Peter Xu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=969; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=V4M8AN33V0OUntyUyMGpKWtwix8tPy9hXpzCHbwVQtM=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLKA0UqghLMKMuzAXWQP0PdVRaQM+YKmNBya 7BEEiR6kAmJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiygAKCRDa6OEJdZac 5U8uEACp9RuuFIUQEQ0/nSUENyLdG+y4I7raxyR6C+C5A7TsCDQA0iNN08YxZCta6vc4eFkgTLU fe1IkJQoJw7ZBx1yXKFg3yNEZmoo7Muq+sJgDTO0Nera9tPhnjaocdmfHmbMvv70M0z66Wx5SUY uiYdlXZS/Nk8s4LClwJKRB8GdBTim77SywFhJ8Puc77yOvcQ5L7ZUymOqQ5D1HJlyl3NmI1oOc5 xthklKBoYew/sn9KBv0cJiYAfACe4zFaDPc+EXU9AcTU9+IqwD0YQKyEKRBRdkwq1xJD9ZoH+/P SRGIy99zQGtbkOCfnjcsiqe0RA/lsWAqFnbKHSdaG/CQX7oGvvezEiySpUwBrzdU70wEoixNvlx JfzRSu8f3tpv0z+HoygMJlrsdxp1QCgRWN8Zi9CbuMjlV+EAcOuwsMzO5s/m57aA2ldJIi9DTZS 2eop+CiLTBKYQwQKKMZ5CaCJCJ7PB3jHwpC85iqg4iGJnzGqTZMrL33EV5EUlAgkMZbkHqq2ksq FehPlhRCCnQ804kMyPMUbaILxwSWK8+gzP1zXUrV/U6DrA8KuWMi1dr40OkEDCQiMuJBw1QYWLo 7BMj2OyVjxu7BpVdFztboU068Jt4k2bK7TzFvgmQD4eMNMFHx6nf+WaTnFSu+AIoRWvjzeZNZSQ 4sCDkBvbVfCDx4A== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552151417154100 The value and the getter are int32. Fixes: d33382da9ab ("memory: MemoryRegion: Add may-overlap and priority pro= ps") Reviewed-by: Mark Cave-Ayland Signed-off-by: Marc-Andr=C3=A9 Lureau --- system/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/memory.c b/system/memory.c index 9760721e4550..d4a0a5b81805 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 Sat Sep 26 20:00:45 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=1788552039; cv=none; d=zohomail.com; s=zohoarc; b=d2C4K2g9PCzds5ObRi4pfmHjNn6UB82LvsrgTDsPVF9420QBE+wXjz5kYMzo4FsjwuSS61YWDFxspuGHjUyBWI9UBeu8vGH5sCz2QcaLL+7wYBXOAYymLCBNWMheQ83fZlZ7+IWlX4g65AruQcDYrqNJG9FE2RKC4i6bSmEb1Ig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552039; 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=jljT0NNDMf+bBzLc8+ZCGqCh/IWJMadXoK6c2GGKq5Q=; b=S8QdBh/E6e7qcQnV4fKWGJ2l8pTI7A5J5XTP4qU3473X3e6FJDtliNIff7/AaEm5/Ex8ot0EI3jAhip02OGreco68NESRttgnmaLkCSjEn5Rq7A+Ii1g9duqUmdUz2Pl+OJwp/gX2aw5cvo4dNiQoNhBoIltbqMyRDpDVi/7e6I= 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 1788552038719967.0173925079883; Fri, 4 Sep 2026 13:00:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a5B-0002km-M5; Fri, 04 Sep 2026 16:00:17 -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 1x2a57-0002aH-Ku for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00: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 1x2a55-0008El-Sg for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00: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-45-sBmpUEB3Oj6-TqpiuMhmjw-1; Fri, 04 Sep 2026 16:00:07 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 57B5019540D2; Fri, 4 Sep 2026 20:00:06 +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 878421955F01; Fri, 4 Sep 2026 20:00:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552011; 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=jljT0NNDMf+bBzLc8+ZCGqCh/IWJMadXoK6c2GGKq5Q=; b=Q1y3Q+UdG1pOY+tuwGx5OTAX5mS1tU39DZXrrhkCf0enBZUIkTg04zgtNJZHfUgDZZuqBY deCBochSMTSuW8vPaaQVDMWaSx1Jyu1DXtwNq8sNv4pA5z4MFZ9zQym99SumOh8tmcuSFg Q6Uem8B0a2BD69Th4aB5lR1eTjJgWJg= X-MC-Unique: sBmpUEB3Oj6-TqpiuMhmjw-1 X-Mimecast-MFC-AGG-ID: sBmpUEB3Oj6-TqpiuMhmjw_1788552006 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:15 +0400 Subject: [PATCH v4 32/75] backends/hostmem: fix property typenames MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260904-qom-qapi-v4-32-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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?= , Mark Cave-Ayland , David Hildenbrand , Igor Mammedov X-Developer-Signature: v=1; a=openpgp-sha256; l=1468; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=FoUII7vTDJocTkLIY2sS2QSsmGOwJJb8/wNlwYKz2FI=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLKeAyaAzvycT4tWausA0s5ZN32mdkyg0VE+ kGfG/fUxr6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiygAKCRDa6OEJdZac 5V1aD/9LZcDWQu6Z/rGFdfmc3kWVsaoBa9qWXwHXgjWpYnthupw6RcDUIBNoINU7d62aoUdi/s3 zOvnrpbouuJnh6OLKiXW163BIEjj/NsbG0dXOWf2uEp916e5uAQ6NqdV/MWTNGpJu+ECzvHWXgT hJg8mZI2cqr7uOr4VE0MOZXATO4trziZAgMMl/UIN5VBwldq8ZJ5niHSkag3Nv4r4TK3xFmmdJI n0SwrZiTIVvCx0i9kpKf2w/GLXfHDLA/33IddXCm3FdoVoLLyauJti0eii1V6hN9WJgSroshEm5 YQAKJqusU+rLg5qtJFYM0mbmNyqRB2PFbllb2//uWQovWaN283cQA0NQMlJVHBhtSeSNR4cG5/y ohRmzLy9ZmsM63iMmZFS0QcVPrGdldOZ2j5gCzODLCtYT5AMeSuBtQNughD0w4MPBWBo5ZpEhxZ /zFdT02+ZjUyWS7HqSCLj8pNX9hBcUpYHIjwuVsDU7riMFFSW5oSBpIc7hJk7LTih49qs10gQwL SGOmVE9u2xQcIe2BaCd6o15Fx+MzyYnIbT06X/N6NHxfgQrwn2gakWfl5BldZBRrqJHVEO9xTk8 vwPnc2vO8Z1qrvW9Px+PbpDkf9AjvruysdUNvanziB6V4Xth/cMN/7rDgds8LpA34szCUu3xO3F Gs6D+Wdn6sry3cw== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552041540158500 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") Reviewed-by: Mark Cave-Ayland Signed-off-by: Marc-Andr=C3=A9 Lureau --- 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 Sat Sep 26 20:00:45 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=1788552260; cv=none; d=zohomail.com; s=zohoarc; b=dbfyPlG28odOzRWrMFRHgM3yL0YHeDpGerjezYkhjTjjWmj3XxKnSQyXr+zwCmnBCSljMVtHS/08h4ej/gJ7kgImQdnw+nYnWtWs09gvWYkjjgd7B+Qn9MQe76LTsYQLjGFfgrVOpZpAwm1/dUFTZS7jBahPt8ZqzFWBhvL1i2c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552260; 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=Ogne/0neUK9BGYyUWymCXs7DWfYh5TdP1DDM15iGuPg=; b=afxzr6hXeNJ51IgeGOa66nFwRll9uA4NrzDZzg88/nfEo2OAzsC1FHnDU4/pBJvunf59dIcHQmgitKvkW57LCKWNyJX7CK+hsg/XcYPf8ivh9ivWWGNPCme32EE8XAnQIAiP1TKE2R3764py1ZlgE1kk93Seq5s7fvuPtXTKu1s= 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 1788552259996124.51592864154122; Fri, 4 Sep 2026 13:04:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a5R-0003FS-Ed; Fri, 04 Sep 2026 16:00: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 1x2a5B-0002nw-Pg for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:18 -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 1x2a5A-0008G2-2d for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:17 -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-441-8eebFb9PPQi4wvdJq-FylA-1; Fri, 04 Sep 2026 16:00:11 -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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8903118E9B37; Fri, 4 Sep 2026 20:00:09 +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 BB933423; Fri, 4 Sep 2026 20:00:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552015; 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=Ogne/0neUK9BGYyUWymCXs7DWfYh5TdP1DDM15iGuPg=; b=Gt/s1sF+qtFqf7TAEf0sD4+KZWgSGzdVuYjLAF7eZkA0W8cWnzG9AUujGQMCjBK74t1g5d 35JYcbS0yG5G0uWilPHaFoQdRvlWx3Bm1pQpX9Xj9Kw2ozwmBvzuuUH9rFi+Odl5h3/Pnd yHtP0OC+GKfr7ZLTaSkXVSXXzLQhQBc= X-MC-Unique: 8eebFb9PPQi4wvdJq-FylA-1 X-Mimecast-MFC-AGG-ID: 8eebFb9PPQi4wvdJq-FylA_1788552009 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:16 +0400 Subject: [PATCH v4 33/75] 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: <20260904-qom-qapi-v4-33-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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?= , Mark Cave-Ayland , David Hildenbrand , Igor Mammedov X-Developer-Signature: v=1; a=openpgp-sha256; l=1682; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=KfzAE91Swi71PaZDmkuwKzLsZE6ZgjX9d19Y8iilkmk=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLKWJdIV0akNU9HwQpeACgNNDximEqUsyMnT MrYs4HYqSaJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiygAKCRDa6OEJdZac 5V8kD/0WzWG/RBo/q35B3gWpbXryOMBaeV4ZETHWgGNUqbcWOVMnn2odYfMeNfyUdHRqgsGX838 JW23OCpanmdefIppUYV1kuzSXUXc6c7984O32+ZJ1Jh+oNtg5oS1qtXJywaPCbYNd5SP2Rkgm6h Wk2Vx24dwipjenDiUsmefB6PZJ10BXj5WVDasdVJwr+86CfxsWHtLPist5ocPLbWktqZXS/WrIt M36Z3ittEQKAI8g5G2HzWe8AVquvxUg+Xg5aDdaIWCD0+XrhYOzHFitjvvbr9H/lCmz36Uc4rZg 6BuAjiwBQiBtn+6RJDFJgXMsK4LaLSBvIKlMWAZOAmqZzBAMZKHaFJVSfagj+QrGDx+gNKBHopU 0hgWoP0npVrnO57nQ1i6kCrC2095SnzOqRK5B/76LveqZaEcVGqgu9c5/qOtjKZ55LebMUUibOg nPjXgZXtEGKa2XN/FwLPtbB4qLPhvx/4BVgwMGdQuDmqbgx77xx3yCWpyltCyCDunaTJYu3by+l btfsXYb5and0yWtCoumxsgVvhVNB9cZwx3PpBfXz8nNbiuMgRV8S0bOzvlfXNdHFBfmeOnZEvsr aab//5WcVS6fpRsmGcJrrncverJE3GidrdAtcUYKA2EC2+vesW0/pQEJXR8o3r2SYqQnlHNrvkO X/kHf3DZsJJRF8g== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552262944154100 The getter and setter use visit_type_size, not visit_type_int. Since the underlying type is uint64, change it to that. Fixes: 983768431676 ("hostmem-file: add "align" option") Reviewed-by: Mark Cave-Ayland Signed-off-by: Marc-Andr=C3=A9 Lureau --- backends/hostmem-file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 52b62f715334..9c7e0183d480 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -134,7 +134,7 @@ static void file_memory_backend_get_align(Object *o, Vi= sitor *v, HostMemoryBackendFile *fb =3D MEMORY_BACKEND_FILE(o); uint64_t val =3D fb->align; =20 - visit_type_size(v, name, &val, errp); + visit_type_uint64(v, name, &val, errp); } =20 static void file_memory_backend_set_align(Object *o, Visitor *v, @@ -151,7 +151,7 @@ static void file_memory_backend_set_align(Object *o, Vi= sitor *v, return; } =20 - if (!visit_type_size(v, name, &val, errp)) { + if (!visit_type_uint64(v, name, &val, errp)) { return; } fb->align =3D val; @@ -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", "uint64", file_memory_backend_get_align, file_memory_backend_set_align, NULL, NULL); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Sat Sep 26 20:00:45 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=1788552120; cv=none; d=zohomail.com; s=zohoarc; b=S3VpFdg19kg1wOM6zvaJra11H/KlWdkmXnFJOjBZQk1hm1zpZoH5uG733OeZKfBh/MMscwWh7dJmXbrKd50+44ykrMSTcmodvYlAcuHZ+t2Zh5/dFVebGeekkJCBZfxYUF0vVcfy4onrmQXSMoEimBSfx7s2mGdcTEQ9mPY9hbk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552120; 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=qAFNoyvj+YXGqN0JpON0sM385oGtzFD4MoEk+w0Iq28=; b=AvKzq7us3FhSU25WdAo2mohVOeiDhXRD9Px/M1tehiEHaMatgcYOVhLoSzIQ5MuQ6gGu9TqPTLlYAkydMLQPHaUP6Ygyk6RbCrTSkYfp17pPkCmm0lA1stEgfHYDWi0IxsvwdWx8lmCnN8LRHt3JDTT/GLWnLp7TU+WowolIKLw= 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 1788552120363383.12382146843527; Fri, 4 Sep 2026 13:02:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a5X-0003zf-TD; Fri, 04 Sep 2026 16:00: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 1x2a5H-00039z-Mi for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:29 -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 1x2a5F-0008Gh-So for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:23 -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-557-H7Z-CmNuNMSrD92pUATM4Q-1; Fri, 04 Sep 2026 16:00: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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 575E018E9B3D; Fri, 4 Sep 2026 20:00: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 7F178423; Fri, 4 Sep 2026 20:00:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552021; 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=qAFNoyvj+YXGqN0JpON0sM385oGtzFD4MoEk+w0Iq28=; b=MbAg/xrPrUKutSRARMgVbPxVGd2Y9bwTKaFxp9/CHG5mtpzgiVOXmpyMIkxOevQZheK47g 2+dylL3S79xEhYNb1/kCZCiOqG9WLJ7mvHHnwKYIn/NW9tEpTXX2MnNX4FBV+kYw9K7+zA VrnRSMrjPU6N2VjeOGaLkzEYKy8t32I= X-MC-Unique: H7Z-CmNuNMSrD92pUATM4Q-1 X-Mimecast-MFC-AGG-ID: H7Z-CmNuNMSrD92pUATM4Q_1788552013 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:17 +0400 Subject: [PATCH v4 34/75] 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: <20260904-qom-qapi-v4-34-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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?= , Mark Cave-Ayland , Richard Henderson X-Developer-Signature: v=1; a=openpgp-sha256; l=976; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=MfnRvRly2UY5P5uzJJrkX8tLTLJ7e9JP810t3Z45rWc=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLKqoOy7BqTwzbLYDEwqKC5s6zutHMZKAQeJ 372p0eXkpGJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiygAKCRDa6OEJdZac 5Ws8D/906VcPWjevEynfPGOxPfLreonNITA9QeGQbDjlZ1Om7xDA8RHGsN+ij97tGqHpyxkEOic i3I6XKRlDT4qX0ECpRIJ2IOxEV5ecIrjzYAkNAQxbhNpB1+bDS+sg6NIxRVAAFlT+Xr+f1mprut kKAWBcXr682H+G2Lhertv4RXRJy3KG95ii+5nzyP6s7zK6/xXbg6n9zBnIQEOxUOYXJR8Ns0zv3 te9DHF5LBkvLmdGFTNfbtN88UluJL9UebsH1K6dKl9PZa7YHrZCV1Y02qqeC709BrEputKqI7Bz 5tIa5P1vw0QFLLqjHygI8M3Hk++oZFTqNEH1tjoxmKtihgX7gFShhijCQLlrM7sSAq92m5laIAW IfgJLZVxGJ4kVP7mF83LKgCfNhZyfehHy5aFvoRJSStMKE1CgcFtWMAcHzOfbLxWaRL4trZ4+L7 Lg/muVlmy7AsmS/Aov8OLjiOD07RrgJjvA9l0mZuPejC/cBerdzy1ceVrm3iRsgJJMhWB9//xX5 isHaeUIqdAojVPXlRXPNM0PkP1qTPF61BXJreKIkdb21yymbW73KChIu1ccydFhxs4Omm+d3NSS cN/hVAb4sKqeMVpCxZeZpH6/YCOBXmmreMP2Ahmma4tJ+sR9UFvUd0sGFymhvS6adbZAnUghWdA 4EvrEvLutQs9tcw== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552122116158500 The getter and setter use visit_type_uint32, not visit_type_int. Fixes: fe174132478b ("tcg: add "-accel tcg,tb-size" and deprecate "-tb-size= "") Reviewed-by: Mark Cave-Ayland Signed-off-by: Marc-Andr=C3=A9 Lureau --- 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 Sat Sep 26 20:00:45 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=1788552219; cv=none; d=zohomail.com; s=zohoarc; b=SnTqG8SZ/GFdqLaV4RIwni6n714Ig3cEIHflQ0gQ6NRCLgryE9Gze7hfW8csbDyuQQALMt/PNFaMPLrLZTAe9iLnJ8wgHvfNx6hiw+aHLUBLCb2FgHxGC2/m3dGDuurfAZRIrjiA5VGEEnpLDjaY1RDX3U5SUP2N608B20MR7Dc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552219; 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=LxoEY/uHRXi4qMzgkcEFrcFfNXHjpLx0KFyuPTVlyBE=; b=N2maQgeGy82PFR3pHYRzCGmUPv3JvzACko7wfnqyB+zCnzFWEuvN2rQooUCKCxO1Vbp1I3A79AXyZ9nXf56lci8LmDW2jkJQ78SaAFN5nN1IKBEUd9j7AWRpeELPEDMFogQlJU94/jp6NcyWnrDCWdwAohnNsGzOahxa73fLR8Q= 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 1788552219380871.4565561580908; Fri, 4 Sep 2026 13:03:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a5W-0003nP-ED; Fri, 04 Sep 2026 16:00:38 -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 1x2a5J-0003AT-ML for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00: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 1x2a5I-0008H8-8Z for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00: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-592--MbMRRKTPharnmlF8vLWzg-1; Fri, 04 Sep 2026 16:00:18 -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 2B4D918E9B2C; Fri, 4 Sep 2026 20:00:17 +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 BB9ED30002F4; Fri, 4 Sep 2026 20:00:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552022; 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=LxoEY/uHRXi4qMzgkcEFrcFfNXHjpLx0KFyuPTVlyBE=; b=cR7Yh95j4M3paWPSHFU5uhkH3dRrowu4dPZDIB6zlXutfICrGwXsg8IHlwmOuwqpjqygSG MovXxw2xip9j+eD6oA9vBdcm5bbXcAOsPwGpnpd+X+hDLEfKNokn+4jGs9q910kZlew7w3 dI0EFxh7ylzZw1C7QdiVjfw0eBJkc3Y= X-MC-Unique: -MbMRRKTPharnmlF8vLWzg-1 X-Mimecast-MFC-AGG-ID: -MbMRRKTPharnmlF8vLWzg_1788552017 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:18 +0400 Subject: [PATCH v4 35/75] 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: <20260904-qom-qapi-v4-35-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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?= , Mark Cave-Ayland , Alberto Garcia , Kevin Wolf , Hanna Reitz , qemu-block@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=1072; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=yr36TEgtI5Y04PbneexOLq85ZeIO8zZMxEncXro3aZg=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLKUzf8oGlv5kVVnrA5VQ5TSbVydjZXqId8G RM49msRNHeJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiygAKCRDa6OEJdZac 5Z1CD/4ld6pKbspfB7P0DJRQvtCuyymJ0VBfEedqin/gSoQcNC9kaxsScxgwrBLHXPABxS77Dsc qkf5H13k40tmFL0X3UNO/R+UGYpvC1c7SVFjnG41aBTFdm0rDFauFghv+2nP78eHGoeICk81k/e R9iJ9fzfpgJ9oVWSBvEBrcLjPD7luPCB3SaK8ht+6sFNwZ/zDYKZpyEdNekdjyp9SM87AUxwvH5 G127jaiYrt1+46gAVRHIWBp8XnhD+o/r6DC658fSIQR3vwsjy9oQOFz+liBOc89oSa1bn6Un5ZG kxPhDbK4kwx86lFWcEGLEuIjDMfEaiKTCh80ENNO+t6cUB419LRG3FhzXNU5LT7ifrel5a+uoL+ v4hnjg4B6RzaQgtjUOiWyddktVOpPW4XVTEAeWU64Fl/2tUVuAHcLVaq/ZoDeGAPsnDY3xqROmU eSe1FSASI7wLQyq5Ez8Wsi2dD4pib+aXlAdhtXYSSkYl7n2W2snkRLtb9i8cYtbxU3uB+VGARyX DqdYDh16eLkCWvRxc4HW+rQ0Q1H9lX2TTU0Y+dTIagEazsVNScKoViPkYuHisOG/I5R5LoJu9/s Jh80WMXhV9jwzyAsUnqQ1E5e3P2pPwvFmAWUYs+BkhBLhMnzS8OJ29Kj/K/2RMeG8YWu1A4WXY8 7yJ1luJ/K/zAYEQ== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552221791154100 The getter and setter use visit_type_int64, not visit_type_int. Fixes: 432d889e55e2 ("block: convert ThrottleGroup to object with QOM") Reviewed-by: Mark Cave-Ayland Signed-off-by: Marc-Andr=C3=A9 Lureau --- 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 Sat Sep 26 20:00:45 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=1788552080; cv=none; d=zohomail.com; s=zohoarc; b=KBGSh0NlD4tUd7OJv0AzwYSvLr3Vru3Tb1rRWr6vd+3cL7MonTV7RTe21edZyGrRwEkI79KXE7uxdqGOP4Q7NDcrI3EPzyxPCdLHkKp65ou5X1D24q7B/EtaxUL7Ud3SgBBfxaAB9A33Rmkmid7svl3x9nass5ZFXgoUIqd7qcg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552080; 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=PGC7AWWiRfT0nijYNQie4gpAMfiUv3PG/W7v3ZGTcOg=; b=kTRk+9HLAFvMcYOZJIgVkYN0ig0xFmEpRi6UPmi5DLQxZIz62/cBQRiy6WMe836Nzjv5vTXgC5LIi+mraop1ea3eVfX4BsCTGwJo4cSnQHsAX17B8+K0DwBvqnlJkJDa+s7qdyBkQGL98qfKraW8zWoMs2PbUCkC0ehQ+7K5sbE= 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 1788552080592814.5492218624534; Fri, 4 Sep 2026 13:01:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a5T-0003Sh-SN; Fri, 04 Sep 2026 16:00:35 -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 1x2a5K-0003AU-2j for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:29 -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 1x2a5I-0008HM-9r for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00: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-201-AJyv8iijOZeIP_tmhaZakA-1; Fri, 04 Sep 2026 16:00:21 -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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7355118E9B28; Fri, 4 Sep 2026 20:00:20 +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 A2F24423; Fri, 4 Sep 2026 20:00:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552023; 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=PGC7AWWiRfT0nijYNQie4gpAMfiUv3PG/W7v3ZGTcOg=; b=YH9QweMHAHcymbk3KAnk3TuhJMsQj59Hj5Jh5gs3L+55JeYKlH+lmPfOjYfYw0FA0N3gn9 X9Y+4ZpRtGuadh4o3Jm9DAevPueJTSV4/Y1QLLMEzyU6DyvLz0v147zEAG9IDFQkz7IUAo P4SwgSxHCGR0BrSHnki03uK1oGUH2s4= X-MC-Unique: AJyv8iijOZeIP_tmhaZakA-1 X-Mimecast-MFC-AGG-ID: AJyv8iijOZeIP_tmhaZakA_1788552020 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:19 +0400 Subject: [PATCH v4 36/75] event-loop-base: fix property typenames MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260904-qom-qapi-v4-36-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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?= , Mark Cave-Ayland X-Developer-Signature: v=1; a=openpgp-sha256; l=1646; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=CIXUVByGgj1bOy4pqQ3L2h+yhTR6wjLSQ4vTbUh0CWM=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLK/dccNGoOhFaFJT7ECoia4UOMIuuzuCLrz M3/DI8H8LSJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiygAKCRDa6OEJdZac 5T5dD/4ycKchkl2QEN/a68qTxrsNopXeYiPYLvzxxvdqqgGJSgtx0QFafZyf4mvTI5WbFjeyZ7V 83cOncvMmMQyf//YAJ6o5NiZVRAGQLJUAUNs+4WUDeHNlJrBPM1qRXxZggC1NLxsvdhtIjoO3hK MtklcnEyvcurUxf+U9PBkMokatA9XV7AcVHFsRkjiIOX/otCBUxBqNmyB9a35QBF8p7W3JnCiOd aVbrzln1RsI+8iwETcUUTCE7fzVT3A0Y3LOu/JMKYHgXJi+V+cJrjutc8vK3W6Yfk0zfkzfS3AI WK4GT4fv6ACSoj+7T+5oLdG2OrTvd1nLIVB+E62Cc89YE+1HbGu2bVOPoniV7E1n6dU+gkj86oP WfCW9H58/RdGN63JiYXqdPDI0NkCIqnWrs3kuCJahOZJl5gRPTN5QdDfMn1o0qWIxVi+CRmXpO6 Gn418ADYVn2i2k9eQdEjvguEXB3wMatS4TPi2uKnBHz/xGIlE9T+xXDuJ8ntuCny/ndYV158+6A oyQrsPAzLRpZMx2jE65Lb3AZ6iNyoQpk4Ofps/7dPtlaiwIq113L8HmudIprrRyxNj3LLcMZr49 4UKLVs5KZbqgZyU2JM2XGeHJRf+Z98YeoWm4JnlatKvmZVBrMU6jOOCv3CAdI4u8NB28ckBLWgq J+TU4lSBZ3gMdsg== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552081805158500 The getter and setter use visit_type_int64, not visit_type_int. Fixes: 7d5983e3c8c4 ("Introduce event-loop-base abstract class") Reviewed-by: Mark Cave-Ayland Signed-off-by: Marc-Andr=C3=A9 Lureau --- 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 Sat Sep 26 20:00:45 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=1788552080; cv=none; d=zohomail.com; s=zohoarc; b=IAJI76XBARelxBrNgo/SERGIpMkz3ASOrUDlv4j5w4O/esE4AyGiL/+jH3Xh8oZhY3mAHirGgZju6v/XNE3W1PBlDfkQxxF9iK6j68pCluLFEr7/hazgjpSts0kCp6XK5B3nlVM+niKM9MC5VUc1B5yYuWm2uYmSF5Y769l08fk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552080; 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=WiZ7TZb3vfkr1iFesD5k1O2a5EjcMYTKUDmeoVZkZhE=; b=LA0Hu68EFgqlJgmqiWBEX9QD6ynMhfG6C4NAS6uNvspl6KD5wl9TgUTtfZyijJi/CRUBqkrgCLVqe0UjOODPzowN546DKqScpbXwpiwfa3l/MDmDeUQG/mC1mS2WwWBgD60K7LJLj1Ehv61pJWmj5wpnaAZUtWe/b72EuebeAfY= 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 1788552080254382.11372178528404; Fri, 4 Sep 2026 13:01:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a5V-0003cj-6H; Fri, 04 Sep 2026 16:00: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 1x2a5M-0003AX-FU for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00: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 1x2a5K-0008Ht-Lp for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:28 -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-546-OI9d2skKN5yLv1mWjik_VQ-1; Fri, 04 Sep 2026 16:00:24 -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 ADA42188699A; Fri, 4 Sep 2026 20:00:23 +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 AFAE81955E72; Fri, 4 Sep 2026 20:00:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552026; 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=WiZ7TZb3vfkr1iFesD5k1O2a5EjcMYTKUDmeoVZkZhE=; b=fdrl1kGHoqd3oMjynqeVP6ngyBR8Fy8hD/6Y0qWX1ciFQEGwmMyvykMh7V/hEttd/am6kW HdA1lHdHEGS/sbMH8he+wMPuygOVfyRNhYp8uGc+vNjzMa8rn4HFvpCDz8mi1o1C479QKO +XtNqTEvKznCfFjhPIyOp95hUdMsVqI= X-MC-Unique: OI9d2skKN5yLv1mWjik_VQ-1 X-Mimecast-MFC-AGG-ID: OI9d2skKN5yLv1mWjik_VQ_1788552023 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:20 +0400 Subject: [PATCH v4 37/75] iothread: fix poll properties typename MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260904-qom-qapi-v4-37-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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?= , Mark Cave-Ayland X-Developer-Signature: v=1; a=openpgp-sha256; l=1853; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=y5FNojlkLsAF0V5m9dch4w29DrjqN7eZD7tFamq7MSM=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLKAf6RVglrzzT7k0IgoXpAqSg5C3T8R1lAK SxFAbNaPwuJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiygAKCRDa6OEJdZac 5QGbD/wJ+Df1RVBcCUsdDXo51E0XEisOiK+sT0OceqOHWdfSGidX5wZ6aQ6IUrfDJzkovae6P5I IWZbD0fsRS7ai3ypCwJ0O3W3+ir9ERyjO6LVqAmwhFTCSuQ24tdL4xK3yGsV3jG566HK3oti3oM GP9oRN2zseRgpxi4sXRSdOUFC4VwmE5pt6EHYh0FVk1sDHv4WplZM1NmDPrYhTx7vpG9Jt/poJw 02VUx59g89DsrGGMj1OBwrAcmgtJ+c/tFBhAgQ3PpbD5Bghd7KBKGSdZIrGpgb/awx2wz+o32Fl 6ZPSo2RK2Jy3Ol85DcXIRFTDLIPUE5ydVUqAVp3REKpwSfgXgiHCUNHzQAaPRHUWeGxQm2MgXe3 h2PJJa5jxkJBFHQa3iM3sZpGnbsHYGllZ1BhqEyj6by3Tmb09Z5QZtA1BIXKe8lTh3wuTAdy4HY aZ3dt6Ds3M040+2Sz9n5pCeFsXT1KnPW2YtIgY5ulublKBTrb9E1h+rzxy4sIbqQcyrZzzN+g7a Ew2vhnWfqDeDN0UgqQsXnOVkjmg86prmoZ3pYRrenfoer7NDMaHjTMMySj8oZ2Ob0zo9840PRTl 62i1/sVbND2/cXU7tMhSteqILzoXdxSbNo87+fRIOhE713oNwlVM+XiH/t2qlwhDsYwduTbIbrh fcAh/UPxRs2uHuw== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552081898158500 The getter and setter use visit_type_int64, not visit_type_int. Fixes: 0d9d86fb4df4 ("iothread: add polling parameters") Reviewed-by: Mark Cave-Ayland Signed-off-by: Marc-Andr=C3=A9 Lureau --- 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 Sat Sep 26 20:00:45 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=1788552048; cv=none; d=zohomail.com; s=zohoarc; b=an/B9a9+4YauS6S6NHDweMLQbU1b+5nMpzK2IciSYvCdZG7JOiUgGNyPWnsrBkHkjnaOkS1pfZbK03NpI2jMR7rl8TUIsuf0/cj5LDZfkCOfol2KfGx5GuaxKncLXaPn9WfgAJqxSsZAshb0+rCBfCRpUg0gpPAEnI+YKnQSgTQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552048; 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=I45vBLy8mR9FO7QFOJ9NNNU2qKzB6oMkrFNeXIX3qdg=; b=ZTyHcD6ebr4tYIpASZZReI923JMLmBR34/9zaw8OYM0uJsao7rbPFh28rdg4tBwHbElYb1QgMfd5SwSNqlj0lBXItGwdANfsJ68jVWxTSKue25rCAPlkrqkthn1MvONYTkYjKblrdxyRBsA9y8kya8HqeMC8XfGHiw3K7DRxV4Q= 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 1788552048507771.1110948147762; Fri, 4 Sep 2026 13:00:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a5V-0003hz-OW; Fri, 04 Sep 2026 16:00: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 1x2a5S-0003O7-34 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00: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 1x2a5Q-0008IW-F2 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:33 -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-607-jHdQ1ck3M72sx02V018i8w-1; Fri, 04 Sep 2026 16:00:28 -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 4813818D727A; Fri, 4 Sep 2026 20:00:27 +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 5F7611955F0D; Fri, 4 Sep 2026 20:00:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552031; 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=I45vBLy8mR9FO7QFOJ9NNNU2qKzB6oMkrFNeXIX3qdg=; b=VkI2WCZ34P+S21uFZBcYgzMOSwiXH5+61mGvr5H0pIzPB3eKn719ZeoAJ9wyK7rLLuhEZo CkfAQjymDEggdo0+IgfbnjodGBoPWgGp9Eusy65vZ+jWQQV+ZNPSCvc233KH2laytWlmdb zdwcwwyWUQx50XlrJRaxdd0YAAGtnN0= X-MC-Unique: jHdQ1ck3M72sx02V018i8w-1 X-Mimecast-MFC-AGG-ID: jHdQ1ck3M72sx02V018i8w_1788552027 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:21 +0400 Subject: [PATCH v4 38/75] util/thread-context: fix property typenames MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260904-qom-qapi-v4-38-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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?= , Mark Cave-Ayland X-Developer-Signature: v=1; a=openpgp-sha256; l=1539; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=06uELAnv7q0WduS1iwJjsed0nBZGdIUdjr/uI9WI748=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLKixMPjsuy6lbj+NvLjbk+ARkgK45C1mONf C3nDAOD1lOJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiygAKCRDa6OEJdZac 5f3PD/wMNHXjcPj2TqY9zdTliK0DR246VdnZyn2ZaP7vyWyje9td+jUWeKSsTFqTDxqCyB1bPZG VT/RmfpPCciSR0ZLm7T8qhShJnDiA/iIFY50jwUGL8gXLig0dKhuMDLGSIZw6cJ4nr44iXI3+XE 7lwkwvmMdVBKNxk4z7k0xwe75SRxVdLLK9vDyI7lwzPkrhy67zPHrY/DF3lvuCbdib8B2r+oe/r 1Gt5BkZv1PPxW4rR0mbT8lwR9qAXaEdm36BX4VtzblFXoVXN8g8YwWXGeNBt0c2XUzaGXm27roM lRtzCsxTBdYHaqmRvSUTRrRLL0GuB9cwROpiqE5NqGGfEvoVE/kdm0ZSQkKvOnxn99sMPRDriW6 /+96BMIG93szhT93VtJKwOnkvqw/MNV2WX6zj1dP4zipMnkWuDA923yeBRwXb6pMWe2Zh2ntMAr lqNDgE9l3wZOaL3cvmauVs/GjSJzRX/0vVMMBaFlWQtfZ6CMtbJuXsaHmqK/wIG+xUk4pRG887G geo54yCrT2o7BI5XZCc6bnwtXyjUl3UyW7WYXZo6SK4xbB+uKDzYbbjbjalXCCg5zBD3Xj4c5vb AUVG21gz4QY91qhvmU0ABL1Y45Iw7kdUuZn8lfzBt3OlLAA5hHimoqSECY2c1iu6lcMWa2/LHB7 bzYpkgmTFyyI+Pw== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552049663158500 "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") Reviewed-by: Mark Cave-Ayland Signed-off-by: Marc-Andr=C3=A9 Lureau --- 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 Sat Sep 26 20:00:45 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=1788552074; cv=none; d=zohomail.com; s=zohoarc; b=LJgnB12EmCaWm5dTRzLnbO+zgin5CeWi6NEQU00pho4rlCnsFidN6CCiJYjel+6jT5Bet8zrGxNkoIJPfCzckJZnEFqwYSLN7tkAOThOmNJrPFIgn83+UYGuK04rH9Of7dYVkIzR7iOQpr1DwtZnVb4VoKpkRXs797qhEgMLNYE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552074; 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=FJp1n1X4kEb9FVyTrLhFfNk3BbvcDbYF/4WsCIfyaaw=; b=EwcYq/FZMfWOvx50aZDmMtNnh6yzUWezbCIoMHh/uHIVNNZmKB/EoD0UmNmtWesKsP4F7uVr2rwCvlKZFwZnzGNDpZ0SY4zVxIzWaEbScKimkSkf3TwFaRiy0dOEwsrQOmO8oNukRODelDyAMrwCJArgSkTP9fq1AgkC7wusOUM= 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 1788552074753314.39346184219585; Fri, 4 Sep 2026 13:01:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a5Y-00046s-Sd; Fri, 04 Sep 2026 16:00: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 1x2a5V-0003fj-86 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00: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 1x2a5T-0008Io-FM for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:36 -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-711-peOq2TIdObWWl3AVlu8z9Q-1; Fri, 04 Sep 2026 16:00:31 -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 6BF261893EC1; Fri, 4 Sep 2026 20:00:30 +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 9856E1800577; Fri, 4 Sep 2026 20:00:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552034; 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=FJp1n1X4kEb9FVyTrLhFfNk3BbvcDbYF/4WsCIfyaaw=; b=Jf/KoPM3s2XR/68/257MQOfk+Op3wowkd+9zgkr18lwtn/AmzWHwNDW7PSZEMjeDOscZYk TCu1uGffhcmxdeIryRcY0wYXMj6TTG657OTkNsaZ/BSck1bPIvaVgrOdX/AfHFzRAqxiFP zLgO3VIlsx0cSh+24dhhQXIBAnQOhJE= X-MC-Unique: peOq2TIdObWWl3AVlu8z9Q-1 X-Mimecast-MFC-AGG-ID: peOq2TIdObWWl3AVlu8z9Q_1788552030 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:22 +0400 Subject: [PATCH v4 39/75] 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: <20260904-qom-qapi-v4-39-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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?= , Mark Cave-Ayland , Zhao Liu X-Developer-Signature: v=1; a=openpgp-sha256; l=1469; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=nGSAzw2abdBuzYrCnna+i4/DxV7ssuqypEQwO1YQiCc=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLKZ/eQ/Ati9HSVR/aZPmQfXwgy0CiehYh09 70PocVuZY6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiygAKCRDa6OEJdZac 5eX4EACYmyesSmt8a0+jPV1Go+Ic4LNmPM9+h/PqEDO+LrvhLtU2AL5n9Ox+WaBMD/dRZcCHwJf HEUo1Q/9LGCPzFV7hzMDAyAQPdEy/Z/WZ2QVYR5iBtdeehAHxHihokMBTK2bPdrTEP93iq/7jiT tiPevQi45q5C7uJ2ryRYXuJeKT5Hs+hE6ebe8M3Wg9A/5lObN4G6WOe7NQ3Pq/NAkZi9KkiCwCp Uh/IMjOk9668VxIBOPl7v3DrQY0J2x7hziZYjbkyYBXOuScoMVVLR7YHb3ZqS8OH1SDoXO6G0h7 CT0tORJ0NpXz+tyYmbZ6NXjeNJ+GTzivLES7yqf78QPer7gCIMfSX0kFTPsI2arysqX58god60d 7JbUk2YB3W8XmKVHqcVepZluAXSGwI/kkrOe7uJmCClNGKzH6YI13MVd8VguGvQxwmCAKP9MEbm SMrRKI9qwbzuitOK57ir7OTDoNPmIKHY/bfqQ1LzqfLx/l6CjamZaLv9zeYvjGfixdKsOiuMx2+ teN5mmRdEOoafsG2A2GR2k2xgaTZ3qiatCKld0s733aEHGDQyrJ+msB81MyA3WsNR0X3T9NKQI4 96VTWofKc47vL4xgbjS8G1PelPT+U3pIcjtd7rESUEGYCaRx6S+y/eXH/tPfCfJiXCqfKOXzkru I8Zki0Wz899B/xA== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552075783158500 The getter and setter use visit_type_uint64, not visit_type_int. Fixes: 3e0dceaf9450 ("i386: Register most CPU properties as class propertie= s") Reviewed-by: Mark Cave-Ayland Signed-off-by: Marc-Andr=C3=A9 Lureau --- 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 7c24eba3e0c3..8650ff6caecc 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -10950,13 +10950,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 Sat Sep 26 20:00:45 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=1788552111; cv=none; d=zohomail.com; s=zohoarc; b=P1hC68JQhpCQ/hXvjHcxs2fqKbyCaveVWEiILx1gYJm8nsi6kif+hOH1w1qOjiESgh/9Y1U4kLkZO45YBeIylc/lddsk/rTZAoDBgnm5gX+zIvTZOfBbmP4OSO7oB3gUNdhjoq75B5emtqAzdPO2A4fowBU2rmrHnkficb+qbdE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552111; 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=rYUW7mTarKGtGHB/ejRnCer72Bim5gXX0iKigt43Ozg=; b=TCUIqAug8F7ZYdn/QSQS66z4EmTZ0/2BvR4gXXC/dSIA/CTy/5MnejjsA8jKMrGKOZXuTt7oRk2sKR8a3rQR2gZxGY/w0la5zzSMKwA9cjjoWmKU0LQW7AGYlfPL7c0CqNjO6iitC67yAxj37Noj+6UZYKWOtiiAlWTGbK1V4/Q= 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 1788552077398611.5698814436006; Fri, 4 Sep 2026 13:01:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a5c-0004VX-9r; Fri, 04 Sep 2026 16:00: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 1x2a5Z-0004CH-Hw for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2a5X-0008JW-JU for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:41 -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-263-IE0eJQ6aP9i2C852AHkJ9Q-1; Fri, 04 Sep 2026 16:00:35 -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 E3E7918DA5CC; Fri, 4 Sep 2026 20:00:33 +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 1EB421955F0D; Fri, 4 Sep 2026 20:00:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552038; 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=rYUW7mTarKGtGHB/ejRnCer72Bim5gXX0iKigt43Ozg=; b=Av65GRyiRoeP8bprMuet3BJxlXYndv+R+2ML4xGsLAI9K6LnFVS/6+gs5TGiiE/ZIp4rm0 ow9EQ+7MpRWpNuGJOkPKBPHlILOL/Wlj4PhCZnJpVTxG8I+0h1BJsn2LGg7SHmM0tZAXnr oJaTLeiYTWY54OT/HK6ab3JjkXZ0ljg= X-MC-Unique: IE0eJQ6aP9i2C852AHkJ9Q-1 X-Mimecast-MFC-AGG-ID: IE0eJQ6aP9i2C852AHkJ9Q_1788552034 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:23 +0400 Subject: [PATCH v4 40/75] 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: <20260904-qom-qapi-v4-40-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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?= , Mark Cave-Ayland , Nicholas Piggin , Aditya Gupta , Glenn Miles , Harsh Prateek Bora , qemu-ppc@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=4269; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=HSkTvfNSirJIc6SiW+8atmYUto98Bd95oCUMIIDC048=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLKbG5aF8MftcPJE5LCqW1H0ulVHREG3uHG0 78ZIvzz3oGJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiygAKCRDa6OEJdZac 5epdD/9OUpWstLrqTe3EqqoY4Uq7B5kLIz5m40Pkyajq0hxGn9972Oyo2cMhQ3/d64IxMThNlLx WLIzjh43z3T2JBOAN78WMtlOebNLA83BAAdNfbAb9ACV2nCrCWL7kde3+rO2ttmWWbgFZcXYdI2 bOmd9ioiUOdgKAOdJeSqpciaaDQeODHCUIqd2u23XVFUraxRpT/QM2fuc0d7ObRb2rTjOJpMGrj uoTpXZr+YZX2wD1+OiBWalwi9aEN0G9bTxFoCE+wtAs69JzpiMfihofQcJNkEFqpF3pNI9yohJ1 BYiwBChM53UzDt2zJ1MJo8tkMVFptnDbXNZnsfnuoraJoGKw4Tra66x8B8Yb3yRIhkHTTQZI82F +jroYPwBV6JKdR7tro6SiSoV2m03HR+vgr3MWD3Cr22Uh8h7r+U703JLt/jQCD6AaB9LyhYIsuz zj6sOmGdn4IdskoF/bKxPIKHsWG4WWF+pBgMWhlrU6C28ZDPa5YmmuU8ZwVIaLpNi/MSHwUUpCR WJf/JIk/CocnC3c+4mW3iOICW/qlr8UqeQdlKmvOyVpepjd/g8eHfl2v+vMD2mQM8MBQQM+ic55 JQE2p5A+7BTd95v817fGtQmsBaVhCeuNwI1NcrA8Ob2APadp/zAyw43q/MI+Rfo9HcQ2dAEPoei Tan43nzlSIdsJNA== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552122157158500 The getter and setter use visit_type_size, not visit_type_int. Since the underlying type is uint32, switch to that. Fixes: 8ec1e4f1ef97 ("ppc/pnv: add phb-id/chip-id PnvPHB3RootBus properties= ") Fixes: b7c1750dc440 ("ppc/pnv: add phb-id/chip-id PnvPHB4RootBus properties= ") Reviewed-by: Mark Cave-Ayland Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/pci-host/pnv_phb3.c | 12 ++++++------ hw/pci-host/pnv_phb4.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/pci-host/pnv_phb3.c b/hw/pci-host/pnv_phb3.c index 4ffdb4ce31ae..db061c134e95 100644 --- a/hw/pci-host/pnv_phb3.c +++ b/hw/pci-host/pnv_phb3.c @@ -1130,7 +1130,7 @@ static void pnv_phb3_root_bus_get_prop(Object *obj, V= isitor *v, void *opaque, Error **errp) { PnvPHB3RootBus *bus =3D PNV_PHB3_ROOT_BUS(obj); - uint64_t value =3D 0; + uint32_t value =3D 0; =20 if (strcmp(name, "phb-id") =3D=3D 0) { value =3D bus->phb_id; @@ -1138,7 +1138,7 @@ static void pnv_phb3_root_bus_get_prop(Object *obj, V= isitor *v, value =3D bus->chip_id; } =20 - visit_type_size(v, name, &value, errp); + visit_type_uint32(v, name, &value, errp); } =20 static void pnv_phb3_root_bus_set_prop(Object *obj, Visitor *v, @@ -1147,9 +1147,9 @@ static void pnv_phb3_root_bus_set_prop(Object *obj, V= isitor *v, =20 { PnvPHB3RootBus *bus =3D PNV_PHB3_ROOT_BUS(obj); - uint64_t value; + uint32_t value; =20 - if (!visit_type_size(v, name, &value, errp)) { + if (!visit_type_uint32(v, name, &value, errp)) { return; } =20 @@ -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", "uint32", 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", "uint32", 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..9acaf4c0c2f5 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -1727,7 +1727,7 @@ static void pnv_phb4_root_bus_get_prop(Object *obj, V= isitor *v, void *opaque, Error **errp) { PnvPHB4RootBus *bus =3D PNV_PHB4_ROOT_BUS(obj); - uint64_t value =3D 0; + uint32_t value =3D 0; =20 if (strcmp(name, "phb-id") =3D=3D 0) { value =3D bus->phb_id; @@ -1735,7 +1735,7 @@ static void pnv_phb4_root_bus_get_prop(Object *obj, V= isitor *v, value =3D bus->chip_id; } =20 - visit_type_size(v, name, &value, errp); + visit_type_uint32(v, name, &value, errp); } =20 static void pnv_phb4_root_bus_set_prop(Object *obj, Visitor *v, @@ -1744,9 +1744,9 @@ static void pnv_phb4_root_bus_set_prop(Object *obj, V= isitor *v, =20 { PnvPHB4RootBus *bus =3D PNV_PHB4_ROOT_BUS(obj); - uint64_t value; + uint32_t value; =20 - if (!visit_type_size(v, name, &value, errp)) { + if (!visit_type_uint32(v, name, &value, errp)) { return; } =20 @@ -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", "uint32", 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", "uint32", pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop, NULL, NULL); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Sat Sep 26 20:00:45 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=1788552098; cv=none; d=zohomail.com; s=zohoarc; b=X84IpfLfefpznE0OsEs/TKT1aiM81TldA/5ulh96IhnhqMX1rjjqZ/HHqLXSBDEWx9LlpqsHF8RGl4Q5sBhU8B2vKs6eS93j+Js6jvE7hFjv8euULf1Wou6ol5DOcJiXTUBDqs7P9xAC2yhVyn6u72Np34OmDZoJjzF0ti+zKCc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552098; 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=Wc4wVdKKRGTcZsKcqY4s15MH0d6IQvOOoL3pkebzII8=; b=O9eQSxv1onq9selwZ1UyHQ7KwPG1/d63rr2G5h7/T6EA/4p4C6yClswhylxZesvpWWL5S6j3YSzXIhJ4sZPgwyqrUoPBd4ae8K2wGf67mmXAOEQKJdRHEjoANO2kxaBlnBS84s5e7xqSUbNWmpuyuXctjdvXvCrlifKGOfYSQck= 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 1788552098211326.23788785871045; Fri, 4 Sep 2026 13:01:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a5f-0004oi-4S; Fri, 04 Sep 2026 16:00: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 1x2a5d-0004d4-3y for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00: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 1x2a5b-0008Ku-CP for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00: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-425-c4-FuaHAOpuYSVgIsLq1Ow-1; Fri, 04 Sep 2026 16:00: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 2A00B1893ED3; Fri, 4 Sep 2026 20:00:37 +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 42CE418005B5; Fri, 4 Sep 2026 20:00:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552042; 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=Wc4wVdKKRGTcZsKcqY4s15MH0d6IQvOOoL3pkebzII8=; b=fq+ueyUKDENolv28UPn/sEtaxbW1tN142B7m1sX9q8U0eEojFuagsf3vZCqtyz8Y6yxLb4 LqqBJAtI3LKLP127KZjktUz0gFE+L734oxoWJop8wGEJXkJP9mlJyYqRg/Wxa99+3CF4iJ adPnSnWmcL58I+y9B/cQKNJMWYvB3DM= X-MC-Unique: c4-FuaHAOpuYSVgIsLq1Ow-1 X-Mimecast-MFC-AGG-ID: c4-FuaHAOpuYSVgIsLq1Ow_1788552037 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:24 +0400 Subject: [PATCH v4 41/75] 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: <20260904-qom-qapi-v4-41-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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?= , Mark Cave-Ayland , David Hildenbrand , Igor Mammedov X-Developer-Signature: v=1; a=openpgp-sha256; l=1815; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=Lqvv7cNma1pkWuS9OPNIMIEkyhwDxMpC+fmPqA3Y+7E=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLKbTv+Qk77Ct2PQ2hY6eNtgWV35F1Hq1S5m LBB8UkIFHCJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiygAKCRDa6OEJdZac 5a59EACFYL2DCxdx1DraWj6dwIR0mJR/xNsXgWiQ4+r/AoCX7rQngt8XFPlnRA+M5mVsbjuhn03 I5wNVN6if0934MpZl2l1HaE3ckeBFGG3qAKp3aUEDW7Le7pMAivdh5Ti0luyU8C6N8TKmmfxZJd Sxy4VFlSziavrs6MoSt00Pax7TqF8mUajIhS+TJ0clIymAA3OMNZWQl0PF1LaB1pP4DHuGhOH2q aMjMrpsuGMoNOiTY/c+Sc+kbYOt8hLOg9Lm86DNPwErKoocNNvV8p1VUu4xKFZ36OyEArkkz8dO hwjdSW5JgmwdQM58apvcQIDywofFBs50eb7wXbGa0j5XqvX3jEo656qfpTeGiRrxaG6Iyr99HBZ qn61Nke5lyODerunRZ0oEryuWm0PN33Q7/9bmmeOxlBiwJxhPoQT/9AuZltSaPbnddNeGr73xAN bp4tu+BjPcOMZIXLv8nhBdTFGrfOIafrjWCUnFEE6Ejd2ZfIOjSDc0WkmCNuPAe8cwhZlUxGshM EcejUKjbS3J0ELbLHE7Uht25VACh3Tlcf6Pvx05wt5YTegdt8qiaNaCd4YlqdBcQy3kMEeGonaR WFhU1LurXXe70vG7V0yqHMtzGiRy2Yw3ybLKNMBmeNtNDx9O/XgUwTR0uAgTuY+KjbdCCvPErnB iCSwWwQRHpsYFaQ== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552099911158500 The getter and setter use visit_type_size, not visit_type_int. Since the underlying value is uint64, switch to that. Fixes: 3829640049cf ("hostmem-memfd: add checks before adding hostmem-memfd= & properties") Reviewed-by: Mark Cave-Ayland Signed-off-by: Marc-Andr=C3=A9 Lureau --- backends/hostmem-memfd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index 923239f9cf69..e21c5a3f2e24 100644 --- a/backends/hostmem-memfd.c +++ b/backends/hostmem-memfd.c @@ -89,7 +89,7 @@ memfd_backend_set_hugetlbsize(Object *obj, Visitor *v, co= nst char *name, return; } =20 - if (!visit_type_size(v, name, &value, errp)) { + if (!visit_type_uint64(v, name, &value, errp)) { return; } if (!value) { @@ -107,7 +107,7 @@ memfd_backend_get_hugetlbsize(Object *obj, Visitor *v, = const char *name, HostMemoryBackendMemfd *m =3D MEMORY_BACKEND_MEMFD(obj); uint64_t value =3D m->hugetlbsize; =20 - visit_type_size(v, name, &value, errp); + visit_type_uint64(v, name, &value, errp); } =20 static bool @@ -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", "uint64", memfd_backend_get_hugetlbsize, memfd_backend_set_hugetlbsize, NULL, NULL); --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Sat Sep 26 20:00:45 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=1788552194; cv=none; d=zohomail.com; s=zohoarc; b=jImffGQpkGqMzKJOUS78rGjDrWjgHF6R7a489CyCgRKY5Cqkl8gujrbk1JC11/usmuvjZ9B4VdK5tvDqTaIhCi9igLDiTRQb2ufzyBpTBh2RvhB09ybMcFTjjsooKNLris7HDVfV0I2zOJ5NgJ880WiAfyXLrKphIXXjGUf8Kyc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552194; 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=t0aO7FqfJSAdz1YQ8MVxqiTp3fdIPsWeQDE0DGs8ifM=; b=aVxC/vVwlGg0BiHrYrJNcS0Kvaa0fbv8CIV0WoZavg27B87YIPRkhmebCZqu6PR1jEH3jv4dm30xcAxnOWV7m8VpLxqSwmh6CLeCA+gSJjm6DCoACxFTUrmvIiejWuyL6ercgc6kT/hnXaxiXxU1bEkP2FrFhhTYM5Vbuxbw9lA= 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 1788552194502434.8651814665807; Fri, 4 Sep 2026 13:03:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a5f-0004tG-TE; Fri, 04 Sep 2026 16:00: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 1x2a5d-0004hZ-RC for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00: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 1x2a5c-0008L7-5M for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00: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-358-4pok4fRVMGaX7eZlzhuGBA-1; Fri, 04 Sep 2026 16:00:42 -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 CF10E195396D; Fri, 4 Sep 2026 20:00:40 +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 C154618001CE; Fri, 4 Sep 2026 20:00:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552043; 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=t0aO7FqfJSAdz1YQ8MVxqiTp3fdIPsWeQDE0DGs8ifM=; b=Ae5KQagWwRtdcU5HCA++DOLycnNGj8zfkymdwmmECx6R8BaKs6XveaSU2wUpHAJpzlLtQK Y9Info0vqWlZ6eU8ISqW8AKaQafQsbQAPMHh4Z8ynHy4UTnngrxk1cmi6YmJhGXvKiHJFs Q49SMshWk1z2J3/J88GpL9aYy/fOvCg= X-MC-Unique: 4pok4fRVMGaX7eZlzhuGBA-1 X-Mimecast-MFC-AGG-ID: 4pok4fRVMGaX7eZlzhuGBA_1788552040 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:25 +0400 Subject: [PATCH v4 42/75] hw/acpi: fix "node" properties typename MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260904-qom-qapi-v4-42-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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?= , Mark Cave-Ayland , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha X-Developer-Signature: v=1; a=openpgp-sha256; l=1725; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=rI6+Ht1+ovIHApi7V2V/PxX0Go4UHFVSP/2DooxLlRM=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLKXm+3tmPfI/yolgBHhSSYsiLQ72WSt/MBr 3ek3u+UFT6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiygAKCRDa6OEJdZac 5dXcD/4sNqQxkV6p1w07SrEYYUkTj6wp5Ma6kb1fylmbcKJ61HW0TGK7K9g1plyOxB54GW8/dmC qCt/LMJEDxn0C8aOhjAJAUlBz8Z2c20M1Kai45o94iFElSO8UR5FhWwq9bMOEPhCHGahPa2goRd UnbXAsGPwjWDqbf0rIBndxDvRWgPHGKO8fYXUACLm6RbhV6gC8x3XcEw66GAIu3f/hBZq8WXrHb +g79irPRvAuuqTl/8XFBCCFLYxU/ptHKKq7n0ct2zRcz5LAkE6wVL30/Y22yTwgTfSxR1VEt28U Mpm/Ixlb8vfOILLlQ6TaieFa0HD3rb3+vhU+OyT/LBwHRQfblyxXmeQ255Pe3rgixW6M60c7AcQ S91jjYuhbUtYZPCBmUpwqCQlqfOAd/6DTNvdhTygGHf1WLw4HI1HbKEJ4pFIY0T0111fy8J6c9R QIFovm7likYYX4rFNdaCSrJs2auETAsIPXTJcOlKMxw27gSDqOEfHCAby2IFq7P4FZHWDHzxLk4 aKY7Ff8iYp6kieYyEdd6swz1hlJs6n2Q+aYxpReNH9JH9pwrWu896ZCwCDmnd482oD9986Suv5G u3a+shWf8xqxpKihOPiOKfJOLvt0wnMlxgNQUZwBcxofw+oSVZvSZtwoxPg30nwApoz13tni1nP qSHg762B1GU5OYA== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552196160154100 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") Reviewed-by: Mark Cave-Ayland Signed-off-by: Marc-Andr=C3=A9 Lureau --- 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 Sat Sep 26 20:00:45 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=1788552074; cv=none; d=zohomail.com; s=zohoarc; b=Zdfxfcdn5e5zulfhr+LUvo0gTT7fLqgp59tqwLoeW6jJWDwSGry9E3shSrWGrXeLpG0XF3WIuDFqtuLcLWBSI3Uvu1GDRs2e549W4hOj1OYwS23a6ajuA91CkBGLQB7kErhe9n/y+XKcRerclgPmKEQJSZW48LAmsflt0QJDBqU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552074; 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=n6tdz1Xg7E7W8wiLqvOHFSP1iBXvZWEJUWZhx6KWWIBa45fKZUB3feEVAy5tgyf4D0k1ksq1gEmE1XuPBH47kmvQTYCT58zb1OqGJ+D62D4GIbShWCRcMAPrBFVbFlN1efOIcr63wUrlDGfA5fFYKB/ewjXjmS69jtG7TBCHj0Y= 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 1788552074526214.9236460654164; Fri, 4 Sep 2026 13:01:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a5k-0005Cd-41; Fri, 04 Sep 2026 16:00: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 1x2a5i-00057t-Ca for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:50 -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 1x2a5g-0008Lp-RF for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:50 -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-199-DJWo_Y0uOWyVYDQmBCEMOw-1; Fri, 04 Sep 2026 16:00:45 -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 3909E1893ECB; Fri, 4 Sep 2026 20:00:44 +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 2FE331800577; Fri, 4 Sep 2026 20:00:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552048; 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=Br5YE4amf4P+8b2MHGRtWYlNIUB5K3Nc1MvLayvdMKFIoBllvpOGh/5tARIFZ15a35jhN5 uOHtLVTPqtBcYQ+uMGCO9hFf3Wfxf9KJ+WMkaAN26F6EyShFrCpKtcDP/RRXi0KU4C5hlj EpPLssoTv0diMEWMWNvDHuWJU9DAehc= X-MC-Unique: DJWo_Y0uOWyVYDQmBCEMOw-1 X-Mimecast-MFC-AGG-ID: DJWo_Y0uOWyVYDQmBCEMOw_1788552044 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:26 +0400 Subject: [PATCH v4 43/75] 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: <20260904-qom-qapi-v4-43-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=kA0DAAoB2ujhCXWWnOUByyZiAGqbIsqi+uiupJzcaS60keoudMTzPiIOsCdCpNpAeOcWTyLJ0 YkCMwQAAQoAHRYhBIepvZM/h8YG0nb2Ldro4Ql1lpzlBQJqmyLKAAoJENro4Ql1lpzlxKsP/A/J 9HsKb0iEjHdnQTntRQes/kg1Kp/4DzJJhfgYvYnGKDWvv4/iSnDZd8NVesDcTFpKKNiQaeNe94X yye1TX6MEtyW1yCsALpTZZdNgdI+11QUKG8A4Rtif+u37SabH6b1EWCg8MCq0y/2UNrnzVgdCHE AN9uXcawKgKmQ7QYnaMUlp2IHEJJ88+H7EkxYwltDyC6W00cMdWKk5unecj6cH/44wOruQyeaeY fv8M+P6j0Tb23CzRQRSxFWAwR7SPOWJjAdnWyrjW5IZNVa/K8SozWEt/O5c1wjjMf3zAp0kF9LJ qadG0lo1fHL4qGrqZaecn7LH7B07SZKwJbWFreJxxR7+StZUw1tfcQvoG+o4u5B2Qlicpqy/YN6 mdnozx0ZJuS0wXoZpcH6MlYV6sV/W68M2bxohPds8qHkn4ztSG+MgEJ4OgLc7o8Ue56kxqx4lJP yFvQLA+BVhinRfnQvgtSfBQD3MQN3aFD2/2GzCy9dYheBGYCOFCOGwLDS8Zo7ZJZMjzzYvoWkZH 8q4Zvxw8vSh3XB2ut963nfr/34GvAGpf6Vv7InH+Zv9TEoWGCXkyvZOOGBv5OqA+sAMSarKGrw5 tsiAZWZpnpimIO8VI0W4PshUEicl3Jk0wTKNGPN9TVX/LAVf20OAV5aS2QvqEE+O+JBuw6iLZ7x yUkCc 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552075801158500 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 Sat Sep 26 20:00:45 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=1788552169; cv=none; d=zohomail.com; s=zohoarc; b=dT1XLmDENpUXcqovv5q18gxcwK2Iitui2txqy3pkdy5hzmUgBIwkw/BWAxafKLQnSRa5wOVaT1eM1CXprE9VMkjHs+HiymNWEufJDmF4ydBkxt+kWMisbARlbnZ83Oxhn10Av42jNgLKFtEie7kq0wsf3hkT6HWmfBCKw34u4Ek= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552169; 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=e8oD6UBWNi+ZUI+cVOBIk2vGU1U313U+p1wQJAA74uMPObCC2m/f+zRKMMd6nmDmvqby0XCe45k8mx7K11mYy5+/WAboo/YsQhg4r7EbrSfvWyCrLjsMs9WZOjhLTra1XpfPXsE4pd9oy92dobOJVBqTtBTkv3vl2ZamFgO6qPw= 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 1788552169149359.3532302892444; Fri, 4 Sep 2026 13:02:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a5p-0005Ml-CM; Fri, 04 Sep 2026 16:00:57 -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 1x2a5n-0005GB-4H for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00: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 1x2a5l-0008MN-Ac for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:54 -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-515-R3dKHu7oM7O7qmbWd6gBQA-1; Fri, 04 Sep 2026 16:00: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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 049F118D6343; Fri, 4 Sep 2026 20:00: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 F35481955F0D; Fri, 4 Sep 2026 20:00:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552052; 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=gamvrMmP7igScGYanCE3bQrparhtpM4T49RG7xp61M9Ha3vPTcOGzjachrVyfH7JC8602W Q+DsnDls9fvIQIdpnPQnxnd+Ymh6qJ4SbmHpP5VBMu93Ikz5/yHgph2nqm9QR5OAqsSfxk TGlVyqhApT9xisTOGGgf5YpJ9SbVQro= X-MC-Unique: R3dKHu7oM7O7qmbWd6gBQA-1 X-Mimecast-MFC-AGG-ID: R3dKHu7oM7O7qmbWd6gBQA_1788552048 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:27 +0400 Subject: [PATCH v4 44/75] 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: <20260904-qom-qapi-v4-44-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLKk00d8G+B+kvKvgbKOeexR1nQEaROD/qme DvDIWmsvb2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiygAKCRDa6OEJdZac 5QByEACO2JIk1o+Ht7qrZve9/HYOqO4SMsi6CUbHZ+cOy0Q0faVQQ/7w270ShMzEGXGbrEJX42E KejrnHlC5X3DgMFyFu8WbivZA50x2IgDeZ9tDqZqNTPQW4x6lb5nfA1rg6oRVnQobF7PeWmsUJD +gKv9jEbCtlh4TAe/3lvMSeNGnzF497RWucdJqLgssj789r3Pt/7kvJqmXswb2zGGhjh0zzZGAg Mj8mKOVsHGIwGORgn13Bv4wHiXFngMPbMi2tsW1vtuw7946nIiBNJkYHalvlyBR5FfEdyk7zjKD edZetqIxQ5DK+0hh8DiE2v/xZexIb/4B7qsV7iIaWW4vrP37RIXsmYdL/ZvIH7YO77EpzAMlw9O JDCMvdFI26Wects7vU9LE9M1cOJF4agPFSggZYllH6roUEGZB/3e/6dnSi0qgTuJ+YUaPb/L3SH 5h+BAKiCB+O6ZXu0p7rdc1xqE1DeJSuHAY+BoYc4Aa7SSCBLpgfC7cxdoZfMqLKnj0s5+7tJ1pj 7QUP+JNYC2BOmUMIiDwk8d0UrbgoKP8o0xu7PAihj5ucGXAn9QvkDdPhRvITN0C73HB/sWSq0Bz SwsuB6+6v7JITEhidKFpu/cKbsbbRn37LCttyAi4PQ7KCM/3CNmR40Khf4pTBeI45zoEhT2y3lH fCGkGq73kkVdfbQ== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552171813154100 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 Sat Sep 26 20:00:45 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=1788552112; cv=none; d=zohomail.com; s=zohoarc; b=YDzL+wxb9vMdc99211+jNwxCdgT3TXLtMdSIPQ1EVkqMAxWU7v6ZZB+SDCsIHM1pnMmr31w0U6EtsyqSYhgtfi3H0cSTx2XyZ41Ph/TdMTiynxG7/puYroQ1rEzSEspPVGlf3riMeImisyykW7r7KUe09bcd227SDhSfgrILTLQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552112; 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=Iom1hTl84IsZoSbKkrFRIKnbIxMvUDEP1BenObCH6u/heCFoCokysZsjgIbponcgZHYUFoNjSEf9kn97kOLT5JjAbxUZDVKsMqgPx5alH3rjMC7jWZF/vaP+hKzLDFg4DsLkdsA7Rh6SvY2Wk75+x9kB6uUuXvEuN7TKP+9tPi4= 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 1788552112665213.53011098383172; Fri, 4 Sep 2026 13:01:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a5y-0005jY-A6; Fri, 04 Sep 2026 16:01:08 -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 1x2a5q-0005Uz-Qb for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2a5o-0008NB-Vr for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:00:58 -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-434-BQ5JC3NPMYOYgSZknX2pTA-1; Fri, 04 Sep 2026 16:00:53 -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 8B236180A9F1; Fri, 4 Sep 2026 20:00:51 +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 6DA081955F03; Fri, 4 Sep 2026 20:00:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552056; 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=VjO5kRFLP0NVLnVxJCheOBHg9fhGHTp7iABs7X5MneWVglotKlPUNN/38Mkxm/PiBmgdgG V6la5XtZ6bIh0M9X+0cdjzLEerPcdasU6mOBE8iuG3BcHO3kaN98XCSS/BiJgntF8o9+v6 bReNePuyeDbhUO2L6GEAfxPmPlJi7xM= X-MC-Unique: BQ5JC3NPMYOYgSZknX2pTA-1 X-Mimecast-MFC-AGG-ID: BQ5JC3NPMYOYgSZknX2pTA_1788552051 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:28 +0400 Subject: [PATCH v4 45/75] 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: <20260904-qom-qapi-v4-45-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLKwHyBxleYpQRo6JpL90MKfbJg9xX2c5yfI 0wv/3E4RgCJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiygAKCRDa6OEJdZac 5XTDEAC22BDZneg+yTMXi22ZAG3VgwRy8gIZLe+Ndpxl+BfE5o0oXgOuc2D/kQtPdNcttSPgZyB oF6WtpsFZ0ds4EEm0DMbQivfFfUBbf0xBHA/wBDff8SO11caJbxX35hcA4Mp5ztZWIJI9u6ljiN BGfNBUsQOQNYqPDsPW8UJL7u+W4Ve/fjNTXTRAML0437DUyWoHQsS9FDzW7sMU2NOfFVq70J9Te 2f+QfzfXKU9T7XWSI9pJQO1DA444Xp/gnhps3X66kEDswxJ6J/+UU/z7cglYIPgAjSJMrUNbyEp VG3NMYw8m/5ZRkAB/jThG5bRH2pn1IPcOjlN9ZcfbMU6xbP2hXLLxDrXykM/5Nk3LhcXDp6lSc9 V5TQvQGNzD5hvcDbvwQL4slZc1nfhGE4g837tq0uadL2Ir72GGtMze/KiGpzCNR77y/pQ2WLHhm dja66psytaEVZRYQb+eNKdn3i4kseUWp+120wmERH5a+orKfh1BfVe+lFn6X6Bfmq8uIUatBihj mqT9onf9Efear9q3vFIAxx6sgIExOvVc8HY7SDzHd/WH2pLSxg4mwiscnE3szhP+oy/CvfJ6s/K B+KMBUTgvXASn9GTEapvbLjEaZkoOBytDGMsjJfg0S2LfGvtzDprTlR7FToKt0/u9bR+eIQ570K pPvxU3rHEQCakDg== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552114031158500 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 Sat Sep 26 20:00:45 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=1788552111; cv=none; d=zohomail.com; s=zohoarc; b=HwRELW1BJHsecwS7Zh87jijRFRD6aeGWwHeimcC1/7n04GmKKay+tZDa2cA1i81Hbn4IMlZc4Gb0LZ4jNe5PDSyzaM7M6x33tBMx12h9anKsNUWxHaCSZNmoXRhkQ+Yw9f5f3yG4GCv+VaJgRvwHZmuvYhSkDSipiJlGNxtqynQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552111; 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=lxBbvAr67l+ay1JAMD0STbt+EdH/TmTJeK9Lr7BezhA=; b=ll678sxcUBHP41Ji0CKxCivwtcAzD285rMXuaHp+hEe8z0W9Cv0K+TN9VoyFC6tfKZPzxdg3RK4hZ7CDyjkvujdDkllJL8dMHuHgb8CsJi2MknBQgXTgILdIFUrNEW3dsxdp6leMqNJGz93FuYFo8VNLSZvy4AHsCvTJL8eBess= 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 1788552110927686.5657599690364; Fri, 4 Sep 2026 13:01:50 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1409103.1641276 (Exim 4.92) (envelope-from ) id 1x2a6B-0006pM-TD; Fri, 04 Sep 2026 20:01:19 +0000 Received: by outflank-mailman (output) from mailman id 1409103.1641276; Fri, 04 Sep 2026 20:01:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x2a6B-0006pF-Pm; Fri, 04 Sep 2026 20:01:19 +0000 Received: by outflank-mailman (input) for mailman id 1409103; Fri, 04 Sep 2026 20:01:17 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x2a69-0006p9-GM for xen-devel@lists.xenproject.org; Fri, 04 Sep 2026 20:01:17 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1x2a68-00BBEn-TC for xen-devel@lists.xenproject.org; Fri, 04 Sep 2026 22:01:16 +0200 Received: from [10.42.69.8] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a9b2371-8faa-0a2a0a5109dd-0a2a4508c06a-32 for ; Fri, 04 Sep 2026 22:01:16 +0200 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a9b238b-f659-0a2a45080019-aa0a817c936b-3 for ; Fri, 04 Sep 2026 22:01:16 +0200 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-453-VChG_IsiNHqq84Is3Jl6Iw-1; Fri, 04 Sep 2026 16:01:08 -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 BC56B19560B5; Fri, 4 Sep 2026 20:01:00 +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 E9D201955F01; Fri, 4 Sep 2026 20:00:53 +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=1788552075; 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=lxBbvAr67l+ay1JAMD0STbt+EdH/TmTJeK9Lr7BezhA=; b=KmZpTUQ/W4EDR9Is6tjGamcOnZlSkhmrn+i4oXYKYRDr+aKOaPb83YEav7amjBGglwIYYz d0tDsyD5Chhu5ZbjjDvvWOWk/SYddTV1wtE/X9jT0w+K4PG98d1phqRmrClyIN7oNQIVvc udGweyqARv6qebcSTLhF+m9ylJfdDsk= X-MC-Unique: VChG_IsiNHqq84Is3Jl6Iw-1 X-Mimecast-MFC-AGG-ID: VChG_IsiNHqq84Is3Jl6Iw_1788552062 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:29 +0400 Subject: [PATCH v4 46/75] qom: convert scalar properties to QAPI-aware registration MIME-Version: 1.0 Message-Id: <20260904-qom-qapi-v4-46-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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 , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , 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 , Amit Machhiwal , Conor Dooley , Sebastian Huber , Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , Halil Pasic , Christian Borntraeger , Jason Herne , Ilya Leoshkevich , Eric Farman , Matthew Rosato , 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=108088; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=cHU4sMAOTK0nyjqP8Kte0SJwDuBniWlAjYgt6I7u8VY=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLKEZ5SvUfjS5X2xFeeknK9H7KeJC0Ms2+/K BrbtjNQrcaJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiygAKCRDa6OEJdZac 5b+mEACScl4BbdYgc3pRJej9WkBSQGao4mCcmcadphCYf9peTiIH9x45yjfg+H2XxEilltlPmJU BEkeFi/UzK7MdHZdu3JKngI03qCG2f5cBRrwQRYQpZepcoiQBTex+6e7mqJ/fWmSd31t6XzGXfK 3eA2AdQEXHYrX9bC91wRBbVVEMM1DapYApnaaFn9c8vnDW9xvqynWEINrzfzKMVGK0ifbNCguYt gZPbobnnbfNVpIGIL9pn998cQawlphkgzTB8080gNtKZMkVD0Hpb7JTKWsHRDmy+SaAZTU7N9g1 2PBPw9Hi6nRyF4TRJziJxJhTqSIw+lISCtCwjkRnATTj6F1W+whp8f/7kWQrLclt2oytmLQb1r6 wjMB7X23rCcBm+cdk6Ys3UjjHbJHRcCZbLaRpzUqgj+v8/khFUEyRxXe0hDS1HaCHMRqNwjbx3c GfY/m/Wf4ODlRNiGGqYkPEwU/jYq6DxyNjnknhN7uDcCyLQ0utDuY7+LiKvkOvWfwe7i1N9p7L7 73w5ZSfaLZgJFj5aWCVSZrvr6nT9GibTyAhyNDIIfgVY4G8ngBA3Q1OSBxFrqS75Zu4gS0iUYU+ Hqe+Ggtf+hccnj57z6hNv159RookAUSqCV0ncNAvQ1BuJV2Z/TEhDIkuVzPuvR+X6XmzdYTcyQn +1frzdeAbEMkiHg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: AUf_b-MJNhv7QUT0Q89yclkUfJOwfYSXueCBtFGYpRA_1788552062 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-c1860d/1788552076-D7B59BDB-04830E4A/0/0 X-purgate-type: clean X-purgate-size: 108090 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1788552113098158500 Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Amit Machhiwal --- accel/kvm/kvm-all.c | 5 ++- accel/nitro/nitro-accel.c | 3 +- accel/tcg/tcg-all.c | 3 +- backends/cryptodev.c | 7 ++-- backends/hostmem-file.c | 4 +- backends/hostmem-memfd.c | 3 +- backends/hostmem.c | 6 +-- block/throttle-groups.c | 5 ++- crypto/secret_keyring.c | 9 +++-- event-loop-base.c | 7 ++-- hw/acpi/ich9.c | 1 + hw/acpi/pci.c | 7 ++-- hw/arm/virt.c | 4 +- hw/core/clock.c | 3 +- hw/core/machine.c | 2 +- hw/cpu/core.c | 10 +++-- hw/cxl/cxl-host.c | 2 +- hw/gpio/aspeed_gpio.c | 5 ++- hw/gpio/aspeed_sgpio.c | 3 +- hw/gpio/stm32l4x5_gpio.c | 5 ++- hw/i386/pc.c | 6 +-- hw/i386/sgx-epc.c | 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 | 11 +++--- target/i386/cpu.c | 12 +++--- target/i386/kvm/kvm.c | 8 ++-- target/i386/sev.c | 2 +- target/ppc/compat.c | 3 +- target/riscv/cpu.c | 15 ++++---- target/riscv/kvm/kvm-cpu.c | 7 ++-- target/riscv/tcg/tcg-cpu.c | 13 ++++--- target/s390x/cpu_models.c | 5 ++- tests/unit/test-qdev-global-props.c | 11 ++++-- ui/console.c | 3 +- util/thread-context.c | 7 ++-- 77 files changed, 343 insertions(+), 241 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 9c7e0183d480..aeb6fc37858c 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -275,11 +275,11 @@ file_backend_class_init(ObjectClass *oc, const void *= data) file_memory_backend_get_discard_data, file_memory_backend_set_disc= ard_data); object_class_property_add_str(oc, "mem-path", get_mem_path, set_mem_path); - object_class_property_add(oc, "align", "uint64", + object_class_property_add_qapi(oc, "align", &uint64_type_info, file_memory_backend_get_align, file_memory_backend_set_align, NULL, NULL); - object_class_property_add(oc, "offset", "int", + object_class_property_add_qapi(oc, "offset", &int_type_info, file_memory_backend_get_offset, file_memory_backend_set_offset, NULL, NULL); diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index e21c5a3f2e24..42027529ab50 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", "uint64", + object_class_property_add_qapi(oc, "hugetlbsize", &uint64_type_inf= o, memfd_backend_get_hugetlbsize, memfd_backend_set_hugetlbsize, NULL, NULL); diff --git a/backends/hostmem.c b/backends/hostmem.c index 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 8082eae4282a..cf503668c00a 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -26,6 +26,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/pci/pci.h" #include "migration/vmstate.h" diff --git a/hw/acpi/pci.c b/hw/acpi/pci.c index c82924be8620..71d01307e141 100644 --- a/hw/acpi/pci.c +++ b/hw/acpi/pci.c @@ -27,6 +27,7 @@ #include "qemu/error-report.h" #include "qom/object_interfaces.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "hw/core/boards.h" #include "hw/acpi/aml-build.h" #include "hw/acpi/pci.h" @@ -139,7 +140,7 @@ static void acpi_generic_initiator_class_init(ObjectCla= ss *oc, const void *data) acpi_generic_initiator_set_pci_device); object_class_property_set_description(oc, "pci-dev", "PCI device to associate with the node"); - object_class_property_add(oc, "node", "uint32", NULL, + object_class_property_add_qapi(oc, "node", &uint32_type_info, NULL, acpi_generic_initiator_set_node, NULL, NULL); object_class_property_set_description(oc, "node", "NUMA node associated with the PCI device"); @@ -253,8 +254,8 @@ static void acpi_generic_port_class_init(ObjectClass *o= c, const void *data) acpi_generic_port_set_pci_bus); object_class_property_set_description(oc, "pci-bus", "PCI Bus of the host bridge associated with this GP affinity struct= ure"); - object_class_property_add(oc, "node", "uint32", NULL, - acpi_generic_port_set_node, NULL, NULL); + object_class_property_add_qapi(oc, "node", &uint32_type_info, NULL, + acpi_generic_port_set_node, NULL, NULL); object_class_property_set_description(oc, "node", "The NUMA node like ID to index HMAT/SLIT NUMA properties involving= GP"); } diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 872920b6482b..4e5d8d9f86e3 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 530fbaeb0b28..aa2d90a4e4df 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 db061c134e95..667e9585ab8f 100644 --- a/hw/pci-host/pnv_phb3.c +++ b/hw/pci-host/pnv_phb3.c @@ -11,6 +11,7 @@ #include "qemu/bswap.h" #include "qapi/visitor.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "hw/pci-host/pnv_phb3_regs.h" #include "hw/pci-host/pnv_phb.h" #include "hw/pci-host/pnv_phb3.h" @@ -1164,12 +1165,12 @@ static void pnv_phb3_root_bus_class_init(ObjectClas= s *klass, const void *data) { BusClass *k =3D BUS_CLASS(klass); =20 - object_class_property_add(klass, "phb-id", "uint32", + object_class_property_add_qapi(klass, "phb-id", &uint32_type_info, pnv_phb3_root_bus_get_prop, pnv_phb3_root_bus_set_prop, NULL, NULL); =20 - object_class_property_add(klass, "chip-id", "uint32", + object_class_property_add_qapi(klass, "chip-id", &uint32_type_info, pnv_phb3_root_bus_get_prop, pnv_phb3_root_bus_set_prop, NULL, NULL); diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index 9acaf4c0c2f5..96c2f89f889b 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -11,6 +11,7 @@ #include "qemu/bswap.h" #include "qapi/visitor.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "target/ppc/cpu.h" #include "hw/pci-host/pnv_phb4_regs.h" #include "hw/pci-host/pnv_phb4.h" @@ -1761,12 +1762,12 @@ static void pnv_phb4_root_bus_class_init(ObjectClas= s *klass, const void *data) { BusClass *k =3D BUS_CLASS(klass); =20 - object_class_property_add(klass, "phb-id", "uint32", + object_class_property_add_qapi(klass, "phb-id", &uint32_type_info, pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop, NULL, NULL); =20 - object_class_property_add(klass, "chip-id", "uint32", + object_class_property_add_qapi(klass, "chip-id", &uint32_type_info, pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop, NULL, NULL); diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index f4556ad03a04..6eba30e06811 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -35,6 +35,7 @@ #include "hw/core/qdev-properties.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" =20 @@ -226,19 +227,19 @@ static void q35_host_initfn(Object *obj) qdev_prop_set_uint64(DEVICE(s), PCI_HOST_PROP_PCI_HOLE64_SIZE, Q35_PCI_HOST_HOLE64_SIZE_DEFAULT); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE_START, &uint32_ty= pe_info, q35_host_get_pci_hole_start, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE_END, &uint32_type= _info, q35_host_get_pci_hole_end, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE64_START, &uint64_= type_info, q35_host_get_pci_hole64_start, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE64_END, &uint64_ty= pe_info, q35_host_get_pci_hole64_end, NULL, NULL, NULL); =20 diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 5c2150b71c86..64f9ca29b02e 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -12,6 +12,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qobject/qnull.h" #include "qemu/cutils.h" #include "hw/ppc/spapr_drc.h" @@ -584,7 +585,7 @@ static void spapr_dr_connector_instance_init(Object *ob= j) SpaprDrcClass *drck =3D SPAPR_DR_CONNECTOR_GET_CLASS(drc); =20 object_property_add_uint32_ptr(obj, "id", &drc->id, OBJ_PROP_FLAG_READ= ); - object_property_add(obj, "index", "uint32", prop_get_index, + object_property_add_qapi(obj, "index", &uint32_type_info, prop_get_ind= ex, NULL, NULL, NULL); object_property_add(obj, "fdt", "struct", prop_get_fdt, NULL, NULL, NULL); diff --git a/hw/riscv/microchip_pfsoc.c b/hw/riscv/microchip_pfsoc.c index 60bb96da0161..cf3974577463 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" @@ -741,7 +742,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 8e6ca25dc49d..bbaa999ae0c9 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" @@ -2429,7 +2429,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, @@ -2447,7 +2447,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, @@ -2499,7 +2499,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, @@ -2516,7 +2516,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, @@ -2856,8 +2856,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 * @@ -2897,8 +2897,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 * @@ -2917,8 +2917,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 * @@ -2958,8 +2958,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 * @@ -2978,8 +2978,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 * @@ -3019,8 +3019,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 * @@ -3039,8 +3039,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 * @@ -3080,8 +3080,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 d4a0a5b81805..ae768cba80bd 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 4e8c47253086..55df765e64d1 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 ed99be7fd80c..198b7615f4cc 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" @@ -1777,7 +1778,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 affd87a3ae55..da8d44f1fc61 100644 --- a/target/arm/tcg/cpu64.c +++ b/target/arm/tcg/cpu64.c @@ -20,6 +20,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "cpu.h" #include "qemu/module.h" #include "qapi/visitor.h" @@ -1392,9 +1393,9 @@ void aarch64_max_v8_tcg_initfn(Object *obj) /* v8.2: FEAT_SVE */ cpu->sve_vq.supported =3D MAKE_64BIT_MASK(0, ARM_MAX_VQ); aarch64_add_sve_properties(OBJECT(cpu)); - object_property_add(OBJECT(cpu), "sve-max-vq", "uint32", - cpu_max_get_sve_max_vq, cpu_max_set_sve_max_vq, - NULL, NULL); + object_property_add_qapi(OBJECT(cpu), "sve-max-vq", &uint32_type_info, + cpu_max_get_sve_max_vq, + cpu_max_set_sve_max_vq, NULL, NULL); =20 /* v8.2: FEAT_PAuth2 */ aarch64_add_pauth_properties(OBJECT(cpu)); @@ -1524,8 +1525,8 @@ void aarch64_max_v9_tcg_initfn(Object *obj) object_property_add_bool(obj, "x-rme", cpu_arm_get_rme, cpu_arm_set_rm= e); =20 /* v9.4: FEAT_RME_GPC2 */ - object_property_add(obj, "x-l0gptsz", "uint32", cpu_max_get_l0gptsz, - cpu_max_set_l0gptsz, NULL, NULL); + object_property_add_qapi(obj, "x-l0gptsz", &uint32_type_info, cpu_max_= get_l0gptsz, + cpu_max_set_l0gptsz, NULL, NULL); } =20 static const ARMCPUInfo aarch64_cpus[] =3D { diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 8650ff6caecc..ebce8e128224 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); @@ -10950,13 +10950,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", @@ -10965,7 +10965,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); /* @@ -10978,7 +10978,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 9f65419a2c1a..aa4967adf99e 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -7099,7 +7099,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc) .set =3D kvm_arch_set_notify_vmexit, )); =20 - object_class_property_add(oc, "notify-window", "uint32", + object_class_property_add_qapi(oc, "notify-window", &uint32_type_info, kvm_arch_get_notify_window, kvm_arch_set_notify_window, NULL, NULL); @@ -7107,7 +7107,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc) "Clock cycles without an event w= indow " "after which a notification VM e= xit occurs"); =20 - object_class_property_add(oc, "xen-version", "uint32", + object_class_property_add_qapi(oc, "xen-version", &uint32_type_info, kvm_arch_get_xen_version, kvm_arch_set_xen_version, NULL, NULL); @@ -7116,14 +7116,14 @@ void kvm_arch_accel_class_init(ObjectClass *oc) "(in XENVER_version form " "e.g. 0x4000a for 4.10)"); =20 - object_class_property_add(oc, "xen-gnttab-max-frames", "uint16", + object_class_property_add_qapi(oc, "xen-gnttab-max-frames", &uint16_ty= pe_info, kvm_arch_get_xen_gnttab_max_frames, kvm_arch_set_xen_gnttab_max_frames, NULL, NULL); object_class_property_set_description(oc, "xen-gnttab-max-frames", "Maximum number of grant table f= rames"); =20 - object_class_property_add(oc, "xen-evtchn-max-pirq", "uint16", + object_class_property_add_qapi(oc, "xen-evtchn-max-pirq", &uint16_type= _info, kvm_arch_get_xen_evtchn_max_pirq, kvm_arch_set_xen_evtchn_max_pirq, NULL, NULL); diff --git a/target/i386/sev.c b/target/i386/sev.c index b2c7260c80a4..3a36fa4d0b95 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -3266,7 +3266,7 @@ sev_snp_guest_class_init(ObjectClass *oc, const void = *data) x86_klass->adjust_cpuid_features =3D sev_snp_adjust_cpuid_features; x86_klass->kvm_type =3D sev_snp_kvm_type; =20 - object_class_property_add(oc, "policy", "uint64", + object_class_property_add_qapi(oc, "policy", &uint64_type_info, sev_snp_guest_get_policy, sev_snp_guest_set_policy, NULL, NULL); object_class_property_add_str(oc, "guest-visible-workarounds", diff --git a/target/ppc/compat.c b/target/ppc/compat.c index 55de3bd5d5de..4d81225de37f 100644 --- a/target/ppc/compat.c +++ b/target/ppc/compat.c @@ -23,6 +23,7 @@ #include "kvm_ppc.h" #include "system/cpus.h" #include "qemu/error-report.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "cpu-models.h" @@ -335,7 +336,7 @@ void ppc_compat_add_property(Object *obj, const char *n= ame, gchar *names, *desc; int i; =20 - object_property_add(obj, name, "string", + object_property_add_qapi(obj, name, &str_type_info, ppc_compat_prop_get, ppc_compat_prop_set, NULL, compat_pvr); =20 diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index fd1afbc7fe23..a1faea801d1d 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" @@ -1396,20 +1397,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 68e1501b21e2..d2d6cb7a4c66 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 c41d629d6803..72bf0f48de83 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -17,6 +17,7 @@ #include "system/kvm.h" #include "system/tcg.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/error-report.h" #include "qapi/visitor.h" #include "qemu/module.h" @@ -915,13 +916,13 @@ void s390_cpu_model_class_register_props(ObjectClass = *oc) =20 for (feat =3D 0; feat < S390_FEAT_MAX; feat++) { const S390FeatDef *def =3D s390_feat_def(feat); - object_class_property_add(oc, def->name, "bool", get_feature, + object_class_property_add_qapi(oc, def->name, &bool_type_info, get= _feature, set_feature, NULL, (void *) feat); object_class_property_set_description(oc, def->name, def->desc); } for (group =3D 0; group < S390_FEAT_GROUP_MAX; group++) { const S390FeatGroupDef *def =3D s390_feat_group_def(group); - object_class_property_add(oc, def->name, "bool", get_feature_group, + object_class_property_add_qapi(oc, def->name, &bool_type_info, get= _feature_group, set_feature_group, NULL, (void *) group); object_class_property_set_description(oc, def->name, def->desc); } diff --git a/tests/unit/test-qdev-global-props.c b/tests/unit/test-qdev-glo= bal-props.c index 8ea362cbb902..204436fb7276 100644 --- a/tests/unit/test-qdev-global-props.c +++ b/tests/unit/test-qdev-global-props.c @@ -27,6 +27,7 @@ #include "hw/core/qdev-properties.h" #include "qom/object.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" =20 =20 @@ -171,10 +172,12 @@ static void prop2_accessor(Object *obj, Visitor *v, c= onst char *name, =20 static void dynamic_instance_init(Object *obj) { - object_property_add(obj, "prop1", "uint32", prop1_accessor, prop1_acce= ssor, - NULL, NULL); - object_property_add(obj, "prop2", "uint32", prop2_accessor, prop2_acce= ssor, - NULL, NULL); + object_property_add_qapi(obj, "prop1", &uint32_type_info, + prop1_accessor, prop1_accessor, + NULL, NULL); + object_property_add_qapi(obj, "prop2", &uint32_type_info, + prop2_accessor, prop2_accessor, + NULL, NULL); } =20 static void dynamic_class_init(ObjectClass *oc, const void *data) diff --git a/ui/console.c b/ui/console.c index 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 Sat Sep 26 20:00:45 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=1788552165; cv=none; d=zohomail.com; s=zohoarc; b=kUILqeNZfLirMIrlr5zzsNWvtwCdeTeyr6p6Tcy3uxzKHEhfmckkBF1pa4p9C/RqIPrdHSHx297QDeJWlrbPH4lQ4ZHVAc/BkKZWpmf7pFyCOEIDOZX++iOfqzOIdp4qmKYsDq4ahuQuvMHwxxzJMi8xsr5DcmU5S7AJHt5lEpM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552165; 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=ZqbhsKNjbgDXlQcuFtKvsuc9htp5BzIptdWvWLI5SlA=; b=ZNk9We1hajPiqeYq0erGO6PaTL0XteeygkUZd5cN4pTGzYUaGFVFIVAEOpa9fQwzLv1zqF0XRKTxGNNRzJh/4Mtc6x0dTa18vlBaKgwrQp3JcEzdWQJmLkC2p4Nxn/5mxEU0Mz7sN2hKSE9HJDGOk8DxX3yxMazN3dZquXnD36g= 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 1788552165404553.2567081345168; Fri, 4 Sep 2026 13:02:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a6M-0008Kj-6y; Fri, 04 Sep 2026 16:01: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 1x2a6K-00082d-7S for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01: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 1x2a6H-0008Qt-NJ for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01: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-122-uqSMrFebOG6q6pJ4rC9taQ-1; Fri, 04 Sep 2026 16:01:17 -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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9E89019792DA; Fri, 4 Sep 2026 20:01:04 +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 9478830002F4; Fri, 4 Sep 2026 20:01:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552085; 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=ZqbhsKNjbgDXlQcuFtKvsuc9htp5BzIptdWvWLI5SlA=; b=E52iaT4NuTWhJzT58Ua3AS8XOnweUtW3vCaVDjk1+jq5w6nJiJO0P24cy3i+5zAvVs6vOA 79HWQ9020jV7sI7aw6MCGwx+TCQFUVXT2nYVOyDBDiZySX6mviOg7+TKYUC2WrxGlhaUV7 LxLioPD1XxFJMNdYeVCwHzqrrp3smUc= X-MC-Unique: uqSMrFebOG6q6pJ4rC9taQ-1 X-Mimecast-MFC-AGG-ID: uqSMrFebOG6q6pJ4rC9taQ_1788552064 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:30 +0400 Subject: [PATCH v4 47/75] 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: <20260904-qom-qapi-v4-47-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=SPRNseSbAdO6Ph77aIE7aq7IziNtT5hbLLPbez+gQAA=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLKwEGY7uDbn4CvFUvrfo40tXmrHG5DRw2x/ taT8YmKYE2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiygAKCRDa6OEJdZac 5boID/9FsU0ecwmOF/m+ceIXZ1PtzxmVqI5abF+b9YkODS/rtXPQm/tLB82yVeqSOnBbOlwIL0h d8ANDXHfRMwildkgrrqvgxienBelNBbQhONzmR/SgUlg+6LKQHhu1yPU7TmNxF7iTrNejWprd2A TG0q8fEYByIwLqCrt3MGUHTCxkxfYx62PiA+zsbH6kBCdzRIGMykaFHHzKvyo7M+REqjYBL9JY0 simpfgjNxtjEzMuYHJUIAFb+A518XtsH665yA1zxO0fDJvk13BRyCrHUz8oaZIob2lGHT7xOT4D FTTcY4wf8rntzCPA5q4IvD8B4TMoEY+7Pth90d8oP+PLuYm46XMfsa3WZQRqlVxxVeUtFCiRXJ4 JPtyFN3Vv7DetORiYhG9YTTIIjXknXgUhxB0NYE5Nv4+xzC5K9Y9j3Jey2r1A2IO7zaT7bch/+q XqkA1wY8PJmLMfD8Xitl2v+FenQ4DVhGAqWmNzXLsXFKJJp0/A2utm36kIE+PRedqxukWQlwupF rRoSDOoafmgBocnFEwacBPrxOy68eCxza3OjjzydSk93DapqRoMUqy3o4iJxtqTOOoNxo36Gn5d L6Pu2MsiayHEgDS27aKV6mDecDB76zguufZgpa4aBoKX8W+miFS6a2UZ12E9ERuHsT0Kz56Xhbr YNzqvEweAiPtRkw== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552167967154100 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 ebce8e128224..f5a9d7c3d2c2 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -10974,7 +10974,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 Sat Sep 26 20:00:45 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=1788552146; cv=none; d=zohomail.com; s=zohoarc; b=eJpxljk29ndGKtOt/B1I6s4LgO7xXh6cQKi9uFHX9yoHjpThG0pASZpIH//eDkK4fGk2KX+gtW5X82T/W3uRCc6SISEexyWBXBJtxcWOec4zYut8KmimdWT4DTL+kgbhkKkRxzQAmUE+4RP1sNYIByhPfmvmWFsjSS6sgfxt3Y4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552146; 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=cMBDolSPVEElzYTKtn4KieIC5nCQpDLerFQ50KL2ZeTukFD5zyDRwhep6DFdsniSWYNJvXX5cDi5xWzXBc8rd1O4YfuCASMa1j2Qhgi2V74vZz+zc1jRfxsKdHxGcyH0yZ8QXOjqEgcIRBPaWyq1DUY92xPEtifL2sHctLzUFJA= 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 1788552145645338.3395182169264; Fri, 4 Sep 2026 13:02:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a6A-0006w5-Ut; Fri, 04 Sep 2026 16:01: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 1x2a67-0006Zv-Vw for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2a65-0008PF-Qc for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01:15 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-479-VPQ7JQ1WMoG7KjIKXwBDbg-1; Fri, 04 Sep 2026 16:01: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 45436195423E; Fri, 4 Sep 2026 20:01:08 +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 0F8411955F03; Fri, 4 Sep 2026 20:01:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552072; 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=TDFanQiKVopDGVTzoKyVYJXVojrae8ihBZ/lhrBrEDLcfQgNSSqZyaVJm83A46D36xn8/X XVmN+SnuCj+Iwht0EDcEiFZRhIUARvjyfoj+m2YIwUjhq696jOwmSdeQoF5J892dObQalB wZn+F1ugBOOa81EcUWzfdK8j2U0pRto= X-MC-Unique: VPQ7JQ1WMoG7KjIKXwBDbg-1 X-Mimecast-MFC-AGG-ID: VPQ7JQ1WMoG7KjIKXwBDbg_1788552068 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:31 +0400 Subject: [PATCH v4 48/75] 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: <20260904-qom-qapi-v4-48-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLK+LuGpIcKjt73zpZ56k/wJ/XozmZ3jmj6/ /aDddO5giuJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiygAKCRDa6OEJdZac 5ZklEACvWAaTxlqguJ294ydKn9gDlu8/iEXB+Z0T+RkISZ1dZBnd3f2V63vFxjL7YMoz/i/70MK 1jGrnEVGxugKNlIU9JJ2JTGJKoCHTR8B6Fal3qt1N67wJ+xhQUpGMTatPkHBOQR9JUk1zv8azOJ crbPpYsoACbYVrDwz2w6FqcHV1DckNzbtxzsUxIgQ8Syheb0VS06klNaufCh1sY5+FzMQrZMBtz 1MneYI7zlAJQO8VZRNSBgOW/YwJzvcOoCnzkzsudBvwtHHZv4h8PO3T3NRIFTkCmjDBGzMVTlLI b75zBJEoFSZb4XWUlqrx+eKv7qQLb4OnQXpggoki9WR0dKEMkmX/39ekZPl3mZ4ZqOo878bclcp z+uFFLBb6W33qNoI+ZdFpeHEegaJMIoC3/e1d5vc+xzC1P8+vY0KMh7vPSpalYX3T16mdkA8CG3 zvLrJl5PwkRDupjux4qm39+9HooJJ4eQIIruUkfbhwgiPdw1+LjXIdiWLj30Ca7fYHUiMntAs9c yRPGHU852yjD2aRNw/mlSJC+JTzH6i+EJPywfRXbJkwiWYoHpVmoW2seMpQGm8XB+wCvQTVKnD3 SnHjCUWXqG4gqAXgtKSa67/3DQnDeeXHUZ/luJSaM58crgUbptiIsbe+ZlAlwBEYtS/uEhhaLXx OXRu/O3zc5qfKSQ== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552148816158500 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 Sat Sep 26 20:00:45 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=1788552143; cv=none; d=zohomail.com; s=zohoarc; b=XZDvZJ4jm6g5swyL3G5NSGLz09WN+ImLFDGbSjadPJfwtDbops8vDJw423gaFLUh227HJppkru72YBvhMJ78V6nEIiUo3BAvX0WVxoIGJnpng37Qo1c9b/jc/UnUoUOcJI3U8bWb748cwJKOYH09NSzoHSFhFXPO35XNcPrXHAQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552143; 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=RO5xdBQcp297XzFXq26xfEw/yXShsZtbiSt7Md68TqZtbeGZUKDNNYRUo9eFRnUy9RzG4+fSqpK0dueOiyIuR0U2Z+DM6t6wuqsmj9H7hd7ZAgz4sVSXcVHyLQdkNNN/MB7mcvEaw5K1DlvX9EwrjOrP1NrcaimcMuNoNiSZiw8= 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 1788552143193406.7901387710655; Fri, 4 Sep 2026 13:02:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a6H-0007cK-L5; Fri, 04 Sep 2026 16:01: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 1x2a6B-000752-Lh for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01:19 -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 1x2a69-0008Pr-Qa for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01:19 -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-237-StwE3VGvO8yBVWG0QpciKw-1; Fri, 04 Sep 2026 16:01:13 -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 9F0AA1944D40; Fri, 4 Sep 2026 20:01:12 +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 D3A8C1800577; Fri, 4 Sep 2026 20:01:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552077; 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=Hz0oLytakhl0O1pc8V2wOtT+fwf+IWLbvWhhw6AibqrU72ExIP7GyVRMCU8YH9+9j9XHod qrm9CpqyDOf4iW05KtGIiEkunGV3Quo/pPhLXbYlkqa3Lc3HHHYFEb05HuZdqU7FpBujiD Y8DiJmuWf/lVzn0HBrNnlTa9xkCIwyw= X-MC-Unique: StwE3VGvO8yBVWG0QpciKw-1 X-Mimecast-MFC-AGG-ID: StwE3VGvO8yBVWG0QpciKw_1788552072 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:32 +0400 Subject: [PATCH v4 49/75] 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: <20260904-qom-qapi-v4-49-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLKOLSXMFpNJ4k1dkBucnVHVUQVNUNoi3yoo /VbEpdfC8SJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiygAKCRDa6OEJdZac 5f1TEACsCsMkOfNvNRhfIFpxGLKiz4evd/JqErhK8oJvPrVry8VhsElpUhR99m2VbuC60Lu+E5W fqNhi3wtRnpk52AbWF32d4JVU9doPSUZIlAd/QuevCyLlxQLjuxCAprEYTNDumjTSwpEb9b36eu jV8oz1qTHgF4YMqNX7oLQWNaeHGFAe1loUts4hx/y/8gbsIvJ+Fq4IdjNFm1/KjrhFQUFYpmi/a pIhtRj7S9BFekMjrIrCQqXFv1EOQm6aiOPnjc9nPn22gWs14eMEuANv8ZVOyuBlJx7VTneiAhbX gigOrLW1tgc83t3cCJSgR1sW036HoTLPDuvCw5oRq9TyaxSIw5ofOo+YzC4guSG4ORDDs8ICQDq /Q2acoFDtvO6Gt8x6diwKjZAkOGaDNwd1KlPLyuv9d9W4AJ1+cdmcCoWMJHHW8Ew28pV9Sb/+Y7 a8TA2rahiyqbvDxsn83EQXcEnvhp+P24OriyrCL02IrtrJvh914rsHJg2fLBFeQpsckKW1F9Bg9 NATFkt1dplMK1bGJ0gSjWMv2IiSEwO+6EQWv9ktLKxX2E3uKqiimqZlvBGHTPL+bBy0vupQ/kvX fWCGaS6p0hyx9c2nTajmDTXa38+9sx1INxxPproYz83i+rg+LxXEbrX8XhsXh+dpQ4B7R6NSGNh /HKYlDuiZBQZ49g== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552149406154100 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 Sat Sep 26 20:00:45 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=1788552261; cv=none; d=zohomail.com; s=zohoarc; b=dSJc0L7CYXJrjZEGfi8EqfVxYGQcEYaqE47oYmt4ztN7odDTQp0eGEYUCOm7xcvg+90qI4bbvmbtPuIT0bH/xCF1M/Rm+g7oRPxJFUQDoPTrujJtK7vZn4lo8LW11DBB33EucxDBQvtVnSMhXYcUzeTaoDNCUAC0AeP+Tt/ZFEo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552261; 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=PmEW/B96k3H3l/YBM9VHoTYa79bWzfKcBpSvGHkzKvcHgHgT12cejNZoRl5IK0OMRg3/FqsXtBjFqZFrrUkPNqduucEdc5XFn7EVNqd6oHll8rB6awd7pjPYdsH7xcX9PNrxC8soqKt22fd3zTr//m7xN2BFcpsg+uHQUPhTc5E= 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 178855226152159.8670767734676; Fri, 4 Sep 2026 13:04:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a6I-0007nH-Ta; Fri, 04 Sep 2026 16:01:26 -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 1x2a6F-0007Pq-M1 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01:23 -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 1x2a6D-0008QX-EQ for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01:23 -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-581-MBUAJF9IOfOb1i9aFKYdzQ-1; Fri, 04 Sep 2026 16:01:17 -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 675C5195F16B; Fri, 4 Sep 2026 20:01:16 +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 357D61955D8D; Fri, 4 Sep 2026 20:01:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552080; 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=PFAxeqb5gKoSHOK4x9BO5YAa9tmiSyzl09R2ZXxEq5bglXN3RQdao0E7BQJm5/r9ufE2kx nVOay1NP2ABmB0kz8fJQVpU/Gunwo1cnfJzoZ/qtxtBfghcfndklo2vjU88jJyk5IkuwJx kFnNrJcq2JRBQHWTjreLw750EnQDWPQ= X-MC-Unique: MBUAJF9IOfOb1i9aFKYdzQ-1 X-Mimecast-MFC-AGG-ID: MBUAJF9IOfOb1i9aFKYdzQ_1788552076 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:33 +0400 Subject: [PATCH v4 50/75] 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: <20260904-qom-qapi-v4-50-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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 , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Eric Blake X-Developer-Signature: v=1; a=openpgp-sha256; l=10078; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=wAG3gHYjMgKsDKDJ91QsQeDsDiDGOctuzZ3U1NVRvyY=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLLJ2FxvKx2gxKj2gdCHbG0OI4e7ALvUEb81 n4N0KGr94uJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiywAKCRDa6OEJdZac 5dQoEAC64iybe7pRNHgkt/OaN4jJumdf+2uPrbquUuLNn1DP2uJJTE1ITHanUqYERMkcPHiUf3l SkSmfnLp30KPXihzwBvSGF5s/2lfDgwooVxsIyDkGkdJBXMaQV9vreQ/aANSeDN6icd9C1CKOAH LEvEdXljMQfz7kDdu+5QX8UnmzxH6oIjOADJs8XEOJrF6UFaIN0rP0QYAcvsLpQ/GIOebFnMahs /cPcYpS8m4QoX8opt4fOxwwq7IJGZ+PAp+cy1hX0n1QX6jqdDvv9OkJUo+U6ByvWm3pED5RabPn S4LeFcQMv4JRAWN8ikPrl7gYQwTYsNu6FJtLHfjygiXTGlgsC1HDtmywN4tMt/c+2Mbz3uOUFw5 /mCPb/f/LOBWzXfZ9buI3IvGmAJeFuyd+D6CuIvUvvYIhHAjP6s2DZSdqkonp7Si/Zt5D0L3I4Z ry04RD8Bd+wMrXp12+WzeaEDAVV+DTf0/GwZuPBh0/o+TdcpmLFFSASDwABONvxDDpv9Iat7uJz B3QYoQ50C2ahu04NpbLAjHS9EdBLSAB+FIrvaztbeYSloXy04WB9ayxvoOIm3Du8KRmovJ4lear 6WDsQk/QbuOY0ZlQLCmK9siaQceuQmDIUh2J8kbQuG61KI/+sUCfl9GQjdIvsshxb/xkF3NEcAB AjCEhV5eT3lJmyg== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552263070154100 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 Sat Sep 26 20:00:45 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=1788552206; cv=none; d=zohomail.com; s=zohoarc; b=juvD11aMBgi2UAjMAKkV/vTXz/D0IJv+tSuydtjVP4h/0/n3u2LyEFBXzGTTcUKNyTaCZIqiKvDd5gpHQFI9vbNKzO5PeBIsSOzDsmtJuhymadhlblrgLd+aKtbytz7a44Uy3gQN3m2s+DipG6hf2zPq0+oO3J900CeuQ5T3TfE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552206; 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=7pFnOPIVSD/q/liBLZTnNnkSnKkxuxZIk4GNrSsFg4g=; b=CFSNYwjR09mKrOnmM+j02B5uxaPkfl1rERG6t0LuOWIHklzM2CO8xcEW0MlcByl3kp4hy9zTDOFX146ukGU6faARbz7B7F7TlBhi7xLZufi3IKUGa9Nh8lKnSuXhw7KYVgeK1zMOZgwc/dE7UM/GNwwJIw31/MURLnnEKJ6Y5L8= 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 1788552206160288.55109944244384; Fri, 4 Sep 2026 13:03:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a6L-0008BY-8G; Fri, 04 Sep 2026 16:01: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 1x2a6J-0007z9-W6 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01: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 1x2a6H-0008Qr-Ku for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01:27 -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-617-dmViHKjIOpaYqSofmfnPbA-1; Fri, 04 Sep 2026 16:01:21 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 37757195F16F; Fri, 4 Sep 2026 20:01:20 +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 1BFF71955F01; Fri, 4 Sep 2026 20:01:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552084; 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=7pFnOPIVSD/q/liBLZTnNnkSnKkxuxZIk4GNrSsFg4g=; b=HncGvFtXqDoPAuGpQnWFaq3XlxnWqWuZLDfZLb0VR0Rm136/isJqT5uIuCAsmMO2s14WsW VO3QNRoSj3L43QrJCpg4tTKONdXBpRtdUYAaj8N0i/X9NdtV4XCvPH9S7kVs1P+p4iByB/ Iq4wDpGSqSw7qMmD6HBzMszibjAbMtk= X-MC-Unique: dmViHKjIOpaYqSofmfnPbA-1 X-Mimecast-MFC-AGG-ID: dmViHKjIOpaYqSofmfnPbA_1788552080 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:34 +0400 Subject: [PATCH v4 51/75] 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: <20260904-qom-qapi-v4-51-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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 , Amit Machhiwal , "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=ObykVpty7Jy5t30r2m/tiqdJDn/8pQllDBNIvkjrFA8=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLLvugapNe3KZ7mDdivAh6fzVXe4TnTbECJr pZ7/ARs9wiJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiywAKCRDa6OEJdZac 5d2lEACAjAv+6sBdT6JUgJcPzsQLAvs7LdsahFmByolxD6W2WdcoIRHq7mc0D2DTiNZda3Wzg45 Ctln6bGubTAdKg5OOsGpJ2X7GPUhZrZ5QJDvLv5kALYULaJfIl5HhHpuqj3aXbB4pyt5EEu6bEj wbQgiRrFztCJq5Df9InSvq1ey++BVYKiBxBqylJZoIcVO5MKxgPR2cyhzom8V6rdyGCFbAPLdqj N4pjj8MvFPKeJRL0CSDnq1pg95M27FKrLiJlPECY6JYfNqb8oWUiWlZTc6uFgZtvO/QIOZ51h18 6stVKg4UJxeCBvI9AjFrD9jSviINDACuVRG5zuf1602qxJd0elAe+gv1JsIO2gfS9XQrew9QSYb ZH8bWeqwO0pQxWlJEvETENY+hTelltha0OYYPAsdDfKHdNIBthh3PEaYFKx/BlI6bwd/97LUKiK YvkAOvZQAeLh23M9FYDn/nUqYwA1AWM5w5CWSyZIYeGAeQaI7jLl/SdxMaUkS8tINUxI22FB9Ni pVXGN+4c7uscVl2N5JK1fdnD2RpF0dbmwVrFx5A5HQII7P6qxNeIwBcNRkmzIaO4uW6Deloc7aA dfKkxKpB2VL0Vi41ry8sZNDPqox1mfan/HrIfY7Rp653Fa3h85amdmwJp89YVqhuiB0OtZHwCQ9 ABK6GMD0YbPbULw== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552210274154100 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 6d84bbb25bb5..4bedf17b6c8f 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -2080,35 +2080,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 342cedc42e76..9be2819a46bd 100644 --- a/qapi/pragma.json +++ b/qapi/pragma.json @@ -109,6 +109,7 @@ 'QKeyCode', # send-key, input-sent-event 'QapiErrorClass', # QMP error replies 'SshHostKeyCheckMode', # blockdev-add, -blockdev + 'StructTm', # qom-get of RTC date property 'SysEmuTarget', # query-cpu-fast, query-target 'UuidInfo', # query-uuid 'VncClientInfo', # query-vnc, query-vnc-servers, ... diff --git a/qom/object.c b/qom/object.c index bbaa999ae0c9..a0e3af61ae29 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2632,75 +2632,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 Sat Sep 26 20:00:45 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=1788552142; cv=none; d=zohomail.com; s=zohoarc; b=SgXmFdX+HvJxg5/orJ1eXo43xbnVg8F8fwCTGRoeMWEXvw7kt+/7PeGP6NlAqkpr5SmqX/NedvsemyPXqd4ZLKnn1VMVlFqfUzsSYnCY0knhmT1D+rmeldFs+HzjOnbetx0TC7w+IYeqUvEl5WgE86olKB7dlVBTuK/btW3Qzkw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552142; 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=WyaRBUJwU6Qfiw05/cI7w3eufU/HG236LaIcQ6tg6Fvporqe1d4Jw9WLngyVQSTQKAs4lEWIsQC74P59yUPJGo4iLSZh47AiuI7RAfkXr6HMCUJ+e5ef/kSSQZ+Uq0nVj25P1FISpfsgqYikrWDE4YnFlBYcvd/hiRYNTB6Y8bc= 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 1788552142500666.5363956584152; Fri, 4 Sep 2026 13:02:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a6O-000097-31; Fri, 04 Sep 2026 16:01:32 -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 1x2a6M-0008Oy-Mo for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01: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 1x2a6K-0008Rf-U7 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01:30 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-480-r_jXkbDxNPC5eeRW5uq-0g-1; Fri, 04 Sep 2026 16:01:25 -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 7A9CA18E9B26; Fri, 4 Sep 2026 20:01:23 +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 70EF31800577; Fri, 4 Sep 2026 20:01:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552088; 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=ag7TFVxQ6Yh1abS8ax3f6hHG150VMmS+cO1Ur1ZC6PpZeo+E8fpqlAgpsiw3XjQwt7z3NO iDt/DBxpHchoAMk24tww/UaliYg01hNsSStMOpV/lly6pr0EWn10LgadVc8Oef1X0QIVY0 QUjV1E8pUaacBsGdZrKlYaNzckvGZXg= X-MC-Unique: r_jXkbDxNPC5eeRW5uq-0g-1 X-Mimecast-MFC-AGG-ID: r_jXkbDxNPC5eeRW5uq-0g_1788552083 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:35 +0400 Subject: [PATCH v4 52/75] 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: <20260904-qom-qapi-v4-52-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLL03CKTYxsuAK0h/HSidhe8MDFTeCdHgYCc qvOgyeQIsOJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiywAKCRDa6OEJdZac 5YpoD/0RPrWL1zvoD+BDhUfnAHQFUUoBa61vtO+iq/S+Nz/WHWKoyqdH5oWF4NccmVVPJ9soAfH qyh1h052BbVss5Whkh2VTmOfwRnRhxB9DCVn3Nyx4aWbbSo+S1M+wMsuWKwYl46OETo6U9a3p6u ZnC45IufzWzNJ+7cgIp9h4rRxGeQ1//lJKeab/QKY23Q80YU3WOE/VaJeDyHILV4i/eFKFNT8E1 IKSOEBH9WQDHhpLvLForADdkT+0TJU6WpVarls83JZ3Bw7F/3vGRZN5BMqt3roGKYiXK85yVnbN CyKJVDh+NtfBQUDgCqV+hfBv73tTfXT5cJZN4xkmdVeGW+RHOfUNmllLi+QdTImKtH3ow6giDbr 2ZoPJXf//Kryr6gpulaYOU9aemdrkoAVJ+UYynGfUxcdnPIeaLTqMryxkI1gtWcj+Gv23eUBdTf UJxk0GHOFpU0xEqTDGdH8Aptmzs9RoOUZ+IGdDSrY77fGcJoEg5uFP2dbrvC2FTCrjC9IMzol0f h3gKnTTUNBtgmFyzWB6hlSO2o/BlS0hsUWf3M+4LVB8sqiHL2GAdPVOS6bP1SP/oiyBAlOJu28V /kIE+1shvNJ4szo/sYZjcNWXDAYNsaqnWlCAwLy2K3c5Q0KGLcRAx6sOOFIcmQOL5RinFOSpydx oVBOvjxPoytDiSw== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552149573154100 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 Sat Sep 26 20:00:45 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=1788552217; cv=none; d=zohomail.com; s=zohoarc; b=j/+CURP8FVx5WEIShCJy7wm6Tvs+qqPbTQ4PX6lpRcRFwQPszax32EYxVxKjF0ICk6RjzU1mmmvF20Kl4QgN2Rr2JDAMq/26n4/pHrNzfxwoT7wLLLKpXnDpAgi3bQo94WJc37quHsdLpLrwXp/SEVZDvzvilhv5UwJUtjQI/HA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552217; 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=3xZxsb+MXYVOcFZg8ztTLLylkyJWXaelgAGqcUYHEZA=; b=bMz6fxhXebiMSVBjKXVm3zLGYSAdkVIHoom4efLrZZ0FUus6LCtOzqb+CddtdYeRL9pQT9MqjOdaFpI6CqBn2mBI39ynG+mHnvdzeCAHynns219lKjMcOfRH4KI7i9Zk6atCBd4PwsZjnvF1plRTxY6SBS1lnc69O/2AQ8kpqBI= 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 1788552217484633.3284927333891; Fri, 4 Sep 2026 13:03:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a6R-0000aR-33; Fri, 04 Sep 2026 16:01:35 -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 1x2a6P-0000Ji-2i for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2a6N-0008Rx-Au for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01:32 -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-582-jWb_4IpoNG-QS6jlnyANbQ-1; Fri, 04 Sep 2026 16:01:29 -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 37FDD18E9B26; Fri, 4 Sep 2026 20:01:27 +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 2CB4130002F4; Fri, 4 Sep 2026 20:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552090; 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=3xZxsb+MXYVOcFZg8ztTLLylkyJWXaelgAGqcUYHEZA=; b=I7rB9ttzsY3Szeqp2YhfUW0BofIqpq4UDcBYZjyRWItTKfMuSDM3d8QY7YvcPq2TzQvx7P PZ/W2gFw8E0DH5dH7vkBxnMsmlnHG63oZchlvs9QbFvzIXv7v5HqxtKqRhJ4+46c2Bm7rM EYeBO5ko8HyJGKz7qLwdHipT+JDothc= X-MC-Unique: jWb_4IpoNG-QS6jlnyANbQ-1 X-Mimecast-MFC-AGG-ID: jWb_4IpoNG-QS6jlnyANbQ_1788552087 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:36 +0400 Subject: [PATCH v4 53/75] 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: <20260904-qom-qapi-v4-53-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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 , Ilya Leoshkevich , David Hildenbrand , Halil Pasic , Christian Borntraeger , Eric Farman , Matthew Rosato , Cornelia Huck , qemu-s390x@nongnu.org X-Developer-Signature: v=1; a=openpgp-sha256; l=1384; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=+wSBO6Yrs9Pd23pJ8FlEO+Ge0DCPAboQHJQxxLgvCf0=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLLsYZtPVuciwxZlJdxt3WOAMaiC/2ru5GZj wE34+VwZjuJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiywAKCRDa6OEJdZac 5ZlXD/4/i1/TqDMsO3gc/4jPL7ks7LbzQ00ayXSoYg1PLPtd6/rgUTPjGHxrFjR21EAmqmIx+Pb Lp1+XG+29ER9jBs2ELK8nPqRsmA4GWw2Oyvanxaw/3fe6lGUVG6lCPsDqJr46dUM4Bn1sCp8chA zXx522ZIlnze1HgGCkay9nJMHWcii3ZKvyQswHnvHNGHQ0rB8MY6s2uR23V0E2dYy6ZoEUMQIcV O/a/OA+8JXHtSEvcb7sdF3mZSJ5+LXxkkUb+98obWFQZXvmNamqJFQF58xBu7TK61utj8854vJz d+iLJSxIf2MyP9hcOM3ta1lCx6U+M3unRONptYk662Xt3dJUiFPuuf34YgjeRsMQ0EME3hWL99J vCrT0BJ8yM2B/j9Q7izYfsNJE2/JRX8F2TmYYhjOZF8Jexy+dV2PVZ1XsGO1Vr39V3fE1YP0oG/ Wx9bHXQ5RU9X+pDOscobKIdbjcr1xCLIAYAEdjuzxHxaydcdvY+o9uPqhODNGns17ukAvDPLXe+ OW04TY0ccmDuKbXzIrlOHdw/+KgnFczPxiyzfuQjmAyb5ehxYuVFmM7idTipo62fBZmb1oitf2G CodsaA2avaycqzEjkdU6mqZsXkaPYAjNgSMdDi6mhIoyxjlNdAqD9PU1R+5tUmzqa6hKlVa8WCb Wth7js6xyhZESiw== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552220376154100 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 17266779a6c1..1c8838aeabb6 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -43,6 +43,7 @@ #include "system/hostmem.h" #include "target/s390x/kvm/pv.h" #include "migration/blocker.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qapi/qapi-visit-machine-s390x.h" #include "hw/s390x/cpu-topology.h" @@ -901,7 +902,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 Sat Sep 26 20:00:45 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=1788552165; cv=none; d=zohomail.com; s=zohoarc; b=b4GhZ+5EdUqzI7wEuM5PQW5GAVCNwbRNemo+DMiT8JoktL8AwNpYShACrm30xqjT9q4Vm9z+Bp4d85gkL6F1Mk9KZIMSIquj2RdBp5CQAlKkcgNZ4dvmWhSX9JvLS98dAWjYiWF1fKESJdW8hCkvp7bDQa+BMOvB6vYpOLj+0G4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552165; 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=bsSCEu/aFdvNeK9aSSS98gMf79RbUOmYkdkhzEwow7n4wWzSHZqes80S6s3CjgEq4tMFEofUzHX4lvmZwWOacTdxf0erEqX7o2px5vUn9i0GR+vh/P3hEs3EijxgxC/KyySl8ZsTM80Ms/5Ur+GfI/4mSQlflf7Oz1YTsUvFgzA= 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 1788552165120640.5832638179884; Fri, 4 Sep 2026 13:02:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a6e-0000yO-Ph; Fri, 04 Sep 2026 16:01: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 1x2a6W-0000ss-39 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01: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 1x2a6T-0008Sx-V3 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01:39 -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-xPEl46pCON6dOfEsoOvyGQ-1; Fri, 04 Sep 2026 16:01:31 -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 7E7E11893EDE; Fri, 4 Sep 2026 20:01:30 +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 990A07DC; Fri, 4 Sep 2026 20:01:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552097; 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=aJr/WBZYqmnvvrN1bq2dA2edmPM2rKFnQFksmyY9w85gNpyLCelf0rAPi7vSARPL628n2A JqqaUVPtqwELyqK3paGB+lW48tzkj0Ob6m7grbT4L51CQYceVUbuqPkd0fBbzMeaEOgdAA 8Ficc4VTmufBkaEq3gCVmBczrqC8dwc= X-MC-Unique: xPEl46pCON6dOfEsoOvyGQ-1 X-Mimecast-MFC-AGG-ID: xPEl46pCON6dOfEsoOvyGQ_1788552090 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:37 +0400 Subject: [PATCH v4 54/75] 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: <20260904-qom-qapi-v4-54-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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 , Amit Machhiwal , 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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLLZYtliGOoNv149VyVVY7BeDlQV1sAdI+xg BB7aVQzG0iJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiywAKCRDa6OEJdZac 5VdnD/9tZ0d70Ujucst6iT3VRYyt1b6f7KwLqU+mqUs1NDCmbfzFNPpmi43FG0AAwRVAGGLHjuy ahF9nBbquF3/VJJgd1FRlnFJcLzwlq0iFbrvB7gvD72d+vuMtmO7QmZDtOIJoRFwH/C7n+7wLyj kFinoewEM9mi3L7vr5pJ/NBf3NOv7Nf/29545HUem2YFrf5Ercoa4wLJxRWOcjvugfhoAZeDKTT sHFJXEJwoM94gcIRrY0V/h0TbVGsrpKPSWcaYnuXUZOTgMQkpfhDuz1btuXZH9rRiNaSjfiQtTD 7f73rKwEpCj+6Hk3UWdNLCNPjVVR96EGdI3b4eBSgsj6fzI9ORT3Dk3vf3BOeWoFaTW8VqaXnWR oZVQfx8vkxA7JC47DhijDqGRxP+6qoANPKKTzptlVINR249quUOiVoZ9oc74VhXLWob0i+g+IQt 5b6JQgZ+BO39/H+/QGXhYNGD5Lm2qm1GtPveOZ7FJeNgr3LguqKJT/DJGn+vF0w0ip4mwUR9AS6 9KjKLikCq2GVA/WAVSMPPWTrHEx681kRnWbWVlUg4nqAfz8TNF2KKs2Fai/YT3dS2nervCljGWL ZzYQDP2xeRIpF1Zw9D3LaX2n9bL5BBswNu5V/+sHfj9sFqSMRkdG90cgS7/Ctv901rcToXYy8GY sFeSkQSLgRwLvPg== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552191782154100 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 Sat Sep 26 20:00:45 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=1788552252; cv=none; d=zohomail.com; s=zohoarc; b=GJ+Fum74kw9H8hFmSgI/sx0lvE1aofMQmbVJG6EtKX+lP7cAu/qPL1PRhuvURJM6BY9V3lzPTPiGN2m3Afxv/J/PMtu02MPqRee9ICpumqpYaGuM4xZv7GC4KMEyB1hR4RJa6KBnCOMgOxPtOdRADHeem+vd+i6EftWHR1jASEo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552252; 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=kwI1a1HNsyPG9Nt5yFB6Q/Y2rlD8XNO2xmrf2OlppSnTHkW+9bNjj/RnP8eFBl3N8TE2SjIsoQ3Z2+eEu2poRXFDTaf4fiKr1XOGLijauLYMmlVzAaP7OeE+1YyAs7j9TobXtiZH+aHnliPlMlDi6gtzJvgfzLI25NAqcqArLy4= 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 1788552252074596.5937746176504; Fri, 4 Sep 2026 13:04:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a6m-0001RU-18; Fri, 04 Sep 2026 16:01: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 1x2a6b-0000wY-8f for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01:46 -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 1x2a6Y-0008Tm-2J for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01: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-507-FpnqCMTPMZmHPKWNBVzrfw-1; Fri, 04 Sep 2026 16:01:37 -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 B225F1893EC1; Fri, 4 Sep 2026 20:01:34 +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 22F83423; Fri, 4 Sep 2026 20:01:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552101; 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=GaZ8KSPb/sKEIO+8RuuiZ/oHvUHB7pzPzGkMWjMrXjk/OnGhdTeFOWea6PxTgGRHQ66THy 0N8X00Gjiy6aFlqin8BHv+D8633M8LNtMOphpaz0xkHJPzI4VRNuHExStLvTar1oWEFcET gS+lTyNjla+vbyi2P/ga2edo+TOcU1Y= X-MC-Unique: FpnqCMTPMZmHPKWNBVzrfw-1 X-Mimecast-MFC-AGG-ID: FpnqCMTPMZmHPKWNBVzrfw_1788552095 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:38 +0400 Subject: [PATCH v4 55/75] 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: <20260904-qom-qapi-v4-55-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLLP+f9GafZKR1ao5Sv0BgTE52RY5mlKdPWe 9h9+l/k45WJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiywAKCRDa6OEJdZac 5Sb5D/95sy6pafzrGAwGNqvlyK9pMBU/oOgN3w1+IEpDXJz+wReGvLEJ812NgRz86RwO+ddWUBe 48d4Goy3aX6u7XMtz4SuEpzXnCWP/M2pg4yf5hZrdDdK14zpWA8PqDduQQQuwoGUbOi9pyjn5Z2 xZmYHV/AfhWRVR7Yokjy8FnNViR7nA36xy6s5LsWtr/3XvFYn5dVQf3vfyf3+YBLIdSsulCAUN9 TBSm8HpUAOvEEUggzW57GfxzSQE77mDUTXGeTY6bV/lwmKX3P0GVj8mclbKEBgafoKOFdtzK5hX +nn37h2tSaheMAMXSaq4r8LLVSRngNuvyO9PgAL3UGmWKelx5FIWq0JxWp0DwW2sloEE2B19d38 XenTyZ5ITI4f1bHEm2LT6Ir62yuFj0ArFLinIsW6zUGVmpTe+UyX6ILW5z+e3j4AsWy29ZLR6Js LskiePSG9etDEdWPK6FFfOHphcZK5XtdNMbGTlBgdDedVV+Nd0gLndKI9qebkGwc/g6kEZITrTc an31IBO2E4a0Q4wxQtYzQ4yYX59iUfrgd8fG3RYqLn13eV2HKZY45/W0iSJthAZksoonPlcNK5r n8QhlgeD4a9t5iGGFkm4UG34suRWfHWsCy/e8VZlTGkYNxMIVtiEefaka3s+2zhrLC/zYxMVsKr 4RabuMf1jZXHF1w== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552255224154100 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 Sat Sep 26 20:00:45 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=1788552224; cv=none; d=zohomail.com; s=zohoarc; b=VXomUHB2Z72ZmhAK3mraZeCA7utctYDEaV5NPWpRGmYAyR+Ly1rpAzjzwxCwGTzr07Yhjz6Vd9JhA7SJ0JRQl15pZmocCA40SnCrBGVKQc7BGEE0fMeR1n+WSnlRNe8UQb9BmAamKlQzq59pACYm66rRgyd3AsH3q3JZt+kRUD0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552224; 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=Qp8OXg6WqobsqceU63e4Ktmtul8zcl3b3tyfZzCk3FBUHJMRlXvDAxQh747XnMSDdSdAfN/BFGaj9R8eZMYKtrXpLm/tyjpz806BoKnJu4Og4sYXjJiFrG563BztfqVNGFY4H+FeUt8zQM6megRcC7b6SwZWb71wvOvV0xVt/uY= 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 1788552224679479.96033718883973; Fri, 4 Sep 2026 13:03:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a6l-0001P0-JX; Fri, 04 Sep 2026 16:01:55 -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 1x2a6b-0000xq-FA for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01:46 -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 1x2a6Y-0008Ts-2N for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01:45 -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-557-8wSSLrBWPhyX6ShCXb1oNg-1; Fri, 04 Sep 2026 16:01:39 -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 D71511893EDF; Fri, 4 Sep 2026 20:01: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 10F1730002F5; Fri, 4 Sep 2026 20:01:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552101; 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=H0hwWyDnhkQHjM6YnQDFl3hCPlS3i69P9/wUTRWILGnR+JSr0solQy9VKlqH7B5VujYWZd rpuepCLFdJ7Hm6yzUZWYEDN5LhVHk+WRal1tZoYztHcU1eZiPwQPQCsfMkAz8SNEf+dW/r 4hpVSL0uIy0t4dR77bcdp5lxfGEabqg= X-MC-Unique: 8wSSLrBWPhyX6ShCXb1oNg-1 X-Mimecast-MFC-AGG-ID: 8wSSLrBWPhyX6ShCXb1oNg_1788552098 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:39 +0400 Subject: [PATCH v4 56/75] 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: <20260904-qom-qapi-v4-56-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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 , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , 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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLLAp2XepBpJfPqJBydZ9UAuooyUlS+gadZu T9fJMYGkJWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiywAKCRDa6OEJdZac 5bIvD/9AtGyX1ry5GsuqgOJi06DNfelPCOdLdzk9Oilst/0NGeCEI4HAWz/bjeCsqfc4Psg1tvM AKXCkqJFspZQV8tMxKzUS70gwRf04Hy3rOI/qDiegB/nyjtjfW5D2YQ1uPw7RmvUIMLHiSUfMfm NgT0x66cPjZ2JKqgRVjSNVezcfUk7wxz51O87Mq5UYvJN98jUKzF/v5xJNdSl7qzvURCBulZoHp f3bxixfQAoHRiOh5cCBWoZ2/fO2FkdHh8ChraFJIzUpuut5t63OL5xVw8TUUNB49HsXNyQN6JCh GYkBgHUGSb0G43Qw/khOI6UcnNnfgo2ksb5KG0NxZTGkFvv5PfwOW/8YTzuPGNpG8nz4oICL8cA T2EzvkGgp1NHm/4OLP+ldROvSM1BfD+gEnaFlHQWQyh9xTeFMtHvsY9zbMjmhtzzMkVxEs16W6c +iSWDnbcfxBMtTsCF6CV/AZ7sU4Iw7x+F3TXhHMk4MucWGQksBRj6RyemjyDCjjhml6B4UPnQCQ KwSmSewSQ/0e9DR4zy93f47WaWHaK1NGMSemZnks1mcnBGeYfQMJ4hOeVCh+2cMgTW0FsMJPg+n pGlgLddyz+hl/AvHfoIgj/0hH13RpSy/3+HGyEb+e2+itm/gPEiVgGAHAvK0PJcbdNB05Rt6hxy GpJaMTgCJlchLyQ== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552226491154100 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 Sat Sep 26 20:00:45 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=1788552241; cv=none; d=zohomail.com; s=zohoarc; b=bsYH920CIU04ak4UPmG2HiFSPd5Z2dmos2neQ7q0gubdsy7PpNhvXp2AIvik0igd5su6gXKwYT+FWLVRhj744DuqqexMfcC/NCD3+OAqr30GL6P5Ke+69lZINJzXDUYtYvL3Jjz4oXTYssArpE5Yn2tnv0IH7pgxnK48hcbYG2s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552241; 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=jutTEwmLwwqsawMMIV9IoszepYTPR97THMUvsdV7HBmVZazxBcu2ifiH8H1id5NMd6pdOyE5NU5sJ87zRbHh0HmKOdApLRkGmdIjFt4wstUeAYsX1UQvcCTXoqeOdPGfenBltVGg+LclcJuTcqAGJsX/vsoLpjsUUdYq0SMlayA= 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 1788552241308308.74444012793674; Fri, 4 Sep 2026 13:04:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a6m-0001bP-To; Fri, 04 Sep 2026 16:01:57 -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 1x2a6f-00011E-MH for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01:50 -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 1x2a6d-0008Vq-A4 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01:49 -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-627-6aozs-zTPCGR6zY2a3Tb7g-1; Fri, 04 Sep 2026 16:01:43 -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 D9DEC19091F0; Fri, 4 Sep 2026 20:01:41 +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 CD70A1800641; Fri, 4 Sep 2026 20:01:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552106; 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=S9CaR0nHgfEgGP+CNFg6InTk3GlSXSToOEecI8DriusVLpWktQNkB/RAJTBKN9WeNT5TCL isK+A/Xjyjp44nOs94z8KtmLo6ZVBjG6/b7kSu9wDp3eMOcVsUpxnzSL3Fnk6eSJb/ha9T Ass0PxwYtN/nzY22SupwFq3be/gtABQ= X-MC-Unique: 6aozs-zTPCGR6zY2a3Tb7g-1 X-Mimecast-MFC-AGG-ID: 6aozs-zTPCGR6zY2a3Tb7g_1788552102 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:40 +0400 Subject: [PATCH v4 57/75] include: add QEMU_REPEAT helper macro MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260904-qom-qapi-v4-57-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLLs3TFoQc+S1P2SjUmG3epX/4GVf+GJ/nCx bEz2OFB3rSJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiywAKCRDa6OEJdZac 5QPoD/wIH+SUgoKMu9UwFjY+P5SjH3odo7pduJLtODqpTRBA9HshfbdMjjms/WXXmESeCqOuZJp VqHnRmXFFPoSdyxv2roiuAXGt95QCnNvXTsS6na8Al6RAcSjmjoS2gAq2sKyqkUizrJKEL9ivxo RAeeao/r0RTYe1hgu6KC5GlKOdYsvUCq5FuEhg1FKfQxGX2tnMDwAtsDZDnBQx31GPWQjKDAWvj I3bUJdS1MSf0mswUj7+ANUQhaJNjLH4DYvOW1U6f/dl4UXPpjDg8j55HGiBjEpVGXZKXJilKG/F MqsxoeYcmm7longgtjntTB/7GeYItquBerqVVHfDNtoBcBN/++nWa+sN8yiNAQR88sSjLqi4Hsc 5w4XO0FYnX7r7Koo85OeTDt1vEU4AkGQZrkGqBEHdZQ3LCWChOQKlFRRcTkDV3NA5LfIhrXWeDE zX1R5ufU2oQDU9QgoejcSdteWr9JR5YjxEw2auq5pAZuTZ7k0o6i5LRpZyXRZkW6i2Zp5KaN8qW DumpUxldYGVJeh9oWtGqsiWjBg2Fbu49f1iht0Wq0kLmLRQR0STIhN9GXZjE3jXH/t2XnInB7jp +0jPJeBhIOY0ELAEWgoXjEH8xmX19sK8eOs9xCS1wGkwhJstPGLaxAzhnA8trbFAgGX6MPKF152 dTXf6oLZBHzSzNA== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552242635154100 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 Sat Sep 26 20:00:45 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=1788552206; cv=none; d=zohomail.com; s=zohoarc; b=Kvvd8Wf9c5nmHUzbLidP8M3XntN6OiFuWAW761I5nm5FLKVAapLSXzfCVIu2ekEdin7MsvNQY5kLuAucPq8gNB2CGkNapo88U9tgQ6qbGw+ckjBq9w9hmbnNc1+SbVwr64icu9hzqNzP5ZXSVmNmOFzM/dDzcneVtxZeO+3RUkE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552206; 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=fdwmZPUqAoHgdpQqztbGQZSYMf3AfEAhC2BkqepQnHnkEfO4KfluDw9uj+9Ow8xV1WhsP3FIyhyftM4m0omQY1QIr8Wdq061ULIJdCdpEhcwhV0Eq+H8KJYPk6IkTz9M1mW+dIO3PJ5q6kWaov54RXnAjpqHr/uKYUQB3+7I0F4= 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 17885522061801018.139098411051; Fri, 4 Sep 2026 13:03:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a6n-0001gY-F6; Fri, 04 Sep 2026 16:01:57 -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 1x2a6j-0001G6-IX for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01: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 1x2a6g-00004z-V6 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01:53 -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-336-QvNQvGXZMPm2e79Rcq-uew-1; Fri, 04 Sep 2026 16:01:47 -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 93BE018D634B; Fri, 4 Sep 2026 20:01:45 +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 84D2D1955F05; Fri, 4 Sep 2026 20:01:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552110; 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=OmQP799vpQWZ7EX5vPEWu+brEvvKn75yhkG5ekb1ycE5M+SoewzrF8Jka5w2dylGx0MHuu DCNfrrZCe9JKnCUwqg50VQod+BhANroWjct3ykvFVAF2OAMDjxLwSFTcS3twA5tJWPqVWR jfU85/QVu93YPv88RZYRmCwuavVEowo= X-MC-Unique: QvNQvGXZMPm2e79Rcq-uew-1 X-Mimecast-MFC-AGG-ID: QvNQvGXZMPm2e79Rcq-uew_1788552105 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:41 +0400 Subject: [PATCH v4 58/75] 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: <20260904-qom-qapi-v4-58-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLLBLiY47yzf9MgHDJhfVpweB+rsjgX0rs7d 7IUv5rnT/2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiywAKCRDa6OEJdZac 5QZcEACAQA1UoFJ9qJQaFFyW8lVQqIkyOwaYMB5sNJkIA3TN9lfoQ036bf4zh78Vi/jGHxR9R2c i96XNr0f7Ak7WZtqQdp6N44dGICqUpK3QT/DPilXdDvQYpwJFfizr8fwHSMP1QrkiTNBH25KRgx BR17phrycNgszjglLTM6oE4d2xI2I3kVpj6KYdz4SWIxsTabqyH/O9eoR/NlmqgSZlbgkaORgJ3 OR7QXP27ZEKcn2zPPlkY2p/Kz3dL1nsiYSFNYJYkaE4lLzNSjXZpBACDTIddNCgo+uAxNOtaYnk RPCZ8HAptKhaVZJswAoE48IectJ619f6nO0ELwIH7hlPRbvujvAuR0J90Dc9jawEWTM8H682uz2 jto65FQqGtfYS8zRAXLTODyENSPPxGAh9DDLKEflNMfWDHroLQKkSHyUgjR82sSbTT8psiBsVTv eWRReQPhYvRbm2JioKkX+utQMCb/TCT7YBUhervFhxNYs4qI2cS12xGwY7X3vJ3jT0Gx8j1Mkmh 6SgsDwkdcM5vZ1MQYXKWn26Q+0x+zneZwoD+E6jlr3CVTWGu4WS6Qbx1JH1jy5TSQmzVoWFgvZA cmFV7BSFrHr0d1njpX8fQDECaBoVwOQCB0S6/qKLu7+Sz0/wRTKTZ95ymAm25ZDe995nK7EB3OS UrspPPTH9yPOpRw== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552208253154100 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 Sat Sep 26 20:00:45 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=1788552206; cv=none; d=zohomail.com; s=zohoarc; b=ZwSuVLrqxnVjHKLGj0BtCiUQEbsD5wNUuHYdLFR/hTVL10cN/Y6NrsgHl+eeHm0FB9w8ODA21ZDpCGmOk6fw8bASTeQWDENvwxUimSpfd7+EAFjeFO/d/N6UHYGu0yMfLipUMKtlUddLvfOnij6BeDZ4d1VPskfjBJPzf/jm43w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552206; 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=JF8h3ORZNfEB8i4Tjr4bqZSkhDQQB1gVmeetkO2W1xk=; b=j9xzLTVN0kjYu2wDlgnMZVPQ8cy09ImuQeZIf3CungaIPhp+RnNj6tkiI5u3vMqocoeyvmEAlLAY6+YLYOAiFs3nYuYlExd8sWhqkbrq5rhAjtJTsR2NQnKxx9kRH8JCyZv5SovWaY0SNS97L4xZQeEI6jlBLoUzCSirRH4hrjE= 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 1788552206409398.20484929297857; Fri, 4 Sep 2026 13:03:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a6s-0002G1-Du; Fri, 04 Sep 2026 16:02:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2a6q-00024R-6w for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2a6o-00005r-GQ for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01:59 -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-447-k72EVum8NfW3uamze0MXXg-1; Fri, 04 Sep 2026 16:01:51 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9B46818D727D; Fri, 4 Sep 2026 20:01:49 +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 6C0E6423; Fri, 4 Sep 2026 20:01:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552117; 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=JF8h3ORZNfEB8i4Tjr4bqZSkhDQQB1gVmeetkO2W1xk=; b=gtsNDXs2bgALh2CXxaemqlW88aEj5UBZy59xgV8VrNElCwBtSPUUb18wwm89fNcmzCniRm lriYUy+BoizNPBctV+LDwuCvLmduvHE8rubNj42J5bxgxy0x4moDTMkOo5hF7iNuSQ1Uw/ OMP1M32YZh1F55op1QcZ9tn3P48SrM0= X-MC-Unique: k72EVum8NfW3uamze0MXXg-1 X-Mimecast-MFC-AGG-ID: k72EVum8NfW3uamze0MXXg_1788552109 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:42 +0400 Subject: [PATCH v4 59/75] 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: <20260904-qom-qapi-v4-59-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=um8mwQpkF7gZqlVS3nLmWf6c8kRhu74W62ZkPTk7ysE=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLLaGBoapSkIEiZawcVfQmtavJgxiCtKr8jA yc7WwK8rFKJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiywAKCRDa6OEJdZac 5Y0FD/4mxFEByFIbjaHjV6QRqhnfKMeMPV79GrYHz3HqV+jABpLPFk0wuu+ULxW4weB7iVH9I4p /xqJDYwN5fKdpTB4HnvQNbRk+fJYSyogpUSmZb5FGpWfrL8yzHKE0fycsOSbZh8if/U/PXUsjRr z/4bNZEtPpfc+LvwaqyJRarliFnAJHfmgmE8wry6oGJ2poJvbiRYuU8jz9qqXf4XvbOLSyoCgjC Vm6pdckuuJykCjREPS3gaqnOqfyvvbmZcwjns2BrN7L7PKjzH10qtnE/a9ZUY32XdLeUhMlp8Hn 7UQhIPidLJRn160iWazxFfSVnnHWYmumrE6oYynXHRuRUN0/SRJgCfrj+Nngz9bTA6hMQM9T/p1 IuNraGP+QrD//dFbT4/M573z560YXmclEKuKCox52qOsEUOgekkJq1yt+xNfbbimY8GOkKZ9P3i bxWuNKFLIjc1pLAfQ1lDH7hkiSvcUbSJzU/0GGNgqDoEah+e5rb+DAaBFv/FbytWTtJ3qOo6GE0 y7c8Ju7HLghckd1/O7eoaf+vU2DZItWHsm5LHGxfZaWrR0t4LEfCXpdEAgMRPBv4vfppgzZ3Eeg uf/fzyMCU9ghyG4CqTxBLiqBwajMtFycafLjZQ7ZTnqitBKKdgLdZGgh8YgAe98QIm78cclvNYQ l8kqcwOnCPYpgyw== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552208183154100 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 c15f2b9f084a..af6e1d440c37 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -80,7 +80,7 @@ static void prop_pci_busnr_get(Object *obj, Visitor *v, c= onst char *name, } =20 static const PropertyInfo prop_pci_busnr =3D { - .type =3D "busnr", + .type =3D "uint8", .get =3D prop_pci_busnr_get, }; =20 --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Sat Sep 26 20:00:45 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=1788552166; cv=none; d=zohomail.com; s=zohoarc; b=QqDbun0+7FzIlk6ydAJOAIntv31pa8dE2iIerXW1uaf4JVfV5bwDR5j2i3hkGtJK1P50QOvIpf0fEqnoSKoNvc7Y8rQRDYSUZNIK5wm7irXrclfuvm04R2rCaoD9x9ctjIEUpI+4oPyVZJlDIoKv3Z8Kqq7+aex3u6dVTvclwj0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552166; 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=hB0AySssU/HRc2RtQEJUNkkS3gKY7w6yEcV0g8DkDyF6e9wX5YGbPZl42QHWn1Xz7l8TTqxUEiajfBoGuTN2Rg5PJGd0OK2OG+GgJ34si9b31yqVoiU8rTOkDU9aXs3Rd895uWcaRDpGi+e7QzqsSzlV0OYnbN2F8kQKMR01ErY= 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 1788552166616105.70750324160736; Fri, 4 Sep 2026 13:02:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a6r-0002Ek-UK; Fri, 04 Sep 2026 16:02:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2a6p-00020C-Re for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01: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 1x2a6n-00005i-QV for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:01: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-187-ZroAoxHDP2akBDOp8juxqg-1; Fri, 04 Sep 2026 16:01:54 -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 D98B219539AF; Fri, 4 Sep 2026 20:01:52 +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 D75641955D67; Fri, 4 Sep 2026 20:01:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552117; 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=V1jMjEujZ1fAcAT4xHxDAh+98j0jj6mPMeh33zvud4JeQT6rEUUFSNAAAiPaevNXyBg2Z8 wFUDIQ8y20j2nZEZ3pdgxgS3WobI1eokowyHWH06MiucoXFSA/Z0RnjewK5Thf1iRAzqCa 9zPIyc50RyR6mQnNSHPdjefKJ+hrzZ4= X-MC-Unique: ZroAoxHDP2akBDOp8juxqg-1 X-Mimecast-MFC-AGG-ID: ZroAoxHDP2akBDOp8juxqg_1788552113 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:43 +0400 Subject: [PATCH v4 60/75] 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: <20260904-qom-qapi-v4-60-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLL2X51JapQvlv1cvkPlIRBVKnp0IuPNeVx/ m1a7d0oCKaJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiywAKCRDa6OEJdZac 5RRkEAC0LYCthYbuoZ2gp56TVm6D/bCWPsEPWDZAFILciYrJ7r5iLq1eOgrMQ+AtjjFYrYMjje8 7P08Q5GwWrqGR/LqEa1Lzn34T5B7s/a64qPZzZE2FekmoZAuKOX4k8aOeIFohy38IfUzNioH3Do hD+vYnnHj+Pfwbz4rwGbW1uJm+r6vVl9N6p2CcMB5OGoFyJMnz+i6PJFmiIdQf907ERpKaKsR60 uSxss9iATeBEm7J4Bzu0tPsChAGxScyu4BiPOnpvTj19PVA4anI7N1KI1T73EjzK7kRVVEDGCki wITs8VCJ2CFpZVnFkB4hMfI4LNPvaqBXytF50ABMJJqz08d2sMbzmLat8rynTsM84UWmRejbwF2 a4ErPVJ90h5/t608q+dLMXr6aBtvFvrd+R83zfGYfBKI2ty5i718fFr1ZX7bG8MOvCbvMJHluBL qHelECyon+MLcMME6C5mfmgnoSNTu5jFJpl5GLQKM/l/TE0vMHIq195IBPMPrrMa6v/FFZrX6+l y5yJTR1YCpFMPWiy6Fa7/KgiW5qseWUNCtSlefHRp+ORLiE8LQY+ET68WczbcuvVA0jXh5xeeuc zBvUkXOvQZg6VSSKlit5mZnh/QP0XJ2BpRIv99sKAOaMzt9xSGYiroSGqkLG/3TVxDoU1jV87no 0jGKCF2CBlr69Fw== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552167773154100 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 Sat Sep 26 20:00:45 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=1788552212; cv=none; d=zohomail.com; s=zohoarc; b=mUnJ0yLSsFYH+ghFdH4OnNx+ZxmytgsM80MclZW+GEyMqLRqRxBkvjdSCg985q6BVWZXXkIvU7t9tEQZlCg+woCZwBp8nOALbtNBcAwP8/5ZIsYv83ton42+KzSv/aXfaH0NbCqSK8kVPvm2Mue6sUf7UIvBBl67byowdZkv1KE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552212; 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=KRrciB7vmqP8wEdnX+p0IzdmW2eaBSCi/O6E/X55dKlGAY8uuSnpX092i95+lVP7SlpOTlfgmplhRi2m5c2G9TvZkM/MGo3uoh6YrEa6VGRRW+xmBrqNLJuTqw5xP+lwxYGVAqYB0RuSCWoQ2NOU+SqwKccW/09RPVyD+tWxuUs= 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 1788552212806249.70531728030062; Fri, 4 Sep 2026 13:03:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a6x-0002z6-5v; Fri, 04 Sep 2026 16:02: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 1x2a6u-0002bN-5d for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02:04 -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 1x2a6r-00006U-UZ for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02: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-618-oG_2gKlxOgSM1344dDVQrQ-1; Fri, 04 Sep 2026 16:01:57 -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 6C9121893EC1; Fri, 4 Sep 2026 20:01: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 A0B0E1800765; Fri, 4 Sep 2026 20:01:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552121; 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=dPhcRL6RRd2CJJqrPFg9kezi2Onk5Bk3hX0ULuC291sLSXFca7LXKL5ynkNgve7XPdfEuV SiIx3wQI1zgILOJqyv4LB/oANX62EMZ5OnnH8pGr2PeI03OY+nS/6N6qWZnrAeKCZF3i0q YaCw/CC7QSJxHtOyo07jUfReMwrjNys= X-MC-Unique: oG_2gKlxOgSM1344dDVQrQ-1 X-Mimecast-MFC-AGG-ID: oG_2gKlxOgSM1344dDVQrQ_1788552116 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:44 +0400 Subject: [PATCH v4 61/75] 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: <20260904-qom-qapi-v4-61-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=kA0DAAoB2ujhCXWWnOUByyZiAGqbIsuh7Ju5muX9ldCS5SZAMeY/5SkkNa6XnOG7nu1RgZbmk 4kCMwQAAQoAHRYhBIepvZM/h8YG0nb2Ldro4Ql1lpzlBQJqmyLLAAoJENro4Ql1lpzl5oQQAK3h KG2kTBvHbhD3c/kvJW9tW1X9icv8U/hGXXMrAYfYOYTZP7xWrOgz3g3jTfGBL4FnazNQsyz8nSN WGetZgMrzcgxELrHpO4+cUj1qw5VJeGSlOeeHbqxr4Yo0OPgy56kmOK+/PGbyVYV3BF2GSRSqEa 29Or8hK7HAWSyLgWzKs2GURQda1EzwRCNDkJUYTEkFlMVLq0SikTH3Op214g5FyInY5XxCWQA7z IrxP4v8oVxdZh8D2dZ5FIcMinF594dDJVwYFctuhWo0yMhry83aUQzYOTN+/uTYnqZq3KssfpAI Ucc1ZlFy9ALGziZcM0pwDsp5dAcgI0wvT1gfNW+Ncs+CE42iODCy4RZD933YzX5o4JgnpkWI0pr tGtZXmatDjgl/9tt76GJfaFr1B8tcsGClJ9i2TSeNpiHqjjo5VJsktGpgtjNuP6ybIPxmBFoOzk hFFuaKOjEyGxllDaSFGv8WpHGwLWKC2AAK6J4iXc8k6Tg9MHPi4Wk4mQwAHeOV5eZBUubT4Sph3 AynZrRGGjR6haTtAxFPZMrhzreduT9OhTrvSOVY9XCp836TFgYg2S8NJad4iVdx33ajfZR+ykwA EXu/SvXH5sVf7iaLVhD/wSP+dBUSCUamWcCOrKYDengxB72Q1NARln3PG9lolv/xhG5umxtNuzP +daTy 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552214358154100 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 Sat Sep 26 20:00:45 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=1788552222; cv=none; d=zohomail.com; s=zohoarc; b=Mz4fCOOTZ0fzglEKuppad+C/mcoO9YqdbRbw27amv48TWL4dUYC0gqSbz7tRCLGQ3HC16maKsJwaR1QlnW5qkmhht+/jezJ2A9wLBOcYiNn8ye1oqril0qigoQl6d331QV2DeQ1XD0Lqq4JnTXVq3hS3yWT18V33wqM2CjhI2QM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552222; 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=Ol8JNhQ7DRLXsAeMM8DYkClB+zuJhxQUvY+tbgNJ2L7gS9mpNeBquPb3crriFpNKrCReioWcGkhC8rBL/XSrtHSTgkzVRs6iO8op2BhK1vLiBxLDbDDVUbkmqfOzS+k3vIvUSacXzkzdBdnkK64quFApjRvG/1e9Fb6zk64fdQA= 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 1788552222399672.0067226241127; Fri, 4 Sep 2026 13:03:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a6y-00037w-BE; Fri, 04 Sep 2026 16:02:08 -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 1x2a6u-0002hR-VS for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02: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 1x2a6t-00006a-5W for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02:04 -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-457-EY1sutotOGOjZ9DS4LogVA-1; Fri, 04 Sep 2026 16:02:00 -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 A17A518D726A; Fri, 4 Sep 2026 20:01:59 +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 D34791955F03; Fri, 4 Sep 2026 20:01:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552122; 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=WwDkBdksp7kO/d/BOsRfmbkQQz05I18K3RVC9hZ6/MjwT+4k7CivSmigVbDUqYb/uZObUL FW6kbtYlhWCSlN2pGD4DNi6WQeobiQTujaI0wYlYNlxf69Yp85COfHNlqRfQ9nGWzVWRnM VBfHTkH7I0Q/rWRg0KiZoPYMWgqyNkU= X-MC-Unique: EY1sutotOGOjZ9DS4LogVA-1 X-Mimecast-MFC-AGG-ID: EY1sutotOGOjZ9DS4LogVA_1788552119 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:45 +0400 Subject: [PATCH v4 62/75] qdev: adjust PciDevfn declared type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260904-qom-qapi-v4-62-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLLWbPAS23pVMbSlH+dXWiydT0u71JJQ5Ex4 nYSo1iSHkqJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiywAKCRDa6OEJdZac 5fXqEACWwM53Bs6YUYaFbbWmDiswK3O0Ju31yjBhsWD6/hgMwCUa4c6WOqcI3OKy+E3e91iKIKC W8RQUsvVAJahh3pG+Tu/wYNvbFK+qwqyRIk7tLNrxxZQcPUpIx6s0Z4B/oeOFb35Yz7/4DV06lx aKamAm1rqDWU5cpsMCVjzqFUVcjjzEcEff8WtbWMpBS/0hp17kmfHYjYQTI1xjPbpL15rau0Il0 D7/7ZCh5U2jIukSYVqvycJiLiNvQ4aT/Dq08Vd21R1PEpcDCx+/tgE7fhwJSWoTpPxe/YT8NlsD +e5JPzfhLFEg5mnnqAvnth9DueoAAJb8QeHFS++C/ONURWssxnHiI7Z1GFsuBonHouMGWVwnGWR Yc5cNU0FS4KLVd7HpMOkb4/7VO+dwYdiBTKurLExa9VFWI89hgpIWhiG41S2a6UELVw9AWLWkGz FyHi6Jn5NQzSlmofq+uxK6hlLutpdqS53JI4g4hZkHDcpZQYNVepfDoTmGM5vQG64DBkYznIqyB WWv0FR+2UYsIN417ElcVqeEeXcE1yUMhXAsISU2vQd94eHgwk26dwEO5qzK+DSb+QQpG8GebUGW RYRkQVyIHMEf0R7a8VQuMaYICmG49hJKfchR5Cb6F7uYNC80bJcBiDqTDPxLYh+avY+pvJB69mY bA/9Ro+jkXHEPCw== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552224375154100 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 Sat Sep 26 20:00:45 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=1788552257; cv=none; d=zohomail.com; s=zohoarc; b=nUrZ44UT7alrE423PxU4UkujkODzmeY00Jk7O1XbtADnsQ1kFKzArpZwfB2atUT6iYTdgV74dTv/NR4+2Yom5qN33gTulQMWLOURVv0RhHcoseo3QkFYz8GtOXew12aMuNWedgpEyNJUtLbshUJBj9oDXlpxTQo7KINIL8Dgsjs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552257; 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=C7x9mBsjP4GuO6Kd40VIxr1W5EGVx5Jasbk5lhf2qGr9kq1tsOnDcJ++fR0NmxkE7qN2Y0Y4JDl8JDhucvV4LvlMxQ3iLmkJY+hLkWm8nJGlH90avRI4/4/+S9eb8fdrWO4vRi6GntK8XbISxyYiznBd0GTPfSyAJj4ixP0o8ns= 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 1788552257158320.82137782118025; Fri, 4 Sep 2026 13:04:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a75-0003u5-9Y; Fri, 04 Sep 2026 16:02: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 1x2a72-0003dG-Nx for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02: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 1x2a6z-00007X-Sq for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02: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-672-3XSkPU6SNmC-G5vFCJ9bfQ-1; Fri, 04 Sep 2026 16:02:05 -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 D977318D636F; Fri, 4 Sep 2026 20:02:03 +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 A8AF61955F0D; Fri, 4 Sep 2026 20:02:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552129; 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=Kr6qBoUBRwkWmQth6omNsOkPpBTvulY9kM4NdoqIjhRAsDBt1qGPVckHdTZqNJBxKJOGBz Wm0bktrNlgUETw9WJfpT1NVd+kAleZjwt8mcsADG5f7Xk8AC024625lF7FfKCOZvtx3/v1 SUkWHYmwu1wq62/5XGmAZU7hQT9d0Bs= X-MC-Unique: 3XSkPU6SNmC-G5vFCJ9bfQ-1 X-Mimecast-MFC-AGG-ID: 3XSkPU6SNmC-G5vFCJ9bfQ_1788552124 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:46 +0400 Subject: [PATCH v4 63/75] 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: <20260904-qom-qapi-v4-63-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLLiisg+0wjT3vmTLJe4/qc0Ls6ARydrk8pi r1jv7liaueJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiywAKCRDa6OEJdZac 5ahTD/454bJJp5Iz+m/kgVp2XG2qYGf+YpIRIA0EJxOWNm8pDhMxZR6/Na2JfgaVz0tAgPowfOG 1J2LjJGqf3NDlGzmI1Y4NV4eTpXkZhdSyyZ0oBrWwRCl3rsw8Ne0+CICc7mXCM0y8wzpR9HDHa4 QDUSrX5yNwjNZ/jW1ZB9BtqfJyi7GYIb9qNe5LuRamdFlZDCkXzqaFR/YL0NmqrmT5LgRGn9Kd5 LT/rYGVO/O5DMFRNK9KW7ZDblm8aYeVLfuwO++v7GjrroL+CXVsU9vwSTAX6MKYadNlhfdJ4skD 4+LTPV2XUfLWPHJt9gWXFo4MNsFXF3EhIbetipUoFlSLsQZSiyyip31LF2lO29Du1Hti/tRq7YI DLX9QIpKQMPtsGTuWJuELmYjbfCdKp91COenZX+XAxJwONTa32n2sWO0YdUMk7Vsloxmi6vp1az /bSIaWGZcfghTU3mLcdquafzrQftQeVNH8Q0v/HwjF6KLiIXxOvfGJedLq/b98WoWRWH1W1+Y4w sO4AtT+HRjaF2l8xtjkDfyFz8WHibpBQbL1NUR9ghhhRUxiDEbCV5Q2E+2ystBFdMtnKfao1CX8 aWuxhJxsq0x4g+rY3LqK9NpYPd5+sl/FgCvNreVtJYVPEe+ZMYi07YpYUTXVjlFULahGF6o9/g9 8bKPZrLjQwDnpPg== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552259028154100 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 Sat Sep 26 20:00:45 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=1788552155; cv=none; d=zohomail.com; s=zohoarc; b=CEXRqFwIinQts8RTE2eRCfEOdD0tz2oHd+d1vWrf3mu1/Ct8DdHhKeeXw5eQXrWT2u1GwWdAQuBoTdLwxzkc+tY3Pu9sFd/mBo0jad25H1RcRkNpP0U0vIS29rXABrCXijDN2JD8Wm46k9wpHPiE9KRA8VHFLr8I2OVt07aUb04= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552155; 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=uDadYbb+MvTukZ4DS18E0pLdpqsEG2v4jBcqkrYw0bM=; b=Ul4nBNvZGmXiIye8xBEei4763mPLbAo+QCS8WJ6APW6XqpKycAJAtrNuVuDzMNkzePcp6VTDWfZ3G7NCcDeF/sliWXoZDMsJP4HXhOxY9T76vHomCEcgY9OVgeG2kLKguVKyMTMCchpAaPIGsWhbfqT4SNLtPfJCE8y2vr3T10o= 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 1788552155267683.6065083805498; Fri, 4 Sep 2026 13:02:35 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1409111.1641285 (Exim 4.92) (envelope-from ) id 1x2a7A-0007L1-Br; Fri, 04 Sep 2026 20:02:20 +0000 Received: by outflank-mailman (output) from mailman id 1409111.1641285; Fri, 04 Sep 2026 20:02:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x2a7A-0007Ku-81; Fri, 04 Sep 2026 20:02:20 +0000 Received: by outflank-mailman (input) for mailman id 1409111; Fri, 04 Sep 2026 20:02:18 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x2a78-0007Kk-Py for xen-devel@lists.xenproject.org; Fri, 04 Sep 2026 20:02:18 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1x2a78-00BBPW-6a for xen-devel@lists.xenproject.org; Fri, 04 Sep 2026 22:02:18 +0200 Received: from [10.42.69.5] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a9b23c5-2eae-0a2a0a5409dd-0a2a4505c458-10 for ; Fri, 04 Sep 2026 22:02:17 +0200 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a9b23c8-4cb1-0a2a45050019-aa0a857c7047-3 for ; Fri, 04 Sep 2026 22:02:17 +0200 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-416-IWU0nSy2PnWCVq_nvHCZLw-1; Fri, 04 Sep 2026 16:02:12 -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 72E3218F0F0D; Fri, 4 Sep 2026 20:02:08 +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 3B8F030002F4; Fri, 4 Sep 2026 20:02:05 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552136; 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=uDadYbb+MvTukZ4DS18E0pLdpqsEG2v4jBcqkrYw0bM=; b=T4Ql7Mol8BUUMYul3AzIbQuKeZ3trrh8pLPg1/aOaTVRTd0btosLTuV4xR3uDtom9o4tkb SIQTjgs/o8XiiA5g8p7xCwCfh9I7uDvPQ6MxzDTBQG8YTVTjEvtNz6T4e5BGKdIZ+w0fi5 0+0/p9NYomrtYIqPDXKh9btcT9MN160= X-MC-Unique: IWU0nSy2PnWCVq_nvHCZLw-1 X-Mimecast-MFC-AGG-ID: IWU0nSy2PnWCVq_nvHCZLw_1788552129 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:47 +0400 Subject: [PATCH v4 64/75] hw: convert device-local PropertyInfo definitions to use qapi_type MIME-Version: 1.0 Message-Id: <20260904-qom-qapi-v4-64-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=JMD8CHS/Ms/ZN3B00kadMDC30ZNsy393OriqSCvH/Y0=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLLxp67EFAkaEpd3WKP4FD56N94sNeVMF5/4 Rz0oJm8TwGJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiywAKCRDa6OEJdZac 5a/GEACgM37bOE7xh8937jq4gCqcIYr3R0ftgwPqG7ZfxTrH+ADF5OrXrSWlGdaYE3vZmYWeWvE Ay0/GEkzLQ27Tkp0uGZqarxstlBi1Qb1hJ+VGeCoo2oy3QVC/VzvHGUzXFuu+q+KcpsJy/vz+rm TYQNst2H8aOh69l6a5pmW6xTvfVpZ2ulbkkSicOqDf2w8/l7+32aVxr4n9Rpbi3cHyYnmprQ09i Dq3YOy/Sx/x3O3G35/3vZf2ueHVsN9yfAfe5iNfh4qHntyNkf/jrIvNIgvC/r5hGOSs0Btsgx9j 0bKDAcQL74zjzWQbkFVk4XDTaLMaw7MP88VeJ3SnPj09/EdFYfNHyTbLUYCDVSE2xYBVwLcSgm+ g9Z2ceGQGLH6dT3w1VjsnN7l8lL1EUk00XNUYgxxjqCEH7KKWY1PuZlLXV5z18ZeE6w4odwBid+ jtiAa9vRzoSygzMEVCDwKTc1t/n4RbZnaZrlge/VpCUQG7LCZ2LHUrPCgz2wKOmoBAmJlQ9vOsJ 0QZDWpWRu+TIwt8JfVw8B7j+0dlFMTQAx2kwGMUr04qkhu1KtOAi44D57OZ9zc8MA5O3tqzURsZ bHoHzseTmlAcB55HF+5b6+ssWCHSFf3vTO+2iF3KxzqWoeD400QHZKULWt4JFKYWWlPQ0MoCoab 6nmkrZqZmEuUV3A== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-MFC-PROC-ID: vdrKhz4BQZVMO8kr9NAbihcGroSXTo1hNP-nKldg_h4_1788552129 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-c201ff/1788552137-738BE2A1-17E957B4/0/0 X-purgate-type: clean X-purgate-size: 8763 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1788552156493158500 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 af6e1d440c37..89a36221bc43 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -53,6 +53,7 @@ #include "qapi/error.h" #include "qemu/cutils.h" #include "pci-internal.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #include "hw/xen/xen.h" #include "hw/i386/kvm/xen_evtchn.h" @@ -80,7 +81,7 @@ static void prop_pci_busnr_get(Object *obj, Visitor *v, c= onst char *name, } =20 static const PropertyInfo prop_pci_busnr =3D { - .type =3D "uint8", + .qapi_type =3D &uint8_type_info, .get =3D prop_pci_busnr_get, }; =20 diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c index 25c427327957..fd21a4346522 100644 --- a/hw/s390x/ccw-device.c +++ b/hw/s390x/ccw-device.c @@ -17,6 +17,7 @@ #include "qapi/visitor.h" #include "qemu/ctype.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" =20 static void ccw_device_refill_ids(CcwDevice *dev) { @@ -74,7 +75,7 @@ static void ccw_device_set_loadparm(Object *obj, Visitor = *v, } =20 const PropertyInfo ccw_loadparm =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Up to 8 chars in set of [A-Za-z0-9. ] to select" " a guest kernel", .get =3D ccw_device_get_loadparm, diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 76dbca3bb961..60cba93e7eec 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; @@ -2518,7 +2519,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, @@ -2526,7 +2527,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 Sat Sep 26 20:00:45 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=1788552221; cv=none; d=zohomail.com; s=zohoarc; b=frzoZvS7YG77W/zUMBtgK5mTbi8+gES/tcE4+sj8h2SMeMFWHvR01WnwdGWwgQ0g4qIz98CAOyLJ35kph2va33CVjGe4Vvmia+QRKfg6bzRKLwx2GQ9Lirj1n0cbXpynZ4CQfUkXJIQHt4j+AkG/xXkjA/6t4bIcOyeE4EcDynQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552221; 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=t43vVbAqt9a44+uxeyZhjiVCXGpQtyarxq5dgbrLkic=; b=QnEPlZj/OaD2rPGHFyb/tk8EtRKZOlgonf/ej/le+LDasgLqCumFXuce4CQKCptTYDqN9XcNqwUcWIyXg3QZOApp2SBC1NbGtLhsLLqXtH2+mvHYiSZIb2qqmiHkVbNaB5mCzJJRqJbg7e1ltVpteW8d5qLgNKvvW1NTGr4vkww= 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 1788552221938121.00678215301912; Fri, 4 Sep 2026 13:03:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a7E-0004iX-0x; Fri, 04 Sep 2026 16:02: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 1x2a7B-0004T8-9m for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02:21 -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 1x2a78-00008X-D5 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02: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-655-m-GKPx0sO2OwgKOSDNJIIw-1; Fri, 04 Sep 2026 16:02:14 -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 04ADB195399B; Fri, 4 Sep 2026 20:02:12 +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 240001800641; Fri, 4 Sep 2026 20:02:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552137; 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=t43vVbAqt9a44+uxeyZhjiVCXGpQtyarxq5dgbrLkic=; b=MNbroCXXRGRSMGD3O9pKC0fmc6FviVptOzQ0f4sJVdYa+lvzrEtC07Tzulv8lsk6v55aOO OqD/BTTzURL0Z6zvSsFRuvjArRAZa4QjSUfuRZNRky/jxnz1W6em7tqJkpZWpRKfT6RZlE WckdV4xDyjOBHS08Fdr6ZqJKA8kZaow= X-MC-Unique: m-GKPx0sO2OwgKOSDNJIIw-1 X-Mimecast-MFC-AGG-ID: m-GKPx0sO2OwgKOSDNJIIw_1788552132 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:48 +0400 Subject: [PATCH v4 65/75] 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: <20260904-qom-qapi-v4-65-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=YoOMy/B5EQPhqWBYY6y+EbIrpX6/2zs8Ep/p5YEq0BI=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLLP0i09YeYpDmNiYmzFmy/4uyiSUfDgpti3 ajYpXO9LSeJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiywAKCRDa6OEJdZac 5cyuD/9oLJh4GPcQRNVwM8ScGpXhfLuHjw2Ku54eAV1mZpe3B2FSiHZ7BRH5F6Blgu+eOt5EqIk ZH6ZNYgwMR5zaJKHvzGv+d8V3beG6eydH4Lqw3MYY9k8AO2jk2b15hkXJBRP4SpI9teU1DnOte8 YuOcxlVk601+7akhlYniWpy5+pqqBXjPFgNd+NvzktX0jaBZZTRdrPTuCsD2stgCezdQOdfmbsN 86J6Ch/U+zcv0he8WhQENo+XwcfJ1FXpU3Bp32Va57AnSbhbGw+iH8iImtWxn3IOifW3DSmV6A9 l320ENHQX5F12gjXu2s0tAS1WWcxc3l0gPe13x393MLWpmgCUd6AOujg25jeIw8EQc9UwYcgIt9 6MI6ZBkZpdUCR5gPFREr11Auvy8pQjfV31ocpOYTFMNwnSHmmDkirveGFuuSYI/zVk+SebK6oQb AkGJ2O406NCtKvRiaTg1ZRyFR0fesCzcScIf8wV+7HMkoJNUsvL0bB1tA+mqCyXa0GSbK4ARhQF mfZy8xPtGrEtN02WcbPWZVSEHFUJYPYbLCWHuo00uFpb4JkZn3+m/pr8Rlbpr4Efmb87A2AQM5n X+pnIXexlUaR+760m5jaj6x0dUZt+eBPR1aSa1bRWfDoe4VlBdl9z0gMyeYz6Qn8yIdeqpIyHbC QNCgIR7fGXUAHyA== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552224408154100 "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 a1faea801d1d..0f25f0c8fb5f 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1688,7 +1688,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, @@ -1724,13 +1724,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, @@ -1873,6 +1873,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 Sat Sep 26 20:00:45 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=1788552219; cv=none; d=zohomail.com; s=zohoarc; b=gJQjXdY1IPBAxXmZlgPpfdndFh+T5uqDyApls+hX9OCIgiM4CI7CCD5u6uGIzkr3pvZscgGohymSUi3G7cfs4nFcCMRsnV67CmoK61bYbzblwv/u2Ba0DKIPvzyZPkGlDu3H5fwj7Rk/GTzKPWoY44BkldEXFqg2w2ctZXehmIo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552219; 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=PJPGrbVov3kLsIeHkTM5r5PTRyzKMricfboJV7AlXjk=; b=hJXABUtOfqJPd+p/7cuF6wxXkOoMGGoWzp5+0K3NBQ5r5MuU11zUaUA0A0OZF24NkPJiz17XBxGJaLVl8kMUi4ZYS5UFv76l4Za3pQrl0ks5JNNbIpOFPjJMb7oEYG1K1cfTVyw72cBx0ArBJNouRk8QW6olMJ+jvQ3CiBTK/dg= 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 1788552219421926.5018261915725; Fri, 4 Sep 2026 13:03:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a7J-0005Fj-RQ; Fri, 04 Sep 2026 16:02: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 1x2a7H-00057V-VY for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02: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 1x2a7F-0000AS-Vu for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02: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-564-q1N_GnGKOS-agKZ9Iupl7Q-1; Fri, 04 Sep 2026 16:02:23 -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 89D0019091F0; Fri, 4 Sep 2026 20:02:15 +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 5413F1955F0D; Fri, 4 Sep 2026 20:02:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552145; 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=PJPGrbVov3kLsIeHkTM5r5PTRyzKMricfboJV7AlXjk=; b=hs/kdunB85bfEo63KZZvwTJczcX/B0a5tF7n9g+rq0uNJvo7qaTcNxmAtp2ixSzR+70cW1 s1uNzW+WyP/t6dXKp3jPALCG90/60sdCp5VQbykOVLuyiC8UPGaSYVYEEb6n1hRHv/e1v6 ZAIoLZrR7nfgSwMHUzt5XlPQ/HGrOsY= X-MC-Unique: q1N_GnGKOS-agKZ9Iupl7Q-1 X-Mimecast-MFC-AGG-ID: q1N_GnGKOS-agKZ9Iupl7Q_1788552141 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:49 +0400 Subject: [PATCH v4 66/75] 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: <20260904-qom-qapi-v4-66-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=ynlNi8WKyUARlJz5bFYO+4tq2XYJXSIvCIUhQxW5SGU=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLLSm0/uY8QUEop2ZyWv8GT4TrdifRPrjNqF dvX7rTXGTWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiywAKCRDa6OEJdZac 5R0XD/0WbjUt/szWhv8RXK02BkiGRp7fcOVAhe0VdHEme2rOYONH3C71VjdRGy9JlBS4psTYVsn wyXiJ7n8768R2Bbs6Ty6iZiJS/es8T4EjGQpBrqdZhR/cOEMKkJZA7HL1KJH8bKHtPyt5p+Av3w sRqDCGNt5ym6Lvul/s/kUaO0PbJnZg1ZhNvPn+6hmlaGwGouRFREsx9NuCKaBbozvFBnpNcGtEY a/sMXORWBgBear2OJdf7rNDg4PWdHI0GwmXhTr6DSnTS/U8BYb4KE2UHPX5htbucRyeAULGHXyh flFpbmWBw1k6XRLt7br8/jtC8HDfCLSdfMA4avtwvXUjNJ+Z/goGFHTUX2eKpdxA+nFwCGJwm1A ZY6p3xtzKG9JFN8Gwn+6lWaesnrarJnZtYgF1ZGBFk9gg+uszApiLeb4qMRYYUw5mkJeZ2YM8yd /AaDE0urGEwnPuoDDc1y+TwkqtZocXlupCNw9G1oDjergFbzvW4lDmv0MAdkWboDOvb/yHMahbd gYlO4SPIpLWsH3b4mfJ7UTUQzDi03VhufQbM7MtEE2sRIyRcBjVFbrKEEBwfLEFtg+i4h7izQnu CYdxHfxOkIV39imPdOLL3C2qUSXIoGtxCONnnec+tFWVi0nsfPiDnxyB0bzQunGEv9rrMgFlLg4 TlVizOxhbUE/2Hw== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552221970154100 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 0f25f0c8fb5f..a5282a1d0d04 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1688,7 +1688,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, @@ -1730,7 +1730,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, @@ -1762,7 +1762,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, @@ -1795,7 +1795,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, @@ -1835,7 +1835,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, @@ -1873,7 +1873,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, @@ -1949,7 +1949,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, @@ -1982,7 +1982,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, @@ -2025,7 +2025,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, @@ -2066,7 +2066,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, @@ -2102,7 +2102,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, @@ -2138,7 +2138,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, @@ -2174,7 +2174,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, @@ -2210,7 +2210,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, @@ -2246,7 +2246,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, @@ -2303,7 +2303,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 Sat Sep 26 20:00:45 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=1788552241; cv=none; d=zohomail.com; s=zohoarc; b=X1DL76U+pWqaLL/EMi+2otk7bI9O8sdTyJFEYLKmkyv+GaLmqOLCo6BQSdk9sMWUyNQ8xLjEdyJwsNwPNbaSpwpNp6L5jC41kFFgfQamQBQZYJQE1hUor1deotPKgQ4kLiDjFxs2wsM9Dl8d6RYJBsOFqKk1oK6thG7tiMkXKpI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552241; 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=PwaEdy8ZnQVC4f1U6iU1d1dziaG8puTh0bFfych/IvA=; b=XKWUZgwQSREWK1MfPffyCUWIrAvRZetVQkvW6p1PbhaUxXhA6go2YarGAERPi6HpKRsE+Ij6zFEejhm00QXLHNi/kZE60KKetrTrTU7ROlxetn3acamENVhachXdn4EXXcFAfD4zsv5bqJJ5f24Ro1Ke3DlXb/oZSh5YI5Kf2do= 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 1788552241321685.0438324043672; Fri, 4 Sep 2026 13:04:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a7H-00056W-Sm; Fri, 04 Sep 2026 16:02: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 1x2a7F-0004vJ-Th for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02: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 1x2a7D-0000A7-U2 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02: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-371-bZCr8nDCMFCqJYrN390DxQ-1; Fri, 04 Sep 2026 16:02:21 -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 19DD818E9B22; Fri, 4 Sep 2026 20:02:20 +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 883711955D8D; Fri, 4 Sep 2026 20:02:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552143; 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=PwaEdy8ZnQVC4f1U6iU1d1dziaG8puTh0bFfych/IvA=; b=BttxJ0+ew7Q1MxI3sbet2cK+1pPc2IV9bUZuRv24JGaDTqNI55t7bB1FuADdWUc/Cx+zUK sAflZAOqT9YWleUVXaGQylNv8MTniSb03S/PVWULTqnYwRdoZG0ripbcVpwkR8SzkJHgWN /+AGPDTvFFxMaMRYULjKmNTkDexMWsY= X-MC-Unique: bZCr8nDCMFCqJYrN390DxQ-1 X-Mimecast-MFC-AGG-ID: bZCr8nDCMFCqJYrN390DxQ_1788552140 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:50 +0400 Subject: [PATCH v4 67/75] 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: <20260904-qom-qapi-v4-67-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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=QHqeQMn/jmK1W7g0UftNgCE38XbzkODSG27/Of7QTCI=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLLcC2noEkslTZ18qxdtX/IsK+5YRPRQhF2M hb1YlfBC7uJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiywAKCRDa6OEJdZac 5XuwD/4wXQA5W5B7qBDq+dSo4h6s4Q2f2AnVBp1CQJvPFADpZlgOuquXaYs6katPvC3kihWt7wF LZymiim4r3/0JXRKYwDMweYw7zXQNqgtN82+DMo/FTlw6ElbUrtF17lHOsVUuP7R/3r/8PUo2dQ 1T5HclvH9pARKq4eS7reUzE513NCQh38ggfXhNJbs+2dH6MAZeBXK0LcKCZP55Y8dE2GLm6T9DF yr6O9TSJiYfrk+QwgIP3eoCTi2PnQ3TobBMLM1iIO0VNBekrnsEktAKKZhsJs8NuxvEQ+ERnzTd Xpr8arhylhPkKr1QLJvCckjp69YS5mWKUKrTOoNx/vplXkPyiQYqWA2E6Bb7qnrKFp6MrZ1O+Ym SqvGHP4Pq7wmd8wtMYgYhjXYmGqO1QULnGKRlTgd+wweN94dqioLQIur4SmEJ630kbhzv1Z/QHR RM/xdEIx/nzmpWJVyi3dqzRjY5coyCjeVdvpLKI8N6na45C7mQ+h3lGe6MEVcRh/hdxkt25bfpl hi7MK4qwzsinqfwiR0/zPHT2nNFcbi8Slg3nMsrzsIRBIyKkBriuF7e9cBt0nULRMRRjnZyz4J1 ZvdRQcj5deo7XMsGGHWsJgRVZWn/AiAanCHyJEROVirONPf8XEzEQIg6+XbHNbKfpZtLLDb5iNM 3E9WYXG0MZdHYjg== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552243150154100 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 Reviewed-by: Stefan Berger --- 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 d2575edb6cbe..78d4d4818514 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 ae9bdca9df82..d0354a4d02af 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -30,6 +30,7 @@ #include "tcg/tcg.h" #include "fpu/softfloat.h" #include "target/sparc/translate.h" +#include "qapi/qapi-builtin-type-infos.h" =20 //#define DEBUG_FEATURES =20 @@ -948,7 +949,7 @@ static void sparc_set_nwindows(Object *obj, Visitor *v,= const char *name, } =20 static const PropertyInfo qdev_prop_nwindows =3D { - .type =3D "int", + .qapi_type =3D &int_type_info, .description =3D "Number of register windows", .get =3D sparc_get_nwindows, .set =3D sparc_set_nwindows, --=20 2.55.0.543.g5ebe2ebe4ea8 From nobody Sat Sep 26 20:00:45 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=1788552198; cv=none; d=zohomail.com; s=zohoarc; b=Oxcn67AOLPHgM3TkqJNHwl9BHDa9s443PeTW4t4OE4LfvWC0GwNilzN02y0KjUMmKnlgAnSniuGLeyFc9aDeMkGIbPGPWEFiIs1ZlVuOerY3Mv8l+DOgdC6jZmCEQmspZcPjhrcAPGn4wxM5Ty2fqlD5pE+jRxVLy1KrEzbCXqw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552198; 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=gTnAPZLxzaMI/voNNfTAayTn4NBCtetLFdbj40IJHHHgLn5Wzwl5GgDZtspaW92AFNKFRcQ/Ff8nrpm4P+KDCsqFU7yoiARxnrswx8c1hlo2+P2SVQ84Qur5h9/Ld44Yk/WNEtxqTux3gNScFDxBDs85UVQwG5w6XPzCGNubfpM= 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 1788552198448218.0135598977247; Fri, 4 Sep 2026 13:03:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a7K-0005LL-Rf; Fri, 04 Sep 2026 16:02: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 1x2a7J-0005FZ-Nt for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02: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 1x2a7G-0000Ac-Lw for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02: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-518-4wj1JknoMAuTi4aKqahBbA-1; Fri, 04 Sep 2026 16:02:24 -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 8556F191F5B8; Fri, 4 Sep 2026 20:02:23 +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 5BA4C18001CE; Fri, 4 Sep 2026 20:02:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552145; 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=KPVlAGMltmNzLWyPoKsFV80YL6cNmzZIa6mUxUE0L/C8V47yKYSebgX/GqpaMjSyCdcock IibmKlrVxxjp4LY8Euf3UsZscgLRRtI/aSkggqbSiyLxzu05kpu5aDMqYOvZzOWPO9cdBz HWh8zY8h5HrW9fcPNn0jpOrx3HCEPcE= X-MC-Unique: 4wj1JknoMAuTi4aKqahBbA-1 X-Mimecast-MFC-AGG-ID: 4wj1JknoMAuTi4aKqahBbA_1788552143 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:51 +0400 Subject: [PATCH v4 68/75] qdev: introduce typed array PropertyInfos MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260904-qom-qapi-v4-68-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLLgCjSs0IqNe9IiypP87hVTy6EhQawE6WUS gILkbRnIPyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsiywAKCRDa6OEJdZac 5cKnD/sGmfEtoro7ipdwOJA1PK7DbYjpLndFlpg7SnIrDB+27LuqMDl+NLd29jAvMqrtH6zCt3i 38guxF8OhqxFYiODovwBF6FfVKeGEBDrauGLIq250vaxdkllulO+jYrPGtKqoNTjOxDjCjIogji 2XAFVsVxnl7jiS+omyuYmbq2nxSHITZHm+iH4pzK9Ag250ZFkMmeMfnaQkvPaSUin4Y1tYw19l4 ZjJXy5ko+sWa91UPfTrvQdi4fmSvTOUoU25CBG6oWikGGOkririG2s1x8YAJYuMOoF3t2lDHZLi vzlwo1e5LZcNdMiD0kl+lU6eQOBmk/e7edP534VWMmdhENbBbFU6YuaG08mnJFc4+Ma9wz2XBSJ fr+m1DPboaDtf1x2QJwVID5/a+JyQZkbBNytIUNW4QJiCpn2tA236tEdK2Iwl4KIX1SQfpAYV7U fhqc02bu8Zl9PmIttajdU5+pExPo1DXd31xQIXW/d0Eau5ln+wsnSXTUgBG+eqHY6c3IPthQ5Q5 YexYVJm3YpjSpMBEIuKYl6gNr4NjkuKb/nMdMDYywkkWZ7+u6c7BkUwkBTsekF8bquSlj6B6UuL yk1bFDv8yzJJfCCRluIqxFehLCfnIDW6P7tPf8YB/K9Q+hyxe6om96AqB77AuEZD/svVqmJ5q8N S8udf4HM4qhU2eg== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552200159154100 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 Sat Sep 26 20:00:45 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=1788552188; cv=none; d=zohomail.com; s=zohoarc; b=F8paRzOofncEx/qi2EoK1nwqhSJkIFA+ckhT10I3aLJvp4BTtyVsP0v7yHNKhLWoML5pnn4tuj71lX5/Xw7C9ZSAtGuCOMdW8MFk1gxHkkCW/7IIM7qBUljoXFC00HzAN3s5oD3Xr+NR3iXkmXW89I13AbFihr25U+Fz+fgla1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552188; 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=n6F/GF8R2eWlsVlCc5gjbhQV3ZUlR/DpLiRwedmZdmA9aGfaFmbo7CtCaLxbDUu4YhfkpdcEK7RSK/9urho4ZUVTyYy/H2c33UCuUBThHNvwws4subB5Zf+Oe6uiUaMbRjwifid+X8uXuoe11MC5xV5Z5lTRZ3dz1c3Ivf1hNB4= 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 1788552188445107.92333276653358; Fri, 4 Sep 2026 13:03:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a7h-0006TF-2i; Fri, 04 Sep 2026 16:02:55 -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 1x2a7S-0005wW-EZ for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2a7P-0000D5-FV for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02: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-631-KZnly8klOKyS-uFRWv1XsQ-1; Fri, 04 Sep 2026 16:02:31 -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 3A671191F5B8; Fri, 4 Sep 2026 20:02:28 +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 479E730002F4; Fri, 4 Sep 2026 20:02:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552154; 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=hMRBO8/yXdoFBXMorfg2aLCNNnxx/PXY6AGiqtxbk1yiuMcd5OzKYrQB4xLakdpvulCLSY dGtEIXmvPrRgslZPZI2ISDV7dRQFkNFbPCZ6AaAGDiTRpdSA19MmgqBc2PK1zruwAKU/bq EktG4aif3me8ep9JoWPiHgGzHkyBRTA= X-MC-Unique: KZnly8klOKyS-uFRWv1XsQ-1 X-Mimecast-MFC-AGG-ID: KZnly8klOKyS-uFRWv1XsQ_1788552149 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:52 +0400 Subject: [PATCH v4 69/75] 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: <20260904-qom-qapi-v4-69-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLM9ISaqb9L2IDQTdF09XZyYtjYX/EvdwrSc XjGgg8vU6iJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsizAAKCRDa6OEJdZac 5QeeD/4mofU6am5AoY2KIG1gi/PG0cNk1TH11/lzKGB18RJwaIcZ4jOQgEvutBjF/vcWToOyRRC ihZ3OpVoeCl0qmqKW67Iba8wBRp230H6l1mhguUD+sjzc92A3jOh76ulNCEBAuJxMTpDstbZtiQ 0ey1xK2EeKgoI/1GhA6U5X/zt0RIPRASIw8ZWZKdM48WYQ3pK4SiAcnL9Hbcoi+//dwqxCQLqdd ZG9064O81FE7iEiS+ah8sAWwxI8z8llHBELVxMRlmGhiFn1Ek0dXGQaJOm9ZIvwYHy8+iPubV7v Sn6C4IKU1KuM5N1gfgPDL/0EzM6vSny2SP6iCjVDOz8bov5mwqK05xcGaRgvukZvpWD1dT4TNQ9 a5HXvnxTRfgop1OBx5d4KBYlnBLSc/MCBw+1nlQjru5c3uSOpW79wlnLS2CezLaO1v2Vk5ZYb2Z Ht2vSsdM2lqtfhXRflV8BBbFVLWWhJaiCFkrbumjfcBq8vv1+CPLtAa00n1ZLrBDX9TxZf7AVdT 8IPce8dFC7nkTRPNimkWYncQHhrZKo1V8lKvSmlQbB8iefuH81GH1WSjWdmNEnxJSwa6Dop9krc LWr7JcG6mPm+CoBPORtBR3cLDw+fJ13Mft/RtPHUcqsEusMM9QZ4nJA5+7ix2reV/3QE4NizoLo NOtvoS8zKb7ddSg== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552190351154100 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 Sat Sep 26 20:00:45 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=1788552232; cv=none; d=zohomail.com; s=zohoarc; b=VSTKIvUL/CeWBoW1STsFoVN1tade1rc0Dq5whNe591pO+NYQjikiVOqQS0dFWG2npugZ/kziQIKkNFWT8+Ggmes3HehrYFvZOLmCWiJyuANdmVLM9bXPDMSFcAwo9YfiGlbmWqBDc2QHuftjWmUaoqSG1YA6VcHQtjeVN9U/evI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552232; 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=goAiQMesQjTW3aMRMrSxTZsVszpfVOQ9ZMlk/2rhSFTAW7rjpv/AlVIjusW8LgUMxRDx/i9LKHtUuHeD2gQWItR9nJEzms1DP0x7rHFDa7prSh2ToNZH9FkfdYmzgfL3m5enlNzbOwHs9m+4wQT7yx2VE/Afxkm9MJgtSNHmldQ= 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 1788552232860470.69123694895404; Fri, 4 Sep 2026 13:03:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a7t-0006cZ-Me; Fri, 04 Sep 2026 16:03: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 1x2a7U-00061r-QU for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2a7S-0000DP-19 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02:39 -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-55-UHVf062TPJuNIIQRh2mAag-1; Fri, 04 Sep 2026 16:02:32 -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 C160A18E9B1F; Fri, 4 Sep 2026 20:02:31 +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 C3C9818005B5; Fri, 4 Sep 2026 20:02:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552157; 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=F8TtXVnhaTRpVN0e6TtMMMaBhpnlojSKKTvcws1PEhHndCOEzUo/cIohribRF34ayPT6NT 71K2DY/Ms7Clm1alt4Do9hleHVtgBC+7rVx8C0RxG6f9bH/s+BYRtC3ge5IQrGMu84zgns h+hi4oC7bqOZe2MEkjdgzzB9PPYA00U= X-MC-Unique: UHVf062TPJuNIIQRh2mAag-1 X-Mimecast-MFC-AGG-ID: UHVf062TPJuNIIQRh2mAag_1788552151 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:53 +0400 Subject: [PATCH v4 70/75] 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: <20260904-qom-qapi-v4-70-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLMr+EwLnOJjiAHSzm4lrIYnyqlBb9/L0Vnl tTWOT6TUeWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsizAAKCRDa6OEJdZac 5cG4EACJzsHtimlbtQRn+yJERxc8B29iQRQA+DemmUH97j9WKahTa3/LgQ2qdb63f4IPycdrA1R TjIW+ucVRpWzfW112IWvFTnRGnA8uPu2tDyqdbdwUNj+Isv7L0z3yRWHbZqF0Ta4pXhxd7Gqaih kuvOkTM4K1cugEbMDVNl1TcYDU+WgPk3zscyiMAEBh/I50Lp1PK6kr7nf6ILF/hsIC2eWlx44Zd QpXihtxgutdKA/2JTCjiwXyZ5TqTueFlQdzRerwmCSD2AI8I8SfHCpFgvr//R01ePEQsMT+INmd HNXDNAdxdlaTV2i3J8rvHL15zfCMKOpBfryU5TY7/GPeyGnIcMoorjEONPS3J1/yFPWb1gZXgyf 2FhgL/Hpt7yoNUfkxifZgJ0pvCoxpp+o/Ejksy7LiiyX3GErhi4DMDigdzpYtHf5gne4Mky34Ao 8oOGlCA9WRRhERWxxSZ10vgRLm45EuQynnZBWGN+EGytF1P5ErwLwD8Wqdih9NBfGcFdbZrnOoh w0qSXgTCDoqeFht1+Bbkt0125W9GVkfbf0EzG2Yk4X55Qeoq1WbCRY5DaSOd7Aw6MjnZnL0zrLl cxQHER3VrOoxmDk/3GUbFszJE5w92d40MfBG1wEgGjm7gYaN5ESDwwmcV+tacB1ZVW8ycXtjF0t LgAqxesiJ8TixDw== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552236595154100 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 Sat Sep 26 20:00:45 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=1788552265; cv=none; d=zohomail.com; s=zohoarc; b=TLyD9h1AXAIsjKrs4k1NdWP5vTXM708HUaNnhc+UcwAPfY8j07L8NJQWRzBEpNO/uwjSTt04p4K5AIcu2NwFSYL/v5gFAnsLB4HPZlaw+0MR0xgfra0tZnIhMbFhPTiZdTY1i5oBWUfkpz/72LpkoFCoifCaIaTfYE28yRApoaA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552265; 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=16zsikAccAekmkNlHDOk/n8q3ix6f+yp74/a3MGeqiE=; b=W2sZje2zAb9odthMAMeMhlb9TRdbYfLkUiIsZU8F5xKcuT3F39PrJ2pdiqafdvoRMlIjF7k+2aoEVyLOfmbiNP8BUlPx8aCdpNxTYHXokBoV2xYCS4WOeDbMIxj3mLgXTI0gYwwWgZC2dXRbkgkiSl2H4ds0xlkq8XNBXL94sDg= 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 1788552265017592.8919154010363; Fri, 4 Sep 2026 13:04:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a84-00077e-3Q; Fri, 04 Sep 2026 16:03: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 1x2a7X-00069k-3z for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02: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 1x2a7V-0000Ds-Bu for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02:42 -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-519-a6KiYyppOs6AeW8x4hzkIQ-1; Fri, 04 Sep 2026 16:02:36 -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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 75A591944DE9; Fri, 4 Sep 2026 20:02:35 +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 A7F5130002F4; Fri, 4 Sep 2026 20:02:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552160; 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=16zsikAccAekmkNlHDOk/n8q3ix6f+yp74/a3MGeqiE=; b=GV8ENhQpG239a5zaRS35XmKq82+QBUp0O4u7AtcF1UhG+7DIbp/WEPQdwK46FZGZDKKgb3 72H85vDu5NY9AbzvD6oR33i+xSL1w+8G6h8YPk9i5ISnIJod0240Pv/s+3zSvEhPvNLPz9 rofqZsVnXjT2Yzv/0VhUwiZiz54u3Og= X-MC-Unique: a6KiYyppOs6AeW8x4hzkIQ-1 X-Mimecast-MFC-AGG-ID: a6KiYyppOs6AeW8x4hzkIQ_1788552155 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:54 +0400 Subject: [PATCH v4 71/75] 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: <20260904-qom-qapi-v4-71-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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 , Peter Xu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=3016; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=IsjJZSOq/U/MfHB1PwGbnjBDBup7eSiE3ULiQgoviDk=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLMFEsbbQxjZJ92nLApZY6RfL3hSirNmVxra Y485gaOo66JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsizAAKCRDa6OEJdZac 5bjLEACqAnGNDVR9U4A6Xzznxjon1JfDXR9Lsu2XjnQPbtxTo2lNaYEeVzmvSjqTDL1svrNu6rb rN8+PNJg5OmCiAKr/rRq/FE4nStPj58RKmgtu8A5z6x5/8u+8MAemdgK4csufUfHekWbw3IlvcD DFfgMF2Jv7Gd69vplKZVir+2PfQHtYfasRIf2/jQT5sWFIRMXHoMMuxBdJNLx/P+x5qZA3WU00w J1AyxcxMlWBG6qZdjCdmkReK4CwNP5dCNJgKoMgDeO+rH9J8LjUXsamRS7WtrhDLHfConj44q2M 6nort0FDAvMg4Hkk89S/jEp0tvA5AL+rtJpuEYzWJUK5jwqAddLt4ZMFIJWFgGGN+SIRHh8soY7 U52x1qZa7mJ4trAL7s1abKbo65UDl9+6Qn7pFlmi5gha4R3xC+aN4kHWVCxRwKymqlP9ts71uAX 9+lTarap73o5ex4DBINtBnLDGNdlevEX0gYYN0Ej/TSROmVdtTQkH6HB00f0nmv0F7ApDNAoz48 U9pIEcmUH+xbcUQNeLPXIX6mR8bCveTioGLt5ETJzqXZEPAzS/IG/qwkAbMFk0B0pwtHVa8PAQt aPy2Wvz/A8cuycUNdVX9JwpArIM4Gds3SbefEAFWT4eX1KmnOknnHiLZnGRrH26J4F3JcqiBNTx cwMeaPA7MKULC+g== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552267047154100 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(). Reviewed-by: Peter Xu Signed-off-by: Marc-Andr=C3=A9 Lureau --- system/memory.c | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/system/memory.c b/system/memory.c index ae768cba80bd..72ecb3115496 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 Sat Sep 26 20:00:45 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=1788552278; cv=none; d=zohomail.com; s=zohoarc; b=T7WXCFS7o9mdT34QTzpNw1Dr6VGW2p3MFaR1+edoh7kG1ptPUcYsZskjLEREYmQxzV+benC0c/uJu2FXBRk80P1fQWK2Ru/psQ5bx4hekgxaemGrQBPXybf92xcfCLk+IB5hT7Gw5HluxDxc2/cJwAyvQvRAto9iTUYzvn3o718= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552278; 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=FJf/kj5pYAtF0Sfmg1GRjxo8XAyUICYOJss5ctXd/XoJtGFscfSRRMQeiFsuXT3o0G6P64ajg84qUuzAYFGxB70q2HEyjmucLAyl3x5m5j/xjkslRdwQ4/tG0eZ1MU2GcdJiisNuFbpFwD3YOjqNAcx7COwTS8FP9A1StTreyuQ= 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 1788552278138747.7070168740522; Fri, 4 Sep 2026 13:04:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a7v-0006oS-UD; Fri, 04 Sep 2026 16:03: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 1x2a7b-0006Ky-Ok for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02:49 -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 1x2a7Z-0000Ei-Sa for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02:47 -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-253-i_pITgzUOguRRFW2HJYTxw-1; Fri, 04 Sep 2026 16:02: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 2104E188699A; Fri, 4 Sep 2026 20:02:39 +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 DA1B6423; Fri, 4 Sep 2026 20:02:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552165; 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=gDlEdl3cCqdkj+sD++2WScMh8jbHnXA+Ep7PnkR9dmpOcNz2LHqgwm3cLHDbyPSa2GtAkf LtNWQ9SqPJpm05EHUxSxJGybVNuxEz+R81K+5YbHm3op/A8xkzPItugY7gOyN7BDOuAx+5 b++NOXf2xY5e2HrPxv1fRyz5ZE6EmE4= X-MC-Unique: i_pITgzUOguRRFW2HJYTxw-1 X-Mimecast-MFC-AGG-ID: i_pITgzUOguRRFW2HJYTxw_1788552159 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:55 +0400 Subject: [PATCH v4 72/75] 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: <20260904-qom-qapi-v4-72-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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 , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , 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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLMV1UCL6xWqEU9t8e+npSGUWdm2jGxBSbSJ CBJ8va1smyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsizAAKCRDa6OEJdZac 5W4BD/wIx8zxD5Sk1Gp6YwsTmIfaU3WOGwT4KKqIzrmNcf8VmL4GfIUoHptBXzE3rZKgUfMwv3i Eo+LHtztmtaCK3TtEZsd6ii2uej25fAF9wZAqilHVzCXNNSeUzdESZsW4wOwCibwr4xEEbACaGJ kSxXvW3YgfhjMhZuRiyt+O8xRYrnoCfpTmTZloSbEPKZwxdg3gVfb2P3h4NcWEzfkFnho21rVJf Infndfp+GKfU/JUzENd74NUWIt8gejsFGSNE4EJjcSjEDHmLq1I8EGKIPn1rduXd0tq1+BUDLe5 OLZcYdKi+ZE0xmZT74zwp+iMY/1QfetKOYHjXXmQMT1KVzienMnmgOdswc0M2XLEHTcWLKkzcl4 6e2pHWVbmoZ/5B4Zy28/gMopXSNkduvN7bAWbVXB95ExgBCfIWml6NRBvBpB0bUht07UrJO3KbP cDPUcdIRVAU/Act5lDhRJ54K3Xwpff+D/tqLI/sr3uxiOIDAeZ1X4Ta2FIV5BG/YhnMVz8cimNe rhwYc6I9uep84kzxZXVpcOS9rPj0pAsBeGsTDS7bVS9LL6C+EZFPqiKAauF4cXW/WooEIEiXiXP YjCKA5Zr2FdPkunAYiHzP7mfLEIHPD/ZmvrScA1tV+x4iKj1A2Tfxt9VwaydMy8OlKpdsQNRj+S zwLAYAe7CcFs6WA== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552281268154100 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 Sat Sep 26 20:00:45 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=1788552277; cv=none; d=zohomail.com; s=zohoarc; b=I1a+9b3h8IDA5y5qoWWVhDPEZknNAJdfW9Q1KgalWMzXnIfC7PtavDJIRKGv6g5bBaILBflSkJ1gJS8kbgLZz51jdn7ErFF9OWfhSh+njzWnNPFKNJLAndnFsV6HcNW2fFqvHT2gnjWpUDlTtvJLO0OrHh/Ef46c3UET2SJVHZU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552277; 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=WeVOBHQkCvC0XwLo7TG2qrvX/rqsXNC28uR/Ps0fpcg=; b=Yfvgv7NSNJPH74LMmtwjKlt5PDgwCrHfmW9q3hUvGflA82d38rqDPLMPFWCngtZRJFXLUlW4S+EWXAYnO73D0WlRu8tYU8nOsszR54fZq85vCFUbVDoL84j2k7U4sOiE4T0rTiOR1dkkqYtYAEju3vRuO7LYGOGAh1CJr47UShU= 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 178855227738783.220893803541; Fri, 4 Sep 2026 13:04:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a84-00077L-1K; Fri, 04 Sep 2026 16:03: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 1x2a7b-0006Jw-KP for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02:47 -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 1x2a7Z-0000Eg-SA for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02:47 -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-470-6iJUCVLEPHejkBON8lL7rg-1; Fri, 04 Sep 2026 16:02:44 -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 A988C19540D6; Fri, 4 Sep 2026 20:02:42 +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 CEEE018005B9; Fri, 4 Sep 2026 20:02:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552165; 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=WeVOBHQkCvC0XwLo7TG2qrvX/rqsXNC28uR/Ps0fpcg=; b=Sp32joEb2gzd0UlV2wS0vIqZRsZQidV7ita48TixDB5kPapexFv9o4jsQ232bTRz+FhXcI y1MNRp0afodrfQU2rwfB9YPwY02HgZA4b2AMYlcZwDCJFoKgp72gOH8H2iKzCUMktrfNdc wO49A+rFtvHgLi8cqSbNGi6C3sCCs70= X-MC-Unique: 6iJUCVLEPHejkBON8lL7rg-1 X-Mimecast-MFC-AGG-ID: 6iJUCVLEPHejkBON8lL7rg_1788552162 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:56 +0400 Subject: [PATCH v4 73/75] 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: <20260904-qom-qapi-v4-73-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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?= , Zhao Liu X-Developer-Signature: v=1; a=openpgp-sha256; l=4675; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=mCUaQP+PMbwio8wO+Fb5G23JdGsVTJ0kQ84RxKYhKgs=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLMIf4xwlEcjyNza5w+kxzrSIl7Dt/P8TdqH +UZpKlAIs2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsizAAKCRDa6OEJdZac 5YeNEACtWCMHZuqN+ozRRIFcXYbhRx+sZztN1VwM6xj3CSYNM56ooigH+PYQfUa4NFYqPMtXjWg E4SFyRS9mfeEn8d/oRlPP3nAwbRjw82x2/WHp6HnL47ieSOBsr8nwC1KIgHIbTO86uxuXcw3iyQ 7P0uY8aj0IqKht+CdByEAlbcbylhvC32VXwA9usecFFidlTNAFL8IEEarhN0wRoJiLtFBGetQME 6ELATbirkCnzU0UNiZ/Il3z99aNHBhRCTHVQTfvwlOQgbeM92mShgCvZ4rouvKqMmAitopPJI2J xVQaDZLYysFgS2RUAz1+DPNKtuYXAoScv3aOiR3UhDPapQWWs9scONu9B14Q5/TSErDnegE+p/i vn15IUvANh3aGmQ+hgceN7qLwfwpyHPs+EadlQdVq1q5DrmsRBjlvwm2K32uLu8SxCufHrUDYe0 E8tRRudABr75OGRzzyunv+nLkgPVt6MJsxH2YmB9UkLF8Ujd29mpHR1oo6JlkvDwebFAltefon2 r0abvFTyxT8FfqBLXb5G7QY9o5nHwjI51Np6klOYDocYPvdIzklbOqPG1aOOAo4K41Dv/0w2FGL 7KJceW/VmtMLgLyjLT6auCbYIrkfnPnhdqHrsqr/SgplQJKLG9pMBHItqT46K3iZk4BQofEOKo5 Axl9csvZnM+Obmg== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552281244154100 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 543dd3201b5a..1c23ec8897f0 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 4bedf17b6c8f..e09af481440d 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1532,7 +1532,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 @@ -1540,7 +1540,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 a0e3af61ae29..46c8e2f7c62d 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1765,7 +1765,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; @@ -1775,10 +1775,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 Sat Sep 26 20:00:45 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=1788552262; cv=none; d=zohomail.com; s=zohoarc; b=jPdtp0gswR60Ze+blB9V2CMquUKkTFRL3JhxgH5abirvNPRG9lGebGyQj4uhC8H11JUTr39cAABdCMCWxcvEkI+7KJpS18b+NjZjQWSwOfqKKcarcu4ava37Ipu9AkPOClehQjZsrR7CMeo3NzNMulAVH5XNY7MH59iiO9aPms8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552262; 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=JJ0QqMr2aYRvaX8mdOG+2co8znOgwmsUrY7IwIg3dxEx0zxCQLrW78QiCQcABUVP3t0GnETRQJ3VIRFujl+E/py8VJLo5Wb4aF5JEiEwhcplCF0krlBQAYob1jdCQE0TvPISPam5XmgVYSbxmfFbTWLKnyXIa9LnssEEjqCBzNc= 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 1788552262727972.6578773620959; Fri, 4 Sep 2026 13:04:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a84-0007Gh-Sh; Fri, 04 Sep 2026 16:03: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 1x2a7f-0006X6-Jz for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02: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 1x2a7d-0000F6-F5 for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02: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-183-_O3eFB1TNUy_9FWKYQTemg-1; Fri, 04 Sep 2026 16:02:47 -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 8D6EA180AE12; Fri, 4 Sep 2026 20:02:46 +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 2F3011955D8D; Fri, 4 Sep 2026 20:02:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552168; 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=SDR127COcGrv7VZw+CZv+BwrfasxJEnfIiH0ErJf7P1+nLSAbRsaELcqvpde7inqJjazqQ H1Gm6Unrp3N9aflu16XcyOUXMWlia4bb3GB/zU5hMFvD08XS4Kt/M9Q8nlwhVwG2Lc8Hi4 ycmWk6L+32dHR3j1GTX5SROlf/IOlBI= X-MC-Unique: _O3eFB1TNUy_9FWKYQTemg-1 X-Mimecast-MFC-AGG-ID: _O3eFB1TNUy_9FWKYQTemg_1788552166 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:57 +0400 Subject: [PATCH v4 74/75] 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: <20260904-qom-qapi-v4-74-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLMQZSyJjoIVRIskTDIGVZckB4WYAAaRHJ2O JUSKjyMkYWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsizAAKCRDa6OEJdZac 5dJ8D/9BelrLie6vyV3Y8cyRwg++ej8f5m/+bqC85tupNeBSlm1QPDRv9EXo7LVFxEtRuvWkgcT eXKzaQke3PDNrsCiQVwUBhImmfBbLEr51jl+gdg/atNweKO7PUJkcMUd7R3S3TEOeUUxfshOFzd 5fz3EgGkEErmEDVdsRyKCWBmiyCwx+1PRX3kwzcaQZzeLMkm9SgbopkfJ51cv+1SMISk5CV+vwN LAUDXcofE1lJ3eFeq/zjUT7Xj9ZDuv67fawKjJ4dXGtOwKl5XfJjsdE+S97DBklvfRMl5VDZMHM aDuCRLVVOpZ6B0Sb3p9ne05lZksRWHIx7gfXKDd/ks/xU4+dgbkXnDhmkLCPqubMEpzbfasuAN+ ALio1RGlJxJ6KGa6wtfEdXFhSZAT50jT8oyjCHqcLCanK4yzKUpvj/BH90frhhqz2c3uraPEmRW 6X1FdNL/Reoy4Q/FxhFBTsEDpQIfe+SjLSHmggs/ht6+KsoPx1m+KEQ3GVeAsaZ2rU0KrUIuVkZ fTkiq4pXOi9EbaZfGyHgiwLcHRwNMBfWfFdmQUUDgYqJ8/vCc45X7Mne7Cy1m9q0qUAJRfvkpHb h9O4JN3MIqZYEwLKNkfRZx+/9cEy/qKBggopj0f4eZ5KSuecN5VLi6HORB6m6mVdQM2yhvqhsh4 2YleYNgEl2N2UxQ== 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552265077154100 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 Sat Sep 26 20:00:45 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=1788552255; cv=none; d=zohomail.com; s=zohoarc; b=MdQSYAJopi8nl0Yrri1M1mjiIBDyBownkjxg5o1ucg7ljdyyP2iNEfIWR4ONDQY0f+30yeYH5LiIynGifo6Yu/uGe84+njfjoIeZonYKtxenxMlc53ZJftKSQM0p2gCiHtWUBZiWXDInlyU0Wy+YmQFF7ql7Rxi8U7mq5k4IRnc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788552255; 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=Km29GxyIy3EJQ43u8HeUbogUAKrF3KpxGZCcdk+O0f1Y5u7jT6IqOFBmP7+5aHffezT/PLgVPZsApbTOm2ig7f5bkIOt9pyTSvQPznksC+NIhGbf570HzV0Fccz8SyzYvQX1oIrquMDkDTA3tvoP/MaH5IpRV8SsQVGHK8eZ+LU= 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 178855225523158.36791369426237; Fri, 4 Sep 2026 13:04:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2a87-0007fn-5T; Fri, 04 Sep 2026 16:03: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 1x2a7m-0006Y4-HF for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:03:01 -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 1x2a7k-0000FW-Vb for qemu-devel@nongnu.org; Fri, 04 Sep 2026 16:02:58 -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-196-541o8MnRPdi8whjZ4r79Ng-1; Fri, 04 Sep 2026 16:02:51 -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 57CB2191DFCE; Fri, 4 Sep 2026 20:02:50 +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 55AC930002F4; Fri, 4 Sep 2026 20:02:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788552175; 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=Ka4TYlIXXJKM/cyrWVP//AHd4YM/Qr26WRy26iALfQsvhpFKZfptFD5Ps8p2RUw5ZCMCFb v5CZQ1oZ2Cx6lpPyk0kGs902FFAdsKrwDhOhn669nKF9d2JBuvRQXr0rBkuRBSwsWSv1LS z2Eq5wAnqOqsefm944O20l3kbPZ4opI= X-MC-Unique: 541o8MnRPdi8whjZ4r79Ng-1 X-Mimecast-MFC-AGG-ID: 541o8MnRPdi8whjZ4r79Ng_1788552170 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 04 Sep 2026 23:58:58 +0400 Subject: [PATCH v4 75/75] 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: <20260904-qom-qapi-v4-75-a985f168e938@redhat.com> References: <20260904-qom-qapi-v4-0-a985f168e938@redhat.com> In-Reply-To: <20260904-qom-qapi-v4-0-a985f168e938@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/ZANAwAKAdro4Ql1lpzlAcsmYgBqmyLM7USoQU0vzkCn+3sytx0h8hLdjQBfeAKFt r+S0za+/BKJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCapsizAAKCRDa6OEJdZac 5VpDEACIUlTQxUZdiob8jwSBYO3YVZqq8dxC01v50dNyfjm/uFSN+LoaPWENQ5ODkGjcO9NF4MW AAPfrwwWzw8gh/RutysiQl89oEcCKWvjsOcPjVsJOMzfem4dHv05sY5gLy7JAb6SuEY1opO6YxP zjkBj/4dJ+oCNLOdhfFvmiaRSidfS4mfJ5nglSI+tj2SoIZOAgFM4b6NwmagNHtvTBTj3Q40AFp rUbnZufe+FKlIVogUMOOLq10Q5Ty9Q2GMPVz8mBUU5EDNqquLGpMRubF67yHuaM7EXfnJUvfcIP LdqUN18vcfns1/4rlrcbU0htFLSPjcgiinHE+cDY7xm9rXi5qRacOcwe2E5eVKk/H8Zv0J5sJej xjPxLUYjeWyW34wbJBnSPBjwucheGidiLC0nfdJtHJrmEjTnZu/r0fW5lVzVEredpbB+3IWja5/ +Z7PktHA1uD9ZDonzdWdkmNewGRGssmfxX3fKNaN1u9LtbtlR9XxEeNtf2NUXHf2JtG87WHaiFx 5WnBagsbu8i++10TsblqmKWbBa+fLEplsdt5lj1YEh0KHPsDLVoX9aUkHO/KLKHVC9NFRq7sMfk wSeHccFDMo+rVM468KxFpo/DZr5grHk99OCZoowGxONl90q6IRUDB6zEzVr5ZQL/dbXZytAr9HG np00NsA8gzgdw9Q== 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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_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: 1788552256883154100 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