From nobody Mon Nov 23 04:28:00 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=1793630541; cv=none; d=zohomail.com; s=zohoarc; b=RwNakk6cnJldU/3Z3Xk3k0en9Hc0FlK7u+TuVeOivwQIUvDCkaHD9rCfCf8jabbr0pVrKi1oVnntgqs/UUu+mzA0jTYye/za0Vv+dUAfEpllEMnQGAtoGUb3hGg31pKTO1f9MsScqDFlj6CY0I3APqrkjICmrrFHeEQwc1eQzIE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630541; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2WAQR7L5ckqMN1VmfC17If5uXdLKJHj7DvAGvVdAeXs=; b=nyS/oOJBu6BmR75/F/U7cWoPQ9R9U+Tc3QxyEstXQ1uBeUnG3kUwcSCUYSmd9vyw+UMZ4l2jR/NwYKskcB6d5TwJUW9pTC9Xs6HOF0XXbBXngSSxc4nppyZDkhMLx8m5wFOYmWS68ZT6myHwm9obh96bry/P1Gy4Blz275GjEnw= 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 1793630541012993.6999773411511; Mon, 2 Nov 2026 06:42:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDb-0003Q4-EW; Mon, 02 Nov 2026 09:41:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD1-00036y-NH for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtCz-0008OX-8M for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:27 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-572-jhtCPAYMMpua-EpbwfjVCQ-1; Mon, 02 Nov 2026 09:40:22 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A5E551944DF2; Mon, 2 Nov 2026 14:40:21 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6400D30001A2; Mon, 2 Nov 2026 14:40:21 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E286121E692D; Mon, 02 Nov 2026 15:40:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2WAQR7L5ckqMN1VmfC17If5uXdLKJHj7DvAGvVdAeXs=; b=eGuPhjncMrA0fsGshRJjwx7vb4+IiC2qgTs2HG1rJT4sNZ9hbJXoal3CJb5Na4koFy7Zu2 s3Nn1cIJLlsd3CeKnBe0xDLawTFn1GxbsIfIXfQY5ZRr+L2JUi9wDhJqosanZxGwhTGMQW e6ezmqa5ff4R5gtuQ1D5Wvt8ZwXzFoU= X-MC-Unique: jhtCPAYMMpua-EpbwfjVCQ-1 X-Mimecast-MFC-AGG-ID: jhtCPAYMMpua-EpbwfjVCQ_1793630421 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 01/74] qapi/machine: Drop misleading (for OptsVisitor) doc Date: Mon, 2 Nov 2026 15:39:05 +0100 Message-ID: <20261102144018.3212223-2-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630545150154100 The QMP Reference Manual describes NumaOptions and NumaNodeOptions as "(for OptsVisitor)". This makes no sense; the OptsVisitor is a purely internal thing. When commit 0042109a6a (NUMA: convert -numa option to use OptsVisitor) added these QAPI types, both "(for OptsVisitor)" were correct and merely schema comments. They have since become wrong (both types are part of QMP according to query-qmp-schema) and reference documentation. Delete both instances. Signed-off-by: Markus Armbruster Message-ID: <20260911095350.2020964-2-armbru@redhat.com> Reviewed-by: Daniel P. Berrang=C3=A9 [Straightforward conflict with commit 74c1a2e9a3 (qapi: convert simple data struct intros for machine.json) and commit c4d2c31e05 (qapi: convert remaining simple intros for machine.json) resolved] --- qapi/machine.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 9b145c635b..9dc63c1c8b 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -455,7 +455,7 @@ =20 ## # @NumaOptions: -# A discriminated record of NUMA options. (for OptsVisitor) +# A discriminated record of NUMA options. # # @type: NUMA option type # @@ -473,7 +473,7 @@ =20 ## # @NumaNodeOptions: -# Create a guest NUMA node. (for OptsVisitor) +# Create a guest NUMA node. # # @nodeid: NUMA node ID (increase by 1 from 0 if omitted) # --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630564; cv=none; d=zohomail.com; s=zohoarc; b=bTTEVkGR6E0mwuq++o0BBk2/Fg2vRmUlyqAiEGWzrMZvzdX3gWtFOycLXzM8A6asR8aZ0/T7ZP3yAWHCJK9kKAppG5kf/2/ENd+KJutBWF9z4lYXptLQ8atPmlvGyV7ny9SkH4rVENBp404K84HWIc1rJDRjajln8HzTzuknY1s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630564; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZgiXp1wEtyK41O/sVgAq7b25DbBtsZAcH5FF+s+YGB4=; b=WFKZK9sAvYykT1QEN9MQeJ8TJ684Uo7jN8QwclJer27qu+wwn93v05iEEDT3NohlNqAjhwE9EUEbLmrqn9xIvJCrC3YFji7Q/0vdoGQGBg87isut7/kIAlzjrup9Z58umIx8IxcXpR7CHAYrgFxrVeuZcOuolkoMVuQQ8jo5h2U= 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 1793630564262811.1072949831389; Mon, 2 Nov 2026 06:42:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDZ-0003On-BM; Mon, 02 Nov 2026 09:41:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD1-00036t-Mj for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtCz-0008OW-80 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:27 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-572-pY8Z3tC8MfW2KDH_iDAeyg-1; Mon, 02 Nov 2026 09:40:22 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C51D3180AEE2; Mon, 2 Nov 2026 14:40:21 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4B89230000E7; Mon, 2 Nov 2026 14:40:21 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E68BA21E6880; Mon, 02 Nov 2026 15:40:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZgiXp1wEtyK41O/sVgAq7b25DbBtsZAcH5FF+s+YGB4=; b=MsTvzqjOYMpTt2mF7lUkU/stdy2trNGXBhQAlNDlMHjrpRNolsP6C6YegBoR0bvSy0+GNt kGFiHQlbWSVXsD/C3gH8rEFNfNo+cy5/QMGKN/9kgm8hxBuwuFoJatsRcorrVEh1gCEmom zse2jcYxAdFgi1/r9pYOdOo2mjkv62g= X-MC-Unique: pY8Z3tC8MfW2KDH_iDAeyg-1 X-Mimecast-MFC-AGG-ID: pY8Z3tC8MfW2KDH_iDAeyg_1793630421 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, John Snow Subject: [PULL 02/74] qga/qapi-schema: Drop "This is a read-only operation" Date: Mon, 2 Nov 2026 15:39:06 +0100 Message-ID: <20261102144018.3212223-3-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630567962158500 Content-Type: text/plain; charset="utf-8" Documentation of guest-get-vcpus and guest-get-memory-blocks has "This is a read-only operation". Similar commands don't. A "get" command that actually writes would be in surprisingly bad taste. Delete both instances of the sentence. Signed-off-by: Markus Armbruster Message-ID: <20260923064212.839691-1-armbru@redhat.com> Reviewed-by: John Snow [Straightforward conflict with commit 45a70e37ff (qapi: split intros for qga/qapi-schema.json) resolved] --- qga/qapi-schema.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json index 7b937713e6..a6cda5eae1 100644 --- a/qga/qapi-schema.json +++ b/qga/qapi-schema.json @@ -741,8 +741,6 @@ # @guest-get-vcpus: # Retrieve the list of the guest's logical processors. # -# This is a read-only operation. -# # Returns: The list of all VCPUs the guest knows about. Each VCPU is # put on the list exactly once, but their order is unspecified. # @@ -1100,8 +1098,6 @@ # @guest-get-memory-blocks: # Retrieve the list of the guest's memory blocks. # -# This is a read-only operation. -# # Returns: The list of all memory blocks the guest knows about. Each # memory block is put on the list exactly once, but their order is # unspecified. --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630893; cv=none; d=zohomail.com; s=zohoarc; b=W82qnwEzWG6IelWCn9uUIbKLQ42YjEnU/2lMUw/tUWqpdVClpMfovVR529jjF1QSuwOYA77W6nq76UF7MgfquaasD62+BW0Q5quaj7okO3q2OIO0WDUHB0tXPyb7vfTKK9GmvKREVsAmkhnSTqno3EADLVvpZ43AUxD2wPCRQZ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630893; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0DdFKHqe5GUihwYRJEAX0e5YrBigo3dCGxPlsV2eZsk=; b=UdTzdWqcKSJQICGIjvgaML92EHoF4ikh9m1FmX9JJqHR4dC87qF6gkJmNvIRGcQJPnmTnwg2JFPpImf7ONfFAkc6P0uZeciyipsnBxHWjRtsESnLxe94tw+kZLGTBYZuzVtpmO3ccSRBS0M8oJpuveexiXCgQKm1LjLjVMSqbrU= 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 179363089393942.99813559311178; Mon, 2 Nov 2026 06:48:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDM-0003DS-Sc; Mon, 02 Nov 2026 09:40:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD0-00034E-Ch for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:26 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtCy-0008OO-TJ for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:26 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-303-K7kOrDW7MVKAFeb5Uk5_2w-1; Mon, 02 Nov 2026 09:40:22 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A3004180AC6C; Mon, 2 Nov 2026 14:40:21 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 55675195604B; Mon, 2 Nov 2026 14:40:21 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id EA88521E6882; Mon, 02 Nov 2026 15:40:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0DdFKHqe5GUihwYRJEAX0e5YrBigo3dCGxPlsV2eZsk=; b=gj1uq+VHKOSOV2sHy8uI+ROVuP/ovIvm7uvj5oF/QOfkr/1NpbllbFNqsnCVuNfbQ2xuL+ OMMZ+maNse9fA6c5ZhIYpMc033z+hkLP6DqGvJGG6m3ptMexMEQQEI74OlwUoV9Q1CWOug Vc2EW9jOGY2Z8AdzZcaNJkdxB4UiNJY= X-MC-Unique: K7kOrDW7MVKAFeb5Uk5_2w-1 X-Mimecast-MFC-AGG-ID: K7kOrDW7MVKAFeb5Uk5_2w_1793630421 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, John Snow Subject: [PULL 03/74] qga/qapi-schema: Deemphasize numeric @whence in guest-file-seek Date: Mon, 2 Nov 2026 15:39:07 +0100 Message-ID: <20261102144018.3212223-4-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630896075158500 Content-Type: text/plain; charset="utf-8" guest-file-seek accepts both symbolic and numeric @whence values, but the former is documented as "preferred interface". Remove or replace mentions of numeric values by symbolic ones. Signed-off-by: Markus Armbruster Message-ID: <20260923070351.855246-1-armbru@redhat.com> Reviewed-by: John Snow [Straightforward conflict with commit ae42905b2a (qapi: convert simple intros for qga/qapi-schema.json) resolved] --- qga/qapi-schema.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json index a6cda5eae1..de42dfe77d 100644 --- a/qga/qapi-schema.json +++ b/qga/qapi-schema.json @@ -327,11 +327,11 @@ # @QGASeek: # Symbolic names for use in `guest-file-seek` # -# @set: Set to the specified offset (same effect as 'whence':0) +# @set: Set to the specified offset # -# @cur: Add offset to the current location (same effect as 'whence':1) +# @cur: Add offset to the current location # -# @end: Add offset to the end of the file (same effect as 'whence':2) +# @end: Add offset to the end of the file # # Since: 2.6 ## @@ -356,7 +356,7 @@ # @guest-file-seek: # Seek to a position in the file, as with fseek(), and return the # current file position afterward. Also encapsulates ftell()'s -# functionality, with offset=3D0 and whence=3D1. +# functionality, with offset=3D0 and whence=3Dcur. # # @handle: filehandle returned by `guest-file-open` # --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630585; cv=none; d=zohomail.com; s=zohoarc; b=X3ukqsVPz1658VkXGMgrmZ6mWA6MGv3nr5v6B35NGWmhocb5NdzJBnzK5q86AJ3zEv/OVi3qcTal/OeNIwIbKKM8S2/jIpuzHPzjYGm6o1z411crBu2HoFORUPyKbNokW60+NzOn1tRa7ohZYw0SW+5GAQl6Vu30a+SmODXCdfQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630585; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nx+JQzVuV6SfoCUfbG7m6RhpcRShrhNZwmG6nyMCMQY=; b=Int2+cVBa3BhjRzwh8VA5WlGqW8b3/Myiouk74WbQDXobV1Z/ZKkmJdAe2EQREpLGQcY1BssAf+cazgBDXJSfjNN2HFLmqUGPepsr00EYZjFLvtF3Q601ArXAoQCsP6yWQz1/c1LxYsXUCL9aZCF52+IazNUP0sZTRlc5KN4o14= 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 1793630585360813.7277418130474; Mon, 2 Nov 2026 06:43:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtEB-0003zf-FH; Mon, 02 Nov 2026 09:41:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD2-0003AT-QQ for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD1-0008P0-8J for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-104-uz9Hewr3OJSB4qYiQH-Kbw-1; Mon, 02 Nov 2026 09:40:22 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C509A1977034; Mon, 2 Nov 2026 14:40:21 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5024D433; Mon, 2 Nov 2026 14:40:21 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id EED2321E6883; Mon, 02 Nov 2026 15:40:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nx+JQzVuV6SfoCUfbG7m6RhpcRShrhNZwmG6nyMCMQY=; b=Mg0RI//Q8aSNDefcPn2wTrjIzYZEUuiXLyUZRlyRAdIUKxrSaDJaNK2/Et3kIlApHX97xp Z4vRAcAOTbfmUebF4PU8D5xfK6OPNLY+hTV8Io1iyq1VTnEfVBx7pk8W1e8MSZGIMcAteD Zqj9/G1VdCJOQLTFIpaBhi/mDwHtLNw= X-MC-Unique: uz9Hewr3OJSB4qYiQH-Kbw-1 X-Mimecast-MFC-AGG-ID: uz9Hewr3OJSB4qYiQH-Kbw_1793630421 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, John Snow , Eric Blake Subject: [PULL 04/74] qapi/control: Turn the reference to qmp-spec.rst into a link Date: Mon, 2 Nov 2026 15:39:08 +0100 Message-ID: <20261102144018.3212223-5-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630588421158500 Content-Type: text/plain; charset="utf-8" From: John Snow Add a new anchor to qmp-spec that allows us to cross-reference the Out-of-band execution section of the spec directly. Amend the documentation in qapi/control.json to use this new cross reference instead of a plaintext "see also". Signed-off-by: Markus Armbruster Signed-off-by: John Snow Message-ID: <20260929192403.2972132-1-jsnow@redhat.com> Reviewed-by: Eric Blake --- docs/interop/qmp-spec.rst | 2 ++ qapi/control.json | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/interop/qmp-spec.rst b/docs/interop/qmp-spec.rst index 563344160e..ea713a96ac 100644 --- a/docs/interop/qmp-spec.rst +++ b/docs/interop/qmp-spec.rst @@ -119,6 +119,8 @@ Where: =20 The actual commands are documented in the :doc:`qemu-qmp-ref`. =20 +.. _out-of-band execution: + Out-of-band execution --------------------- =20 diff --git a/qapi/control.json b/qapi/control.json index ef63a8a261..e97fe317af 100644 --- a/qapi/control.json +++ b/qapi/control.json @@ -44,8 +44,7 @@ # client connection, used for agreeing on particular QMP extension # behaviors. # -# @oob: QMP ability to support out-of-band requests. (Please refer to -# qmp-spec.rst for more information on OOB) +# @oob: QMP ability to support :ref:`out-of-band execution` requests. # # Since: 2.12 ## --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630623; cv=none; d=zohomail.com; s=zohoarc; b=L11eUazmd1WR7YQOdCIkI8CAC8iSOW406PFHPgklv0azbGNsYC30mMAyNv+UAw7DnuG8lPwOMu90T63+goMm0V8+aJQ4nK4QzL12qhwR0crpDUGf7/myg+Au6HSaJaxN3MNd2CUxuHxTgRgI/VVqUnyDoVcLGnwv/FtNs7tP4b0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630623; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zvqYVVKZBTtqXq5602EjQyMqc1Er/8Mn1fPJ/UTX9pg=; b=GY9fH7yPLOVqtsxxFfrhtaCAsaHyytZ0xLr8eFdMqSMsT0Tc8RPPswz+8OaINsXw0WIo5rsM4rCzIypqQLy/WQVnrUv6+lTPZ2oiK79q0JdXbk/TYI4OD/4B3iehl3J3UVsNPuy148+H5zI1bbu6FIVKdorMONvthN5xAc+DGAs= 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 1793630623544566.6723796581418; Mon, 2 Nov 2026 06:43:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDl-0003VL-8y; Mon, 02 Nov 2026 09:41:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD5-0003Bv-AP for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD3-0008QD-G3 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:30 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-393-Ib7H72hkO1OPpDm6Q4NkNg-1; Mon, 02 Nov 2026 09:40:25 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A6B1D180A9D8; Mon, 2 Nov 2026 14:40:24 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 664C11800677; Mon, 2 Nov 2026 14:40:24 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id F354C21E6884; Mon, 02 Nov 2026 15:40:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zvqYVVKZBTtqXq5602EjQyMqc1Er/8Mn1fPJ/UTX9pg=; b=RJrD9ddYkdaOG9IJ0KFtcOms1i2DOFmzSlL6sSv1fa3zNyW1ML7hxeKb5GsFbDsfhDjpj5 vA9NJmuXK/9kkUZ2mKA3mGZ/iP1RKJHqYnZorIe5gm+fhD5K663FSg8iVvx8Y5IZZtQiBj 2Btl87sixj1rpyjt7lTX6KNmsfYkPvM= X-MC-Unique: Ib7H72hkO1OPpDm6Q4NkNg-1 X-Mimecast-MFC-AGG-ID: Ib7H72hkO1OPpDm6Q4NkNg_1793630424 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 05/74] qapi/acpi-hest: Fix markup of heading Date: Mon, 2 Nov 2026 15:39:09 +0100 Message-ID: <20261102144018.3212223-6-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630626175154100 The docs generated for qapi/acpi-hest.json shows text "=3D=3D GHESv2 CPER Error Injection" instead of a heading. This is because the patch that added the heading crossed with the commit that changed heading markup (commit 6c10778826a "docs/sphinx: remove special parsing for freeform sections"). Fix the markup. Fixes: ddd8f3baa27d ("qapi/acpi-hest: add an interface to do generic CPER e= rror injection") Signed-off-by: Markus Armbruster Message-ID: <20261028144028.771869-2-armbru@redhat.com> Reviewed-by: Daniel P. Berrang=C3=A9 --- qapi/acpi-hest.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qapi/acpi-hest.json b/qapi/acpi-hest.json index 8db804df19..505f68e053 100644 --- a/qapi/acpi-hest.json +++ b/qapi/acpi-hest.json @@ -3,7 +3,8 @@ # SPDX-License-Identifier: GPL-2.0-or-later =20 ## -# =3D=3D GHESv2 CPER Error Injection +# GHESv2 CPER Error Injection +# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D # # Defined since ACPI Specification 6.1, section 18.3.2.8 Generic # Hardware Error Source version 2. See: --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793631105; cv=none; d=zohomail.com; s=zohoarc; b=BRdrvhYz7CLqP+ghCbzAxyV6/pPoFs6MwcRQcR2S29//9pUzza7nfSYBvqpmbxRU0uRaKuwL0bcQFMz4zPy4kQoTcJb3Ci1yEo04fn3ZREMEqJcHpntA2ZFfUXTDnw8cM28xDg/epBSbM7ThpWrsnyIHlJ24GBHjjVbzzk1Tamc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631105; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=psi7Txkv9HAyYZbT2su523DAoHPAy3qCgIthAjT8FwY=; b=S58+3exS6VfbzCvihi8gtdurYzZcL5q5QuTclzrd2Ljxdr1Z4TUCOQA734C9dLWG5b0Zz2aIRu8iy8a+j2cgQoZPBel80G+QrdirrkG6IFxTaBhcHi8mjd5oW3Zxhbnpy36y6OVdoYyYpT3XEXliJS2vRg/YAXpqoZccNn+D6nQ= 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 1793631105169124.63820658538248; Mon, 2 Nov 2026 06:51:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDs-0003YL-HD; Mon, 02 Nov 2026 09:41:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD5-0003Bt-9c for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD3-0008Q9-F2 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:30 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-159-NcGnRLeWOfK8kCrWNt9_-w-1; Mon, 02 Nov 2026 09:40:25 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8BA901944D46; Mon, 2 Nov 2026 14:40:24 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 49E0030000E3; Mon, 2 Nov 2026 14:40:24 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 037CA21E6885; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=psi7Txkv9HAyYZbT2su523DAoHPAy3qCgIthAjT8FwY=; b=AcWAQ5ITqyJBZZFyku/SdRNZ9y3txzFh9FYX/0TWB67BsdtwV6cwxIiOe4HSFDjf3gyrka aFn/rZwDyjwYZTFGCYh5ikuBVW37XclbKRIKE6tnYsxRPRn4n8Lu+4jVyKPYxCGAZo+bi2 Q3ve6Ef/lPleBzcH6sYCCntJMtoFUzU= X-MC-Unique: NcGnRLeWOfK8kCrWNt9_-w-1 X-Mimecast-MFC-AGG-ID: NcGnRLeWOfK8kCrWNt9_-w_1793630424 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 06/74] qapi: Fix inaccurate comment on pragma member-name-exceptions Date: Mon, 2 Nov 2026 15:39:10 +0100 Message-ID: <20261102144018.3212223-7-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793631105487158500 Signed-off-by: Markus Armbruster Message-ID: <20261028144028.771869-3-armbru@redhat.com> Reviewed-by: Daniel P. Berrang=C3=A9 --- qapi/pragma.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/pragma.json b/qapi/pragma.json index 342cedc42e..73807abc6a 100644 --- a/qapi/pragma.json +++ b/qapi/pragma.json @@ -80,7 +80,7 @@ 'XDbgBlockGraph', 'YankInstanceType', 'blockdev-reopen' ], - # Externally visible types whose member names may use uppercase + # Externally visible types whose member names may use uppercase or '_' 'member-name-exceptions': [ # visible in: 'ACPISlotType', # query-acpi-ospm-status 'AcpiTableOptions', # -acpitable --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630569; cv=none; d=zohomail.com; s=zohoarc; b=Jb8l3xJ31ZIfow17+3ZWvlUx/vP2DybO5DqR1zMF0puvs/aWcXNPdutYIQKs6nP2ae0IGw/muWYa5CVnvNxGEyjYfrqu+sex7YPNt/8UKUp79mLKiL0FeN3fjs7L8DTQ52r7+X30rHo7VPYt/YetKxh+MFNi296Erlb37h/Qdf8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630569; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TUGTwlF8JN4SiiDhGUbXXGBrSbUHgEhyrqBQWUe4wvc=; b=F6opCCa64gYzV1ePsCdceVF35veHWXg4zcA/NHvyqZA3uoc4kUoSVH5ziDbzYJp71Pp9thpSGcJ4dcmMaWUvTiCZe+2sqRk7m9zsnHo4NJQkcfBrr+q4qFQ2reP0VEO58VNn7kAVWmOifQcDj8tiuQEAw4rAu5M1P8dNMI5xARQ= 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 1793630569611185.4143508801518; Mon, 2 Nov 2026 06:42:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDb-0003QF-MT; Mon, 02 Nov 2026 09:41:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD3-0003Ad-3X for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD1-0008P6-Ig for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-636-VEsV-HoNMmquPMckPysmvg-1; Mon, 02 Nov 2026 09:40:25 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7B11F180A972; Mon, 2 Nov 2026 14:40:24 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3B7F21800345; Mon, 2 Nov 2026 14:40:24 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 078C421E6886; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TUGTwlF8JN4SiiDhGUbXXGBrSbUHgEhyrqBQWUe4wvc=; b=HzI9cqoSh6Gv1uHnzl/BcktTRigHs7nZKpDfE8+/adQSaGRz5bm1JD3DtbbjSMkMvsSeUm ueGpyBcMAExLJb6146DZuiQT4Dp8G9exAT8l3qP6PHQEgeLQCRjZy5PXO2IxIgXL/+OXze 0nJH6PUibenoqwqlO5+RuMTLGXNupes= X-MC-Unique: VEsV-HoNMmquPMckPysmvg-1 X-Mimecast-MFC-AGG-ID: VEsV-HoNMmquPMckPysmvg_1793630424 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 07/74] qapi/compat: Fix inaccurate CompatPolicy introduction Date: Mon, 2 Nov 2026 15:39:11 +0100 Message-ID: <20261102144018.3212223-8-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630571425154100 "Policy for handling deprecated management interfaces" was initially accurate, but we neglected to update it when we added policy for unstable and insecure interfaces. Change it to "problematic management interfaces". Signed-off-by: Markus Armbruster Message-ID: <20261028144028.771869-9-armbru@redhat.com> Reviewed-by: Daniel P. Berrang=C3=A9 --- qapi/compat.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/compat.json b/qapi/compat.json index 0f90ea1f52..f6bc93904f 100644 --- a/qapi/compat.json +++ b/qapi/compat.json @@ -53,7 +53,7 @@ =20 ## # @CompatPolicy: -# Policy for handling deprecated management interfaces. +# Policy for handling problematic management interfaces. # # This is intended for testing users of the management interfaces. # --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630560; cv=none; d=zohomail.com; s=zohoarc; b=JQpiHP2nC6cVOR3UwGvvZi0kw6Wwa9s6WhY321zLNyocVklO5Dv5EQam9DIsBb7Z86pU6M4+WC7Px+ENQNIgVO82oNELZoHiqipavBsoNDdymuau4JqskuYu5V+m7aRoYc6e4H60vsoSzd0P6kbI2HQOrDggdecUtE+PQ0fXBl4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630560; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TDT3c6SXwbgez6Gljsasb/QcIek2D9EaihtumDBSfy4=; b=P5/80pN0gt+Yka3MVZDgiZHxtLVp2ih/i1S72DJLMP52eqhmxvDr29ZfdQHoFMSSNAPD62QFnQrPljS0TecSUPPOBRwpWaFZeTDYrb7uUMGuadqej+dz5Bl+nmJBEMnS+g4YG3XBe+7bqYsR0MP9lUYcNk8QepLvNJ5oIDa+tK0= 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 1793630560366918.6588787514459; Mon, 2 Nov 2026 06:42:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtEB-0003xu-1w; Mon, 02 Nov 2026 09:41:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD5-0003Bz-GE for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD3-0008QN-No for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:31 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-378-L7Dc0So3MTSOCWBl9cDt-Q-1; Mon, 02 Nov 2026 09:40:25 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 983A1194510E; Mon, 2 Nov 2026 14:40:24 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5830D7E2; Mon, 2 Nov 2026 14:40:24 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0BA7121E6887; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TDT3c6SXwbgez6Gljsasb/QcIek2D9EaihtumDBSfy4=; b=NqobuSwXsVThhNPxNq+oExGdtkaNPek8DNChfgeT4ElqhX6XQhiMFTFcqAUYV3A9U9Ed4b /YC8B1NBlVfAOcs18F583ICK4pIUskmaQ50K4IXNVr/RLpGrvpxPJ30HxObAkapvIgU/sN E0LGF6Kq4S+ed8Xoy3JRMyQXi4MPIHc= X-MC-Unique: L7Dc0So3MTSOCWBl9cDt-Q-1 X-Mimecast-MFC-AGG-ID: L7Dc0So3MTSOCWBl9cDt-Q_1793630424 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 08/74] qapi/compat: Fix "only syntactic aspects of QMP" note Date: Mon, 2 Nov 2026 15:39:12 +0100 Message-ID: <20261102144018.3212223-9-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630562334158500 "Covers only syntactic aspects of QMP" was initially accurate, but we we neglected to update it when we added @insecure-types. Do that now. While there, move the limitation notes below the enum value descriptions to avoid forward references, and mark up an existing reference properly. Signed-off-by: Markus Armbruster Message-ID: <20261028144028.771869-5-armbru@redhat.com> Reviewed-by: Daniel P. Berrang=C3=A9 --- qapi/compat.json | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/qapi/compat.json b/qapi/compat.json index f6bc93904f..d1fb74abf7 100644 --- a/qapi/compat.json +++ b/qapi/compat.json @@ -57,13 +57,6 @@ # # This is intended for testing users of the management interfaces. # -# Limitation: covers only syntactic aspects of QMP, i.e. stuff tagged -# with feature 'deprecated' or 'unstable'. We may want to extend it -# to cover semantic aspects and CLI. -# -# Limitation: deprecated-output policy @hide is not implemented for -# enumeration values. They behave the same as with policy @accept. -# # @deprecated-input: how to handle deprecated input (default 'accept') # # @deprecated-output: how to handle deprecated output (default @@ -78,6 +71,14 @@ # @insecure-types: how to handle types that are not declared secure # (default 'accept') (since 11.2) # +# Limitation: @deprecated-input, @deprecated-output, @unstable-input, +# and @unstable-output cover only syntactic aspects of QMP, i.e. stuff +# tagged with feature 'deprecated' or 'unstable'. We may want to +# extend it to cover semantic aspects and CLI. +# +# Limitation: @deprecated-output policy @hide is not implemented for +# enumeration values. They behave the same as with policy @accept. +# # Since: 6.0 ## { 'struct': 'CompatPolicy', --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630828; cv=none; d=zohomail.com; s=zohoarc; b=EsXjDynE3GmWWbMQfx9JrjhQ2lXkJia6KcjhwFCO+lMW5I58rhMj1q1/8EYNw6bRPIegR68ws9hE8usneTUftIVWg0Ut4L43DAZ+AMFC5VRYT2sm4pDK7q0T6Y3uTv8P5yG8lmocttRyj0GThtj0XhY1ZswIOrA7lnFVuli+wbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630828; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GV5CZqebP/VpiQ6tYNOvrerKYMSDFf96jRCYs+9ffFQ=; b=CpwjfAo3dGLBVYcefqjWanMrADtSb+H2zRtuyoTXBpm2bAYI3oe/vpvox1HivWVxsWkTR2MBE0+yB0TiTVe/jY8EAbSvGaB5aTg/Yy7E5kAYjEM2RHFbGg7Ou9jm2BXDamnFLDIIe/aPdUxj2D/R0aSseTY2rEhhfSLxpcIC750= 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 1793630828174284.6047812455074; Mon, 2 Nov 2026 06:47:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDc-0003QL-Gf; Mon, 02 Nov 2026 09:41:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD5-0003Bu-9l for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD3-0008Q7-FW for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:30 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-159-afUM_U4qOeSdR6PCM3bcSw-1; Mon, 02 Nov 2026 09:40:25 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8F431180A8FC; Mon, 2 Nov 2026 14:40:24 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4E5975BC; Mon, 2 Nov 2026 14:40:24 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 1025D21E6888; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GV5CZqebP/VpiQ6tYNOvrerKYMSDFf96jRCYs+9ffFQ=; b=NpyJhV+lxPq1Vg9o0yZAfjzM/hJVGNcngd8rHCzQ5ReNbJGWUvkD5FGiejiqY63RJzkEeo H65BnwqfBwpGTPD0iCx8VN8z5kUaWg5sdJGJ1PXUwZlmuiopyQ5kPDifWRehawg+S9PsTE eRxuBMyWc30w3UE5DwfgjdY+4Y3+1TQ= X-MC-Unique: afUM_U4qOeSdR6PCM3bcSw-1 X-Mimecast-MFC-AGG-ID: afUM_U4qOeSdR6PCM3bcSw_1793630424 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Laurent Vivier Subject: [PULL 09/74] rng: Remove deprecated "rng-backend" property "opened" Date: Mon, 2 Nov 2026 15:39:13 +0100 Message-ID: <20261102144018.3212223-10-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630831614154100 This property was deprecated in commit 6815bc1d03c (qapi/qom: Add ObjectOptions for rng-*, deprecate 'opened') in v6.0.0. Commit 6e577937485 (rng: make opened property read-only) in v7.1.0 made it read-only, and also moved the its entry from docs/about/deprecated.rst to docs/about/removed-features.rst. I have no idea why it made the property read-only instead of dropping it. Signed-off-by: Markus Armbruster Message-ID: <20261028152612.953491-1-armbru@redhat.com> Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Laurent Vivier --- qapi/qom.json | 22 ---------------------- backends/rng.c | 11 ----------- 2 files changed, 33 deletions(-) diff --git a/qapi/qom.json b/qapi/qom.json index 4810d53e58..2a98b1de5f 100644 --- a/qapi/qom.json +++ b/qapi/qom.json @@ -925,25 +925,6 @@ 'data': { 'pci-bus': 'str', 'node': 'uint32' } } =20 -## -# @RngProperties: -# Properties for objects of classes derived from rng. -# -# @opened: if true, the device is opened immediately when applying -# this option and will probably fail when processing the next -# option. Don't use; only provided for compatibility. -# (default: false) -# -# Features: -# -# @deprecated: Member @opened is deprecated. Setting true doesn't -# make sense, and false is already the default. -# -# Since: 1.3 -## -{ 'struct': 'RngProperties', - 'data': { '*opened': { 'type': 'bool', 'features': ['deprecated'] } } } - ## # @RngEgdProperties: # Properties for rng-egd objects. @@ -954,7 +935,6 @@ # Since: 1.3 ## { 'struct': 'RngEgdProperties', - 'base': 'RngProperties', 'data': { 'chardev': 'str' } } =20 ## @@ -967,7 +947,6 @@ # Since: 1.3 ## { 'struct': 'RngRandomProperties', - 'base': 'RngProperties', 'data': { '*filename': 'str' }, 'if': 'CONFIG_POSIX' } =20 @@ -1372,7 +1351,6 @@ 'pr-manager-helper': { 'type': 'PrManagerHelperProperties', 'if': 'CONFIG_LINUX' }, 'qtest': 'QtestProperties', - 'rng-builtin': 'RngProperties', 'rng-egd': 'RngEgdProperties', 'rng-random': { 'type': 'RngRandomProperties', 'if': 'CONFIG_POSIX' }, diff --git a/backends/rng.c b/backends/rng.c index bc9c7a5ab3..08d57e47ab 100644 --- a/backends/rng.c +++ b/backends/rng.c @@ -41,13 +41,6 @@ void rng_backend_request_entropy(RngBackend *s, size_t s= ize, } } =20 -static bool rng_backend_prop_get_opened(Object *obj, Error **errp) -{ - RngBackend *s =3D RNG_BACKEND(obj); - - return s->opened; -} - static void rng_backend_complete(UserCreatable *uc, Error **errp) { RngBackend *s =3D RNG_BACKEND(uc); @@ -123,10 +116,6 @@ static void rng_backend_class_init(ObjectClass *oc, co= nst void *data) UserCreatableClass *ucc =3D USER_CREATABLE_CLASS(oc); =20 ucc->complete =3D rng_backend_complete; - - object_class_property_add_bool(oc, "opened", - rng_backend_prop_get_opened, - NULL); } =20 static const TypeInfo rng_backend_info =3D { --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630970; cv=none; d=zohomail.com; s=zohoarc; b=S4tl05DGlzs16uy+7Ji47/vQ9XlkcH1N0+i4whmJW5SqBq/ZzqyNHYEdNdCSqdXQtfEjeVz3e0yKD8vz7gyWl/g/ny2+AYsQNYNPWuqeg/jwP6IE+JlsRp46Ayt/j2CcV1y+Bz1lyQBUb0Nz8LvYWh7TLjA9/1dB3TP0tU3RxCc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630970; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cFy744EbTKaof+XnsyO8USs/Oj5iICBKu5ik0mEUYt0=; b=Zra9IxdtL+7nML0EpQlCochtLVrd6emie4b36P12auGcsKsNSJYqa94mAlPdSlQytFbFJ1AxyU39d6eE/rA+qSyqFZ2/Q7phxFWhRoYe9oxPKY/AACzeSRV/nQTAF1Ot2cVeSdJlegob0G9Zb4GjYWu+PqN4eCeJpdqnrEs6ZBo= 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 1793630970183798.858556266337; Mon, 2 Nov 2026 06:49:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtF6-0005gT-Gg; Mon, 02 Nov 2026 09:42:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD5-0003CA-Tf for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:36 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD4-0008QV-0Z for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:31 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-695-qrjkENfvOce7OlH3CVxZMA-1; Mon, 02 Nov 2026 09:40:26 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 07F5E180AC6C; Mon, 2 Nov 2026 14:40:25 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 715DD1956087; Mon, 2 Nov 2026 14:40:24 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 1647921E688A; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cFy744EbTKaof+XnsyO8USs/Oj5iICBKu5ik0mEUYt0=; b=jNw0joyZeRc5VuV9/388qICuexYsYUeCOdTBI0P5SsETerO/9hexvLLocTwaYsbu1kWl0n j+cjsewBOCWehgf0pAanVEh794YysAozm7PeVZcWHEDKCBRertD1iciqtXTe+JUmncoYkF LTVH0EKX67/6T45nnBmAgKivASDUtoY= X-MC-Unique: qrjkENfvOce7OlH3CVxZMA-1 X-Mimecast-MFC-AGG-ID: qrjkENfvOce7OlH3CVxZMA_1793630425 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 10/74] qapi: make 'CompatPolicy' the first arg in compat_policy_input_ok Date: Mon, 2 Nov 2026 15:39:14 +0100 Message-ID: <20261102144018.3212223-11-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630971216158500 From: Daniel P. Berrang=C3=A9 The typical API design pattern is for a method to be named after the type of the first arg passed into the method. For the compat_policy_input_ok method, this points towards 'CompatPolicy' being the first arg, matching compat_policy_check_security. Signed-off-by: Daniel P. Berrang=C3=A9 Message-ID: <20261030141713.2841710-2-berrange@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- include/qapi/compat-policy.h | 4 ++-- qapi/qapi-util.c | 16 ++++++++-------- qapi/qapi-visit-core.c | 4 ++-- qapi/qmp-dispatch.c | 2 +- qapi/qobject-input-visitor.c | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/qapi/compat-policy.h b/include/qapi/compat-policy.h index f5af209069..df87d71643 100644 --- a/include/qapi/compat-policy.h +++ b/include/qapi/compat-policy.h @@ -18,8 +18,8 @@ =20 extern CompatPolicy compat_policy; =20 -bool compat_policy_input_ok(uint64_t features, - const CompatPolicy *policy, +bool compat_policy_input_ok(const CompatPolicy *policy, + uint64_t features, ErrorClass error_class, const char *kind, const char *name, Error **errp); diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c index 38b1cec7a4..93898f57a0 100644 --- a/qapi/qapi-util.c +++ b/qapi/qapi-util.c @@ -19,8 +19,8 @@ =20 CompatPolicy compat_policy; =20 -static bool compat_policy_input_ok1(const char *adjective, - CompatPolicyInput policy, +static bool compat_policy_input_ok1(CompatPolicyInput policy, + const char *adjective, ErrorClass error_class, const char *kind, const char *name, Error **errp) @@ -38,21 +38,21 @@ static bool compat_policy_input_ok1(const char *adjecti= ve, } } =20 -bool compat_policy_input_ok(uint64_t features, - const CompatPolicy *policy, +bool compat_policy_input_ok(const CompatPolicy *policy, + uint64_t features, ErrorClass error_class, const char *kind, const char *name, Error **errp) { if ((features & 1u << QAPI_DEPRECATED) - && !compat_policy_input_ok1("Deprecated", - policy->deprecated_input, + && !compat_policy_input_ok1(policy->deprecated_input, + "Deprecated", error_class, kind, name, errp)) { return false; } if ((features & (1u << QAPI_UNSTABLE)) - && !compat_policy_input_ok1("Unstable", - policy->unstable_input, + && !compat_policy_input_ok1(policy->unstable_input, + "Unstable", error_class, kind, name, errp)) { return false; } diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c index 706c61e026..66d57dd447 100644 --- a/qapi/qapi-visit-core.c +++ b/qapi/qapi-visit-core.c @@ -410,8 +410,8 @@ static bool input_type_enum(Visitor *v, const char *nam= e, int *obj, } =20 if (lookup->features - && !compat_policy_input_ok(lookup->features[value], - &v->compat_policy, + && !compat_policy_input_ok(&v->compat_policy, + lookup->features[value], ERROR_CLASS_GENERIC_ERROR, "value", enum_str, errp)) { return false; diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c index 965cad6499..f2fb8f7976 100644 --- a/qapi/qmp-dispatch.c +++ b/qapi/qmp-dispatch.c @@ -185,7 +185,7 @@ QDict *coroutine_mixed_fn qmp_dispatch(const QmpCommand= List *cmds, QObject *requ "The command %s has not been found", command); goto out; } - if (!compat_policy_input_ok(cmd->features, &compat_policy, + if (!compat_policy_input_ok(&compat_policy, cmd->features, ERROR_CLASS_COMMAND_NOT_FOUND, "command", command, &err)) { goto out; diff --git a/qapi/qobject-input-visitor.c b/qapi/qobject-input-visitor.c index c52d36997d..17d91746d3 100644 --- a/qapi/qobject-input-visitor.c +++ b/qapi/qobject-input-visitor.c @@ -667,7 +667,7 @@ static bool qobject_input_policy_reject(Visitor *v, con= st char *name, uint64_t features, Error **errp) { - return !compat_policy_input_ok(features, &v->compat_policy, + return !compat_policy_input_ok(&v->compat_policy, features, ERROR_CLASS_GENERIC_ERROR, "parameter", name, errp); } --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630518; cv=none; d=zohomail.com; s=zohoarc; b=iAQE7sLPUA81NUag0p7nK/5F/J0/dJtnqvkBwVtr6yGSXLtvz0hleFpw90N9IKCfPG+rreuvSIfTTbzrrPq2OWWrL57YWHhfs8WkzDMzBMgTFo0wHjubPPcr875f/BXFg/w8vhlx1l4eyqRn3ftrXMMWo/3Mx7e/rGCS4PcwBPg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630518; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JdqFzmVVYGEziw8l4vB0HednyO2pPO+OjJhxsWZ61YM=; b=juWIr618iU4mr7iQqNKE295IzeCOZgEfZHYUb37EMCOn2BH/UOi9hF+/suwLaMRAXEmGl1eI3yitXg1zphfyex44j1Xdo0JvtJtn4ZKw1duRJX3NJa2KjrMyFY443KJph0AozpAwQ9R3L4gq+Uu5x9axi7NaF5jXXi2eWDrebIA= 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 1793630518805383.4976331552849; Mon, 2 Nov 2026 06:41:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDw-0003ZF-0L; Mon, 02 Nov 2026 09:41:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD4-0003Bm-Ow for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD1-0008PH-PU for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:30 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-179-_xC2qiVFN4OSghuRTEsoLw-1; Mon, 02 Nov 2026 09:40:25 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C0E4A1802159; Mon, 2 Nov 2026 14:40:24 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7B3BD300019F; Mon, 2 Nov 2026 14:40:24 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 18C6021E688B; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JdqFzmVVYGEziw8l4vB0HednyO2pPO+OjJhxsWZ61YM=; b=FtVhZYlI6WmPB0QPMtEYp5MvbqLbAk9TdUZkBHhzdXOOdGE9oCHlSqhQ5Qu5eCLXdD0O+B u4cJq72lAgMOC+CJ3A3pxnwlrQ6/WmaJf0xTeR/FRVH0OASNTPPwWGyWTI9hioWC2+vAfI MgyMeDUEvaOZDbD2Vw2bU6LHGL60G4s= X-MC-Unique: _xC2qiVFN4OSghuRTEsoLw-1 X-Mimecast-MFC-AGG-ID: _xC2qiVFN4OSghuRTEsoLw_1793630424 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 11/74] qapi: add 'warn' option to CompatPolicyInput Date: Mon, 2 Nov 2026 15:39:15 +0100 Message-ID: <20261102144018.3212223-12-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630526875154100 From: Daniel P. Berrang=C3=A9 This prints a warning on stderr every time a policy violation is encountered, but accepts the input. Warning every time is known to be annoying and sub-optimal, but the normal trick of using warn_report_once() isn't possible in this scenario. As a result 'warn' is not set as the default policy at this time, despite other manually placed deprecation warnings being emitted by default. Future work will consider ways to reduce the warnings to be once only, which would unlock the ability to use 'warn' by default. Signed-off-by: Daniel P. Berrang=C3=A9 Message-ID: <20261030141713.2841710-3-berrange@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- qapi/compat.json | 7 ++++++- qapi/qapi-util.c | 4 ++++ qemu-options.hx | 14 ++++++++++---- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/qapi/compat.json b/qapi/compat.json index d1fb74abf7..b183be15d4 100644 --- a/qapi/compat.json +++ b/qapi/compat.json @@ -17,10 +17,15 @@ # # @crash: abort() the process # +# @warn: Accept with warnings printed to stderr (Since: 11.2) +# +# .. note:: at this time, warnings will be printed on every policy +# check failure rather than once only. +# # Since: 6.0 ## { 'enum': 'CompatPolicyInput', - 'data': [ 'accept', 'reject', 'crash' ] } + 'data': [ 'accept', 'reject', 'crash', 'warn' ] } =20 ## # @CompatPolicyOutput: diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c index 93898f57a0..fe0a6a57c8 100644 --- a/qapi/qapi-util.c +++ b/qapi/qapi-util.c @@ -28,6 +28,10 @@ static bool compat_policy_input_ok1(CompatPolicyInput po= licy, switch (policy) { case COMPAT_POLICY_INPUT_ACCEPT: return true; + case COMPAT_POLICY_INPUT_WARN: + warn_report("%s %s %s accepted by policy", + adjective, kind, name); + return true; case COMPAT_POLICY_INPUT_REJECT: error_set(errp, error_class, "%s %s %s disabled by policy", adjective, kind, name); diff --git a/qemu-options.hx b/qemu-options.hx index f72f30e246..854341e7a0 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4693,9 +4693,9 @@ DEFHEADING() DEFHEADING(Debug/Expert options:) =20 DEF("compat", HAS_ARG, QEMU_OPTION_compat, - "-compat [deprecated-input=3Daccept|reject|crash][,deprecated-output= =3Daccept|hide]\n" + "-compat [deprecated-input=3Daccept|reject|crash|warn][,deprecated-out= put=3Daccept|hide]\n" " Policy for handling deprecated management interfaces\= n" - "-compat [unstable-input=3Daccept|reject|crash][,unstable-output=3Dacc= ept|hide]\n" + "-compat [unstable-input=3Daccept|reject|crash|warn][,unstable-output= =3Daccept|hide]\n" " Policy for handling unstable management interfaces\n", QEMU_ARCH_ALL) SRST @@ -4703,7 +4703,10 @@ SRST Set policy for handling deprecated management interfaces (experimental= ): =20 ``deprecated-input=3Daccept`` (default) - Accept deprecated commands and arguments + Accept deprecated commands and arguments silently + ``deprecated-input=3Dwarn`` + Accept deprecated commands and arguments with repeated warnings + on stderr ``deprecated-input=3Dreject`` Reject deprecated commands and arguments ``deprecated-input=3Dcrash`` @@ -4719,7 +4722,10 @@ SRST Set policy for handling unstable management interfaces (experimental): =20 ``unstable-input=3Daccept`` (default) - Accept unstable commands and arguments + Accept unstable commands and arguments silently + ``unstable-input=3Dwarn`` + Accept unstable commands and arguments with repeated warnings + on stderr ``unstable-input=3Dreject`` Reject unstable commands and arguments ``unstable-input=3Dcrash`` --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630647; cv=none; d=zohomail.com; s=zohoarc; b=ZHYXOc+8zLPRCb/Y2cr1R7EY/8mwF9Tp+RU4d+ElSqxv4NarNk4SK4U1DCvyFmLqpoyB51Afu/K97uLU5ovphRuj+Daql23pX1zDWXgGT6aPjZAJ6c4QLJOfgy/yiZmVanWvNSRcQ7xD4TG0VSkXcsHZOJaxswqjgQtbJxfsMbo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630647; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9Fgwapp/v0iLff1537axWKnYSr0vE08VOoQpRDT2G50=; b=YW9QNtxtfaYkL6Aq9YrY5Xa5MqZShEuYxXOj51ITH6H7LvontysjfM2prz+hg+9p+QgrChV9zbUCxSNM/1f5O3XzDl32MAu+u/JBCtRoZYrAgWUVKirY23PZ66/XnB2o5jH+kTILFvTX+RPi60HsFWbFvkYC6llhEr+Vb18foqc= 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 1793630647510726.9960861084269; Mon, 2 Nov 2026 06:44:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtE5-0003ee-Nr; Mon, 02 Nov 2026 09:41:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD4-0003BW-1z for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD1-0008PF-P9 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:29 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-169-xzXVn1FeP2CShu4AfDhI9A-1; Mon, 02 Nov 2026 09:40:25 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B77C8195D00C; Mon, 2 Nov 2026 14:40:24 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 451B630000E7; Mon, 2 Nov 2026 14:40:24 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 1D4AB21E688D; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9Fgwapp/v0iLff1537axWKnYSr0vE08VOoQpRDT2G50=; b=C6lNuFlPEbLoz1BIsLHGJGteGeAl/nFLDa61Xbl+KIrcEk9/GgW61ByOflaE8GoVJAlriY ZoxwYVk0B4G3R8xEbWSVbXbe7CHlJvbh4ZHA/w3XvPmxcm3FO2Loz+h3B3ODEL4+fiXKxy eJ/ZWoITaWsOO0OqOKidtAtbsC6ohHQ= X-MC-Unique: xzXVn1FeP2CShu4AfDhI9A-1 X-Mimecast-MFC-AGG-ID: xzXVn1FeP2CShu4AfDhI9A_1793630424 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 12/74] qapi: rename 'insecure-types' to 'insecure-input' Date: Mon, 2 Nov 2026 15:39:16 +0100 Message-ID: <20261102144018.3212223-13-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630649500158500 From: Daniel P. Berrang=C3=A9 This provides better conceptual naming alignment with other -compat flags. Signed-off-by: Daniel P. Berrang=C3=A9 Message-ID: <20261030141713.2841710-4-berrange@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- docs/system/security.rst | 2 +- qapi/compat.json | 4 ++-- qapi/qapi-util.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/system/security.rst b/docs/system/security.rst index 75e39caede..e211fdd234 100644 --- a/docs/system/security.rst +++ b/docs/system/security.rst @@ -168,7 +168,7 @@ eligible for CVE assignment. Annotations will be extend= ed to other backend and object types over time, to make their security status explicit. =20 It is possible to control or identify the usage of types that do not offer -an explicit security boundary using the ``insecure-types`` parameter to the +an explicit security boundary using the ``insecure-input`` parameter to the ``-compat`` argument, which accepts three values: =20 * accept: usage of any type will be permitted. This is the current diff --git a/qapi/compat.json b/qapi/compat.json index b183be15d4..7146eab6b9 100644 --- a/qapi/compat.json +++ b/qapi/compat.json @@ -73,7 +73,7 @@ # @unstable-output: how to handle unstable output (default 'accept') # (since 6.2) # -# @insecure-types: how to handle types that are not declared secure +# @insecure-input: how to handle types that are not declared secure # (default 'accept') (since 11.2) # # Limitation: @deprecated-input, @deprecated-output, @unstable-input, @@ -91,4 +91,4 @@ '*deprecated-output': 'CompatPolicyOutput', '*unstable-input': 'CompatPolicyInput', '*unstable-output': 'CompatPolicyOutput', - '*insecure-types': 'CompatPolicySecurity' } } + '*insecure-input': 'CompatPolicySecurity' } } diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c index fe0a6a57c8..e5d8662f8b 100644 --- a/qapi/qapi-util.c +++ b/qapi/qapi-util.c @@ -72,7 +72,7 @@ bool compat_policy_check_security(const CompatPolicy *pol= icy, return true; } =20 - switch (policy->insecure_types) { + switch (policy->insecure_input) { case COMPAT_POLICY_SECURITY_ACCEPT: return true; =20 --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630582; cv=none; d=zohomail.com; s=zohoarc; b=UMv5mQL2RTn2wN7iFwWcb1gxX0H0kzLvs3LD0ffRD5/fSo4y7M/bu0OipbGGFiRvRcSmde32/CxcJASydokNb5DAtyZyKZ6Rm/htd6OauDnfSCkmJExjhGh1XiLh2R9Utde/ZEClYTAmduF9ZNlY+1KY8hXC9IUpQ16Wi12YdE0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630582; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=332r771SEtrMdRKM5twMkzBlQ+3eXs1IGKYZ2+XQir8=; b=YTDIxk52OrAsxi0/Yf19JD/ZUWywn7XRnX163YgxQXPfdMfeZlpLrmswcDF8IV2oYKlPXSg88RuTY+kPV90Nf2egbns5PSLmfSMHK1KcnzYMGRdqkMq5EgFt0NkrMs3a1uWRWwn/QzR08QLb3+aV5nmPHeo/Vk8tJVPI6p6RI0I= 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 1793630582397345.6936559534082; Mon, 2 Nov 2026 06:43:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDZ-0003Pl-L7; Mon, 02 Nov 2026 09:41:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD3-0003Ag-8S for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD1-0008PB-MQ for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:29 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-169-bEe3EZC7Nk2FN41tLg5nFQ-1; Mon, 02 Nov 2026 09:40:25 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9E0CF19539AA; Mon, 2 Nov 2026 14:40:24 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5CD1C7E3; Mon, 2 Nov 2026 14:40:24 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 21ADD21E6890; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=332r771SEtrMdRKM5twMkzBlQ+3eXs1IGKYZ2+XQir8=; b=CKg3evGH2++sbb6SUsCWfOAb/on9UJMtmDPhdujendCE0TqYPIQp4rqvjy7X/K/VZJlneZ gReDG3xTcpyGyNrLVj2hEiD6vduaiSOlF4pnas0/UwhaL8NOMr5O+KrlCiJCJkn3OBgkYp yw2O9hDfIYyKjT/4TozYtenNSGhxLRk= X-MC-Unique: bEe3EZC7Nk2FN41tLg5nFQ-1 X-Mimecast-MFC-AGG-ID: bEe3EZC7Nk2FN41tLg5nFQ_1793630424 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 13/74] qapi: drop CompatPolicySecurity and use CompatPolicyInput Date: Mon, 2 Nov 2026 15:39:17 +0100 Message-ID: <20261102144018.3212223-14-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630583493154100 From: Daniel P. Berrang=C3=A9 With 'CompatPolicyInput' gaining a 'warn' option, the 'insecure-input' option can use the 'CompatPolicySecurity' type, dropping the former. This replacement means that the 'insecure-input' option gains the ability use the 'crash' policy option. Note the error message for insecure-input changes from Type 'rtl8139' does not provide a security boundary to protect against untrusted data or actions To Insecure QOM type rtl8139 disabled by policy This type does does not provide a security boundary to protect against untrusted data or actions Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-ID: <20261030141713.2841710-5-berrange@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- qapi/compat.json | 18 +----------------- qapi/qapi-util.c | 26 +++++++++++--------------- 2 files changed, 12 insertions(+), 32 deletions(-) diff --git a/qapi/compat.json b/qapi/compat.json index 7146eab6b9..df7d1109c3 100644 --- a/qapi/compat.json +++ b/qapi/compat.json @@ -40,22 +40,6 @@ { 'enum': 'CompatPolicyOutput', 'data': [ 'accept', 'hide' ] } =20 -## -# @CompatPolicySecurity: -# Policy for handling any devices or backends which do not provide -# a security boundary to protect against untrusted environments -# -# @accept: Allow any usage -# -# @reject: Reject with an error reported -# -# @warn: Allow any usage, with a warning reported -# -# Since: 11.2 -## -{ 'enum': 'CompatPolicySecurity', - 'data': [ 'accept', 'reject', 'warn' ] } - ## # @CompatPolicy: # Policy for handling problematic management interfaces. @@ -91,4 +75,4 @@ '*deprecated-output': 'CompatPolicyOutput', '*unstable-input': 'CompatPolicyInput', '*unstable-output': 'CompatPolicyOutput', - '*insecure-input': 'CompatPolicySecurity' } } + '*insecure-input': 'CompatPolicyInput' } } diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c index e5d8662f8b..e8ecc7346b 100644 --- a/qapi/qapi-util.c +++ b/qapi/qapi-util.c @@ -16,6 +16,7 @@ #include "qemu/ctype.h" #include "qemu/error-report.h" #include "qapi/qmp/qerror.h" +#include "qapi/error.h" =20 CompatPolicy compat_policy; =20 @@ -68,27 +69,22 @@ bool compat_policy_check_security(const CompatPolicy *p= olicy, bool is_secure, Error **errp) { + ERRP_GUARD(); + if (is_secure) { return true; } =20 - switch (policy->insecure_input) { - case COMPAT_POLICY_SECURITY_ACCEPT: - return true; - - case COMPAT_POLICY_SECURITY_REJECT: - error_setg(errp, "Type '%s' does not provide a security boundary " - "to protect against untrusted data or actions", typenam= e); + if (!compat_policy_input_ok1(policy->insecure_input, + "Insecure", + ERROR_CLASS_GENERIC_ERROR, + "QOM type", typename, errp)) { + error_append_hint(errp, "This type does does not provide a " + "security boundary to protect against " + "untrusted data or actions\n"); return false; - - case COMPAT_POLICY_SECURITY_WARN: - warn_report("Type '%s' does not provide a security boundary " - "to protect against untrusted data or actions", typena= me); - return true; - - default: - g_assert_not_reached(); } + return true; } =20 =20 --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793631090; cv=none; d=zohomail.com; s=zohoarc; b=Tsv5Uzd6x83i3s1dyP6JoHF9XSSDDBfy7bQlTGylHpmhKVZLX24j7L8/mzX94Uvu+K/bsznKmt/Fyg2vPSChd2tfT7wLCpi/OAAJrG4icYtTdh3JNqDdEngf5fTOnOLZIvLDLF13ggY2LDhxamRVcqCLPHaP3LJRwkz2v5LmEk4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631090; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZtvJzBDcRQmk60jxe7Q6/yBekI3ODcS2Rl00ZPeI4kE=; b=D/pGSfkDM1ZS7X2cOr565jB6UB2nvFGKUWjEEOb/rQMDOL5xedtz/7x1TLVBvkMpRqmQ6J6s7VlcCH5Yur3g9/3GIvw7l97YHlV6sHVCObTLa3IgyYlILYpHlAbj1qiZPZ3b/bpYhg5Fvccvz9fpbmFSPEYe/pI51OI1QZJ/RKs= 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 1793631090689871.6522347179028; Mon, 2 Nov 2026 06:51:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDd-0003Qd-DP; Mon, 02 Nov 2026 09:41:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD4-0003Be-6R for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD1-0008PN-Ry for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:29 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-392-xrPar-XSOBmOrWctbvbi6w-1; Mon, 02 Nov 2026 09:40:25 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A2155195D023; Mon, 2 Nov 2026 14:40:24 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 61D1218004D2; Mon, 2 Nov 2026 14:40:24 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 25FF121E6892; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZtvJzBDcRQmk60jxe7Q6/yBekI3ODcS2Rl00ZPeI4kE=; b=MtslUjIFnJa2IbM/A/smQZ6Hi00TlDY1pqx0YeEMoDb1sq4UEWVoHcKLIsFEnOmPvyia9d FA7NOUEoxGWtaLYY7M/i0g15qPEwVjHEjxaaajviz1+yVmWB/r9hhb0kbLbVOTxNk36XET +zLn5M3+d1jl9ZhjPL7Bl/9cCqcb9ZI= X-MC-Unique: xrPar-XSOBmOrWctbvbi6w-1 X-Mimecast-MFC-AGG-ID: xrPar-XSOBmOrWctbvbi6w_1793630424 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 14/74] qapi: rename compat_policy_check_security method Date: Mon, 2 Nov 2026 15:39:18 +0100 Message-ID: <20261102144018.3212223-15-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793631091407158500 From: Daniel P. Berrang=C3=A9 Rename to compat_policy_security_ok to match the naming convention established by compat_policy_input_ok. Signed-off-by: Daniel P. Berrang=C3=A9 Message-ID: <20261030141713.2841710-6-berrange@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- include/qapi/compat-policy.h | 8 ++++---- qapi/qapi-util.c | 8 ++++---- qom/object.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/qapi/compat-policy.h b/include/qapi/compat-policy.h index df87d71643..b7b543ffe7 100644 --- a/include/qapi/compat-policy.h +++ b/include/qapi/compat-policy.h @@ -24,10 +24,10 @@ bool compat_policy_input_ok(const CompatPolicy *policy, const char *kind, const char *name, Error **errp); =20 -bool compat_policy_check_security(const CompatPolicy *policy, - const char *typename, - bool is_secure, - Error **errp); +bool compat_policy_security_ok(const CompatPolicy *policy, + const char *typename, + bool is_secure, + Error **errp); =20 /* * Create a QObject input visitor for @obj for use with QMP diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c index e8ecc7346b..806533c7b3 100644 --- a/qapi/qapi-util.c +++ b/qapi/qapi-util.c @@ -64,10 +64,10 @@ bool compat_policy_input_ok(const CompatPolicy *policy, return true; } =20 -bool compat_policy_check_security(const CompatPolicy *policy, - const char *typename, - bool is_secure, - Error **errp) +bool compat_policy_security_ok(const CompatPolicy *policy, + const char *typename, + bool is_secure, + Error **errp) { ERRP_GUARD(); =20 diff --git a/qom/object.c b/qom/object.c index 96498f3d00..ceb8e9eebe 100644 --- a/qom/object.c +++ b/qom/object.c @@ -3276,10 +3276,10 @@ void object_class_property_set_description(ObjectCl= ass *klass, =20 bool object_class_check_security(ObjectClass *klass, Error **errp) { - return compat_policy_check_security(&compat_policy, - object_class_get_name(klass), - object_class_is_secure(klass), - errp); + return compat_policy_security_ok(&compat_policy, + object_class_get_name(klass), + object_class_is_secure(klass), + errp); } =20 static void object_class_init(ObjectClass *klass, const void *data) --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630958; cv=none; d=zohomail.com; s=zohoarc; b=TsReIQhFzy8lnfQMhy1icP6PNWYqDln/z0WBeY0spqv3EIujrzJL745094p9qAyo6qqFGo40NEob4VdVj0lOFSbLcLi87iB03lHyGzUILL4d28IUr1Xw+f56MOcWa7sd4VGILDmqmaIQCgRCIFmDcx2jNNN0gfL2ulJD5fxFMlo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630958; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Ok4YTAFMKrXKggBO/aC5h4edgAB8BP+176APe+RvX2U=; b=OP/wTJrJg117GlEspX1mB0mlhBW5v22DqXiRofPEJ7/wvpJYs2m8TWHWBL5CgCvtxq0WTb6YwjqOHY93gGVqWqNO/2PlitM4YTorryGWQoFymmi7h+lEXDMZpA/SlAmGVYfsSeTaw5RQaJLXLpIst9ZAHA9YFZcy2cMi1DkQfCo= 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 1793630958740942.9056860861048; Mon, 2 Nov 2026 06:49:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtEC-00044I-Ol; Mon, 02 Nov 2026 09:41:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDA-0003Cx-Gf for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD6-0008S1-DG for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:35 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-618-zfJ8Ul6RN6q9Jj2fR0R9Jw-1; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 48EC2180A9DA; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 09C695BC; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2A4A421E6893; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ok4YTAFMKrXKggBO/aC5h4edgAB8BP+176APe+RvX2U=; b=EdjS1b2KZRgOSxToxVGpkMzZszbPgFJIJNfKzNHA6ljJYJja8MPg4on6Srtyi2ikspGVhb w39BoLHwaEANVpnFl9KqWDEqFMBBLdGIB4BRQxmhwuLiNavd3YoNx/U6ZSc0lDrYZ8jR8c sQn4WSluZhD1MckG049HWUrY8uyHgk0= X-MC-Unique: zfJ8Ul6RN6q9Jj2fR0R9Jw-1 X-Mimecast-MFC-AGG-ID: zfJ8Ul6RN6q9Jj2fR0R9Jw_1793630427 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 15/74] qapi: reverse arg order in compat_policy_security_ok Date: Mon, 2 Nov 2026 15:39:19 +0100 Message-ID: <20261102144018.3212223-16-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630960956158500 From: Daniel P. Berrang=C3=A9 Match the compat_policy_input_ok design more closely by having the "relevant facts" being checked as the 2nd argument. Signed-off-by: Daniel P. Berrang=C3=A9 Message-ID: <20261030141713.2841710-7-berrange@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- include/qapi/compat-policy.h | 2 +- qapi/qapi-util.c | 2 +- qom/object.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/qapi/compat-policy.h b/include/qapi/compat-policy.h index b7b543ffe7..53c96ce1a2 100644 --- a/include/qapi/compat-policy.h +++ b/include/qapi/compat-policy.h @@ -25,8 +25,8 @@ bool compat_policy_input_ok(const CompatPolicy *policy, Error **errp); =20 bool compat_policy_security_ok(const CompatPolicy *policy, - const char *typename, bool is_secure, + const char *typename, Error **errp); =20 /* diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c index 806533c7b3..29d01653e7 100644 --- a/qapi/qapi-util.c +++ b/qapi/qapi-util.c @@ -65,8 +65,8 @@ bool compat_policy_input_ok(const CompatPolicy *policy, } =20 bool compat_policy_security_ok(const CompatPolicy *policy, - const char *typename, bool is_secure, + const char *typename, Error **errp) { ERRP_GUARD(); diff --git a/qom/object.c b/qom/object.c index ceb8e9eebe..30699f9127 100644 --- a/qom/object.c +++ b/qom/object.c @@ -3277,8 +3277,8 @@ void object_class_property_set_description(ObjectClas= s *klass, bool object_class_check_security(ObjectClass *klass, Error **errp) { return compat_policy_security_ok(&compat_policy, - object_class_get_name(klass), object_class_is_secure(klass), + object_class_get_name(klass), errp); } =20 --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630656; cv=none; d=zohomail.com; s=zohoarc; b=NydHkU+ifHXNNYhgNgtYgCleHkPf0bkem36+SOF8OfnoXAYe1m5fFiKpi7abV7+Ah4kJ2miYJAH7KOrrMMwYf2/xhPELCvvR8AbD3iOhCctDX9/YU94BMhok29X6d8k9PQE8WLQ2pPy2MO6mwcXclPf48juKrdeuH302z3pkts0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630656; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1s/mvrx1q0S5I50XUQhf0u/EhOrFqP6tNTATwJHH3RU=; b=i60vm2ZXDFX2eQatGSZ8BzRflO/xXFKf/NVrtvPef8e+4qWFZHedffdcisRDQ/tv7SphJgt9M9S3j8ca7vxqnf4dETsuDJQXb/GZCq88s6IYJ3dV8MPEpfz+xSrC3Rj3A8Iy3yob96vJWVavK3NI2qGFZDpNEjewPgzBzPpBjqE= 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 1793630656629794.979615308551; Mon, 2 Nov 2026 06:44:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDc-0003QX-Qf; Mon, 02 Nov 2026 09:41:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD9-0003Cq-6f for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD5-0008Ro-Us for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:34 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-461-zMetqqBTMSGu-zEoY-TseA-1; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3B78D1954102; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EF1AA1800677; Mon, 2 Nov 2026 14:40:26 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2E9C421E6894; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1s/mvrx1q0S5I50XUQhf0u/EhOrFqP6tNTATwJHH3RU=; b=fSFFAkuWk7ayeDRivYv85i50n+5rum9v3Zw2pbBanWPZYSSXBed5Z6afA13w7ImF3Qwta0 loawIdUNLsNjBZ6Av9TDfMvGZdpgzA9CWuyBxdBHJ2Rg5+Y/uORKqsYvZbSkCfkI1v1I/D 0JxXs+cVB9ks5hjaQq7r1Lgd65wIL0g= X-MC-Unique: zMetqqBTMSGu-zEoY-TseA-1 X-Mimecast-MFC-AGG-ID: zMetqqBTMSGu-zEoY-TseA_1793630427 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 16/74] qemu-options: document -compat insecure-input parameter Date: Mon, 2 Nov 2026 15:39:20 +0100 Message-ID: <20261102144018.3212223-17-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630658583154100 From: Daniel P. Berrang=C3=A9 This adds documentation for the previously added 'insecure-input' parameter to -compat, which controls policy for insecure configuration requests. Signed-off-by: Daniel P. Berrang=C3=A9 Message-ID: <20261030141713.2841710-8-berrange@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster [Doc text typo fixed] Signed-off-by: Markus Armbruster --- qemu-options.hx | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index 854341e7a0..5fe9d73eaa 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4696,7 +4696,9 @@ DEF("compat", HAS_ARG, QEMU_OPTION_compat, "-compat [deprecated-input=3Daccept|reject|crash|warn][,deprecated-out= put=3Daccept|hide]\n" " Policy for handling deprecated management interfaces\= n" "-compat [unstable-input=3Daccept|reject|crash|warn][,unstable-output= =3Daccept|hide]\n" - " Policy for handling unstable management interfaces\n", + " Policy for handling unstable management interfaces\n" + "-compat [insecure-input=3Daccept|reject|crash|warn]\n" + " Policy for handling insecure configuration requests\n= ", QEMU_ARCH_ALL) SRST ``-compat [deprecated-input=3D][,deprecated-output=3D]`` @@ -4736,6 +4738,25 @@ SRST Suppress unstable command results and events =20 Limitation: covers only syntactic aspects of QMP. + +``-compat [insecure-input=3D]`` + Set policy for handling insecure configuration requests: + + ``insecure-input=3Daccept`` (default) + Accept insecure configurations requests silently + ``insecure-input=3Dwarn`` + Accept insecure configuration requests with repeated warnings + on stderr + ``insecure-input=3Dreject`` + Reject insecure configuration requests + ``insecure-input=3Dcrash`` + Crash on insecure configuration requests + + Limitation: an insecure configuration is one where QEMU does + not provide a security boundary to protect against malicious + usage / untrusted data. Covers only user creatable QOM types + for devices, machine types and accelerators. Implicitly created + QOM types and parent types are not checked at this time. ERST =20 DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg, --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630647; cv=none; d=zohomail.com; s=zohoarc; b=SYY8wuEoiMznUXKbjQjgB19uGTiG7SFqPw6MGmyL66f2Ou2HFhbMuprSQX7RgZYnNvxtRP1CPjXrFxJB4UjZ9ouRDv2J7+O9dhEPfrcXEwyCQim6juU62Uh6oeCKY79PbjRAfuS/dhOuw0nU2c8+L0fB92fyXXsIy3ijhfbYHsQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630647; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6JEwzPFuhB5b4vJDRyOhOxziu9bh78D5MMKrJXO2rdI=; b=Nu40yFUeUcJfxGVpydSdDRBircgwA/HvFpYJWVvAbew8pJgfEL0bYRdakasSI2n50IA4GfAXexmnUyP9QQeBefzRgYuYFV1fRJfw8NOci5ob54gOxUQ4Vskjk92jj0Vt6EByA3YXaVU5rMA4VbJ3oRv3zHeUht2++6j213cLzWg= 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 1793630647937416.33739363552775; Mon, 2 Nov 2026 06:44:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDe-0003Qp-KW; Mon, 02 Nov 2026 09:41:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0003Cg-KT for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD4-0008Qr-IK for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:33 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-195-dmqP1cbJP9qHI_svq6HgiA-1; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 66DDB195D00D; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2720018004D2; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 32FBE21E6895; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6JEwzPFuhB5b4vJDRyOhOxziu9bh78D5MMKrJXO2rdI=; b=I9sUhndjNf0Z5jAekcvfQMDmYO8EBfKkPpQ1TKwLp8hHDG79/T5eLJ+yPSa13QmQrkgAXS JZ8NuNw1v6wFIGGOVi/AR7zZc3p2NBYMWr0TYhCiqqdflR2HuIs+5cYc2hDmezXc3Rtx2N SRhSgOyaseAx8LryTRDMmXKE2M22dkY= X-MC-Unique: dmqP1cbJP9qHI_svq6HgiA-1 X-Mimecast-MFC-AGG-ID: dmqP1cbJP9qHI_svq6HgiA_1793630427 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 17/74] qapi: print a message before aborting for -compat violations Date: Mon, 2 Nov 2026 15:39:21 +0100 Message-ID: <20261102144018.3212223-18-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630649491158500 From: Daniel P. Berrang=C3=A9 When using the 'crash' policy with -compat options, QEMU will abort() on a policy violation. All the user sees is a core dump though and while the stack trace will ultimately show what the violation was, it can be hard to reverse engineer the cause when variables are optimized out. If the crash is within a CI system, it can be even harder to determine what the cause was as a core dump may not be available. Printing a message when crashing is easier to diagnose when limited context is available. Signed-off-by: Daniel P. Berrang=C3=A9 Message-ID: <20261030141713.2841710-9-berrange@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- qapi/qapi-util.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c index 29d01653e7..7067b4ddf6 100644 --- a/qapi/qapi-util.c +++ b/qapi/qapi-util.c @@ -38,6 +38,9 @@ static bool compat_policy_input_ok1(CompatPolicyInput pol= icy, adjective, kind, name); return false; case COMPAT_POLICY_INPUT_CRASH: + error_report("%s %s %s disabled by policy, aborting", + adjective, kind, name); + /* fallthrough */ default: abort(); } --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630591; cv=none; d=zohomail.com; s=zohoarc; b=JU2JcZE7cd0HgvwmTOd4KX51VGiVexUUmFymbvcbrd9R5be+TxmYtlGP1hwjGgI4tIdgwKxKEkDPxUXWJkbqWpCfLioBDyTVkH4H3y9Rv9O/ZkJR/kvZvSbjTAUW//0zGf9DmLKneAbe+/9S3rHXR7k2C/FTaMYia8yc9mengF8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630591; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QeRm/AHNPeQvFEi2K+G5n11YZ7LPmUa7esM2HjTXHiE=; b=HW+zARqTgHe3/bd93hoFsXNxq2GRK/lnrGIY441G+7M8aeJqeexjf2rVc0aCkOgLBdHIB6u8QOHqrpNVeosYilYfGq8Fn5aEEuKJtN1x8pkjcaybhxsUa8z/pznuu7vdNnB4tOOorHqDQsLHpfFgVeoaMomF6a5/Id/NXDxWS88= 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 1793630591161214.42726370020205; Mon, 2 Nov 2026 06:43:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtEB-0003xy-1O; Mon, 02 Nov 2026 09:41:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDB-0003DF-Uq for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0008S8-9M for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:37 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-175-iM20B0WVN1Sh63mb7QcW5Q-1; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 73706195BDD0; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2C3BA1956088; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 374D921E6896; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QeRm/AHNPeQvFEi2K+G5n11YZ7LPmUa7esM2HjTXHiE=; b=NOmldUwisInUDDeP5sgcAOP/seISewUKvO6l89uors/3X26NPVXYNF00r3fCQ/8q4yrjek X7qljAdkCBXG64Ni7TKkgXr5xebOhE0DPd4U0AW5VK89IrOFCtbBGxIK/bPLGHiTF8qgqv EHyPMiJ0Fr1M4yvE73hHScU9UaB8gck= X-MC-Unique: iM20B0WVN1Sh63mb7QcW5Q-1 X-Mimecast-MFC-AGG-ID: iM20B0WVN1Sh63mb7QcW5Q_1793630427 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 18/74] qapi/schema: Rename .lookup_entity() and tighten return type Date: Mon, 2 Nov 2026 15:39:22 +0100 Message-ID: <20261102144018.3212223-19-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630592522158500 Commit 060b5a9323 (qapi: Dumb down QAPISchema.lookup_entity()) accidentally relaxed QAPISchema.lookup_entity()'s return type to QAPISchemaEntity. Tighten it back to QAPISchemaDefinition, and rename the method to .lookup_defn(). Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-ID: <20261101201717.3911097-2-armbru@redhat.com> --- docs/sphinx/qapidoc.py | 2 +- scripts/qapi/schema.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py index 54a32e45f7..31d09ed634 100644 --- a/docs/sphinx/qapidoc.py +++ b/docs/sphinx/qapidoc.py @@ -512,7 +512,7 @@ def transmogrify(self, schema: QAPISchema) -> nodes.Ele= ment: modules.add(module_source) =20 if doc.symbol: - ent =3D schema.lookup_entity(doc.symbol) + ent =3D schema.lookup_defn(doc.symbol) assert isinstance(ent, QAPISchemaDefinition) vis.visit_entity(ent) else: diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py index 8d88b40de2..9c9e257a8f 100644 --- a/scripts/qapi/schema.py +++ b/scripts/qapi/schema.py @@ -1184,11 +1184,11 @@ def _def_definition(self, defn: QAPISchemaDefinitio= n) -> None: defn.info, "%s is already defined" % other_defn.describe()) self._entity_dict[defn.name] =3D defn =20 - def lookup_entity(self, name: str) -> Optional[QAPISchemaEntity]: + def lookup_defn(self, name: str) -> Optional[QAPISchemaDefinition]: return self._entity_dict.get(name) =20 def lookup_type(self, name: str) -> Optional[QAPISchemaType]: - typ =3D self.lookup_entity(name) + typ =3D self.lookup_defn(name) if isinstance(typ, QAPISchemaType): return typ return None @@ -1324,7 +1324,7 @@ def _make_implicit_object_type( return None # See also QAPISchemaObjectTypeMember.describe() name =3D 'q_obj_%s-%s' % (name, role) - typ =3D self.lookup_entity(name) + typ =3D self.lookup_defn(name) if typ: assert isinstance(typ, QAPISchemaObjectType) # The implicit object type has multiple users. This can --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793631110; cv=none; d=zohomail.com; s=zohoarc; b=TpbK3PewMS/s4dJvceu2+wO/5+sXvaAhDaMYbm0V0Bng7QlwQqX8Azqz713/hATsiaDCrgikuq7ppaQLBreCTidEdzftSN50pBtfHZV10bnJWJJtg4jys4oXbreYsDHXccTYT4OyLpDMMwOXvxUFa06zZPzeV5RLFzR+R6DzgSI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631110; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BmSUShUmjzfb9fNNyF30AdUtyGVrWp9N7ej3ouDDLsI=; b=VeIo29Y/8zTV4D+jyxaou0wkoZr+E3uie+FNlpwsgu6IIfUx2LORxNGmj24PM5ZfEUYuyIDSA8HKI8YZ9IZ0dYCyism70kBHI8z80CYxRK/MqQlw1fsHHqq5up3wpoN2Y7ZsBx6OJExYd+724G6sZKns+Dektz/Cp82L0DKLP5Y= 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 179363111027328.585343011411396; Mon, 2 Nov 2026 06:51:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDd-0003Qg-Or; Mon, 02 Nov 2026 09:41:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDB-0003D2-7u for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD6-0008Rz-F9 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:36 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-465-0zJYdkmPM16fFX73XqVQVg-1; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8CBB4195BDE4; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0EA8326C; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3BC0B21E6897; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BmSUShUmjzfb9fNNyF30AdUtyGVrWp9N7ej3ouDDLsI=; b=QaM2NQmUldfk8RuLxDdC3T0hWY6l5bdzkrGB1Tzbp+Jc0vxyfDhRl1Knq+k1bP4NQ2zugX hAuRUhAvYe57zGrUsU4Yg25IFvLz/aBGx78pFSbsqtzFGcxl+FYvoMuJwdPe3moPAW66YB cnkDKVQYsOsAf34RHJLDYRfh/LKO//0= X-MC-Unique: 0zJYdkmPM16fFX73XqVQVg-1 X-Mimecast-MFC-AGG-ID: 0zJYdkmPM16fFX73XqVQVg_1793630427 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 19/74] qapi: Ease access to introspection names Date: Mon, 2 Nov 2026 15:39:23 +0100 Message-ID: <20261102144018.3212223-20-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793631113860154100 query-qmp-schema masks type names, because they are not part of the external interface. Marc-Andr=C3=A9 Lureau would like to also use them with qom-list & friends. Trouble is the masked names are buried deep in QAPISchemaGenIntrospectVisitor. Lift them into schema.py: new QAPISchemaDefinition method introspection_name() returns a definition's name for use in introspection. This changes the masked names, which is fine. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-ID: <20261101201717.3911097-3-armbru@redhat.com> --- docs/devel/qapi-code-gen.rst | 24 ++++++++++---------- scripts/qapi/introspect.py | 23 ++++--------------- scripts/qapi/schema.py | 43 ++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 31 deletions(-) diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst index b1cc5b5f0d..9bd5a3af28 100644 --- a/docs/devel/qapi-code-gen.rst +++ b/docs/devel/qapi-code-gen.rst @@ -2012,33 +2012,33 @@ Example:: =20 const QLitObject example_qmp_schema_qlit =3D QLIT_QLIST(((QLitObject[]= ) { QLIT_QDICT(((QLitDictEntry[]) { - { "arg-type", QLIT_QSTR("0"), }, + { "arg-type", QLIT_QSTR("34"), }, { "meta-type", QLIT_QSTR("command"), }, { "name", QLIT_QSTR("my-command"), }, - { "ret-type", QLIT_QSTR("1"), }, + { "ret-type", QLIT_QSTR("32"), }, {} })), QLIT_QDICT(((QLitDictEntry[]) { - { "arg-type", QLIT_QSTR("2"), }, + { "arg-type", QLIT_QSTR("30"), }, { "meta-type", QLIT_QSTR("event"), }, { "name", QLIT_QSTR("MY_EVENT"), }, {} })), - /* "0" =3D q_obj_my-command-arg */ + /* "34" =3D q_obj_my-command-arg */ QLIT_QDICT(((QLitDictEntry[]) { { "members", QLIT_QLIST(((QLitObject[]) { QLIT_QDICT(((QLitDictEntry[]) { { "name", QLIT_QSTR("arg1"), }, - { "type", QLIT_QSTR("[1]"), }, + { "type", QLIT_QSTR("[32]"), }, {} })), {} })), }, { "meta-type", QLIT_QSTR("object"), }, - { "name", QLIT_QSTR("0"), }, + { "name", QLIT_QSTR("34"), }, {} })), - /* "1" =3D UserDefOne */ + /* "32" =3D UserDefOne */ QLIT_QDICT(((QLitDictEntry[]) { { "members", QLIT_QLIST(((QLitObject[]) { QLIT_QDICT(((QLitDictEntry[]) { @@ -2061,22 +2061,22 @@ Example:: {} })), }, { "meta-type", QLIT_QSTR("object"), }, - { "name", QLIT_QSTR("1"), }, + { "name", QLIT_QSTR("32"), }, {} })), - /* "2" =3D q_empty */ + /* "30" =3D q_empty */ QLIT_QDICT(((QLitDictEntry[]) { { "members", QLIT_QLIST(((QLitObject[]) { {} })), }, { "meta-type", QLIT_QSTR("object"), }, - { "name", QLIT_QSTR("2"), }, + { "name", QLIT_QSTR("30"), }, {} })), QLIT_QDICT(((QLitDictEntry[]) { - { "element-type", QLIT_QSTR("1"), }, + { "element-type", QLIT_QSTR("32"), }, { "meta-type", QLIT_QSTR("array"), }, - { "name", QLIT_QSTR("[1]"), }, + { "name", QLIT_QSTR("[32]"), }, {} })), QLIT_QDICT(((QLitDictEntry[]) { diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 7e28de2279..644461560c 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -30,7 +30,6 @@ QAPISchemaAlternatives, QAPISchemaArrayType, QAPISchemaBranches, - QAPISchemaBuiltinType, QAPISchemaEntity, QAPISchemaEnumMember, QAPISchemaFeature, @@ -177,7 +176,6 @@ def __init__(self, prefix: str, unmask: bool): self._schema: Optional[QAPISchema] =3D None self._trees: List[Annotated[SchemaInfo]] =3D [] self._used_types: List[QAPISchemaType] =3D [] - self._name_map: Dict[str, str] =3D {} self._genc.add(mcgen(''' #include "qemu/osdep.h" #include "%(prefix)sqapi-introspect.h" @@ -208,18 +206,14 @@ def visit_end(self) -> None: self._schema =3D None self._trees =3D [] self._used_types =3D [] - self._name_map =3D {} =20 def visit_needed(self, entity: QAPISchemaEntity) -> bool: # Ignore types on first pass; visit_end() will pick up used types return not isinstance(entity, QAPISchemaType) =20 def _name(self, name: str) -> str: - if self._unmask: - return name - if name not in self._name_map: - self._name_map[name] =3D '%d' % len(self._name_map) - return self._name_map[name] + assert self._schema + return self._schema.definition_introspection_name(name, self._unma= sk) =20 def _use_type(self, typ: QAPISchemaType) -> str: assert self._schema is not None @@ -237,13 +231,6 @@ def _use_type(self, typ: QAPISchemaType) -> str: # Add type to work queue if new if typ not in self._used_types: self._used_types.append(typ) - # Clients should examine commands and events, not types. Hide - # type names as integers to reduce the temptation. Also, it - # saves a few characters on the wire. - if isinstance(typ, QAPISchemaBuiltinType): - return typ.name - if isinstance(typ, QAPISchemaArrayType): - return '[' + self._use_type(typ.element_type) + ']' return self._name(typ.name) =20 @staticmethod @@ -271,8 +258,7 @@ def _gen_tree(self, name: str, mtype: str, obj: Dict[st= r, object], # Output a comment to make it easy to map masked names # back to the source when reading the generated output. comment =3D f'"{self._name(name)}" =3D {name}' - name =3D self._name(name) - obj['name'] =3D name + obj['name'] =3D self._name(name) obj['meta-type'] =3D mtype if features: obj['features'] =3D self._gen_features(features) @@ -327,8 +313,7 @@ def visit_array_type(self, name: str, info: Optional[QA= PISourceInfo], ifcond: QAPISchemaIfCond, element_type: QAPISchemaType) -> None: element =3D self._use_type(element_type) - self._gen_tree('[' + element + ']', 'array', {'element-type': elem= ent}, - ifcond) + self._gen_tree(name, 'array', {'element-type': element}, ifcond) =20 def visit_object_type_flat(self, name: str, info: Optional[QAPISourceI= nfo], ifcond: QAPISchemaIfCond, diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py index 9c9e257a8f..11f3accec8 100644 --- a/scripts/qapi/schema.py +++ b/scripts/qapi/schema.py @@ -136,6 +136,13 @@ def __repr__(self) -> str: def c_name(self) -> str: return c_name(self.name) =20 + def set_ordinal(self, ordinal: int) -> None: + pass + + # pylint: disable=3Dunused-argument + def introspection_name(self, unmask: bool) -> str: + return self.name + def check(self, schema: QAPISchema) -> None: assert not self._checked super().check(schema) @@ -323,6 +330,17 @@ def visit(self, visitor: QAPISchemaVisitor) -> None: =20 =20 class QAPISchemaType(QAPISchemaDefinition, ABC): + def __init__( + self, + name: str, + info: Optional[QAPISourceInfo], + doc: Optional[QAPIDoc], + ifcond: Optional[QAPISchemaIfCond] =3D None, + features: Optional[List[QAPISchemaFeature]] =3D None, + ): + super().__init__(name, info, doc, ifcond, features) + self._masked_name: Optional[str] =3D None + # Return the C type for common use. # For the types we commonly box, this is a pointer type. @abstractmethod @@ -363,6 +381,17 @@ def need_has_if_optional(self) -> bool: # Except for arrays; see QAPISchemaArrayType.need_has_if_optional(= ). return not self.c_type().endswith(POINTER_SUFFIX) =20 + def set_ordinal(self, ordinal: int) -> None: + assert not self._masked_name + self._masked_name =3D str(ordinal) + + def introspection_name(self, unmask: bool) -> str: + # Type names are not part of the external interface. Hide + # them in introspection. Also saves a few characters on the + # wire. + assert self._masked_name + return self.name if unmask else self._masked_name + def check(self, schema: QAPISchema) -> None: super().check(schema) for feat in self.features: @@ -402,6 +431,11 @@ def json_type(self) -> str: def doc_type(self) -> str: return self.json_type() =20 + def introspection_name(self, unmask: bool): + if self.json_type() =3D=3D 'int': + return 'int' + return self.name + def visit(self, visitor: QAPISchemaVisitor) -> None: super().visit(visitor) visitor.visit_builtin_type(self.name, self.info, self.json_type()) @@ -503,6 +537,9 @@ def doc_type(self) -> Optional[str]: return None return 'array of ' + elt_doc_type =20 + def introspection_name(self, unmask: bool): + return '[' + self.element_type.introspection_name(unmask) + ']' + def visit(self, visitor: QAPISchemaVisitor) -> None: super().visit(visitor) visitor.visit_array_type(self.name, self.info, self.ifcond, @@ -1182,6 +1219,7 @@ def _def_definition(self, defn: QAPISchemaDefinition)= -> None: "'%s' is already defined\n%s" % (defn.name, where)) raise QAPISemError( defn.info, "%s is already defined" % other_defn.describe()) + defn.set_ordinal(len(self._entity_dict)) self._entity_dict[defn.name] =3D defn =20 def lookup_defn(self, name: str) -> Optional[QAPISchemaDefinition]: @@ -1208,6 +1246,11 @@ def resolve_type( info, "%s uses unknown type '%s'" % (what, name)) return typ =20 + def definition_introspection_name(self, name: str, unmask: bool) -> st= r: + defn =3D self.lookup_defn(name) + assert defn + return defn.introspection_name(unmask) + def _module_name(self, fname: str) -> str: if QAPISchemaModule.is_system_module(fname): return fname --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630963; cv=none; d=zohomail.com; s=zohoarc; b=CuXIWyL+HtOALjMQ7Jh47tpO7UHdezVc3+/a5luIxQk/A3SGT28bfuLLARrBbjsvoUDVcJr4MAhiiJcnaAKr/35b2dbhk5i/8C8h2GBv57fo3PEa/HmCPTEAN0YcH3Y4knOQkOJuPs5TeS/18e5itmduv0MVghMJhF5We0xuzKk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630963; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2jXQV3pkHAP+uIdmDsEHkMll4K00qf0RtfQMrd76I34=; b=WPud9fhHaHYGz2XjYGr5tuFCrd72if0CiiDXk3EkF7AVUFxWxWAODF4CwkfqiV6vMTNihT2GBRSkEoqBdgA+nVpHGpBcBPzlEqRbAGu6KK4ikWG/ZY4dd/8dj8b2A/R00xsOss0MAOLiLRVYAKpS+JGPKxjEsOcSA6b+7owYCc0= 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 1793630963004916.8226113824867; Mon, 2 Nov 2026 06:49:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDd-0003Qf-Hy; Mon, 02 Nov 2026 09:41:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0003Cf-Jc for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD4-0008Qs-Qy for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:33 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-225-15VnshsyNte8ym0FvkUSew-1; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7A040180AC71; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3400C195604B; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3FD4021E6898; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2jXQV3pkHAP+uIdmDsEHkMll4K00qf0RtfQMrd76I34=; b=FnSadESXnisLKc/7P8r+TKGMs2kUOQXGdsTghUVkcJddcdrrhV4fRSxJZxcJa6fg44GzFZ /PfLJu+Q/mqzyBtdvBCHlPNZQK31ytyTVdWxw1jM4rMkESIngQ+7cVs3lJxLJanE8MpvKr nKi72DmaKHDzbRb8Xks9krXPWFQsLBM= X-MC-Unique: 15VnshsyNte8ym0FvkUSew-1 X-Mimecast-MFC-AGG-ID: 15VnshsyNte8ym0FvkUSew_1793630427 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 20/74] qapi/introspect: Simplify masked name comment emission slighly Date: Mon, 2 Nov 2026 15:39:24 +0100 Message-ID: <20261102144018.3212223-21-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630965530154100 Instead of emitting the comment for certain meta-types, simply emit it when introspection name and name differ. This additionally emits it for arrays, which is fine. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-ID: <20261101201717.3911097-4-armbru@redhat.com> --- docs/devel/qapi-code-gen.rst | 1 + scripts/qapi/introspect.py | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst index 9bd5a3af28..1e89cbbcd7 100644 --- a/docs/devel/qapi-code-gen.rst +++ b/docs/devel/qapi-code-gen.rst @@ -2073,6 +2073,7 @@ Example:: { "name", QLIT_QSTR("30"), }, {} })), + /* "[32]" =3D UserDefOneList */ QLIT_QDICT(((QLitDictEntry[]) { { "element-type", QLIT_QSTR("32"), }, { "meta-type", QLIT_QSTR("array"), }, diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 644461560c..49d1ed2897 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -253,12 +253,12 @@ def _gen_tree(self, name: str, mtype: str, obj: Dict[= str, object], Will be omitted from the output if empty. """ comment: Optional[str] =3D None - if mtype not in ('command', 'event', 'builtin', 'array'): - if not self._unmask: - # Output a comment to make it easy to map masked names - # back to the source when reading the generated output. - comment =3D f'"{self._name(name)}" =3D {name}' - obj['name'] =3D self._name(name) + introspection_name =3D self._name(name) + if introspection_name !=3D name: + # Output a comment to make it easy to map masked names + # back to the source when reading the generated output. + comment =3D f'"{introspection_name}" =3D {name}' + obj['name'] =3D introspection_name obj['meta-type'] =3D mtype if features: obj['features'] =3D self._gen_features(features) --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630883; cv=none; d=zohomail.com; s=zohoarc; b=OXaaPAW2+OyUhISDfKa9yu2WvE6aKeZbRbtsfOCK5qwahPWLQ2a8LwGOJrg+bO2W3PI5hsVv6d79lmriPuDQgcx4MddFC6D7PVmFu0o1k1vHv/pH+WQuHcDhadpewSNNFrSrGQ34fcwS1kzqNtkhNnLhQIRVBIDSI2EWlb1pjXs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630883; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=O/UYa6LLClnDjYHXTafCjn8wvKGxrdMcS48zwF7HEK0=; b=E++Y6FSZfGWeE3PiviHHAFKuM5JylumZsnHylAvjOyPXvETb3xHuNcs0OD5K+nJ8BQz5qIHE5r0gWCjxLUYQyYEUb1CDvyMjDnv8V00sSyxlRVa1bc2UcXakwPzsKv0iEVzkdR5+FYw8nMmgZOGM/uPqb64xpMv7GQzVPWHR92g= 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 1793630883246439.7143736210302; Mon, 2 Nov 2026 06:48:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDc-0003QU-Nb; Mon, 02 Nov 2026 09:41:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0003Cm-UF for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD5-0008R4-2O for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:34 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-650-xp2d7Uq3Nhqt4Znejuo7ug-1; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 918CF180A9E2; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 13A671955F43; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4419221E6899; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O/UYa6LLClnDjYHXTafCjn8wvKGxrdMcS48zwF7HEK0=; b=Q5T8hZKLxnhULZB+dBtbeS3oHPn9xBpM+M5Ot2fIZPenl3T8cazwfr3t7fzyMrXshWLuh+ 1o/ew6NSAZC0CkZUzF+lcLnvx26xXdaSDjxhidbBPgkM/yPZTrv5DDkItF7ohMMzbMEZ+L /Ql+DWSF0aVv5Pw2IpcXaC16iNqddeE= X-MC-Unique: xp2d7Uq3Nhqt4Znejuo7ug-1 X-Mimecast-MFC-AGG-ID: xp2d7Uq3Nhqt4Znejuo7ug_1793630427 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 21/74] qapi/introspect: Don't elide types Date: Mon, 2 Nov 2026 15:39:25 +0100 Message-ID: <20261102144018.3212223-22-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630886333154100 query-qmp-schema elides types not reachable from commands and events. It currently emits 1251 out of 1385 definitions, and elides 134 types. Whether that's worthwhile is debatable. Marc-Andr=C3=A9 Lureau would like to make QOM introspection (qom-list & friends) refer to QAPI types. We additionally need types reachable from QOM properties. Unfortunately, the QAPI generator knows nothing about QOM properties. We could manually mark the QAPI types to elide, or the QAPI types not to elide even though they are not reachable from commands and events. Feels very much not worthwhile to me. We could conservatively approximate "reachable from QOM properties" by "available for use with QOM properties". These are the built-in and user-defined types, and their arrays. With that, we'd elide just 38 out of 1385 definitions. Too few to be worthwhile. Simply emit everything. Output of query-qmp-schema grows from 247KiB to 274KiB for me. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-ID: <20261101201717.3911097-5-armbru@redhat.com> --- docs/devel/qapi-code-gen.rst | 67 ++++++++++++++---------------------- scripts/qapi/introspect.py | 31 +++-------------- 2 files changed, 30 insertions(+), 68 deletions(-) diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst index 1e89cbbcd7..3c21dda91b 100644 --- a/docs/devel/qapi-code-gen.rst +++ b/docs/devel/qapi-code-gen.rst @@ -1250,8 +1250,6 @@ JSON array of strings. To examine a type, start with a command or event using it, then follow references by name. =20 -QAPI schema definitions not reachable that way are omitted. - The SchemaInfo for a command has meta-type "command", and variant members "arg-type", "ret-type" and "allow-oob". On the wire, the "arguments" member of a client's "execute" command must conform to the @@ -2012,32 +2010,19 @@ Example:: =20 const QLitObject example_qmp_schema_qlit =3D QLIT_QLIST(((QLitObject[]= ) { QLIT_QDICT(((QLitDictEntry[]) { - { "arg-type", QLIT_QSTR("34"), }, - { "meta-type", QLIT_QSTR("command"), }, - { "name", QLIT_QSTR("my-command"), }, - { "ret-type", QLIT_QSTR("32"), }, + { "json-type", QLIT_QSTR("string"), }, + { "meta-type", QLIT_QSTR("builtin"), }, + { "name", QLIT_QSTR("str"), }, {} })), + /* "[str]" =3D strList */ QLIT_QDICT(((QLitDictEntry[]) { - { "arg-type", QLIT_QSTR("30"), }, - { "meta-type", QLIT_QSTR("event"), }, - { "name", QLIT_QSTR("MY_EVENT"), }, - {} - })), - /* "34" =3D q_obj_my-command-arg */ - QLIT_QDICT(((QLitDictEntry[]) { - { "members", QLIT_QLIST(((QLitObject[]) { - QLIT_QDICT(((QLitDictEntry[]) { - { "name", QLIT_QSTR("arg1"), }, - { "type", QLIT_QSTR("[32]"), }, - {} - })), - {} - })), }, - { "meta-type", QLIT_QSTR("object"), }, - { "name", QLIT_QSTR("34"), }, + { "element-type", QLIT_QSTR("str"), }, + { "meta-type", QLIT_QSTR("array"), }, + { "name", QLIT_QSTR("[str]"), }, {} })), + [Remainder of built-in types omitted...] /* "32" =3D UserDefOne */ QLIT_QDICT(((QLitDictEntry[]) { { "members", QLIT_QLIST(((QLitObject[]) { @@ -2064,15 +2049,6 @@ Example:: { "name", QLIT_QSTR("32"), }, {} })), - /* "30" =3D q_empty */ - QLIT_QDICT(((QLitDictEntry[]) { - { "members", QLIT_QLIST(((QLitObject[]) { - {} - })), }, - { "meta-type", QLIT_QSTR("object"), }, - { "name", QLIT_QSTR("30"), }, - {} - })), /* "[32]" =3D UserDefOneList */ QLIT_QDICT(((QLitDictEntry[]) { { "element-type", QLIT_QSTR("32"), }, @@ -2080,22 +2056,31 @@ Example:: { "name", QLIT_QSTR("[32]"), }, {} })), + /* "34" =3D q_obj_my-command-arg */ QLIT_QDICT(((QLitDictEntry[]) { - { "json-type", QLIT_QSTR("int"), }, - { "meta-type", QLIT_QSTR("builtin"), }, - { "name", QLIT_QSTR("int"), }, + { "members", QLIT_QLIST(((QLitObject[]) { + QLIT_QDICT(((QLitDictEntry[]) { + { "name", QLIT_QSTR("arg1"), }, + { "type", QLIT_QSTR("[32]"), }, + {} + })), + {} + })), }, + { "meta-type", QLIT_QSTR("object"), }, + { "name", QLIT_QSTR("34"), }, {} })), QLIT_QDICT(((QLitDictEntry[]) { - { "json-type", QLIT_QSTR("string"), }, - { "meta-type", QLIT_QSTR("builtin"), }, - { "name", QLIT_QSTR("str"), }, + { "arg-type", QLIT_QSTR("34"), }, + { "meta-type", QLIT_QSTR("command"), }, + { "name", QLIT_QSTR("my-command"), }, + { "ret-type", QLIT_QSTR("32"), }, {} })), QLIT_QDICT(((QLitDictEntry[]) { - { "json-type", QLIT_QSTR("boolean"), }, - { "meta-type", QLIT_QSTR("builtin"), }, - { "name", QLIT_QSTR("bool"), }, + { "arg-type", QLIT_QSTR("30"), }, + { "meta-type", QLIT_QSTR("event"), }, + { "name", QLIT_QSTR("MY_EVENT"), }, {} })), {} diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 49d1ed2897..15302ecf15 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -28,9 +28,7 @@ from .schema import ( QAPISchema, QAPISchemaAlternatives, - QAPISchemaArrayType, QAPISchemaBranches, - QAPISchemaEntity, QAPISchemaEnumMember, QAPISchemaFeature, QAPISchemaIfCond, @@ -175,7 +173,6 @@ def __init__(self, prefix: str, unmask: bool): self._unmask =3D unmask self._schema: Optional[QAPISchema] =3D None self._trees: List[Annotated[SchemaInfo]] =3D [] - self._used_types: List[QAPISchemaType] =3D [] self._genc.add(mcgen(''' #include "qemu/osdep.h" #include "%(prefix)sqapi-introspect.h" @@ -187,10 +184,6 @@ def visit_begin(self, schema: QAPISchema) -> None: self._schema =3D schema =20 def visit_end(self) -> None: - # visit the types that are actually used - for typ in self._used_types: - typ.visit(self) - # generate C name =3D c_name(self._prefix, protect=3DFalse) + 'qmp_schema_qlit' self._genh.add(mcgen(''' #include "qobject/qlit.h" @@ -205,32 +198,12 @@ def visit_end(self) -> None: c_string=3D_tree_to_qlit(self._trees))) self._schema =3D None self._trees =3D [] - self._used_types =3D [] - - def visit_needed(self, entity: QAPISchemaEntity) -> bool: - # Ignore types on first pass; visit_end() will pick up used types - return not isinstance(entity, QAPISchemaType) =20 def _name(self, name: str) -> str: assert self._schema return self._schema.definition_introspection_name(name, self._unma= sk) =20 def _use_type(self, typ: QAPISchemaType) -> str: - assert self._schema is not None - - # Map the various integer types to plain int - if typ.json_type() =3D=3D 'int': - type_int =3D self._schema.lookup_type('int') - assert type_int - typ =3D type_int - elif (isinstance(typ, QAPISchemaArrayType) and - typ.element_type.json_type() =3D=3D 'int'): - type_intlist =3D self._schema.lookup_type('intList') - assert type_intlist - typ =3D type_intlist - # Add type to work queue if new - if typ not in self._used_types: - self._used_types.append(typ) return self._name(typ.name) =20 @staticmethod @@ -295,6 +268,8 @@ def _gen_variant(self, variant: QAPISchemaVariant =20 def visit_builtin_type(self, name: str, info: Optional[QAPISourceInfo], json_type: str) -> None: + if json_type =3D=3D 'int' and name !=3D 'int': + return self._gen_tree(name, 'builtin', {'json-type': json_type}) =20 def visit_enum_type(self, name: str, info: Optional[QAPISourceInfo], @@ -312,6 +287,8 @@ def visit_enum_type(self, name: str, info: Optional[QAP= ISourceInfo], def visit_array_type(self, name: str, info: Optional[QAPISourceInfo], ifcond: QAPISchemaIfCond, element_type: QAPISchemaType) -> None: + if element_type.json_type() =3D=3D 'int' and name !=3D 'intList': + return element =3D self._use_type(element_type) self._gen_tree(name, 'array', {'element-type': element}, ifcond) =20 --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630961; cv=none; d=zohomail.com; s=zohoarc; b=cDAkJ5e2LD82lIEGGV/hVhJnuoJxoToBcbU9YHWAOElUWMH7ZFyRhmY7nJoGhjvNL59X3Ah6kMLXvo+dhi38fmo89+9zPZJ/rDo9hQa3rhDKCcIscVduv7hOtOBn5G6Skrdrlb+/YcNcJw02aYYYnHHQYuiGgTfwNBFBkGJTigw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630961; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gkMSluGbkdTqOaPCGpiW3WpFrqQZjAGnKt7nLESnzoo=; b=kw8hMXR9hTkKvLazF1w1jLjTirW7y4snx9yv9XXeCi7XLLi+z5GJDP+Of3H1TyYSPGOBP75lSAavEiflyhDwlCp5BvV4c+137pQmHl6UZ4R4YA3SH16xiyX4Gl4APZlUcWm/ZJWr6QtJpairdOxZWcdFpjNyWHOAcGkLa2WP+5g= 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 179363096152047.97987419662479; Mon, 2 Nov 2026 06:49:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtEE-0004BQ-Dg; Mon, 02 Nov 2026 09:41:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDA-0003Cw-G1 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD6-0008SB-M1 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:35 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-292-RNYXPcBFN269LX4HuD7bBA-1; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 70A7C195BDC5; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 30D74767; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4837421E689A; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gkMSluGbkdTqOaPCGpiW3WpFrqQZjAGnKt7nLESnzoo=; b=XSVJ3kL1J/k/YM3wrhXaTs9ZABGzWy3UEuycCfLidSW7i4lAPQZUxmFH/RGsUNy9+C/Xx0 rGR9xZj2DDXuiCtRB9bheW60ivNCUR08bb0rIrA83LBtEWIFjASlAymq3sKzpen78bz06H btxU3JykA5/HdmL/jmSgiMi40paLTfQ= X-MC-Unique: RNYXPcBFN269LX4HuD7bBA-1 X-Mimecast-MFC-AGG-ID: RNYXPcBFN269LX4HuD7bBA_1793630427 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 22/74] qapi: QAPISchemaVisitor.visit_needed() is now unused, drop Date: Mon, 2 Nov 2026 15:39:26 +0100 Message-ID: <20261102144018.3212223-23-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630963017158500 Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-ID: <20261101201717.3911097-6-armbru@redhat.com> --- scripts/qapi/schema.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py index 11f3accec8..9e2152fa41 100644 --- a/scripts/qapi/schema.py +++ b/scripts/qapi/schema.py @@ -179,11 +179,6 @@ def visit_end(self) -> None: def visit_module(self, name: str) -> None: pass =20 - def visit_needed(self, entity: QAPISchemaEntity) -> bool: - # pylint: disable=3Dunused-argument - # Default to visiting everything - return True - def visit_include(self, name: str, info: Optional[QAPISourceInfo]) -> = None: pass =20 @@ -315,8 +310,7 @@ def add_entity(self, ent: QAPISchemaEntity) -> None: def visit(self, visitor: QAPISchemaVisitor) -> None: visitor.visit_module(self.name) for entity in self._entity_list: - if visitor.visit_needed(entity): - entity.visit(visitor) + entity.visit(visitor) =20 =20 class QAPISchemaInclude(QAPISchemaEntity): --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630590; cv=none; d=zohomail.com; s=zohoarc; b=fED+k/KQ5nHW6ioEdKCalsmM/XeEWB5eY9ppoLB3Un46no0xeL8Y0qlyNQUnJ7HTwsggMtYxncN4TmnOGb00GmG84tvq/ZMF7HttRT693SrWTapq5IV5KgMwUbjrKC80xXRhy/epIU8tF05xivHc8vlSdIA4Zs77d1dSHqiWqyQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630590; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gzmXv7OAR6YIIk+AkZhohdUnPss/h2HWsXgpzVBE9+w=; b=Ted1h4c1ntJJaGKjc1ZlSlHAVitxNj5IlXjTJJGoajOOPuyNUyIWZ9h+tcKsoHiaru3ukjZYZdlQwqd8wc6b7MNShrVltPzHhdSOGEE7OjJHVV9LP2x3J14SwFLB81PEXMHVOJ3cO/7kr2CobUMRKzz4t0HVboceNK/Z/mFANLE= 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 1793630590618608.8582902769302; Mon, 2 Nov 2026 06:43:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDw-0003ZD-06; Mon, 02 Nov 2026 09:41:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD6-0003CC-7E for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:36 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD4-0008QY-3X for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:31 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-461-t5egH857PiGkyxWWaPThfA-1; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3129D1800D8D; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E120018004D2; Mon, 2 Nov 2026 14:40:26 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4C5A021E689B; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gzmXv7OAR6YIIk+AkZhohdUnPss/h2HWsXgpzVBE9+w=; b=fpe77ORa2UtbQpC/lxORXiXLD2k+iN8j5KVv69Ai2EXhND9jAS3pUq6zXBVQre5BnuKX5L Yqvdl/nnsENN9ovj97xKVD1v50zs4QJX83Ke7Cglr88qjyWWrkv9S8C8jUbaWyCeD86zFe BnkpDt6KiKQzhOSpF5p4fSiBUkfUKo0= X-MC-Unique: t5egH857PiGkyxWWaPThfA-1 X-Mimecast-MFC-AGG-ID: t5egH857PiGkyxWWaPThfA_1793630427 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 23/74] qapi/introspect: Tweak integer type masking Date: Mon, 2 Nov 2026 15:39:27 +0100 Message-ID: <20261102144018.3212223-24-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630592457158500 Since introspection maps all integer types to 'int', we need to skip all but one of them. Instead of filtering by hardcoded name, filter out duplicates. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-ID: <20261101201717.3911097-7-armbru@redhat.com> --- scripts/qapi/introspect.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 15302ecf15..dc6f70a6fe 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -172,7 +172,7 @@ def __init__(self, prefix: str, unmask: bool): ' * QAPI/QMP schema introspection', __doc__) self._unmask =3D unmask self._schema: Optional[QAPISchema] =3D None - self._trees: List[Annotated[SchemaInfo]] =3D [] + self._trees: Dict[str, Annotated[SchemaInfo]] =3D {} self._genc.add(mcgen(''' #include "qemu/osdep.h" #include "%(prefix)sqapi-introspect.h" @@ -191,13 +191,14 @@ def visit_end(self) -> None: extern const QLitObject %(c_name)s; ''', c_name=3Dc_name(name))) + trees =3D list(self._trees.values()) self._genc.add(mcgen(''' const QLitObject %(c_name)s =3D %(c_string)s; ''', c_name=3Dc_name(name), - c_string=3D_tree_to_qlit(self._trees))) + c_string=3D_tree_to_qlit(trees))) self._schema =3D None - self._trees =3D [] + self._trees =3D {} =20 def _name(self, name: str) -> str: assert self._schema @@ -235,7 +236,12 @@ def _gen_tree(self, name: str, mtype: str, obj: Dict[s= tr, object], obj['meta-type'] =3D mtype if features: obj['features'] =3D self._gen_features(features) - self._trees.append(Annotated(obj, ifcond, comment)) + if introspection_name in self._trees: + # Duplicates are possible because + # QAPISchemaBuiltinType.introspection_name() returns 'int' + # for all integer types. Ignore them. + return + self._trees[introspection_name] =3D Annotated(obj, ifcond, comment) =20 def _gen_enum_member(self, member: QAPISchemaEnumMember ) -> Annotated[SchemaInfoEnumMember]: @@ -268,8 +274,6 @@ def _gen_variant(self, variant: QAPISchemaVariant =20 def visit_builtin_type(self, name: str, info: Optional[QAPISourceInfo], json_type: str) -> None: - if json_type =3D=3D 'int' and name !=3D 'int': - return self._gen_tree(name, 'builtin', {'json-type': json_type}) =20 def visit_enum_type(self, name: str, info: Optional[QAPISourceInfo], @@ -287,8 +291,6 @@ def visit_enum_type(self, name: str, info: Optional[QAP= ISourceInfo], def visit_array_type(self, name: str, info: Optional[QAPISourceInfo], ifcond: QAPISchemaIfCond, element_type: QAPISchemaType) -> None: - if element_type.json_type() =3D=3D 'int' and name !=3D 'intList': - return element =3D self._use_type(element_type) self._gen_tree(name, 'array', {'element-type': element}, ifcond) =20 --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630925; cv=none; d=zohomail.com; s=zohoarc; b=MvDlMu+n8JNzxu93MnS8OSCdImGtY1c0w95rZOpDtkkMGXBFglwXqBr/mNwg0+rEBJbht1fQ6tlQeTJ7LPJyaxoOMiFsRaHOJX73t95sahQZKSblRrfl2a+gUcHWtR2ahTKOI0UoRiviGRHFDCfLFfnNAZE9ogQlpO1z2PSCuuc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630925; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iFu6DAyZ6sIv+ZSgYLp6oDjmTiuYUaW48TszCfI5nX8=; b=YnDH35Mb6weu9Dtpi2Jiu77rSi7Ld8otTiTQavHV2WokGnqkz+Zt1KULPxrU/4v8uudUNlnHZg5b8Jkbedrm8Ul6jkvAA1pr7apERL18INfwJzjU52rQn4imQazVeD1m3j/EbzzkLSBYm6wlVQqFZWWv2mxe03RWt+DOBzgSyFI= 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 1793630925553682.3573127716268; Mon, 2 Nov 2026 06:48:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtEC-00044B-LB; Mon, 02 Nov 2026 09:41:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD6-0003CK-O1 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD4-0008Qf-9o for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:32 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-618-aqzO9Cl3OoCa8YsiLdkVeQ-1; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4E5A51944D46; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0A5ED30000E3; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 50AAC21E689C; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iFu6DAyZ6sIv+ZSgYLp6oDjmTiuYUaW48TszCfI5nX8=; b=efydqLOjrSsBJbZKYj8gsl9IsUmJYXeLSuc0ChpEgI10OlfyC/vUkIn4FT/PeRgp8gvvHo rb31Dr1jdbqW/knlBMDbveRto2C6TiZFPQjE01KWtma7++6AOTJwYTVXtt66rzLq4G+v9l GzpmYxWFvONgTM1RRBdyiWwXhqBXqQ8= X-MC-Unique: aqzO9Cl3OoCa8YsiLdkVeQ-1 X-Mimecast-MFC-AGG-ID: aqzO9Cl3OoCa8YsiLdkVeQ_1793630427 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 24/74] qapi: add QAPITypeInfo struct definition Date: Mon, 2 Nov 2026 15:39:28 +0100 Message-ID: <20261102144018.3212223-25-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630926885154100 From: Marc-Andr=C3=A9 Lureau Introduce a minimal struct that pairs a QAPI type's internal name with its "masked" introspection name. Generated constants of this type will let QOM property registration carry a reliable reference to the QAPI schema and possibly other associated data. The fields are populated in following commits. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-8-armbru@redhat.com> --- include/qapi/qapi-type-info.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 include/qapi/qapi-type-info.h diff --git a/include/qapi/qapi-type-info.h b/include/qapi/qapi-type-info.h new file mode 100644 index 0000000000..a14ba56016 --- /dev/null +++ b/include/qapi/qapi-type-info.h @@ -0,0 +1,25 @@ +/* + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef QAPI_TYPE_INFO_H +#define QAPI_TYPE_INFO_H + +#include "qapi/util.h" + +/** + * QAPITypeInfo - QAPI type metadata + * + * @name: QAPI type name (e.g. "str", "OnOffAuto", "int32List"). + * QOM uses this as the property type string. + * @masked_name: Name of the type in the output of query-qmp-schema, + * assigned by scripts/qapi code generator (e.g. "368"). + * @lookup: QEnumLookup for this type, or NULL for non-enum types. + */ +typedef struct QAPITypeInfo { + const char *name; + const char *masked_name; + const QEnumLookup *lookup; +} QAPITypeInfo; + +#endif /* QAPI_TYPE_INFO_H */ --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630710; cv=none; d=zohomail.com; s=zohoarc; b=NSW/wqpzx6LEwdDCELppuluQVyY2Yk5OA0vZ+AhY3+gwqhfauL7XIo0CLJ8FVq/o+Ye5+DDUsdA+SrwM/gfg8+JHV/p6NuAR4QSqJhe5T8kn8s3TEyGnAh4upF4kn6ACU2pcg0ExLAIRy6sWG2nEdo0Q/7DTxrzhkH2yh4N5xCM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630710; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DcrTh87MD3s4RRnoimt9meJ+rl5ZjVyZ1//Xu18WDnU=; b=TdjNA0XNbkXULc6OHWnh7qh8l7ecjPPn+4J3yB3NhiLhr4CFGW5II6DzfS+9dZaElinOsw14oXdXLJVqbmSPaqxJ7yqPhG/92gbiCIgotm2jDU+G5weYXHi4eadyKGI20PANxmG+GlhgnHn1Hq3hPKVM76KS3lHMQEARMWBWaTQ= 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 1793630710033718.5910797968282; Mon, 2 Nov 2026 06:45:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDc-0003QJ-4t; Mon, 02 Nov 2026 09:41:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD6-0003CJ-Mw for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:36 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD4-0008Qi-Gm for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:32 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-618-BIAseqfNPC6XA1HhA3fEsQ-1; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 448A6180A972; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 04564433; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 54D5921E689D; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DcrTh87MD3s4RRnoimt9meJ+rl5ZjVyZ1//Xu18WDnU=; b=UXcX1Ba5qvvrIVEdnSfdudbZ9/c/nAUDPHsoZ6M46XXvicn4/eA50QAbpS79Ys6S/hNw2e X66N5yq4OxFx91nUQXTvpohaPlpk/1V06wyLFg+KH+tYhp8uwqtVyN+LpfCNCFr3SUg8Bm IqQS54X3apFakS8pbbb4sEM1/F4iRwc= X-MC-Unique: BIAseqfNPC6XA1HhA3fEsQ-1 X-Mimecast-MFC-AGG-ID: BIAseqfNPC6XA1HhA3fEsQ_1793630427 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 25/74] qapi/gen: fix _module_basename for multi-dash 'what' parameters Date: Mon, 2 Nov 2026 15:39:29 +0100 Message-ID: <20261102144018.3212223-26-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630717660154100 From: Marc-Andr=C3=A9 Lureau The re.sub() call replaces every hyphen in 'what' with the system module infix. This produces broken filenames for multi-hyphen names (e.g. 'qapi-type-infos' becomes 'qapi-builtin-type-builtin-infos'). Add count=3D1 so only the first hyphen is replaced. Reviewed-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-9-armbru@redhat.com> --- scripts/qapi/gen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index 0c9b8db3b0..690187d428 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -300,7 +300,7 @@ def _module_basename(self, what: str, name: str) -> str: ret +=3D '-' + os.path.splitext(basename)[0] else: assert QAPISchemaModule.is_system_module(name) - ret +=3D re.sub(r'-', '-' + name[2:] + '-', what) + ret +=3D re.sub(r'-', '-' + name[2:] + '-', what, count=3D1) return ret =20 def _module_filename(self, what: str, name: str) -> str: --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793631235; cv=none; d=zohomail.com; s=zohoarc; b=jmlUU/ULvOeUcDTS3iO/nrR17xyeFTk+hEDna35TNxM8nfPXwz/PNwQrOSpgOXN1JyB6iFIT3ycmdPA9IfCfTv4DjxlS/VQhsOOgTAniNjX+AoG7BXec53FtexrO37Hm0AoJ/bE4w4CYlxHaDEG5dWwYmzkBaY/VS4OhRi8eJGY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631235; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3gFVqNcyNI3fOvproMNEhMRZVUqFF0YTEUu+rdMccNQ=; b=QmM2K1VVatoOEYGPWr/N0Qs2KZIjqbya+kzLNQq+bFY4Ka3V0uxYOUam6HIVzdi2cv7so5He3013hUIexcpv9tkeGBS6GAcuUZE+dpVfcXzatpO9pTvp90maPquyMkCswG+vyncgsq5gzouH6MgJCRA8dL+MsClPRd7JHqjgaUw= 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 1793631235697230.94357759388242; Mon, 2 Nov 2026 06:53:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtFQ-0007Y7-0Y; Mon, 02 Nov 2026 09:42:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDD-0003DR-2A for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0008Sm-AM for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:38 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-25-NNNHMiDjMWSFYyitlsqXXA-1; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AE3911944F2C; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 30F831800345; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5929021E689E; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3gFVqNcyNI3fOvproMNEhMRZVUqFF0YTEUu+rdMccNQ=; b=YmIuKl9uqwpsh+bJRpRyllek3+QDYNOhKX8vf1lZCAiMGjs/nY77wa0nCAmtuMc4Tu5jmK 5ugBkua8JWWQ+OZaogEKr3Wv5qD9exrP7nJcjzCrM7xfBD7QBzWcKBoL8AzZ/w9y7Sdc6+ bm/zZUpJfTSMPcER7LuLYyAbrXQwDFE= X-MC-Unique: NNNHMiDjMWSFYyitlsqXXA-1 X-Mimecast-MFC-AGG-ID: NNNHMiDjMWSFYyitlsqXXA_1793630427 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 26/74] qapi: add type-infos generator Date: Mon, 2 Nov 2026 15:39:30 +0100 Message-ID: <20261102144018.3212223-27-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793631237875154100 From: Marc-Andr=C3=A9 Lureau New QAPISchemaGenTypeInfoVisitor produces per-module qapi-type-infos-*.h/c files. Each file declares QAPITypeInfo constants pairing the QAPI type name with its masked introspection name. We want per-module .h for less recompiling when we touch QAPI types. Unfortunately, the per-module .c usually all change then, because the masked names all change. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-10-armbru@redhat.com> --- docs/devel/qapi-code-gen.rst | 87 ++++++++++++++++++++ meson.build | 1 + qapi/meson.build | 4 + qga/meson.build | 2 + scripts/qapi/backend.py | 2 + scripts/qapi/type_infos.py | 149 ++++++++++++++++++++++++++++++++++ tests/include/meson.build | 2 + tests/meson.build | 6 ++ tests/qapi-schema/meson.build | 1 + 9 files changed, 254 insertions(+) create mode 100644 scripts/qapi/type_infos.py diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst index 3c21dda91b..fc3a1dd6d8 100644 --- a/docs/devel/qapi-code-gen.rst +++ b/docs/devel/qapi-code-gen.rst @@ -1250,6 +1250,9 @@ JSON array of strings. To examine a type, start with a command or event using it, then follow references by name. =20 +.. TODO document QOM introspection (qom-list, qom-list-properties, + qom-get) and how it relates to QAPI type information. + The SchemaInfo for a command has meta-type "command", and variant members "arg-type", "ret-type" and "allow-oob". On the wire, the "arguments" member of a client's "execute" command must conform to the @@ -2087,3 +2090,87 @@ Example:: })); =20 [Uninteresting stuff omitted...] + + +Code generated for type information +----------------------------------- + +Type information is generated for user-defined types and their array +types. With option --builtins, it is also generated for the built-in +types. + +The following files are created: + + ``$(prefix)qapi-type-infos.c`` + A ``QAPITypeInfo`` instance for each type listed above, providing + a mapping between the QAPI type name and the masked name used by + introspection, along with optional enum lookup table and array + type pointers. + + ``$(prefix)qapi-type-infos.h`` + Declarations for the above type info instances + +Each ``QAPITypeInfo`` struct has the following fields: + +``name`` + The QAPI type name (e.g. ``"UserDefOne"``). + +``masked_name`` + The masked name used in ``query-qmp-schema`` output. + +``lookup`` + For enum types, a pointer to the corresponding ``QEnumLookup`` + table. ``NULL`` for non-enum types. + +These type info instances are used by QOM property registration +functions (``object_property_add()``, +``object_class_property_add_enum()``, etc.) to associate each property +with its QAPI type. The ``qom-list`` and ``device-list-properties`` +QMP commands then expose the ``qapi-type`` field, giving management +tools a formal type reference they can look up in the introspection +schema. + +Example:: + + $ cat qapi-generated/example-qapi-type-infos.h + [Uninteresting stuff omitted...] + + #ifndef EXAMPLE_QAPI_TYPE_INFOS_H + #define EXAMPLE_QAPI_TYPE_INFOS_H + + #include "qapi/qapi-builtin-type-infos.h" + + extern const QAPITypeInfo UserDefOne_type_info; + + extern const QAPITypeInfo UserDefOneList_type_info; + + #endif /* EXAMPLE_QAPI_TYPE_INFOS_H */ + $ cat qapi-generated/example-qapi-type-infos.c + [Uninteresting stuff omitted...] + + const QAPITypeInfo UserDefOne_type_info =3D { + .name =3D "UserDefOne", + .masked_name =3D "32", + }; + + const QAPITypeInfo UserDefOneList_type_info =3D { + .name =3D "UserDefOneList", + .masked_name =3D "[32]", + }; + + [Uninteresting stuff omitted...] + +For a modular QAPI schema (see section `Include directives`_), code for +each sub-module SUBDIR/SUBMODULE.json is actually generated into :: + + SUBDIR/$(prefix)qapi-type-infos-SUBMODULE.h + SUBDIR/$(prefix)qapi-type-infos-SUBMODULE.c + +If qapi-gen.py is run with option --builtins, additional files are +created: + + ``qapi-builtin-type-infos.h`` + Type info instances for built-in types + + ``qapi-builtin-type-infos.c`` + Definitions for the above type info instances diff --git a/meson.build b/meson.build index 71f135f053..fa4d2851e5 100644 --- a/meson.build +++ b/meson.build @@ -3522,6 +3522,7 @@ qapi_gen_depends =3D [ meson.current_source_dir() / '= scripts/qapi/__init__.py', meson.current_source_dir() / 'scripts/qapi/parser.py', meson.current_source_dir() / 'scripts/qapi/schema.py', meson.current_source_dir() / 'scripts/qapi/source.py', + meson.current_source_dir() / 'scripts/qapi/type_infos= .py', meson.current_source_dir() / 'scripts/qapi/types.py', meson.current_source_dir() / 'scripts/qapi/visit.py', meson.current_source_dir() / 'scripts/qapi-gen.py' diff --git a/qapi/meson.build b/qapi/meson.build index a46269b5a0..7477953492 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -79,6 +79,7 @@ endif =20 qapi_nonmodule_outputs =3D [ 'qapi-introspect.c', 'qapi-introspect.h', + 'qapi-type-infos.c', 'qapi-type-infos.h', 'qapi-types.c', 'qapi-types.h', 'qapi-visit.h', 'qapi-visit.c', 'qapi-commands.h', 'qapi-commands.c', @@ -88,6 +89,7 @@ qapi_nonmodule_outputs =3D [ ] =20 qapi_outputs =3D qapi_nonmodule_outputs + [ + 'qapi-builtin-type-infos.c', 'qapi-builtin-type-infos.h', 'qapi-builtin-types.c', 'qapi-builtin-visit.c', 'qapi-builtin-types.h', 'qapi-builtin-visit.h', ] @@ -96,6 +98,8 @@ qapi_inputs =3D [] foreach module : qapi_all_modules qapi_inputs +=3D [ files(module + '.json') ] qapi_module_outputs =3D [ + 'qapi-type-infos-@0@.c'.format(module), + 'qapi-type-infos-@0@.h'.format(module), 'qapi-types-@0@.c'.format(module), 'qapi-types-@0@.h'.format(module), 'qapi-visit-@0@.c'.format(module), diff --git a/qga/meson.build b/qga/meson.build index a046ebe305..5cc43b87df 100644 --- a/qga/meson.build +++ b/qga/meson.build @@ -39,6 +39,8 @@ qga_qapi_outputs =3D [ 'qga-qapi-init-commands.h', 'qga-qapi-introspect.c', 'qga-qapi-introspect.h', + 'qga-qapi-type-infos.c', + 'qga-qapi-type-infos.h', 'qga-qapi-types.c', 'qga-qapi-types.h', 'qga-qapi-visit.c', diff --git a/scripts/qapi/backend.py b/scripts/qapi/backend.py index 49ae6ecdd3..508ab21735 100644 --- a/scripts/qapi/backend.py +++ b/scripts/qapi/backend.py @@ -8,6 +8,7 @@ from .features import gen_features from .introspect import gen_introspect from .schema import QAPISchema +from .type_infos import gen_type_infos from .types import gen_types from .visit import gen_visit =20 @@ -63,3 +64,4 @@ def generate(self, gen_commands(schema, output_dir, prefix, gen_tracing) gen_events(schema, output_dir, prefix) gen_introspect(schema, output_dir, prefix, unmask) + gen_type_infos(schema, output_dir, prefix, builtins, unmask) diff --git a/scripts/qapi/type_infos.py b/scripts/qapi/type_infos.py new file mode 100644 index 0000000000..d9ed16d185 --- /dev/null +++ b/scripts/qapi/type_infos.py @@ -0,0 +1,149 @@ +""" +QAPI type info generator + +SPDX-License-Identifier: GPL-2.0-or-later +""" + +from typing import List, Optional + +from .common import c_name, mcgen +from .gen import QAPISchemaModularCVisitor, ifcontext +from .schema import ( + QAPISchema, + QAPISchemaAlternatives, + QAPISchemaBranches, + QAPISchemaEnumMember, + QAPISchemaFeature, + QAPISchemaIfCond, + QAPISchemaObjectType, + QAPISchemaObjectTypeMember, + QAPISchemaType, +) +from .source import QAPISourceInfo + + +class QAPISchemaGenTypeInfoVisitor(QAPISchemaModularCVisitor): + + def __init__(self, prefix: str, unmask: bool): + super().__init__( + prefix, 'qapi-type-infos', + ' * Schema-defined QAPI type info', + ' * Built-in QAPI type info', __doc__) + self._unmask =3D unmask + self._schema: Optional[QAPISchema] =3D None + + def visit_begin(self, schema: QAPISchema) -> None: + super().visit_begin(schema) + self._schema =3D schema + + def _begin_builtin_module(self) -> None: + self._genc.preamble_add(mcgen(''' +#include "qemu/osdep.h" +#include "qapi/qapi-builtin-types.h" +#include "qapi/qapi-builtin-type-infos.h" +''')) + self._genh.preamble_add(mcgen(''' +#include "qapi/qapi-type-info.h" +''')) + + def _begin_user_module(self, name: str) -> None: + type_infos =3D self._module_basename('qapi-type-infos', name) + types =3D self._module_basename('qapi-types', name) + self._genc.preamble_add(mcgen(''' +#include "qemu/osdep.h" +#include "%(types)s.h" +#include "%(type_infos)s.h" +''', + types=3Dtypes, + type_infos=3Dtype_infos)) + self._genh.preamble_add(mcgen(''' +#include "qapi/qapi-builtin-type-infos.h" +''')) + + def _masked_name(self, name: str) -> str: + assert self._schema is not None + return self._schema.definition_introspection_name(name, self._unma= sk) + + def _gen_type_info(self, name: str, + ifcond: Optional[QAPISchemaIfCond] =3D None, + with_lookup: bool =3D False) -> None: + cname =3D c_name(name, protect=3DFalse) + with ifcontext(ifcond or QAPISchemaIfCond(), + self._genh, self._genc): + self._genh.add(mcgen(''' + +extern const QAPITypeInfo %(cname)s_type_info; +''', + cname=3Dcname)) + self._genc.add(mcgen(''' + +const QAPITypeInfo %(cname)s_type_info =3D { + .name =3D "%(name)s", + .masked_name =3D "%(masked_name)s", +''', + cname=3Dcname, name=3Dname, + masked_name=3Dself._masked_name(name))) + if with_lookup: + self._genc.add(mcgen(''' + .lookup =3D &%(cname)s_lookup, +''', + cname=3Dcname)) + self._genc.add(mcgen(''' +}; +''')) + + def visit_builtin_type(self, + name: str, + info: Optional[QAPISourceInfo], + json_type: str) -> None: + self._gen_type_info(name) + + def visit_enum_type(self, + name: str, + info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + features: List[QAPISchemaFeature], + members: List[QAPISchemaEnumMember], + prefix: Optional[str]) -> None: + self._gen_type_info(name, ifcond, + with_lookup=3DTrue) + + def visit_array_type(self, + name: str, + info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + element_type: QAPISchemaType) -> None: + self._gen_type_info(name, ifcond) + + def visit_object_type(self, + name: str, + info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + features: List[QAPISchemaFeature], + base: Optional[QAPISchemaObjectType], + members: List[QAPISchemaObjectTypeMember], + branches: Optional[QAPISchemaBranches]) -> None: + assert self._schema is not None + typ =3D self._schema.lookup_type(name) + assert typ + if typ.is_implicit(): + return + self._gen_type_info(name, ifcond) + + def visit_alternate_type(self, + name: str, + info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + features: List[QAPISchemaFeature], + alternatives: QAPISchemaAlternatives) -> None: + self._gen_type_info(name, ifcond) + + +def gen_type_infos(schema: QAPISchema, + output_dir: str, + prefix: str, + opt_builtins: bool, + opt_unmask: bool) -> None: + vis =3D QAPISchemaGenTypeInfoVisitor(prefix, opt_unmask) + schema.visit(vis) + vis.write(output_dir, opt_builtins) diff --git a/tests/include/meson.build b/tests/include/meson.build index 8e8d1ec4e6..026480d968 100644 --- a/tests/include/meson.build +++ b/tests/include/meson.build @@ -4,6 +4,8 @@ test_qapi_outputs_extra =3D [ 'test-qapi-commands-sub-module.h', 'test-qapi-events-sub-module.c', 'test-qapi-events-sub-module.h', + 'test-qapi-type-infos-sub-module.c', + 'test-qapi-type-infos-sub-module.h', 'test-qapi-types-sub-module.c', 'test-qapi-types-sub-module.h', 'test-qapi-visit-sub-module.c', diff --git a/tests/meson.build b/tests/meson.build index 5877d2f60b..6769a1e781 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -2,6 +2,8 @@ subdir('bench') subdir('qemu-iotests') =20 test_qapi_outputs =3D [ + 'qapi-builtin-type-infos.c', + 'qapi-builtin-type-infos.h', 'qapi-builtin-types.c', 'qapi-builtin-types.h', 'qapi-builtin-visit.c', @@ -22,6 +24,10 @@ test_qapi_outputs =3D [ 'test-qapi-init-commands.h', 'test-qapi-introspect.c', 'test-qapi-introspect.h', + 'test-qapi-type-infos-sub-sub-module.c', + 'test-qapi-type-infos-sub-sub-module.h', + 'test-qapi-type-infos.c', + 'test-qapi-type-infos.h', 'test-qapi-types-sub-sub-module.c', 'test-qapi-types-sub-sub-module.h', 'test-qapi-types.c', diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build index debff633ac..392b59d8dc 100644 --- a/tests/qapi-schema/meson.build +++ b/tests/qapi-schema/meson.build @@ -231,6 +231,7 @@ custom_target('QAPI doc', 'doc-good-qapi-events.c', 'doc-good-qapi-events.h', 'doc-good-qapi-init-commands.c', 'doc-good-qapi-ini= t-commands.h', 'doc-good-qapi-introspect.c', 'doc-good-qapi-intros= pect.h', + 'doc-good-qapi-type-infos.c', 'doc-good-qapi-type-i= nfos.h', 'doc-good-qapi-types.c', 'doc-good-qapi-types.h', 'doc-good-qapi-visit.c', 'doc-good-qapi-visit.h' ], input: files('doc-good.json'), --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630926; cv=none; d=zohomail.com; s=zohoarc; b=QhVP2fopQyB9WjcOxSSZYtK2Sedao9qodulUyFK1LP9+bYw/S24Y0Jptn8ZRsybAhD2CDJrMhCaPAKZN8sUyzke6pbmWk9EzDpJpibt5izUd9cPaEOvBdg3pWdLGcPtoEgQqy4NMHNvN15ONsq4EvPPJtTxSpL7JhQ79G/AL4Oc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630926; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0TIZROgXzXMZfXa9YZ+0HpmqmLgJxMWdTR2+qq9vW04=; b=fb1PveyZ1xnbCDeclvgEOwm2g0SEIpL0zDQIAu4whYodaet4iDKkNsm1DkhcXTimXNNbH6d2JoJtu1lzfc+w2/MPBM96Zq0q4bZNUXohTzSqgqNYMya2gSJvVkDm3mXXVTdAvdOLWuWJf0n000iOqdGWWlaLcn/ItXYgbuGZNKY= 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 1793630926183643.4040583120233; Mon, 2 Nov 2026 06:48:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtF6-0005hD-IT; Mon, 02 Nov 2026 09:42:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0003Ch-LP for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD4-0008Qm-Hm for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:32 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-465-PX_eO79IOdilu9cQP_QEuA-1; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A002B180A9DF; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1D5121955F06; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5D44E21E689F; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0TIZROgXzXMZfXa9YZ+0HpmqmLgJxMWdTR2+qq9vW04=; b=AmbyYZxUEtr04HaNSfr8D+/dIqSAV2iFNMU3A4Ow2gU1tN+iAMIZtfLW1H4hUvgnxqFLvl MOK2zptw/tocrEEFg32LTSwiaMwxm5CyELBkvtUH6793PByuwkXJM59mQEAN2gPkWSihCS T6DmxsXAZW80pxEQV0GazjgHtyRSNb8= X-MC-Unique: PX_eO79IOdilu9cQP_QEuA-1 X-Mimecast-MFC-AGG-ID: PX_eO79IOdilu9cQP_QEuA_1793630427 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 27/74] qom: add qapi_type field to ObjectProperty Date: Mon, 2 Nov 2026 15:39:31 +0100 Message-ID: <20261102144018.3212223-28-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630928916154100 From: Marc-Andr=C3=A9 Lureau Add a const pointer to QAPITypeInfo in ObjectProperty. NULL for now, but future patches will add means to make it non-null. The QAPITypeInfo will then be used by QOM introspection to tie the property to a QAPI type. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-11-armbru@redhat.com> --- include/qom/object.h | 2 ++ qom/object.c | 1 + 2 files changed, 3 insertions(+) diff --git a/include/qom/object.h b/include/qom/object.h index 90c1a34e49..e9b380462d 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -15,6 +15,7 @@ #define QEMU_OBJECT_H =20 #include "qapi/qapi-builtin-types.h" +#include "qapi/qapi-type-info.h" #include "qemu/module.h" =20 struct TypeImpl; @@ -91,6 +92,7 @@ struct ObjectProperty char *name; char *type; char *description; + const QAPITypeInfo *qapi_type; ObjectPropertyAccessor *get; ObjectPropertyAccessor *set; ObjectPropertyResolve *resolve; diff --git a/qom/object.c b/qom/object.c index 30699f9127..bbaff619e6 100644 --- a/qom/object.c +++ b/qom/object.c @@ -3171,6 +3171,7 @@ object_property_add_alias(Object *obj, const char *na= me, property_release_alias, prop); op->resolve =3D property_resolve_alias; + op->qapi_type =3D target_prop->qapi_type; if (target_prop->defval) { op->defval =3D qobject_ref(target_prop->defval); } --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630597; cv=none; d=zohomail.com; s=zohoarc; b=iAgdD1C/sC36OK1YhQbKygG3DllfCoDa+ArGQYIBBQVULlxWN/jCDUPIhGWKIttTP0KOrt8MCimMVOIbEGrvdU6taPvKiI2niv0U+gcmNBXXlKuLlb3LLmpPXplBZDqMCNCobBKmV6nKO5d3bEBIMVMxiTRr59iVbhAjFwNkRps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630597; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=a9smzNq1EdpfhvOvWNEpc6GL4bwEXwnVdY7lqnWCsI8=; b=C/Od4DDPYOzsBZO99izuAjwmpVmawmzp9b/f/H//0550Egkl+icRJ4AQ8ImQ1wvs4C0tn3UXXytkp2WPcN+okXWsV3jXXZY4rNwqH5gjayKYf+umfu6Ir1VrU82OLVsqSgo6QzLROV5N7jpPLSn4D/HvT1cjohMBoWupAZL/QNc= 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 1793630597093373.2948186647011; Mon, 2 Nov 2026 06:43:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDg-0003SK-A8; Mon, 02 Nov 2026 09:41:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD6-0003CM-Ra for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD4-0008Qx-H4 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:32 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-500-PolzrWPbOCuAeedtBAs1sA-1; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 679DB180ABEE; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 221271800765; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6170621E68A0; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=a9smzNq1EdpfhvOvWNEpc6GL4bwEXwnVdY7lqnWCsI8=; b=DyPfycz+MHQi+FUQQnALjgcJbovcRZZGM6D8CLx40QlwDhlor1YBKxG1DTn7s/YdUy2sJ6 76fSdT+ha9j4unF3sYg/4qmjpylwpOPTS3l+9Zs5XG9ZYCnuzytZhn/QI96Hvy9MoWTMPF RVA6crB2KYq9OXbnO0GFQjN7ihbh4fU= X-MC-Unique: PolzrWPbOCuAeedtBAs1sA-1 X-Mimecast-MFC-AGG-ID: PolzrWPbOCuAeedtBAs1sA_1793630427 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 28/74] qapi/qom: add qapi-type to qom-list, qom-list-properties, qom-list-get Date: Mon, 2 Nov 2026 15:39:32 +0100 Message-ID: <20261102144018.3212223-29-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630597680154100 From: Marc-Andr=C3=A9 Lureau QOM introspection is flawed: the type information is just a string (ObjectPropertyInfo and ObjectPropertyValue field 'type'). Management applications need to know these strings. Their documentation is of little help. QAPI introspection is more powerful, and management applications already know how to use it. Let's put it to use for QOM introspection. Add an optional 'qapi-type' field to ObjectPropertyInfo and ObjectPropertyValue. When present, it contains the masked type name that can be looked up in query-qmp-schema output. Absent for properties without a QAPI type association. Always absent for now, populated in the following changes. This cannot fully replace 'type', yet: it doesn't cover child and link properties. Mark 'unstable' for now. Reviewed-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-12-armbru@redhat.com> --- qapi/qom.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/qapi/qom.json b/qapi/qom.json index 2a98b1de5f..32a5926936 100644 --- a/qapi/qom.json +++ b/qapi/qom.json @@ -35,15 +35,24 @@ # qdev device type name. Link properties form the device model # graph. # +# @qapi-type: the name of the property's type as it appears in the +# output of ``query-qmp-schema``. Absent if the type does not +# occur there. (since 11.2) +# # @description: if specified, the description of the property. # # @default-value: the default value, if any (since 5.0) # +# Features: +# +# @unstable: Member @qapi-type is experimental. +# # Since: 1.2 ## { 'struct': 'ObjectPropertyInfo', 'data': { 'name': 'str', 'type': 'str', + '*qapi-type': { 'type': 'str', 'features': [ 'unstable' ] }, '*description': 'str', '*default-value': 'any' } } =20 @@ -55,14 +64,23 @@ # @type: the type of the property, as described in # `ObjectPropertyInfo`. # +# @qapi-type: the name of the property's type as it appears in the +# output of ``query-qmp-schema``. Absent if the type does not +# occur there. (since 11.2) +# # @value: the value of the property. Absent when the property cannot # be read. # +# Features: +# +# @unstable: Member @qapi-type is experimental. +# # Since: 10.1 ## { 'struct': 'ObjectPropertyValue', 'data': { 'name': 'str', 'type': 'str', + '*qapi-type': { 'type': 'str', 'features': [ 'unstable' ] }, '*value': 'any' } } =20 ## --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630670; cv=none; d=zohomail.com; s=zohoarc; b=YGTcIkcqTXJZExeCIIVc2o+ueG2Xtb4qsFVXq25Cn5lEO/sLt//vg2Bxob0SLseYrkTRky3PbOUX7LhyPtRZufNBqZUUh3E9BE8x/nUWdITTPyxu4YUEtg2bZ3Y+WGI4XYbYoHAOKaSNKECLqZFv5r6mv3CnC16p8lM2zYH558A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630670; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=p8+lAepfnrGEvH1FujN80D+XUgX13Xo2jCJAUioWrag=; b=SQRUgxMxO3QOQ9QdEfC5B+sNqA6DXIXIfWwmqeEBXfdBrHCfMbgjeadsV4SsHdpJU17wEKy9j0ix3wDctwH3KeYQXe8+6QhTtnuFfkdD/R+1qZbbHFjYZATRjDE9K1wz53/FCw7z7uQpewIYAA6jelQIwhkmw8P0qTcKQuS+Mm4= 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 1793630670932488.05386248575167; Mon, 2 Nov 2026 06:44:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDb-0003QI-VQ; Mon, 02 Nov 2026 09:41:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0003Cj-Pf for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD5-0008R5-4p for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:34 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-221-QZDjiiDaMr2iow1Wh2EPwQ-1; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7A7BA195D02C; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 35FE21955F19; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 65C4521E68A1; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p8+lAepfnrGEvH1FujN80D+XUgX13Xo2jCJAUioWrag=; b=Tbq+J2nMsKG9iaX08sNKFnmILytM7kp3hSDrhcrYlfpzHFjpWvBdVvjJi/LfGUas1r3mEm p8naP/KhdEUHcssuh1ASCihvxxIrTzEyls7UulJ4x/LiMsAaSo9vjS4y8GEUItrjnUuJ/M Lyb08PzSanBjna/tRRczvH2tYPCHYiU= X-MC-Unique: QZDjiiDaMr2iow1Wh2EPwQ-1 X-Mimecast-MFC-AGG-ID: QZDjiiDaMr2iow1Wh2EPwQ_1793630427 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 29/74] qom/qmp: populate qapi-type in QMP handlers Date: Mon, 2 Nov 2026 15:39:33 +0100 Message-ID: <20261102144018.3212223-30-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630672059158500 From: Marc-Andr=C3=A9 Lureau Wire up the new qapi-type field in all four QMP handlers that return ObjectPropertyInfo or ObjectPropertyValue: qom-list, qom-list-get, device-list-properties, and qom-list-properties. When an ObjectProperty has a qapi_type set, the masked QAPI type name is copied into the response, allowing clients to cross-reference with query-qmp-schema. No property has it yet, the following changes will populate it. Reviewed-by: Markus Armbruster Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-13-armbru@redhat.com> --- qom/qom-qmp-cmds.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c index f17389c730..47bf3bf293 100644 --- a/qom/qom-qmp-cmds.c +++ b/qom/qom-qmp-cmds.c @@ -25,9 +25,23 @@ #include "qapi/qobject-input-visitor.h" #include "qapi/qobject-output-visitor.h" #include "qemu/cutils.h" +#include "qapi/qapi-type-info.h" #include "qom/object_interfaces.h" #include "qom/qom-qobject.h" =20 +static ObjectPropertyInfo *qom_property_info(ObjectProperty *prop) +{ + ObjectPropertyInfo *info =3D g_new0(ObjectPropertyInfo, 1); + + info->name =3D g_strdup(prop->name); + info->type =3D g_strdup(prop->type); + if (prop->qapi_type) { + assert(prop->qapi_type->masked_name); + info->qapi_type =3D g_strdup(prop->qapi_type->masked_name); + } + return info; +} + static Object *qom_resolve_path(const char *path, Error **errp) { bool ambiguous =3D false; @@ -58,12 +72,7 @@ ObjectPropertyInfoList *qmp_qom_list(const char *path, E= rror **errp) =20 object_property_iter_init(&iter, obj); while ((prop =3D object_property_iter_next(&iter))) { - ObjectPropertyInfo *value =3D g_new0(ObjectPropertyInfo, 1); - - QAPI_LIST_PREPEND(props, value); - - value->name =3D g_strdup(prop->name); - value->type =3D g_strdup(prop->type); + QAPI_LIST_PREPEND(props, qom_property_info(prop)); } =20 return props; @@ -78,6 +87,10 @@ static void qom_list_add_property_value(Object *obj, Obj= ectProperty *prop, =20 item->name =3D g_strdup(prop->name); item->type =3D g_strdup(prop->type); + if (prop->qapi_type) { + assert(prop->qapi_type->masked_name); + item->qapi_type =3D g_strdup(prop->qapi_type->masked_name); + } item->value =3D object_property_get_qobject(obj, prop->name, NULL); } =20 @@ -241,9 +254,7 @@ ObjectPropertyInfoList *qmp_device_list_properties(cons= t char *typename, continue; } =20 - info =3D g_new0(ObjectPropertyInfo, 1); - info->name =3D g_strdup(prop->name); - info->type =3D g_strdup(prop->type); + info =3D qom_property_info(prop); info->description =3D g_strdup(prop->description); info->default_value =3D qobject_ref(prop->defval); =20 @@ -284,11 +295,8 @@ ObjectPropertyInfoList *qmp_qom_list_properties(const = char *typename, object_property_iter_init(&iter, obj); } while ((prop =3D object_property_iter_next(&iter))) { - ObjectPropertyInfo *info; + ObjectPropertyInfo *info =3D qom_property_info(prop); =20 - info =3D g_malloc0(sizeof(*info)); - info->name =3D g_strdup(prop->name); - info->type =3D g_strdup(prop->type); info->description =3D g_strdup(prop->description); info->default_value =3D qobject_ref(prop->defval); =20 --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793631212; cv=none; d=zohomail.com; s=zohoarc; b=Yir2lZwJrEmTpTvS1bi4+1cG3MLRRablybEccauWxmsF9hwqxJYvr0ejl2h1L0z/1jzex2NtSiSaHFI1B2e8px6WVgKSFdyvOKIDQ/OQlnQ/Tz0DUFf17xpt55zPB65cgAgWQVlKqeZbzMvgR36EKeN+e0rdEuhG+61o2x186qU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631212; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1vWrF76QyBOQJL9ArpPgVf9RSg+nebgYyjOi2LONmiw=; b=OuSYHjhycohkawqWtR2Rcuy+VEbWXEASI1aOY9CEoekb5YDTzfF7a8ne1DD0k2e+2MzCC3deS4TMeemMq2HnnV4FVG6RCef//ooMs8eZU7PaGfBEvoOfLM8Bd2DxsmlRxk8/1PxNqMig57sGpvxtdz1dBq4fPOxkn6sf2h3RUyM= 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 1793631212688592.1790023972867; Mon, 2 Nov 2026 06:53:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDf-0003RO-Am; Mon, 02 Nov 2026 09:41:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDB-0003D1-6v for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0008SN-9R for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:36 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-650-mtR_1METNpaXlpZ7vXZVbg-1; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9B714180A9D6; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 574D41803A51; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 69F6421E68A2; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1vWrF76QyBOQJL9ArpPgVf9RSg+nebgYyjOi2LONmiw=; b=MyQYOapEEhEvLcn8BLfDN1LAKU0YWCUAh7kQS2qIVN60Lz68HpmL1+uB77PnpHdtt9Ein8 xNBWuqbE6nEBiC1VTVyO4r7ZrbEVPR8k+YdK/KIdEaEnEWhXdENO/OQVOb6gN0xofSEz3c o3BTj3pwF9Qb67F4jXfnFuAghhPUFJw= X-MC-Unique: mtR_1METNpaXlpZ7vXZVbg-1 X-Mimecast-MFC-AGG-ID: mtR_1METNpaXlpZ7vXZVbg_1793630427 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 30/74] qom/qmp: populate description & default-value in qom_property_info() Date: Mon, 2 Nov 2026 15:39:34 +0100 Message-ID: <20261102144018.3212223-31-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793631219611154100 From: Marc-Andr=C3=A9 Lureau Move description and default_value population from the individual QMP handlers into qom_property_info(), so all callers get them. This also adds description and default-value to qom-list responses, which previously only returned name and type. The handler doesn't care. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-14-armbru@redhat.com> --- qom/qom-qmp-cmds.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c index 47bf3bf293..84a2959051 100644 --- a/qom/qom-qmp-cmds.c +++ b/qom/qom-qmp-cmds.c @@ -35,6 +35,8 @@ static ObjectPropertyInfo *qom_property_info(ObjectProper= ty *prop) =20 info->name =3D g_strdup(prop->name); info->type =3D g_strdup(prop->type); + info->description =3D g_strdup(prop->description); + info->default_value =3D qobject_ref(prop->defval); if (prop->qapi_type) { assert(prop->qapi_type->masked_name); info->qapi_type =3D g_strdup(prop->qapi_type->masked_name); @@ -243,8 +245,6 @@ ObjectPropertyInfoList *qmp_device_list_properties(cons= t char *typename, =20 object_property_iter_init(&iter, obj); while ((prop =3D object_property_iter_next(&iter))) { - ObjectPropertyInfo *info; - /* Skip Object and DeviceState properties */ if (strcmp(prop->name, "type") =3D=3D 0 || strcmp(prop->name, "realized") =3D=3D 0 || @@ -254,11 +254,7 @@ ObjectPropertyInfoList *qmp_device_list_properties(con= st char *typename, continue; } =20 - info =3D qom_property_info(prop); - info->description =3D g_strdup(prop->description); - info->default_value =3D qobject_ref(prop->defval); - - QAPI_LIST_PREPEND(prop_list, info); + QAPI_LIST_PREPEND(prop_list, qom_property_info(prop)); } =20 object_unref(obj); @@ -295,12 +291,7 @@ ObjectPropertyInfoList *qmp_qom_list_properties(const = char *typename, object_property_iter_init(&iter, obj); } while ((prop =3D object_property_iter_next(&iter))) { - ObjectPropertyInfo *info =3D qom_property_info(prop); - - info->description =3D g_strdup(prop->description); - info->default_value =3D qobject_ref(prop->defval); - - QAPI_LIST_PREPEND(prop_list, info); + QAPI_LIST_PREPEND(prop_list, qom_property_info(prop)); } =20 object_unref(obj); --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630615; cv=none; d=zohomail.com; s=zohoarc; b=CqfJV/3yb+4vT3uGgqPe+tr10k50sh2CjjvKy1VZLxXQ12SDARprbsr1hnWP0yo+JEBgZfImJllgx9jRN7fFc9s410yDdH8Fjx/rd9YoC3uJ7yamikNfjgjsnKUEpu5X3GJeTrc03WjOxNHKzX4ez47gXx901gXT4FZiN8/P5Eo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630615; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9njjDZSCTZpGDZHzihI5mtsQD9ptuIJBU1VTjcPaGIY=; b=GQX/ho1J9YcvqJY1Pkx9m2noDCu6fBPvzy5ydEv3IlaVkrCm/Egy3CT1vBUhZQadkTXTDBSBtCHev1xn/r+K1H+tyIl8gaLxYQhEika89iaT3JCY1FUA0GtxWsV8Ts4igww96Rfr4uj5pK0FITB/YAuM4rroPT+IddRt9PUgbkc= 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 1793630615480781.1040638532099; Mon, 2 Nov 2026 06:43:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtF0-0005JN-Ow; Mon, 02 Nov 2026 09:42:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDH-0003Fy-OB for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0008SQ-Bx for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:41 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-326-yk44MpPTOrajQF0U0XV_Bg-1; Mon, 02 Nov 2026 09:40:29 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 21A831945117; Mon, 2 Nov 2026 14:40:28 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 270B41803A40; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6F9AE21E68A4; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9njjDZSCTZpGDZHzihI5mtsQD9ptuIJBU1VTjcPaGIY=; b=KIQxaGkoOXDvSLwsV2TQVdq4YfDfCwRuWilu1AhTcbvC0csCAJfReaGaax7GgSI8vC6mA7 WQBI6c23SYY7tW7FsmIp9SNIILYUGfN3Ywds2L4HiWwAMAV+MlcoA9wL/d/l5S5+aR2IGq NOzfvXLaFt0vtVzWRB6xDHUhvwVEVrk= X-MC-Unique: yk44MpPTOrajQF0U0XV_Bg-1 X-Mimecast-MFC-AGG-ID: yk44MpPTOrajQF0U0XV_Bg_1793630428 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org Subject: [PULL 31/74] qom: New object_property_add() etc. parameter @qapi_type Date: Mon, 2 Nov 2026 15:39:35 +0100 Message-ID: <20261102144018.3212223-32-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793630617986154100 Content-Type: text/plain; charset="utf-8" This permits setting ObjectProperty's optional @qapi_type. For now, all callers pass null. Callers updated with this Coccinelle script: @@ identifier fun =3D { object_property_try_add, object_property_add, object_class_property_add }; expression obj, name, type; @@ - fun(obj, name, type, + fun(obj, name, type, NULL, ...) Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-15-armbru@redhat.com> [Pass @qapi-type to object_property_try_add(), add missing const there] --- include/qom/object.h | 5 +++ accel/hvf/hvf-all.c | 6 +-- accel/kvm/kvm-all.c | 19 +++++---- accel/nitro/nitro-accel.c | 2 +- accel/tcg/tcg-all.c | 6 +-- accel/whpx/whpx-common.c | 12 +++--- authz/list.c | 2 +- backends/cryptodev.c | 6 +-- backends/hostmem-file.c | 21 ++++----- backends/hostmem-memfd.c | 4 +- backends/hostmem.c | 24 +++++------ block/throttle-groups.c | 7 +-- chardev/char-socket.c | 2 +- crypto/secret_keyring.c | 2 +- event-loop-base.c | 6 +-- hw/acpi/ich9.c | 2 +- hw/acpi/pci.c | 8 ++-- hw/arm/virt.c | 10 ++--- hw/core/clock.c | 2 +- hw/core/machine.c | 29 +++++++------ hw/core/qdev-properties.c | 5 +-- hw/cpu/core.c | 6 ++- hw/cxl/cxl-host.c | 4 +- hw/gpio/aspeed_gpio.c | 6 +-- hw/gpio/aspeed_sgpio.c | 2 +- hw/gpio/pca9552.c | 4 +- hw/gpio/pca9554.c | 3 +- hw/gpio/stm32l4x5_gpio.c | 4 +- hw/hexagon/hexagon_dsp.c | 2 +- hw/i386/microvm.c | 6 +-- hw/i386/pc.c | 27 ++++++------ hw/i386/sgx-epc.c | 2 +- hw/i386/x86.c | 23 +++++----- hw/ide/ide-dev.c | 2 +- hw/intc/apic_common.c | 2 +- hw/loongarch/virt.c | 18 ++++---- hw/mem/nvdimm.c | 5 ++- hw/mem/pc-dimm.c | 3 +- hw/misc/aspeed_lpc.c | 36 ++++++++++------ hw/misc/aspeed_sdmc.c | 2 +- hw/misc/npcm7xx_mft.c | 2 +- hw/net/ne2000-isa.c | 2 +- hw/nvme/ctrl.c | 2 +- hw/pci-bridge/pci_expander_bridge.c | 2 +- hw/pci-host/i440fx.c | 4 ++ hw/pci-host/pnv_phb3.c | 4 +- hw/pci-host/pnv_phb4.c | 4 +- hw/pci-host/q35.c | 8 ++-- hw/ppc/spapr_caps.c | 2 +- hw/ppc/spapr_drc.c | 4 +- hw/remote/vfio-user-obj.c | 2 +- hw/riscv/microchip_pfsoc.c | 1 + hw/riscv/virt.c | 4 +- hw/s390x/s390-virtio-ccw.c | 4 +- hw/s390x/sclpcpi.c | 6 ++- hw/s390x/virtio-ccw-mem.c | 2 +- hw/sensor/adc128d818.c | 8 ++-- hw/sensor/adm1266.c | 2 +- hw/sensor/adm1272.c | 8 ++-- hw/sensor/emc141x.c | 8 ++-- hw/sensor/isl_pmbus_vr.c | 18 ++++---- hw/sensor/lsm303dlhc_mag.c | 24 +++++------ hw/sensor/max34451.c | 4 +- hw/sensor/tmp105.c | 2 +- hw/sensor/tmp421.c | 8 ++-- hw/usb/dev-storage-classic.c | 2 +- hw/vfio-user/pci.c | 2 +- hw/virtio/virtio-balloon.c | 4 +- hw/virtio/virtio-mem-pci.c | 2 +- hw/virtio/virtio-mem.c | 7 +-- hw/xen/xen-pvh-common.c | 8 ++-- iothread.c | 8 ++-- net/colo-compare.c | 6 +-- net/dump.c | 3 +- net/filter-buffer.c | 2 +- qom/object.c | 66 ++++++++++++++++------------- system/bootdevice.c | 2 +- system/memory.c | 4 +- target/arm/cpu64.c | 10 ++--- target/arm/kvm.c | 2 +- target/arm/tcg/cpu64.c | 4 +- target/i386/cpu.c | 20 +++++---- target/i386/kvm/kvm.c | 8 ++-- target/i386/kvm/tdx.c | 2 +- target/i386/sev.c | 8 ++-- target/i386/whpx/whpx-all.c | 18 ++++---- target/ppc/compat.c | 2 +- target/riscv/cpu.c | 12 +++--- target/riscv/kvm/kvm-cpu.c | 6 +-- target/riscv/tcg/tcg-cpu.c | 6 +-- target/s390x/cpu-system.c | 1 + target/s390x/cpu_models.c | 5 ++- tests/unit/test-qdev-global-props.c | 6 ++- ui/console.c | 2 +- util/thread-context.c | 6 +-- 95 files changed, 378 insertions(+), 328 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index e9b380462d..77fc618b9d 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1163,6 +1163,7 @@ void object_unref(void *obj); * defined. Sub namespaces are constructed by using a prefix and then * to angle brackets. For instance, the type 'virtio-net-pci' in the * 'link' namespace would be 'link'. + * @qapi_type: QAPI type info descriptor * @get: The getter to be called to read a property. If this is NULL, then * the property cannot be read. * @set: the setter to be called to write a property. If this is NULL, @@ -1188,6 +1189,7 @@ void object_unref(void *obj); */ ObjectProperty *object_property_try_add(Object *obj, const char *name, const char *type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release, @@ -1203,6 +1205,7 @@ ObjectProperty *object_property_try_add(Object *obj, = const char *name, * defined. Sub namespaces are constructed by using a prefix and then * to angle brackets. For instance, the type 'virtio-net-pci' in the * 'link' namespace would be 'link'. + * @qapi_type: QAPI type info descriptor * @get: The getter to be called to read a property. If this is NULL, then * the property cannot be read. * @set: the setter to be called to write a property. If this is NULL, @@ -1220,6 +1223,7 @@ ObjectProperty *object_property_try_add(Object *obj, = const char *name, */ ObjectProperty *object_property_add(Object *obj, const char *name, const char *type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release, @@ -1237,6 +1241,7 @@ void object_property_del(Object *obj, const char *nam= e); =20 ObjectProperty *object_class_property_add(ObjectClass *klass, const char *= name, const char *type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release, diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 8bd9154a50..213ee15b4a 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -277,9 +277,9 @@ static void hvf_accel_class_init(ObjectClass *oc, const= void *data) ac->allowed =3D &hvf_allowed; hvf_kernel_irqchip_override =3D false; hvf_kernel_irqchip =3D false; - object_class_property_add(oc, "kernel-irqchip", "on|off|split", - NULL, hvf_set_kernel_irqchip, - NULL, NULL); + object_class_property_add(oc, "kernel-irqchip", "on|off|split", NULL, + NULL, hvf_set_kernel_irqchip, + NULL, NULL); object_class_property_set_description(oc, "kernel-irqchip", "Configure HVF irqchip"); } diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index db8fba53f3..9cc1e4b0a9 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -4303,21 +4303,22 @@ static void kvm_accel_class_init(ObjectClass *oc, c= onst void *data) ac->has_memory =3D kvm_accel_has_memory; ac->allowed =3D &kvm_allowed; =20 - object_class_property_add(oc, "kernel-irqchip", "on|off|split", - NULL, kvm_set_kernel_irqchip, - NULL, NULL); + object_class_property_add(oc, "kernel-irqchip", "on|off|split", NULL, + NULL, kvm_set_kernel_irqchip, + NULL, NULL); object_class_property_set_description(oc, "kernel-irqchip", "Configure KVM in-kernel irqchip"); =20 - object_class_property_add(oc, "kvm-shadow-mem", "int", - kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_mem, - NULL, NULL); + object_class_property_add(oc, "kvm-shadow-mem", "int", NULL, + kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_m= em, + NULL, NULL); object_class_property_set_description(oc, "kvm-shadow-mem", "KVM shadow MMU size"); =20 - object_class_property_add(oc, "dirty-ring-size", "uint32", - kvm_get_dirty_ring_size, kvm_set_dirty_ring_size, - NULL, NULL); + object_class_property_add(oc, "dirty-ring-size", "uint32", NULL, + kvm_get_dirty_ring_size, + kvm_set_dirty_ring_size, + NULL, NULL); object_class_property_set_description(oc, "dirty-ring-size", "Size of KVM dirty page ring buffer (default: 0, i.e. use bitmap)"= ); =20 diff --git a/accel/nitro/nitro-accel.c b/accel/nitro/nitro-accel.c index a1e97a9162..597027438c 100644 --- a/accel/nitro/nitro-accel.c +++ b/accel/nitro/nitro-accel.c @@ -238,7 +238,7 @@ static void nitro_accel_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, "debug-mode", "Start enclave in debug mode (enables console output)"); =20 - object_class_property_add(oc, "enclave-cid", "uint64", + object_class_property_add(oc, "enclave-cid", "uint64", NULL, nitro_get_enclave_cid, nitro_set_enclave_cid, NULL, NULL); diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 767e880555..ed314e01cb 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -270,9 +270,9 @@ static void tcg_accel_class_init(ObjectClass *oc, const= void *data) tcg_get_thread, tcg_set_thread); =20 - object_class_property_add(oc, "tb-size", "uint32", - tcg_get_tb_size, tcg_set_tb_size, - NULL, NULL); + object_class_property_add(oc, "tb-size", "uint32", NULL, + tcg_get_tb_size, tcg_set_tb_size, + NULL, NULL); object_class_property_set_description(oc, "tb-size", "TCG translation block cache size"); =20 diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c index 247e12db81..f82e607745 100644 --- a/accel/whpx/whpx-common.c +++ b/accel/whpx/whpx-common.c @@ -528,14 +528,14 @@ static void whpx_accel_class_init(ObjectClass *oc, co= nst void *data) ac->pre_resume_vm =3D whpx_pre_resume_vm; ac->allowed =3D &whpx_allowed; =20 - object_class_property_add(oc, "kernel-irqchip", "on|off|split", - NULL, whpx_set_kernel_irqchip, - NULL, NULL); + object_class_property_add(oc, "kernel-irqchip", "on|off|split", NULL, + NULL, whpx_set_kernel_irqchip, + NULL, NULL); object_class_property_set_description(oc, "kernel-irqchip", "Configure WHPX in-kernel irqchip"); - object_class_property_add(oc, "hyperv", "OnOffAuto", - NULL, whpx_set_hyperv, - NULL, NULL); + object_class_property_add(oc, "hyperv", "OnOffAuto", NULL, + NULL, whpx_set_hyperv, + NULL, NULL); object_class_property_set_description(oc, "hyperv", "Configure Hyper-V enlightenments"); =20 diff --git a/authz/list.c b/authz/list.c index 17aa0efd80..72aedc6ac4 100644 --- a/authz/list.c +++ b/authz/list.c @@ -126,7 +126,7 @@ qauthz_list_class_init(ObjectClass *oc, const void *dat= a) qauthz_list_prop_get_policy, qauthz_list_prop_set_policy); =20 - object_class_property_add(oc, "rules", "QAuthZListRule", + object_class_property_add(oc, "rules", "QAuthZListRule", NULL, qauthz_list_prop_get_rules, qauthz_list_prop_set_rules, NULL, NULL); diff --git a/backends/cryptodev.c b/backends/cryptodev.c index e8f2b18f20..cc323014cc 100644 --- a/backends/cryptodev.c +++ b/backends/cryptodev.c @@ -622,15 +622,15 @@ cryptodev_backend_class_init(ObjectClass *oc, const v= oid *data) ucc->prepare_delete =3D cryptodev_backend_prepare_delete; =20 QTAILQ_INIT(&crypto_clients); - object_class_property_add(oc, "queues", "uint32", + object_class_property_add(oc, "queues", "uint32", NULL, cryptodev_backend_get_queues, cryptodev_backend_set_queues, NULL, NULL); - object_class_property_add(oc, "throttle-bps", "uint64", + object_class_property_add(oc, "throttle-bps", "uint64", NULL, cryptodev_backend_get_bps, cryptodev_backend_set_bps, NULL, NULL); - object_class_property_add(oc, "throttle-ops", "uint64", + object_class_property_add(oc, "throttle-ops", "uint64", NULL, cryptodev_backend_get_ops, cryptodev_backend_set_ops, NULL, NULL); diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 7efecf71f5..aec38bac2f 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -281,14 +281,14 @@ file_backend_class_init(ObjectClass *oc, const void *= data) file_memory_backend_get_discard_data, file_memory_backend_set_disc= ard_data); object_class_property_add_str(oc, "mem-path", get_mem_path, set_mem_path); - object_class_property_add(oc, "align", "uint64", - file_memory_backend_get_align, - file_memory_backend_set_align, - NULL, NULL); - object_class_property_add(oc, "offset", "int", - file_memory_backend_get_offset, - file_memory_backend_set_offset, - NULL, NULL); + object_class_property_add(oc, "align", "uint64", NULL, + file_memory_backend_get_align, + file_memory_backend_set_align, + NULL, NULL); + object_class_property_add(oc, "offset", "int", NULL, + file_memory_backend_get_offset, + file_memory_backend_set_offset, + NULL, NULL); object_class_property_set_description(oc, "offset", "Offset into the target file (ex: 1G)"); #ifdef CONFIG_LIBPMEM @@ -298,8 +298,9 @@ file_backend_class_init(ObjectClass *oc, const void *da= ta) object_class_property_add_bool(oc, "readonly", file_memory_backend_get_readonly, file_memory_backend_set_readonly); - object_class_property_add(oc, "rom", "OnOffAuto", - file_memory_backend_get_rom, file_memory_backend_set_rom, NULL, NU= LL); + object_class_property_add(oc, "rom", "OnOffAuto", NULL, + file_memory_backend_get_rom, + file_memory_backend_set_rom, NULL, NULL); object_class_property_set_description(oc, "rom", "Whether to create Read Only Memory (ROM)"); } diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index 67f1924a36..7df0440071 100644 --- a/backends/hostmem-memfd.c +++ b/backends/hostmem-memfd.c @@ -198,7 +198,7 @@ memfd_backend_class_init(ObjectClass *oc, const void *d= ata) memfd_backend_set_hugetlb); object_class_property_set_description(oc, "hugetlb", "Use huge pages"); - object_class_property_add(oc, "hugetlbsize", "uint64", + object_class_property_add(oc, "hugetlbsize", "uint64", NULL, memfd_backend_get_hugetlbsize, memfd_backend_set_hugetlbsize, NULL, NULL); @@ -206,7 +206,7 @@ memfd_backend_class_init(ObjectClass *oc, const void *d= ata) "Huge pages size (ex: 2M, 1G= )"); } =20 - object_class_property_add(oc, "guest-memfd", "OnOffAuto", + object_class_property_add(oc, "guest-memfd", "OnOffAuto", NULL, memfd_backend_get_guest_memfd, memfd_backend_set_guest_memfd, NULL, NULL); object_class_property_set_description(oc, "guest-memfd", diff --git a/backends/hostmem.c b/backends/hostmem.c index 8782c8b1ea..299a3b90fe 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -528,10 +528,10 @@ host_memory_backend_class_init(ObjectClass *oc, const= void *data) host_memory_backend_set_prealloc); object_class_property_set_description(oc, "prealloc", "Preallocate memory"); - object_class_property_add(oc, "prealloc-threads", "int", - host_memory_backend_get_prealloc_threads, - host_memory_backend_set_prealloc_threads, - NULL, NULL); + object_class_property_add(oc, "prealloc-threads", "int", NULL, + host_memory_backend_get_prealloc_threads, + host_memory_backend_set_prealloc_threads, + NULL, NULL); object_class_property_set_description(oc, "prealloc-threads", "Number of CPU threads to use for prealloc"); object_class_property_add_link(oc, "prealloc-context", @@ -539,16 +539,16 @@ host_memory_backend_class_init(ObjectClass *oc, const= void *data) object_property_allow_set_link, OBJ_PROP_LINK_STRONG); object_class_property_set_description(oc, "prealloc-context", "Context to use for creating CPU threads for preallocation"); - object_class_property_add(oc, "size", "size", - host_memory_backend_get_size, - host_memory_backend_set_size, - NULL, NULL); + object_class_property_add(oc, "size", "size", NULL, + host_memory_backend_get_size, + host_memory_backend_set_size, + NULL, NULL); object_class_property_set_description(oc, "size", "Size of the memory region (ex: 500M)"); - object_class_property_add(oc, "host-nodes", "[uint16]", - host_memory_backend_get_host_nodes, - host_memory_backend_set_host_nodes, - NULL, NULL); + object_class_property_add(oc, "host-nodes", "[uint16]", NULL, + host_memory_backend_get_host_nodes, + host_memory_backend_set_host_nodes, + NULL, NULL); object_class_property_set_description(oc, "host-nodes", "Binds memory to the list of NUMA host nodes"); object_class_property_add_enum(oc, "policy", "HostMemPolicy", diff --git a/block/throttle-groups.c b/block/throttle-groups.c index 37814b84fe..cfe2ea67e3 100644 --- a/block/throttle-groups.c +++ b/block/throttle-groups.c @@ -984,17 +984,14 @@ static void throttle_group_obj_class_init(ObjectClass= *klass, =20 /* individual properties */ for (i =3D 0; i < sizeof(properties) / sizeof(ThrottleParamInfo); i++)= { - object_class_property_add(klass, - properties[i].name, - "int64", + object_class_property_add(klass, properties[i].name, "int64", NULL, throttle_group_get, throttle_group_set, NULL, &properties[i]); } =20 /* ThrottleLimits */ - object_class_property_add(klass, - "limits", "ThrottleLimits", + object_class_property_add(klass, "limits", "ThrottleLimits", NULL, throttle_group_get_limits, throttle_group_set_limits, NULL, NULL); diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 81bac42a15..6ce9c2a50b 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -1568,7 +1568,7 @@ static void char_socket_class_init(ObjectClass *oc, c= onst void *data) cc->chr_listener_cleanup =3D tcp_chr_listener_cleanup; cc->chr_get_filename =3D tcp_chr_get_filename; =20 - object_class_property_add(oc, "addr", "SocketAddress", + object_class_property_add(oc, "addr", "SocketAddress", NULL, char_socket_get_addr, NULL, NULL, NULL); =20 diff --git a/crypto/secret_keyring.c b/crypto/secret_keyring.c index 3b332276ef..e9cb222bf8 100644 --- a/crypto/secret_keyring.c +++ b/crypto/secret_keyring.c @@ -107,7 +107,7 @@ qcrypto_secret_keyring_class_init(ObjectClass *oc, cons= t void *data) QCryptoSecretCommonClass *sic =3D QCRYPTO_SECRET_COMMON_CLASS(oc); sic->load_data =3D qcrypto_secret_keyring_load_data; =20 - object_class_property_add(oc, "serial", "int32_t", + object_class_property_add(oc, "serial", "int32_t", NULL, qcrypto_secret_prop_get_key, qcrypto_secret_prop_set_key, NULL, NULL); diff --git a/event-loop-base.c b/event-loop-base.c index 23f554d92c..42bf09d58b 100644 --- a/event-loop-base.c +++ b/event-loop-base.c @@ -104,15 +104,15 @@ static void event_loop_base_class_init(ObjectClass *k= lass, ucc->complete =3D event_loop_base_complete; ucc->prepare_delete =3D event_loop_base_prepare_delete; =20 - object_class_property_add(klass, "aio-max-batch", "int64", + object_class_property_add(klass, "aio-max-batch", "int64", NULL, event_loop_base_get_param, event_loop_base_set_param, NULL, &aio_max_batch_info); - object_class_property_add(klass, "thread-pool-min", "int64", + object_class_property_add(klass, "thread-pool-min", "int64", NULL, event_loop_base_get_param, event_loop_base_set_param, NULL, &thread_pool_min_info); - object_class_property_add(klass, "thread-pool-max", "int64", + object_class_property_add(klass, "thread-pool-max", "int64", NULL, event_loop_base_get_param, event_loop_base_set_param, NULL, &thread_pool_max_info); diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 6d421b990c..f3e248c8da 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -379,7 +379,7 @@ void ich9_pm_add_class_properties(ObjectClass *oc, ptrd= iff_t pm_offset) PM_REG_FIELD(acpi_pci_hotplug.root), object_property_allow_set_link, OBJ_PROP_LINK_STRONG); - object_class_property_add(oc, ACPI_PM_PROP_GPE0_BLK, "uint32", + object_class_property_add(oc, ACPI_PM_PROP_GPE0_BLK, "uint32", NULL, ich9_pm_get_gpe0_blk, NULL, NULL, NULL); object_class_property_add_uint8_ptr(oc, ACPI_PM_PROP_S3_DISABLED, diff --git a/hw/acpi/pci.c b/hw/acpi/pci.c index c82924be86..abd1071f49 100644 --- a/hw/acpi/pci.c +++ b/hw/acpi/pci.c @@ -139,8 +139,8 @@ static void acpi_generic_initiator_class_init(ObjectCla= ss *oc, const void *data) acpi_generic_initiator_set_pci_device); object_class_property_set_description(oc, "pci-dev", "PCI device to associate with the node"); - object_class_property_add(oc, "node", "uint32", NULL, - acpi_generic_initiator_set_node, NULL, NULL); + object_class_property_add(oc, "node", "uint32", NULL, NULL, + acpi_generic_initiator_set_node, NULL, NULL); object_class_property_set_description(oc, "node", "NUMA node associated with the PCI device"); } @@ -253,8 +253,8 @@ static void acpi_generic_port_class_init(ObjectClass *o= c, const void *data) acpi_generic_port_set_pci_bus); object_class_property_set_description(oc, "pci-bus", "PCI Bus of the host bridge associated with this GP affinity struct= ure"); - object_class_property_add(oc, "node", "uint32", NULL, - acpi_generic_port_set_node, NULL, NULL); + object_class_property_add(oc, "node", "uint32", NULL, NULL, + acpi_generic_port_set_node, NULL, NULL); object_class_property_set_description(oc, "node", "The NUMA node like ID to index HMAT/SLIT NUMA properties involving= GP"); } diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 3ab3ad8c3b..dad3f8c39b 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -4206,9 +4206,9 @@ static void virt_machine_class_init(ObjectClass *oc, = const void *data) mc->default_ram_id =3D "mach-virt.ram"; mc->default_nic =3D "virtio-net-pci"; =20 - object_class_property_add(oc, "acpi", "OnOffAuto", - virt_get_acpi, virt_set_acpi, - NULL, NULL); + object_class_property_add(oc, "acpi", "OnOffAuto", NULL, + virt_get_acpi, virt_set_acpi, + NULL, NULL); object_class_property_set_description(oc, "acpi", "Enable ACPI"); object_class_property_add_bool(oc, "secure", virt_get_secure, @@ -4259,7 +4259,7 @@ static void virt_machine_class_init(ObjectClass *oc, = const void *data) "Set on/off to enable/disable hi= gh " "memory region for PCI MMIO"); =20 - object_class_property_add(oc, "highmem-mmio-size", "size", + object_class_property_add(oc, "highmem-mmio-size", "size", NULL, virt_get_highmem_mmio_size, virt_set_highmem_mmio_size, NULL, NULL); @@ -4267,7 +4267,7 @@ static void virt_machine_class_init(ObjectClass *oc, = const void *data) "Set the high memory region size= " "for PCI MMIO"); =20 - object_class_property_add(oc, "virtio-mmio-transports", "uint8", + object_class_property_add(oc, "virtio-mmio-transports", "uint8", NULL, virt_get_virtio_transports, virt_set_virtio_transports, NULL, NULL); diff --git a/hw/core/clock.c b/hw/core/clock.c index 3fc98a0c65..d46c888f5c 100644 --- a/hw/core/clock.c +++ b/hw/core/clock.c @@ -185,7 +185,7 @@ static void clock_initfn(Object *obj) QLIST_INIT(&clk->children); =20 if (qtest_enabled()) { - object_property_add(obj, "qtest-clock-period", "uint64", + object_property_add(obj, "qtest-clock-period", "uint64", NULL, clock_period_prop_get, NULL, NULL, NULL); } } diff --git a/hw/core/machine.c b/hw/core/machine.c index 4da24f014a..6948fc9c26 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1119,26 +1119,29 @@ static void machine_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, "dumpdtb", "Dump current dtb to a file and quit"); =20 - object_class_property_add(oc, "boot", "BootConfiguration", - machine_get_boot, machine_set_boot, - NULL, NULL); + object_class_property_add(oc, "boot", "BootConfiguration", NULL, + machine_get_boot, machine_set_boot, + NULL, NULL); object_class_property_set_description(oc, "boot", "Boot configuration"); =20 - object_class_property_add(oc, "smp", "SMPConfiguration", - machine_get_smp, machine_set_smp, - NULL, NULL); + object_class_property_add(oc, "smp", "SMPConfiguration", NULL, + machine_get_smp, machine_set_smp, + NULL, NULL); object_class_property_set_description(oc, "smp", "CPU topology"); =20 object_class_property_add(oc, "smp-cache", "SmpCachePropertiesWrapper", - machine_get_smp_cache, machine_set_smp_cache, NULL, NULL); + NULL, + machine_get_smp_cache, machine_set_smp_cache, + NULL, NULL); object_class_property_set_description(oc, "smp-cache", "Cache properties list for SMP machine"); =20 - object_class_property_add(oc, "phandle-start", "int", - machine_get_phandle_start, machine_set_phandle_start, - NULL, NULL); + object_class_property_add(oc, "phandle-start", "int", NULL, + machine_get_phandle_start, + machine_set_phandle_start, + NULL, NULL); object_class_property_set_description(oc, "phandle-start", "The first phandle ID we may generate dynamically"); =20 @@ -1213,9 +1216,9 @@ static void machine_class_init(ObjectClass *oc, const= void *data) "Set RAM backend" "Valid value is ID of hostmem ba= sed backend"); =20 - object_class_property_add(oc, "memory", "MemorySizeConfiguration", - machine_get_mem, machine_set_mem, - NULL, NULL); + object_class_property_add(oc, "memory", "MemorySizeConfiguration", NUL= L, + machine_get_mem, machine_set_mem, + NULL, NULL); object_class_property_set_description(oc, "memory", "Memory size configuration"); } diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 34d7b26a73..61dca80c95 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -1150,7 +1150,7 @@ void qdev_property_add_static(DeviceState *dev, const= Property *prop) =20 assert(!prop->info->create); =20 - op =3D object_property_add(obj, prop->name, prop->info->type, + op =3D object_property_add(obj, prop->name, prop->info->type, NULL, field_prop_getter(prop->info), field_prop_setter(prop->info), prop->info->release, @@ -1176,8 +1176,7 @@ static void qdev_class_add_property(DeviceClass *klas= s, const char *name, if (prop->info->create) { op =3D prop->info->create(oc, name, prop); } else { - op =3D object_class_property_add(oc, - name, prop->info->type, + op =3D object_class_property_add(oc, name, prop->info->type, NULL, field_prop_getter(prop->info), field_prop_setter(prop->info), prop->info->release, diff --git a/hw/cpu/core.c b/hw/cpu/core.c index 26e488f3d8..f430befad8 100644 --- a/hw/cpu/core.c +++ b/hw/cpu/core.c @@ -82,9 +82,11 @@ static void cpu_core_class_init(ObjectClass *oc, const v= oid *data) DeviceClass *dc =3D DEVICE_CLASS(oc); =20 set_bit(DEVICE_CATEGORY_CPU, dc->categories); - object_class_property_add(oc, "core-id", "int", core_prop_get_core_id, + object_class_property_add(oc, "core-id", "int", NULL, + core_prop_get_core_id, core_prop_set_core_id, NULL, NULL); - object_class_property_add(oc, "nr-threads", "int", core_prop_get_nr_th= reads, + object_class_property_add(oc, "nr-threads", "int", NULL, + core_prop_get_nr_threads, core_prop_set_nr_threads, NULL, NULL); } =20 diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index cda4dfed50..9348c9841e 100644 --- a/hw/cxl/cxl-host.c +++ b/hw/cxl/cxl-host.c @@ -610,13 +610,13 @@ static void machine_set_cfmw(Object *obj, Visitor *v,= const char *name, =20 void cxl_machine_init(Object *obj, CXLState *state) { - object_property_add(obj, "cxl", "bool", machine_get_cxl, + object_property_add(obj, "cxl", "bool", NULL, machine_get_cxl, machine_set_cxl, NULL, state); object_property_set_description(obj, "cxl", "Set on/off to enable/disable " "CXL instantiation"); =20 - object_property_add(obj, "cxl-fmw", "CXLFixedMemoryWindow", + object_property_add(obj, "cxl-fmw", "CXLFixedMemoryWindow", NULL, machine_get_cfmw, machine_set_cfmw, NULL, state); object_property_set_description(obj, "cxl-fmw", diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c index 1cf6f5df55..4463cf7c9f 100644 --- a/hw/gpio/aspeed_gpio.c +++ b/hw/gpio/aspeed_gpio.c @@ -1481,7 +1481,7 @@ static void aspeed_gpio_init(Object *obj) int pin_idx =3D j % GPIOS_PER_GROUP; const char *group =3D &props->group_label[group_idx][0]; char *name =3D g_strdup_printf("gpio%s%d", group, pin_idx); - object_property_add(obj, name, "bool", aspeed_gpio_get_pin, + object_property_add(obj, name, "bool", NULL, aspeed_gpio_get_p= in, aspeed_gpio_set_pin, NULL, NULL); g_free(name); } @@ -1489,8 +1489,8 @@ static void aspeed_gpio_init(Object *obj) =20 for (int i =3D 0; i < agc->nr_gpio_sets; i++) { g_autofree char *name =3D g_strdup_printf("gpio-set[%d]", i); - object_property_add(obj, name, "uint32", aspeed_gpio_get_set, - aspeed_gpio_set_set, NULL, NULL); + object_property_add(obj, name, "uint32", NULL, aspeed_gpio_get_set, + aspeed_gpio_set_set, NULL, NULL); } } =20 diff --git a/hw/gpio/aspeed_sgpio.c b/hw/gpio/aspeed_sgpio.c index 7d2f736995..aeaef4f102 100644 --- a/hw/gpio/aspeed_sgpio.c +++ b/hw/gpio/aspeed_sgpio.c @@ -300,7 +300,7 @@ static void aspeed_sgpio_init(Object *obj) { for (int i =3D 0; i < ASPEED_SGPIO_MAX_PIN_PAIR * 2; i++) { g_autofree char *name =3D g_strdup_printf("sgpio%03d", i); - object_property_add(obj, name, "bool", aspeed_sgpio_get_pin, + object_property_add(obj, name, "bool", NULL, aspeed_sgpio_get_pin, aspeed_sgpio_set_pin, NULL, NULL); } } diff --git a/hw/gpio/pca9552.c b/hw/gpio/pca9552.c index 719149b717..7e5fda4980 100644 --- a/hw/gpio/pca9552.c +++ b/hw/gpio/pca9552.c @@ -567,12 +567,12 @@ static void pca955x_initfn(Object *obj) if (k->has_led_support) { /* LED variant: expose the LED selector state as led%d. */ name =3D g_strdup_printf("led%d", ix); - object_property_add(obj, name, "bool", + object_property_add(obj, name, "bool", NULL, pca955x_get_led, pca955x_set_led, NULL, NU= LL); } else { /* GPIO variant: expose the pin logic level as pin%d. */ name =3D g_strdup_printf("pin%d", ix); - object_property_add(obj, name, "str", + object_property_add(obj, name, "str", NULL, pca955x_get_pin, pca955x_set_pin, NULL, NU= LL); } g_free(name); diff --git a/hw/gpio/pca9554.c b/hw/gpio/pca9554.c index 904698cdce..0dd063f93a 100644 --- a/hw/gpio/pca9554.c +++ b/hw/gpio/pca9554.c @@ -280,7 +280,8 @@ static void pca9554_initfn(Object *obj) char *name; =20 name =3D g_strdup_printf("pin%d", pin); - object_property_add(obj, name, "str", pca9554_get_pin, pca9554_set= _pin, + object_property_add(obj, name, "str", NULL, pca9554_get_pin, + pca9554_set_pin, NULL, NULL); g_free(name); } diff --git a/hw/gpio/stm32l4x5_gpio.c b/hw/gpio/stm32l4x5_gpio.c index 92fa397fba..a31999323a 100644 --- a/hw/gpio/stm32l4x5_gpio.c +++ b/hw/gpio/stm32l4x5_gpio.c @@ -409,10 +409,10 @@ static void stm32l4x5_gpio_init(Object *obj) =20 s->clk =3D qdev_init_clock_in(DEVICE(s), "clk", NULL, s, 0); =20 - object_property_add(obj, "disconnected-pins", "uint16", + object_property_add(obj, "disconnected-pins", "uint16", NULL, disconnected_pins_get, disconnected_pins_set, NULL, &s->disconnected_pins); - object_property_add(obj, "clock-freq-hz", "uint32", + object_property_add(obj, "clock-freq-hz", "uint32", NULL, clock_freq_get, NULL, NULL, NULL); } =20 diff --git a/hw/hexagon/hexagon_dsp.c b/hw/hexagon/hexagon_dsp.c index 05b95f39aa..abccf10c00 100644 --- a/hw/hexagon/hexagon_dsp.c +++ b/hw/hexagon/hexagon_dsp.c @@ -153,7 +153,7 @@ static void hexagon_sim_set_subsystem_base(Object *obj,= Visitor *v, =20 static void add_dsp_properties(ObjectClass *oc) { - object_class_property_add(oc, "subsystem-base", "uint32", + object_class_property_add(oc, "subsystem-base", "uint32", NULL, hexagon_sim_get_subsystem_base, hexagon_sim_set_subsystem_base, NULL, NULL); object_class_property_set_description(oc, "subsystem-base", diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index a49de33749..c679b3b177 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -673,21 +673,21 @@ static void microvm_class_init(ObjectClass *oc, const= void *data) hc->unplug_request =3D microvm_device_unplug_request_cb; hc->unplug =3D microvm_device_unplug_cb; =20 - object_class_property_add(oc, MICROVM_MACHINE_RTC, "OnOffAuto", + object_class_property_add(oc, MICROVM_MACHINE_RTC, "OnOffAuto", NULL, microvm_machine_get_rtc, microvm_machine_set_rtc, NULL, NULL); object_class_property_set_description(oc, MICROVM_MACHINE_RTC, "Enable MC146818 RTC"); =20 - object_class_property_add(oc, MICROVM_MACHINE_PCIE, "OnOffAuto", + object_class_property_add(oc, MICROVM_MACHINE_PCIE, "OnOffAuto", NULL, microvm_machine_get_pcie, microvm_machine_set_pcie, NULL, NULL); object_class_property_set_description(oc, MICROVM_MACHINE_PCIE, "Enable PCIe"); =20 - object_class_property_add(oc, MICROVM_MACHINE_IOAPIC2, "OnOffAuto", + object_class_property_add(oc, MICROVM_MACHINE_IOAPIC2, "OnOffAuto", NU= LL, microvm_machine_get_ioapic2, microvm_machine_set_ioapic2, NULL, NULL); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index dbfd55de30..1fce96f5ec 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1722,15 +1722,16 @@ static void pc_machine_class_init(ObjectClass *oc, = const void *data) mc->default_ram_id =3D "pc.ram"; pcmc->default_smbios_ep_type =3D SMBIOS_ENTRY_POINT_TYPE_AUTO; =20 - object_class_property_add(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "size", - pc_machine_get_max_ram_below_4g, pc_machine_set_max_ram_below_4g, - NULL, NULL); + object_class_property_add(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "size", NUL= L, + pc_machine_get_max_ram_below_4g, + pc_machine_set_max_ram_below_4g, + NULL, NULL); object_class_property_set_description(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "Maximum ram below the 4G boundary (32bit boundary)"); =20 - object_class_property_add(oc, PC_MACHINE_VMPORT, "OnOffAuto", - pc_machine_get_vmport, pc_machine_set_vmport, - NULL, NULL); + object_class_property_add(oc, PC_MACHINE_VMPORT, "OnOffAuto", NULL, + pc_machine_get_vmport, pc_machine_set_vmport, + NULL, NULL); object_class_property_set_description(oc, PC_MACHINE_VMPORT, "Enable vmport (pc & q35)"); =20 @@ -1758,15 +1759,17 @@ static void pc_machine_class_init(ObjectClass *oc, = const void *data) pc_machine_get_default_bus_bypass_iommu, pc_machine_set_default_bus_bypass_iommu); =20 - object_class_property_add(oc, PC_MACHINE_MAX_FW_SIZE, "size", - pc_machine_get_max_fw_size, pc_machine_set_max_fw_size, - NULL, NULL); + object_class_property_add(oc, PC_MACHINE_MAX_FW_SIZE, "size", NULL, + pc_machine_get_max_fw_size, + pc_machine_set_max_fw_size, + NULL, NULL); object_class_property_set_description(oc, PC_MACHINE_MAX_FW_SIZE, "Maximum combined firmware size"); =20 - object_class_property_add(oc, PC_MACHINE_SMBIOS_EP, "str", - pc_machine_get_smbios_ep, pc_machine_set_smbios_ep, - NULL, NULL); + object_class_property_add(oc, PC_MACHINE_SMBIOS_EP, "str", NULL, + pc_machine_get_smbios_ep, + pc_machine_set_smbios_ep, + NULL, NULL); object_class_property_set_description(oc, PC_MACHINE_SMBIOS_EP, "SMBIOS Entry Point type [32, 64]"); =20 diff --git a/hw/i386/sgx-epc.c b/hw/i386/sgx-epc.c index 29cda843c9..a1b55c2ec3 100644 --- a/hw/i386/sgx-epc.c +++ b/hw/i386/sgx-epc.c @@ -159,7 +159,7 @@ static void sgx_epc_class_init(ObjectClass *oc, const v= oid *data) mdc->get_memory_region =3D sgx_epc_md_get_memory_region; mdc->fill_device_info =3D sgx_epc_md_fill_device_info; =20 - object_class_property_add(oc, SGX_EPC_SIZE_PROP, "uint64", + object_class_property_add(oc, SGX_EPC_SIZE_PROP, "uint64", NULL, sgx_epc_get_size, NULL, NULL, NULL); diff --git a/hw/i386/x86.c b/hw/i386/x86.c index f8ba3244e2..1b7740a97e 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -391,26 +391,26 @@ static void x86_machine_class_init(ObjectClass *oc, c= onst void *data) mc->kvm_type =3D x86_kvm_type; nc->raise_nmi =3D x86_nmi; =20 - object_class_property_add(oc, X86_MACHINE_SMM, "OnOffAuto", - x86_machine_get_smm, x86_machine_set_smm, - NULL, NULL); + object_class_property_add(oc, X86_MACHINE_SMM, "OnOffAuto", NULL, + x86_machine_get_smm, x86_machine_set_smm, + NULL, NULL); object_class_property_set_description(oc, X86_MACHINE_SMM, "Enable SMM"); =20 - object_class_property_add(oc, X86_MACHINE_ACPI, "OnOffAuto", - x86_machine_get_acpi, x86_machine_set_acpi, - NULL, NULL); + object_class_property_add(oc, X86_MACHINE_ACPI, "OnOffAuto", NULL, + x86_machine_get_acpi, x86_machine_set_acpi, + NULL, NULL); object_class_property_set_description(oc, X86_MACHINE_ACPI, "Enable ACPI"); =20 - object_class_property_add(oc, X86_MACHINE_PIT, "OnOffAuto", + object_class_property_add(oc, X86_MACHINE_PIT, "OnOffAuto", NULL, x86_machine_get_pit, x86_machine_set_pit, NULL, NULL); object_class_property_set_description(oc, X86_MACHINE_PIT, "Enable i8254 PIT"); =20 - object_class_property_add(oc, X86_MACHINE_PIC, "OnOffAuto", + object_class_property_add(oc, X86_MACHINE_PIC, "OnOffAuto", NULL, x86_machine_get_pic, x86_machine_set_pic, NULL, NULL); @@ -435,14 +435,15 @@ static void x86_machine_class_init(ObjectClass *oc, c= onst void *data) "The string may be up to 8 bytes= in size"); =20 object_class_property_add(oc, X86_MACHINE_BUS_LOCK_RATELIMIT, "uint64_= t", + NULL, x86_machine_get_bus_lock_ratelimit, x86_machine_set_bus_lock_ratelimit, NULL, = NULL); object_class_property_set_description(oc, X86_MACHINE_BUS_LOCK_RATELIM= IT, "Set the ratelimit for the bus locks acquired in VMs"); =20 - object_class_property_add(oc, "sgx-epc", "SgxEPC", - machine_get_sgx_epc, machine_set_sgx_epc, - NULL, NULL); + object_class_property_add(oc, "sgx-epc", "SgxEPC", NULL, + machine_get_sgx_epc, machine_set_sgx_epc, + NULL, NULL); object_class_property_set_description(oc, "sgx-epc", "SGX EPC device"); } diff --git a/hw/ide/ide-dev.c b/hw/ide/ide-dev.c index 5d478588c6..7bb06088a5 100644 --- a/hw/ide/ide-dev.c +++ b/hw/ide/ide-dev.c @@ -174,7 +174,7 @@ out: =20 static void ide_dev_instance_init(Object *obj) { - object_property_add(obj, "bootindex", "int32", + object_property_add(obj, "bootindex", "int32", NULL, ide_dev_get_bootindex, ide_dev_set_bootindex, NULL, NULL); object_property_set_int(obj, "bootindex", -1, NULL); diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c index 0f0f37d457..ee5f6cb4c3 100644 --- a/hw/intc/apic_common.c +++ b/hw/intc/apic_common.c @@ -442,7 +442,7 @@ static void apic_common_initfn(Object *obj) APICCommonState *s =3D APIC_COMMON(obj); =20 s->id =3D s->initial_apic_id =3D -1; - object_property_add(obj, "id", "uint32", + object_property_add(obj, "id", "uint32", NULL, apic_common_get_id, apic_common_set_id, NULL, NULL); } diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 9c5371af9d..8ad327b8dd 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -1483,18 +1483,18 @@ static void virt_class_init(ObjectClass *oc, const = void *data) hc->unplug_request =3D virt_device_unplug_request; hc->unplug =3D virt_device_unplug; =20 - object_class_property_add(oc, "acpi", "OnOffAuto", - virt_get_acpi, virt_set_acpi, - NULL, NULL); + object_class_property_add(oc, "acpi", "OnOffAuto", NULL, + virt_get_acpi, virt_set_acpi, + NULL, NULL); object_class_property_set_description(oc, "acpi", "Enable ACPI"); - object_class_property_add(oc, "v-eiointc", "OnOffAuto", - virt_get_veiointc, virt_set_veiointc, - NULL, NULL); + object_class_property_add(oc, "v-eiointc", "OnOffAuto", NULL, + virt_get_veiointc, virt_set_veiointc, + NULL, NULL); object_class_property_set_description(oc, "v-eiointc", "Enable Virt Extend I/O Interrupt Controller."= ); - object_class_property_add(oc, "dmsi", "OnOffAuto", - virt_get_dmsi, virt_set_dmsi, NULL, NULL); + object_class_property_add(oc, "dmsi", "OnOffAuto", NULL, + virt_get_dmsi, virt_set_dmsi, NULL, NULL); object_class_property_set_description(oc, "dmsi", "Enable direct Message-interrupts Controller."= ); machine_class_allow_dynamic_sysbus_dev(mc, TYPE_RAMFB_DEVICE); @@ -1525,7 +1525,7 @@ static void virt_class_init(ObjectClass *oc, const vo= id *data) object_class_property_set_description(oc, "highmem-mmio", "Set on/off to enable/disable hi= gh " "memory region for PCI MMIO"); - object_class_property_add(oc, "highmem-mmio-size", "size", + object_class_property_add(oc, "highmem-mmio-size", "size", NULL, virt_get_highmem_mmio_size, virt_set_highmem_mmio_size, NULL, NULL); diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index cf8a4d8c5f..8d6e8d0bd9 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -99,11 +99,12 @@ static void nvdimm_set_uuid(Object *obj, Visitor *v, co= nst char *name, =20 static void nvdimm_init(Object *obj) { - object_property_add(obj, NVDIMM_LABEL_SIZE_PROP, "size", + object_property_add(obj, NVDIMM_LABEL_SIZE_PROP, "size", NULL, nvdimm_get_label_size, nvdimm_set_label_size, NULL, NULL); =20 - object_property_add(obj, NVDIMM_UUID_PROP, "QemuUUID", nvdimm_get_uuid, + object_property_add(obj, NVDIMM_UUID_PROP, "QemuUUID", NULL, + nvdimm_get_uuid, nvdimm_set_uuid, NULL, NULL); } =20 diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 68862926ee..7250146c10 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -176,7 +176,8 @@ static void pc_dimm_get_size(Object *obj, Visitor *v, c= onst char *name, =20 static void pc_dimm_init(Object *obj) { - object_property_add(obj, PC_DIMM_SIZE_PROP, "uint64", pc_dimm_get_size, + object_property_add(obj, PC_DIMM_SIZE_PROP, "uint64", NULL, + pc_dimm_get_size, NULL, NULL, NULL); } =20 diff --git a/hw/misc/aspeed_lpc.c b/hw/misc/aspeed_lpc.c index 7f7e4f1a09..a73df07332 100644 --- a/hw/misc/aspeed_lpc.c +++ b/hw/misc/aspeed_lpc.c @@ -417,29 +417,41 @@ static void aspeed_lpc_realize(DeviceState *dev, Erro= r **errp) =20 static void aspeed_lpc_init(Object *obj) { - object_property_add(obj, "idr1", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "idr1", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr1", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "odr1", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str1", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "str1", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr2", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "idr2", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr2", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "odr2", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str2", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "str2", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr3", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "idr3", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr3", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "odr3", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str3", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "str3", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr4", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "idr4", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr4", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "odr4", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str4", "uint32", aspeed_kcs_get_register_pro= perty, + object_property_add(obj, "str4", "uint32", NULL, + aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); } =20 diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c index f8fbaebee6..427816b838 100644 --- a/hw/misc/aspeed_sdmc.c +++ b/hw/misc/aspeed_sdmc.c @@ -259,7 +259,7 @@ static void aspeed_sdmc_set_ram_size(Object *obj, Visit= or *v, const char *name, =20 static void aspeed_sdmc_initfn(Object *obj) { - object_property_add(obj, "ram-size", "int", + object_property_add(obj, "ram-size", "int", NULL, aspeed_sdmc_get_ram_size, aspeed_sdmc_set_ram_size, NULL, NULL); } diff --git a/hw/misc/npcm7xx_mft.c b/hw/misc/npcm7xx_mft.c index 742166c4e8..3ce92fad3a 100644 --- a/hw/misc/npcm7xx_mft.c +++ b/hw/misc/npcm7xx_mft.c @@ -491,7 +491,7 @@ static void npcm7xx_mft_init(Object *obj) s->clock_2 =3D qdev_init_clock_out(dev, "clock2"); =20 for (int i =3D 0; i < NPCM7XX_PWM_PER_MODULE; ++i) { - object_property_add(obj, "max_rpm[*]", "uint32", + object_property_add(obj, "max_rpm[*]", "uint32", NULL, npcm7xx_mft_get_max_rpm, npcm7xx_mft_set_max_rpm, NULL, &s->max_rpm[i]); diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c index 673c785abc..02300eaaa6 100644 --- a/hw/net/ne2000-isa.c +++ b/hw/net/ne2000-isa.c @@ -131,7 +131,7 @@ out: =20 static void isa_ne2000_instance_init(Object *obj) { - object_property_add(obj, "bootindex", "int32", + object_property_add(obj, "bootindex", "int32", NULL, isa_ne2000_get_bootindex, isa_ne2000_set_bootindex, NULL, NULL); object_property_set_int(obj, "bootindex", -1, NULL); diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 578421c217..405010af4b 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -10612,7 +10612,7 @@ static void nvme_instance_init(Object *obj) "bootindex", "/namespace@1,0", DEVICE(obj)); =20 - object_property_add(obj, "smart_critical_warning", "uint8", + object_property_add(obj, "smart_critical_warning", "uint8", NULL, nvme_get_smart_warning, nvme_set_smart_warning, NULL, NULL); } diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expand= er_bridge.c index 2498df480b..d66a12d004 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -75,7 +75,7 @@ void pxb_bus_class_init(ObjectClass *class, const void *d= ata) pbc->bus_num =3D pxb_bus_num; pbc->numa_node =3D pxb_bus_numa_node; =20 - object_class_property_add(class, "acpi_uid", "uint32", + object_class_property_add(class, "acpi_uid", "uint32", NULL, prop_pxb_uid_get, NULL, NULL, NULL); object_class_property_set_description(class, "acpi_uid", "ACPI Unique ID used to distinguish this PCI Host Bridge / ACPI000= 16"); diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index c1982f7962..bf4b6c4253 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -388,18 +388,22 @@ static void i440fx_pcihost_class_init(ObjectClass *kl= ass, const void *data) dc->user_creatable =3D false; =20 object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_START, "uint32= ", + NULL, i440fx_pcihost_get_pci_hole_start, NULL, NULL, NULL); =20 object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_END, "uint32", + NULL, i440fx_pcihost_get_pci_hole_end, NULL, NULL, NULL); =20 object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE64_START, "uint= 64", + NULL, i440fx_pcihost_get_pci_hole64_start, NULL, NULL, NULL); =20 object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE64_END, "uint64= ", + NULL, i440fx_pcihost_get_pci_hole64_end, NULL, NULL, NULL); } diff --git a/hw/pci-host/pnv_phb3.c b/hw/pci-host/pnv_phb3.c index db061c134e..c45401d9dd 100644 --- a/hw/pci-host/pnv_phb3.c +++ b/hw/pci-host/pnv_phb3.c @@ -1164,12 +1164,12 @@ static void pnv_phb3_root_bus_class_init(ObjectClas= s *klass, const void *data) { BusClass *k =3D BUS_CLASS(klass); =20 - object_class_property_add(klass, "phb-id", "uint32", + object_class_property_add(klass, "phb-id", "uint32", NULL, pnv_phb3_root_bus_get_prop, pnv_phb3_root_bus_set_prop, NULL, NULL); =20 - object_class_property_add(klass, "chip-id", "uint32", + object_class_property_add(klass, "chip-id", "uint32", NULL, pnv_phb3_root_bus_get_prop, pnv_phb3_root_bus_set_prop, NULL, NULL); diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index ac09a0b034..6a5d1bb227 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -1775,12 +1775,12 @@ static void pnv_phb4_root_bus_class_init(ObjectClas= s *klass, const void *data) { BusClass *k =3D BUS_CLASS(klass); =20 - object_class_property_add(klass, "phb-id", "uint32", + object_class_property_add(klass, "phb-id", "uint32", NULL, pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop, NULL, NULL); =20 - object_class_property_add(klass, "chip-id", "uint32", + object_class_property_add(klass, "chip-id", "uint32", NULL, pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop, NULL, NULL); diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index f4556ad03a..027ae02066 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -226,19 +226,19 @@ static void q35_host_initfn(Object *obj) qdev_prop_set_uint64(DEVICE(s), PCI_HOST_PROP_PCI_HOLE64_SIZE, Q35_PCI_HOST_HOLE64_SIZE_DEFAULT); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32", + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32", NULL, q35_host_get_pci_hole_start, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32", + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32", NULL, q35_host_get_pci_hole_end, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64", + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64", NUL= L, q35_host_get_pci_hole64_start, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64", + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64", NULL, q35_host_get_pci_hole64_end, NULL, NULL, NULL); =20 diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index 0d659e9b02..b8c48bca8a 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -1069,7 +1069,7 @@ void spapr_caps_add_properties(SpaprMachineClass *smc) g_autofree char *name =3D g_strdup_printf("cap-%s", cap->name); g_autofree char *desc =3D g_strdup(cap->description); =20 - object_class_property_add(klass, name, cap->type, + object_class_property_add(klass, name, cap->type, NULL, cap->get, cap->set, NULL, cap); =20 diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 5c2150b71c..a33f0949d1 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -584,9 +584,9 @@ static void spapr_dr_connector_instance_init(Object *ob= j) SpaprDrcClass *drck =3D SPAPR_DR_CONNECTOR_GET_CLASS(drc); =20 object_property_add_uint32_ptr(obj, "id", &drc->id, OBJ_PROP_FLAG_READ= ); - object_property_add(obj, "index", "uint32", prop_get_index, + object_property_add(obj, "index", "uint32", NULL, prop_get_index, NULL, NULL, NULL); - object_property_add(obj, "fdt", "struct", prop_get_fdt, + object_property_add(obj, "fdt", "struct", NULL, prop_get_fdt, NULL, NULL, NULL); drc->state =3D drck->empty_state; } diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c index a0498d218f..c4b3cb0b7b 100644 --- a/hw/remote/vfio-user-obj.c +++ b/hw/remote/vfio-user-obj.c @@ -931,7 +931,7 @@ static void vfu_object_class_init(ObjectClass *klass, c= onst void *data) =20 k->nr_devs =3D 0; =20 - object_class_property_add(klass, "socket", "SocketAddress", NULL, + object_class_property_add(klass, "socket", "SocketAddress", NULL, NULL, vfu_object_set_socket, NULL, NULL); object_class_property_set_description(klass, "socket", "SocketAddress " diff --git a/hw/riscv/microchip_pfsoc.c b/hw/riscv/microchip_pfsoc.c index edd29626fa..04c48a4eda 100644 --- a/hw/riscv/microchip_pfsoc.c +++ b/hw/riscv/microchip_pfsoc.c @@ -744,6 +744,7 @@ static void microchip_icicle_kit_machine_class_init(Obj= ectClass *oc, mc->default_ram_size =3D 1537 * MiB; =20 object_class_property_add(oc, "clint-timebase-frequency", "uint32_t", + NULL, microchip_icicle_kit_get_clint_timebase_freq, microchip_icicle_kit_set_clint_timebase_freq, NULL, NULL); diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index de1c92463a..65f4c67bff 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -1184,13 +1184,13 @@ static void virt_machine_class_init(ObjectClass *oc= , const void *data) object_class_property_set_description(oc, "aia-guests", str); } =20 - object_class_property_add(oc, "acpi", "OnOffAuto", + object_class_property_add(oc, "acpi", "OnOffAuto", NULL, virt_get_acpi, virt_set_acpi, NULL, NULL); object_class_property_set_description(oc, "acpi", "Enable ACPI"); =20 - object_class_property_add(oc, "iommu-sys", "OnOffAuto", + object_class_property_add(oc, "iommu-sys", "OnOffAuto", NULL, virt_get_iommu_sys, virt_set_iommu_sys, NULL, NULL); object_class_property_set_description(oc, "iommu-sys", diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index fda5ecc9ad..7d4392d73f 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -908,7 +908,7 @@ static void ccw_machine_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, "dea-key-wrap", "enable/disable DEA key wrapping using the CPACF wrapping key"= ); =20 - object_class_property_add(oc, "loadparm", "loadparm", + object_class_property_add(oc, "loadparm", "loadparm", NULL, machine_get_loadparm, machine_set_loadparm, NULL, NULL); object_class_property_set_description(oc, "loadparm", @@ -916,7 +916,7 @@ static void ccw_machine_class_init(ObjectClass *oc, con= st void *data) " to upper case) to pass to machine loader, boot manager," " and guest kernel"); =20 - object_class_property_add(oc, "boot-certs", "BootCertificatesList", + object_class_property_add(oc, "boot-certs", "BootCertificatesList", NU= LL, machine_get_boot_certs, machine_set_boot_cer= ts, NULL, NULL); object_class_property_set_description(oc, "boot-certs", "provide paths to a directory and/or a certificate file for se= cure boot"); diff --git a/hw/s390x/sclpcpi.c b/hw/s390x/sclpcpi.c index ec4bdf2350..90cb36aad6 100644 --- a/hw/s390x/sclpcpi.c +++ b/hw/s390x/sclpcpi.c @@ -195,12 +195,14 @@ static void cpi_class_init(ObjectClass *klass, const = void *data) "name of the cluster which the VM belongs to, if any" " e.g. \"PLEX \""); =20 - object_class_property_add(klass, "system_level", "uint64", get_system_= level, + object_class_property_add(klass, "system_level", "uint64", NULL, + get_system_level, NULL, NULL, NULL); object_class_property_set_description(klass, "system_level", "distribution and kernel version in Linux e.g. 748723438054305= 28"); =20 - object_class_property_add(klass, "timestamp", "uint64", get_timestamp, + object_class_property_add(klass, "timestamp", "uint64", NULL, + get_timestamp, NULL, NULL, NULL); object_class_property_set_description(klass, "timestamp", "latest update of CPI data in nanoseconds since the UNIX EPOCH= "); diff --git a/hw/s390x/virtio-ccw-mem.c b/hw/s390x/virtio-ccw-mem.c index dea30aacfb..1dc19ca914 100644 --- a/hw/s390x/virtio-ccw-mem.c +++ b/hw/s390x/virtio-ccw-mem.c @@ -205,7 +205,7 @@ static void virtio_ccw_mem_instance_init(Object *obj) OBJECT(&dev->vdev), VIRTIO_MEM_BLOCK_SIZE_PR= OP); object_property_add_alias(obj, VIRTIO_MEM_SIZE_PROP, OBJECT(&dev->vdev= ), VIRTIO_MEM_SIZE_PROP); - object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", + object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", NULL, virtio_ccw_mem_get_requested_size, virtio_ccw_mem_set_requested_size, NULL, NULL); } diff --git a/hw/sensor/adc128d818.c b/hw/sensor/adc128d818.c index c65508cba1..14d79d3958 100644 --- a/hw/sensor/adc128d818.c +++ b/hw/sensor/adc128d818.c @@ -642,14 +642,16 @@ static void adc128d818_initfn(Object *obj) for (unsigned ch =3D 0u; ch < ADC128D818_NUM_CHANNELS; ch++) { char *name =3D g_strdup_printf("ain%u", ch); =20 - object_property_add(obj, name, "int", adc128d818_get_ain, + object_property_add(obj, name, "int", NULL, adc128d818_get_ain, adc128d818_set_ain, NULL, NULL); g_free(name); } =20 - object_property_add(obj, "temperature", "int", adc128d818_get_temperat= ure, + object_property_add(obj, "temperature", "int", NULL, + adc128d818_get_temperature, adc128d818_set_temperature, NULL, NULL); - object_property_add(obj, "ext-vref-mv", "int", adc128d818_get_ext_vref, + object_property_add(obj, "ext-vref-mv", "int", NULL, + adc128d818_get_ext_vref, adc128d818_set_ext_vref, NULL, NULL); } =20 diff --git a/hw/sensor/adm1266.c b/hw/sensor/adm1266.c index 37d1cffd57..7927845e32 100644 --- a/hw/sensor/adm1266.c +++ b/hw/sensor/adm1266.c @@ -217,7 +217,7 @@ static void adm1266_init(Object *obj) for (int i =3D 0; i < ADM1266_NUM_PAGES; i++) { pmbus_page_config(pmdev, i, flags); =20 - object_property_add(obj, "vout[*]", "uint16", + object_property_add(obj, "vout[*]", "uint16", NULL, adm1266_get, adm1266_set, NULL, &pmdev->pages[i].read_vout); } diff --git a/hw/sensor/adm1272.c b/hw/sensor/adm1272.c index 0aa2a86556..6a7ff02617 100644 --- a/hw/sensor/adm1272.c +++ b/hw/sensor/adm1272.c @@ -493,19 +493,19 @@ static void adm1272_init(Object *obj) =20 pmbus_page_config(pmdev, 0, flags); =20 - object_property_add(obj, "vin", "uint16", + object_property_add(obj, "vin", "uint16", NULL, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_vin); =20 - object_property_add(obj, "vout", "uint16", + object_property_add(obj, "vout", "uint16", NULL, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_vout); =20 - object_property_add(obj, "iout", "uint16", + object_property_add(obj, "iout", "uint16", NULL, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_iout); =20 - object_property_add(obj, "pin", "uint16", + object_property_add(obj, "pin", "uint16", NULL, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_pin); =20 diff --git a/hw/sensor/emc141x.c b/hw/sensor/emc141x.c index a51fc44395..128d721b7b 100644 --- a/hw/sensor/emc141x.c +++ b/hw/sensor/emc141x.c @@ -251,16 +251,16 @@ static void emc141x_reset(DeviceState *dev) =20 static void emc141x_initfn(Object *obj) { - object_property_add(obj, "temperature0", "int", + object_property_add(obj, "temperature0", "int", NULL, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature1", "int", + object_property_add(obj, "temperature1", "int", NULL, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature2", "int", + object_property_add(obj, "temperature2", "int", NULL, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature3", "int", + object_property_add(obj, "temperature3", "int", NULL, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); } diff --git a/hw/sensor/isl_pmbus_vr.c b/hw/sensor/isl_pmbus_vr.c index 0fad04def7..1af0f2af35 100644 --- a/hw/sensor/isl_pmbus_vr.c +++ b/hw/sensor/isl_pmbus_vr.c @@ -136,63 +136,63 @@ static void isl_pmbus_vr_add_props(Object *obj, uint6= 4_t *flags, uint8_t pages) PMBusDevice *pmdev =3D PMBUS_DEVICE(obj); for (int i =3D 0; i < pages; i++) { if (flags[i] & PB_HAS_VIN) { - object_property_add(obj, "vin[*]", "uint16", + object_property_add(obj, "vin[*]", "uint16", NULL, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_vin); } =20 if (flags[i] & PB_HAS_VOUT) { - object_property_add(obj, "vout[*]", "uint16", + object_property_add(obj, "vout[*]", "uint16", NULL, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_vout); } =20 if (flags[i] & PB_HAS_IIN) { - object_property_add(obj, "iin[*]", "uint16", + object_property_add(obj, "iin[*]", "uint16", NULL, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_iin); } =20 if (flags[i] & PB_HAS_IOUT) { - object_property_add(obj, "iout[*]", "uint16", + object_property_add(obj, "iout[*]", "uint16", NULL, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_iout); } =20 if (flags[i] & PB_HAS_PIN) { - object_property_add(obj, "pin[*]", "uint16", + object_property_add(obj, "pin[*]", "uint16", NULL, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_pin); } =20 if (flags[i] & PB_HAS_POUT) { - object_property_add(obj, "pout[*]", "uint16", + object_property_add(obj, "pout[*]", "uint16", NULL, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_pout); } =20 if (flags[i] & PB_HAS_TEMPERATURE) { - object_property_add(obj, "temp1[*]", "uint16", + object_property_add(obj, "temp1[*]", "uint16", NULL, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_temperature_1); } =20 if (flags[i] & PB_HAS_TEMP2) { - object_property_add(obj, "temp2[*]", "uint16", + object_property_add(obj, "temp2[*]", "uint16", NULL, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_temperature_2); } =20 if (flags[i] & PB_HAS_TEMP3) { - object_property_add(obj, "temp3[*]", "uint16", + object_property_add(obj, "temp3[*]", "uint16", NULL, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_temperature_3); diff --git a/hw/sensor/lsm303dlhc_mag.c b/hw/sensor/lsm303dlhc_mag.c index cd5773ae64..f362686b69 100644 --- a/hw/sensor/lsm303dlhc_mag.c +++ b/hw/sensor/lsm303dlhc_mag.c @@ -509,21 +509,21 @@ static void lsm303dlhc_mag_reset(DeviceState *dev) */ static void lsm303dlhc_mag_initfn(Object *obj) { - object_property_add(obj, "mag-x", "int", - lsm303dlhc_mag_get_x, - lsm303dlhc_mag_set_x, NULL, NULL); + object_property_add(obj, "mag-x", "int", NULL, + lsm303dlhc_mag_get_x, + lsm303dlhc_mag_set_x, NULL, NULL); =20 - object_property_add(obj, "mag-y", "int", - lsm303dlhc_mag_get_y, - lsm303dlhc_mag_set_y, NULL, NULL); + object_property_add(obj, "mag-y", "int", NULL, + lsm303dlhc_mag_get_y, + lsm303dlhc_mag_set_y, NULL, NULL); =20 - object_property_add(obj, "mag-z", "int", - lsm303dlhc_mag_get_z, - lsm303dlhc_mag_set_z, NULL, NULL); + object_property_add(obj, "mag-z", "int", NULL, + lsm303dlhc_mag_get_z, + lsm303dlhc_mag_set_z, NULL, NULL); =20 - object_property_add(obj, "temperature", "int", - lsm303dlhc_mag_get_temperature, - lsm303dlhc_mag_set_temperature, NULL, NULL); + object_property_add(obj, "temperature", "int", NULL, + lsm303dlhc_mag_get_temperature, + lsm303dlhc_mag_set_temperature, NULL, NULL); } =20 /* diff --git a/hw/sensor/max34451.c b/hw/sensor/max34451.c index 4d64434f3a..6c2f7311ff 100644 --- a/hw/sensor/max34451.c +++ b/hw/sensor/max34451.c @@ -727,7 +727,7 @@ static void max34451_init(Object *obj) =20 /* get and set the voltage in millivolts, max is 32767 mV */ for (int i =3D 0; i < MAX34451_NUM_PWR_DEVICES; i++) { - object_property_add(obj, "vout[*]", "uint16", + object_property_add(obj, "vout[*]", "uint16", NULL, max34451_get, max34451_set, NULL, &pmdev->pages[i].read_vout= ); } @@ -737,7 +737,7 @@ static void max34451_init(Object *obj) * centidegrees Celsius i.e.: 2500 -> 25.00 C, max is 327.67 C */ for (int i =3D 0; i < MAX34451_NUM_TEMP_DEVICES; i++) { - object_property_add(obj, "temperature[*]", "uint16", + object_property_add(obj, "temperature[*]", "uint16", NULL, max34451_get, max34451_set, NULL, diff --git a/hw/sensor/tmp105.c b/hw/sensor/tmp105.c index ece0650d70..98f45a49b7 100644 --- a/hw/sensor/tmp105.c +++ b/hw/sensor/tmp105.c @@ -408,7 +408,7 @@ static void tmp105_realize(DeviceState *dev, Error **er= rp) =20 static void tmp105_initfn(Object *obj) { - object_property_add(obj, "temperature", "int", + object_property_add(obj, "temperature", "int", NULL, tmp105_get_temperature, tmp105_set_temperature, NULL, NULL); object_property_set_description(obj, "temperature", diff --git a/hw/sensor/tmp421.c b/hw/sensor/tmp421.c index 127edd0ba5..8e6823dfcc 100644 --- a/hw/sensor/tmp421.c +++ b/hw/sensor/tmp421.c @@ -350,16 +350,16 @@ static void tmp421_class_init(ObjectClass *klass, con= st void *data) dc->vmsd =3D &vmstate_tmp421; sc->dev =3D (DeviceInfo *) data; =20 - object_class_property_add(klass, "temperature0", "int", + object_class_property_add(klass, "temperature0", "int", NULL, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature1", "int", + object_class_property_add(klass, "temperature1", "int", NULL, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature2", "int", + object_class_property_add(klass, "temperature2", "int", NULL, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature3", "int", + object_class_property_add(klass, "temperature3", "int", NULL, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); } diff --git a/hw/usb/dev-storage-classic.c b/hw/usb/dev-storage-classic.c index 977151c4a0..dfd568da5e 100644 --- a/hw/usb/dev-storage-classic.c +++ b/hw/usb/dev-storage-classic.c @@ -122,7 +122,7 @@ out: =20 static void usb_msd_instance_init(Object *obj) { - object_property_add(obj, "bootindex", "int32", + object_property_add(obj, "bootindex", "int32", NULL, usb_msd_get_bootindex, usb_msd_set_bootindex, NULL, NULL); object_property_set_int(obj, "bootindex", -1, NULL); diff --git a/hw/vfio-user/pci.c b/hw/vfio-user/pci.c index 983e1d4ad4..4c76a3fe5d 100644 --- a/hw/vfio-user/pci.c +++ b/hw/vfio-user/pci.c @@ -471,7 +471,7 @@ static void vfio_user_pci_class_init(ObjectClass *klass= , const void *data) device_class_set_legacy_reset(dc, vfio_user_pci_reset); device_class_set_props(dc, vfio_user_pci_properties); =20 - object_class_property_add(klass, "socket", "SocketAddress", NULL, + object_class_property_add(klass, "socket", "SocketAddress", NULL, NULL, vfio_user_pci_set_socket, NULL, NULL); object_class_property_set_description(klass, "socket", "SocketAddress (UNIX sockets onl= y)"); diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 07d519cf6d..995b1a41ef 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -1036,10 +1036,10 @@ static void virtio_balloon_instance_init(Object *ob= j) s->free_page_hint_cmd_id =3D VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN; s->free_page_hint_notify.notify =3D virtio_balloon_free_page_hint_noti= fy; =20 - object_property_add(obj, "guest-stats", "guest statistics", + object_property_add(obj, "guest-stats", "guest statistics", NULL, balloon_stats_get_all, NULL, NULL, NULL); =20 - object_property_add(obj, "guest-stats-polling-interval", "int", + object_property_add(obj, "guest-stats-polling-interval", "int", NULL, balloon_stats_get_poll_interval, balloon_stats_set_poll_interval, NULL, NULL); diff --git a/hw/virtio/virtio-mem-pci.c b/hw/virtio/virtio-mem-pci.c index f592eb1a78..6349337bf4 100644 --- a/hw/virtio/virtio-mem-pci.c +++ b/hw/virtio/virtio-mem-pci.c @@ -211,7 +211,7 @@ static void virtio_mem_pci_instance_init(Object *obj) OBJECT(&dev->vdev), VIRTIO_MEM_BLOCK_SIZE_PR= OP); object_property_add_alias(obj, VIRTIO_MEM_SIZE_PROP, OBJECT(&dev->vdev= ), VIRTIO_MEM_SIZE_PROP); - object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", + object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", NULL, virtio_mem_pci_get_requested_size, virtio_mem_pci_set_requested_size, NULL, NULL); } diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c index ee6a0c206a..c6befd6c54 100644 --- a/hw/virtio/virtio-mem.c +++ b/hw/virtio/virtio-mem.c @@ -1533,12 +1533,13 @@ static void virtio_mem_instance_init(Object *obj) =20 notifier_list_init(&vmem->size_change_notifiers); =20 - object_property_add(obj, VIRTIO_MEM_SIZE_PROP, "size", virtio_mem_get_= size, + object_property_add(obj, VIRTIO_MEM_SIZE_PROP, "size", NULL, + virtio_mem_get_size, NULL, NULL, NULL); - object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", + object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", NULL, virtio_mem_get_requested_size, virtio_mem_set_requested_size, NULL, NULL); - object_property_add(obj, VIRTIO_MEM_BLOCK_SIZE_PROP, "size", + object_property_add(obj, VIRTIO_MEM_BLOCK_SIZE_PROP, "size", NULL, virtio_mem_get_block_size, virtio_mem_set_block_si= ze, NULL, NULL); } diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c index cca37202ff..ddeabe30f2 100644 --- a/hw/xen/xen-pvh-common.c +++ b/hw/xen/xen-pvh-common.c @@ -413,7 +413,7 @@ void xen_pvh_class_setup_common_props(XenPVHMachineClas= s *xpc) =20 #define OC_MEMMAP_PROP_BASE(c, prop_name, name) \ do { \ - object_class_property_add(c, prop_name "-base", "uint64_t", \ + object_class_property_add(c, prop_name "-base", "uint64_t", NULL, \ xen_pvh_get_ ## name ## _base, \ xen_pvh_set_ ## name ## _base, NULL, NULL); \ object_class_property_set_description(oc, prop_name "-base", \ @@ -422,7 +422,7 @@ do { = \ =20 #define OC_MEMMAP_PROP_SIZE(c, prop_name, name) \ do { \ - object_class_property_add(c, prop_name "-size", "uint64_t", \ + object_class_property_add(c, prop_name "-size", "uint64_t", NULL, \ xen_pvh_get_ ## name ## _size, \ xen_pvh_set_ ## name ## _size, NULL, NULL); \ object_class_property_set_description(oc, prop_name "-size", \ @@ -458,7 +458,7 @@ do { = \ OC_MEMMAP_PROP(oc, "pci-mmio", pci_mmio); OC_MEMMAP_PROP(oc, "pci-mmio-high", pci_mmio_high); =20 - object_class_property_add(oc, "pci-intx-irq-base", "uint32_t", + object_class_property_add(oc, "pci-intx-irq-base", "uint32_t", NUL= L, xen_pvh_get_pci_intx_irq_base, xen_pvh_set_pci_intx_irq_base, NULL, NULL); @@ -468,7 +468,7 @@ do { = \ =20 #ifdef CONFIG_TPM if (xpc->has_tpm) { - object_class_property_add(oc, "tpm-base-addr", "uint64_t", + object_class_property_add(oc, "tpm-base-addr", "uint64_t", NULL, xen_pvh_get_tpm_base, xen_pvh_set_tpm_base, NULL, NULL); diff --git a/iothread.c b/iothread.c index 76eea6df38..7084d336a4 100644 --- a/iothread.c +++ b/iothread.c @@ -315,19 +315,19 @@ static void iothread_class_init(ObjectClass *klass, c= onst void *class_data) bc->init =3D iothread_init; bc->update_params =3D iothread_set_aio_context_params; =20 - object_class_property_add(klass, "poll-max-ns", "int64", + object_class_property_add(klass, "poll-max-ns", "int64", NULL, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_max_ns_info); - object_class_property_add(klass, "poll-grow", "int64", + object_class_property_add(klass, "poll-grow", "int64", NULL, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_grow_info); - object_class_property_add(klass, "poll-shrink", "int64", + object_class_property_add(klass, "poll-shrink", "int64", NULL, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_shrink_info); - object_class_property_add(klass, "poll-weight", "int64", + object_class_property_add(klass, "poll-weight", "int64", NULL, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_weight_info); diff --git a/net/colo-compare.c b/net/colo-compare.c index 5986fb1e88..7d4a2db522 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -1373,15 +1373,15 @@ static void colo_compare_init(Object *obj) object_property_add_str(obj, "notify_dev", compare_get_notify_dev, compare_set_notify_dev= ); =20 - object_property_add(obj, "compare_timeout", "uint64", + object_property_add(obj, "compare_timeout", "uint64", NULL, compare_get_timeout, compare_set_timeout, NULL, NULL); =20 - object_property_add(obj, "expired_scan_cycle", "uint32", + object_property_add(obj, "expired_scan_cycle", "uint32", NULL, compare_get_expired_scan_cycle, compare_set_expired_scan_cycle, NULL, NULL); =20 - object_property_add(obj, "max_queue_size", "uint32", + object_property_add(obj, "max_queue_size", "uint32", NULL, get_max_queue_size, set_max_queue_size, NULL, NULL); =20 diff --git a/net/dump.c b/net/dump.c index 0c39f09892..558115b9c9 100644 --- a/net/dump.c +++ b/net/dump.c @@ -238,7 +238,8 @@ static void filter_dump_class_init(ObjectClass *oc, con= st void *data) { NetFilterClass *nfc =3D NETFILTER_CLASS(oc); =20 - object_class_property_add(oc, "maxlen", "uint32", filter_dump_get_maxl= en, + object_class_property_add(oc, "maxlen", "uint32", NULL, + filter_dump_get_maxlen, filter_dump_set_maxlen, NULL, NULL); object_class_property_add_str(oc, "file", file_dump_get_filename, file_dump_set_filename); diff --git a/net/filter-buffer.c b/net/filter-buffer.c index 427da24097..f56b2cfaf0 100644 --- a/net/filter-buffer.c +++ b/net/filter-buffer.c @@ -182,7 +182,7 @@ static void filter_buffer_class_init(ObjectClass *oc, c= onst void *data) { NetFilterClass *nfc =3D NETFILTER_CLASS(oc); =20 - object_class_property_add(oc, "interval", "uint32", + object_class_property_add(oc, "interval", "uint32", NULL, filter_buffer_get_interval, filter_buffer_set_interval, NULL, NULL); =20 diff --git a/qom/object.c b/qom/object.c index bbaff619e6..aa039536f2 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1340,6 +1340,7 @@ void object_unref(void *objptr) =20 ObjectProperty * object_property_try_add(Object *obj, const char *name, const char *type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release, @@ -1357,8 +1358,8 @@ object_property_try_add(Object *obj, const char *name= , const char *type, for (i =3D 0; i < INT16_MAX; ++i) { char *full_name =3D g_strdup_printf("%s[%d]", name_no_array, i= ); =20 - ret =3D object_property_try_add(obj, full_name, type, get, set, - release, opaque, NULL); + ret =3D object_property_try_add(obj, full_name, type, qapi_typ= e, + get, set, release, opaque, NULL); g_free(full_name); if (ret) { break; @@ -1379,6 +1380,7 @@ object_property_try_add(Object *obj, const char *name= , const char *type, =20 prop->name =3D g_strdup(name); prop->type =3D g_strdup(type); + prop->qapi_type =3D qapi_type; =20 prop->get =3D get; prop->set =3D set; @@ -1393,19 +1395,21 @@ object_property_try_add(Object *obj, const char *na= me, const char *type, =20 ObjectProperty * object_property_add(Object *obj, const char *name, const char *type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release, void *opaque) { - return object_property_try_add(obj, name, type, get, set, release, - opaque, &error_abort); + return object_property_try_add(obj, name, type, qapi_type, + get, set, release, opaque, &error_abort= ); } =20 ObjectProperty * object_class_property_add(ObjectClass *klass, const char *name, const char *type, + const QAPITypeInfo *qapi_type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, ObjectPropertyRelease *release, @@ -1420,6 +1424,7 @@ object_class_property_add(ObjectClass *klass, =20 prop->name =3D g_strdup(name); prop->type =3D g_strdup(type); + prop->qapi_type =3D qapi_type; =20 prop->get =3D get; prop->set =3D set; @@ -1947,7 +1952,8 @@ object_property_try_add_child(Object *obj, const char= *name, =20 type =3D g_strdup_printf("child<%s>", object_get_typename(child)); =20 - op =3D object_property_try_add(obj, name, type, object_get_child_prope= rty, + op =3D object_property_try_add(obj, name, type, NULL, + object_get_child_property, NULL, object_finalize_child_property, child, errp); if (!op) { @@ -2141,7 +2147,7 @@ object_add_link_prop(Object *obj, const char *name, =20 full_type =3D g_strdup_printf("link<%s>", type); =20 - op =3D object_property_add(obj, name, full_type, + op =3D object_property_add(obj, name, full_type, NULL, object_get_link_property, check ? object_set_link_property : NULL, object_release_link_property, @@ -2178,7 +2184,7 @@ object_class_property_add_link(ObjectClass *oc, =20 full_type =3D g_strdup_printf("link<%s>", type); =20 - op =3D object_class_property_add(oc, name, full_type, + op =3D object_class_property_add(oc, name, full_type, NULL, object_get_link_property, check ? object_set_link_property : NULL, object_release_link_property, @@ -2438,7 +2444,7 @@ object_property_add_str(Object *obj, const char *name, prop->get =3D get; prop->set =3D set; =20 - return object_property_add(obj, name, "string", + return object_property_add(obj, name, "string", NULL, get ? property_get_str : NULL, set ? property_set_str : NULL, property_release_data, @@ -2456,7 +2462,7 @@ object_class_property_add_str(ObjectClass *klass, con= st char *name, prop->get =3D get; prop->set =3D set; =20 - return object_class_property_add(klass, name, "string", + return object_class_property_add(klass, name, "string", NULL, get ? property_get_str : NULL, set ? property_set_str : NULL, NULL, @@ -2508,7 +2514,7 @@ object_property_add_bool(Object *obj, const char *nam= e, prop->get =3D get; prop->set =3D set; =20 - return object_property_add(obj, name, "bool", + return object_property_add(obj, name, "bool", NULL, get ? property_get_bool : NULL, set ? property_set_bool : NULL, property_release_data, @@ -2525,7 +2531,7 @@ object_class_property_add_bool(ObjectClass *klass, co= nst char *name, prop->get =3D get; prop->set =3D set; =20 - return object_class_property_add(klass, name, "bool", + return object_class_property_add(klass, name, "bool", NULL, get ? property_get_bool : NULL, set ? property_set_bool : NULL, NULL, @@ -2573,7 +2579,7 @@ object_property_add_enum(Object *obj, const char *nam= e, prop->get =3D get; prop->set =3D set; =20 - return object_property_add(obj, name, typename, + return object_property_add(obj, name, typename, NULL, get ? property_get_enum : NULL, set ? property_set_enum : NULL, property_release_data, @@ -2593,7 +2599,7 @@ object_class_property_add_enum(ObjectClass *klass, co= nst char *name, prop->get =3D get; prop->set =3D set; =20 - return object_class_property_add(klass, name, typename, + return object_class_property_add(klass, name, typename, NULL, get ? property_get_enum : NULL, set ? property_set_enum : NULL, NULL, @@ -2651,7 +2657,7 @@ object_property_add_tm(Object *obj, const char *name, =20 prop->get =3D get; =20 - return object_property_add(obj, name, "struct tm", + return object_property_add(obj, name, "struct tm", NULL, get ? property_get_tm : NULL, NULL, property_release_data, prop); @@ -2665,7 +2671,7 @@ object_class_property_add_tm(ObjectClass *klass, cons= t char *name, =20 prop->get =3D get; =20 - return object_class_property_add(klass, name, "struct tm", + return object_class_property_add(klass, name, "struct tm", NULL, get ? property_get_tm : NULL, NULL, NULL, prop); } @@ -2804,7 +2810,7 @@ object_class_property_add_bool_ptr(ObjectClass *klass= , const char *name, setter =3D property_class_set_bool_ptr; } =20 - return object_class_property_add(klass, name, "bool", + return object_class_property_add(klass, name, "bool", NULL, getter, setter, NULL, (void *)offset); } =20 @@ -2824,7 +2830,7 @@ object_property_add_uint8_ptr(Object *obj, const char= *name, setter =3D property_set_uint8_ptr; } =20 - return object_property_add(obj, name, "uint8", + return object_property_add(obj, name, "uint8", NULL, getter, setter, NULL, (void *)v); } =20 @@ -2844,7 +2850,7 @@ object_class_property_add_uint8_ptr(ObjectClass *klas= s, const char *name, setter =3D property_class_set_uint8_ptr; } =20 - return object_class_property_add(klass, name, "uint8", + return object_class_property_add(klass, name, "uint8", NULL, getter, setter, NULL, (void *)offset); } =20 @@ -2865,7 +2871,7 @@ object_class_static_property_add_uint8_ptr(ObjectClas= s *klass, setter =3D property_set_uint8_ptr; } =20 - return object_class_property_add(klass, name, "uint8", + return object_class_property_add(klass, name, "uint8", NULL, getter, setter, NULL, (void *)v); } =20 @@ -2885,7 +2891,7 @@ object_property_add_uint16_ptr(Object *obj, const cha= r *name, setter =3D property_set_uint16_ptr; } =20 - return object_property_add(obj, name, "uint16", + return object_property_add(obj, name, "uint16", NULL, getter, setter, NULL, (void *)v); } =20 @@ -2905,7 +2911,7 @@ object_class_property_add_uint16_ptr(ObjectClass *kla= ss, const char *name, setter =3D property_class_set_uint16_ptr; } =20 - return object_class_property_add(klass, name, "uint16", + return object_class_property_add(klass, name, "uint16", NULL, getter, setter, NULL, (void *)offset); } =20 @@ -2926,7 +2932,7 @@ object_class_static_property_add_uint16_ptr(ObjectCla= ss *klass, setter =3D property_set_uint16_ptr; } =20 - return object_class_property_add(klass, name, "uint16", + return object_class_property_add(klass, name, "uint16", NULL, getter, setter, NULL, (void *)v); } =20 @@ -2946,7 +2952,7 @@ object_property_add_uint32_ptr(Object *obj, const cha= r *name, setter =3D property_set_uint32_ptr; } =20 - return object_property_add(obj, name, "uint32", + return object_property_add(obj, name, "uint32", NULL, getter, setter, NULL, (void *)v); } =20 @@ -2966,7 +2972,7 @@ object_class_property_add_uint32_ptr(ObjectClass *kla= ss, const char *name, setter =3D property_class_set_uint32_ptr; } =20 - return object_class_property_add(klass, name, "uint32", + return object_class_property_add(klass, name, "uint32", NULL, getter, setter, NULL, (void *)offset); } =20 @@ -2987,7 +2993,7 @@ object_class_static_property_add_uint32_ptr(ObjectCla= ss *klass, setter =3D property_set_uint32_ptr; } =20 - return object_class_property_add(klass, name, "uint32", + return object_class_property_add(klass, name, "uint32", NULL, getter, setter, NULL, (void *)v); } =20 @@ -3007,7 +3013,7 @@ object_property_add_uint64_ptr(Object *obj, const cha= r *name, setter =3D property_set_uint64_ptr; } =20 - return object_property_add(obj, name, "uint64", + return object_property_add(obj, name, "uint64", NULL, getter, setter, NULL, (void *)v); } =20 @@ -3027,7 +3033,7 @@ object_class_property_add_uint64_ptr(ObjectClass *kla= ss, const char *name, setter =3D property_class_set_uint64_ptr; } =20 - return object_class_property_add(klass, name, "uint64", + return object_class_property_add(klass, name, "uint64", NULL, getter, setter, NULL, (void *)offset); } =20 @@ -3048,7 +3054,7 @@ object_class_static_property_add_uint64_ptr(ObjectCla= ss *klass, setter =3D property_set_uint64_ptr; } =20 - return object_class_property_add(klass, name, "uint64", + return object_class_property_add(klass, name, "uint64", NULL, getter, setter, NULL, (void *)v); } =20 @@ -3165,7 +3171,7 @@ object_property_add_alias(Object *obj, const char *na= me, prop->target_name =3D g_strdup(target_name); prop->flags =3D 0; =20 - op =3D object_property_add(obj, name, prop_type, + op =3D object_property_add(obj, name, prop_type, NULL, property_get_alias, property_set_alias, property_release_alias, @@ -3210,7 +3216,7 @@ object_class_property_add_alias(ObjectClass *klass, c= onst char *name, prop->target_name =3D g_strdup(target_name); prop->flags =3D OBJ_PROP_ALIAS_CLASS; =20 - op =3D object_class_property_add(klass, name, prop_type, + op =3D object_class_property_add(klass, name, prop_type, NULL, property_get_alias, property_set_alias, property_release_alias, diff --git a/system/bootdevice.c b/system/bootdevice.c index 9538b08983..4fc6b4c8ed 100644 --- a/system/bootdevice.c +++ b/system/bootdevice.c @@ -336,7 +336,7 @@ void device_add_bootindex_property(Object *obj, int32_t= *bootindex, prop->suffix =3D suffix; prop->dev =3D dev; =20 - object_property_add(obj, name, "int32", + object_property_add(obj, name, "int32", NULL, device_get_bootindex, device_set_bootindex, property_release_bootindex, diff --git a/system/memory.c b/system/memory.c index f1910af8a0..ac296cb0d8 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1293,11 +1293,11 @@ static void memory_region_initfn(Object *obj) =20 object_property_add_uint64_ptr(OBJECT(mr), "addr", &mr->addr, OBJ_PROP_FLAG_READ); - object_property_add(OBJECT(mr), "priority", "int32", + object_property_add(OBJECT(mr), "priority", "int32", NULL, memory_region_get_priority, NULL, /* memory_region_set_priority */ NULL, NULL); - object_property_add(OBJECT(mr), "size", "uint64", + object_property_add(OBJECT(mr), "size", "uint64", NULL, memory_region_get_size, NULL, /* memory_region_set_size, */ NULL, NULL); diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index dcd0d698b3..9c869b4488 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -328,7 +328,7 @@ static void prop_bool_set_false(Object *obj, Visitor *v= , const char *name, =20 static void prop_add_stub_bool(Object *obj, const char *name) { - object_property_add(obj, name, "bool", prop_bool_get_false, + object_property_add(obj, name, "bool", NULL, prop_bool_get_false, prop_bool_set_false, NULL, NULL); } =20 @@ -518,13 +518,13 @@ void aarch64_add_sve_properties(Object *obj) for (vq =3D 1; vq <=3D ARM_MAX_VQ; ++vq) { char name[8]; snprintf(name, sizeof(name), "sve%d", vq * 128); - object_property_add(obj, name, "bool", cpu_arm_get_vq, + object_property_add(obj, name, "bool", NULL, cpu_arm_get_vq, cpu_arm_set_vq, NULL, &cpu->sve_vq); } =20 #ifdef CONFIG_USER_ONLY /* Mirror linux /proc/sys/abi/sve_default_vector_length. */ - object_property_add(obj, "sve-default-vector-length", "int32", + object_property_add(obj, "sve-default-vector-length", "int32", NULL, cpu_arm_get_default_vec_len, cpu_arm_set_default_vec_len, NULL, &cpu->sve_default_vq); @@ -543,13 +543,13 @@ void aarch64_add_sme_properties(Object *obj) for (vq =3D 1; vq <=3D ARM_MAX_VQ; vq <<=3D 1) { char name[8]; snprintf(name, sizeof(name), "sme%d", vq * 128); - object_property_add(obj, name, "bool", cpu_arm_get_vq, + object_property_add(obj, name, "bool", NULL, cpu_arm_get_vq, cpu_arm_set_vq, NULL, &cpu->sme_vq); } =20 #ifdef CONFIG_USER_ONLY /* Mirror linux /proc/sys/abi/sme_default_vector_length. */ - object_property_add(obj, "sme-default-vector-length", "int32", + object_property_add(obj, "sme-default-vector-length", "int32", NULL, cpu_arm_get_default_vec_len, cpu_arm_set_default_vec_len, NULL, &cpu->sme_default_vq); diff --git a/target/arm/kvm.c b/target/arm/kvm.c index de09d63d2e..8a698a9d20 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1820,7 +1820,7 @@ static void kvm_arch_set_eager_split_size(Object *obj= , Visitor *v, =20 void kvm_arch_accel_class_init(ObjectClass *oc) { - object_class_property_add(oc, "eager-split-size", "size", + object_class_property_add(oc, "eager-split-size", "size", NULL, kvm_arch_get_eager_split_size, kvm_arch_set_eager_split_size, NULL, NULL); =20 diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c index c92e331e73..79df821da8 100644 --- a/target/arm/tcg/cpu64.c +++ b/target/arm/tcg/cpu64.c @@ -1392,7 +1392,7 @@ void aarch64_max_v8_tcg_initfn(Object *obj) /* v8.2: FEAT_SVE */ cpu->sve_vq.supported =3D MAKE_64BIT_MASK(0, ARM_MAX_VQ); aarch64_add_sve_properties(OBJECT(cpu)); - object_property_add(OBJECT(cpu), "sve-max-vq", "uint32", + object_property_add(OBJECT(cpu), "sve-max-vq", "uint32", NULL, cpu_max_get_sve_max_vq, cpu_max_set_sve_max_vq, NULL, NULL); =20 @@ -1529,7 +1529,7 @@ void aarch64_max_v9_tcg_initfn(Object *obj) object_property_add_bool(obj, "x-rme", cpu_arm_get_rme, cpu_arm_set_rm= e); =20 /* v9.4: FEAT_RME_GPC2 */ - object_property_add(obj, "x-l0gptsz", "uint32", cpu_max_get_l0gptsz, + object_property_add(obj, "x-l0gptsz", "uint32", NULL, cpu_max_get_l0gp= tsz, cpu_max_set_l0gptsz, NULL, NULL); } =20 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index e65eca0459..4514de46ff 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -10484,7 +10484,7 @@ static void x86_cpu_register_bit_prop(X86CPUClass *= xcc, fp =3D g_new0(BitProperty, 1); fp->w =3D w; fp->mask =3D mask; - object_class_property_add(oc, prop_name, "bool", + object_class_property_add(oc, prop_name, "bool", NULL, x86_cpu_get_bit_prop, x86_cpu_set_bit_prop, NULL, fp); @@ -10569,10 +10569,11 @@ static void x86_cpu_initfn(Object *obj) =20 x86_cpu_init_default_topo(cpu); =20 - object_property_add(obj, "feature-words", "X86CPUFeatureWordInfo", + object_property_add(obj, "feature-words", "X86CPUFeatureWordInfo", NUL= L, x86_cpu_get_feature_words, NULL, NULL, (void *)env->features); object_property_add(obj, "filtered-features", "X86CPUFeatureWordInfo", + NULL, x86_cpu_get_feature_words, NULL, NULL, (void *)cpu->filtered_features); =20 @@ -11005,13 +11006,13 @@ static void x86_cpu_common_class_init(ObjectClass= *oc, const void *data) =20 dc->user_creatable =3D true; =20 - object_class_property_add(oc, "family", "uint64", + object_class_property_add(oc, "family", "uint64", NULL, x86_cpuid_version_get_family, x86_cpuid_version_set_family, NULL, NULL); - object_class_property_add(oc, "model", "uint64", + object_class_property_add(oc, "model", "uint64", NULL, x86_cpuid_version_get_model, x86_cpuid_version_set_model, NULL, NULL); - object_class_property_add(oc, "stepping", "uint64", + object_class_property_add(oc, "stepping", "uint64", NULL, x86_cpuid_version_get_stepping, x86_cpuid_version_set_stepping, NULL, NULL); object_class_property_add_str(oc, "vendor", @@ -11020,7 +11021,7 @@ static void x86_cpu_common_class_init(ObjectClass *= oc, const void *data) object_class_property_add_str(oc, "model-id", x86_cpuid_get_model_id, x86_cpuid_set_model_id); - object_class_property_add(oc, "tsc-frequency", "int", + object_class_property_add(oc, "tsc-frequency", "int", NULL, x86_cpuid_get_tsc_freq, x86_cpuid_set_tsc_freq, NULL, NULL); /* @@ -11029,17 +11030,18 @@ static void x86_cpu_common_class_init(ObjectClass= *oc, const void *data) * QMP command: they list the features that would have prevented the * CPU from running if the "enforce" flag was set. */ - object_class_property_add(oc, "unavailable-features", "strList", + object_class_property_add(oc, "unavailable-features", "strList", NULL, x86_cpu_get_unavailable_features, NULL, NULL, NULL); =20 - object_class_property_add(oc, "avx10-version", "uint8", + object_class_property_add(oc, "avx10-version", "uint8", NULL, x86_cpuid_get_avx10_version, x86_cpuid_set_avx10_version, NULL, NULL); =20 #if !defined(CONFIG_USER_ONLY) - object_class_property_add(oc, "crash-information", "GuestPanicInformat= ion", + object_class_property_add(oc, "crash-information", + "GuestPanicInformation", NULL, x86_cpu_get_crash_info_qom, NULL, NULL, NULL= ); #endif =20 diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 072da8b9f1..03b51d20cf 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -7105,7 +7105,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc) object_class_property_set_description(oc, "notify-vmexit", "Enable notify VM exit"); =20 - object_class_property_add(oc, "notify-window", "uint32", + object_class_property_add(oc, "notify-window", "uint32", NULL, kvm_arch_get_notify_window, kvm_arch_set_notify_window, NULL, NULL); @@ -7113,7 +7113,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc) "Clock cycles without an event w= indow " "after which a notification VM e= xit occurs"); =20 - object_class_property_add(oc, "xen-version", "uint32", + object_class_property_add(oc, "xen-version", "uint32", NULL, kvm_arch_get_xen_version, kvm_arch_set_xen_version, NULL, NULL); @@ -7122,14 +7122,14 @@ void kvm_arch_accel_class_init(ObjectClass *oc) "(in XENVER_version form " "e.g. 0x4000a for 4.10)"); =20 - object_class_property_add(oc, "xen-gnttab-max-frames", "uint16", + object_class_property_add(oc, "xen-gnttab-max-frames", "uint16", NULL, kvm_arch_get_xen_gnttab_max_frames, kvm_arch_set_xen_gnttab_max_frames, NULL, NULL); object_class_property_set_description(oc, "xen-gnttab-max-frames", "Maximum number of grant table f= rames"); =20 - object_class_property_add(oc, "xen-evtchn-max-pirq", "uint16", + object_class_property_add(oc, "xen-evtchn-max-pirq", "uint16", NULL, kvm_arch_get_xen_evtchn_max_pirq, kvm_arch_set_xen_evtchn_max_pirq, NULL, NULL); diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c index 8294dbde3a..f6707abd34 100644 --- a/target/i386/kvm/tdx.c +++ b/target/i386/kvm/tdx.c @@ -1586,7 +1586,7 @@ static void tdx_guest_init(Object *obj) tdx_guest_get_mrownerconfig, tdx_guest_set_mrownerconfig); =20 - object_property_add(obj, "quote-generation-socket", "SocketAddress", + object_property_add(obj, "quote-generation-socket", "SocketAddress", N= ULL, tdx_guest_get_qgs, tdx_guest_set_qgs, NULL, NULL); diff --git a/target/i386/sev.c b/target/i386/sev.c index 11072b00dc..74a7b719b5 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -3024,7 +3024,7 @@ sev_guest_class_init(ObjectClass *oc, const void *dat= a) sev_guest_set_session_file); object_class_property_set_description(oc, "session-file", "guest owners session parameters (encoded with base64)"); - object_class_property_add(oc, "legacy-vm-type", "OnOffAuto", + object_class_property_add(oc, "legacy-vm-type", "OnOffAuto", NULL, sev_guest_get_legacy_vm_type, sev_guest_set_legacy_vm_type, NULL, NULL); object_class_property_set_description(oc, "legacy-vm-type", @@ -3056,7 +3056,7 @@ sev_guest_instance_init(Object *obj) sev_guest->policy =3D DEFAULT_GUEST_POLICY; object_property_add_uint32_ptr(obj, "handle", &sev_guest->handle, OBJ_PROP_FLAG_READWRITE); - object_property_add(obj, "policy", "uint32", sev_guest_get_policy, + object_property_add(obj, "policy", "uint32", NULL, sev_guest_get_polic= y, sev_guest_set_policy, NULL, NULL); object_apply_compat_props(obj); =20 @@ -3334,7 +3334,7 @@ sev_snp_guest_class_init(ObjectClass *oc, const void = *data) x86_klass->adjust_cpuid_features =3D sev_snp_adjust_cpuid_features; x86_klass->kvm_type =3D sev_snp_kvm_type; =20 - object_class_property_add(oc, "policy", "uint64", + object_class_property_add(oc, "policy", "uint64", NULL, sev_snp_guest_get_policy, sev_snp_guest_set_policy, NULL, NULL); object_class_property_add_str(oc, "guest-visible-workarounds", @@ -3358,7 +3358,7 @@ sev_snp_guest_class_init(ObjectClass *oc, const void = *data) object_class_property_add_bool(oc, "secure-tsc", sev_snp_guest_get_secure_tsc, sev_snp_guest_set_secure_tsc); - object_class_property_add(oc, "tsc-frequency", "uint32", + object_class_property_add(oc, "tsc-frequency", "uint32", NULL, sev_snp_guest_get_tsc_frequency, sev_snp_guest_set_tsc_frequency, NULL, NULL); } diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 113f79afb9..778da68bf4 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -3010,19 +3010,19 @@ static void whpx_set_ssd(Object *obj, Visitor *v, =20 void whpx_arch_accel_class_init(ObjectClass *oc) { - object_class_property_add(oc, "ignore-unknown-msr", "OnOffAuto", - NULL, whpx_set_unknown_msr, - NULL, NULL); + object_class_property_add(oc, "ignore-unknown-msr", "OnOffAuto", NULL, + NULL, whpx_set_unknown_msr, + NULL, NULL); object_class_property_set_description(oc, "ignore-unknown-msr", "Configure unknown MSR behavior"); - object_class_property_add(oc, "intercept-msr-gp", "OnOffAuto", - NULL, whpx_set_intercept_msr_gp, - NULL, NULL); + object_class_property_add(oc, "intercept-msr-gp", "OnOffAuto", NULL, + NULL, whpx_set_intercept_msr_gp, + NULL, NULL); object_class_property_set_description(oc, "intercept-msr-gp", "Intercept #GP to log erroring MSR accesses."); - object_class_property_add(oc, "ssd", "OnOffAuto", - NULL, whpx_set_ssd, - NULL, NULL); + object_class_property_add(oc, "ssd", "OnOffAuto", NULL, + NULL, whpx_set_ssd, + NULL, NULL); object_class_property_set_description(oc, "ssd", "Separate security domain"); } diff --git a/target/ppc/compat.c b/target/ppc/compat.c index 55de3bd5d5..78f4b23122 100644 --- a/target/ppc/compat.c +++ b/target/ppc/compat.c @@ -335,7 +335,7 @@ void ppc_compat_add_property(Object *obj, const char *n= ame, gchar *names, *desc; int i; =20 - object_property_add(obj, name, "string", + object_property_add(obj, name, "string", NULL, ppc_compat_prop_get, ppc_compat_prop_set, NULL, compat_pvr); =20 diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 5a0529fbda..85b674217e 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1412,20 +1412,20 @@ void riscv_add_satp_mode_properties(Object *obj) { RISCVCPU *cpu =3D RISCV_CPU(obj); =20 - object_property_add(obj, "svbare", "bool", cpu_riscv_get_satp, + object_property_add(obj, "svbare", "bool", NULL, cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); =20 if (cpu->env.misa_mxl =3D=3D MXL_RV32) { - object_property_add(obj, "sv32", "bool", cpu_riscv_get_satp, + object_property_add(obj, "sv32", "bool", NULL, cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); } else { - object_property_add(obj, "sv39", "bool", cpu_riscv_get_satp, + object_property_add(obj, "sv39", "bool", NULL, cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv48", "bool", cpu_riscv_get_satp, + object_property_add(obj, "sv48", "bool", NULL, cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv57", "bool", cpu_riscv_get_satp, + object_property_add(obj, "sv57", "bool", NULL, cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv64", "bool", cpu_riscv_get_satp, + object_property_add(obj, "sv64", "bool", NULL, cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); } } diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c index 5a82a63b82..9bccd59809 100644 --- a/target/riscv/kvm/kvm-cpu.c +++ b/target/riscv/kvm/kvm-cpu.c @@ -541,7 +541,7 @@ static void riscv_cpu_add_kvm_unavail_prop(Object *obj,= const char *prop_name) * unknown to KVM and error out if the user attempts * to enable any of them. */ - object_property_add(obj, prop_name, "bool", + object_property_add(obj, prop_name, "bool", NULL, cpu_get_cfg_unavailable, cpu_set_cfg_unavailable, NULL, (void *)prop_name); @@ -561,7 +561,7 @@ static void kvm_riscv_add_cpu_user_properties(Object *c= pu_obj) misa_cfg->name =3D riscv_get_misa_ext_name(bit); misa_cfg->description =3D riscv_get_misa_ext_description(bit); =20 - object_property_add(cpu_obj, misa_cfg->name, "bool", + object_property_add(cpu_obj, misa_cfg->name, "bool", NULL, kvm_cpu_get_misa_ext_cfg, kvm_cpu_set_misa_ext_cfg, NULL, misa_cfg); @@ -577,7 +577,7 @@ static void kvm_riscv_add_cpu_user_properties(Object *c= pu_obj) for (i =3D 0; i < ARRAY_SIZE(kvm_multi_ext_cfgs); i++) { KVMCPUConfig *multi_cfg =3D &kvm_multi_ext_cfgs[i]; =20 - object_property_add(cpu_obj, multi_cfg->name, "bool", + object_property_add(cpu_obj, multi_cfg->name, "bool", NULL, kvm_cpu_get_multi_ext_cfg, kvm_cpu_set_multi_ext_cfg, NULL, multi_cfg); diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c index 2a7796c382..df73f45829 100644 --- a/target/riscv/tcg/tcg-cpu.c +++ b/target/riscv/tcg/tcg-cpu.c @@ -1478,7 +1478,7 @@ static void riscv_cpu_add_misa_properties(Object *cpu= _obj) continue; } =20 - object_property_add(cpu_obj, name, "bool", + object_property_add(cpu_obj, name, "bool", NULL, cpu_get_misa_ext_cfg, cpu_set_misa_ext_cfg, NULL, (void *)misa_cfg); @@ -1532,7 +1532,7 @@ static void riscv_cpu_add_profiles(Object *cpu_obj) for (int i =3D 0; riscv_profiles[i] !=3D NULL; i++) { RISCVCPUProfile *profile =3D riscv_profiles[i]; =20 - object_property_add(cpu_obj, profile->name, "bool", + object_property_add(cpu_obj, profile->name, "bool", NULL, cpu_get_profile, cpu_set_profile, NULL, (void *)profile); =20 @@ -1608,7 +1608,7 @@ static void riscv_cpu_add_user_properties(Object *obj) =20 for (edata =3D isa_edata_arr; edata && edata->name; edata++) { if (edata->prop_name) { - object_property_add(obj, edata->prop_name, "bool", + object_property_add(obj, edata->prop_name, "bool", NULL, cpu_get_multi_ext_cfg, cpu_set_multi_ext_cfg, NULL, (void *)&edata->ext_enable_offset); diff --git a/target/s390x/cpu-system.c b/target/s390x/cpu-system.c index 715ff3ca94..de2f1422e3 100644 --- a/target/s390x/cpu-system.c +++ b/target/s390x/cpu-system.c @@ -138,6 +138,7 @@ void s390_cpu_system_init(Object *obj) =20 cs->start_powered_off =3D true; object_property_add(obj, "crash-information", "GuestPanicInformation", + NULL, s390_cpu_get_crash_info_qom, NULL, NULL, NULL); cpu->env.tod_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_tod_timer, cpu); diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index c30ea2df17..0718df791f 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -792,13 +792,14 @@ void s390_cpu_model_class_register_props(ObjectClass = *oc) =20 for (feat =3D 0; feat < S390_FEAT_MAX; feat++) { const S390FeatDef *def =3D s390_feat_def(feat); - object_class_property_add(oc, def->name, "bool", get_feature, + object_class_property_add(oc, def->name, "bool", NULL, get_feature, set_feature, NULL, (void *) feat); object_class_property_set_description(oc, def->name, def->desc); } for (group =3D 0; group < S390_FEAT_GROUP_MAX; group++) { const S390FeatGroupDef *def =3D s390_feat_group_def(group); - object_class_property_add(oc, def->name, "bool", get_feature_group, + object_class_property_add(oc, def->name, "bool", NULL, + get_feature_group, set_feature_group, NULL, (void *) group); object_class_property_set_description(oc, def->name, def->desc); } diff --git a/tests/unit/test-qdev-global-props.c b/tests/unit/test-qdev-glo= bal-props.c index 8ea362cbb9..35fb5eca6f 100644 --- a/tests/unit/test-qdev-global-props.c +++ b/tests/unit/test-qdev-global-props.c @@ -171,9 +171,11 @@ static void prop2_accessor(Object *obj, Visitor *v, co= nst char *name, =20 static void dynamic_instance_init(Object *obj) { - object_property_add(obj, "prop1", "uint32", prop1_accessor, prop1_acce= ssor, + object_property_add(obj, "prop1", "uint32", NULL, prop1_accessor, + prop1_accessor, NULL, NULL); - object_property_add(obj, "prop2", "uint32", prop2_accessor, prop2_acce= ssor, + object_property_add(obj, "prop2", "uint32", NULL, prop2_accessor, + prop2_accessor, NULL, NULL); } =20 diff --git a/ui/console.c b/ui/console.c index b735717200..732b4afee0 100644 --- a/ui/console.c +++ b/ui/console.c @@ -535,7 +535,7 @@ qemu_graphic_console_class_init(ObjectClass *oc, const = void *data) offsetof(QemuGraphicConsole, device), object_property_allow_set_link, OBJ_PROP_LINK_STRONG); - object_class_property_add(oc, "head", "uint32", + object_class_property_add(oc, "head", "uint32", NULL, qemu_graphic_console_prop_get_head, NULL, NULL, NULL); =20 diff --git a/util/thread-context.c b/util/thread-context.c index 88d8f0a55a..4fe7a6c8f4 100644 --- a/util/thread-context.c +++ b/util/thread-context.c @@ -278,13 +278,13 @@ static void thread_context_class_init(ObjectClass *oc= , const void *data) UserCreatableClass *ucc =3D USER_CREATABLE_CLASS(oc); =20 ucc->complete =3D thread_context_instance_complete; - object_class_property_add(oc, "thread-id", "uint64", + object_class_property_add(oc, "thread-id", "uint64", NULL, thread_context_get_thread_id, NULL, NULL, NULL); - object_class_property_add(oc, "cpu-affinity", "[uint16]", + object_class_property_add(oc, "cpu-affinity", "[uint16]", NULL, thread_context_get_cpu_affinity, thread_context_set_cpu_affinity, NULL, NULL); - object_class_property_add(oc, "node-affinity", "[uint16]", NULL, + object_class_property_add(oc, "node-affinity", "[uint16]", NULL, NULL, thread_context_set_node_affinity, NULL, NULL= ); } =20 --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630605; cv=none; d=zohomail.com; s=zohoarc; b=l10x4NroAYrdEql91KoV4EIjLcceqTBUIbj/fUn9qKoy4lS2tAyMFtcj7M0A7bdxcCQB9cdrefbHNI/iTFiZCilaImGFpAYxgvBSIXRrCfwnaPpr7sePsjZdhYdhKevZv/ys+bJUcpmvBuzquPH1v5d2qarXU/HbgiBsZ5XSUiw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630605; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=F9+EUp73OhO4RG516qSsXEoPxYPw4EFR74aVYFRDqQ8=; b=ZYXZHLD+48FlJfmVzBKkgnjl5oxztZOObthO6DWTHcb5Z6dP0uy8m+NaoZYiFaIJIQdM/COzf78zUFmNM+w5qOcKeCqUXO48lnWJVqZ6nKn9N/bM22VtToqLtNjkxH2y7xAwOKnQcvRjj4iZl2Ruj7EKLwt+iUpdu0/QudvFZc8= 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 1793630605791813.1842046761927; Mon, 2 Nov 2026 06:43:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtE5-0003eZ-NH; Mon, 02 Nov 2026 09:41:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD9-0003Cp-6R for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD6-0008Rx-A2 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:34 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-256-3_r9TesYNCmXWeRfXYmNoA-1; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 406661955D88; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F409F1800347; Mon, 2 Nov 2026 14:40:26 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 741E421E68A5; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F9+EUp73OhO4RG516qSsXEoPxYPw4EFR74aVYFRDqQ8=; b=SZ3ZuCWxQ/BBySLjxavLxp73rIo3eNtLL6XP23CeBsKthQpIqJP2td6fnNkdq9U41xupA2 TUdog39Sh1YVxdcPeXrPqylGvx/LOrU662U30M7Y4/8WgNAniHkkyJ23HWAFHOxGqkk8al maJqER0s/ys/4plByhorj6XBIlROO+g= X-MC-Unique: 3_r9TesYNCmXWeRfXYmNoA-1 X-Mimecast-MFC-AGG-ID: 3_r9TesYNCmXWeRfXYmNoA_1793630427 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 32/74] qom/object: Move enum property code so it is together Date: Mon, 2 Nov 2026 15:39:36 +0100 Message-ID: <20261102144018.3212223-33-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630607762154100 Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-16-armbru@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau --- qom/object.c | 76 ++++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/qom/object.c b/qom/object.c index aa039536f2..75ae45abaf 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1770,44 +1770,6 @@ uint64_t object_property_get_uint(Object *obj, const= char *name, return retval; } =20 -typedef struct EnumProperty { - const QEnumLookup *lookup; - int (*get)(Object *, Error **); - void (*set)(Object *, int, Error **); -} EnumProperty; - -int object_property_get_enum(Object *obj, const char *name, - const char *typename, Error **errp) -{ - char *str; - int ret; - ObjectProperty *prop =3D object_property_find_err(obj, name, errp); - EnumProperty *enumprop; - - if (prop =3D=3D NULL) { - return -1; - } - - if (!g_str_equal(prop->type, typename)) { - error_setg(errp, "Property %s on %s is not '%s' enum type", - name, object_class_get_name( - object_get_class(obj)), typename); - return -1; - } - - enumprop =3D prop->opaque; - - str =3D object_property_get_str(obj, name, errp); - if (!str) { - return -1; - } - - ret =3D qapi_enum_parse(enumprop->lookup, str, -1, errp); - g_free(str); - - return ret; -} - bool object_property_parse(Object *obj, const char *name, const char *string, Error **errp) { @@ -2538,6 +2500,12 @@ object_class_property_add_bool(ObjectClass *klass, c= onst char *name, prop); } =20 +typedef struct EnumProperty { + const QEnumLookup *lookup; + int (*get)(Object *, Error **); + void (*set)(Object *, int, Error **); +} EnumProperty; + static void property_get_enum(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { @@ -2606,6 +2574,38 @@ object_class_property_add_enum(ObjectClass *klass, c= onst char *name, prop); } =20 +int object_property_get_enum(Object *obj, const char *name, + const char *typename, Error **errp) +{ + char *str; + int ret; + ObjectProperty *prop =3D object_property_find_err(obj, name, errp); + EnumProperty *enumprop; + + if (prop =3D=3D NULL) { + return -1; + } + + if (!g_str_equal(prop->type, typename)) { + error_setg(errp, "Property %s on %s is not '%s' enum type", + name, object_class_get_name( + object_get_class(obj)), typename); + return -1; + } + + enumprop =3D prop->opaque; + + str =3D object_property_get_str(obj, name, errp); + if (!str) { + return -1; + } + + ret =3D qapi_enum_parse(enumprop->lookup, str, -1, errp); + g_free(str); + + return ret; +} + typedef struct TMProperty { void (*get)(Object *, struct tm *, Error **); } TMProperty; --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793631235; cv=none; d=zohomail.com; s=zohoarc; b=Z+ZAU9Sk2qiXtUzuK0stlzBH6aXM5TTqIb0h29KKCXz3SKcciOaSiip8WU1nKH0ygs9iK7z9u73gtEASmXFeGwWLZtVHX32e46GWrdj0HLq4TVMJtcdZSQ3nRZoTzEKqRYSqWR4Lz6Kg5IZYxNs6LKYsQEMqSBqrBQErnrCXmUg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631235; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Ekzogjebcu0MHGiXMsAuqcgERutSzGBlg1IoxbaUVRo=; b=Q6XCVKcYG7UGVroabH4lR9aR3GR02clIYUdZ4a3oPTX0qVaTEuyr7k4LNRRY7+pm7uDb+37ByqEcTXtjxBmjhzyXndT7EzmpNpSoh6pRDKvmcwijTv2bk8PcGn4Im0TO+mWEm/WVn26oGQNFlOAdEJdU4bkBgXpwLSWRggFDw+E= 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 1793631235749705.2803962593729; Mon, 2 Nov 2026 06:53:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDf-0003Rf-Gs; Mon, 02 Nov 2026 09:41:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0003Ci-Od for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD5-0008RM-1w for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:34 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-294-oMgfOtXJOBiB5nYcGm6gBg-1; Mon, 02 Nov 2026 09:40:28 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DAA461953971; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 614751956049; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 7895F21E68A6; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ekzogjebcu0MHGiXMsAuqcgERutSzGBlg1IoxbaUVRo=; b=TYxcHA9rNODLmkCHyK7iNy69TlK7nWY+XEGgkUAMj/VqCO2SFjGisI01tzqXcIgPx+zkGR ztIDQ7dumbKLAMv9NAwa8Rz+KG/vesXTGoCA6qpZ2aEq1muVioAj40dmSrVTvs8BzMSktc wCJHRv5/C9S0tZLWjpj1X1iwBehMJdA= X-MC-Unique: oMgfOtXJOBiB5nYcGm6gBg-1 X-Mimecast-MFC-AGG-ID: oMgfOtXJOBiB5nYcGm6gBg_1793630428 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 33/74] qom: New object_property_add_enum() etc. parameter @qapi_type Date: Mon, 2 Nov 2026 15:39:37 +0100 Message-ID: <20261102144018.3212223-34-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793631237860154100 Callers may either pass a non-null @lookup, or a non-null @qapi_type. For now, all pass a non-null @lookup and a null @qapi_type. Callers updated with this Coccinelle script: @@ identifier fun =3D { object_property_add_enum, object_class_property_add_enum }; expression obj, name, type; @@ - fun(obj, name, type, + fun(obj, name, type, NULL, ...) Future patches will eliminate non-null @lookup and drop the parameter. Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-17-armbru@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau --- include/chardev/char.h | 2 +- include/qom/object.h | 4 ++++ authz/list.c | 3 +-- backends/hostmem.c | 8 ++++---- crypto/secret_common.c | 3 +-- crypto/tlscreds.c | 4 ++-- hw/i386/pc_piix.c | 3 ++- hw/microblaze/petalogix_s3adsp1800_mmu.c | 1 + monitor/qmp.c | 2 +- net/filter.c | 2 +- qom/object.c | 15 +++++++++++---- target/i386/kvm/kvm.c | 3 ++- tests/unit/check-qom-proplist.c | 3 +-- ui/dbus.c | 4 ++-- ui/input-linux.c | 2 +- 15 files changed, 35 insertions(+), 24 deletions(-) diff --git a/include/chardev/char.h b/include/chardev/char.h index 2616c19cc0..5283cc0d5d 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -356,7 +356,7 @@ static inline void chardev_vc_add_encoding_prop(ObjectC= lass *oc, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)) { - object_class_property_add_enum(oc, "encoding", "ChardevVCEncoding", + object_class_property_add_enum(oc, "encoding", "ChardevVCEncoding", NU= LL, &ChardevVCEncoding_lookup, get, set); } =20 diff --git a/include/qom/object.h b/include/qom/object.h index 77fc618b9d..25fc32e4ed 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1987,6 +1987,7 @@ ObjectProperty *object_class_property_add_bool(Object= Class *klass, * @obj: the object to add a property to * @name: the name of the property * @typename: the name of the enum data type + * @qapi_type: QAPI type info descriptor * @lookup: enum value namelookup table * @get: the getter or %NULL if the property is write-only. * @set: the setter or %NULL if the property is read-only @@ -1998,6 +1999,7 @@ ObjectProperty *object_class_property_add_bool(Object= Class *klass, */ ObjectProperty *object_property_add_enum(Object *obj, const char *name, const char *typename, + const QAPITypeInfo *qapi_type, const QEnumLookup *lookup, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)); @@ -2007,6 +2009,7 @@ ObjectProperty *object_property_add_enum(Object *obj,= const char *name, * @klass: the object class to add a property to * @name: the name of the property * @typename: the name of the enum data type + * @qapi_type: QAPI type info descriptor * @lookup: enum value namelookup table * @get: the getter or %NULL if the property is write-only. * @set: the setter or %NULL if the property is read-only @@ -2019,6 +2022,7 @@ ObjectProperty *object_property_add_enum(Object *obj,= const char *name, ObjectProperty *object_class_property_add_enum(ObjectClass *klass, const char *name, const char *typename, + const QAPITypeInfo *qapi_type, const QEnumLookup *lookup, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)); diff --git a/authz/list.c b/authz/list.c index 72aedc6ac4..40fbccd87e 100644 --- a/authz/list.c +++ b/authz/list.c @@ -120,8 +120,7 @@ qauthz_list_class_init(ObjectClass *oc, const void *dat= a) { QAuthZClass *authz =3D QAUTHZ_CLASS(oc); =20 - object_class_property_add_enum(oc, "policy", - "QAuthZListPolicy", + object_class_property_add_enum(oc, "policy", "QAuthZListPolicy", NULL, &QAuthZListPolicy_lookup, qauthz_list_prop_get_policy, qauthz_list_prop_set_policy); diff --git a/backends/hostmem.c b/backends/hostmem.c index 299a3b90fe..c5882f0b16 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -551,10 +551,10 @@ host_memory_backend_class_init(ObjectClass *oc, const= void *data) NULL, NULL); object_class_property_set_description(oc, "host-nodes", "Binds memory to the list of NUMA host nodes"); - object_class_property_add_enum(oc, "policy", "HostMemPolicy", - &HostMemPolicy_lookup, - host_memory_backend_get_policy, - host_memory_backend_set_policy); + object_class_property_add_enum(oc, "policy", "HostMemPolicy", NULL, + &HostMemPolicy_lookup, + host_memory_backend_get_policy, + host_memory_backend_set_policy); object_class_property_set_description(oc, "policy", "Set the NUMA policy"); object_class_property_add_bool(oc, "share", diff --git a/crypto/secret_common.c b/crypto/secret_common.c index a5ecb876ae..16df64b336 100644 --- a/crypto/secret_common.c +++ b/crypto/secret_common.c @@ -269,8 +269,7 @@ qcrypto_secret_class_init(ObjectClass *oc, const void *= data) =20 ucc->complete =3D qcrypto_secret_complete; =20 - object_class_property_add_enum(oc, "format", - "QCryptoSecretFormat", + object_class_property_add_enum(oc, "format", "QCryptoSecretFormat", NU= LL, &QCryptoSecretFormat_lookup, qcrypto_secret_prop_get_format, qcrypto_secret_prop_set_format); diff --git a/crypto/tlscreds.c b/crypto/tlscreds.c index fb09e295a6..db74d302cc 100644 --- a/crypto/tlscreds.c +++ b/crypto/tlscreds.c @@ -221,8 +221,8 @@ qcrypto_tls_creds_class_init(ObjectClass *oc, const voi= d *data) object_class_property_add_str(oc, "dir", qcrypto_tls_creds_prop_get_dir, qcrypto_tls_creds_prop_set_dir); - object_class_property_add_enum(oc, "endpoint", - "QCryptoTLSCredsEndpoint", + object_class_property_add_enum(oc, "endpoint", "QCryptoTLSCredsEndpoin= t", + NULL, &QCryptoTLSCredsEndpoint_lookup, qcrypto_tls_creds_prop_get_endpoint, qcrypto_tls_creds_prop_set_endpoint); diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 63c4667ea3..ae07e6c56c 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -413,7 +413,8 @@ static void pc_i440fx_machine_options(MachineClass *m) machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE); machine_class_allow_dynamic_sysbus_dev(m, TYPE_UEFI_VARS_X64); =20 - object_class_property_add_enum(oc, "x-south-bridge", "PCSouthBridgeOpt= ion", + object_class_property_add_enum(oc, "x-south-bridge", + "PCSouthBridgeOption", NULL, &PCSouthBridgeOption_lookup, pc_get_south_bridge, pc_set_south_bridge); diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petal= ogix_s3adsp1800_mmu.c index c5f6431900..8cf7cda7d9 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -175,6 +175,7 @@ static void petalogix_s3adsp1800_machine_class_init(Obj= ectClass *oc, mc->is_default =3D true; =20 prop =3D object_class_property_add_enum(oc, "endianness", "EndianMode", + NULL, &EndianMode_lookup, machine_get_endianness, machine_set_endianness); diff --git a/monitor/qmp.c b/monitor/qmp.c index eb44012643..8d7e49d1ce 100644 --- a/monitor/qmp.c +++ b/monitor/qmp.c @@ -134,7 +134,7 @@ static void monitor_qmp_class_init(ObjectClass *cls, co= nst void *data) monitor_qmp_get_pretty, monitor_qmp_set_pretty); object_class_property_add_enum(cls, "close-action", - "MonitorQMPCloseAction", + "MonitorQMPCloseAction", NULL, &MonitorQMPCloseAction_lookup, monitor_qmp_get_close_action, monitor_qmp_set_close_action); diff --git a/net/filter.c b/net/filter.c index 389f3b0bfe..5311622aca 100644 --- a/net/filter.c +++ b/net/filter.c @@ -342,7 +342,7 @@ static void netfilter_class_init(ObjectClass *oc, const= void *data) =20 object_class_property_add_str(oc, "netdev", netfilter_get_netdev_id, netfilter_set_n= etdev_id); - object_class_property_add_enum(oc, "queue", "NetFilterDirection", + object_class_property_add_enum(oc, "queue", "NetFilterDirection", NULL, &NetFilterDirection_lookup, netfilter_get_direction, netfilter_set_= direction); object_class_property_add_str(oc, "status", diff --git a/qom/object.c b/qom/object.c index 75ae45abaf..44f59fbbe4 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2501,6 +2501,7 @@ object_class_property_add_bool(ObjectClass *klass, co= nst char *name, } =20 typedef struct EnumProperty { + const QAPITypeInfo *qapi_type; /* non-null for QAPI enums */ const QEnumLookup *lookup; int (*get)(Object *, Error **); void (*set)(Object *, int, Error **); @@ -2537,17 +2538,20 @@ static void property_set_enum(Object *obj, Visitor = *v, const char *name, ObjectProperty * object_property_add_enum(Object *obj, const char *name, const char *typename, + const QAPITypeInfo *qapi_type, const QEnumLookup *lookup, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)) { EnumProperty *prop =3D g_malloc(sizeof(*prop)); =20 - prop->lookup =3D lookup; + assert(!qapi_type !=3D !lookup); + prop->qapi_type =3D qapi_type; + prop->lookup =3D lookup ?: qapi_type->lookup; prop->get =3D get; prop->set =3D set; =20 - return object_property_add(obj, name, typename, NULL, + return object_property_add(obj, name, typename, qapi_type, get ? property_get_enum : NULL, set ? property_set_enum : NULL, property_release_data, @@ -2557,17 +2561,20 @@ object_property_add_enum(Object *obj, const char *n= ame, ObjectProperty * object_class_property_add_enum(ObjectClass *klass, const char *name, const char *typename, + const QAPITypeInfo *qapi_type, const QEnumLookup *lookup, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)) { EnumProperty *prop =3D g_malloc(sizeof(*prop)); =20 - prop->lookup =3D lookup; + assert(!qapi_type !=3D !lookup); + prop->qapi_type =3D qapi_type; + prop->lookup =3D lookup ?: qapi_type->lookup; prop->get =3D get; prop->set =3D set; =20 - return object_class_property_add(klass, name, typename, NULL, + return object_class_property_add(klass, name, typename, qapi_type, get ? property_get_enum : NULL, set ? property_set_enum : NULL, NULL, diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 03b51d20cf..e6a9fae928 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -7099,6 +7099,7 @@ static void kvm_arch_set_honor_guest_pat(Object *obj,= int value, Error **errp) void kvm_arch_accel_class_init(ObjectClass *oc) { object_class_property_add_enum(oc, "notify-vmexit", "NotifyVMexitOptio= n", + NULL, &NotifyVmexitOption_lookup, kvm_arch_get_notify_vmexit, kvm_arch_set_notify_vmexit); @@ -7136,7 +7137,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc) object_class_property_set_description(oc, "xen-evtchn-max-pirq", "Maximum number of Xen PIRQs"); =20 - object_class_property_add_enum(oc, "honor-guest-pat", "OnOffAuto", + object_class_property_add_enum(oc, "honor-guest-pat", "OnOffAuto", NUL= L, &OnOffAuto_lookup, kvm_arch_get_honor_guest_pat, kvm_arch_set_honor_guest_pat); diff --git a/tests/unit/check-qom-proplist.c b/tests/unit/check-qom-proplis= t.c index 89de92b7d9..804d066f28 100644 --- a/tests/unit/check-qom-proplist.c +++ b/tests/unit/check-qom-proplist.c @@ -140,8 +140,7 @@ static void dummy_class_init(ObjectClass *cls, const vo= id *data) object_class_property_add_str(cls, "sv", dummy_get_sv, dummy_set_sv); - object_class_property_add_enum(cls, "av", - "DummyAnimal", + object_class_property_add_enum(cls, "av", "DummyAnimal", NULL, &dummy_animal_map, dummy_get_av, dummy_set_av); diff --git a/ui/dbus.c b/ui/dbus.c index 7be0f8e261..966c2c8b4e 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -508,8 +508,8 @@ dbus_display_class_init(ObjectClass *oc, const void *da= ta) object_class_property_add_bool(oc, "p2p", get_dbus_p2p, set_dbus_p2p); object_class_property_add_str(oc, "addr", get_dbus_addr, set_dbus_addr= ); object_class_property_add_str(oc, "audiodev", get_audiodev, set_audiod= ev); - object_class_property_add_enum(oc, "gl-mode", - "DisplayGLMode", &DisplayGLMode_lookup, + object_class_property_add_enum(oc, "gl-mode", "DisplayGLMode", NULL, + &DisplayGLMode_lookup, get_gl_mode, set_gl_mode); } =20 diff --git a/ui/input-linux.c b/ui/input-linux.c index f4eee1ffd7..ea4d76e75d 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -506,7 +506,7 @@ static void input_linux_class_init(ObjectClass *oc, con= st void *data) object_class_property_add_bool(oc, "repeat", input_linux_get_repeat, input_linux_set_repeat); - object_class_property_add_enum(oc, "grab-toggle", "GrabToggleKeys", + object_class_property_add_enum(oc, "grab-toggle", "GrabToggleKeys", NU= LL, &GrabToggleKeys_lookup, input_linux_get_grab_toggle, input_linux_set_grab_toggle); --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793631120; cv=none; d=zohomail.com; s=zohoarc; b=bj0Wx/hRWx4urg05GgcZ0y9rHnvysJoqbEFpVYY/yQOGkaZuO6Qs32S9LhFQs24SX4II07r+QyWhmAd/U/1JRQscGPx4ng0KJbh7dw4+UqnjWGalrFM5ocfOzILqiomIBarpTUVKTTZkFcKYgIKFz34XACFoUtCltaz5Km83Lco= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631120; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lw0nE7I7KA2Y6JlWkYECcvw4LJVZ0mNgEzQH9XYRedc=; b=TXXRADUjRieNWGut8EaZ+aIFZhrxGOs8HKg33BBZaYaZTZdQhq3NCZWQzY9hja/zFJAM6CFYv+By+PdV2sm1sly9cEuLwRiItP2p4dnOXTXEMDWGY4P2j7gWSRvA2YeOi6yRVHsUYeOwIQXDwun+2WewNQc/VxmtFUCG5LoiZJE= 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 1793631120759471.6113756024391; Mon, 2 Nov 2026 06:52:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDf-0003Ry-Qh; Mon, 02 Nov 2026 09:41:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDD-0003DU-G4 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0008TC-DA for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-470-JjV-VU9KOVmUth5CbhNoRA-1; Mon, 02 Nov 2026 09:40:29 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E3C1E1944F12; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 612581800444; Mon, 2 Nov 2026 14:40:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 7CDB521E68A7; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lw0nE7I7KA2Y6JlWkYECcvw4LJVZ0mNgEzQH9XYRedc=; b=KYv8Rc7v6sLbxOd6hcjyOXCdBX+p7WPhm4N2LL3iKfvbYbaRdCE6CSIuv7CnCkUUEZEpji lMFlMPQ7eB40mQWNV+u8Wgwgd+FBfQk8/F8SMy1hoSS7ogF8ebQ6QJDGG5vfrsp/mmy3d+ fSFr5lmZ02WkI9WRXIAg0H1do65CYqQ= X-MC-Unique: JjV-VU9KOVmUth5CbhNoRA-1 X-Mimecast-MFC-AGG-ID: JjV-VU9KOVmUth5CbhNoRA_1793630428 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 34/74] tests: update check-qom-proplist for QAPI-aware property registration Date: Mon, 2 Nov 2026 15:39:38 +0100 Message-ID: <20261102144018.3212223-35-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793631121759158500 From: Marc-Andr=C3=A9 Lureau Migrate the dummy object's string and enum properties from the legacy object_class_property_add_str/enum() helpers to the new QAPI-aware object_class_property_add_qapi/qapi_enum() registration. Add test cases verifying that the qapi_type metadata is correctly populated on properties registered through the new API, and that it remains NULL for properties using the old-style registration. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-18-armbru@redhat.com> --- tests/unit/check-qom-proplist.c | 87 ++++++++++++++++++++++++++++----- 1 file changed, 74 insertions(+), 13 deletions(-) diff --git a/tests/unit/check-qom-proplist.c b/tests/unit/check-qom-proplis= t.c index 804d066f28..246935d714 100644 --- a/tests/unit/check-qom-proplist.c +++ b/tests/unit/check-qom-proplist.c @@ -108,22 +108,21 @@ static int dummy_get_av(Object *obj, } =20 =20 -static void dummy_set_sv(Object *obj, - const char *value, - Error **errp) +static void dummy_set_sv(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DummyObject *dobj =3D DUMMY_OBJECT(obj); =20 - g_free(dobj->sv); - dobj->sv =3D g_strdup(value); + g_clear_pointer(&dobj->sv, g_free); + visit_type_str(v, name, &dobj->sv, errp); } =20 -static char *dummy_get_sv(Object *obj, - Error **errp) +static void dummy_get_sv(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DummyObject *dobj =3D DUMMY_OBJECT(obj); =20 - return g_strdup(dobj->sv); + visit_type_str(v, name, &dobj->sv, errp); } =20 =20 @@ -135,13 +134,25 @@ static void dummy_init(Object *obj) } =20 =20 +static const QAPITypeInfo dummy_animal_qapi_type_info =3D { + .name =3D "DummyAnimal", + .masked_name =3D "DummyAnimalSchema", + .lookup =3D &dummy_animal_map, +}; + +static const QAPITypeInfo dummy_str_qapi_type_info =3D { + .name =3D "str", + .masked_name =3D "StrSchema", +}; + static void dummy_class_init(ObjectClass *cls, const void *data) { - object_class_property_add_str(cls, "sv", - dummy_get_sv, - dummy_set_sv); - object_class_property_add_enum(cls, "av", "DummyAnimal", NULL, - &dummy_animal_map, + object_class_property_add(cls, "sv", "str", + &dummy_str_qapi_type_info, + dummy_get_sv, dummy_set_sv, + NULL, NULL); + object_class_property_add_enum(cls, "av", "DummyAnimal", + &dummy_animal_qapi_type_info, NULL, dummy_get_av, dummy_set_av); } @@ -702,6 +713,54 @@ static void test_qom_partial_path(void) object_unparent(cont1); } =20 +static void test_dummy_qapi_enum(void) +{ + ObjectProperty *prop; + Object *parent =3D object_get_objects_root(); + DummyObject *dobj =3D DUMMY_OBJECT( + object_new_with_props(TYPE_DUMMY, + parent, + "dummy0", + &error_abort, + "av", "platypus", + NULL)); + + g_assert(dobj->av =3D=3D DUMMY_PLATYPUS); + + prop =3D object_property_find(OBJECT(dobj), "av"); + g_assert(prop); + g_assert(prop->qapi_type =3D=3D &dummy_animal_qapi_type_info); + g_assert_cmpstr(prop->qapi_type->name, =3D=3D, "DummyAnimal"); + g_assert_cmpstr(prop->qapi_type->masked_name, =3D=3D, "DummyAnimalSche= ma"); + g_assert(prop->qapi_type->lookup =3D=3D &dummy_animal_map); + + object_unparent(OBJECT(dobj)); +} + +static void test_dummy_qapi_prop(void) +{ + ObjectProperty *prop; + Object *parent =3D object_get_objects_root(); + DummyObject *dobj =3D DUMMY_OBJECT( + object_new_with_props(TYPE_DUMMY, + parent, + "dummy0", + &error_abort, + "sv", "hello", + NULL)); + + g_assert_cmpstr(dobj->sv, =3D=3D, "hello"); + + prop =3D object_property_find(OBJECT(dobj), "sv"); + g_assert(prop); + g_assert(prop->qapi_type =3D=3D &dummy_str_qapi_type_info); + g_assert_cmpstr(prop->qapi_type->name, =3D=3D, "str"); + g_assert_cmpstr(prop->qapi_type->masked_name, =3D=3D, "StrSchema"); + g_assert(prop->qapi_type->lookup =3D=3D NULL); + + object_unparent(OBJECT(dobj)); +} + int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); @@ -726,6 +785,8 @@ int main(int argc, char **argv) g_test_add_func("/qom/proplist/iterator", test_dummy_iterator); g_test_add_func("/qom/proplist/class_iterator", test_dummy_class_itera= tor); g_test_add_func("/qom/proplist/delchild", test_dummy_delchild); + g_test_add_func("/qom/proplist/qapi_enum", test_dummy_qapi_enum); + g_test_add_func("/qom/proplist/qapi_prop", test_dummy_qapi_prop); g_test_add_func("/qom/resolve/partial", test_qom_partial_path); =20 return g_test_run(); --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793631035; cv=none; d=zohomail.com; s=zohoarc; b=fPDU6Kp7CLnc1biH0d9f7AAYvyhgbh7PSoMVoodWlmdHgU523zuCWIf1RqGBtyN+G6z+fkDKIf+3X6J2DnZ6ICqzNA5TFB9RXY81TILwkkiuT1libK4JIDkqIw2/Q2OXkhxP+X4lUYbcCfWWPdW1T7/lhxt8lfuqNDaIvanBOhM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631035; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jmnJXClqhh6yCg1Mzix8EM2w47bJ0LEVCgZpOPH/2K8=; b=COTttumOGfru67tahpmkC37uQNcMLK/n1JmosKV+rPlk6ugqCn4syDqQUOMWg2sWpqVc0nYugmfS4jfOSrWANNAK0NoXoLp+nNmtOZOJn43NjWgGPVtNScsBarIYHEHQ9tfDZawVvKijP33JDDJyHlNOfy1EW8D84Fxzc2HtEpc= 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 1793631035655189.56451354465423; Mon, 2 Nov 2026 06:50:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtF6-0005ij-UA; Mon, 02 Nov 2026 09:42:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDH-0003GB-US for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD9-0008UU-JX for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:43 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-222-_yBQDj--OViV6DCvyCrFpA-1; Mon, 02 Nov 2026 09:40:31 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 23A091954208; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9CB4330000E3; Mon, 2 Nov 2026 14:40:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 815DC21E68A8; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jmnJXClqhh6yCg1Mzix8EM2w47bJ0LEVCgZpOPH/2K8=; b=AhjuNU3xPzLRCzecQIOlicsn4IaU9ceP+n/W/to1MTeYT5uFwx0prXYpHDAoZi34dDVJVS LgCydYAu8kyBBSx/3VdNAuwi74HA64V+/Nlwai3VqRMMcZgrpjr0pb7qnb57ANFK1oRGaZ yVEPcDrHwbY1ooMfEnt4QoZ/+rT2Yx0= X-MC-Unique: _yBQDj--OViV6DCvyCrFpA-1 X-Mimecast-MFC-AGG-ID: _yBQDj--OViV6DCvyCrFpA_1793630430 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 35/74] qom: convert QAPI enum properties to QAPI-aware registration Date: Mon, 2 Nov 2026 15:39:39 +0100 Message-ID: <20261102144018.3212223-36-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793631038583154100 From: Marc-Andr=C3=A9 Lureau Convert all callers of object_class_property_add_enum() but one to pass QAPITypeInfo instead of QEnumLookup. This enables QMP QOM introspection to report accurate QAPI type names for enum properties in member @qapi-type. Leave pc_i440fx_machine_options() for later, because enum PCSouthBridgeOption is a handmade QAPI-like enum instead of a real one. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-19-armbru@redhat.com> --- include/chardev/char.h | 6 ++++-- authz/list.c | 6 ++++-- backends/hostmem.c | 5 +++-- crypto/secret_common.c | 5 +++-- crypto/tlscreds.c | 4 ++-- hw/microblaze/petalogix_s3adsp1800_mmu.c | 4 ++-- monitor/qmp.c | 5 +++-- net/filter.c | 5 +++-- target/i386/kvm/kvm.c | 9 +++++---- ui/console-vc.c | 1 + ui/dbus.c | 6 ++++-- ui/input-linux.c | 5 +++-- 12 files changed, 37 insertions(+), 24 deletions(-) diff --git a/include/chardev/char.h b/include/chardev/char.h index 5283cc0d5d..61e6957118 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -1,6 +1,7 @@ #ifndef QEMU_CHAR_H #define QEMU_CHAR_H =20 +#include "qapi/qapi-type-infos-char.h" #include "qapi/qapi-types-char.h" #include "qemu/bitmap.h" #include "qemu/thread.h" @@ -356,8 +357,9 @@ static inline void chardev_vc_add_encoding_prop(ObjectC= lass *oc, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)) { - object_class_property_add_enum(oc, "encoding", "ChardevVCEncoding", NU= LL, - &ChardevVCEncoding_lookup, get, set); + object_class_property_add_enum(oc, "encoding", "ChardevVCEncoding", + &ChardevVCEncoding_type_info, NULL, + get, set); } =20 #endif diff --git a/authz/list.c b/authz/list.c index 40fbccd87e..767e91b3aa 100644 --- a/authz/list.c +++ b/authz/list.c @@ -22,6 +22,7 @@ #include "authz/list.h" #include "trace.h" #include "qom/object_interfaces.h" +#include "qapi/qapi-type-infos-authz.h" #include "qapi/qapi-visit-authz.h" #include "qemu/module.h" =20 @@ -120,8 +121,9 @@ qauthz_list_class_init(ObjectClass *oc, const void *dat= a) { QAuthZClass *authz =3D QAUTHZ_CLASS(oc); =20 - object_class_property_add_enum(oc, "policy", "QAuthZListPolicy", NULL, - &QAuthZListPolicy_lookup, + object_class_property_add_enum(oc, "policy", "QAuthZListPolicy", + &QAuthZListPolicy_type_info, + NULL, qauthz_list_prop_get_policy, qauthz_list_prop_set_policy); =20 diff --git a/backends/hostmem.c b/backends/hostmem.c index c5882f0b16..b43d6ca956 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -16,6 +16,7 @@ #include "hw/core/boards.h" #include "qapi/error.h" #include "qapi/qapi-builtin-visit.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/visitor.h" #include "qemu/config-file.h" #include "qom/compat-properties.h" @@ -551,8 +552,8 @@ host_memory_backend_class_init(ObjectClass *oc, const v= oid *data) NULL, NULL); object_class_property_set_description(oc, "host-nodes", "Binds memory to the list of NUMA host nodes"); - object_class_property_add_enum(oc, "policy", "HostMemPolicy", NULL, - &HostMemPolicy_lookup, + object_class_property_add_enum(oc, "policy", "HostMemPolicy", + &HostMemPolicy_type_info, NULL, host_memory_backend_get_policy, host_memory_backend_set_policy); object_class_property_set_description(oc, "policy", diff --git a/crypto/secret_common.c b/crypto/secret_common.c index 16df64b336..8e05f1365e 100644 --- a/crypto/secret_common.c +++ b/crypto/secret_common.c @@ -22,6 +22,7 @@ #include "crypto/secret_common.h" #include "crypto/cipher.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-crypto.h" #include "qom/object_interfaces.h" #include "qemu/base64.h" #include "qemu/module.h" @@ -269,8 +270,8 @@ qcrypto_secret_class_init(ObjectClass *oc, const void *= data) =20 ucc->complete =3D qcrypto_secret_complete; =20 - object_class_property_add_enum(oc, "format", "QCryptoSecretFormat", NU= LL, - &QCryptoSecretFormat_lookup, + object_class_property_add_enum(oc, "format", "QCryptoSecretFormat", + &QCryptoSecretFormat_type_info, NULL, qcrypto_secret_prop_get_format, qcrypto_secret_prop_set_format); object_class_property_add_str(oc, "keyid", diff --git a/crypto/tlscreds.c b/crypto/tlscreds.c index db74d302cc..021e4bf111 100644 --- a/crypto/tlscreds.c +++ b/crypto/tlscreds.c @@ -20,6 +20,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-crypto.h" #include "qapi-types-crypto.h" #include "qemu/module.h" #include "qemu/error-report.h" @@ -222,8 +223,7 @@ qcrypto_tls_creds_class_init(ObjectClass *oc, const voi= d *data) qcrypto_tls_creds_prop_get_dir, qcrypto_tls_creds_prop_set_dir); object_class_property_add_enum(oc, "endpoint", "QCryptoTLSCredsEndpoin= t", - NULL, - &QCryptoTLSCredsEndpoint_lookup, + &QCryptoTLSCredsEndpoint_type_info, NUL= L, qcrypto_tls_creds_prop_get_endpoint, qcrypto_tls_creds_prop_set_endpoint); object_class_property_add_str(oc, "priority", diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petal= ogix_s3adsp1800_mmu.c index 8cf7cda7d9..b52f12924d 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -27,6 +27,7 @@ #include "qemu/target-info.h" #include "qemu/units.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "target/microblaze/cpu.h" #include "hw/core/sysbus.h" #include "net/net.h" @@ -175,8 +176,7 @@ static void petalogix_s3adsp1800_machine_class_init(Obj= ectClass *oc, mc->is_default =3D true; =20 prop =3D object_class_property_add_enum(oc, "endianness", "EndianMode", - NULL, - &EndianMode_lookup, + &EndianMode_type_info, NULL, machine_get_endianness, machine_set_endianness); object_property_set_default_str(prop, target_big_endian() ? "big" diff --git a/monitor/qmp.c b/monitor/qmp.c index 8d7e49d1ce..c6341f1a20 100644 --- a/monitor/qmp.c +++ b/monitor/qmp.c @@ -30,6 +30,7 @@ #include "qapi/error.h" #include "qapi/qapi-commands-control.h" #include "qapi/qapi-commands-char.h" +#include "qapi/qapi-type-infos-qom.h" #include "qobject/qdict.h" #include "qobject/qjson.h" #include "qobject/qlist.h" @@ -134,8 +135,8 @@ static void monitor_qmp_class_init(ObjectClass *cls, co= nst void *data) monitor_qmp_get_pretty, monitor_qmp_set_pretty); object_class_property_add_enum(cls, "close-action", - "MonitorQMPCloseAction", NULL, - &MonitorQMPCloseAction_lookup, + "MonitorQMPCloseAction", + &MonitorQMPCloseAction_type_info, NULL, monitor_qmp_get_close_action, monitor_qmp_set_close_action); =20 diff --git a/net/filter.c b/net/filter.c index 5311622aca..9013d872ea 100644 --- a/net/filter.c +++ b/net/filter.c @@ -8,6 +8,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qmp/qerror.h" #include "qemu/error-report.h" =20 @@ -342,8 +343,8 @@ static void netfilter_class_init(ObjectClass *oc, const= void *data) =20 object_class_property_add_str(oc, "netdev", netfilter_get_netdev_id, netfilter_set_n= etdev_id); - object_class_property_add_enum(oc, "queue", "NetFilterDirection", NULL, - &NetFilterDirection_lookup, + object_class_property_add_enum(oc, "queue", "NetFilterDirection", + &NetFilterDirection_type_info, NULL, netfilter_get_direction, netfilter_set_= direction); object_class_property_add_str(oc, "status", netfilter_get_status, netfilter_set_stat= us); diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index e6a9fae928..b52831779f 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 @@ -7099,8 +7101,7 @@ static void kvm_arch_set_honor_guest_pat(Object *obj,= int value, Error **errp) void kvm_arch_accel_class_init(ObjectClass *oc) { object_class_property_add_enum(oc, "notify-vmexit", "NotifyVMexitOptio= n", - NULL, - &NotifyVmexitOption_lookup, + &NotifyVmexitOption_type_info, NULL, kvm_arch_get_notify_vmexit, kvm_arch_set_notify_vmexit); object_class_property_set_description(oc, "notify-vmexit", @@ -7137,8 +7138,8 @@ void kvm_arch_accel_class_init(ObjectClass *oc) object_class_property_set_description(oc, "xen-evtchn-max-pirq", "Maximum number of Xen PIRQs"); =20 - object_class_property_add_enum(oc, "honor-guest-pat", "OnOffAuto", NUL= L, - &OnOffAuto_lookup, + object_class_property_add_enum(oc, "honor-guest-pat", "OnOffAuto", + &OnOffAuto_type_info, NULL, kvm_arch_get_honor_guest_pat, kvm_arch_set_honor_guest_pat); object_class_property_set_description(oc, "honor-guest-pat", diff --git a/ui/console-vc.c b/ui/console-vc.c index 99cc8f09c8..ac8c6bf101 100644 --- a/ui/console-vc.c +++ b/ui/console-vc.c @@ -6,6 +6,7 @@ =20 #include "chardev/char.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-char.h" #include "qemu/option.h" #include "qemu/queue.h" #include "qom/compat-properties.h" diff --git a/ui/dbus.c b/ui/dbus.c index 966c2c8b4e..9c21204771 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -38,6 +38,8 @@ #include "qemu/audio.h" #include "audio/audio_int.h" /* FIXME: use QOM dynamic cast instead of drv= ->name */ #include "qapi/error.h" +#include "qapi/qapi-type-infos-char.h" +#include "qapi/qapi-type-infos-ui.h" #include "trace.h" =20 #include "dbus.h" @@ -508,8 +510,8 @@ dbus_display_class_init(ObjectClass *oc, const void *da= ta) object_class_property_add_bool(oc, "p2p", get_dbus_p2p, set_dbus_p2p); object_class_property_add_str(oc, "addr", get_dbus_addr, set_dbus_addr= ); object_class_property_add_str(oc, "audiodev", get_audiodev, set_audiod= ev); - object_class_property_add_enum(oc, "gl-mode", "DisplayGLMode", NULL, - &DisplayGLMode_lookup, + object_class_property_add_enum(oc, "gl-mode", "DisplayGLMode", + &DisplayGLMode_type_info, NULL, get_gl_mode, set_gl_mode); } =20 diff --git a/ui/input-linux.c b/ui/input-linux.c index ea4d76e75d..127be74450 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -6,6 +6,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "qemu/config-file.h" #include "qemu/main-loop.h" #include "qemu/module.h" @@ -506,8 +507,8 @@ static void input_linux_class_init(ObjectClass *oc, con= st void *data) object_class_property_add_bool(oc, "repeat", input_linux_get_repeat, input_linux_set_repeat); - object_class_property_add_enum(oc, "grab-toggle", "GrabToggleKeys", NU= LL, - &GrabToggleKeys_lookup, + object_class_property_add_enum(oc, "grab-toggle", "GrabToggleKeys", + &GrabToggleKeys_type_info, NULL, input_linux_get_grab_toggle, input_linux_set_grab_toggle); } --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793631090; cv=none; d=zohomail.com; s=zohoarc; b=avw3p2tYw9LnGLGlDjM92dD+cfPwWPmNfFmc3UVggIW71fmo1OBl2V9wLRdHWjED4lJed5ow0B6tKqWg+qlhS+FOu4JOVZHiPng9eEur1ylGx/kS14SjeDZLmvZb9SrCueEXDB15hGHmw7MHzQIlpL9k1+jYP/efhg9R/vEXLfc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631090; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PWM8PrpHmU6nLEOgtkPdmeVQrzoEpi8sQJg+9hKNPEs=; b=fpkmIXH045x0RU4INeBIc7jEp1RWgT8EfO8svTMGcFmKQXlmDSaL9sAWEleGBvBdryW0YRBBHUbgiP2t8xem48e6J7Lmv57X53kLMh+I6cQS7DTDGIcA7ENVJk5DmH4p18QG/3VcROnZJ1ADKEmoAWS5W3scf+iCWm1GTY22fNA= 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 1793631090625941.4032179260092; Mon, 2 Nov 2026 06:51:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtF3-0005ZG-LH; Mon, 02 Nov 2026 09:42:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDH-0003G2-Pe for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD9-0008Tr-6b for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:42 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-351-fm5K2MenN2mCUekUXyHEjQ-1; Mon, 02 Nov 2026 09:40:31 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 27D0B1802569; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A15B1300019F; Mon, 2 Nov 2026 14:40:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 85BBE21E681F; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PWM8PrpHmU6nLEOgtkPdmeVQrzoEpi8sQJg+9hKNPEs=; b=i+ZIWFAEyODh8QrqEYPOROFiVNOTpCg8Yq2sA/1iGEZq9xmOrV3J9jD5PiBpV3oWIVR2U8 vkXZ/SCLDcwAFrREVddr/NYy7xzB2xIh43VCuQPqCNdSjkcWlsF4Zfnht8vZOgjVpHBj8+ i99qk4JldI3Obxci1WfPZAMYj39PKE0= X-MC-Unique: fm5K2MenN2mCUekUXyHEjQ-1 X-Mimecast-MFC-AGG-ID: fm5K2MenN2mCUekUXyHEjQ_1793630430 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 36/74] qom: convert struct properties to QAPI-aware registration Date: Mon, 2 Nov 2026 15:39:40 +0100 Message-ID: <20261102144018.3212223-37-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793631091270158500 From: Marc-Andr=C3=A9 Lureau Convert all callers of object_property_add() and object_class_property_add() that register struct-typed properties with QAPI visitor-based getters/setters to pass QAPITypeInfo. This enables QMP QOM introspection to report accurate QAPI type information for struct properties in member @qapi-type. Existing getters/setters are preserved unchanged. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-20-armbru@redhat.com> --- authz/list.c | 3 ++- block/throttle-groups.c | 4 +++- chardev/char-socket.c | 4 +++- hw/core/machine.c | 12 ++++++++---- hw/cxl/cxl-host.c | 4 +++- hw/remote/vfio-user-obj.c | 6 ++++-- hw/vfio-user/pci.c | 4 +++- target/i386/cpu.c | 10 +++++++--- target/i386/kvm/tdx.c | 10 ++++++---- target/s390x/cpu-system.c | 3 ++- 10 files changed, 41 insertions(+), 19 deletions(-) diff --git a/authz/list.c b/authz/list.c index 767e91b3aa..75155cf077 100644 --- a/authz/list.c +++ b/authz/list.c @@ -127,7 +127,8 @@ qauthz_list_class_init(ObjectClass *oc, const void *dat= a) qauthz_list_prop_get_policy, qauthz_list_prop_set_policy); =20 - object_class_property_add(oc, "rules", "QAuthZListRule", NULL, + object_class_property_add(oc, "rules", "QAuthZListRule", + &QAuthZListRuleList_type_info, qauthz_list_prop_get_rules, qauthz_list_prop_set_rules, NULL, NULL); diff --git a/block/throttle-groups.c b/block/throttle-groups.c index cfe2ea67e3..5d6b089092 100644 --- a/block/throttle-groups.c +++ b/block/throttle-groups.c @@ -31,6 +31,7 @@ #include "qemu/thread.h" #include "system/qtest.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-block-core.h" #include "qapi/qapi-visit-block-core.h" #include "qom/object.h" #include "qom/object_interfaces.h" @@ -991,7 +992,8 @@ static void throttle_group_obj_class_init(ObjectClass *= klass, } =20 /* ThrottleLimits */ - object_class_property_add(klass, "limits", "ThrottleLimits", NULL, + object_class_property_add(klass, "limits", "ThrottleLimits", + &ThrottleLimits_type_info, throttle_group_get_limits, throttle_group_set_limits, NULL, NULL); diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 6ce9c2a50b..d62a057e8c 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -31,6 +31,7 @@ #include "qemu/option.h" #include "qapi/error.h" #include "qapi/clone-visitor.h" +#include "qapi/qapi-type-infos-sockets.h" #include "qapi/qapi-visit-sockets.h" #include "qemu/yank.h" #include "trace.h" @@ -1568,7 +1569,8 @@ static void char_socket_class_init(ObjectClass *oc, c= onst void *data) cc->chr_listener_cleanup =3D tcp_chr_listener_cleanup; cc->chr_get_filename =3D tcp_chr_get_filename; =20 - object_class_property_add(oc, "addr", "SocketAddress", NULL, + object_class_property_add(oc, "addr", "SocketAddress", + &SocketAddress_type_info, char_socket_get_addr, NULL, NULL, NULL); =20 diff --git a/hw/core/machine.c b/hw/core/machine.c index 6948fc9c26..a787b39bb9 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" @@ -1119,20 +1120,22 @@ static void machine_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, "dumpdtb", "Dump current dtb to a file and quit"); =20 - object_class_property_add(oc, "boot", "BootConfiguration", NULL, + object_class_property_add(oc, "boot", "BootConfiguration", + &BootConfiguration_type_info, machine_get_boot, machine_set_boot, NULL, NULL); object_class_property_set_description(oc, "boot", "Boot configuration"); =20 - object_class_property_add(oc, "smp", "SMPConfiguration", NULL, + object_class_property_add(oc, "smp", "SMPConfiguration", + &SMPConfiguration_type_info, machine_get_smp, machine_set_smp, NULL, NULL); object_class_property_set_description(oc, "smp", "CPU topology"); =20 object_class_property_add(oc, "smp-cache", "SmpCachePropertiesWrapper", - NULL, + &SmpCachePropertiesWrapper_type_info, machine_get_smp_cache, machine_set_smp_cache, NULL, NULL); object_class_property_set_description(oc, "smp-cache", @@ -1216,7 +1219,8 @@ static void machine_class_init(ObjectClass *oc, const= void *data) "Set RAM backend" "Valid value is ID of hostmem ba= sed backend"); =20 - object_class_property_add(oc, "memory", "MemorySizeConfiguration", NUL= L, + object_class_property_add(oc, "memory", "MemorySizeConfiguration", + &MemorySizeConfiguration_type_info, machine_get_mem, machine_set_mem, NULL, NULL); object_class_property_set_description(oc, "memory", diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index 9348c9841e..77ddf4511a 100644 --- a/hw/cxl/cxl-host.c +++ b/hw/cxl/cxl-host.c @@ -13,6 +13,7 @@ #include "system/qtest.h" #include "hw/core/boards.h" =20 +#include "qapi/qapi-type-infos-machine.h" #include "qapi/qapi-visit-machine.h" #include "hw/cxl/cxl.h" #include "hw/cxl/cxl_host.h" @@ -616,7 +617,8 @@ void cxl_machine_init(Object *obj, CXLState *state) "Set on/off to enable/disable " "CXL instantiation"); =20 - object_property_add(obj, "cxl-fmw", "CXLFixedMemoryWindow", NULL, + object_property_add(obj, "cxl-fmw", "CXLFixedMemoryWindow", + &CXLFixedMemoryWindowOptionsList_type_info, machine_get_cfmw, machine_set_cfmw, NULL, state); object_property_set_description(obj, "cxl-fmw", diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c index c4b3cb0b7b..205582a91f 100644 --- a/hw/remote/vfio-user-obj.c +++ b/hw/remote/vfio-user-obj.c @@ -47,6 +47,7 @@ #include "hw/core/boards.h" #include "hw/remote/machine.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-sockets.h" #include "qapi/qapi-visit-sockets.h" #include "qapi/qapi-events-misc.h" #include "qemu/notify.h" @@ -931,8 +932,9 @@ static void vfu_object_class_init(ObjectClass *klass, c= onst void *data) =20 k->nr_devs =3D 0; =20 - object_class_property_add(klass, "socket", "SocketAddress", NULL, NULL, - vfu_object_set_socket, NULL, NULL); + object_class_property_add(klass, "socket", "SocketAddress", + &SocketAddress_type_info, + NULL, vfu_object_set_socket, NULL, NULL); object_class_property_set_description(klass, "socket", "SocketAddress " "(ex: type=3Dunix,path=3D/tmp/so= ck). " diff --git a/hw/vfio-user/pci.c b/hw/vfio-user/pci.c index 4c76a3fe5d..c749ff149f 100644 --- a/hw/vfio-user/pci.c +++ b/hw/vfio-user/pci.c @@ -8,6 +8,7 @@ =20 #include "qemu/osdep.h" #include +#include "qapi/qapi-type-infos-sockets.h" #include "qapi-visit-sockets.h" #include "qemu/error-report.h" =20 @@ -471,7 +472,8 @@ static void vfio_user_pci_class_init(ObjectClass *klass= , const void *data) device_class_set_legacy_reset(dc, vfio_user_pci_reset); device_class_set_props(dc, vfio_user_pci_properties); =20 - object_class_property_add(klass, "socket", "SocketAddress", NULL, NULL, + object_class_property_add(klass, "socket", "SocketAddress", + &SocketAddress_type_info, NULL, vfio_user_pci_set_socket, NULL, NULL); object_class_property_set_description(klass, "socket", "SocketAddress (UNIX sockets onl= y)"); diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 4514de46ff..6a05a7144a 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -35,6 +35,8 @@ #include "sev.h" #include "qapi/error.h" #include "qemu/error-report.h" +#include "qapi/qapi-type-infos-machine.h" +#include "qapi/qapi-type-infos-run-state.h" #include "qapi/qapi-visit-machine.h" #include "standard-headers/asm-x86/kvm_para.h" #include "hw/core/qdev-properties.h" @@ -10569,11 +10571,12 @@ static void x86_cpu_initfn(Object *obj) =20 x86_cpu_init_default_topo(cpu); =20 - object_property_add(obj, "feature-words", "X86CPUFeatureWordInfo", NUL= L, + object_property_add(obj, "feature-words", "X86CPUFeatureWordInfo", + &X86CPUFeatureWordInfoList_type_info, x86_cpu_get_feature_words, NULL, NULL, (void *)env->features); object_property_add(obj, "filtered-features", "X86CPUFeatureWordInfo", - NULL, + &X86CPUFeatureWordInfo_type_info, x86_cpu_get_feature_words, NULL, NULL, (void *)cpu->filtered_features); =20 @@ -11041,7 +11044,8 @@ static void x86_cpu_common_class_init(ObjectClass *= oc, const void *data) =20 #if !defined(CONFIG_USER_ONLY) object_class_property_add(oc, "crash-information", - "GuestPanicInformation", NULL, + "GuestPanicInformation", + &GuestPanicInformation_type_info, x86_cpu_get_crash_info_qom, NULL, NULL, NULL= ); #endif =20 diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c index f6707abd34..52bb2ec6ce 100644 --- a/target/i386/kvm/tdx.c +++ b/target/i386/kvm/tdx.c @@ -14,6 +14,7 @@ #include "qemu/base64.h" #include "qemu/mmap-alloc.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-sockets.h" #include "qapi/qapi-visit-sockets.h" #include "qom/object_interfaces.h" #include "crypto/hash.h" @@ -1586,10 +1587,11 @@ static void tdx_guest_init(Object *obj) tdx_guest_get_mrownerconfig, tdx_guest_set_mrownerconfig); =20 - object_property_add(obj, "quote-generation-socket", "SocketAddress", N= ULL, - tdx_guest_get_qgs, - tdx_guest_set_qgs, - NULL, NULL); + object_property_add(obj, "quote-generation-socket", "SocketAddress", + &SocketAddress_type_info, + tdx_guest_get_qgs, + tdx_guest_set_qgs, + NULL, NULL); =20 tdx->event_notify_vector =3D -1; tdx->event_notify_apicid =3D -1; diff --git a/target/s390x/cpu-system.c b/target/s390x/cpu-system.c index de2f1422e3..5b5406b947 100644 --- a/target/s390x/cpu-system.c +++ b/target/s390x/cpu-system.c @@ -30,6 +30,7 @@ #include "system/reset.h" #include "qemu/timer.h" #include "trace.h" +#include "qapi/qapi-type-infos-run-state.h" #include "qapi/qapi-visit-run-state.h" #include "system/hw_accel.h" =20 @@ -138,7 +139,7 @@ void s390_cpu_system_init(Object *obj) =20 cs->start_powered_off =3D true; object_property_add(obj, "crash-information", "GuestPanicInformation", - NULL, + &GuestPanicInformation_type_info, s390_cpu_get_crash_info_qom, NULL, NULL, NULL); cpu->env.tod_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_tod_timer, cpu); --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630578; cv=none; d=zohomail.com; s=zohoarc; b=XilVSjlheU76hLSnIxR9qf5tGS16BQsFJ3I4djTodOAYiZlnKGm+fMpUjvvgJlQX/nKP2KxoZCIlQSvakKlS0JhoNZ/71a2jzcHU4uDjKgyV3jvxcoV/aLnjmubKJIYYG5cTkcYnrlZ5nuvlXfUfQrBEYIC9Mse/HqNwLD9LSpY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630578; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HVuYcWmKfdlgdHae1obuFE5GyNIhgeaSOB43f6Vq4z0=; b=EpeiFvsrw/UBuBSuY6mHzDkcbYY/45FUukP2+zMAlUgW+VPo41O5nGdcEOMDD6SWRdxHiXGUfHBH4xw0uipDbyu2Vrn5NhAR07osknscJ+9L/c5mzhcVZKEtarFTZmrPstQ0p9zQXN17yLlGuwTGCqzR3nabPxvPkLR66PWMsas= 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 1793630578642288.7878419026215; Mon, 2 Nov 2026 06:42:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDl-0003VA-2i; Mon, 02 Nov 2026 09:41:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDH-0003Fw-Mb for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0008T7-GC for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:40 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-100-MPXdLsR6OYuzT4dImICJ0g-1; Mon, 02 Nov 2026 09:40:31 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 24C7919539A9; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A193830001A2; Mon, 2 Nov 2026 14:40:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8A05F21E681E; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HVuYcWmKfdlgdHae1obuFE5GyNIhgeaSOB43f6Vq4z0=; b=Mu7rvipOuQU59Wkfgnx+v9ycl+uDF1GLO+ysnENFT7u0HokawseqLrDeGpB5lPeW/lqhdq XxdOM5Q3J1vFrSktTfBCZDv/vsQXUDTJsl+u8+bu43CzRAGBAwJR7ssQOs1FThBJa3GOQg ShXpwSNB10ON4N50bDmsY5Ty2FwyclE= X-MC-Unique: MPXdLsR6OYuzT4dImICJ0g-1 X-Mimecast-MFC-AGG-ID: MPXdLsR6OYuzT4dImICJ0g_1793630430 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 37/74] x86: convert OnOffAuto properties to QAPI-aware registration Date: Mon, 2 Nov 2026 15:39:41 +0100 Message-ID: <20261102144018.3212223-38-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630579609154100 From: Marc-Andr=C3=A9 Lureau Convert the smm, acpi, pit, and pic OnOffAuto properties from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-21-armbru@redhat.com> --- hw/i386/x86.c | 84 ++++++++++++++++++++------------------------------- 1 file changed, 33 insertions(+), 51 deletions(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 1b7740a97e..3416df13ab 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -24,7 +24,7 @@ #include "qemu/error-report.h" #include "qemu/units.h" #include "qapi/error.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qapi-visit-machine.h" #include "qapi/visitor.h" #include "system/qtest.h" @@ -188,21 +188,16 @@ bool x86_machine_is_smm_enabled(const X86MachineState= *x86ms) return false; } =20 -static void x86_machine_get_smm(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int x86_machine_get_smm(Object *obj, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - OnOffAuto smm =3D x86ms->smm; - - visit_type_OnOffAuto(v, name, &smm, errp); + return x86ms->smm; } =20 -static void x86_machine_set_smm(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void x86_machine_set_smm(Object *obj, int value, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &x86ms->smm, errp); + x86ms->smm =3D value; } =20 bool x86_machine_is_acpi_enabled(const X86MachineState *x86ms) @@ -213,55 +208,40 @@ bool x86_machine_is_acpi_enabled(const X86MachineStat= e *x86ms) return true; } =20 -static void x86_machine_get_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int x86_machine_get_acpi(Object *obj, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - OnOffAuto acpi =3D x86ms->acpi; - - visit_type_OnOffAuto(v, name, &acpi, errp); + return x86ms->acpi; } =20 -static void x86_machine_set_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void x86_machine_set_acpi(Object *obj, int value, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &x86ms->acpi, errp); + x86ms->acpi =3D value; } =20 -static void x86_machine_get_pit(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int x86_machine_get_pit(Object *obj, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - OnOffAuto pit =3D x86ms->pit; - - visit_type_OnOffAuto(v, name, &pit, errp); + return x86ms->pit; } =20 -static void x86_machine_set_pit(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void x86_machine_set_pit(Object *obj, int value, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &x86ms->pit, errp); + x86ms->pit =3D value; } =20 -static void x86_machine_get_pic(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int x86_machine_get_pic(Object *obj, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - OnOffAuto pic =3D x86ms->pic; - - visit_type_OnOffAuto(v, name, &pic, errp); + return x86ms->pic; } =20 -static void x86_machine_set_pic(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void x86_machine_set_pic(Object *obj, int value, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &x86ms->pic, errp); + x86ms->pic =3D value; } =20 static char *x86_machine_get_oem_id(Object *obj, Error **errp) @@ -391,29 +371,31 @@ static void x86_machine_class_init(ObjectClass *oc, c= onst void *data) mc->kvm_type =3D x86_kvm_type; nc->raise_nmi =3D x86_nmi; =20 - object_class_property_add(oc, X86_MACHINE_SMM, "OnOffAuto", NULL, - x86_machine_get_smm, x86_machine_set_smm, - NULL, NULL); + object_class_property_add_enum(oc, X86_MACHINE_SMM, "OnOffAuto", + &OnOffAuto_type_info, NULL, + x86_machine_get_smm, + x86_machine_set_smm); object_class_property_set_description(oc, X86_MACHINE_SMM, "Enable SMM"); =20 - object_class_property_add(oc, X86_MACHINE_ACPI, "OnOffAuto", NULL, - x86_machine_get_acpi, x86_machine_set_acpi, - NULL, NULL); + object_class_property_add_enum(oc, X86_MACHINE_ACPI, "OnOffAuto", + &OnOffAuto_type_info, NULL, + x86_machine_get_acpi, + x86_machine_set_acpi); object_class_property_set_description(oc, X86_MACHINE_ACPI, "Enable ACPI"); =20 - object_class_property_add(oc, X86_MACHINE_PIT, "OnOffAuto", NULL, - x86_machine_get_pit, - x86_machine_set_pit, - NULL, NULL); + object_class_property_add_enum(oc, X86_MACHINE_PIT, "OnOffAuto", + &OnOffAuto_type_info, NULL, + x86_machine_get_pit, + x86_machine_set_pit); object_class_property_set_description(oc, X86_MACHINE_PIT, "Enable i8254 PIT"); =20 - object_class_property_add(oc, X86_MACHINE_PIC, "OnOffAuto", NULL, - x86_machine_get_pic, - x86_machine_set_pic, - NULL, NULL); + object_class_property_add_enum(oc, X86_MACHINE_PIC, "OnOffAuto", + &OnOffAuto_type_info, NULL, + x86_machine_get_pic, + x86_machine_set_pic); object_class_property_set_description(oc, X86_MACHINE_PIC, "Enable i8259 PIC"); =20 --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793631088; cv=none; d=zohomail.com; s=zohoarc; b=O0WXq3nFY089MDeRW3T5NbayyFgRLnPszMb/NVuRODZHi2/mz9hZB8kodq9zHQMwmpk4Cg7a8u7xWbfFbBN7+LquTI3T0fi+ycM/4BFgBCXcqnXrpj/aUHL89u4SYpi04rV+imH+Yl772//WgQqkYY0Dyl8Gx/hbba7mgFCo91M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631088; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=alCDou/Rvo0E2MAtcVXmMDFfY73O+nIcZXTGrDcVfxQ=; b=TR+dpv8sdR0P22qjjjyaL1gRMW22XC6T95ONrC4kyAOjAqBHP14/P6H3FR8G5E2zcK5HelGzeCyOXelJ8ls7cJgOWB17qBLVhoaC1Hk30XcxgLKC4XgkledVw1sHThVjFXFB2/ffNenhUpSjcIWQvnrfxC74jJrD8Ifh9mEGC9Y= 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 1793631088044185.4451192109932; Mon, 2 Nov 2026 06:51:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDn-0003Vg-63; Mon, 02 Nov 2026 09:41:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDO-0003Ji-KN for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDC-0008Vw-9P for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:50 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-232-6zXEUCgtO7KMGDwAGw0mVw-1; Mon, 02 Nov 2026 09:40:31 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 51AD6195D00E; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B92551803A40; Mon, 2 Nov 2026 14:40:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8E34121E6820; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=alCDou/Rvo0E2MAtcVXmMDFfY73O+nIcZXTGrDcVfxQ=; b=W6CBBP/itL8AjwtFp8uarXWmq39/GKF5f5UUtLCDDFNqU+n68TJrwsi9uyzpMMEF6Rrs3d l4j45UPTSMIYjEU508K/L/jFsMIgo2X+sOCY8nETRF5FmFnOjbe0BULoxjycB1XoAdh3Gn m7UhKBd0itzkN+QgdCzM6+qldmzVT/k= X-MC-Unique: 6zXEUCgtO7KMGDwAGw0mVw-1 X-Mimecast-MFC-AGG-ID: 6zXEUCgtO7KMGDwAGw0mVw_1793630430 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 38/74] microvm: convert OnOffAuto properties to QAPI-aware registration Date: Mon, 2 Nov 2026 15:39:42 +0100 Message-ID: <20261102144018.3212223-39-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793631089378154100 From: Marc-Andr=C3=A9 Lureau Convert the rtc, pcie, and ioapic2 OnOffAuto properties from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-22-armbru@redhat.com> --- hw/i386/microvm.c | 68 +++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 40 deletions(-) diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index c679b3b177..7f010cb2f2 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -21,7 +21,7 @@ #include "qemu/units.h" #include "qapi/error.h" #include "qapi/visitor.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "system/system.h" #include "system/cpus.h" #include "system/numa.h" @@ -519,55 +519,40 @@ static void microvm_machine_reset(MachineState *machi= ne, ResetType type) } } =20 -static void microvm_machine_get_rtc(Object *obj, Visitor *v, const char *n= ame, - void *opaque, Error **errp) +static int microvm_machine_get_rtc(Object *obj, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - OnOffAuto rtc =3D mms->rtc; - - visit_type_OnOffAuto(v, name, &rtc, errp); + return mms->rtc; } =20 -static void microvm_machine_set_rtc(Object *obj, Visitor *v, const char *n= ame, - void *opaque, Error **errp) +static void microvm_machine_set_rtc(Object *obj, int value, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &mms->rtc, errp); + mms->rtc =3D value; } =20 -static void microvm_machine_get_pcie(Object *obj, Visitor *v, const char *= name, - void *opaque, Error **errp) +static int microvm_machine_get_pcie(Object *obj, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - OnOffAuto pcie =3D mms->pcie; - - visit_type_OnOffAuto(v, name, &pcie, errp); + return mms->pcie; } =20 -static void microvm_machine_set_pcie(Object *obj, Visitor *v, const char *= name, - void *opaque, Error **errp) +static void microvm_machine_set_pcie(Object *obj, int value, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &mms->pcie, errp); + mms->pcie =3D value; } =20 -static void microvm_machine_get_ioapic2(Object *obj, Visitor *v, const cha= r *name, - void *opaque, Error **errp) +static int microvm_machine_get_ioapic2(Object *obj, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - OnOffAuto ioapic2 =3D mms->ioapic2; - - visit_type_OnOffAuto(v, name, &ioapic2, errp); + return mms->ioapic2; } =20 -static void microvm_machine_set_ioapic2(Object *obj, Visitor *v, const cha= r *name, - void *opaque, Error **errp) +static void microvm_machine_set_ioapic2(Object *obj, int value, Error **er= rp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &mms->ioapic2, errp); + mms->ioapic2 =3D value; } =20 static bool microvm_machine_get_isa_serial(Object *obj, Error **errp) @@ -673,24 +658,27 @@ static void microvm_class_init(ObjectClass *oc, const= void *data) hc->unplug_request =3D microvm_device_unplug_request_cb; hc->unplug =3D microvm_device_unplug_cb; =20 - object_class_property_add(oc, MICROVM_MACHINE_RTC, "OnOffAuto", NULL, - microvm_machine_get_rtc, - microvm_machine_set_rtc, - NULL, NULL); + object_class_property_add_enum(oc, MICROVM_MACHINE_RTC, + "OnOffAuto", + &OnOffAuto_type_info, NULL, + microvm_machine_get_rtc, + microvm_machine_set_rtc); object_class_property_set_description(oc, MICROVM_MACHINE_RTC, "Enable MC146818 RTC"); =20 - object_class_property_add(oc, MICROVM_MACHINE_PCIE, "OnOffAuto", NULL, - microvm_machine_get_pcie, - microvm_machine_set_pcie, - NULL, NULL); + object_class_property_add_enum(oc, MICROVM_MACHINE_PCIE, + "OnOffAuto", + &OnOffAuto_type_info, NULL, + microvm_machine_get_pcie, + microvm_machine_set_pcie); object_class_property_set_description(oc, MICROVM_MACHINE_PCIE, "Enable PCIe"); =20 - object_class_property_add(oc, MICROVM_MACHINE_IOAPIC2, "OnOffAuto", NU= LL, - microvm_machine_get_ioapic2, - microvm_machine_set_ioapic2, - NULL, NULL); + object_class_property_add_enum(oc, MICROVM_MACHINE_IOAPIC2, + "OnOffAuto", + &OnOffAuto_type_info, NULL, + microvm_machine_get_ioapic2, + microvm_machine_set_ioapic2); object_class_property_set_description(oc, MICROVM_MACHINE_IOAPIC2, "Enable second IO-APIC"); =20 --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793631235; cv=none; d=zohomail.com; s=zohoarc; b=gCNdx07vQb+rOXFCvDJZfqedWNw1rYcP8fFVVJLDgA/sjKb8NmgONZp5lcMSMEVpxZFClgO4xhDQFbXrv9I0NE6rGlYnOtWu1Ngp9SAIrmMegog2qwy8HLxcLMD+bOiuNYfk6xB+VumebTfve31OAhesje1YNrQ/z18Fp5rrTCQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631235; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bTd3wFTwGEawFIbNVzYbsQFVpJ/z8P4sEmAjAsn/PJE=; b=nlO8zAFVlj3610EB0NPxRLP3qvX2PWLdXdmrJOBuEz41iN534SLxhGX7Y9JDg7cuNAD910FSM+Lw3lPNzhHaogpu3xjUYHHb7HdQmvd7sXCsmNYYSGtaX5too5Izl/jK/RzL52pKv7C4t/W4C34kZEgQ3ZsksIG53aJjR2vYlvU= 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 1793631235341392.14233113056764; Mon, 2 Nov 2026 06:53:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtEO-0004nN-MJ; Mon, 02 Nov 2026 09:42:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDH-0003Fz-Oi for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD9-0008Tl-4r for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:41 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-407-yhwAYGChNgmeTiAC8ta4hQ-1; Mon, 02 Nov 2026 09:40:31 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1C30A195D023; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CC5E11803A4D; Mon, 2 Nov 2026 14:40:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 923EB21E682B; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bTd3wFTwGEawFIbNVzYbsQFVpJ/z8P4sEmAjAsn/PJE=; b=O/p11G8pnhFgeWXccMhtTtuAoDnQCxyEI+Hk2k47MDgKXIT/92KY6qh5ZlISwyz+YtVmAH 8wUSHrYkAVlQoUX/Kzbc9rnFJAeQP8IUI8qOdlmvQ+yNF+H6PjgwS89W1gPyySBMa8UEuv LTie0fjb8bBw373vBZRcewDM0mmrWh4= X-MC-Unique: yhwAYGChNgmeTiAC8ta4hQ-1 X-Mimecast-MFC-AGG-ID: yhwAYGChNgmeTiAC8ta4hQ_1793630430 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 39/74] pc: convert OnOffAuto vmport property to QAPI-aware registration Date: Mon, 2 Nov 2026 15:39:43 +0100 Message-ID: <20261102144018.3212223-40-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793631237709154100 From: Marc-Andr=C3=A9 Lureau Convert the vmport OnOffAuto property from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-23-armbru@redhat.com> --- hw/i386/pc.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 1fce96f5ec..649ae27156 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -46,6 +46,7 @@ #include "kvm/kvm_i386.h" #include "kvm/tdx.h" #include "hw/xen/xen.h" +#include "qapi/qapi-type-infos-common.h" #include "qobject/qlist.h" #include "qemu/error-report.h" #include "hw/acpi/acpi.h" @@ -1417,21 +1418,16 @@ static const HotplugHandler *pc_get_hotplug_handler= (MachineState *machine, return NULL; } =20 -static void pc_machine_get_vmport(Object *obj, Visitor *v, const char *nam= e, - void *opaque, Error **errp) +static int pc_machine_get_vmport(Object *obj, Error **errp) { PCMachineState *pcms =3D PC_MACHINE(obj); - OnOffAuto vmport =3D pcms->vmport; - - visit_type_OnOffAuto(v, name, &vmport, errp); + return pcms->vmport; } =20 -static void pc_machine_set_vmport(Object *obj, Visitor *v, const char *nam= e, - void *opaque, Error **errp) +static void pc_machine_set_vmport(Object *obj, int value, Error **errp) { PCMachineState *pcms =3D PC_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &pcms->vmport, errp); + pcms->vmport =3D value; } =20 static bool pc_machine_get_fd_bootchk(Object *obj, Error **errp) @@ -1729,9 +1725,11 @@ static void pc_machine_class_init(ObjectClass *oc, c= onst void *data) object_class_property_set_description(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "Maximum ram below the 4G boundary (32bit boundary)"); =20 - object_class_property_add(oc, PC_MACHINE_VMPORT, "OnOffAuto", NULL, - pc_machine_get_vmport, pc_machine_set_vmport, - NULL, NULL); + object_class_property_add_enum(oc, PC_MACHINE_VMPORT, + "OnOffAuto", + &OnOffAuto_type_info, NULL, + pc_machine_get_vmport, + pc_machine_set_vmport); object_class_property_set_description(oc, PC_MACHINE_VMPORT, "Enable vmport (pc & q35)"); =20 --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630596; cv=none; d=zohomail.com; s=zohoarc; b=QTYfYA51XiDL4qwZA2H6Nq48A77aZ+IOFd+Uo88Mk+TmrXooohNHIAtzI6aA7u27Wu7OIf6+9eEWsEi2TiTjCAO7hVbivJ8HcQ7O36qkXtRjQGfiA2Vx2KMfFaBfDRd92sGvShSvZ0fUgPoImdd94R/fcHHwMIggTnIiG3G+Pyg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630596; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=aA15N391HVWG2S+kFZZWxT6Crrg8XwMSyJFL8FGzrC0=; b=PtpLfnoLk7ukuadWDt4nNjwjtV9XP/BJdSAmuNkY/SLCoPwTJMRbBN1YCsNjBCYn/u1Z0oqT1OH55c8Gg64cgeztsRMFQlMveoGjwR6/1FjW0x93o9/xwGGpbpBxum/tFvtBI5jpf5MzDmOiM6QFo0tcwBOR0Fkm0xUUKsZDVcs= 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 179363059608857.128163693527085; Mon, 2 Nov 2026 06:43:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDm-0003VU-Bl; Mon, 02 Nov 2026 09:41:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDB-0003DE-Ti for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0008Sq-AX for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:37 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-484-vX7tBCxdMdWg4bK6mNdDRw-1; Mon, 02 Nov 2026 09:40:30 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E12641953971; Mon, 2 Nov 2026 14:40:29 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A122230000E7; Mon, 2 Nov 2026 14:40:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 966C421E682C; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aA15N391HVWG2S+kFZZWxT6Crrg8XwMSyJFL8FGzrC0=; b=RcMbFPV6u3wKJrMcSKIITrH/3+v8paI1dQ4qJRoyY04JPqo8QC9grsCbf1hDYEwCsKiwfE vveMsVK3TNbmA66IQS7KbjmBm+8+S26HZW3s4yhnoJx9rpvYEhcLZZIvUqtLqVrvwL6EVQ aubRtVOM4pGln9iBrt15raJ1vPc2/iY= X-MC-Unique: vX7tBCxdMdWg4bK6mNdDRw-1 X-Mimecast-MFC-AGG-ID: vX7tBCxdMdWg4bK6mNdDRw_1793630430 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 40/74] arm/virt: convert OnOffAuto acpi property to QAPI-aware registration Date: Mon, 2 Nov 2026 15:39:44 +0100 Message-ID: <20261102144018.3212223-41-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630601690154100 From: Marc-Andr=C3=A9 Lureau Convert the acpi OnOffAuto property from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-24-armbru@redhat.com> --- hw/arm/virt.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index dad3f8c39b..e39d77eba6 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -72,7 +72,7 @@ #include "whpx_arm.h" #include "hw/firmware/smbios.h" #include "qapi/visitor.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "qobject/qlist.h" #include "standard-headers/linux/input.h" #include "hw/arm/smmuv3.h" @@ -3564,21 +3564,16 @@ bool virt_is_acpi_enabled(const VirtMachineState *v= ms) return true; } =20 -static void virt_get_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int virt_get_acpi(Object *obj, Error **errp) { VirtMachineState *vms =3D VIRT_MACHINE(obj); - OnOffAuto acpi =3D vms->acpi; - - visit_type_OnOffAuto(v, name, &acpi, errp); + return vms->acpi; } =20 -static void virt_set_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void virt_set_acpi(Object *obj, int value, Error **errp) { VirtMachineState *vms =3D VIRT_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &vms->acpi, errp); + vms->acpi =3D value; } =20 static bool virt_get_ras(Object *obj, Error **errp) @@ -4206,9 +4201,9 @@ static void virt_machine_class_init(ObjectClass *oc, = const void *data) mc->default_ram_id =3D "mach-virt.ram"; mc->default_nic =3D "virtio-net-pci"; =20 - object_class_property_add(oc, "acpi", "OnOffAuto", NULL, - virt_get_acpi, virt_set_acpi, - NULL, NULL); + object_class_property_add_enum(oc, "acpi", "OnOffAuto", + &OnOffAuto_type_info, NULL, + virt_get_acpi, virt_set_acpi); object_class_property_set_description(oc, "acpi", "Enable ACPI"); object_class_property_add_bool(oc, "secure", virt_get_secure, --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793631088; cv=none; d=zohomail.com; s=zohoarc; b=J1pOeP/qKNM05/2tY4DcKVh3BdMFpI30xUJxZBmy9L2h+LgFdZE48/iHIGxV5dmWpDwn51XWPhmwhgIGfaDwrNFc+RvpODVxQzXn8tNTSlCrBiqYSg9qSDGcOnXUxRH4Wg/0w/U2xE5fr13vkc4dTfgJTnLDtuelcg11O4EEO8M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631088; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+nbZ5E9fHzmmAnJIvysDy2BShswB9qDp+uq7No+2dE0=; b=m/svvGH+stv5VIgqaMBdqlXVMSNSyZ5xjW4rZzIE3SnOfJpPPdJbOVpZtkvCC3GpLEZg/1HHaIOi7bXpU38H1zODHxmf3crpBBB3R6PqBFHJKayHIZUnM6paGRorvDRc5+q5zgV8m8uuTCjncde71DagkZlNRDcBSh9buHdkays= 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 1793631088244454.7756877039841; Mon, 2 Nov 2026 06:51:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtEE-0004Bn-G4; Mon, 02 Nov 2026 09:41:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDD-0003DT-Er for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0008St-DZ for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-177-3jJBa1a4MruLgM66V1Ui6A-1; Mon, 02 Nov 2026 09:40:31 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2624E195BDCA; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D5CFF1800347; Mon, 2 Nov 2026 14:40:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9AA3C21E6832; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+nbZ5E9fHzmmAnJIvysDy2BShswB9qDp+uq7No+2dE0=; b=IHdQACXu1sbTz4DKnNakLfmgagJNyG+w2/bzWRjv9U2IYgPVfLnIFFMOAQJ3rXcj/tuT0e kU5j/Wm83nuTLw1oNC0uqgEFSXIvaj8U7E0riPKyDZnSSfOK6TndkYTAyTSIo0GmH08fVW Tj4MmCf0keBf0RXOgOU8QrplPCeOrEo= X-MC-Unique: 3jJBa1a4MruLgM66V1Ui6A-1 X-Mimecast-MFC-AGG-ID: 3jJBa1a4MruLgM66V1Ui6A_1793630430 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Alistair Francis Subject: [PULL 41/74] riscv/virt: convert OnOffAuto properties to QAPI-aware registration Date: Mon, 2 Nov 2026 15:39:45 +0100 Message-ID: <20261102144018.3212223-42-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793631091449154100 From: Marc-Andr=C3=A9 Lureau Convert the acpi and iommu-sys OnOffAuto properties from manual visitor-based callbacks to object_class_property_add_enum(). Acked-by: Alistair Francis Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-25-armbru@redhat.com> --- hw/riscv/virt.c | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 65f4c67bff..31fecdc964 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -58,7 +58,7 @@ #include "hw/pci-host/gpex.h" #include "hw/display/ramfb.h" #include "hw/acpi/aml-build.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "hw/virtio/virtio-iommu.h" #include "hw/uefi/var-service-api.h" =20 @@ -1055,38 +1055,28 @@ bool virt_is_iommu_sys_enabled(RISCVVirtState *s) return s->iommu_sys =3D=3D ON_OFF_AUTO_ON; } =20 -static void virt_get_iommu_sys(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int virt_get_iommu_sys(Object *obj, Error **errp) { RISCVVirtState *s =3D RISCV_VIRT_MACHINE(obj); - OnOffAuto iommu_sys =3D s->iommu_sys; - - visit_type_OnOffAuto(v, name, &iommu_sys, errp); + return s->iommu_sys; } =20 -static void virt_set_iommu_sys(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void virt_set_iommu_sys(Object *obj, int value, Error **errp) { RISCVVirtState *s =3D RISCV_VIRT_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &s->iommu_sys, errp); + s->iommu_sys =3D value; } =20 -static void virt_get_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int virt_get_acpi(Object *obj, Error **errp) { RISCVVirtState *s =3D RISCV_VIRT_MACHINE(obj); - OnOffAuto acpi =3D s->acpi; - - visit_type_OnOffAuto(v, name, &acpi, errp); + return s->acpi; } =20 -static void virt_set_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void virt_set_acpi(Object *obj, int value, Error **errp) { RISCVVirtState *s =3D RISCV_VIRT_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &s->acpi, errp); + s->acpi =3D value; } =20 static const HotplugHandler * @@ -1184,15 +1174,15 @@ static void virt_machine_class_init(ObjectClass *oc= , const void *data) object_class_property_set_description(oc, "aia-guests", str); } =20 - object_class_property_add(oc, "acpi", "OnOffAuto", NULL, - virt_get_acpi, virt_set_acpi, - NULL, NULL); + object_class_property_add_enum(oc, "acpi", "OnOffAuto", + &OnOffAuto_type_info, NULL, + virt_get_acpi, virt_set_acpi); object_class_property_set_description(oc, "acpi", "Enable ACPI"); =20 - object_class_property_add(oc, "iommu-sys", "OnOffAuto", NULL, - virt_get_iommu_sys, virt_set_iommu_sys, - NULL, NULL); + object_class_property_add_enum(oc, "iommu-sys", "OnOffAuto", + &OnOffAuto_type_info, NULL, + virt_get_iommu_sys, virt_set_iommu_sys); object_class_property_set_description(oc, "iommu-sys", "Enable IOMMU platform device"); } --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630749; cv=none; d=zohomail.com; s=zohoarc; b=NM9S6HZ/lXltCOqfTlXV4ZZeQxPpson04Bn6GWXMfqMn6bFGber4nw5U/CyNVCVquJlydsCW9TBeBu0Lg3Fc6Z7pd21hotVQXB3b3+bWvyD7hunApRjLzVdXwdPn2KqKZrVBUrnw//9Y7R6AM88utgP0rYxfnHOBzYEVHBv7s4E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630749; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hc5x8/hWbcJyBGgz90/IVsHCFyg+hkruSIXa+EuEJrk=; b=bOqDl+lTvTf90YJEAM8AsZO8P9BQWJnKKaMpeRMYPBAJKcJOtwx4Z7xHFGCEqmNKXLVdy4Ro95TI5W4lFBd0oLg8EhzOG8uNP8Z/CoiZFEhN5355JxPzDqXdsy6L1YZ7Uy7VGQFu+aFtjR/c05YhIb26km1cKbK2ViFhgOPPuqU= 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 1793630749533621.8072215842719; Mon, 2 Nov 2026 06:45:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDo-0003WF-3V; Mon, 02 Nov 2026 09:41:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDI-0003HA-DD for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDA-0008Ui-1I for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:43 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-247-6jclamrgOPilb0sKc-F_aw-1; Mon, 02 Nov 2026 09:40:31 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 76F75195DE0A; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A0F2E433; Mon, 2 Nov 2026 14:40:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9EFFA21E6833; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hc5x8/hWbcJyBGgz90/IVsHCFyg+hkruSIXa+EuEJrk=; b=Lhv+9Q8RZuXaDmBlFzgEYMXlMxx+yP8hMK8zrHEVcx9zuWzh4FlWoTYd6IFJo1q+AZFyDd k6l+XNG+RUGHGpsmPO1+14yYHCgrDMrSK9VaZW8Ti5fAg8uo9OlbjjNBjLpWbxKfZEaGh3 IfbktpRpfUvDtUWJZHDZOj1EUPaTOkU= X-MC-Unique: 6jclamrgOPilb0sKc-F_aw-1 X-Mimecast-MFC-AGG-ID: 6jclamrgOPilb0sKc-F_aw_1793630430 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Bibo Mao Subject: [PULL 42/74] loongarch/virt: convert OnOffAuto properties to QAPI-aware registration Date: Mon, 2 Nov 2026 15:39:46 +0100 Message-ID: <20261102144018.3212223-43-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630752173154100 From: Marc-Andr=C3=A9 Lureau Convert the acpi, v-eiointc, and dmsi OnOffAuto properties from manual visitor-based callbacks to object_class_property_add_enum(). Reviewed-by: Bibo Mao Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-26-armbru@redhat.com> --- hw/loongarch/virt.c | 65 ++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 39 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 8ad327b8dd..1e1271ce87 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -36,7 +36,8 @@ #include "target/loongarch/cpu.h" #include "target/loongarch/cpu-mmu.h" #include "hw/firmware/smbios.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" +#include "qapi/visitor.h" #include "hw/acpi/generic_event_device.h" #include "hw/mem/nvdimm.h" #include "hw/core/platform-bus.h" @@ -51,26 +52,21 @@ #include "qemu/log.h" #include "kvm/kvm_loongarch.h" =20 -static void virt_get_dmsi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int virt_get_dmsi(Object *obj, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(obj); - OnOffAuto dmsi =3D lvms->dmsi; - - visit_type_OnOffAuto(v, name, &dmsi, errp); - + return lvms->dmsi; } -static void virt_set_dmsi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) + +static void virt_set_dmsi(Object *obj, int value, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(obj); + lvms->dmsi =3D value; =20 - visit_type_OnOffAuto(v, name, &lvms->dmsi, errp); - - if (lvms->dmsi =3D=3D ON_OFF_AUTO_OFF) { + if (value =3D=3D ON_OFF_AUTO_OFF) { lvms->misc_feature &=3D ~BIT(IOCSRF_DMSI); lvms->misc_status &=3D ~BIT_ULL(IOCSRM_DMSI_EN); - } else if (lvms->dmsi =3D=3D ON_OFF_AUTO_ON) { + } else if (value =3D=3D ON_OFF_AUTO_ON) { lvms->misc_feature =3D BIT(IOCSRF_DMSI); } } @@ -78,21 +74,16 @@ static void virt_set_dmsi(Object *obj, Visitor *v, cons= t char *name, #define DEFAULT_HIGH_PCIE_MMIO_SIZE_GB 64 #define DEFAULT_HIGH_PCIE_MMIO_SIZE (DEFAULT_HIGH_PCIE_MMIO_SIZE_GB * GiB) =20 -static void virt_get_veiointc(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int virt_get_veiointc(Object *obj, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(obj); - OnOffAuto veiointc =3D lvms->veiointc; - - visit_type_OnOffAuto(v, name, &veiointc, errp); + return lvms->veiointc; } =20 -static void virt_set_veiointc(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void virt_set_veiointc(Object *obj, int value, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &lvms->veiointc, errp); + lvms->veiointc =3D value; } =20 static bool virt_get_highmem_mmio(Object *obj, Error **errp) @@ -1025,21 +1016,16 @@ static void virt_init(MachineState *machine) loongarch_load_kernel(machine, &lvms->bootinfo, phys_addr_mask); } =20 -static void virt_get_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int virt_get_acpi(Object *obj, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(obj); - OnOffAuto acpi =3D lvms->acpi; - - visit_type_OnOffAuto(v, name, &acpi, errp); + return lvms->acpi; } =20 -static void virt_set_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void virt_set_acpi(Object *obj, int value, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &lvms->acpi, errp); + lvms->acpi =3D value; } =20 static char *virt_get_oem_id(Object *obj, Error **errp) @@ -1483,18 +1469,19 @@ static void virt_class_init(ObjectClass *oc, const = void *data) hc->unplug_request =3D virt_device_unplug_request; hc->unplug =3D virt_device_unplug; =20 - object_class_property_add(oc, "acpi", "OnOffAuto", NULL, - virt_get_acpi, virt_set_acpi, - NULL, NULL); + object_class_property_add_enum(oc, "acpi", "OnOffAuto", + &OnOffAuto_type_info, NULL, + virt_get_acpi, virt_set_acpi); object_class_property_set_description(oc, "acpi", "Enable ACPI"); - object_class_property_add(oc, "v-eiointc", "OnOffAuto", NULL, - virt_get_veiointc, virt_set_veiointc, - NULL, NULL); + object_class_property_add_enum(oc, "v-eiointc", "OnOffAuto", + &OnOffAuto_type_info, NULL, + virt_get_veiointc, virt_set_veiointc); object_class_property_set_description(oc, "v-eiointc", "Enable Virt Extend I/O Interrupt Controller."= ); - object_class_property_add(oc, "dmsi", "OnOffAuto", NULL, - virt_get_dmsi, virt_set_dmsi, NULL, NULL); + object_class_property_add_enum(oc, "dmsi", "OnOffAuto", + &OnOffAuto_type_info, NULL, + virt_get_dmsi, virt_set_dmsi); object_class_property_set_description(oc, "dmsi", "Enable direct Message-interrupts Controller."= ); machine_class_allow_dynamic_sysbus_dev(mc, TYPE_RAMFB_DEVICE); --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630602; cv=none; d=zohomail.com; s=zohoarc; b=SvAYWfEZSKQ2qV97THpiz9Con2hneY72L3p9+iog6s/NTOT5JbISyacbIMy1PMMiCA2Ac7J1AgDZtyY1acI8gkQwQYWXtfBLQ2fOydYv6mzg0l2FzgUwfDKD7A8vBmuXP/z/oXcRRBal9A01sPbNvLlHTLznC0srI+OHoDwmm4o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630602; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HgWj8FyqJvvr9WM7Y2RJU3bqGMRLvuO9KJ4LAR5cySs=; b=KGG+ZpZKpMOia7231KomMOJr2fvRVXIxQEWpGLq2XRI7OpvT6t0Ic1nnnk9WLoLhVlcfNtSvtBk1laUNaTDHRKLqm9DcobGYXOwmNuN5vMAzPfAem1m1r2MK5UMHMIVD+wNzPfjkcaa3arCXzGy2zlSaIi/c+BO87D2Cxu91zAo= 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 1793630602134279.3892524835627; Mon, 2 Nov 2026 06:43:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDo-0003WM-Mi; Mon, 02 Nov 2026 09:41:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDH-0003GA-St for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0008T3-Ex for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:40 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-423-N-Ejf07SOWmA8YL1bTsR-A-1; Mon, 02 Nov 2026 09:40:31 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3BFE1195DB8E; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A31611956088; Mon, 2 Nov 2026 14:40:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id A352221E6836; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HgWj8FyqJvvr9WM7Y2RJU3bqGMRLvuO9KJ4LAR5cySs=; b=fw+4gSjhZYV2QJSlXb1GEpUs9Ml2St74qJWHs86k0Xu4MuXoPB8m/GJT83W4ZoknvVXtrY VtY2eHhl4DcO05w4FiGa5wm4EaJEEiE2ip405jmIRn3IoNiwjhaml1MkcuDLWEMjKFFhV0 msLQBC5Bff4OkFOm+vKNCd7WRRoiAQA= X-MC-Unique: N-Ejf07SOWmA8YL1bTsR-A-1 X-Mimecast-MFC-AGG-ID: N-Ejf07SOWmA8YL1bTsR-A_1793630430 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 43/74] hostmem: convert OnOffAuto rom property to QAPI-aware registration Date: Mon, 2 Nov 2026 15:39:47 +0100 Message-ID: <20261102144018.3212223-44-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630604537158500 From: Marc-Andr=C3=A9 Lureau Convert the hostmem-file's rom property and hostmem-memfd's guest-memfd property from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-27-armbru@redhat.com> --- backends/hostmem-file.c | 25 ++++++++++--------------- backends/hostmem-memfd.c | 23 ++++++++++------------- 2 files changed, 20 insertions(+), 28 deletions(-) diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index aec38bac2f..15b5fee246 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -19,7 +19,7 @@ #include "qom/object_interfaces.h" #include "qom/object.h" #include "qapi/visitor.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" =20 OBJECT_DECLARE_SIMPLE_TYPE(HostMemoryBackendFile, MEMORY_BACKEND_FILE) =20 @@ -230,30 +230,24 @@ static void file_memory_backend_set_readonly(Object *= obj, bool value, fb->readonly =3D value; } =20 -static void file_memory_backend_get_rom(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static int file_memory_backend_get_rom(Object *obj, Error **errp) { HostMemoryBackendFile *fb =3D MEMORY_BACKEND_FILE(obj); - OnOffAuto rom =3D fb->rom; - - visit_type_OnOffAuto(v, name, &rom, errp); + return fb->rom; } =20 -static void file_memory_backend_set_rom(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void file_memory_backend_set_rom(Object *obj, int value, Error **er= rp) { HostMemoryBackend *backend =3D MEMORY_BACKEND(obj); HostMemoryBackendFile *fb =3D MEMORY_BACKEND_FILE(obj); =20 if (host_memory_backend_mr_inited(backend)) { - error_setg(errp, "cannot change property '%s' of %s.", name, + error_setg(errp, "cannot change property 'rom' of %s.", object_get_typename(obj)); return; } =20 - visit_type_OnOffAuto(v, name, &fb->rom, errp); + fb->rom =3D value; } =20 static void file_backend_unparent(Object *obj) @@ -298,9 +292,10 @@ file_backend_class_init(ObjectClass *oc, const void *d= ata) object_class_property_add_bool(oc, "readonly", file_memory_backend_get_readonly, file_memory_backend_set_readonly); - object_class_property_add(oc, "rom", "OnOffAuto", NULL, - file_memory_backend_get_rom, - file_memory_backend_set_rom, NULL, NULL); + object_class_property_add_enum(oc, "rom", "OnOffAuto", + &OnOffAuto_type_info, NULL, + file_memory_backend_get_rom, + file_memory_backend_set_rom); object_class_property_set_description(oc, "rom", "Whether to create Read Only Memory (ROM)"); } diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index 7df0440071..28f7e180f4 100644 --- a/backends/hostmem-memfd.c +++ b/backends/hostmem-memfd.c @@ -20,7 +20,7 @@ #include "migration/cpr.h" #include "system/kvm.h" #include -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" =20 OBJECT_DECLARE_SIMPLE_TYPE(HostMemoryBackendMemfd, MEMORY_BACKEND_MEMFD) =20 @@ -98,24 +98,20 @@ have_fd: backend->size, ram_flags, fd, 0,= errp); } =20 -static void -memfd_backend_get_guest_memfd(Object *o, Visitor *v, - const char *value, void *opaque, - Error **errp) +static int +memfd_backend_get_guest_memfd(Object *o, Error **errp) { HostMemoryBackendMemfd *m =3D MEMORY_BACKEND_MEMFD(o); =20 - visit_type_OnOffAuto(v, value, &m->guest_memfd, errp); + return m->guest_memfd; } =20 static void -memfd_backend_set_guest_memfd(Object *o, Visitor *v, - const char *value, void *opaque, - Error **errp) +memfd_backend_set_guest_memfd(Object *o, int value, Error **errp) { HostMemoryBackendMemfd *m =3D MEMORY_BACKEND_MEMFD(o); =20 - visit_type_OnOffAuto(v, value, &m->guest_memfd, errp); + m->guest_memfd =3D value; } =20 static bool @@ -206,9 +202,10 @@ memfd_backend_class_init(ObjectClass *oc, const void *= data) "Huge pages size (ex: 2M, 1G= )"); } =20 - object_class_property_add(oc, "guest-memfd", "OnOffAuto", NULL, - memfd_backend_get_guest_memfd, - memfd_backend_set_guest_memfd, NULL, NULL); + object_class_property_add_enum(oc, "guest-memfd", "OnOffAuto", + &OnOffAuto_type_info, NULL, + memfd_backend_get_guest_memfd, + memfd_backend_set_guest_memfd); object_class_property_set_description(oc, "guest-memfd", "Use guest memfd"); =20 --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793631002; cv=none; d=zohomail.com; s=zohoarc; b=lSxPHIECtGnL+KLf00+PME/inlofNfD8LG5zRlWYLWDJlnLLXSi86Tj2U8GqSZ37CJqPG1V6Y2GMVTVqDdsR7r9+UYN0tAP7QnJtIraXMDQ5VYdQ3agx4bgXCsURX4OrpW9bLVxa1dSFRspJPt0eg8m6hZeEnmvsQyl/toSWaNI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631002; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qiJdcth6qN6w5wtIzvVKQDc0KFj1a0m7nS/E3x+4ycI=; b=hvXPausngDqbsATQVGBwAfc8PzRwQCFodl5hQR+gNeXVlnZr907RvycVwPuDc8wCMrjBZ4Es8yZ99nJv5/GCW+rlnVNbqNqBMsLvLG1j2eoj7Qsgx6XEtc95R4wdhEsbGK4pRrkcVXTWk1YvpSR2MH6WmTQvVE2KTbI8j5zoVh4= 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 1793631002304968.2959906509076; Mon, 2 Nov 2026 06:50:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtFP-0007RK-1k; Mon, 02 Nov 2026 09:42:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDH-0003G8-SE for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0008T0-GH for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:40 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-222-l9OTA7pDNvOojhjfCjOyKA-1; Mon, 02 Nov 2026 09:40:31 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1480419541AB; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C79C91803A48; Mon, 2 Nov 2026 14:40:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id A795221E6838; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qiJdcth6qN6w5wtIzvVKQDc0KFj1a0m7nS/E3x+4ycI=; b=bY4eiBETOzelLDrW7DAgNIXIyKob3Px5Y/8GE7I8PTWsc+aRSEkkZO1s9u2426GNBD8X03 09JqWbgSwd1bkseSqZzPxu365q30lvO1Cl9KWN0m5vAFBZte+0VyhHjDABLvy17EDwXW+U kcIYhQ8kSjRG9lHx3+jJ5rMe4oWOPzw= X-MC-Unique: l9OTA7pDNvOojhjfCjOyKA-1 X-Mimecast-MFC-AGG-ID: l9OTA7pDNvOojhjfCjOyKA_1793630430 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 44/74] sev: convert OnOffAuto legacy-vm-type property to QAPI-aware registration Date: Mon, 2 Nov 2026 15:39:48 +0100 Message-ID: <20261102144018.3212223-45-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793631004144154100 From: Marc-Andr=C3=A9 Lureau Convert the legacy-vm-type OnOffAuto property from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-28-armbru@redhat.com> --- target/i386/sev.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 74a7b719b5..d19f98e1c7 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -20,6 +20,7 @@ #include =20 #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "qom/object_interfaces.h" #include "qemu/base64.h" #include "qemu/module.h" @@ -2982,23 +2983,16 @@ sev_guest_set_session_file(Object *obj, const char = *value, Error **errp) SEV_GUEST(obj)->session_file =3D g_strdup(value); } =20 -static void sev_guest_get_legacy_vm_type(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static int sev_guest_get_legacy_vm_type(Object *obj, Error **errp) { SevGuestState *sev_guest =3D SEV_GUEST(obj); - OnOffAuto legacy_vm_type =3D sev_guest->legacy_vm_type; - - visit_type_OnOffAuto(v, name, &legacy_vm_type, errp); + return sev_guest->legacy_vm_type; } =20 -static void sev_guest_set_legacy_vm_type(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void sev_guest_set_legacy_vm_type(Object *obj, int value, Error **e= rrp) { SevGuestState *sev_guest =3D SEV_GUEST(obj); - - visit_type_OnOffAuto(v, name, &sev_guest->legacy_vm_type, errp); + sev_guest->legacy_vm_type =3D value; } =20 static void @@ -3024,9 +3018,10 @@ sev_guest_class_init(ObjectClass *oc, const void *da= ta) sev_guest_set_session_file); object_class_property_set_description(oc, "session-file", "guest owners session parameters (encoded with base64)"); - object_class_property_add(oc, "legacy-vm-type", "OnOffAuto", NULL, - sev_guest_get_legacy_vm_type, - sev_guest_set_legacy_vm_type, NULL, NULL); + object_class_property_add_enum(oc, "legacy-vm-type", "OnOffAuto", + &OnOffAuto_type_info, NULL, + sev_guest_get_legacy_vm_type, + sev_guest_set_legacy_vm_type); object_class_property_set_description(oc, "legacy-vm-type", "use legacy VM type to maintain measurement compatibility with= older QEMU or kernel versions."); } --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793631234; cv=none; d=zohomail.com; s=zohoarc; b=Xt8IwhpLBAKDIFmWPBmwEF9um4JUART+Po5lJ7jJURytIFY1OEm0nlQM2IsMQwfiWq94/0Hud/w5s5C2ukw0b427jZQXun/4GlACkwxmCgrYm8PJSNqduEHe3Fssrx2q6LITdoySpDs420nshA9Q2U0uQ1CvL6oqlKVc7c1MntU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631234; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nU2m0Yh5dgHX5E7G0VlGkuDAQsdpUta0MyDC1metLxQ=; b=FrKZZxLHU8ySvBPxQxc7+/15pwmVADLz/iYcri8vHV04p1VpXn/a2jesrwuFpolA1lgyF/wuNXx6S2G/b6SULjNe8tXhI3RKYgEiEPZUGn8CN8iOgLVY8YFCRxkPQx7GTv3+ZtqdCQt81fQ+uJqlcgolR4PKxeoM2cRkcK23w+w= 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 1793631234178478.89271702024564; Mon, 2 Nov 2026 06:53:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtEO-0004nE-M9; Mon, 02 Nov 2026 09:42:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDJ-0003HG-8m for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDA-0008Ut-Ud for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:44 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-449-QrO3MR0jNUW60CxjswoSpA-1; Mon, 02 Nov 2026 09:40:32 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0D282180049D; Mon, 2 Nov 2026 14:40:31 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B4AC2410; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id ABCB521E6839; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nU2m0Yh5dgHX5E7G0VlGkuDAQsdpUta0MyDC1metLxQ=; b=IWCpMLe2iS+9F6unQ9IwUL8k37B+3xbQ9cJ1jqRnJsGfeCgdESNk842FumdJP0uDlP85ox PsniWmMQ9fGIGtbuv5JgB9VrRDZKc9xyBXajwyTsWr+DL3Q6mtSt/qdcdtCLZh69K0Y0zx 3Z7NbHRVCUTqoH5pTerj+05sQAsKZls= X-MC-Unique: QrO3MR0jNUW60CxjswoSpA-1 X-Mimecast-MFC-AGG-ID: QrO3MR0jNUW60CxjswoSpA_1793630431 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 45/74] whpx: convert OnOffAuto hyperv property to QAPI-aware registration Date: Mon, 2 Nov 2026 15:39:49 +0100 Message-ID: <20261102144018.3212223-46-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793631235726154100 From: Marc-Andr=C3=A9 Lureau Convert the hyperv OnOffAuto property from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-29-armbru@redhat.com> --- accel/whpx/whpx-common.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c index f82e607745..3447c52fb1 100644 --- a/accel/whpx/whpx-common.c +++ b/accel/whpx/whpx-common.c @@ -22,6 +22,7 @@ #include "qemu/error-report.h" #include "qapi/error.h" #include "qapi/qapi-types-common.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qapi-visit-common.h" #include "migration/blocker.h" #include "accel/accel-cpu-target.h" @@ -470,18 +471,11 @@ static void whpx_set_kernel_irqchip(Object *obj, Visi= tor *v, } } =20 -static void whpx_set_hyperv(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_hyperv(Object *obj, int value, Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffAuto mode; =20 - if (!visit_type_OnOffAuto(v, name, &mode, errp)) { - return; - } - - switch (mode) { + switch (value) { case ON_OFF_AUTO_ON: whpx->hyperv_enlightenments_allowed =3D true; whpx->hyperv_enlightenments_required =3D true; @@ -497,11 +491,7 @@ static void whpx_set_hyperv(Object *obj, Visitor *v, whpx->hyperv_enlightenments_required =3D false; break; default: - /* - * The value was checked in visit_type_OnOffAuto() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 @@ -533,9 +523,9 @@ static void whpx_accel_class_init(ObjectClass *oc, cons= t void *data) NULL, NULL); object_class_property_set_description(oc, "kernel-irqchip", "Configure WHPX in-kernel irqchip"); - object_class_property_add(oc, "hyperv", "OnOffAuto", NULL, - NULL, whpx_set_hyperv, - NULL, NULL); + object_class_property_add_enum(oc, "hyperv", "OnOffAuto", + &OnOffAuto_type_info, NULL, + NULL, whpx_set_hyperv); object_class_property_set_description(oc, "hyperv", "Configure Hyper-V enlightenments"); =20 --=20 2.55.0 From nobody Mon Nov 23 04:28:00 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=1793630643; cv=none; d=zohomail.com; s=zohoarc; b=cQYR/o8lcTKaFnIbGjW9M0kG6aqGY6NYjyEqamjeJbOuVJDOFxNppisBgZWzOEtTIiN4O/8OKvfYAIhpudJhLgIqMcXY9ojmoDpVEEsWzdPte1zTxhQJRURGxvlCzqwW17AogIGdlZphRrLC4sPdtcXLnv/lBDfvX6fDCe1hVak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630643; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GXA7kp9FKVpEc3owtkP7EX+ANDz9pYk4uyTaAYljun0=; b=RPOu5q6zAkBfHSIgKjLBs/iih4qwsjbM8w3p03rPXaj4SdXqEaVzcIXRNsu1lz+Ev188XiNtQfzMRwffsu4J2alpfmzpsVuk4q8RARM8g7EsJilA+TNJ3jElqZEwGUBy+70/4tfXFU0FZU8rBnQXmee1xDksh14dcKwhTxVDtRM= 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 1793630643820542.52355708656; Mon, 2 Nov 2026 06:44:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDk-0003V9-Nj; Mon, 02 Nov 2026 09:41:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDH-0003G1-Pe for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD9-0008UD-7v for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:42 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-232-fTzuLUfMNoS8buK6ZQbxCA-1; Mon, 02 Nov 2026 09:40:31 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 449321805A0F; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B92FB1803A44; Mon, 2 Nov 2026 14:40:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id B010121E683B; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GXA7kp9FKVpEc3owtkP7EX+ANDz9pYk4uyTaAYljun0=; b=Y8QXnSGLmbWD6pDEMS33FWjLNK7yISPMYVNWJS8OEGRlJkdmP/d5wJn5DcWCn85gsrSErZ MHy68Gr801I+wglx4N4PZTha+LQuZg8R7wyLdbAFtm4fWGy3/UQFu3L/dYKzD7mTsge/ir FKVWzzh3pgmF1NrFGcab3w9fGRzKnhE= X-MC-Unique: fTzuLUfMNoS8buK6ZQbxCA-1 X-Mimecast-MFC-AGG-ID: fTzuLUfMNoS8buK6ZQbxCA_1793630430 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 46/74] whpx: convert OnOffAuto arch properties to QAPI-aware registration Date: Mon, 2 Nov 2026 15:39:50 +0100 Message-ID: <20261102144018.3212223-47-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630646665154100 From: Marc-Andr=C3=A9 Lureau Convert the ignore-unknown-msr, intercept-msr-gp, and ssd OnOffAuto properties from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-30-armbru@redhat.com> --- target/i386/whpx/whpx-all.c | 84 ++++++++++--------------------------- 1 file changed, 23 insertions(+), 61 deletions(-) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 778da68bf4..c459138c7e 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -30,7 +30,7 @@ #include "qemu/error-report.h" #include "qapi/error.h" #include "qapi/qapi-types-common.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "migration/blocker.h" #include "host-cpu.h" #include "accel/accel-cpu-target.h" @@ -1875,6 +1875,7 @@ void whpx_apply_breakpoints( } } =20 + void whpx_arch_destroy_vcpu(CPUState *cpu) { X86CPU *x86cpu =3D X86_CPU(cpu); @@ -1955,7 +1956,7 @@ static int whpx_handle_hyperv_guestidle(CPUState *cpu) return whpx_handle_halt(cpu); } =20 -static void whpx_vcpu_kick_out_of_hlt(CPUState *cpu)=20 +static void whpx_vcpu_kick_out_of_hlt(CPUState *cpu) { WHV_REGISTER_VALUE reg; whpx_get_reg(cpu, WHvRegisterInternalActivityState, ®); @@ -2059,7 +2060,7 @@ static void whpx_vcpu_pre_run(CPUState *cpu) .Vector =3D irq, }; reg_count +=3D 1; - /*=20 + /* * When the Hyper-V APIC is enabled, to get out of HLT we * either have to request an interrupt or manually get it away * from HLT. @@ -2359,7 +2360,7 @@ int whpx_vcpu_run(CPUState *cpu) WHV_REGISTER_VALUE reg_values[3] =3D {0}; WHV_REGISTER_NAME reg_names[3]; UINT32 reg_count; - bool is_known_msr =3D 0;=20 + bool is_known_msr =3D 0; bool raises_gpf =3D false; uint64_t val; =20 @@ -2911,118 +2912,79 @@ void whpx_cpu_instance_init(CPUState *cs) * Partition support */ =20 -static void whpx_set_unknown_msr(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_unknown_msr(Object *obj, int value, Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffAuto mode; =20 - if (!visit_type_OnOffAuto(v, name, &mode, errp)) { - return; - } - - switch (mode) { + switch (value) { case ON_OFF_AUTO_ON: whpx->ignore_unknown_msr =3D true; break; - case ON_OFF_AUTO_OFF: whpx->ignore_unknown_msr =3D false; break; - case ON_OFF_AUTO_AUTO: whpx->ignore_unknown_msr =3D true; break; default: - /* - * The value was checked in visit_type_OnOffAuto() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 -static void whpx_set_intercept_msr_gp(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_intercept_msr_gp(Object *obj, int value, Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffAuto mode; =20 - if (!visit_type_OnOffAuto(v, name, &mode, errp)) { - return; - } - - switch (mode) { + switch (value) { case ON_OFF_AUTO_ON: whpx->intercept_msr_gp =3D true; break; - case ON_OFF_AUTO_OFF: whpx->intercept_msr_gp =3D false; break; - case ON_OFF_AUTO_AUTO: whpx->intercept_msr_gp =3D false; break; default: - /* - * The value was checked in visit_type_OnOffAuto() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 -static void whpx_set_ssd(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_ssd(Object *obj, int value, Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffAuto mode; =20 - if (!visit_type_OnOffAuto(v, name, &mode, errp)) { - return; - } - - switch (mode) { + switch (value) { case ON_OFF_AUTO_ON: whpx->separate_security_domain =3D true; break; - case ON_OFF_AUTO_OFF: whpx->separate_security_domain =3D false; break; - case ON_OFF_AUTO_AUTO: whpx->separate_security_domain =3D true; break; default: - /* - * The value was checked in visit_type_OnOffAuto() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 =20 void whpx_arch_accel_class_init(ObjectClass *oc) { - object_class_property_add(oc, "ignore-unknown-msr", "OnOffAuto", NULL, - NULL, whpx_set_unknown_msr, - NULL, NULL); + object_class_property_add_enum(oc, "ignore-unknown-msr", "OnOffAuto", + &OnOffAuto_type_info, NULL, + NULL, whpx_set_unknown_msr); object_class_property_set_description(oc, "ignore-unknown-msr", "Configure unknown MSR behavior"); - object_class_property_add(oc, "intercept-msr-gp", "OnOffAuto", NULL, - NULL, whpx_set_intercept_msr_gp, - NULL, NULL); + object_class_property_add_enum(oc, "intercept-msr-gp", "OnOffAuto", + &OnOffAuto_type_info, NULL, + NULL, whpx_set_intercept_msr_gp); object_class_property_set_description(oc, "intercept-msr-gp", "Intercept #GP to log erroring MSR accesses."); - object_class_property_add(oc, "ssd", "OnOffAuto", NULL, - NULL, whpx_set_ssd, - NULL, NULL); + object_class_property_add_enum(oc, "ssd", "OnOffAuto", + &OnOffAuto_type_info, NULL, + NULL, whpx_set_ssd); object_class_property_set_description(oc, "ssd", "Separate security domain"); } --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793631097; cv=none; d=zohomail.com; s=zohoarc; b=f5iWkZvOYKaGFwrt/HRBwCxRRJKwSxqMQsF192ZVvIInO1JnLOgDciAlAxojxFk4OFVj6zvwXO1RcVA38ifXQvt2jQc1tCSPrMVIEyLyqt44mTnBAKoKjHVLY9o1N1AVjHhxYRbS3N2RCHFlLai5/UffR36tBCOCJqAB8ZiUqp8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631097; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=s7Ny4UvCJy959x6nPNWEMWV44Dc6e7yG0eU+2DtHjJY=; b=UB9AEzv2KSTh/9YSL2yQUkVA5ZDPMdLpHkFJvA8jk69shAq2QHB1OXghYIIKtBjOqCXjxWZLOf+J7G5xZa7Wgo/1+KmULs9wzBAqKbDeef8j1j77Jket0dxEbnRjq18/fTIEKUww1HxgNiMKVWSB88F+XXqUqvmxQHG/C3r3nSw= 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 1793631097097655.2832972839377; Mon, 2 Nov 2026 06:51:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtFP-0007Py-0V; Mon, 02 Nov 2026 09:42:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDH-0003G0-PZ for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD9-0008UX-LI for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:42 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-118-YoyTlRtSMRW6pFdc6clvrw-1; Mon, 02 Nov 2026 09:40:31 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 77858195DE24; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 367361955F0A; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id B447A21E683C; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=s7Ny4UvCJy959x6nPNWEMWV44Dc6e7yG0eU+2DtHjJY=; b=WawoC9DghiEEyvKYt6/rfRnsRzj7ScCcilP7KCGU4IlPYOLJO6cMmcQiq43i9yVS5NpPX+ VYP7wakyoKMpAZyFYhM/dNcj6XhF9lU6BQJmSXV0j7fFS1SIfCbOZFcw7Tvwj6h4ugVugh 5n+5QR8EH0SD+KAkrumPuCQsvynRSdk= X-MC-Unique: YoyTlRtSMRW6pFdc6clvrw-1 X-Mimecast-MFC-AGG-ID: YoyTlRtSMRW6pFdc6clvrw_1793630430 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 47/74] accel/kvm: convert OnOffSplit property to QAPI-aware registration Date: Mon, 2 Nov 2026 15:39:51 +0100 Message-ID: <20261102144018.3212223-48-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793631099556154100 From: Marc-Andr=C3=A9 Lureau Convert the OnOffSplit property from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-31-armbru@redhat.com> --- accel/kvm/kvm-all.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 9cc1e4b0a9..fe11cd92b4 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -46,6 +46,7 @@ #include "qapi/visitor.h" #include "qapi/qapi-types-common.h" #include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "system/reset.h" #include "qemu/guest-random.h" #include "system/hw_accel.h" @@ -4151,22 +4152,17 @@ static void kvm_set_kvm_shadow_mem(Object *obj, Vis= itor *v, s->kvm_shadow_mem =3D value; } =20 -static void kvm_set_kernel_irqchip(Object *obj, Visitor *v, - const char *name, void *opaque, +static void kvm_set_kernel_irqchip(Object *obj, int value, Error **errp) { KVMState *s =3D KVM_STATE(obj); - OnOffSplit mode; =20 if (s->fd !=3D -1) { error_setg(errp, "Cannot set properties after the accelerator has = been initialized"); return; } =20 - if (!visit_type_OnOffSplit(v, name, &mode, errp)) { - return; - } - switch (mode) { + switch (value) { case ON_OFF_SPLIT_ON: s->kernel_irqchip_allowed =3D true; s->kernel_irqchip_required =3D true; @@ -4183,10 +4179,7 @@ static void kvm_set_kernel_irqchip(Object *obj, Visi= tor *v, s->kernel_irqchip_split =3D ON_OFF_AUTO_ON; break; default: - /* The value was checked in visit_type_OnOffSplit() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 @@ -4303,9 +4296,9 @@ static void kvm_accel_class_init(ObjectClass *oc, con= st void *data) ac->has_memory =3D kvm_accel_has_memory; ac->allowed =3D &kvm_allowed; =20 - object_class_property_add(oc, "kernel-irqchip", "on|off|split", NULL, - NULL, kvm_set_kernel_irqchip, - NULL, NULL); + object_class_property_add_enum(oc, "kernel-irqchip", "on|off|split", + &OnOffSplit_type_info, NULL, + NULL, kvm_set_kernel_irqchip); object_class_property_set_description(oc, "kernel-irqchip", "Configure KVM in-kernel irqchip"); =20 --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630671; cv=none; d=zohomail.com; s=zohoarc; b=A9Uviy9/2Tm4dI7ZcK6O8LQnK9feOa4uawwNSqbLB5GqC7k/egc43AJinYXCBkni+kxDjojO02WV+QaRJcQ8cEx7poPYMKmiBGN2+bWiwIIW1cnnm+Wm077Yd52djBF17c65+IsvrbNx7ZnBYVbQy+Lwq4R9gp1S6RqmvaKLbAQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630671; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=G6MEz1cFLOwu1UTys8IxZ2XvGpvHifbnnPa41oQJJ/o=; b=ef/LF3SVL0VCJhLiGzJ2lPeR+rBUAo7T6q4lDwkHMN9zSeeRVH4hnzFc6R94TRqYydC4kuI407AW1e+P8NtJw4rvxVaHX0krf1PIWVqi5kSIV0APzbgMtNM0cte4zmeiYTh3SGNYZZMClWy8Ovc7ZPzNrujTcQVz/Dlg3VXEUWA= 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 1793630671726200.65361819317275; Mon, 2 Nov 2026 06:44:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtEy-00056o-1I; Mon, 02 Nov 2026 09:42:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDH-0003G3-Q8 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD9-0008UQ-Ir for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:42 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-363-ljewE3K3PjWd-izO0gezxw-1; Mon, 02 Nov 2026 09:40:31 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5C6CE180A9DF; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1670B1956049; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id B898521E683D; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=G6MEz1cFLOwu1UTys8IxZ2XvGpvHifbnnPa41oQJJ/o=; b=X/xStdXJsW9iXZ/K1hZQ0lck7+GozWRj+PABHBGjVqxFboF7lkItP2YASPq3LDgRnksQFU v9vQbi+rl2VYp5OAZTxx44xR+RCidmnrUjWgqw4tJOQKezQxa6UAtQ0nqXl2oSMba1evyT fuk8BdPY9la491ioXEDNHibf0NEfXwU= X-MC-Unique: ljewE3K3PjWd-izO0gezxw-1 X-Mimecast-MFC-AGG-ID: ljewE3K3PjWd-izO0gezxw_1793630430 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 48/74] whpx: convert OnOffSplit property to QAPI-aware registration Date: Mon, 2 Nov 2026 15:39:52 +0100 Message-ID: <20261102144018.3212223-49-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630674844154100 From: Marc-Andr=C3=A9 Lureau Convert the OnOffSplit property from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-32-armbru@redhat.com> --- accel/whpx/whpx-common.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c index 3447c52fb1..068258bf6c 100644 --- a/accel/whpx/whpx-common.c +++ b/accel/whpx/whpx-common.c @@ -434,18 +434,12 @@ error: return false; } =20 -static void whpx_set_kernel_irqchip(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_kernel_irqchip(Object *obj, int value, + Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffSplit mode; =20 - if (!visit_type_OnOffSplit(v, name, &mode, errp)) { - return; - } - - switch (mode) { + switch (value) { case ON_OFF_SPLIT_ON: whpx->kernel_irqchip_allowed =3D true; whpx->kernel_irqchip_required =3D true; @@ -463,11 +457,7 @@ static void whpx_set_kernel_irqchip(Object *obj, Visit= or *v, break; =20 default: - /* - * The value was checked in visit_type_OnOffSplit() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 @@ -518,9 +508,9 @@ static void whpx_accel_class_init(ObjectClass *oc, cons= t void *data) ac->pre_resume_vm =3D whpx_pre_resume_vm; ac->allowed =3D &whpx_allowed; =20 - object_class_property_add(oc, "kernel-irqchip", "on|off|split", NULL, - NULL, whpx_set_kernel_irqchip, - NULL, NULL); + object_class_property_add_enum(oc, "kernel-irqchip", "on|off|split", + &OnOffSplit_type_info, NULL, + NULL, whpx_set_kernel_irqchip); object_class_property_set_description(oc, "kernel-irqchip", "Configure WHPX in-kernel irqchip"); object_class_property_add_enum(oc, "hyperv", "OnOffAuto", --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630679; cv=none; d=zohomail.com; s=zohoarc; b=OcfUQzuljF0epYKFE0WLoJ5aD9HHPVk+Cr4DqsKUugW7zt2QXX6AMeFYppXjXbsvkjK8ACO/XBbwoIL4MI+rSyukounWsr49w83HFa46MQXeF6iekeLTcPvKLjm4rAapvxfBTNcjcpl2NcM6TYQ3Fgyog+HodjfaQjZO0Xjin4Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630679; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yzXKfDHUTtIZcll3ugPgEaTC6yVMEkW+rehx/GBiCUY=; b=Mk4UmREYHh9yi3sgcIIaNwgXMywYF9HVjujUqx7QMEdIjRF5Bez9Z3+0NefrSTdGbXYwO821M9yWDoMFdV18eb+eFBA4Sn6D9royuM5fRrT6qyPsS43Wdlt/MvI4PXTDXMzfKL1TyJdIH+hjxY/xqXsgZznpFLjeBn2LHJGl8RE= 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 1793630679003143.03138765088693; Mon, 2 Nov 2026 06:44:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDk-0003V8-Il; Mon, 02 Nov 2026 09:41:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDH-0003G6-Rz for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD9-0008Tm-0b for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:41 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-86-p4BYQSqaNF-JlDu19SGIKQ-1; Mon, 02 Nov 2026 09:40:31 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BA60E180A8FC; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 290857E6; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id BCFDD21E683E; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yzXKfDHUTtIZcll3ugPgEaTC6yVMEkW+rehx/GBiCUY=; b=Ms//vO/16gylbrejK2alBqpOAZ3dVIAVQqWXEGBjvh+z5gYWS3qrasS+6xIo+NcC02ZgR3 UppEiV+4AA1d3s7FQ95yUgKJT3aVaZ0rE1wVSd8oRWc+PAtmduozqIQcOKBA4JH8pSFjJM BpJkGmVJ/k082DyrjyWG/mfk8ySFHvQ= X-MC-Unique: p4BYQSqaNF-JlDu19SGIKQ-1 X-Mimecast-MFC-AGG-ID: p4BYQSqaNF-JlDu19SGIKQ_1793630430 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Amit Machhiwal Subject: [PULL 49/74] ppc/spapr-caps: convert to QAPI-aware property registration Date: Mon, 2 Nov 2026 15:39:53 +0100 Message-ID: <20261102144018.3212223-50-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630679965158500 From: Marc-Andr=C3=A9 Lureau Add QAPITypeInfo to SpaprCapabilityInfo, and make spapr_caps_add_properties() pass it to object_class_property_add(). Reviewed-by: Amit Machhiwal Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-33-armbru@redhat.com> --- hw/ppc/spapr_caps.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index b8c48bca8a..79b1cc2e1d 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu/error-report.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "system/hw_accel.h" @@ -60,6 +61,7 @@ typedef struct SpaprCapabilityInfo { ObjectPropertyAccessor *get; ObjectPropertyAccessor *set; const char *type; + const QAPITypeInfo *qapi_type; /* Possible values if this is a custom string type */ SpaprCapPossible *possible; /* Make sure the virtual hardware can support this capability */ @@ -726,6 +728,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_htm_apply, }, [SPAPR_CAP_VSX] =3D { @@ -735,6 +738,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_vsx_apply, }, [SPAPR_CAP_DFP] =3D { @@ -744,6 +748,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_dfp_apply, }, [SPAPR_CAP_CFPC] =3D { @@ -753,6 +758,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_string, .set =3D spapr_cap_set_string, .type =3D "string", + .qapi_type =3D &str_type_info, .possible =3D &cap_cfpc_possible, .apply =3D cap_safe_cache_apply, }, @@ -763,6 +769,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_string, .set =3D spapr_cap_set_string, .type =3D "string", + .qapi_type =3D &str_type_info, .possible =3D &cap_sbbc_possible, .apply =3D cap_safe_bounds_check_apply, }, @@ -775,6 +782,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_string, .set =3D spapr_cap_set_string, .type =3D "string", + .qapi_type =3D &str_type_info, .possible =3D &cap_ibs_possible, .apply =3D cap_safe_indirect_branch_apply, }, @@ -785,6 +793,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_pagesize, .set =3D spapr_cap_set_pagesize, .type =3D "int", + .qapi_type =3D &size_type_info, .apply =3D cap_hpt_maxpagesize_apply, .cpu_apply =3D cap_hpt_maxpagesize_cpu_apply, }, @@ -795,6 +804,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_nested_kvm_hv_apply, }, [SPAPR_CAP_NESTED_PAPR] =3D { @@ -804,6 +814,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_nested_papr_apply, }, [SPAPR_CAP_LARGE_DECREMENTER] =3D { @@ -813,6 +824,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_large_decr_apply, .cpu_apply =3D cap_large_decr_cpu_apply, }, @@ -823,6 +835,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_ccf_assist_apply, }, [SPAPR_CAP_FWNMI] =3D { @@ -832,6 +845,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_fwnmi_apply, }, [SPAPR_CAP_RPT_INVALIDATE] =3D { @@ -841,6 +855,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_rpt_invalidate_apply, }, [SPAPR_CAP_AIL_MODE_3] =3D { @@ -850,6 +865,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_ail_mode_3_apply, }, [SPAPR_CAP_DAWR1] =3D { @@ -859,6 +875,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, .type =3D "bool", + .qapi_type =3D &bool_type_info, .apply =3D cap_dawr1_apply, }, }; @@ -1069,7 +1086,7 @@ void spapr_caps_add_properties(SpaprMachineClass *smc) g_autofree char *name =3D g_strdup_printf("cap-%s", cap->name); g_autofree char *desc =3D g_strdup(cap->description); =20 - object_class_property_add(klass, name, cap->type, NULL, + object_class_property_add(klass, name, cap->type, cap->qapi_type, cap->get, cap->set, NULL, cap); =20 --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630707; cv=none; d=zohomail.com; s=zohoarc; b=Xww2pJKaGa6l3AYKYoHuhar49BU4eLU032fPC2tiUvWwnKkZf23vCd4xgu/1jTEbPnLVKlCrAI/IB+mx8w358divQUts0HEAu4xCAPL/FUsOR1ytBTyqh862uTaVQmkU/igJE70KWFQEOH34duRGrix1scNUIYQSZW4NFGDtINo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630707; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DPep5vr/8NCGioZTw79cbvzENbN9vrors44lCTL4hDA=; b=SLQtngMXW5549ZrNkIFGnBy7SgvPYTGAbMZpqVa5PADubuJnvMzB8mNas7bRSfakMgkMXgT+yfPzEbdKBkmMuHsUwAIH/xxnumUBxJ27F1pll/a31036LEXpgWkzy9KtSzHOJS4+C+UOZVOSYmX6vXEjYpH3iSyie72tNwnTeAs= 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 1793630707602984.6105214787497; Mon, 2 Nov 2026 06:45:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDe-0003Qk-Gg; Mon, 02 Nov 2026 09:41:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDB-0003D0-6g for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0008TR-9g for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:36 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-86-rLk-YAxDPVGuqj7v2RBZ_g-1; Mon, 02 Nov 2026 09:40:31 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8FFA2195BDF0; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 509D21800347; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C137421E683F; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DPep5vr/8NCGioZTw79cbvzENbN9vrors44lCTL4hDA=; b=R8ojH2cU7W1WgITFkdn9XD7b4gAqNEM62Fgyq0dSo4rGUncgSLd6PnscC0RGR/sH/vDxdh 7gR+3g/H82hoBbZ7VibQbSJ6hpUSBQvjdzhLJqBAQjQUAISYyyEIZ18aGIHeuXlYgw6v22 lX270fsbW0QBXIGUiJD3DyfdGxNd55Y= X-MC-Unique: rLk-YAxDPVGuqj7v2RBZ_g-1 X-Mimecast-MFC-AGG-ID: rLk-YAxDPVGuqj7v2RBZ_g_1793630430 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 50/74] net/colo-compare: fix compare_timeout setter visitor type Date: Mon, 2 Nov 2026 15:39:54 +0100 Message-ID: <20261102144018.3212223-51-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630710703158500 From: Marc-Andr=C3=A9 Lureau The setter was using visit_type_uint32, truncating the value, while the getter and typename use uint64. Use visit_type_uint64 consistently. Fixes: 0c4266ef2690 ("net/colo-compare.c: Fix compare_timeout format issue") Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-34-armbru@redhat.com> --- net/colo-compare.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 7d4a2db522..a9c6cca5e1 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -1075,9 +1075,9 @@ static void compare_set_timeout(Object *obj, Visitor = *v, Error **errp) { CompareState *s =3D COLO_COMPARE(obj); - uint32_t value; + uint64_t value; =20 - if (!visit_type_uint32(v, name, &value, errp)) { + if (!visit_type_uint64(v, name, &value, errp)) { return; } if (!value) { --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630595; cv=none; d=zohomail.com; s=zohoarc; b=Ai9Bcls/+dpqmTyH7fsQzD0dNqzoOb90MCoEZKok92SqW0kWWtINNPaISaXGx2ByWhsCoRMfiQEBKwNryzNKD2sCLivEaE+I8VTNvBd2i2lAfgrhup8RYWs4oRpqGQdfB8+6WzRy0ynkyYkysybAyxx2nwRisW/gplcEOvo2dD4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630595; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UkO1Zo2bHx/UoA2ROy1uaJ3Bvjqi/TP11BUdnNreuU4=; b=ELEmvflVR54Rd66z2z44GDl74Y0P63VuZ74GMQB8I2SvXmtlT+0Ip7/u9du3AFIYBQWLdW2MEECdFLGp3zgiuVQQgFo525bSpBBTnV06baZ0DxMMrv+MjtBLaq6Lfz0ewpgA/I5HlrhOMHyKxb/HcgMHqVIlxdhjlHaXbNGDcEQ= 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 179363059587266.72680637566987; Mon, 2 Nov 2026 06:43:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtEK-0004l8-7Q; Mon, 02 Nov 2026 09:41:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDH-0003G7-S6 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0008T2-EP for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-423-ergpGdC8P2KXLIAWTldkYA-1; Mon, 02 Nov 2026 09:40:31 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5C250180AEBE; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 16C571800444; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C57BC21E66D7; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UkO1Zo2bHx/UoA2ROy1uaJ3Bvjqi/TP11BUdnNreuU4=; b=O1osAJbHZF7Ay2PsnJj8cZjChX431eW2fzWtQJdfIpn812A9iG6GdQNZ9ooFB0V9KxYiz+ 4Hv/ZPsA20v7CwIAEfIeMN3RSZxcKS8z9uh1Be8R7/ncsyfGfm1FCmEs+OgU8W6duGGY0k TPwxswH+CXjxZq1AgMkVmUX2W3jsbGU= X-MC-Unique: ergpGdC8P2KXLIAWTldkYA-1 X-Mimecast-MFC-AGG-ID: ergpGdC8P2KXLIAWTldkYA_1793630430 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 51/74] net/colo-compare: fix max_queue_size setter visitor type Date: Mon, 2 Nov 2026 15:39:55 +0100 Message-ID: <20261102144018.3212223-52-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630597652154100 From: Marc-Andr=C3=A9 Lureau The setter was using visit_type_uint64, accepting values wider than the uint32_t field. Use visit_type_uint32 to match the getter, field, and typename. Fixes: 0c4266ef2690 ("net/colo-compare.c: Fix compare_timeout format issue") Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-35-armbru@redhat.com> --- net/colo-compare.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index a9c6cca5e1..6bc43e0696 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -1129,9 +1129,9 @@ static void set_max_queue_size(Object *obj, Visitor *= v, const char *name, void *opaque, Error **errp) { - uint64_t value; + uint32_t value; =20 - if (!visit_type_uint64(v, name, &value, errp)) { + if (!visit_type_uint32(v, name, &value, errp)) { return; } if (!value) { --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630558; cv=none; d=zohomail.com; s=zohoarc; b=HmhVlV9PmsVr5pjQgiOzfBb/CnVZMr6nEwRgkQV+4oe2/E3L7oN8et0tq8NkxniasezHAZx9xiSBTOOenfEesXJu3hdct/HwAJPSr64nCd1As4UbUcjLW/aRmC+AgwLQiQrUbrmExWCLwaO97wWetXjzohHeeziU1/jwA3xlgjI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630558; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tPPauJnjUL8+o9J/As9+2TU1FvW5xFz73JCg7sYruek=; b=fkCsmDl6MJQAmTc9VvD7iYYybM/dcM7w5Pf19kj2t332L8PnykSbEgZ3UiuWHVCqkVxDNn+tL0lqTGCaeTFkp4X5KWzrzp/2vC8d038Kooi5f5RS4jReERYsWPLino7r5PpOdD8NqmMNyau2O4n6yOX+4Qih8vMHy6+D+fzR43o= 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 1793630558222141.88447006221145; Mon, 2 Nov 2026 06:42:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDe-0003Qs-MM; Mon, 02 Nov 2026 09:41:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDC-0003DQ-8I for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0008TD-Bg for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:37 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-237-iKakli4SMqWPKYxua4Zi6w-1; Mon, 02 Nov 2026 09:40:31 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 94D0C19540E2; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 506A41800345; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C9C9821E66D8; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tPPauJnjUL8+o9J/As9+2TU1FvW5xFz73JCg7sYruek=; b=DwTDR0kaFl4LSHtdxxG4uXTH9W02rcPeMGoKt6/6nyo9f7yvLHTjlEdipXfaVu81jGy5yo RgR66cmj+tg01tGnnweIUuaT7apoBz9NE8JOSIYDRtXHf7LEA2STq/44FGKUAfFaZCWI1G ceEnDXzhXYfc0KDSxLTzSkMxL6qu+2Q= X-MC-Unique: iKakli4SMqWPKYxua4Zi6w-1 X-Mimecast-MFC-AGG-ID: iKakli4SMqWPKYxua4Zi6w_1793630430 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 52/74] hw/misc/xlnx-versal-trng: add missing getter for fips-fault-events Date: Mon, 2 Nov 2026 15:39:56 +0100 Message-ID: <20261102144018.3212223-53-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630561170154100 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-36-armbru@redhat.com> --- hw/misc/xlnx-versal-trng.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/misc/xlnx-versal-trng.c b/hw/misc/xlnx-versal-trng.c index aa1d65de7b..0584ee089e 100644 --- a/hw/misc/xlnx-versal-trng.c +++ b/hw/misc/xlnx-versal-trng.c @@ -650,10 +650,22 @@ static void trng_prop_fault_event_set(Object *obj, Vi= sitor *v, trng_fault_event_set(XLNX_VERSAL_TRNG(obj), *events); } =20 +static void trng_prop_fault_event_get(Object *obj, Visitor *v, + const char *name, + void *opaque, + Error **errp) +{ + const Property *prop =3D opaque; + uint32_t *events =3D object_field_prop_ptr(obj, prop); + + visit_type_uint32(v, name, events, errp); +} + static const PropertyInfo trng_prop_fault_events =3D { .type =3D "uint32", .description =3D "Set to trigger TRNG fault events", .set =3D trng_prop_fault_event_set, + .get =3D trng_prop_fault_event_get, .realized_set_allowed =3D true, }; =20 --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630604; cv=none; d=zohomail.com; s=zohoarc; b=DxNbb/lbiog/cXSpg+ZPBAkNk9M4r0tRhrBc/bZAPzhZq9RgkPVZKoBJhJxEcrRiXPnkocX2FdNEbubpX1NbWd9AQu2aMsbw6vmDoZxt17eRvB11SS0+cijNoU/H9eOMnvDke5zFdhBlrlCT5Ds4aaEtUp2x1RunyMEY/q3IAzM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630604; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NOJF5UTnTpUwQ1t7aTchNiAiS1cSQsEz5BjAXcFsyGo=; b=KHJQMKjkNuN6NotcO8l0OWPOnQNDnO9u29lkp2V9lqL9CYcZ3hS5GbDU8oA/UnxeE+5pMw71yjsANSgD3zpscE4AA20Nngg9tn7Xdif02a788apWpkENrYbjDm1cyjhdTK3MSdtXRRt7ADeuQmfCaEMRXJfohrLSUnxf8s15jO4= 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 1793630604391220.81318272005876; Mon, 2 Nov 2026 06:43:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtFM-0007JD-QO; Mon, 02 Nov 2026 09:42:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDR-0003KI-Jf for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDC-0008V0-9N for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:53 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-503-pZqwjMv5NmiumCd8NMSPng-1; Mon, 02 Nov 2026 09:40:32 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 95C4A1802159; Mon, 2 Nov 2026 14:40:31 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8A381195608B; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id CF51521E66E5; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NOJF5UTnTpUwQ1t7aTchNiAiS1cSQsEz5BjAXcFsyGo=; b=MMW+we2Ed0/Zb3sLbqJVjOsS7F3B+qScG94H8DqDlY0MP9qHL6Ivo7oWKg99I4rJuWPJ3L CIAY3c+EcigUl3c+Q8HlOyKhb+beHrS755xp23FDDClFUizeNCkMMlVuUfKsaNW5fpiu6Y PRnP24C1DvxrdGLKxooq/4TQxFrANo0= X-MC-Unique: pZqwjMv5NmiumCd8NMSPng-1 X-Mimecast-MFC-AGG-ID: pZqwjMv5NmiumCd8NMSPng_1793630431 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Amit Machhiwal Subject: [PULL 53/74] qom: convert scalar properties to QAPI-aware registration Date: Mon, 2 Nov 2026 15:39:57 +0100 Message-ID: <20261102144018.3212223-54-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630607833154100 From: Marc-Andr=C3=A9 Lureau Pass appropriate QAPITypeInfo to object_class_property_add() and object_property_add(). Reviewed-by: Amit Machhiwal Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-37-armbru@redhat.com> --- accel/kvm/kvm-all.c | 9 ++++---- accel/nitro/nitro-accel.c | 4 +++- accel/tcg/tcg-all.c | 3 ++- backends/cryptodev.c | 7 +++--- backends/hostmem-file.c | 4 ++-- backends/hostmem-memfd.c | 4 +++- backends/hostmem.c | 7 +++--- block/throttle-groups.c | 4 +++- crypto/secret_keyring.c | 9 ++++---- event-loop-base.c | 10 +++++--- hw/acpi/ich9.c | 4 +++- hw/acpi/pci.c | 5 ++-- hw/arm/virt.c | 18 ++++++++------- hw/core/clock.c | 4 +++- hw/core/machine.c | 2 +- hw/cpu/core.c | 5 ++-- hw/cxl/cxl-host.c | 2 +- hw/gpio/aspeed_gpio.c | 7 ++++-- hw/gpio/aspeed_sgpio.c | 4 +++- hw/gpio/stm32l4x5_gpio.c | 5 ++-- hw/hexagon/hexagon_dsp.c | 4 +++- hw/i386/pc.c | 9 +++++--- hw/i386/sgx-epc.c | 4 +++- hw/i386/x86.c | 6 ++--- hw/ide/ide-dev.c | 3 ++- hw/intc/apic_common.c | 3 ++- hw/loongarch/virt.c | 8 +++---- hw/mem/nvdimm.c | 3 ++- hw/mem/pc-dimm.c | 3 ++- hw/misc/aspeed_lpc.c | 25 ++++++++++---------- hw/misc/aspeed_sdmc.c | 3 ++- hw/misc/npcm7xx_mft.c | 3 ++- hw/net/ne2000-isa.c | 3 ++- hw/nvme/ctrl.c | 4 +++- hw/pci-bridge/pci_expander_bridge.c | 3 ++- hw/pci-host/i440fx.c | 9 ++++---- hw/pci-host/pnv_phb3.c | 5 ++-- hw/pci-host/pnv_phb4.c | 5 ++-- hw/pci-host/q35.c | 13 +++++++---- hw/ppc/spapr_drc.c | 5 ++-- hw/remote/vfio-user-obj.c | 4 ++-- hw/riscv/microchip_pfsoc.c | 3 ++- hw/s390x/sclpcpi.c | 6 +++-- hw/s390x/virtio-ccw-mem.c | 4 +++- hw/sensor/adc128d818.c | 8 ++++--- hw/sensor/adm1266.c | 3 ++- hw/sensor/adm1272.c | 9 ++++---- hw/sensor/emc141x.c | 9 ++++---- hw/sensor/isl_pmbus_vr.c | 19 +++++++-------- hw/sensor/lsm303dlhc_mag.c | 9 ++++---- hw/sensor/max34451.c | 5 ++-- hw/sensor/tmp105.c | 3 ++- hw/sensor/tmp421.c | 9 ++++---- hw/usb/dev-storage-classic.c | 3 ++- hw/virtio/virtio-balloon.c | 4 +++- hw/virtio/virtio-mem-pci.c | 4 +++- hw/virtio/virtio-mem.c | 10 +++++--- hw/xen/xen-pvh-common.c | 13 +++++++---- iothread.c | 9 ++++---- net/colo-compare.c | 7 +++--- net/dump.c | 3 ++- net/filter-buffer.c | 3 ++- qom/object.c | 36 ++++++++++++++--------------- system/bootdevice.c | 3 ++- system/memory.c | 5 ++-- target/arm/cpu64.c | 16 +++++++++---- target/arm/kvm.c | 3 ++- target/arm/tcg/cpu64.c | 6 +++-- target/i386/cpu.c | 13 ++++++----- target/i386/kvm/kvm.c | 10 ++++---- target/i386/sev.c | 7 +++--- target/ppc/compat.c | 3 ++- target/riscv/cpu.c | 19 ++++++++++----- target/riscv/kvm/kvm-cpu.c | 7 +++--- target/riscv/tcg/tcg-cpu.c | 7 +++--- target/s390x/cpu_models.c | 6 +++-- tests/unit/test-qdev-global-props.c | 9 ++++---- ui/console.c | 3 ++- util/thread-context.c | 10 +++++--- 79 files changed, 335 insertions(+), 213 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index fe11cd92b4..dcb1db139d 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -24,6 +24,7 @@ #include "qemu/config-file.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "hw/pci/msi.h" #include "hw/pci/msix.h" #include "hw/s390x/adapter.h" @@ -4302,15 +4303,15 @@ static void kvm_accel_class_init(ObjectClass *oc, c= onst void *data) object_class_property_set_description(oc, "kernel-irqchip", "Configure KVM in-kernel irqchip"); =20 - object_class_property_add(oc, "kvm-shadow-mem", "int", NULL, + object_class_property_add(oc, "kvm-shadow-mem", "int", &int_type_info, kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_m= em, NULL, NULL); object_class_property_set_description(oc, "kvm-shadow-mem", "KVM shadow MMU size"); =20 - object_class_property_add(oc, "dirty-ring-size", "uint32", NULL, - kvm_get_dirty_ring_size, - kvm_set_dirty_ring_size, + object_class_property_add(oc, "dirty-ring-size", "uint32", + &uint32_type_info, + kvm_get_dirty_ring_size, kvm_set_dirty_ring_= size, NULL, NULL); object_class_property_set_description(oc, "dirty-ring-size", "Size of KVM dirty page ring buffer (default: 0, i.e. use bitmap)"= ); diff --git a/accel/nitro/nitro-accel.c b/accel/nitro/nitro-accel.c index 597027438c..9c07483be3 100644 --- a/accel/nitro/nitro-accel.c +++ b/accel/nitro/nitro-accel.c @@ -29,6 +29,7 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qemu/rcu.h" @@ -238,7 +239,8 @@ static void nitro_accel_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, "debug-mode", "Start enclave in debug mode (enables console output)"); =20 - object_class_property_add(oc, "enclave-cid", "uint64", NULL, + object_class_property_add(oc, "enclave-cid", "uint64", + &uint64_type_info, nitro_get_enclave_cid, nitro_set_enclave_cid, NULL, NULL); diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index ed314e01cb..bbc733a707 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -29,6 +29,7 @@ #include "exec/icount.h" #include "tcg/startup.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/error-report.h" #include "qemu/accel.h" #include "qemu/atomic.h" @@ -270,7 +271,7 @@ static void tcg_accel_class_init(ObjectClass *oc, const= void *data) tcg_get_thread, tcg_set_thread); =20 - object_class_property_add(oc, "tb-size", "uint32", NULL, + object_class_property_add(oc, "tb-size", "uint32", &uint32_type_info, tcg_get_tb_size, tcg_set_tb_size, NULL, NULL); object_class_property_set_description(oc, "tb-size", diff --git a/backends/cryptodev.c b/backends/cryptodev.c index cc323014cc..46059faa26 100644 --- a/backends/cryptodev.c +++ b/backends/cryptodev.c @@ -25,6 +25,7 @@ #include "system/cryptodev.h" #include "system/stats.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-commands-cryptodev.h" #include "qapi/qapi-types-stats.h" #include "qapi/visitor.h" @@ -622,15 +623,15 @@ cryptodev_backend_class_init(ObjectClass *oc, const v= oid *data) ucc->prepare_delete =3D cryptodev_backend_prepare_delete; =20 QTAILQ_INIT(&crypto_clients); - object_class_property_add(oc, "queues", "uint32", NULL, + object_class_property_add(oc, "queues", "uint32", &uint32_type_info, cryptodev_backend_get_queues, cryptodev_backend_set_queues, NULL, NULL); - object_class_property_add(oc, "throttle-bps", "uint64", NULL, + object_class_property_add(oc, "throttle-bps", "uint64", &uint64_type_i= nfo, cryptodev_backend_get_bps, cryptodev_backend_set_bps, NULL, NULL); - object_class_property_add(oc, "throttle-ops", "uint64", NULL, + object_class_property_add(oc, "throttle-ops", "uint64", &uint64_type_i= nfo, cryptodev_backend_get_ops, cryptodev_backend_set_ops, NULL, NULL); diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 15b5fee246..2f65ca3678 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -275,11 +275,11 @@ file_backend_class_init(ObjectClass *oc, const void *= data) file_memory_backend_get_discard_data, file_memory_backend_set_disc= ard_data); object_class_property_add_str(oc, "mem-path", get_mem_path, set_mem_path); - object_class_property_add(oc, "align", "uint64", NULL, + object_class_property_add(oc, "align", "uint64", &uint64_type_info, file_memory_backend_get_align, file_memory_backend_set_align, NULL, NULL); - object_class_property_add(oc, "offset", "int", NULL, + object_class_property_add(oc, "offset", "int", &int_type_info, file_memory_backend_get_offset, file_memory_backend_set_offset, NULL, NULL); diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index 28f7e180f4..a6e46aa706 100644 --- a/backends/hostmem-memfd.c +++ b/backends/hostmem-memfd.c @@ -16,6 +16,7 @@ #include "qemu/memfd.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qom/object.h" #include "migration/cpr.h" #include "system/kvm.h" @@ -194,7 +195,8 @@ memfd_backend_class_init(ObjectClass *oc, const void *d= ata) memfd_backend_set_hugetlb); object_class_property_set_description(oc, "hugetlb", "Use huge pages"); - object_class_property_add(oc, "hugetlbsize", "uint64", NULL, + object_class_property_add(oc, "hugetlbsize", "uint64", + &uint64_type_info, memfd_backend_get_hugetlbsize, memfd_backend_set_hugetlbsize, NULL, NULL); diff --git a/backends/hostmem.c b/backends/hostmem.c index b43d6ca956..0f39f4d1b7 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -529,7 +529,7 @@ host_memory_backend_class_init(ObjectClass *oc, const v= oid *data) host_memory_backend_set_prealloc); object_class_property_set_description(oc, "prealloc", "Preallocate memory"); - object_class_property_add(oc, "prealloc-threads", "int", NULL, + object_class_property_add(oc, "prealloc-threads", "int", &int_type_inf= o, host_memory_backend_get_prealloc_threads, host_memory_backend_set_prealloc_threads, NULL, NULL); @@ -540,13 +540,14 @@ host_memory_backend_class_init(ObjectClass *oc, const= void *data) object_property_allow_set_link, OBJ_PROP_LINK_STRONG); object_class_property_set_description(oc, "prealloc-context", "Context to use for creating CPU threads for preallocation"); - object_class_property_add(oc, "size", "size", NULL, + object_class_property_add(oc, "size", "size", &size_type_info, host_memory_backend_get_size, host_memory_backend_set_size, NULL, NULL); object_class_property_set_description(oc, "size", "Size of the memory region (ex: 500M)"); - object_class_property_add(oc, "host-nodes", "[uint16]", NULL, + object_class_property_add(oc, "host-nodes", "[uint16]", + &uint16List_type_info, host_memory_backend_get_host_nodes, host_memory_backend_set_host_nodes, NULL, NULL); diff --git a/block/throttle-groups.c b/block/throttle-groups.c index 5d6b089092..40a49e6233 100644 --- a/block/throttle-groups.c +++ b/block/throttle-groups.c @@ -31,6 +31,7 @@ #include "qemu/thread.h" #include "system/qtest.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-type-infos-block-core.h" #include "qapi/qapi-visit-block-core.h" #include "qom/object.h" @@ -985,7 +986,8 @@ static void throttle_group_obj_class_init(ObjectClass *= klass, =20 /* individual properties */ for (i =3D 0; i < sizeof(properties) / sizeof(ThrottleParamInfo); i++)= { - object_class_property_add(klass, properties[i].name, "int64", NULL, + object_class_property_add(klass, properties[i].name, "int64", + &int64_type_info, throttle_group_get, throttle_group_set, NULL, &properties[i]); diff --git a/crypto/secret_keyring.c b/crypto/secret_keyring.c index e9cb222bf8..aa9c45f141 100644 --- a/crypto/secret_keyring.c +++ b/crypto/secret_keyring.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include #include +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/error.h" #include "qom/object_interfaces.h" #include "trace.h" @@ -107,10 +108,10 @@ qcrypto_secret_keyring_class_init(ObjectClass *oc, co= nst void *data) QCryptoSecretCommonClass *sic =3D QCRYPTO_SECRET_COMMON_CLASS(oc); sic->load_data =3D qcrypto_secret_keyring_load_data; =20 - object_class_property_add(oc, "serial", "int32_t", NULL, - qcrypto_secret_prop_get_key, - qcrypto_secret_prop_set_key, - NULL, NULL); + object_class_property_add(oc, "serial", "int32_t", &int32_type_info, + qcrypto_secret_prop_get_key, + qcrypto_secret_prop_set_key, + NULL, NULL); } =20 =20 diff --git a/event-loop-base.c b/event-loop-base.c index 42bf09d58b..e4a57c6190 100644 --- a/event-loop-base.c +++ b/event-loop-base.c @@ -14,6 +14,7 @@ #include "qemu/osdep.h" #include "qom/object_interfaces.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "block/thread-pool.h" #include "system/event-loop-base.h" =20 @@ -104,15 +105,18 @@ static void event_loop_base_class_init(ObjectClass *k= lass, ucc->complete =3D event_loop_base_complete; ucc->prepare_delete =3D event_loop_base_prepare_delete; =20 - object_class_property_add(klass, "aio-max-batch", "int64", NULL, + object_class_property_add(klass, "aio-max-batch", "int64", + &int64_type_info, event_loop_base_get_param, event_loop_base_set_param, NULL, &aio_max_batch_info); - object_class_property_add(klass, "thread-pool-min", "int64", NULL, + object_class_property_add(klass, "thread-pool-min", "int64", + &int64_type_info, event_loop_base_get_param, event_loop_base_set_param, NULL, &thread_pool_min_info); - object_class_property_add(klass, "thread-pool-max", "int64", NULL, + object_class_property_add(klass, "thread-pool-max", "int64", + &int64_type_info, event_loop_base_get_param, event_loop_base_set_param, NULL, &thread_pool_max_info); diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index f3e248c8da..91a22a8e94 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -26,6 +26,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/pci/pci.h" #include "migration/vmstate.h" @@ -379,7 +380,8 @@ void ich9_pm_add_class_properties(ObjectClass *oc, ptrd= iff_t pm_offset) PM_REG_FIELD(acpi_pci_hotplug.root), object_property_allow_set_link, OBJ_PROP_LINK_STRONG); - object_class_property_add(oc, ACPI_PM_PROP_GPE0_BLK, "uint32", NULL, + object_class_property_add(oc, ACPI_PM_PROP_GPE0_BLK, "uint32", + &uint32_type_info, ich9_pm_get_gpe0_blk, NULL, NULL, NULL); object_class_property_add_uint8_ptr(oc, ACPI_PM_PROP_S3_DISABLED, diff --git a/hw/acpi/pci.c b/hw/acpi/pci.c index abd1071f49..d393638d2e 100644 --- a/hw/acpi/pci.c +++ b/hw/acpi/pci.c @@ -27,6 +27,7 @@ #include "qemu/error-report.h" #include "qom/object_interfaces.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "hw/core/boards.h" #include "hw/acpi/aml-build.h" #include "hw/acpi/pci.h" @@ -139,7 +140,7 @@ static void acpi_generic_initiator_class_init(ObjectCla= ss *oc, const void *data) acpi_generic_initiator_set_pci_device); object_class_property_set_description(oc, "pci-dev", "PCI device to associate with the node"); - object_class_property_add(oc, "node", "uint32", NULL, NULL, + object_class_property_add(oc, "node", "uint32", &uint32_type_info, NUL= L, acpi_generic_initiator_set_node, NULL, NULL); object_class_property_set_description(oc, "node", "NUMA node associated with the PCI device"); @@ -253,7 +254,7 @@ static void acpi_generic_port_class_init(ObjectClass *o= c, const void *data) acpi_generic_port_set_pci_bus); object_class_property_set_description(oc, "pci-bus", "PCI Bus of the host bridge associated with this GP affinity struct= ure"); - object_class_property_add(oc, "node", "uint32", NULL, NULL, + object_class_property_add(oc, "node", "uint32", &uint32_type_info, NUL= L, acpi_generic_port_set_node, NULL, NULL); object_class_property_set_description(oc, "node", "The NUMA node like ID to index HMAT/SLIT NUMA properties involving= GP"); diff --git a/hw/arm/virt.c b/hw/arm/virt.c index e39d77eba6..2f03679afd 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -4254,18 +4254,20 @@ static void virt_machine_class_init(ObjectClass *oc= , const void *data) "Set on/off to enable/disable hi= gh " "memory region for PCI MMIO"); =20 - object_class_property_add(oc, "highmem-mmio-size", "size", NULL, - virt_get_highmem_mmio_size, - virt_set_highmem_mmio_size, - NULL, NULL); + object_class_property_add(oc, "highmem-mmio-size", "size", + &size_type_info, + virt_get_highmem_mmio_size, + virt_set_highmem_mmio_size, + NULL, NULL); object_class_property_set_description(oc, "highmem-mmio-size", "Set the high memory region size= " "for PCI MMIO"); =20 - object_class_property_add(oc, "virtio-mmio-transports", "uint8", NULL, - virt_get_virtio_transports, - virt_set_virtio_transports, - NULL, NULL); + object_class_property_add(oc, "virtio-mmio-transports", "uint8", + &uint8_type_info, + virt_get_virtio_transports, + virt_set_virtio_transports, + NULL, NULL); object_class_property_set_description(oc, "virtio-mmio-transports", "Set the number of virtio-mmio t= ransports to instantiate"); =20 diff --git a/hw/core/clock.c b/hw/core/clock.c index d46c888f5c..f927354923 100644 --- a/hw/core/clock.c +++ b/hw/core/clock.c @@ -13,6 +13,7 @@ =20 #include "qemu/osdep.h" #include "qemu/cutils.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "system/qtest.h" #include "hw/core/clock.h" @@ -185,7 +186,8 @@ static void clock_initfn(Object *obj) QLIST_INIT(&clk->children); =20 if (qtest_enabled()) { - object_property_add(obj, "qtest-clock-period", "uint64", NULL, + object_property_add(obj, "qtest-clock-period", "uint64", + &uint64_type_info, clock_period_prop_get, NULL, NULL, NULL); } } diff --git a/hw/core/machine.c b/hw/core/machine.c index a787b39bb9..8b97f159ca 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1141,7 +1141,7 @@ static void machine_class_init(ObjectClass *oc, const= void *data) object_class_property_set_description(oc, "smp-cache", "Cache properties list for SMP machine"); =20 - object_class_property_add(oc, "phandle-start", "int", NULL, + object_class_property_add(oc, "phandle-start", "int", &int_type_info, machine_get_phandle_start, machine_set_phandle_start, NULL, NULL); diff --git a/hw/cpu/core.c b/hw/cpu/core.c index f430befad8..5fae05ae37 100644 --- a/hw/cpu/core.c +++ b/hw/cpu/core.c @@ -12,6 +12,7 @@ #include "hw/core/boards.h" #include "hw/cpu/core.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" =20 static void core_prop_get_core_id(Object *obj, Visitor *v, const char *nam= e, @@ -82,10 +83,10 @@ static void cpu_core_class_init(ObjectClass *oc, const = void *data) DeviceClass *dc =3D DEVICE_CLASS(oc); =20 set_bit(DEVICE_CATEGORY_CPU, dc->categories); - object_class_property_add(oc, "core-id", "int", NULL, + object_class_property_add(oc, "core-id", "int", &int_type_info, core_prop_get_core_id, core_prop_set_core_id, NULL, NULL); - object_class_property_add(oc, "nr-threads", "int", NULL, + object_class_property_add(oc, "nr-threads", "int", &int_type_info, core_prop_get_nr_threads, core_prop_set_nr_threads, NULL, NULL); } diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index 77ddf4511a..754f708cce 100644 --- a/hw/cxl/cxl-host.c +++ b/hw/cxl/cxl-host.c @@ -611,7 +611,7 @@ static void machine_set_cfmw(Object *obj, Visitor *v, c= onst char *name, =20 void cxl_machine_init(Object *obj, CXLState *state) { - object_property_add(obj, "cxl", "bool", NULL, machine_get_cxl, + object_property_add(obj, "cxl", "bool", &bool_type_info, machine_get_c= xl, machine_set_cxl, NULL, state); object_property_set_description(obj, "cxl", "Set on/off to enable/disable " diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c index 4463cf7c9f..f95fe0d82a 100644 --- a/hw/gpio/aspeed_gpio.c +++ b/hw/gpio/aspeed_gpio.c @@ -12,6 +12,7 @@ #include "hw/gpio/aspeed_gpio.h" #include "hw/misc/aspeed_scu.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/irq.h" #include "migration/vmstate.h" @@ -1481,7 +1482,8 @@ static void aspeed_gpio_init(Object *obj) int pin_idx =3D j % GPIOS_PER_GROUP; const char *group =3D &props->group_label[group_idx][0]; char *name =3D g_strdup_printf("gpio%s%d", group, pin_idx); - object_property_add(obj, name, "bool", NULL, aspeed_gpio_get_p= in, + object_property_add(obj, name, "bool", &bool_type_info, + aspeed_gpio_get_pin, aspeed_gpio_set_pin, NULL, NULL); g_free(name); } @@ -1489,7 +1491,8 @@ static void aspeed_gpio_init(Object *obj) =20 for (int i =3D 0; i < agc->nr_gpio_sets; i++) { g_autofree char *name =3D g_strdup_printf("gpio-set[%d]", i); - object_property_add(obj, name, "uint32", NULL, aspeed_gpio_get_set, + object_property_add(obj, name, "uint32", &uint32_type_info, + aspeed_gpio_get_set, aspeed_gpio_set_set, NULL, NULL); } } diff --git a/hw/gpio/aspeed_sgpio.c b/hw/gpio/aspeed_sgpio.c index aeaef4f102..6263d126ee 100644 --- a/hw/gpio/aspeed_sgpio.c +++ b/hw/gpio/aspeed_sgpio.c @@ -11,6 +11,7 @@ #include "qemu/log.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/irq.h" #include "hw/core/qdev-properties.h" @@ -300,7 +301,8 @@ static void aspeed_sgpio_init(Object *obj) { for (int i =3D 0; i < ASPEED_SGPIO_MAX_PIN_PAIR * 2; i++) { g_autofree char *name =3D g_strdup_printf("sgpio%03d", i); - object_property_add(obj, name, "bool", NULL, aspeed_sgpio_get_pin, + object_property_add(obj, name, "bool", &bool_type_info, + aspeed_sgpio_get_pin, aspeed_sgpio_set_pin, NULL, NULL); } } diff --git a/hw/gpio/stm32l4x5_gpio.c b/hw/gpio/stm32l4x5_gpio.c index a31999323a..e3e5bc46e7 100644 --- a/hw/gpio/stm32l4x5_gpio.c +++ b/hw/gpio/stm32l4x5_gpio.c @@ -25,6 +25,7 @@ #include "hw/core/qdev-properties.h" #include "qapi/visitor.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "migration/vmstate.h" #include "trace.h" =20 @@ -409,10 +410,10 @@ static void stm32l4x5_gpio_init(Object *obj) =20 s->clk =3D qdev_init_clock_in(DEVICE(s), "clk", NULL, s, 0); =20 - object_property_add(obj, "disconnected-pins", "uint16", NULL, + object_property_add(obj, "disconnected-pins", "uint16", &uint16_type_i= nfo, disconnected_pins_get, disconnected_pins_set, NULL, &s->disconnected_pins); - object_property_add(obj, "clock-freq-hz", "uint32", NULL, + object_property_add(obj, "clock-freq-hz", "uint32", &uint32_type_info, clock_freq_get, NULL, NULL, NULL); } =20 diff --git a/hw/hexagon/hexagon_dsp.c b/hw/hexagon/hexagon_dsp.c index abccf10c00..eddf69545e 100644 --- a/hw/hexagon/hexagon_dsp.c +++ b/hw/hexagon/hexagon_dsp.c @@ -17,6 +17,7 @@ #include "hw/hexagon/hex-subsys.h" #include "hw/core/loader.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/error-report.h" #include "qemu/log.h" @@ -153,7 +154,8 @@ static void hexagon_sim_set_subsystem_base(Object *obj,= Visitor *v, =20 static void add_dsp_properties(ObjectClass *oc) { - object_class_property_add(oc, "subsystem-base", "uint32", NULL, + object_class_property_add(oc, "subsystem-base", "uint32", + &uint32_type_info, hexagon_sim_get_subsystem_base, hexagon_sim_set_subsystem_base, NULL, NULL); object_class_property_set_description(oc, "subsystem-base", diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 649ae27156..80940e81e5 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1718,7 +1718,8 @@ static void pc_machine_class_init(ObjectClass *oc, co= nst void *data) mc->default_ram_id =3D "pc.ram"; pcmc->default_smbios_ep_type =3D SMBIOS_ENTRY_POINT_TYPE_AUTO; =20 - object_class_property_add(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "size", NUL= L, + object_class_property_add(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "size", + &size_type_info, pc_machine_get_max_ram_below_4g, pc_machine_set_max_ram_below_4g, NULL, NULL); @@ -1757,14 +1758,16 @@ static void pc_machine_class_init(ObjectClass *oc, = const void *data) pc_machine_get_default_bus_bypass_iommu, pc_machine_set_default_bus_bypass_iommu); =20 - object_class_property_add(oc, PC_MACHINE_MAX_FW_SIZE, "size", NULL, + object_class_property_add(oc, PC_MACHINE_MAX_FW_SIZE, "size", + &size_type_info, pc_machine_get_max_fw_size, pc_machine_set_max_fw_size, NULL, NULL); object_class_property_set_description(oc, PC_MACHINE_MAX_FW_SIZE, "Maximum combined firmware size"); =20 - object_class_property_add(oc, PC_MACHINE_SMBIOS_EP, "str", NULL, + object_class_property_add(oc, PC_MACHINE_SMBIOS_EP, "str", + &str_type_info, pc_machine_get_smbios_ep, pc_machine_set_smbios_ep, NULL, NULL); diff --git a/hw/i386/sgx-epc.c b/hw/i386/sgx-epc.c index a1b55c2ec3..e5fc90db9e 100644 --- a/hw/i386/sgx-epc.c +++ b/hw/i386/sgx-epc.c @@ -15,6 +15,7 @@ #include "hw/mem/memory-device.h" #include "hw/core/qdev-properties.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "target/i386/cpu.h" #include "system/address-spaces.h" @@ -159,7 +160,8 @@ static void sgx_epc_class_init(ObjectClass *oc, const v= oid *data) mdc->get_memory_region =3D sgx_epc_md_get_memory_region; mdc->fill_device_info =3D sgx_epc_md_fill_device_info; =20 - object_class_property_add(oc, SGX_EPC_SIZE_PROP, "uint64", NULL, + object_class_property_add(oc, SGX_EPC_SIZE_PROP, "uint64", + &uint64_type_info, sgx_epc_get_size, NULL, NULL, NULL); diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 3416df13ab..b490c4e715 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -417,9 +417,9 @@ static void x86_machine_class_init(ObjectClass *oc, con= st void *data) "The string may be up to 8 bytes= in size"); =20 object_class_property_add(oc, X86_MACHINE_BUS_LOCK_RATELIMIT, "uint64_= t", - NULL, - x86_machine_get_bus_lock_ratelimit, - x86_machine_set_bus_lock_ratelimit, NULL, = NULL); + &uint64_type_info, + x86_machine_get_bus_lock_ratelimit, + x86_machine_set_bus_lock_ratelimit, NULL, NU= LL); object_class_property_set_description(oc, X86_MACHINE_BUS_LOCK_RATELIM= IT, "Set the ratelimit for the bus locks acquired in VMs"); =20 diff --git a/hw/ide/ide-dev.c b/hw/ide/ide-dev.c index 7bb06088a5..94b9147892 100644 --- a/hw/ide/ide-dev.c +++ b/hw/ide/ide-dev.c @@ -19,6 +19,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-types-block.h" #include "qemu/error-report.h" #include "qemu/module.h" @@ -174,7 +175,7 @@ out: =20 static void ide_dev_instance_init(Object *obj) { - object_property_add(obj, "bootindex", "int32", NULL, + object_property_add(obj, "bootindex", "int32", &int32_type_info, ide_dev_get_bootindex, ide_dev_set_bootindex, NULL, NULL); object_property_set_int(obj, "bootindex", -1, NULL); diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c index ee5f6cb4c3..eab75dd169 100644 --- a/hw/intc/apic_common.c +++ b/hw/intc/apic_common.c @@ -22,6 +22,7 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/i386/apic.h" #include "hw/i386/apic_internal.h" @@ -442,7 +443,7 @@ static void apic_common_initfn(Object *obj) APICCommonState *s =3D APIC_COMMON(obj); =20 s->id =3D s->initial_apic_id =3D -1; - object_property_add(obj, "id", "uint32", NULL, + object_property_add(obj, "id", "uint32", &uint32_type_info, apic_common_get_id, apic_common_set_id, NULL, NULL); } diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 1e1271ce87..1eae2bffe6 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -1512,10 +1512,10 @@ static void virt_class_init(ObjectClass *oc, const = void *data) object_class_property_set_description(oc, "highmem-mmio", "Set on/off to enable/disable hi= gh " "memory region for PCI MMIO"); - object_class_property_add(oc, "highmem-mmio-size", "size", NULL, - virt_get_highmem_mmio_size, - virt_set_highmem_mmio_size, - NULL, NULL); + object_class_property_add(oc, "highmem-mmio-size", "size", &size_type_= info, + virt_get_highmem_mmio_size, + virt_set_highmem_mmio_size, + NULL, NULL); object_class_property_set_description(oc, "highmem-mmio-size", "Set the high memory region size= " "for PCI MMIO"); diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index 8d6e8d0bd9..04e8361348 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -26,6 +26,7 @@ #include "qemu/module.h" #include "qemu/pmem.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/mem/nvdimm.h" #include "hw/core/qdev-properties.h" @@ -99,7 +100,7 @@ static void nvdimm_set_uuid(Object *obj, Visitor *v, con= st char *name, =20 static void nvdimm_init(Object *obj) { - object_property_add(obj, NVDIMM_LABEL_SIZE_PROP, "size", NULL, + object_property_add(obj, NVDIMM_LABEL_SIZE_PROP, "size", &size_type_in= fo, nvdimm_get_label_size, nvdimm_set_label_size, NULL, NULL); =20 diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 7250146c10..e9b872450a 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -26,6 +26,7 @@ #include "hw/mem/nvdimm.h" #include "hw/mem/memory-device.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "system/hostmem.h" @@ -176,7 +177,7 @@ static void pc_dimm_get_size(Object *obj, Visitor *v, c= onst char *name, =20 static void pc_dimm_init(Object *obj) { - object_property_add(obj, PC_DIMM_SIZE_PROP, "uint64", NULL, + object_property_add(obj, PC_DIMM_SIZE_PROP, "uint64", &uint64_type_inf= o, pc_dimm_get_size, NULL, NULL, NULL); } diff --git a/hw/misc/aspeed_lpc.c b/hw/misc/aspeed_lpc.c index a73df07332..ef320875cc 100644 --- a/hw/misc/aspeed_lpc.c +++ b/hw/misc/aspeed_lpc.c @@ -12,6 +12,7 @@ #include "qemu/error-report.h" #include "hw/misc/aspeed_lpc.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/irq.h" #include "hw/core/qdev-properties.h" @@ -417,40 +418,40 @@ static void aspeed_lpc_realize(DeviceState *dev, Erro= r **errp) =20 static void aspeed_lpc_init(Object *obj) { - object_property_add(obj, "idr1", "uint32", NULL, + object_property_add(obj, "idr1", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr1", "uint32", NULL, + object_property_add(obj, "odr1", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str1", "uint32", NULL, + object_property_add(obj, "str1", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr2", "uint32", NULL, + object_property_add(obj, "idr2", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr2", "uint32", NULL, + object_property_add(obj, "odr2", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str2", "uint32", NULL, + object_property_add(obj, "str2", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr3", "uint32", NULL, + object_property_add(obj, "idr3", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr3", "uint32", NULL, + object_property_add(obj, "odr3", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str3", "uint32", NULL, + object_property_add(obj, "str3", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr4", "uint32", NULL, + object_property_add(obj, "idr4", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr4", "uint32", NULL, + object_property_add(obj, "odr4", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str4", "uint32", NULL, + object_property_add(obj, "str4", "uint32", &uint32_type_info, aspeed_kcs_get_register_property, aspeed_kcs_set_register_property, NULL, NULL); } diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c index 427816b838..412aa17d2e 100644 --- a/hw/misc/aspeed_sdmc.c +++ b/hw/misc/aspeed_sdmc.c @@ -15,6 +15,7 @@ #include "hw/core/qdev-properties.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "trace.h" #include "qemu/units.h" #include "qemu/cutils.h" @@ -259,7 +260,7 @@ static void aspeed_sdmc_set_ram_size(Object *obj, Visit= or *v, const char *name, =20 static void aspeed_sdmc_initfn(Object *obj) { - object_property_add(obj, "ram-size", "int", NULL, + object_property_add(obj, "ram-size", "int", &int_type_info, aspeed_sdmc_get_ram_size, aspeed_sdmc_set_ram_size, NULL, NULL); } diff --git a/hw/misc/npcm7xx_mft.c b/hw/misc/npcm7xx_mft.c index 3ce92fad3a..a9e827e937 100644 --- a/hw/misc/npcm7xx_mft.c +++ b/hw/misc/npcm7xx_mft.c @@ -23,6 +23,7 @@ #include "hw/core/registerfields.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/bitops.h" #include "qemu/error-report.h" @@ -491,7 +492,7 @@ static void npcm7xx_mft_init(Object *obj) s->clock_2 =3D qdev_init_clock_out(dev, "clock2"); =20 for (int i =3D 0; i < NPCM7XX_PWM_PER_MODULE; ++i) { - object_property_add(obj, "max_rpm[*]", "uint32", NULL, + object_property_add(obj, "max_rpm[*]", "uint32", &uint32_type_info, npcm7xx_mft_get_max_rpm, npcm7xx_mft_set_max_rpm, NULL, &s->max_rpm[i]); diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c index 02300eaaa6..ed2c9e356c 100644 --- a/hw/net/ne2000-isa.c +++ b/hw/net/ne2000-isa.c @@ -29,6 +29,7 @@ #include "ne2000.h" #include "system/system.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qom/object.h" @@ -131,7 +132,7 @@ out: =20 static void isa_ne2000_instance_init(Object *obj) { - object_property_add(obj, "bootindex", "int32", NULL, + object_property_add(obj, "bootindex", "int32", &int32_type_info, isa_ne2000_get_bootindex, isa_ne2000_set_bootindex, NULL, NULL); object_property_set_int(obj, "bootindex", -1, NULL); diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 405010af4b..10e5d976a8 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -203,6 +203,7 @@ #include "qemu/units.h" #include "qemu/range.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "system/system.h" #include "system/block-backend.h" @@ -10612,7 +10613,8 @@ static void nvme_instance_init(Object *obj) "bootindex", "/namespace@1,0", DEVICE(obj)); =20 - object_property_add(obj, "smart_critical_warning", "uint8", NULL, + object_property_add(obj, "smart_critical_warning", "uint8", + &uint8_type_info, nvme_get_smart_warning, nvme_set_smart_warning, NULL, NULL); } diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expand= er_bridge.c index d66a12d004..a96b2d228e 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" @@ -75,7 +76,7 @@ void pxb_bus_class_init(ObjectClass *class, const void *d= ata) pbc->bus_num =3D pxb_bus_num; pbc->numa_node =3D pxb_bus_numa_node; =20 - object_class_property_add(class, "acpi_uid", "uint32", NULL, + object_class_property_add(class, "acpi_uid", "uint32", &uint32_type_in= fo, prop_pxb_uid_get, NULL, NULL, NULL); object_class_property_set_description(class, "acpi_uid", "ACPI Unique ID used to distinguish this PCI Host Bridge / ACPI000= 16"); diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index bf4b6c4253..0951378836 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -32,6 +32,7 @@ #include "hw/core/qdev-properties.h" #include "hw/core/sysbus.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "migration/vmstate.h" #include "qapi/visitor.h" #include "qemu/error-report.h" @@ -388,22 +389,22 @@ static void i440fx_pcihost_class_init(ObjectClass *kl= ass, const void *data) dc->user_creatable =3D false; =20 object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_START, "uint32= ", - NULL, + &uint32_type_info, i440fx_pcihost_get_pci_hole_start, NULL, NULL, NULL); =20 object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_END, "uint32", - NULL, + &uint32_type_info, i440fx_pcihost_get_pci_hole_end, NULL, NULL, NULL); =20 object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE64_START, "uint= 64", - NULL, + &uint64_type_info, i440fx_pcihost_get_pci_hole64_start, NULL, NULL, NULL); =20 object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE64_END, "uint64= ", - NULL, + &uint64_type_info, i440fx_pcihost_get_pci_hole64_end, NULL, NULL, NULL); } diff --git a/hw/pci-host/pnv_phb3.c b/hw/pci-host/pnv_phb3.c index c45401d9dd..b159f93944 100644 --- a/hw/pci-host/pnv_phb3.c +++ b/hw/pci-host/pnv_phb3.c @@ -11,6 +11,7 @@ #include "qemu/bswap.h" #include "qapi/visitor.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "hw/pci-host/pnv_phb3_regs.h" #include "hw/pci-host/pnv_phb.h" #include "hw/pci-host/pnv_phb3.h" @@ -1164,12 +1165,12 @@ static void pnv_phb3_root_bus_class_init(ObjectClas= s *klass, const void *data) { BusClass *k =3D BUS_CLASS(klass); =20 - object_class_property_add(klass, "phb-id", "uint32", NULL, + object_class_property_add(klass, "phb-id", "uint32", &uint32_type_info, pnv_phb3_root_bus_get_prop, pnv_phb3_root_bus_set_prop, NULL, NULL); =20 - object_class_property_add(klass, "chip-id", "uint32", NULL, + object_class_property_add(klass, "chip-id", "uint32", &uint32_type_inf= o, pnv_phb3_root_bus_get_prop, pnv_phb3_root_bus_set_prop, NULL, NULL); diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index 6a5d1bb227..a5e1ee2844 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -11,6 +11,7 @@ #include "qemu/bswap.h" #include "qapi/visitor.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "target/ppc/cpu.h" #include "hw/pci-host/pnv_phb4_regs.h" #include "hw/pci-host/pnv_phb4.h" @@ -1775,12 +1776,12 @@ static void pnv_phb4_root_bus_class_init(ObjectClas= s *klass, const void *data) { BusClass *k =3D BUS_CLASS(klass); =20 - object_class_property_add(klass, "phb-id", "uint32", NULL, + object_class_property_add(klass, "phb-id", "uint32", &uint32_type_info, pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop, NULL, NULL); =20 - object_class_property_add(klass, "chip-id", "uint32", NULL, + object_class_property_add(klass, "chip-id", "uint32", &uint32_type_inf= o, pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop, NULL, NULL); diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index 027ae02066..d53441561f 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -35,6 +35,7 @@ #include "hw/core/qdev-properties.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" =20 @@ -226,19 +227,23 @@ static void q35_host_initfn(Object *obj) qdev_prop_set_uint64(DEVICE(s), PCI_HOST_PROP_PCI_HOLE64_SIZE, Q35_PCI_HOST_HOLE64_SIZE_DEFAULT); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32", NULL, + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32", + &uint32_type_info, q35_host_get_pci_hole_start, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32", NULL, + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32", + &uint32_type_info, q35_host_get_pci_hole_end, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64", NUL= L, + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64", + &uint64_type_info, q35_host_get_pci_hole64_start, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64", NULL, + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64", + &uint64_type_info, q35_host_get_pci_hole64_end, NULL, NULL, NULL); =20 diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index a33f0949d1..4054215592 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -12,6 +12,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qobject/qnull.h" #include "qemu/cutils.h" #include "hw/ppc/spapr_drc.h" @@ -584,8 +585,8 @@ static void spapr_dr_connector_instance_init(Object *ob= j) SpaprDrcClass *drck =3D SPAPR_DR_CONNECTOR_GET_CLASS(drc); =20 object_property_add_uint32_ptr(obj, "id", &drc->id, OBJ_PROP_FLAG_READ= ); - object_property_add(obj, "index", "uint32", NULL, prop_get_index, - NULL, NULL, NULL); + object_property_add(obj, "index", "uint32", &uint32_type_info, + prop_get_index, NULL, NULL, NULL); object_property_add(obj, "fdt", "struct", NULL, prop_get_fdt, NULL, NULL, NULL); drc->state =3D drck->empty_state; diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c index 205582a91f..eae8a799f1 100644 --- a/hw/remote/vfio-user-obj.c +++ b/hw/remote/vfio-user-obj.c @@ -933,8 +933,8 @@ static void vfu_object_class_init(ObjectClass *klass, c= onst void *data) k->nr_devs =3D 0; =20 object_class_property_add(klass, "socket", "SocketAddress", - &SocketAddress_type_info, - NULL, vfu_object_set_socket, NULL, NULL); + &SocketAddress_type_info, NULL, + vfu_object_set_socket, NULL, NULL); object_class_property_set_description(klass, "socket", "SocketAddress " "(ex: type=3Dunix,path=3D/tmp/so= ck). " diff --git a/hw/riscv/microchip_pfsoc.c b/hw/riscv/microchip_pfsoc.c index 04c48a4eda..27c7c42231 100644 --- a/hw/riscv/microchip_pfsoc.c +++ b/hw/riscv/microchip_pfsoc.c @@ -39,6 +39,7 @@ #include "qemu/units.h" #include "qemu/cutils.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/boards.h" #include "hw/core/loader.h" @@ -744,7 +745,7 @@ static void microchip_icicle_kit_machine_class_init(Obj= ectClass *oc, mc->default_ram_size =3D 1537 * MiB; =20 object_class_property_add(oc, "clint-timebase-frequency", "uint32_t", - NULL, + &uint32_type_info, microchip_icicle_kit_get_clint_timebase_freq, microchip_icicle_kit_set_clint_timebase_freq, NULL, NULL); diff --git a/hw/s390x/sclpcpi.c b/hw/s390x/sclpcpi.c index 90cb36aad6..7de38f81e7 100644 --- a/hw/s390x/sclpcpi.c +++ b/hw/s390x/sclpcpi.c @@ -53,6 +53,7 @@ #include "qemu/timer.h" #include "hw/s390x/event-facility.h" #include "hw/s390x/ebcdic.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-visit-machine.h" #include "qapi/qapi-events-machine-s390x.h" #include "migration/vmstate.h" @@ -195,13 +196,14 @@ static void cpi_class_init(ObjectClass *klass, const = void *data) "name of the cluster which the VM belongs to, if any" " e.g. \"PLEX \""); =20 - object_class_property_add(klass, "system_level", "uint64", NULL, + object_class_property_add(klass, "system_level", "uint64", + &uint64_type_info, get_system_level, NULL, NULL, NULL); object_class_property_set_description(klass, "system_level", "distribution and kernel version in Linux e.g. 748723438054305= 28"); =20 - object_class_property_add(klass, "timestamp", "uint64", NULL, + object_class_property_add(klass, "timestamp", "uint64", &uint64_type_i= nfo, get_timestamp, NULL, NULL, NULL); object_class_property_set_description(klass, "timestamp", diff --git a/hw/s390x/virtio-ccw-mem.c b/hw/s390x/virtio-ccw-mem.c index 1dc19ca914..c9d09237c2 100644 --- a/hw/s390x/virtio-ccw-mem.c +++ b/hw/s390x/virtio-ccw-mem.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "hw/core/qdev-properties.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/module.h" #include "virtio-ccw-mem.h" #include "hw/mem/memory-device.h" @@ -205,7 +206,8 @@ static void virtio_ccw_mem_instance_init(Object *obj) OBJECT(&dev->vdev), VIRTIO_MEM_BLOCK_SIZE_PR= OP); object_property_add_alias(obj, VIRTIO_MEM_SIZE_PROP, OBJECT(&dev->vdev= ), VIRTIO_MEM_SIZE_PROP); - object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", NULL, + object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", + &size_type_info, virtio_ccw_mem_get_requested_size, virtio_ccw_mem_set_requested_size, NULL, NULL); } diff --git a/hw/sensor/adc128d818.c b/hw/sensor/adc128d818.c index 14d79d3958..4ac7a4393d 100644 --- a/hw/sensor/adc128d818.c +++ b/hw/sensor/adc128d818.c @@ -8,6 +8,7 @@ =20 #include "qemu/osdep.h" #include "qemu/log.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "qom/object.h" @@ -642,15 +643,16 @@ static void adc128d818_initfn(Object *obj) for (unsigned ch =3D 0u; ch < ADC128D818_NUM_CHANNELS; ch++) { char *name =3D g_strdup_printf("ain%u", ch); =20 - object_property_add(obj, name, "int", NULL, adc128d818_get_ain, + object_property_add(obj, name, "int", &int_type_info, + adc128d818_get_ain, adc128d818_set_ain, NULL, NULL); g_free(name); } =20 - object_property_add(obj, "temperature", "int", NULL, + object_property_add(obj, "temperature", "int", &int_type_info, adc128d818_get_temperature, adc128d818_set_temperature, NULL, NULL); - object_property_add(obj, "ext-vref-mv", "int", NULL, + object_property_add(obj, "ext-vref-mv", "int", &int_type_info, adc128d818_get_ext_vref, adc128d818_set_ext_vref, NULL, NULL); } diff --git a/hw/sensor/adm1266.c b/hw/sensor/adm1266.c index 7927845e32..c880fca225 100644 --- a/hw/sensor/adm1266.c +++ b/hw/sensor/adm1266.c @@ -14,6 +14,7 @@ #include "hw/core/irq.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h" @@ -217,7 +218,7 @@ static void adm1266_init(Object *obj) for (int i =3D 0; i < ADM1266_NUM_PAGES; i++) { pmbus_page_config(pmdev, i, flags); =20 - object_property_add(obj, "vout[*]", "uint16", NULL, + object_property_add(obj, "vout[*]", "uint16", &uint16_type_info, adm1266_get, adm1266_set, NULL, &pmdev->pages[i].read_vout); } diff --git a/hw/sensor/adm1272.c b/hw/sensor/adm1272.c index 6a7ff02617..ca66039c20 100644 --- a/hw/sensor/adm1272.c +++ b/hw/sensor/adm1272.c @@ -12,6 +12,7 @@ #include "hw/core/irq.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h" @@ -493,19 +494,19 @@ static void adm1272_init(Object *obj) =20 pmbus_page_config(pmdev, 0, flags); =20 - object_property_add(obj, "vin", "uint16", NULL, + object_property_add(obj, "vin", "uint16", &uint16_type_info, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_vin); =20 - object_property_add(obj, "vout", "uint16", NULL, + object_property_add(obj, "vout", "uint16", &uint16_type_info, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_vout); =20 - object_property_add(obj, "iout", "uint16", NULL, + object_property_add(obj, "iout", "uint16", &uint16_type_info, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_iout); =20 - object_property_add(obj, "pin", "uint16", NULL, + object_property_add(obj, "pin", "uint16", &uint16_type_info, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_pin); =20 diff --git a/hw/sensor/emc141x.c b/hw/sensor/emc141x.c index 128d721b7b..f53ee9f654 100644 --- a/hw/sensor/emc141x.c +++ b/hw/sensor/emc141x.c @@ -22,6 +22,7 @@ #include "hw/i2c/i2c.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qom/object.h" @@ -251,16 +252,16 @@ static void emc141x_reset(DeviceState *dev) =20 static void emc141x_initfn(Object *obj) { - object_property_add(obj, "temperature0", "int", NULL, + object_property_add(obj, "temperature0", "int", &int_type_info, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature1", "int", NULL, + object_property_add(obj, "temperature1", "int", &int_type_info, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature2", "int", NULL, + object_property_add(obj, "temperature2", "int", &int_type_info, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature3", "int", NULL, + object_property_add(obj, "temperature3", "int", &int_type_info, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); } diff --git a/hw/sensor/isl_pmbus_vr.c b/hw/sensor/isl_pmbus_vr.c index 1af0f2af35..dbff398d57 100644 --- a/hw/sensor/isl_pmbus_vr.c +++ b/hw/sensor/isl_pmbus_vr.c @@ -9,6 +9,7 @@ #include "qemu/osdep.h" #include "hw/sensor/isl_pmbus_vr.h" #include "hw/core/qdev-properties.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h" @@ -136,63 +137,63 @@ static void isl_pmbus_vr_add_props(Object *obj, uint6= 4_t *flags, uint8_t pages) PMBusDevice *pmdev =3D PMBUS_DEVICE(obj); for (int i =3D 0; i < pages; i++) { if (flags[i] & PB_HAS_VIN) { - object_property_add(obj, "vin[*]", "uint16", NULL, + object_property_add(obj, "vin[*]", "uint16", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_vin); } =20 if (flags[i] & PB_HAS_VOUT) { - object_property_add(obj, "vout[*]", "uint16", NULL, + object_property_add(obj, "vout[*]", "uint16", &uint16_type_inf= o, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_vout); } =20 if (flags[i] & PB_HAS_IIN) { - object_property_add(obj, "iin[*]", "uint16", NULL, + object_property_add(obj, "iin[*]", "uint16", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_iin); } =20 if (flags[i] & PB_HAS_IOUT) { - object_property_add(obj, "iout[*]", "uint16", NULL, + object_property_add(obj, "iout[*]", "uint16", &uint16_type_inf= o, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_iout); } =20 if (flags[i] & PB_HAS_PIN) { - object_property_add(obj, "pin[*]", "uint16", NULL, + object_property_add(obj, "pin[*]", "uint16", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_pin); } =20 if (flags[i] & PB_HAS_POUT) { - object_property_add(obj, "pout[*]", "uint16", NULL, + object_property_add(obj, "pout[*]", "uint16", &uint16_type_inf= o, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_pout); } =20 if (flags[i] & PB_HAS_TEMPERATURE) { - object_property_add(obj, "temp1[*]", "uint16", NULL, + object_property_add(obj, "temp1[*]", "uint16", &uint16_type_in= fo, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_temperature_1); } =20 if (flags[i] & PB_HAS_TEMP2) { - object_property_add(obj, "temp2[*]", "uint16", NULL, + object_property_add(obj, "temp2[*]", "uint16", &uint16_type_in= fo, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_temperature_2); } =20 if (flags[i] & PB_HAS_TEMP3) { - object_property_add(obj, "temp3[*]", "uint16", NULL, + object_property_add(obj, "temp3[*]", "uint16", &uint16_type_in= fo, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_temperature_3); diff --git a/hw/sensor/lsm303dlhc_mag.c b/hw/sensor/lsm303dlhc_mag.c index f362686b69..1045473595 100644 --- a/hw/sensor/lsm303dlhc_mag.c +++ b/hw/sensor/lsm303dlhc_mag.c @@ -25,6 +25,7 @@ #include "hw/i2c/i2c.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qemu/log.h" @@ -509,19 +510,19 @@ static void lsm303dlhc_mag_reset(DeviceState *dev) */ static void lsm303dlhc_mag_initfn(Object *obj) { - object_property_add(obj, "mag-x", "int", NULL, + object_property_add(obj, "mag-x", "int", &int_type_info, lsm303dlhc_mag_get_x, lsm303dlhc_mag_set_x, NULL, NULL); =20 - object_property_add(obj, "mag-y", "int", NULL, + object_property_add(obj, "mag-y", "int", &int_type_info, lsm303dlhc_mag_get_y, lsm303dlhc_mag_set_y, NULL, NULL); =20 - object_property_add(obj, "mag-z", "int", NULL, + object_property_add(obj, "mag-z", "int", &int_type_info, lsm303dlhc_mag_get_z, lsm303dlhc_mag_set_z, NULL, NULL); =20 - object_property_add(obj, "temperature", "int", NULL, + object_property_add(obj, "temperature", "int", &int_type_info, lsm303dlhc_mag_get_temperature, lsm303dlhc_mag_set_temperature, NULL, NULL); } diff --git a/hw/sensor/max34451.c b/hw/sensor/max34451.c index 6c2f7311ff..9e3ebf72be 100644 --- a/hw/sensor/max34451.c +++ b/hw/sensor/max34451.c @@ -11,6 +11,7 @@ #include "hw/core/irq.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h" @@ -727,7 +728,7 @@ static void max34451_init(Object *obj) =20 /* get and set the voltage in millivolts, max is 32767 mV */ for (int i =3D 0; i < MAX34451_NUM_PWR_DEVICES; i++) { - object_property_add(obj, "vout[*]", "uint16", NULL, + object_property_add(obj, "vout[*]", "uint16", &uint16_type_info, max34451_get, max34451_set, NULL, &pmdev->pages[i].read_vout= ); } @@ -737,7 +738,7 @@ static void max34451_init(Object *obj) * centidegrees Celsius i.e.: 2500 -> 25.00 C, max is 327.67 C */ for (int i =3D 0; i < MAX34451_NUM_TEMP_DEVICES; i++) { - object_property_add(obj, "temperature[*]", "uint16", NULL, + object_property_add(obj, "temperature[*]", "uint16", &uint16_type_= info, max34451_get, max34451_set, NULL, diff --git a/hw/sensor/tmp105.c b/hw/sensor/tmp105.c index 98f45a49b7..ec39c31d90 100644 --- a/hw/sensor/tmp105.c +++ b/hw/sensor/tmp105.c @@ -28,6 +28,7 @@ #include "qemu/osdep.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qom/object.h" #include "hw/sensor/tmp105.h" @@ -408,7 +409,7 @@ static void tmp105_realize(DeviceState *dev, Error **er= rp) =20 static void tmp105_initfn(Object *obj) { - object_property_add(obj, "temperature", "int", NULL, + object_property_add(obj, "temperature", "int", &int_type_info, tmp105_get_temperature, tmp105_set_temperature, NULL, NULL); object_property_set_description(obj, "temperature", diff --git a/hw/sensor/tmp421.c b/hw/sensor/tmp421.c index 8e6823dfcc..0e4d0d0ec2 100644 --- a/hw/sensor/tmp421.c +++ b/hw/sensor/tmp421.c @@ -28,6 +28,7 @@ #include "hw/i2c/i2c.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qom/object.h" @@ -350,16 +351,16 @@ static void tmp421_class_init(ObjectClass *klass, con= st void *data) dc->vmsd =3D &vmstate_tmp421; sc->dev =3D (DeviceInfo *) data; =20 - object_class_property_add(klass, "temperature0", "int", NULL, + object_class_property_add(klass, "temperature0", "int", &int_type_info, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature1", "int", NULL, + object_class_property_add(klass, "temperature1", "int", &int_type_info, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature2", "int", NULL, + object_class_property_add(klass, "temperature2", "int", &int_type_info, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature3", "int", NULL, + object_class_property_add(klass, "temperature3", "int", &int_type_info, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); } diff --git a/hw/usb/dev-storage-classic.c b/hw/usb/dev-storage-classic.c index dfd568da5e..353f81dcc0 100644 --- a/hw/usb/dev-storage-classic.c +++ b/hw/usb/dev-storage-classic.c @@ -9,6 +9,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/usb/usb.h" #include "hw/usb/desc.h" @@ -122,7 +123,7 @@ out: =20 static void usb_msd_instance_init(Object *obj) { - object_property_add(obj, "bootindex", "int32", NULL, + object_property_add(obj, "bootindex", "int32", &int32_type_info, usb_msd_get_bootindex, usb_msd_set_bootindex, NULL, NULL); object_property_set_int(obj, "bootindex", -1, NULL); diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 995b1a41ef..366f88e048 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -27,6 +27,7 @@ #include "hw/virtio/virtio-balloon.h" #include "system/address-spaces.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-events-machine.h" #include "qapi/visitor.h" #include "trace.h" @@ -1039,7 +1040,8 @@ static void virtio_balloon_instance_init(Object *obj) object_property_add(obj, "guest-stats", "guest statistics", NULL, balloon_stats_get_all, NULL, NULL, NULL); =20 - object_property_add(obj, "guest-stats-polling-interval", "int", NULL, + object_property_add(obj, "guest-stats-polling-interval", "int", + &int_type_info, balloon_stats_get_poll_interval, balloon_stats_set_poll_interval, NULL, NULL); diff --git a/hw/virtio/virtio-mem-pci.c b/hw/virtio/virtio-mem-pci.c index 6349337bf4..3044a807c1 100644 --- a/hw/virtio/virtio-mem-pci.c +++ b/hw/virtio/virtio-mem-pci.c @@ -14,6 +14,7 @@ #include "virtio-mem-pci.h" #include "hw/mem/memory-device.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-events-machine.h" #include "qapi/qapi-events-misc.h" =20 @@ -211,7 +212,8 @@ static void virtio_mem_pci_instance_init(Object *obj) OBJECT(&dev->vdev), VIRTIO_MEM_BLOCK_SIZE_PR= OP); object_property_add_alias(obj, VIRTIO_MEM_SIZE_PROP, OBJECT(&dev->vdev= ), VIRTIO_MEM_SIZE_PROP); - object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", NULL, + object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", + &size_type_info, virtio_mem_pci_get_requested_size, virtio_mem_pci_set_requested_size, NULL, NULL); } diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c index c6befd6c54..546ea18b7c 100644 --- a/hw/virtio/virtio-mem.c +++ b/hw/virtio/virtio-mem.c @@ -26,6 +26,7 @@ #include "hw/virtio/virtio-bus.h" #include "hw/virtio/virtio-mem.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "migration/misc.h" #include "hw/core/boards.h" @@ -1533,13 +1534,16 @@ static void virtio_mem_instance_init(Object *obj) =20 notifier_list_init(&vmem->size_change_notifiers); =20 - object_property_add(obj, VIRTIO_MEM_SIZE_PROP, "size", NULL, + object_property_add(obj, VIRTIO_MEM_SIZE_PROP, "size", + &size_type_info, virtio_mem_get_size, NULL, NULL, NULL); - object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", NULL, + object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", + &size_type_info, virtio_mem_get_requested_size, virtio_mem_set_requested_size, NULL, NULL); - object_property_add(obj, VIRTIO_MEM_BLOCK_SIZE_PROP, "size", NULL, + object_property_add(obj, VIRTIO_MEM_BLOCK_SIZE_PROP, "size", + &size_type_info, virtio_mem_get_block_size, virtio_mem_set_block_si= ze, NULL, NULL); } diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c index ddeabe30f2..ca3326156f 100644 --- a/hw/xen/xen-pvh-common.c +++ b/hw/xen/xen-pvh-common.c @@ -9,6 +9,7 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qemu/units.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/boards.h" #include "hw/core/irq.h" @@ -413,7 +414,8 @@ void xen_pvh_class_setup_common_props(XenPVHMachineClas= s *xpc) =20 #define OC_MEMMAP_PROP_BASE(c, prop_name, name) \ do { \ - object_class_property_add(c, prop_name "-base", "uint64_t", NULL, \ + object_class_property_add(c, prop_name "-base", "uint64_t", \ + &uint64_type_info, \ xen_pvh_get_ ## name ## _base, \ xen_pvh_set_ ## name ## _base, NULL, NULL); \ object_class_property_set_description(oc, prop_name "-base", \ @@ -422,7 +424,8 @@ do { = \ =20 #define OC_MEMMAP_PROP_SIZE(c, prop_name, name) \ do { \ - object_class_property_add(c, prop_name "-size", "uint64_t", NULL, \ + object_class_property_add(c, prop_name "-size", "uint64_t", \ + &uint64_type_info, \ xen_pvh_get_ ## name ## _size, \ xen_pvh_set_ ## name ## _size, NULL, NULL); \ object_class_property_set_description(oc, prop_name "-size", \ @@ -458,7 +461,8 @@ do { = \ OC_MEMMAP_PROP(oc, "pci-mmio", pci_mmio); OC_MEMMAP_PROP(oc, "pci-mmio-high", pci_mmio_high); =20 - object_class_property_add(oc, "pci-intx-irq-base", "uint32_t", NUL= L, + object_class_property_add(oc, "pci-intx-irq-base", "uint32_t", + &uint32_type_info, xen_pvh_get_pci_intx_irq_base, xen_pvh_set_pci_intx_irq_base, NULL, NULL); @@ -468,7 +472,8 @@ do { = \ =20 #ifdef CONFIG_TPM if (xpc->has_tpm) { - object_class_property_add(oc, "tpm-base-addr", "uint64_t", NULL, + object_class_property_add(oc, "tpm-base-addr", "uint64_t", + &uint64_type_info, xen_pvh_get_tpm_base, xen_pvh_set_tpm_base, NULL, NULL); diff --git a/iothread.c b/iothread.c index 7084d336a4..3a1601e28b 100644 --- a/iothread.c +++ b/iothread.c @@ -20,6 +20,7 @@ #include "system/event-loop-base.h" #include "system/iothread.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-commands-misc.h" #include "qemu/error-report.h" #include "qemu/rcu.h" @@ -315,19 +316,19 @@ static void iothread_class_init(ObjectClass *klass, c= onst void *class_data) bc->init =3D iothread_init; bc->update_params =3D iothread_set_aio_context_params; =20 - object_class_property_add(klass, "poll-max-ns", "int64", NULL, + object_class_property_add(klass, "poll-max-ns", "int64", &int64_type_i= nfo, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_max_ns_info); - object_class_property_add(klass, "poll-grow", "int64", NULL, + object_class_property_add(klass, "poll-grow", "int64", &int64_type_inf= o, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_grow_info); - object_class_property_add(klass, "poll-shrink", "int64", NULL, + object_class_property_add(klass, "poll-shrink", "int64", &int64_type_i= nfo, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_shrink_info); - object_class_property_add(klass, "poll-weight", "int64", NULL, + object_class_property_add(klass, "poll-weight", "int64", &int64_type_i= nfo, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_weight_info); diff --git a/net/colo-compare.c b/net/colo-compare.c index 6bc43e0696..9b04b28484 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -16,6 +16,7 @@ #include "qemu/error-report.h" #include "trace.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "net/net.h" #include "net/eth.h" #include "qom/object_interfaces.h" @@ -1373,15 +1374,15 @@ static void colo_compare_init(Object *obj) object_property_add_str(obj, "notify_dev", compare_get_notify_dev, compare_set_notify_dev= ); =20 - object_property_add(obj, "compare_timeout", "uint64", NULL, + object_property_add(obj, "compare_timeout", "uint64", &uint64_type_inf= o, compare_get_timeout, compare_set_timeout, NULL, NULL); =20 - object_property_add(obj, "expired_scan_cycle", "uint32", NULL, + object_property_add(obj, "expired_scan_cycle", "uint32", &uint32_type_= info, compare_get_expired_scan_cycle, compare_set_expired_scan_cycle, NULL, NULL); =20 - object_property_add(obj, "max_queue_size", "uint32", NULL, + object_property_add(obj, "max_queue_size", "uint32", &uint32_type_info, get_max_queue_size, set_max_queue_size, NULL, NULL); =20 diff --git a/net/dump.c b/net/dump.c index 558115b9c9..da366f48da 100644 --- a/net/dump.c +++ b/net/dump.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include "clients.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/error-report.h" #include "qemu/iov.h" #include "qemu/module.h" @@ -238,7 +239,7 @@ static void filter_dump_class_init(ObjectClass *oc, con= st void *data) { NetFilterClass *nfc =3D NETFILTER_CLASS(oc); =20 - object_class_property_add(oc, "maxlen", "uint32", NULL, + object_class_property_add(oc, "maxlen", "uint32", &uint32_type_info, filter_dump_get_maxlen, filter_dump_set_maxlen, NULL, NULL); object_class_property_add_str(oc, "file", file_dump_get_filename, diff --git a/net/filter-buffer.c b/net/filter-buffer.c index f56b2cfaf0..82a64a4680 100644 --- a/net/filter-buffer.c +++ b/net/filter-buffer.c @@ -10,6 +10,7 @@ #include "net/filter.h" #include "net/queue.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/timer.h" #include "qemu/iov.h" #include "qapi/qapi-builtin-visit.h" @@ -182,7 +183,7 @@ static void filter_buffer_class_init(ObjectClass *oc, c= onst void *data) { NetFilterClass *nfc =3D NETFILTER_CLASS(oc); =20 - object_class_property_add(oc, "interval", "uint32", NULL, + object_class_property_add(oc, "interval", "uint32", &uint32_type_info, filter_buffer_get_interval, filter_buffer_set_interval, NULL, NULL); =20 diff --git a/qom/object.c b/qom/object.c index 44f59fbbe4..937735f025 100644 --- a/qom/object.c +++ b/qom/object.c @@ -22,10 +22,10 @@ #include "qapi/string-output-visitor.h" #include "qapi/qobject-input-visitor.h" #include "qapi/forward-visitor.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-builtin-visit.h" #include "qapi/compat-policy.h" #include "qobject/qdict.h" -#include "qobject/qjson.h" #include "qemu/id.h" #include "qapi/qmp/qerror.h" #include "trace.h" @@ -2406,7 +2406,7 @@ object_property_add_str(Object *obj, const char *name, prop->get =3D get; prop->set =3D set; =20 - return object_property_add(obj, name, "string", NULL, + return object_property_add(obj, name, "string", &str_type_info, get ? property_get_str : NULL, set ? property_set_str : NULL, property_release_data, @@ -2424,7 +2424,7 @@ object_class_property_add_str(ObjectClass *klass, con= st char *name, prop->get =3D get; prop->set =3D set; =20 - return object_class_property_add(klass, name, "string", NULL, + return object_class_property_add(klass, name, "string", &str_type_info, get ? property_get_str : NULL, set ? property_set_str : NULL, NULL, @@ -2476,7 +2476,7 @@ object_property_add_bool(Object *obj, const char *nam= e, prop->get =3D get; prop->set =3D set; =20 - return object_property_add(obj, name, "bool", NULL, + return object_property_add(obj, name, "bool", &bool_type_info, get ? property_get_bool : NULL, set ? property_set_bool : NULL, property_release_data, @@ -2493,7 +2493,7 @@ object_class_property_add_bool(ObjectClass *klass, co= nst char *name, prop->get =3D get; prop->set =3D set; =20 - return object_class_property_add(klass, name, "bool", NULL, + return object_class_property_add(klass, name, "bool", &bool_type_info, get ? property_get_bool : NULL, set ? property_set_bool : NULL, NULL, @@ -2817,7 +2817,7 @@ object_class_property_add_bool_ptr(ObjectClass *klass= , const char *name, setter =3D property_class_set_bool_ptr; } =20 - return object_class_property_add(klass, name, "bool", NULL, + return object_class_property_add(klass, name, "bool", &bool_type_info, getter, setter, NULL, (void *)offset); } =20 @@ -2837,7 +2837,7 @@ object_property_add_uint8_ptr(Object *obj, const char= *name, setter =3D property_set_uint8_ptr; } =20 - return object_property_add(obj, name, "uint8", NULL, + return object_property_add(obj, name, "uint8", &uint8_type_info, getter, setter, NULL, (void *)v); } =20 @@ -2857,7 +2857,7 @@ object_class_property_add_uint8_ptr(ObjectClass *klas= s, const char *name, setter =3D property_class_set_uint8_ptr; } =20 - return object_class_property_add(klass, name, "uint8", NULL, + return object_class_property_add(klass, name, "uint8", &uint8_type_inf= o, getter, setter, NULL, (void *)offset); } =20 @@ -2878,7 +2878,7 @@ object_class_static_property_add_uint8_ptr(ObjectClas= s *klass, setter =3D property_set_uint8_ptr; } =20 - return object_class_property_add(klass, name, "uint8", NULL, + return object_class_property_add(klass, name, "uint8", &uint8_type_inf= o, getter, setter, NULL, (void *)v); } =20 @@ -2898,7 +2898,7 @@ object_property_add_uint16_ptr(Object *obj, const cha= r *name, setter =3D property_set_uint16_ptr; } =20 - return object_property_add(obj, name, "uint16", NULL, + return object_property_add(obj, name, "uint16", &uint16_type_info, getter, setter, NULL, (void *)v); } =20 @@ -2918,7 +2918,7 @@ object_class_property_add_uint16_ptr(ObjectClass *kla= ss, const char *name, setter =3D property_class_set_uint16_ptr; } =20 - return object_class_property_add(klass, name, "uint16", NULL, + return object_class_property_add(klass, name, "uint16", &uint16_type_i= nfo, getter, setter, NULL, (void *)offset); } =20 @@ -2939,7 +2939,7 @@ object_class_static_property_add_uint16_ptr(ObjectCla= ss *klass, setter =3D property_set_uint16_ptr; } =20 - return object_class_property_add(klass, name, "uint16", NULL, + return object_class_property_add(klass, name, "uint16", &uint16_type_i= nfo, getter, setter, NULL, (void *)v); } =20 @@ -2959,7 +2959,7 @@ object_property_add_uint32_ptr(Object *obj, const cha= r *name, setter =3D property_set_uint32_ptr; } =20 - return object_property_add(obj, name, "uint32", NULL, + return object_property_add(obj, name, "uint32", &uint32_type_info, getter, setter, NULL, (void *)v); } =20 @@ -2979,7 +2979,7 @@ object_class_property_add_uint32_ptr(ObjectClass *kla= ss, const char *name, setter =3D property_class_set_uint32_ptr; } =20 - return object_class_property_add(klass, name, "uint32", NULL, + return object_class_property_add(klass, name, "uint32", &uint32_type_i= nfo, getter, setter, NULL, (void *)offset); } =20 @@ -3000,7 +3000,7 @@ object_class_static_property_add_uint32_ptr(ObjectCla= ss *klass, setter =3D property_set_uint32_ptr; } =20 - return object_class_property_add(klass, name, "uint32", NULL, + return object_class_property_add(klass, name, "uint32", &uint32_type_i= nfo, getter, setter, NULL, (void *)v); } =20 @@ -3020,7 +3020,7 @@ object_property_add_uint64_ptr(Object *obj, const cha= r *name, setter =3D property_set_uint64_ptr; } =20 - return object_property_add(obj, name, "uint64", NULL, + return object_property_add(obj, name, "uint64", &uint64_type_info, getter, setter, NULL, (void *)v); } =20 @@ -3040,7 +3040,7 @@ object_class_property_add_uint64_ptr(ObjectClass *kla= ss, const char *name, setter =3D property_class_set_uint64_ptr; } =20 - return object_class_property_add(klass, name, "uint64", NULL, + return object_class_property_add(klass, name, "uint64", &uint64_type_i= nfo, getter, setter, NULL, (void *)offset); } =20 @@ -3061,7 +3061,7 @@ object_class_static_property_add_uint64_ptr(ObjectCla= ss *klass, setter =3D property_set_uint64_ptr; } =20 - return object_class_property_add(klass, name, "uint64", NULL, + return object_class_property_add(klass, name, "uint64", &uint64_type_i= nfo, getter, setter, NULL, (void *)v); } =20 diff --git a/system/bootdevice.c b/system/bootdevice.c index 4fc6b4c8ed..36eb582dee 100644 --- a/system/bootdevice.c +++ b/system/bootdevice.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "system/system.h" #include "qapi/visitor.h" #include "qemu/error-report.h" @@ -336,7 +337,7 @@ void device_add_bootindex_property(Object *obj, int32_t= *bootindex, prop->suffix =3D suffix; prop->dev =3D dev; =20 - object_property_add(obj, name, "int32", NULL, + object_property_add(obj, name, "int32", &int32_type_info, device_get_bootindex, device_set_bootindex, property_release_bootindex, diff --git a/system/memory.c b/system/memory.c index ac296cb0d8..56c5dd6c8a 100644 --- a/system/memory.c +++ b/system/memory.c @@ -16,6 +16,7 @@ #include "qemu/osdep.h" #include "qemu/log.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "system/memory.h" #include "qapi/visitor.h" #include "qemu/bitops.h" @@ -1293,11 +1294,11 @@ static void memory_region_initfn(Object *obj) =20 object_property_add_uint64_ptr(OBJECT(mr), "addr", &mr->addr, OBJ_PROP_FLAG_READ); - object_property_add(OBJECT(mr), "priority", "int32", NULL, + object_property_add(OBJECT(mr), "priority", "int32", &int32_type_info, memory_region_get_priority, NULL, /* memory_region_set_priority */ NULL, NULL); - object_property_add(OBJECT(mr), "size", "uint64", NULL, + object_property_add(OBJECT(mr), "size", "uint64", &uint64_type_info, memory_region_get_size, NULL, /* memory_region_set_size, */ NULL, NULL); diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 9c869b4488..2a0f61e42d 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -20,6 +20,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "cpu.h" #include "cpregs.h" #include "qemu/module.h" @@ -328,7 +329,8 @@ static void prop_bool_set_false(Object *obj, Visitor *v= , const char *name, =20 static void prop_add_stub_bool(Object *obj, const char *name) { - object_property_add(obj, name, "bool", NULL, prop_bool_get_false, + object_property_add(obj, name, "bool", &bool_type_info, + prop_bool_get_false, prop_bool_set_false, NULL, NULL); } =20 @@ -518,13 +520,15 @@ void aarch64_add_sve_properties(Object *obj) for (vq =3D 1; vq <=3D ARM_MAX_VQ; ++vq) { char name[8]; snprintf(name, sizeof(name), "sve%d", vq * 128); - object_property_add(obj, name, "bool", NULL, cpu_arm_get_vq, + object_property_add(obj, name, "bool", &bool_type_info, + cpu_arm_get_vq, cpu_arm_set_vq, NULL, &cpu->sve_vq); } =20 #ifdef CONFIG_USER_ONLY /* Mirror linux /proc/sys/abi/sve_default_vector_length. */ - object_property_add(obj, "sve-default-vector-length", "int32", NULL, + object_property_add(obj, "sve-default-vector-length", "int32", + &int32_type_info, cpu_arm_get_default_vec_len, cpu_arm_set_default_vec_len, NULL, &cpu->sve_default_vq); @@ -543,13 +547,15 @@ void aarch64_add_sme_properties(Object *obj) for (vq =3D 1; vq <=3D ARM_MAX_VQ; vq <<=3D 1) { char name[8]; snprintf(name, sizeof(name), "sme%d", vq * 128); - object_property_add(obj, name, "bool", NULL, cpu_arm_get_vq, + object_property_add(obj, name, "bool", &bool_type_info, + cpu_arm_get_vq, cpu_arm_set_vq, NULL, &cpu->sme_vq); } =20 #ifdef CONFIG_USER_ONLY /* Mirror linux /proc/sys/abi/sme_default_vector_length. */ - object_property_add(obj, "sme-default-vector-length", "int32", NULL, + object_property_add(obj, "sme-default-vector-length", "int32", + &int32_type_info, cpu_arm_get_default_vec_len, cpu_arm_set_default_vec_len, NULL, &cpu->sme_default_vq); diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 8a698a9d20..5c78a64b47 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -20,6 +20,7 @@ #include "qemu/main-loop.h" #include "qom/object.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "system/system.h" #include "system/runstate.h" #include "system/ramblock.h" @@ -1820,7 +1821,7 @@ static void kvm_arch_set_eager_split_size(Object *obj= , Visitor *v, =20 void kvm_arch_accel_class_init(ObjectClass *oc) { - object_class_property_add(oc, "eager-split-size", "size", NULL, + object_class_property_add(oc, "eager-split-size", "size", &size_type_i= nfo, kvm_arch_get_eager_split_size, kvm_arch_set_eager_split_size, NULL, NULL); =20 diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c index 79df821da8..026d074868 100644 --- a/target/arm/tcg/cpu64.c +++ b/target/arm/tcg/cpu64.c @@ -20,6 +20,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "cpu.h" #include "qemu/module.h" #include "qapi/visitor.h" @@ -1392,7 +1393,7 @@ void aarch64_max_v8_tcg_initfn(Object *obj) /* v8.2: FEAT_SVE */ cpu->sve_vq.supported =3D MAKE_64BIT_MASK(0, ARM_MAX_VQ); aarch64_add_sve_properties(OBJECT(cpu)); - object_property_add(OBJECT(cpu), "sve-max-vq", "uint32", NULL, + object_property_add(OBJECT(cpu), "sve-max-vq", "uint32", &uint32_type_= info, cpu_max_get_sve_max_vq, cpu_max_set_sve_max_vq, NULL, NULL); =20 @@ -1529,7 +1530,8 @@ void aarch64_max_v9_tcg_initfn(Object *obj) object_property_add_bool(obj, "x-rme", cpu_arm_get_rme, cpu_arm_set_rm= e); =20 /* v9.4: FEAT_RME_GPC2 */ - object_property_add(obj, "x-l0gptsz", "uint32", NULL, cpu_max_get_l0gp= tsz, + object_property_add(obj, "x-l0gptsz", "uint32", &uint32_type_info, + cpu_max_get_l0gptsz, cpu_max_set_l0gptsz, NULL, NULL); } =20 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 6a05a7144a..9ee96cbe39 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -10486,7 +10486,7 @@ static void x86_cpu_register_bit_prop(X86CPUClass *= xcc, fp =3D g_new0(BitProperty, 1); fp->w =3D w; fp->mask =3D mask; - object_class_property_add(oc, prop_name, "bool", NULL, + object_class_property_add(oc, prop_name, "bool", &bool_type_info, x86_cpu_get_bit_prop, x86_cpu_set_bit_prop, NULL, fp); @@ -11009,13 +11009,13 @@ static void x86_cpu_common_class_init(ObjectClass= *oc, const void *data) =20 dc->user_creatable =3D true; =20 - object_class_property_add(oc, "family", "uint64", NULL, + object_class_property_add(oc, "family", "uint64", &uint64_type_info, x86_cpuid_version_get_family, x86_cpuid_version_set_family, NULL, NULL); - object_class_property_add(oc, "model", "uint64", NULL, + object_class_property_add(oc, "model", "uint64", &uint64_type_info, x86_cpuid_version_get_model, x86_cpuid_version_set_model, NULL, NULL); - object_class_property_add(oc, "stepping", "uint64", NULL, + object_class_property_add(oc, "stepping", "uint64", &uint64_type_info, x86_cpuid_version_get_stepping, x86_cpuid_version_set_stepping, NULL, NULL); object_class_property_add_str(oc, "vendor", @@ -11024,7 +11024,7 @@ static void x86_cpu_common_class_init(ObjectClass *= oc, const void *data) object_class_property_add_str(oc, "model-id", x86_cpuid_get_model_id, x86_cpuid_set_model_id); - object_class_property_add(oc, "tsc-frequency", "int", NULL, + object_class_property_add(oc, "tsc-frequency", "int", &int_type_info, x86_cpuid_get_tsc_freq, x86_cpuid_set_tsc_freq, NULL, NULL); /* @@ -11037,7 +11037,8 @@ static void x86_cpu_common_class_init(ObjectClass *= oc, const void *data) x86_cpu_get_unavailable_features, NULL, NULL, NULL); =20 - object_class_property_add(oc, "avx10-version", "uint8", NULL, + object_class_property_add(oc, "avx10-version", "uint8", + &uint8_type_info, x86_cpuid_get_avx10_version, x86_cpuid_set_avx10_version, NULL, NULL); diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index b52831779f..fcd6d79ce9 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -7107,7 +7107,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc) object_class_property_set_description(oc, "notify-vmexit", "Enable notify VM exit"); =20 - object_class_property_add(oc, "notify-window", "uint32", NULL, + object_class_property_add(oc, "notify-window", "uint32", &uint32_type_= info, kvm_arch_get_notify_window, kvm_arch_set_notify_window, NULL, NULL); @@ -7115,7 +7115,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc) "Clock cycles without an event w= indow " "after which a notification VM e= xit occurs"); =20 - object_class_property_add(oc, "xen-version", "uint32", NULL, + object_class_property_add(oc, "xen-version", "uint32", &uint32_type_in= fo, kvm_arch_get_xen_version, kvm_arch_set_xen_version, NULL, NULL); @@ -7124,14 +7124,16 @@ void kvm_arch_accel_class_init(ObjectClass *oc) "(in XENVER_version form " "e.g. 0x4000a for 4.10)"); =20 - object_class_property_add(oc, "xen-gnttab-max-frames", "uint16", NULL, + object_class_property_add(oc, "xen-gnttab-max-frames", "uint16", + &uint16_type_info, kvm_arch_get_xen_gnttab_max_frames, kvm_arch_set_xen_gnttab_max_frames, NULL, NULL); object_class_property_set_description(oc, "xen-gnttab-max-frames", "Maximum number of grant table f= rames"); =20 - object_class_property_add(oc, "xen-evtchn-max-pirq", "uint16", NULL, + object_class_property_add(oc, "xen-evtchn-max-pirq", "uint16", + &uint16_type_info, kvm_arch_get_xen_evtchn_max_pirq, kvm_arch_set_xen_evtchn_max_pirq, NULL, NULL); diff --git a/target/i386/sev.c b/target/i386/sev.c index d19f98e1c7..c1c12d1125 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -3051,7 +3051,8 @@ sev_guest_instance_init(Object *obj) sev_guest->policy =3D DEFAULT_GUEST_POLICY; object_property_add_uint32_ptr(obj, "handle", &sev_guest->handle, OBJ_PROP_FLAG_READWRITE); - object_property_add(obj, "policy", "uint32", NULL, sev_guest_get_polic= y, + object_property_add(obj, "policy", "uint32", &uint32_type_info, + sev_guest_get_policy, sev_guest_set_policy, NULL, NULL); object_apply_compat_props(obj); =20 @@ -3329,7 +3330,7 @@ sev_snp_guest_class_init(ObjectClass *oc, const void = *data) x86_klass->adjust_cpuid_features =3D sev_snp_adjust_cpuid_features; x86_klass->kvm_type =3D sev_snp_kvm_type; =20 - object_class_property_add(oc, "policy", "uint64", NULL, + object_class_property_add(oc, "policy", "uint64", &uint64_type_info, sev_snp_guest_get_policy, sev_snp_guest_set_policy, NULL, NULL); object_class_property_add_str(oc, "guest-visible-workarounds", @@ -3353,7 +3354,7 @@ sev_snp_guest_class_init(ObjectClass *oc, const void = *data) object_class_property_add_bool(oc, "secure-tsc", sev_snp_guest_get_secure_tsc, sev_snp_guest_set_secure_tsc); - object_class_property_add(oc, "tsc-frequency", "uint32", NULL, + object_class_property_add(oc, "tsc-frequency", "uint32", &uint64_type_= info, sev_snp_guest_get_tsc_frequency, sev_snp_guest_set_tsc_frequency, NULL, NULL); } diff --git a/target/ppc/compat.c b/target/ppc/compat.c index 78f4b23122..8740c8727b 100644 --- a/target/ppc/compat.c +++ b/target/ppc/compat.c @@ -23,6 +23,7 @@ #include "kvm_ppc.h" #include "system/cpus.h" #include "qemu/error-report.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "cpu-models.h" @@ -335,7 +336,7 @@ void ppc_compat_add_property(Object *obj, const char *n= ame, gchar *names, *desc; int i; =20 - object_property_add(obj, name, "string", NULL, + object_property_add(obj, name, "string", &str_type_info, ppc_compat_prop_get, ppc_compat_prop_set, NULL, compat_pvr); =20 diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 85b674217e..adb53aad96 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -29,6 +29,7 @@ #include "target/riscv/tcg/csr.h" #include "internals.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/error-report.h" #include "qemu/timer.h" @@ -1412,20 +1413,26 @@ void riscv_add_satp_mode_properties(Object *obj) { RISCVCPU *cpu =3D RISCV_CPU(obj); =20 - object_property_add(obj, "svbare", "bool", NULL, cpu_riscv_get_satp, + object_property_add(obj, "svbare", "bool", &bool_type_info, + cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); =20 if (cpu->env.misa_mxl =3D=3D MXL_RV32) { - object_property_add(obj, "sv32", "bool", NULL, cpu_riscv_get_satp, + object_property_add(obj, "sv32", "bool", &bool_type_info, + cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); } else { - object_property_add(obj, "sv39", "bool", NULL, cpu_riscv_get_satp, + object_property_add(obj, "sv39", "bool", &bool_type_info, + cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv48", "bool", NULL, cpu_riscv_get_satp, + object_property_add(obj, "sv48", "bool", &bool_type_info, + cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv57", "bool", NULL, cpu_riscv_get_satp, + object_property_add(obj, "sv57", "bool", &bool_type_info, + cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv64", "bool", NULL, cpu_riscv_get_satp, + object_property_add(obj, "sv64", "bool", &bool_type_info, + cpu_riscv_get_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); } } diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c index 9bccd59809..21b675c74c 100644 --- a/target/riscv/kvm/kvm-cpu.c +++ b/target/riscv/kvm/kvm-cpu.c @@ -24,6 +24,7 @@ =20 #include "qemu/timer.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/target-info.h" @@ -541,7 +542,7 @@ static void riscv_cpu_add_kvm_unavail_prop(Object *obj,= const char *prop_name) * unknown to KVM and error out if the user attempts * to enable any of them. */ - object_property_add(obj, prop_name, "bool", NULL, + object_property_add(obj, prop_name, "bool", &bool_type_info, cpu_get_cfg_unavailable, cpu_set_cfg_unavailable, NULL, (void *)prop_name); @@ -561,7 +562,7 @@ static void kvm_riscv_add_cpu_user_properties(Object *c= pu_obj) misa_cfg->name =3D riscv_get_misa_ext_name(bit); misa_cfg->description =3D riscv_get_misa_ext_description(bit); =20 - object_property_add(cpu_obj, misa_cfg->name, "bool", NULL, + object_property_add(cpu_obj, misa_cfg->name, "bool", &bool_type_in= fo, kvm_cpu_get_misa_ext_cfg, kvm_cpu_set_misa_ext_cfg, NULL, misa_cfg); @@ -577,7 +578,7 @@ static void kvm_riscv_add_cpu_user_properties(Object *c= pu_obj) for (i =3D 0; i < ARRAY_SIZE(kvm_multi_ext_cfgs); i++) { KVMCPUConfig *multi_cfg =3D &kvm_multi_ext_cfgs[i]; =20 - object_property_add(cpu_obj, multi_cfg->name, "bool", NULL, + object_property_add(cpu_obj, multi_cfg->name, "bool", &bool_type_i= nfo, kvm_cpu_get_multi_ext_cfg, kvm_cpu_set_multi_ext_cfg, NULL, multi_cfg); diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c index df73f45829..5834ec1524 100644 --- a/target/riscv/tcg/tcg-cpu.c +++ b/target/riscv/tcg/tcg-cpu.c @@ -26,6 +26,7 @@ #include "pmu.h" #include "time_helper.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/accel.h" #include "qemu/error-report.h" @@ -1478,7 +1479,7 @@ static void riscv_cpu_add_misa_properties(Object *cpu= _obj) continue; } =20 - object_property_add(cpu_obj, name, "bool", NULL, + object_property_add(cpu_obj, name, "bool", &bool_type_info, cpu_get_misa_ext_cfg, cpu_set_misa_ext_cfg, NULL, (void *)misa_cfg); @@ -1532,7 +1533,7 @@ static void riscv_cpu_add_profiles(Object *cpu_obj) for (int i =3D 0; riscv_profiles[i] !=3D NULL; i++) { RISCVCPUProfile *profile =3D riscv_profiles[i]; =20 - object_property_add(cpu_obj, profile->name, "bool", NULL, + object_property_add(cpu_obj, profile->name, "bool", &bool_type_inf= o, cpu_get_profile, cpu_set_profile, NULL, (void *)profile); =20 @@ -1608,7 +1609,7 @@ static void riscv_cpu_add_user_properties(Object *obj) =20 for (edata =3D isa_edata_arr; edata && edata->name; edata++) { if (edata->prop_name) { - object_property_add(obj, edata->prop_name, "bool", NULL, + object_property_add(obj, edata->prop_name, "bool", &bool_type_= info, cpu_get_multi_ext_cfg, cpu_set_multi_ext_cfg, NULL, (void *)&edata->ext_enable_offset); diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 0718df791f..abbfa96646 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -17,6 +17,7 @@ #include "system/kvm.h" #include "system/tcg.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/error-report.h" #include "qapi/visitor.h" #include "qemu/module.h" @@ -792,13 +793,14 @@ void s390_cpu_model_class_register_props(ObjectClass = *oc) =20 for (feat =3D 0; feat < S390_FEAT_MAX; feat++) { const S390FeatDef *def =3D s390_feat_def(feat); - object_class_property_add(oc, def->name, "bool", NULL, get_feature, + object_class_property_add(oc, def->name, "bool", &bool_type_info, + get_feature, set_feature, NULL, (void *) feat); object_class_property_set_description(oc, def->name, def->desc); } for (group =3D 0; group < S390_FEAT_GROUP_MAX; group++) { const S390FeatGroupDef *def =3D s390_feat_group_def(group); - object_class_property_add(oc, def->name, "bool", NULL, + object_class_property_add(oc, def->name, "bool", &bool_type_info, get_feature_group, set_feature_group, NULL, (void *) group); object_class_property_set_description(oc, def->name, def->desc); diff --git a/tests/unit/test-qdev-global-props.c b/tests/unit/test-qdev-glo= bal-props.c index 35fb5eca6f..e32c0eee55 100644 --- a/tests/unit/test-qdev-global-props.c +++ b/tests/unit/test-qdev-global-props.c @@ -27,6 +27,7 @@ #include "hw/core/qdev-properties.h" #include "qom/object.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" =20 =20 @@ -171,11 +172,11 @@ static void prop2_accessor(Object *obj, Visitor *v, c= onst char *name, =20 static void dynamic_instance_init(Object *obj) { - object_property_add(obj, "prop1", "uint32", NULL, prop1_accessor, - prop1_accessor, + object_property_add(obj, "prop1", "uint32", &uint32_type_info, + prop1_accessor, prop1_accessor, NULL, NULL); - object_property_add(obj, "prop2", "uint32", NULL, prop2_accessor, - prop2_accessor, + object_property_add(obj, "prop2", "uint32", &uint32_type_info, + prop2_accessor, prop2_accessor, NULL, NULL); } =20 diff --git a/ui/console.c b/ui/console.c index 732b4afee0..c995abc5d1 100644 --- a/ui/console.c +++ b/ui/console.c @@ -28,6 +28,7 @@ #include "ui/vgafont.h" #include "hw/core/qdev.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-commands-ui.h" #include "qapi/visitor.h" #include "qemu/coroutine.h" @@ -535,7 +536,7 @@ qemu_graphic_console_class_init(ObjectClass *oc, const = void *data) offsetof(QemuGraphicConsole, device), object_property_allow_set_link, OBJ_PROP_LINK_STRONG); - object_class_property_add(oc, "head", "uint32", NULL, + object_class_property_add(oc, "head", "uint32", &uint32_type_info, qemu_graphic_console_prop_get_head, NULL, NULL, NULL); =20 diff --git a/util/thread-context.c b/util/thread-context.c index 4fe7a6c8f4..d653178048 100644 --- a/util/thread-context.c +++ b/util/thread-context.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "qemu/thread-context.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-builtin-visit.h" #include "qapi/visitor.h" #include "qemu/config-file.h" @@ -278,13 +279,16 @@ static void thread_context_class_init(ObjectClass *oc= , const void *data) UserCreatableClass *ucc =3D USER_CREATABLE_CLASS(oc); =20 ucc->complete =3D thread_context_instance_complete; - object_class_property_add(oc, "thread-id", "uint64", NULL, + object_class_property_add(oc, "thread-id", "uint64", + &uint64_type_info, thread_context_get_thread_id, NULL, NULL, NULL); - object_class_property_add(oc, "cpu-affinity", "[uint16]", NULL, + object_class_property_add(oc, "cpu-affinity", "[uint16]", + &uint16List_type_info, thread_context_get_cpu_affinity, thread_context_set_cpu_affinity, NULL, NULL); - object_class_property_add(oc, "node-affinity", "[uint16]", NULL, NULL, + object_class_property_add(oc, "node-affinity", "[uint16]", + &uint16List_type_info, NULL, thread_context_set_node_affinity, NULL, NULL= ); } =20 --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793631096; cv=none; d=zohomail.com; s=zohoarc; b=dRgqc75x9AH4rJgIz8wrDob/LpYUcBaSKs6LERhsoV8j0nGXD8tvhTE5bWTQOTjRSdnCmnRFDdQ/IKfXE76qYh1wODCVEQnXXVf6jl15QUCM8h0jqKLs6q5IeAvJqcBbBGgl17OpVW0Bzk9zAsrv144IDqgBoaDWlIkjC4pP0Rc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631096; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6fNKZaqEx5aoauHJ0bKVGcTBaDnHthqOrX1RTQLd9Ko=; b=ilrAtuQlbtHgjqXzYLpTqQXohLJCr72cI7OO3j+K9gUJlBTlNhXZ5K6pRCDhtAgrUsaCbWuPqAEct4yejdfOQ/ostdmXWvljSYG2a0pp/y51w8fpYVmojR6eBV2FfsrUkBkpeFEHEuUVZNJUwqckawz/X7YxxcruONkAzuOep0k= 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 1793631096052755.7887758524738; Mon, 2 Nov 2026 06:51:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDf-0003RL-AW; Mon, 02 Nov 2026 09:41:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDC-0003DP-6W for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD8-0008Tb-Aj for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:37 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-449-c_iAIBn4MsS_uJhxUWrZvQ-1; Mon, 02 Nov 2026 09:40:32 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1BDC8195DE63; Mon, 2 Nov 2026 14:40:31 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B4D451956049; Mon, 2 Nov 2026 14:40:30 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D37BB21E6686; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6fNKZaqEx5aoauHJ0bKVGcTBaDnHthqOrX1RTQLd9Ko=; b=bvSz9OcQr9kzJ7/hpHPmQjh0kxq9Sf6QDPu7NHjdu5MJT39F8FyXctJG608geC3ALVCCQe qnXnGPFudBit/xSAlir1ZVO+vHRMcXZ3c1rhZ6x4un/nk/0llA0ZfuNiVQq8LVean0AiK6 0ZwGniTMJZ3QZhj2b5zNbDGPxtCVh64= X-MC-Unique: c_iAIBn4MsS_uJhxUWrZvQ-1 X-Mimecast-MFC-AGG-ID: c_iAIBn4MsS_uJhxUWrZvQ_1793630431 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 54/74] i386/cpu: convert strList property to QAPI-aware registration Date: Mon, 2 Nov 2026 15:39:58 +0100 Message-ID: <20261102144018.3212223-55-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793631097476154100 From: Marc-Andr=C3=A9 Lureau Pass appropriate QAPITypeInfo to object_class_property_add(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-38-armbru@redhat.com> --- target/i386/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 9ee96cbe39..eab0d5a4d4 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -11033,7 +11033,8 @@ static void x86_cpu_common_class_init(ObjectClass *= oc, const void *data) * QMP command: they list the features that would have prevented the * CPU from running if the "enforce" flag was set. */ - object_class_property_add(oc, "unavailable-features", "strList", NULL, + object_class_property_add(oc, "unavailable-features", "strList", + &strList_type_info, x86_cpu_get_unavailable_features, NULL, NULL, NULL); =20 --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630750; cv=none; d=zohomail.com; s=zohoarc; b=MNGR1t3iC3zwMNyG85NdRLcBZ08w/TGuwKYGYVKpeRSJW38+Yc223Cx5oId9ZQ3P4wrUMy6LWoJHtafx3RQJ7NPM3200qoaLML7oGuU3/ndPNBiDg5CKA3BRir4ZtGnhp1wAGG3nm5T8ybb/s4Kyglk9x9Idi+G4HUcFwbS/5QU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630750; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IFpxyiH0UmA4xTEsvVq6E1bmPt0zVrT2xXUfg7k6Ohg=; b=VyafBT9G/osSwlagXsDXxXAzBePUxDwnyyC3TSKfEsS8KBwHDYHzyRyzJWaKD5wUq+r9HHVs3VORx2F0SVQ4rmtHkqDs++k6fP7KTHaH+d/O73B3Yjd+iQtPDSvWSlcKZUnokizGdkjs5b/A2K3UAeVzMpbrjXygiKPPoEhmojE= 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 1793630750335566.018063975541; Mon, 2 Nov 2026 06:45:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtEl-0004xg-Ls; Mon, 02 Nov 2026 09:42:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDI-0003GC-0L for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtD9-0008Ud-WB for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:43 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-203-cJQA0Va4MHapo2rYZaPckg-1; Mon, 02 Nov 2026 09:40:33 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B893E180049F; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 757A01956049; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D78BB21E668C; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IFpxyiH0UmA4xTEsvVq6E1bmPt0zVrT2xXUfg7k6Ohg=; b=DwzhErhtzB5sChWQp9NfiZHTOJVmd9vDsyeigG67zfMz3VTfCEeG2pEqaurZRpzuN9xwKL FXtAGSKmjVYwtgKBX2n/Urk0h4mhhrnI5wXHDGWgk0jn4auo5q+5tWX97F3eIIIQpRzbx3 Lt/bxbStACLmRXj2R/SkXeZ/UWbC2/4= X-MC-Unique: cJQA0Va4MHapo2rYZaPckg-1 X-Mimecast-MFC-AGG-ID: cJQA0Va4MHapo2rYZaPckg_1793630432 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 55/74] accel/hvf: convert OnOffSplit property to QAPI-aware registration Date: Mon, 2 Nov 2026 15:39:59 +0100 Message-ID: <20261102144018.3212223-56-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630752170154100 From: Marc-Andr=C3=A9 Lureau Convert the OnOffSplit property from manual visitor-based callbacks to object_class_property_add_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-39-armbru@redhat.com> --- accel/hvf/hvf-all.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 213ee15b4a..938379b9f2 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -11,6 +11,7 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qapi-visit-common.h" #include "accel/accel-ops.h" #include "exec/cpu-common.h" @@ -230,18 +231,12 @@ static int hvf_accel_init(AccelState *as, MachineStat= e *ms) return hvf_arch_init(); } =20 -static void hvf_set_kernel_irqchip(Object *obj, Visitor *v, - const char *name, void *opaque, +static void hvf_set_kernel_irqchip(Object *obj, int value, Error **errp) { - OnOffSplit mode; - hvf_kernel_irqchip_override =3D true; - if (!visit_type_OnOffSplit(v, name, &mode, errp)) { - return; - } =20 - switch (mode) { + switch (value) { case ON_OFF_SPLIT_ON: #ifdef HOST_X86_64 /* macOS 12 onwards exposes an HVF virtual APIC. */ @@ -261,11 +256,7 @@ static void hvf_set_kernel_irqchip(Object *obj, Visito= r *v, break; =20 default: - /* - * The value was checked in visit_type_OnOffSplit() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 @@ -277,9 +268,10 @@ static void hvf_accel_class_init(ObjectClass *oc, cons= t void *data) ac->allowed =3D &hvf_allowed; hvf_kernel_irqchip_override =3D false; hvf_kernel_irqchip =3D false; - object_class_property_add(oc, "kernel-irqchip", "on|off|split", NULL, - NULL, hvf_set_kernel_irqchip, - NULL, NULL); + + object_class_property_add_enum(oc, "kernel-irqchip", "on|off|split", + &OnOffSplit_type_info, NULL, + NULL, hvf_set_kernel_irqchip); object_class_property_set_description(oc, "kernel-irqchip", "Configure HVF irqchip"); } --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630899; cv=none; d=zohomail.com; s=zohoarc; b=iu8/vbcxdFZx/NomvTqPMyuY1v2ge4KIkMo8/giyWL6U7W5MPvbxkkPEEIhoVw/L9aducf2zFONfgTFglY7Ia87NaiApgpmRWEFogFkMRwhAMKkxCz0zy1DX6XnRPXmbp5mvFR2LFGjPJehJD/LZ9xjdngDW3gvP3NMFLp0DBB4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630899; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Q2Esz/MEkk0GrEmq3Kukq6w++DRn/e542UjS+tX639c=; b=eIvHRV62zZf3CJrfOG+Y8Ziw8mZHYYA+BW4LG+wb0YE9ghUb2AemAgdUa0YaVxdQiWrCH4SBdrGIqkMqQ4NQUFYp13+7f+1hiTaSfjdktUFX7mz38kl168nPgA+xQCfdCh8lvVqAr+c4gvLD2yxlA8QbeRbWSkHxeoCFJUstoxQ= 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 1793630899423743.8615411890386; Mon, 2 Nov 2026 06:48:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtFA-00061u-7d; Mon, 02 Nov 2026 09:42:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDM-0003Ho-CP for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDB-0008WG-M5 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:46 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-203-9HJjKY3gNP2tbcJvIQqkgg-1; Mon, 02 Nov 2026 09:40:33 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A8BF2180A8FC; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6BDF1410; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id DBA4421E66BB; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q2Esz/MEkk0GrEmq3Kukq6w++DRn/e542UjS+tX639c=; b=Rj8sa+pZnIWyAaa9A+YOd1rQu0lP9nO+ezUfW65Nn88I63Vo40UUsv68zpcJ6PhG2kT8FP gcRuJHAWku/fM5TTKwkuD7fu4ArFkScWKrGUgyPnvd4BYmQpDX8HIwjTmss4m6Q1aWcKk1 NvJ5WS5CLf4gWAfpzUfLz1a5q1X89X4= X-MC-Unique: 9HJjKY3gNP2tbcJvIQqkgg-1 X-Mimecast-MFC-AGG-ID: 9HJjKY3gNP2tbcJvIQqkgg_1793630432 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 56/74] i386/x86: convert SgxEPCList property to QAPI-aware registration Date: Mon, 2 Nov 2026 15:40:00 +0100 Message-ID: <20261102144018.3212223-57-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630902492154100 From: Marc-Andr=C3=A9 Lureau Pass appropriate QAPITypeInfo to object_class_property_add(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-40-armbru@redhat.com> --- hw/i386/x86.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index b490c4e715..4e5a7cf270 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -25,6 +25,7 @@ #include "qemu/units.h" #include "qapi/error.h" #include "qapi/qapi-type-infos-common.h" +#include "qapi/qapi-type-infos-machine.h" #include "qapi/qapi-visit-machine.h" #include "qapi/visitor.h" #include "system/qtest.h" @@ -423,7 +424,7 @@ static void x86_machine_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, X86_MACHINE_BUS_LOCK_RATELIM= IT, "Set the ratelimit for the bus locks acquired in VMs"); =20 - object_class_property_add(oc, "sgx-epc", "SgxEPC", NULL, + object_class_property_add(oc, "sgx-epc", "SgxEPC", &SgxEPCList_type_in= fo, machine_get_sgx_epc, machine_set_sgx_epc, NULL, NULL); object_class_property_set_description(oc, "sgx-epc", --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630605; cv=none; d=zohomail.com; s=zohoarc; b=WzFgf0apRwOetCjQihk5ymIxzMupaU1nSCOVXI72lKU1/+Lk7LufAxl2EigX8vl/TCao14sF2LEABlLLaxPVMgabIyxT0za0Iknq2sG0rMPAN+418tEWZUUYQwG9cpAQ3/Z39ek96UGvclS/V/9OSUY6lizhVbeTb9JOC4FQxMg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630605; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZMwH+IvhE8mNAIfNaD0tXWUX8ZMwx21s2L5mTVGsNyU=; b=Gs8e8ZJ5Ny5Lwme0wMIUImLUvsgRC44vJ4124vjaS9Q28pxQLM+kO2K7GFSxrFJvsmlZQVnXRyOuU98580RcP45fp2e73Pzg8riQQ6D9PFWJpgk/8vhazjS1VMqkNSdI/VhyjogNexHRbKS17zxSVQ2GsLQps4bLLnYDfcogbY4= 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 179363060581322.328690347029806; Mon, 2 Nov 2026 06:43:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDg-0003Sn-Nk; Mon, 02 Nov 2026 09:41:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDJ-0003HE-6h for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDA-0008Um-1R for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:44 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-325-BiYpAv2QOzyGm6GYaq_u3g-1; Mon, 02 Nov 2026 09:40:33 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E4D9C1945CB4; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6C78930000E7; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id DFE1221E6600; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZMwH+IvhE8mNAIfNaD0tXWUX8ZMwx21s2L5mTVGsNyU=; b=IeZd1exE3aWBSYUiOO/ZtEWr2kk57EKi+UF4hvFQnVjIqrjrJMm8o6btpTKE2V+mxRf/tm jB7rfyEnzMM+/juYx3xDlg6YgWnxGEmsktbsqIWXptn0WJb9MeFAT0FHYov9rJtaXLvMNc uMelqpbX+tTw/8bIeaIcYsptBSS8PMM= X-MC-Unique: BiYpAv2QOzyGm6GYaq_u3g-1 X-Mimecast-MFC-AGG-ID: BiYpAv2QOzyGm6GYaq_u3g_1793630433 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 57/74] virtio-balloon: convert guest-stats property to QAPI type Date: Mon, 2 Nov 2026 15:40:01 +0100 Message-ID: <20261102144018.3212223-58-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630607895154100 From: Marc-Andr=C3=A9 Lureau Define VirtioBalloonStats and VirtioBalloonGuestStats QAPI struct types in the schema, replacing the hand-rolled visitor in balloon_stats_get_all() with a generated visit_type_VirtioBalloonGuestStats() call. The wire format is preserved: the JSON output from qom-get is identical to the previous hand-rolled visitor output. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-41-armbru@redhat.com> --- docs/interop/virtio-balloon-stats.rst | 22 +------ qapi/machine.json | 88 +++++++++++++++++++++++++++ hw/virtio/virtio-balloon.c | 85 +++++++++----------------- 3 files changed, 119 insertions(+), 76 deletions(-) diff --git a/docs/interop/virtio-balloon-stats.rst b/docs/interop/virtio-ba= lloon-stats.rst index b9a6a6edb2..88d3271bbb 100644 --- a/docs/interop/virtio-balloon-stats.rst +++ b/docs/interop/virtio-balloon-stats.rst @@ -22,27 +22,7 @@ polling the guest's balloon driver for new stats in the = specified time interval. =20 To retrieve those stats, clients have to query the guest-stats property, -which will return a dictionary containing: - - * A key named 'stats', containing all available stats. If the guest - doesn't support a particular stat, or if it couldn't be retrieved, - its value will be -1. Currently, the following stats are supported: - - - stat-swap-in - - stat-swap-out - - stat-major-faults - - stat-minor-faults - - stat-free-memory - - stat-total-memory - - stat-available-memory - - stat-disk-caches - - stat-htlb-pgalloc - - stat-htlb-pgfail - - * A key named last-update, which contains the last stats update - timestamp in seconds. Since this timestamp is generated by the host, - a buggy guest can't influence its value. The value is 0 if the guest - has not updated the stats (yet). +which will return a VirtioBalloonGuestStats (see QAPI documentation). =20 It's also important to note the following: =20 diff --git a/qapi/machine.json b/qapi/machine.json index 9dc63c1c8b..2ee7055dcd 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1126,6 +1126,94 @@ ## { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } } =20 +## +# @VirtioBalloonStats: +# VirtIO balloon device guest memory statistics. +# +# If the guest doesn't support a particular stat, or if it couldn't be +# retrieved, its value will be -1. +# +# @stat-swap-in: The amount of memory that has been swapped in (in +# bytes). +# +# @stat-swap-out: The amount of memory that has been swapped out to +# disk (in bytes). +# +# @stat-major-faults: The number of major page faults that have +# occurred. +# +# @stat-minor-faults: The number of minor page faults that have +# occurred. +# +# @stat-free-memory: The amount of memory not being used for any +# purpose (in bytes). +# +# @stat-total-memory: The total amount of memory available (in bytes). +# +# @stat-available-memory: An estimate of how much memory is available +# (in bytes) for starting new applications, without pushing the +# system to swap. +# +# @stat-disk-caches: The amount of memory, in bytes, that can be +# quickly reclaimed without additional I/O. Typically these pages +# are used for caching files from disk. +# +# @stat-htlb-pgalloc: The number of successful hugetlb page +# allocations +# +# @stat-htlb-pgfail: The number of failed hugetlb page allocations +# +# @stat-oom-kills: The number of OOM killer invocations +# +# @stat-alloc-stalls: The number of memory allocation stalls +# +# @stat-async-scans: The number of memory scanned asynchronously +# +# @stat-direct-scans: The number of memory scanned directly +# +# @stat-async-reclaims: The number of memory reclaimed asynchronously +# +# @stat-direct-reclaims: The number of memory reclaimed directly +# +# Since: 11.2 +## +{ 'struct': 'VirtioBalloonStats', + 'data': { + 'stat-swap-in': 'uint64', + 'stat-swap-out': 'uint64', + 'stat-major-faults': 'uint64', + 'stat-minor-faults': 'uint64', + 'stat-free-memory': 'uint64', + 'stat-total-memory': 'uint64', + 'stat-available-memory': 'uint64', + 'stat-disk-caches': 'uint64', + 'stat-htlb-pgalloc': 'uint64', + 'stat-htlb-pgfail': 'uint64', + 'stat-oom-kills': 'uint64', + 'stat-alloc-stalls': 'uint64', + 'stat-async-scans': 'uint64', + 'stat-direct-scans': 'uint64', + 'stat-async-reclaims': 'uint64', + 'stat-direct-reclaims': 'uint64' } } + +## +# @VirtioBalloonGuestStats: +# Guest statistics from the VirtIO balloon device. +# +# @last-update: Timestamp in seconds of the last stats update from the +# guest. Since this timestamp is generated by the host, a buggy +# guest can't influence its value. The value is 0 if the guest +# has not updated the stats, yet. +# +# @stats: balloon memory statistics +# +# Since: 11.2 +## +{ 'struct': 'VirtioBalloonGuestStats', + 'data': { + 'last-update': 'int', + 'stats': 'VirtioBalloonStats' } } + ## # @query-balloon: # Return information about the balloon device. diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 366f88e048..547173e035 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -29,6 +29,8 @@ #include "qapi/error.h" #include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-events-machine.h" +#include "qapi/qapi-type-infos-machine.h" +#include "qapi/qapi-visit-machine.h" #include "qapi/visitor.h" #include "trace.h" #include "qemu/error-report.h" @@ -170,34 +172,6 @@ static void balloon_deflate_page(VirtIOBalloon *balloo= n, } } =20 -/* - * All stats upto VIRTIO_BALLOON_S_NR /must/ have a - * non-NULL name declared here, since these are used - * as keys for populating the QDict with stats - */ -static const char *balloon_stat_names[] =3D { - [VIRTIO_BALLOON_S_SWAP_IN] =3D "stat-swap-in", - [VIRTIO_BALLOON_S_SWAP_OUT] =3D "stat-swap-out", - [VIRTIO_BALLOON_S_MAJFLT] =3D "stat-major-faults", - [VIRTIO_BALLOON_S_MINFLT] =3D "stat-minor-faults", - [VIRTIO_BALLOON_S_MEMFREE] =3D "stat-free-memory", - - [VIRTIO_BALLOON_S_MEMTOT] =3D "stat-total-memory", - [VIRTIO_BALLOON_S_AVAIL] =3D "stat-available-memory", - [VIRTIO_BALLOON_S_CACHES] =3D "stat-disk-caches", - [VIRTIO_BALLOON_S_HTLB_PGALLOC] =3D "stat-htlb-pgalloc", - [VIRTIO_BALLOON_S_HTLB_PGFAIL] =3D "stat-htlb-pgfail", - - [VIRTIO_BALLOON_S_OOM_KILL] =3D "stat-oom-kills", - [VIRTIO_BALLOON_S_ALLOC_STALL] =3D "stat-alloc-stalls", - [VIRTIO_BALLOON_S_ASYNC_SCAN] =3D "stat-async-scans", - [VIRTIO_BALLOON_S_DIRECT_SCAN] =3D "stat-direct-scans", - [VIRTIO_BALLOON_S_ASYNC_RECLAIM] =3D "stat-async-reclaims", - - [VIRTIO_BALLOON_S_DIRECT_RECLAIM] =3D "stat-direct-reclaims", -}; -G_STATIC_ASSERT(G_N_ELEMENTS(balloon_stat_names) =3D=3D VIRTIO_BALLOON_S_N= R); - /* * reset_stats - Mark all items in the stats array as unset * @@ -258,33 +232,33 @@ static void balloon_stats_get_all(Object *obj, Visito= r *v, const char *name, void *opaque, Error **errp) { VirtIOBalloon *s =3D VIRTIO_BALLOON(obj); - bool ok =3D false; - int i; + VirtioBalloonStats stats =3D { + .stat_swap_in =3D s->stats[VIRTIO_BALLOON_S_SWAP_IN], + .stat_swap_out =3D s->stats[VIRTIO_BALLOON_S_SWAP_OUT], + .stat_major_faults =3D s->stats[VIRTIO_BALLOON_S_MAJFLT], + .stat_minor_faults =3D s->stats[VIRTIO_BALLOON_S_MINFLT], + .stat_free_memory =3D s->stats[VIRTIO_BALLOON_S_MEMFREE], + .stat_total_memory =3D s->stats[VIRTIO_BALLOON_S_MEMTOT], + .stat_available_memory =3D s->stats[VIRTIO_BALLOON_S_AVAIL], + .stat_disk_caches =3D s->stats[VIRTIO_BALLOON_S_CACHES], + .stat_htlb_pgalloc =3D s->stats[VIRTIO_BALLOON_S_HTLB_PGALLOC], + .stat_htlb_pgfail =3D s->stats[VIRTIO_BALLOON_S_HTLB_PGFAIL], + .stat_oom_kills =3D s->stats[VIRTIO_BALLOON_S_OOM_KILL], + .stat_alloc_stalls =3D s->stats[VIRTIO_BALLOON_S_ALLOC_STALL], + .stat_async_scans =3D s->stats[VIRTIO_BALLOON_S_ASYNC_SCAN], + .stat_direct_scans =3D s->stats[VIRTIO_BALLOON_S_DIRECT_SCAN], + .stat_async_reclaims =3D s->stats[VIRTIO_BALLOON_S_ASYNC_RECLAIM], + .stat_direct_reclaims =3D s->stats[VIRTIO_BALLOON_S_DIRECT_RECLAIM= ], + }; + /* Update VirtioBalloonStats QAPI type when new stats are added */ + G_STATIC_ASSERT(VIRTIO_BALLOON_S_NR =3D=3D 16); + VirtioBalloonGuestStats guest_stats =3D { + .last_update =3D s->stats_last_update, + .stats =3D &stats, + }; + VirtioBalloonGuestStats *argp =3D &guest_stats; =20 - if (!visit_start_struct(v, name, NULL, 0, errp)) { - return; - } - if (!visit_type_int(v, "last-update", &s->stats_last_update, errp)) { - goto out_end; - } - - if (!visit_start_struct(v, "stats", NULL, 0, errp)) { - goto out_end; - } - for (i =3D 0; i < VIRTIO_BALLOON_S_NR; i++) { - if (!visit_type_uint64(v, balloon_stat_names[i], &s->stats[i], err= p)) { - goto out_nested; - } - } - ok =3D visit_check_struct(v, errp); -out_nested: - visit_end_struct(v, NULL); - - if (ok) { - visit_check_struct(v, errp); - } -out_end: - visit_end_struct(v, NULL); + visit_type_VirtioBalloonGuestStats(v, name, &argp, errp); } =20 static void balloon_stats_get_poll_interval(Object *obj, Visitor *v, @@ -1037,7 +1011,8 @@ static void virtio_balloon_instance_init(Object *obj) s->free_page_hint_cmd_id =3D VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN; s->free_page_hint_notify.notify =3D virtio_balloon_free_page_hint_noti= fy; =20 - object_property_add(obj, "guest-stats", "guest statistics", NULL, + object_property_add(obj, "guest-stats", "guest statistics", + &VirtioBalloonGuestStats_type_info, balloon_stats_get_all, NULL, NULL, NULL); =20 object_property_add(obj, "guest-stats-polling-interval", "int", --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630539; cv=none; d=zohomail.com; s=zohoarc; b=DqxmuVHypAYyI+v1+Xf9PX1pmXDuN++SsG1WM0hYE2fGKtVstBH8YpmPu1egqgsV6RbIDTXcrB5odbBNW4HtL4c3rvVDpRBsDufKx3iC/iwEzEKu1DTa4eG1ddS9xFQLJkDUZaidFgADG4D7hQy53irPLRUsVQ9Z17B3drfcZwQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630539; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YMn60zkfPklPk5sJ9TZJO8lKOLTzBOcLR9kmoNlY2/8=; b=k3zBdhj5HgeVwbDX8YkBFNGdlDkeR6XIi5LrgJCHzg7HcMciKUJKVn7lmo7fzTZhGx7h4YooKFHKnV2W6TwUj0ORgDva7TyEjqDUIkypTAdB2uT4BTCNOcduCqEL54liWvaDh59b4PPSmf+3QRLGZWK8VmG5T1zcMmXWvHLAjvQ= 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 1793630539924343.3792496035644; Mon, 2 Nov 2026 06:42:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDl-0003VO-Eb; Mon, 02 Nov 2026 09:41:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDM-0003Hr-Dk for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDB-0008V7-Mp for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:47 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-333-6qaN2yj8O12RrRQILmeURA-1; Mon, 02 Nov 2026 09:40:34 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0C6681955EAE; Mon, 2 Nov 2026 14:40:33 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 83E9B1800345; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E431B21E6603; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YMn60zkfPklPk5sJ9TZJO8lKOLTzBOcLR9kmoNlY2/8=; b=WHlOJkp8sH2Mht3e0AFNPuv0EO25V3NkDG79nU5BXKHfaiMm2+3qT7PdmJh3Pi1LXOqCwG ANJv9X4iGyVKW96/nxck+rUViDtTaRpMb//eou1izsC+TNVnbm8enwqABK7RjIrHNmLIkL PCDSdIk8AkAVUkBNVFKq8XclHItWceY= X-MC-Unique: 6qaN2yj8O12RrRQILmeURA-1 X-Mimecast-MFC-AGG-ID: 6qaN2yj8O12RrRQILmeURA_1793630433 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Amit Machhiwal Subject: [PULL 58/74] qom: replace object_property_add_tm with StructTm QAPI type Date: Mon, 2 Nov 2026 15:40:02 +0100 Message-ID: <20261102144018.3212223-59-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630543153154100 From: Marc-Andr=C3=A9 Lureau Define a StructTm QAPI struct in common.json matching the existing "struct tm" property wire format (tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec as int32). Convert the two callers (mc146818rtc and spapr_rtc) to pass its QAPITypeInfo to object_class_property_add() / object_property_add(), and use a standard ObjectPropertyAccessor that populates a StructTm and calls the generated visitor. Remove object_property_add_tm(), object_class_property_add_tm(), the TMProperty type, and the property_get_tm() helper from qom/object.c, along with their declarations in object.h. Reviewed-by: Amit Machhiwal Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-42-armbru@redhat.com> --- qapi/common.json | 27 +++++++++++++++++ qapi/pragma.json | 1 + include/qom/object.h | 29 ------------------ hw/ppc/spapr_rtc.c | 25 ++++++++++++++-- hw/rtc/mc146818rtc.c | 23 +++++++++++++-- qom/object.c | 70 -------------------------------------------- 6 files changed, 70 insertions(+), 105 deletions(-) diff --git a/qapi/common.json b/qapi/common.json index 1352e664b2..68b649ecf2 100644 --- a/qapi/common.json +++ b/qapi/common.json @@ -218,3 +218,30 @@ ## { 'enum': 'EndianMode', 'data': [ 'unspecified', 'little', 'big' ] } + +## +# @StructTm: +# Broken-down time. Field semantics match C ``struct tm``. +# +# @tm_year: years since 1900 +# +# @tm_mon: months since January (0-11) +# +# @tm_mday: day of the month (1-31) +# +# @tm_hour: hours since midnight (0-23) +# +# @tm_min: minutes after the hour (0-59) +# +# @tm_sec: seconds after the minute (0-59, 60-61 for leap seconds) +# +# Since: 11.2 +## +{ 'struct': 'StructTm', + 'data': { + 'tm_year': 'int32', + 'tm_mon': 'int32', + 'tm_mday': 'int32', + 'tm_hour': 'int32', + 'tm_min': 'int32', + 'tm_sec': 'int32' } } diff --git a/qapi/pragma.json b/qapi/pragma.json index 73807abc6a..0b75fb6438 100644 --- a/qapi/pragma.json +++ b/qapi/pragma.json @@ -109,6 +109,7 @@ 'QKeyCode', # send-key, input-sent-event 'QapiErrorClass', # QMP error replies 'SshHostKeyCheckMode', # blockdev-add, -blockdev + 'StructTm', # qom-get of RTC date property 'SysEmuTarget', # query-cpu-fast, query-target 'UuidInfo', # query-uuid 'VncClientInfo', # query-vnc, query-vnc-servers, ... diff --git a/include/qom/object.h b/include/qom/object.h index 25fc32e4ed..0fe97e9371 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -2027,35 +2027,6 @@ ObjectProperty *object_class_property_add_enum(Objec= tClass *klass, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)); =20 -/** - * object_property_add_tm: - * @obj: the object to add a property to - * @name: the name of the property - * @get: the getter or NULL if the property is write-only. - * - * Add a read-only struct tm valued property using a getter function. - * This function will add a property of type 'struct tm'. - * - * Returns: The newly added property on success, or %NULL on failure. - */ -ObjectProperty *object_property_add_tm(Object *obj, const char *name, - void (*get)(Object *, struct tm *, Error **)); - -/** - * object_class_property_add_tm: - * @klass: the object class to add a property to - * @name: the name of the property - * @get: the getter or NULL if the property is write-only. - * - * Add a read-only struct tm valued property using a getter function. - * This function will add a property of type 'struct tm'. - * - * Returns: The newly added property on success, or %NULL on failure. - */ -ObjectProperty *object_class_property_add_tm(ObjectClass *klass, - const char *name, - void (*get)(Object *, struct tm *, Error **)); - typedef enum { /* Automatically add a getter to the property */ OBJ_PROP_FLAG_READ =3D 1 << 0, diff --git a/hw/ppc/spapr_rtc.c b/hw/ppc/spapr_rtc.c index 1f7d2d8f89..10d4cddb42 100644 --- a/hw/ppc/spapr_rtc.c +++ b/hw/ppc/spapr_rtc.c @@ -33,6 +33,9 @@ #include "migration/vmstate.h" #include "qapi/error.h" #include "qapi/qapi-events-misc.h" +#include "qapi/qapi-type-infos-common.h" +#include "qapi/qapi-visit-common.h" +#include "qapi/visitor.h" #include "qemu/cutils.h" #include "qemu/module.h" =20 @@ -131,9 +134,23 @@ static void rtas_set_time_of_day(PowerPCCPU *cpu, Spap= rMachineState *spapr, rtas_st(rets, 0, RTAS_OUT_SUCCESS); } =20 -static void spapr_rtc_qom_date(Object *obj, struct tm *current_tm, Error *= *errp) +static void spapr_rtc_qom_date(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { - spapr_rtc_read(SPAPR_RTC(obj), current_tm, NULL); + struct tm value; + StructTm tm, *tmp =3D &tm; + + spapr_rtc_read(SPAPR_RTC(obj), &value, NULL); + + tm =3D (StructTm) { + .tm_year =3D value.tm_year, + .tm_mon =3D value.tm_mon, + .tm_mday =3D value.tm_mday, + .tm_hour =3D value.tm_hour, + .tm_min =3D value.tm_min, + .tm_sec =3D value.tm_sec, + }; + visit_type_StructTm(v, name, &tmp, errp); } =20 static void spapr_rtc_realize(DeviceState *dev, Error **errp) @@ -150,7 +167,9 @@ static void spapr_rtc_realize(DeviceState *dev, Error *= *errp) rtc_ns =3D qemu_clock_get_ns(rtc_clock); rtc->ns_offset =3D host_s * NANOSECONDS_PER_SECOND - rtc_ns; =20 - object_property_add_tm(OBJECT(rtc), "date", spapr_rtc_qom_date); + object_property_add(OBJECT(rtc), "date", "struct tm", + &StructTm_type_info, + spapr_rtc_qom_date, NULL, NULL, NULL); } =20 static const VMStateDescription vmstate_spapr_rtc =3D { diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index ba396435d1..835684abce 100644 --- a/hw/rtc/mc146818rtc.c +++ b/hw/rtc/mc146818rtc.c @@ -42,6 +42,8 @@ #include "migration/vmstate.h" #include "qapi/error.h" #include "qapi/qapi-events-misc.h" +#include "qapi/qapi-type-infos-common.h" +#include "qapi/qapi-visit-common.h" #include "qapi/visitor.h" #include "trace.h" =20 @@ -854,12 +856,25 @@ static const MemoryRegionOps cmos_ops =3D { .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 -static void rtc_get_date(Object *obj, struct tm *current_tm, Error **errp) +static void rtc_get_date(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { MC146818RtcState *s =3D MC146818_RTC(obj); + struct tm value; + StructTm tm, *tmp =3D &tm; =20 rtc_update_time(s); - rtc_get_time(s, current_tm); + rtc_get_time(s, &value); + + tm =3D (StructTm) { + .tm_year =3D value.tm_year, + .tm_mon =3D value.tm_mon, + .tm_mday =3D value.tm_mday, + .tm_hour =3D value.tm_hour, + .tm_min =3D value.tm_min, + .tm_sec =3D value.tm_sec, + }; + visit_type_StructTm(v, name, &tmp, errp); } =20 static void rtc_realizefn(DeviceState *dev, Error **errp) @@ -1019,7 +1034,9 @@ static void rtc_class_initfn(ObjectClass *klass, cons= t void *data) device_class_set_props(dc, mc146818rtc_properties); set_bit(DEVICE_CATEGORY_MISC, dc->categories); =20 - object_class_property_add_tm(klass, "date", rtc_get_date); + object_class_property_add(klass, "date", "struct tm", + &StructTm_type_info, + rtc_get_date, NULL, NULL, NULL); } =20 static const TypeInfo mc146818rtc_info =3D { diff --git a/qom/object.c b/qom/object.c index 937735f025..8444afd24f 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2613,76 +2613,6 @@ int object_property_get_enum(Object *obj, const char= *name, return ret; } =20 -typedef struct TMProperty { - void (*get)(Object *, struct tm *, Error **); -} TMProperty; - -static void property_get_tm(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - TMProperty *prop =3D opaque; - Error *err =3D NULL; - struct tm value; - - prop->get(obj, &value, &err); - if (err) { - error_propagate(errp, err); - return; - } - - if (!visit_start_struct(v, name, NULL, 0, errp)) { - return; - } - if (!visit_type_int32(v, "tm_year", &value.tm_year, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_mon", &value.tm_mon, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_mday", &value.tm_mday, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_hour", &value.tm_hour, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_min", &value.tm_min, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_sec", &value.tm_sec, errp)) { - goto out_end; - } - visit_check_struct(v, errp); -out_end: - visit_end_struct(v, NULL); -} - -ObjectProperty * -object_property_add_tm(Object *obj, const char *name, - void (*get)(Object *, struct tm *, Error **)) -{ - TMProperty *prop =3D g_malloc0(sizeof(*prop)); - - prop->get =3D get; - - return object_property_add(obj, name, "struct tm", NULL, - get ? property_get_tm : NULL, NULL, - property_release_data, - prop); -} - -ObjectProperty * -object_class_property_add_tm(ObjectClass *klass, const char *name, - void (*get)(Object *, struct tm *, Error **)) -{ - TMProperty *prop =3D g_malloc0(sizeof(*prop)); - - prop->get =3D get; - - return object_class_property_add(klass, name, "struct tm", NULL, - get ? property_get_tm : NULL, - NULL, NULL, prop); -} - static char *object_get_type(Object *obj, Error **errp) { return g_strdup(object_get_typename(obj)); --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793631235; cv=none; d=zohomail.com; s=zohoarc; b=CXDcqAyU23dz0x3kHuipvLVzh7+Mdz/cXxm8tQXfS5C6hxBFJnRhfVcV4L9RMBjYr31Ijy4pwpMPdLYr8oyO3IrvfXSmMr9RsFXSTd9mKJJVQVJAKTuH7D7uxO3XASkBpSA+nvA726eEQWYG2eGaIkMwyFAYugMmxoD6kp0fCec= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631235; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hZWIJI5aCIXEbL/xvaJXMpRdgGdFxwPUBbVCO0wKUIg=; b=CM/2KTy/S2K2KEsdQohB6kMV/40O4O/SjIfEgE+yNzxsj4Il5h0NcHS7bWJIo7a4bpuvlCCsRkRitYjv1SqFn52Q8SeflNz+zd4l8e5wHfSAYNOEq6Nt1JNycsQbkPduvfEzwJAz4+phNkjHFIdHIitKqg09bz/vZp+7ie1OQKA= 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 1793631235980544.3908075609187; Mon, 2 Nov 2026 06:53:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtFR-0007cg-FI; Mon, 02 Nov 2026 09:42:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDN-0003JR-C7 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDC-0008V1-2T for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:49 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-248-1GIqfvp0MbGMuUfDH14gKA-1; Mon, 02 Nov 2026 09:40:33 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DB77F1955D84; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 96E1B767; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E87A921E6617; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hZWIJI5aCIXEbL/xvaJXMpRdgGdFxwPUBbVCO0wKUIg=; b=UEn2idyLLLBgcXmn6rY/ZTWDiBoZ+JRYMMfLHGzTMSZVp4eKH9sfqDDXxCiFBvpT5gwCiD uiPSYSZ6gnvMHbrdYTVFZz6FwvCS/LA/z7YVVDYW9V2xwv7tBflPy8aEiJLs16VWmyXcqG jsuKdQ688YU7Al8+DT1iZf/wpyvxbUo= X-MC-Unique: 1GIqfvp0MbGMuUfDH14gKA-1 X-Mimecast-MFC-AGG-ID: 1GIqfvp0MbGMuUfDH14gKA_1793630433 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 59/74] hw/nvdimm: convert UUID property to QAPI-aware registration Date: Mon, 2 Nov 2026 15:40:03 +0100 Message-ID: <20261102144018.3212223-60-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793631237722154100 From: Marc-Andr=C3=A9 Lureau Pass appropriate QAPITypeInfo to object_property_add(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-43-armbru@redhat.com> --- hw/mem/nvdimm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index 04e8361348..08086997d7 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -104,7 +104,7 @@ static void nvdimm_init(Object *obj) nvdimm_get_label_size, nvdimm_set_label_size, NULL, NULL); =20 - object_property_add(obj, NVDIMM_UUID_PROP, "QemuUUID", NULL, + object_property_add(obj, NVDIMM_UUID_PROP, "QemuUUID", &str_type_info, nvdimm_get_uuid, nvdimm_set_uuid, NULL, NULL); } --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630590; cv=none; d=zohomail.com; s=zohoarc; b=GJSy6Afa8LDKyAeBh/mNfOn8tpBAaLAvjbtb0Nb+KHOJXJpHXB13PSGIXbMGvWhncToeKvB7G0vXSTFFdBi5H4lBVl3ACr/BT4Zi5wdPbu2OgqBybkY1vx7d1suyyHreV1gY7ylei6Ow1R4/dnYygyyo1HQc8VdI6DbcOSnGbQ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630590; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7oJS0rQyxQcscLXa2TQyzP12Oq1gZT5dB66Ida+x7D8=; b=K7vT+saUzWuUi3gd3UcLpH+HhUakjrG79oI9PBdaQIlEjE5kN30635Gg9Llnxm6A3SsqAhGjQianGLQ5AouLP9ZgA+tj1ncEkfaExod5TjwQTzZnT8SJIks9eRXcp02T55C+bfcu4atIIeqUuxxE0/TFB5zBmoxzX9kj6CwKRHc= 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 1793630590652458.3326894924768; Mon, 2 Nov 2026 06:43:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtF9-00061V-Tz; Mon, 02 Nov 2026 09:42:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDM-0003Hn-Cb for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDB-0008WP-Nz for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:47 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-248-6EFTtcaCO5SroDY4Q1ILxw-1; Mon, 02 Nov 2026 09:40:33 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id ADB7C18028BD; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 70BDB1800444; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id ECC2221E661D; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7oJS0rQyxQcscLXa2TQyzP12Oq1gZT5dB66Ida+x7D8=; b=cJlohA1Y536qLhE/Ad0mcXX1Z4SAG9pAwSgeb9/WLbPJiDwOAknvUsnT3r9OoehUulnG8Z BZLxUWUiJhmFeaMjLR16aUxUfPzM8gQd6Ymn/pBt7YvRt6jBBy+IqbWwgAj+VajtXIKlCx BrHZtOOEzs2TL6baHE+Xlw5E5NdVIEg= X-MC-Unique: 6EFTtcaCO5SroDY4Q1ILxw-1 X-Mimecast-MFC-AGG-ID: 6EFTtcaCO5SroDY4Q1ILxw_1793630432 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 60/74] hw/s390-virtio-ccw: convert loadparm property to QAPI-aware registration Date: Mon, 2 Nov 2026 15:40:04 +0100 Message-ID: <20261102144018.3212223-61-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630592376158500 From: Marc-Andr=C3=A9 Lureau Pass appropriate QAPITypeInfo to object_class_property_add(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-44-armbru@redhat.com> --- hw/s390x/s390-virtio-ccw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 7d4392d73f..393e4d261d 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -43,6 +43,7 @@ #include "system/hostmem.h" #include "target/s390x/kvm/pv.h" #include "migration/blocker.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qapi/qapi-visit-machine-s390x.h" #include "hw/s390x/cpu-topology.h" @@ -908,7 +909,7 @@ static void ccw_machine_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, "dea-key-wrap", "enable/disable DEA key wrapping using the CPACF wrapping key"= ); =20 - object_class_property_add(oc, "loadparm", "loadparm", NULL, + object_class_property_add(oc, "loadparm", "loadparm", &str_type_info, machine_get_loadparm, machine_set_loadparm, NULL, NULL); object_class_property_set_description(oc, "loadparm", --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793631087; cv=none; d=zohomail.com; s=zohoarc; b=fb+7BA3m+jZAGskChsxC2UqvTz8RDUUjgvtSzpab9chgAm2n2g6y6J36bZqXVjhxiyF0dAluGzXArSYYrwtTCYa6hlF0RPYYbe+EFvQWQrjn4XA0wtJDYqvXhYR6xS7wZvNdJ0VN5ZSfmWpsusXtJm5KocXEBHT7tA2XH+3lMow= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631087; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nU/68kvA+elGRGA3iv5+TOzH4WNAI9OPeJRFj9LliYk=; b=Ic/vgLNdFgAMTBF5xA3Uj+cM2mFtuEnlxs3xQOBzTJPbk2lyAg8BMe3kvQqd/PKc7XHDcSTzVWWEC5m/hP35uHvaHN9VPkrVo5CsK9aDobyTnF/z2Z8Yux3cW+iZkdnrjC4cgGPUeMYpDjs8wV/zSDeX3kkfVeNu/iJ+s8dTGiI= 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 1793631087769385.2331921816349; Mon, 2 Nov 2026 06:51:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtEG-0004QW-7y; Mon, 02 Nov 2026 09:41:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDJ-0003HF-6n for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDA-0008Uu-Uz for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:44 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-324-cRlcLTOnP5qYWkjqRoBJdQ-1; Mon, 02 Nov 2026 09:40:33 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CA9C9180066B; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 88A4E18004D2; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id F0EFF21E6627; Mon, 02 Nov 2026 15:40:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nU/68kvA+elGRGA3iv5+TOzH4WNAI9OPeJRFj9LliYk=; b=F0GMoGEkal8XtXRqT+Mp2XPizd6dNxwRYEKulfUsf7Ty3KHSO8j8IHKmz6378F0Rd6IQ7J 3C33AIfHc6q/qB6nSMVK0dHMTcfriR1E+B9HGenP9q+SW0ZpyyHOVDOoC0Y0CcrX0+RyOj /vOvkeaXRZVX64DX6+tYD6ka2G3hdJE= X-MC-Unique: cRlcLTOnP5qYWkjqRoBJdQ-1 X-Mimecast-MFC-AGG-ID: cRlcLTOnP5qYWkjqRoBJdQ_1793630432 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Amit Machhiwal Subject: [PULL 61/74] hw/ppc/spapr_drc: convert fdt property to QAPI-aware registration Date: Mon, 2 Nov 2026 15:40:05 +0100 Message-ID: <20261102144018.3212223-62-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793631089354154100 From: Marc-Andr=C3=A9 Lureau Use object_property_add_qapi() with any_type_info for the "fdt" property, since the FDT structure is dynamically shaped at runtime and cannot be represented as a static QAPI type. Reviewed-by: Amit Machhiwal Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-45-armbru@redhat.com> --- hw/ppc/spapr_drc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 4054215592..7663f232e0 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -587,7 +587,7 @@ static void spapr_dr_connector_instance_init(Object *ob= j) object_property_add_uint32_ptr(obj, "id", &drc->id, OBJ_PROP_FLAG_READ= ); object_property_add(obj, "index", "uint32", &uint32_type_info, prop_get_index, NULL, NULL, NULL); - object_property_add(obj, "fdt", "struct", NULL, prop_get_fdt, + object_property_add(obj, "fdt", "struct", &any_type_info, prop_get_fdt, NULL, NULL, NULL); drc->state =3D drck->empty_state; } --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630535; cv=none; d=zohomail.com; s=zohoarc; b=RriaO/grOaEt81WTOTArOQstBsfiwWVrd303TdFQf6WXDbeLY8IBhZtjN2xsTlhS7KnUZN2lpEAquz9mKON5W3z0DCyfZuQa0c6bdcVxbEpGpOXeqWU8XpWxJfXs/+CM6q8lLtwGqp2mh9dWMbckH8rv3/oNHyKzbin/1ppfa2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630535; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UJpDmmZZIGjttI5mDW4plQFSuDEsemnEAzFbYxOvVuE=; b=fmf4TzmzQFI0gkP/LEbxtK5+X6mfn5YdhOSfo2LEoaQZrJ1KNWdDdCo/jhw5sb4xRklEO8jw4smcBQQn/qHHz8czerkM3bUE5V4Jus4qGCBSzShH5PFAXfBWNBihV3PsCNG0+xp18KuYEYHJ3MkUKyHTxH8kJoiP0uc33X7pp/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 17936305354588.043962154637711; Mon, 2 Nov 2026 06:42:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDj-0003Uy-PG; Mon, 02 Nov 2026 09:41:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDK-0003HO-Bu for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDB-0008Vj-M4 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:46 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-203-tFXUsBKWMPG3EvszjpDPnA-1; Mon, 02 Nov 2026 09:40:33 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B2838180049D; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 70DE9433; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 00EC521E662A; Mon, 02 Nov 2026 15:40:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UJpDmmZZIGjttI5mDW4plQFSuDEsemnEAzFbYxOvVuE=; b=QNqLmpzHQK6UGyKUy0bg+Solvag7uZJLZLbTYliHB8zGPu0o6WAan1vaZc1vQWRTQO5LdN H7tKkg/uAf4V+f1pymwC26hhgKlr7D7MhovfNkCTtAPFR5Kyp7F0HEde9dISsmGTiMvZuK tn5z8HMfozQPQSSp6tCZIUEt/bPyZ1Q= X-MC-Unique: tFXUsBKWMPG3EvszjpDPnA-1 X-Mimecast-MFC-AGG-ID: tFXUsBKWMPG3EvszjpDPnA_1793630432 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 62/74] hw/s390x: convert BootCertificatesList to QAPI-aware registration Date: Mon, 2 Nov 2026 15:40:06 +0100 Message-ID: <20261102144018.3212223-63-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, TVD_SPACE_RATIO=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: 1793630536853154100 From: Marc-Andr=C3=A9 Lureau Pass appropriate QAPITypeInfo to object_class_property_add(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-46-armbru@redhat.com> --- hw/s390x/s390-virtio-ccw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 393e4d261d..3b197e7dc6 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -44,6 +44,7 @@ #include "target/s390x/kvm/pv.h" #include "migration/blocker.h" #include "qapi/qapi-builtin-type-infos.h" +#include "qapi/qapi-type-infos-machine-s390x.h" #include "qapi/visitor.h" #include "qapi/qapi-visit-machine-s390x.h" #include "hw/s390x/cpu-topology.h" @@ -917,7 +918,8 @@ static void ccw_machine_class_init(ObjectClass *oc, con= st void *data) " to upper case) to pass to machine loader, boot manager," " and guest kernel"); =20 - object_class_property_add(oc, "boot-certs", "BootCertificatesList", NU= LL, + object_class_property_add(oc, "boot-certs", "BootCertificatesList", + &BootCertificatesList_type_info, machine_get_boot_certs, machine_set_boot_cer= ts, NULL, NULL); object_class_property_set_description(oc, "boot-certs", "provide paths to a directory and/or a certificate file for se= cure boot"); --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630593; cv=none; d=zohomail.com; s=zohoarc; b=ATnl+sZv3VADRO7IFiURxs9MKUTAYPFbJXIPc2tOTjMDUeokbj62AOwOX556Rfv0FXWoTnvYZZzcDA6Q5QA1FmjKGXFS6XXNnRR0ZPSF/864Ip8j+ZW4HyDyHjPsGg68bOVJO6gNgo2I7/xZ4zUz56UjKIan6cZCA+kwh0+CWjs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630593; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YCQ44BCIZJt+h8SHa+MrvoTQ81VBPJ8aYx0cUgelBUM=; b=JVDqimFcaa/7uLSw/eY4qymUGBojKKw5D4LYez2O+t9LrA0px8qIQ8N0iqjiugYRnSU5GuBHGO1dafs9RntnLs5EvNcMUlnTJVu1UblO9xwf74H4UnosYgsfr6cgjnibsH6ytqRToqDjifWEfUcH6smTbizTF9eCc97s3wMzVrs= 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 1793630593334747.2565576490834; Mon, 2 Nov 2026 06:43:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDm-0003VX-Ex; Mon, 02 Nov 2026 09:41:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDM-0003Hs-Dr for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDB-0008V3-NE for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:47 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-517-w5fJOLb-MSi6zJxzEP6BMw-1; Mon, 02 Nov 2026 09:40:34 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 60FCB180A9D7; Mon, 2 Nov 2026 14:40:33 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D0D6E433; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 054B921E662B; Mon, 02 Nov 2026 15:40:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YCQ44BCIZJt+h8SHa+MrvoTQ81VBPJ8aYx0cUgelBUM=; b=CGrwwvEUeDBSrJXxNUzzfBpM2WVZtaY1hKp2yTthp4TRULKIe3e5f3TIdJbrdQgOYtJx/s qk3YVggTERXK8kO7RbDUgaIuvFkplNXVH+bgzucNviaerLkz2Df3656u5cF7zKWEG/3JH8 thDWuq/O6gLbj3JsdGepEpg2JSR26iU= X-MC-Unique: w5fJOLb-MSi6zJxzEP6BMw-1 X-Mimecast-MFC-AGG-ID: w5fJOLb-MSi6zJxzEP6BMw_1793630433 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 63/74] qdev: add qapi_type field to PropertyInfo with fallback registration Date: Mon, 2 Nov 2026 15:40:07 +0100 Message-ID: <20261102144018.3212223-64-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630595837154100 From: Marc-Andr=C3=A9 Lureau Add a qapi_type field to PropertyInfo to prepare for the transition from string-based type metadata to QAPI type-info. Update qdev_property_add_static() and qdev_class_add_property() to pass qapi_type instead of NULL to object_property_add() and object_class_property_add(). Update the shared enum accessor functions to prefer .qapi_type->lookup over .enum_table via a new qdev_propinfo_enum_lookup() helper. No PropertyInfo definitions are changed, all .qapi_type fields default to NULL, so this patch is no-op for now. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-47-armbru@redhat.com> --- include/hw/core/qdev-properties.h | 1 + hw/core/qdev-properties.c | 26 +++++++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-prope= rties.h index eba5436e53..1ea2ba66bb 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -34,6 +34,7 @@ struct PropertyInfo { const char *type; const char *description; const QEnumLookup *enum_table; + const QAPITypeInfo *qapi_type; bool realized_set_allowed; /* allow setting property on realized devic= e */ char *(*print)(Object *obj, const Property *prop); void (*set_default_value)(ObjectProperty *op, const Property *prop); diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 61dca80c95..71580c04e4 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -99,13 +99,22 @@ static ObjectPropertyAccessor *field_prop_setter(const = PropertyInfo *info) return info->set ? field_prop_set : NULL; } =20 +static const QEnumLookup *qdev_propinfo_enum_lookup(const PropertyInfo *in= fo) +{ + if (info->qapi_type) { + assert(info->qapi_type->lookup); + return info->qapi_type->lookup; + } + return info->enum_table; +} + void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { const Property *prop =3D opaque; int *ptr =3D object_field_prop_ptr(obj, prop); =20 - visit_type_enum(v, name, ptr, prop->info->enum_table, errp); + visit_type_enum(v, name, ptr, qdev_propinfo_enum_lookup(prop->info), e= rrp); } =20 void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name, @@ -114,14 +123,15 @@ void qdev_propinfo_set_enum(Object *obj, Visitor *v, = const char *name, const Property *prop =3D opaque; int *ptr =3D object_field_prop_ptr(obj, prop); =20 - visit_type_enum(v, name, ptr, prop->info->enum_table, errp); + visit_type_enum(v, name, ptr, qdev_propinfo_enum_lookup(prop->info), e= rrp); } =20 void qdev_propinfo_set_default_value_enum(ObjectProperty *op, const Property *prop) { object_property_set_default_str(op, - qapi_enum_lookup(prop->info->enum_table, prop->defval.i)); + qapi_enum_lookup(qdev_propinfo_enum_lookup(prop->info), + prop->defval.i)); } =20 /* Bit */ @@ -941,8 +951,8 @@ void qdev_prop_set_enum(DeviceState *dev, const char *n= ame, int value) =20 prop =3D qdev_prop_find(dev, name); object_property_set_str(OBJECT(dev), name, - qapi_enum_lookup(prop->info->enum_table, value= ), - &error_abort); + qapi_enum_lookup(qdev_propinfo_enum_lookup(prop->info), value), + &error_abort); } =20 void qdev_prop_set_array(DeviceState *dev, const char *name, QList *values) @@ -1150,7 +1160,8 @@ void qdev_property_add_static(DeviceState *dev, const= Property *prop) =20 assert(!prop->info->create); =20 - op =3D object_property_add(obj, prop->name, prop->info->type, NULL, + op =3D object_property_add(obj, prop->name, prop->info->type, + prop->info->qapi_type, field_prop_getter(prop->info), field_prop_setter(prop->info), prop->info->release, @@ -1176,7 +1187,8 @@ static void qdev_class_add_property(DeviceClass *klas= s, const char *name, if (prop->info->create) { op =3D prop->info->create(oc, name, prop); } else { - op =3D object_class_property_add(oc, name, prop->info->type, NULL, + op =3D object_class_property_add(oc, name, prop->info->type, + prop->info->qapi_type, field_prop_getter(prop->info), field_prop_setter(prop->info), prop->info->release, --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630637; cv=none; d=zohomail.com; s=zohoarc; b=LI9GRapQnOlyhVo5Olh32WEUcS7oWsIVG0MIMLzlQwi85f/w0PivqXl70rYQLudOGk2bUdvkSjnxh4D6Tyid7zMjTdMwM/Cq4paKYJGTLJaaKuAHFydEk5JAmWQ/2AYkLiQTNGGNra1lguNfo6U5P/4uHhWbAeP5EatuQ9v6YPg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630637; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QvzSIEH1srLwW53dLgFhqYUSaCf7VH0jrbE9wvfxGU0=; b=MuzNY3HoQL4uJkvN7QeFWOKgU0dONF/id9j7sMu52SdO1oAYu8Ok4dTizZu0zl55BEM0pCjRYlNZd5IlWk7BDY1qkgrXomUb2Xqn35RpwUhKX6fD/tggkQaIuLfXOkTnzLq4VXFsYLihvoxp5ykfB4udoMYCB53zoWeND7X3rsk= 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 179363063756766.28614171291474; Mon, 2 Nov 2026 06:43:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDo-0003WK-Fv; Mon, 02 Nov 2026 09:41:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDM-0003Hq-D3 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDB-0008VC-Lc for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:46 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-517-XCfqmgJ_OZOHVtQDFZxidA-1; Mon, 02 Nov 2026 09:40:34 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6763719541AA; Mon, 2 Nov 2026 14:40:33 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E3ED91956087; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0989C21E662D; Mon, 02 Nov 2026 15:40:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QvzSIEH1srLwW53dLgFhqYUSaCf7VH0jrbE9wvfxGU0=; b=YjQoU9j6/hYj/I8913rKOhvTT0nyBzQSKQUjGFgWL+ciSPKLhxY8uEY8xGBpDRAc06Ex1c 5Lq7qN6iot//lHBYV5GwYx+UWs66WlIJ7xvVpV5c9h6gPj6HkYQOMthHO2ecs/bS0pdXrW W8q3vHg73VJtI6Niz6FzCupSLaTFOoE= X-MC-Unique: XCfqmgJ_OZOHVtQDFZxidA-1 X-Mimecast-MFC-AGG-ID: XCfqmgJ_OZOHVtQDFZxidA_1793630433 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 64/74] qdev: convert core PropertyInfo definitions to use qapi_type Date: Mon, 2 Nov 2026 15:40:08 +0100 Message-ID: <20261102144018.3212223-65-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630640365154100 From: Marc-Andr=C3=A9 Lureau Add a .qapi_type pointer on all core PropertyInfo definitions in qdev-properties.c. Remove .enum_table from enum definitions, since the lookup is now accessed through .qapi_type->lookup via the qdev_propinfo_enum_lookup() fallback helper. It's strange to use type &size_type_info for both u32 (prop_size32) and u64 (prop_size). Link property are actually strings. The "full type name" is set when the property is added, as "link". Array properties are left for later. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-48-armbru@redhat.com> --- hw/core/qdev-properties.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 71580c04e4..f891fc78ae 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -12,6 +12,8 @@ #include "qdev-prop-internal.h" #include "qom/compat-properties.h" #include "qom/qom-qobject.h" +#include "qapi/qapi-builtin-type-infos.h" +#include "qapi/qapi-type-infos-common.h" =20 void qdev_prop_set_after_realize(DeviceState *dev, const char *name, Error **errp) @@ -182,6 +184,7 @@ static void set_default_value_bool(ObjectProperty *op, = const Property *prop) =20 const PropertyInfo qdev_prop_bit =3D { .type =3D "bool", + .qapi_type =3D &bool_type_info, .description =3D "on/off", .get =3D prop_get_bit, .set =3D prop_set_bit, @@ -232,6 +235,7 @@ static void prop_set_bit64(Object *obj, Visitor *v, con= st char *name, =20 const PropertyInfo qdev_prop_bit64 =3D { .type =3D "bool", + .qapi_type =3D &bool_type_info, .description =3D "on/off", .get =3D prop_get_bit64, .set =3D prop_set_bit64, @@ -294,8 +298,8 @@ static void prop_set_on_off_auto_bit64(Object *obj, Vis= itor *v, =20 const PropertyInfo qdev_prop_on_off_auto_bit64 =3D { .type =3D "OnOffAuto", + .qapi_type =3D &OnOffAuto_type_info, .description =3D "on/off/auto", - .enum_table =3D &OnOffAuto_lookup, .get =3D prop_get_on_off_auto_bit64, .set =3D prop_set_on_off_auto_bit64, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -323,6 +327,7 @@ static void set_bool(Object *obj, Visitor *v, const cha= r *name, void *opaque, =20 const PropertyInfo qdev_prop_bool =3D { .type =3D "bool", + .qapi_type =3D &bool_type_info, .description =3D "on/off", .get =3D get_bool, .set =3D set_bool, @@ -363,6 +368,7 @@ void qdev_propinfo_set_default_value_uint(ObjectPropert= y *op, =20 const PropertyInfo qdev_prop_uint8 =3D { .type =3D "uint8", + .qapi_type =3D &uint8_type_info, .get =3D get_uint8, .set =3D set_uint8, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -390,6 +396,7 @@ static void set_uint16(Object *obj, Visitor *v, const c= har *name, =20 const PropertyInfo qdev_prop_uint16 =3D { .type =3D "uint16", + .qapi_type =3D &uint16_type_info, .get =3D get_uint16, .set =3D set_uint16, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -435,6 +442,7 @@ static void set_int32(Object *obj, Visitor *v, const ch= ar *name, void *opaque, =20 const PropertyInfo qdev_prop_uint32 =3D { .type =3D "uint32", + .qapi_type =3D &uint32_type_info, .get =3D get_uint32, .set =3D set_uint32, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -442,6 +450,7 @@ const PropertyInfo qdev_prop_uint32 =3D { =20 const PropertyInfo qdev_prop_int32 =3D { .type =3D "int32", + .qapi_type =3D &int32_type_info, .get =3D qdev_propinfo_get_int32, .set =3D set_int32, .set_default_value =3D qdev_propinfo_set_default_value_int, @@ -487,6 +496,7 @@ static void set_int64(Object *obj, Visitor *v, const ch= ar *name, =20 const PropertyInfo qdev_prop_uint64 =3D { .type =3D "uint64", + .qapi_type =3D &uint64_type_info, .get =3D get_uint64, .set =3D set_uint64, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -494,6 +504,7 @@ const PropertyInfo qdev_prop_uint64 =3D { =20 const PropertyInfo qdev_prop_int64 =3D { .type =3D "int64", + .qapi_type =3D &int64_type_info, .get =3D get_int64, .set =3D set_int64, .set_default_value =3D qdev_propinfo_set_default_value_int, @@ -516,6 +527,7 @@ static void set_uint64_checkmask(Object *obj, Visitor *= v, const char *name, =20 const PropertyInfo qdev_prop_uint64_checkmask =3D { .type =3D "uint64", + .qapi_type =3D &uint64_type_info, .get =3D get_uint64, .set =3D set_uint64_checkmask, }; @@ -552,6 +564,11 @@ static void set_usize(Object *obj, Visitor *v, const c= har *name, void *opaque, =20 const PropertyInfo qdev_prop_usize =3D { .type =3D "usize", +#if HOST_LONG_BITS =3D=3D 32 + .qapi_type =3D &uint32_type_info, +#else + .qapi_type =3D &uint64_type_info, +#endif .get =3D get_usize, .set =3D set_usize, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -596,6 +613,7 @@ static void set_string(Object *obj, Visitor *v, const c= har *name, =20 const PropertyInfo qdev_prop_string =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .release =3D release_string, .get =3D get_string, .set =3D set_string, @@ -605,8 +623,8 @@ const PropertyInfo qdev_prop_string =3D { =20 const PropertyInfo qdev_prop_on_off_auto =3D { .type =3D "OnOffAuto", + .qapi_type =3D &OnOffAuto_type_info, .description =3D "on/off/auto", - .enum_table =3D &OnOffAuto_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -648,6 +666,7 @@ static void set_size32(Object *obj, Visitor *v, const c= har *name, void *opaque, =20 const PropertyInfo qdev_prop_size32 =3D { .type =3D "size", + .qapi_type =3D &size_type_info, .get =3D qdev_propinfo_get_size32, .set =3D set_size32, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -1061,6 +1080,7 @@ static void set_size(Object *obj, Visitor *v, const c= har *name, void *opaque, =20 const PropertyInfo qdev_prop_size =3D { .type =3D "size", + .qapi_type =3D &size_type_info, .get =3D get_size, .set =3D set_size, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -1143,6 +1163,7 @@ static void set_link(Object *obj, Visitor *v, const c= har *name, void *opaque, =20 const PropertyInfo qdev_prop_link =3D { .type =3D "link", + .qapi_type =3D &str_type_info, .create =3D create_link_property, /* * Since we have a create method, the get and set are used --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630926; cv=none; d=zohomail.com; s=zohoarc; b=j5iajzbkPbdZjPVFpfWqjMEu7DGuOSdOVsUZcG1LxIv9Aes7r0RDJVES++aGp8AFwMN1FOHcNS7gkC8O9+Zc5nA2QZpS01pRtWAcaa+b/NThYWHTXzcEneNDKchM3L2ZybhsL6O6/1AJ2isCA/tY2qsuydQC+q1Pffm+fjr295c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630926; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Jzldq7cXC1KrndZ9Z3qf6PzM/Vk98hafzKvAdjb4QmU=; b=TaK9W6Qy5hXfGxQIlkUtC19KjEUSewzm9zabd0SCWhlG27Sv9zjjxyA/NbKCtDug4pM8RsjE1Tqh1fQrRPc704JyK6zhhSSb68SnBpC3UNv8LsrHmjZ6kXRo9KppsiSNgVxjEUKxqigcndsoaSYDTY+l86QHxaGY0x/yihTljZE= 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 1793630926425541.5788865515834; Mon, 2 Nov 2026 06:48:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDn-0003Vz-Sn; Mon, 02 Nov 2026 09:41:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDM-0003Hp-Ce for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDA-0008VR-VI for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:46 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-302-cuCccgSSOFer0oSbW69ZSg-1; Mon, 02 Nov 2026 09:40:34 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 67A4C180ABF3; Mon, 2 Nov 2026 14:40:33 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E3EFC1956088; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0E3B721E662F; Mon, 02 Nov 2026 15:40:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jzldq7cXC1KrndZ9Z3qf6PzM/Vk98hafzKvAdjb4QmU=; b=dVSGo5qlCa7EPoyIzPxM4VRSAacIQqjKRB/crALS1M4QMUpgJ+RLCFXyLJpEsxtNTaF6OZ 3lQ5zc9NS4JW1AlFMaNnduG5egf1jJfkITxM4/nJ8RT7CO6NL4zXTxsthgQl9fNUlLisPs KjhM+Nzp6+DjXKKwXjiOC94xDtnEuLI= X-MC-Unique: cuCccgSSOFer0oSbW69ZSg-1 X-Mimecast-MFC-AGG-ID: cuCccgSSOFer0oSbW69ZSg_1793630433 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 65/74] qdev: convert system PropertyInfo definitions to use qapi_type Date: Mon, 2 Nov 2026 15:40:09 +0100 Message-ID: <20261102144018.3212223-66-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630928658158500 From: Marc-Andr=C3=A9 Lureau Add a .qapi_type pointer on all PropertyInfo definitions in qdev-properties-system.c. Remove .enum_table from enum definitions, since the lookup is now accessed through .qapi_type->lookup via the qdev_propinfo_enum_lookup() fallback helper. Update file-private enum accessor functions to use .qapi_type->lookup instead of .enum_table. Note, this should be a faithful conversion, but it would be worth to consider better types than just "str" for references (block node names, chardev/netdev IDs, MAC addrs, etc) Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-49-armbru@redhat.com> --- hw/core/qdev-prop-internal.h | 2 + hw/core/qdev-properties-system.c | 71 +++++++++++++++++++++----------- hw/core/qdev-properties.c | 2 +- 3 files changed, 51 insertions(+), 24 deletions(-) diff --git a/hw/core/qdev-prop-internal.h b/hw/core/qdev-prop-internal.h index d7b77844fe..c190b7b88c 100644 --- a/hw/core/qdev-prop-internal.h +++ b/hw/core/qdev-prop-internal.h @@ -8,6 +8,8 @@ #ifndef HW_CORE_QDEV_PROP_INTERNAL_H #define HW_CORE_QDEV_PROP_INTERNAL_H =20 +const QEnumLookup *qdev_propinfo_enum_lookup(const PropertyInfo *info); + void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp); void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name, diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 5bfdfe1ab9..8924f84806 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -27,6 +27,7 @@ #include "qemu/uuid.h" #include "qemu/error-report.h" #include "qdev-prop-internal.h" +#include "qapi/qapi-type-infos.h" =20 #include "qemu/audio.h" #include "chardev/char-fe.h" @@ -239,6 +240,7 @@ static void release_drive(Object *obj, const char *name= , void *opaque) =20 const PropertyInfo qdev_prop_drive =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Node name or ID of a block device to use as a backen= d", .realized_set_allowed =3D true, .get =3D get_drive, @@ -248,6 +250,7 @@ const PropertyInfo qdev_prop_drive =3D { =20 const PropertyInfo qdev_prop_drive_iothread =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Node name or ID of a block device to use as a backen= d", .realized_set_allowed =3D true, .get =3D get_drive, @@ -316,6 +319,7 @@ static void release_chr(Object *obj, const char *name, = void *opaque) =20 const PropertyInfo qdev_prop_chr =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "ID of a chardev to use as a backend", .get =3D get_chr, .set =3D set_chr, @@ -390,6 +394,7 @@ inval: =20 const PropertyInfo qdev_prop_macaddr =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Ethernet 6-byte MAC Address, example: 52:54:00:12:34= :56", .get =3D get_mac, .set =3D set_mac, @@ -478,6 +483,7 @@ out: =20 const PropertyInfo qdev_prop_netdev =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "ID of a netdev to use as a backend", .get =3D get_netdev, .set =3D set_netdev, @@ -515,6 +521,7 @@ static void set_audiodev(Object *obj, Visitor *v, const= char* name, =20 const PropertyInfo qdev_prop_audiodev =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "ID of an audiodev to use as a backend", /* release done on shutdown */ .get =3D get_audiodev, @@ -584,7 +591,8 @@ static void qdev_propinfo_set_losttickpolicy(Object *ob= j, Visitor *v, int *ptr =3D object_field_prop_ptr(obj, prop); int value; =20 - if (!visit_type_enum(v, name, &value, prop->info->enum_table, errp)) { + if (!visit_type_enum(v, name, &value, + qdev_propinfo_enum_lookup(prop->info), errp)) { return; } =20 @@ -605,8 +613,8 @@ QEMU_BUILD_BUG_ON(sizeof(LostTickPolicy) !=3D sizeof(in= t)); =20 const PropertyInfo qdev_prop_losttickpolicy =3D { .type =3D "LostTickPolicy", + .qapi_type =3D &LostTickPolicy_type_info, .description =3D "Policy for handling lost ticks (discard/delay/slew)", - .enum_table =3D &LostTickPolicy_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_losttickpolicy, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -632,6 +640,7 @@ static void set_blocksize(Object *obj, Visitor *v, cons= t char *name, =20 const PropertyInfo qdev_prop_blocksize =3D { .type =3D "size", + .qapi_type =3D &size_type_info, .description =3D "A power of two between " MIN_BLOCK_SIZE_STR " and " MAX_BLOCK_SIZE_STR, .get =3D qdev_propinfo_get_size32, @@ -645,8 +654,8 @@ QEMU_BUILD_BUG_ON(sizeof(BlockdevOnError) !=3D sizeof(i= nt)); =20 const PropertyInfo qdev_prop_blockdev_on_error =3D { .type =3D "BlockdevOnError", + .qapi_type =3D &BlockdevOnError_type_info, .description =3D "Error handling policy (report/ignore/enospc/stop/aut= o)", - .enum_table =3D &BlockdevOnError_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -658,9 +667,9 @@ QEMU_BUILD_BUG_ON(sizeof(BiosAtaTranslation) !=3D sizeo= f(int)); =20 const PropertyInfo qdev_prop_bios_chs_trans =3D { .type =3D "BiosAtaTranslation", + .qapi_type =3D &BiosAtaTranslation_type_info, .description =3D "Logical CHS translation algorithm " " (auto/none/lba/large/rechs)", - .enum_table =3D &BiosAtaTranslation_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -670,8 +679,8 @@ const PropertyInfo qdev_prop_bios_chs_trans =3D { =20 const PropertyInfo qdev_prop_fdc_drive_type =3D { .type =3D "FloppyDriveType", + .qapi_type =3D &FloppyDriveType_type_info, .description =3D "Floppy drive type (144/288/120/none/auto)", - .enum_table =3D &FloppyDriveType_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -681,9 +690,9 @@ const PropertyInfo qdev_prop_fdc_drive_type =3D { =20 const PropertyInfo qdev_prop_multifd_compression =3D { .type =3D "MultiFDCompression", + .qapi_type =3D &MultiFDCompression_type_info, .description =3D "multifd compression method" " (none/zlib/zstd/qpl/uadk/qatzip)", - .enum_table =3D &MultiFDCompression_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -695,8 +704,8 @@ QEMU_BUILD_BUG_ON(sizeof(MigMode) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_mig_mode =3D { .type =3D "MigMode", + .qapi_type =3D &MigMode_type_info, .description =3D "Migration mode (normal/cpr-reboot)", - .enum_table =3D &MigMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -708,8 +717,8 @@ QEMU_BUILD_BUG_ON(sizeof(GranuleMode) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_granule_mode =3D { .type =3D "GranuleMode", + .qapi_type =3D &GranuleMode_type_info, .description =3D "Granule page size (4k/8k/16k/64k/host)", - .enum_table =3D &GranuleMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -717,8 +726,8 @@ const PropertyInfo qdev_prop_granule_mode =3D { =20 const PropertyInfo qdev_prop_zero_page_detection =3D { .type =3D "ZeroPageDetection", + .qapi_type =3D &ZeroPageDetection_type_info, .description =3D "Zero page detection (none/legacy/multifd)", - .enum_table =3D &ZeroPageDetection_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -730,8 +739,8 @@ QEMU_BUILD_BUG_ON(sizeof(SsidSizeMode) !=3D sizeof(int)= ); =20 const PropertyInfo qdev_prop_ssidsize_mode =3D { .type =3D "SsidSizeMode", + .qapi_type =3D &SsidSizeMode_type_info, .description =3D "ssidsize mode: auto, 0-20", - .enum_table =3D &SsidSizeMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -743,8 +752,8 @@ QEMU_BUILD_BUG_ON(sizeof(OasMode) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_oas_mode =3D { .type =3D "OasMode", + .qapi_type =3D &OasMode_type_info, .description =3D "oas mode: auto, 32, 36, 40, 42, 44, 48, 52, 56", - .enum_table =3D &OasMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -825,6 +834,7 @@ out: =20 const PropertyInfo qdev_prop_reserved_region =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Reserved Region, example: 0xFEE00000:0xFEEFFFFF:0", .get =3D get_reserved_region, .set =3D set_reserved_region, @@ -904,7 +914,16 @@ static char *print_pci_devfn(Object *obj, const Proper= ty *prop) } =20 const PropertyInfo qdev_prop_pci_devfn =3D { + /* + * Both .type and .qapi_type are inaccurate. We actually accept + * string or integer. The natural QAPI type would be an + * alternate, but QAPI refuses this combination, because it + * wouldn't work with the QObject input keyval visitor. + * set_pci_devfn() bypasses this restriction by doing it manually. + * It can pick integer only with JSON input (QMP). + */ .type =3D "str", + .qapi_type =3D &int32_type_info, .description =3D "Slot and optional function number, example: 06.0 or = 06", .print =3D print_pci_devfn, .get =3D qdev_propinfo_get_int32, @@ -1011,6 +1030,7 @@ inval: =20 const PropertyInfo qdev_prop_pci_host_devaddr =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Address (bus:device.function) of " "the host device, example: 04:10.0", .get =3D get_pci_host_devaddr, @@ -1021,8 +1041,8 @@ const PropertyInfo qdev_prop_pci_host_devaddr =3D { =20 const PropertyInfo qdev_prop_off_auto_pcibar =3D { .type =3D "OffAutoPCIBAR", + .qapi_type =3D &OffAutoPCIBAR_type_info, .description =3D "off/auto/bar0/bar1/bar2/bar3/bar4/bar5", - .enum_table =3D &OffAutoPCIBAR_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1061,7 +1081,8 @@ static void get_prop_pcielinkspeed(Object *obj, Visit= or *v, const char *name, abort(); } =20 - visit_type_enum(v, name, &speed, prop->info->enum_table, errp); + visit_type_enum(v, name, &speed, + qdev_propinfo_enum_lookup(prop->info), errp); } =20 static void set_prop_pcielinkspeed(Object *obj, Visitor *v, const char *na= me, @@ -1071,8 +1092,8 @@ static void set_prop_pcielinkspeed(Object *obj, Visit= or *v, const char *name, PCIExpLinkSpeed *p =3D object_field_prop_ptr(obj, prop); int speed; =20 - if (!visit_type_enum(v, name, &speed, prop->info->enum_table, - errp)) { + if (!visit_type_enum(v, name, &speed, + qdev_propinfo_enum_lookup(prop->info), errp)) { return; } =20 @@ -1103,8 +1124,8 @@ static void set_prop_pcielinkspeed(Object *obj, Visit= or *v, const char *name, =20 const PropertyInfo qdev_prop_pcie_link_speed =3D { .type =3D "PCIELinkSpeed", + .qapi_type =3D &PCIELinkSpeed_type_info, .description =3D "2_5/5/8/16/32/64", - .enum_table =3D &PCIELinkSpeed_lookup, .get =3D get_prop_pcielinkspeed, .set =3D set_prop_pcielinkspeed, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1146,7 +1167,8 @@ static void get_prop_pcielinkwidth(Object *obj, Visit= or *v, const char *name, abort(); } =20 - visit_type_enum(v, name, &width, prop->info->enum_table, errp); + visit_type_enum(v, name, &width, + qdev_propinfo_enum_lookup(prop->info), errp); } =20 static void set_prop_pcielinkwidth(Object *obj, Visitor *v, const char *na= me, @@ -1156,8 +1178,8 @@ static void set_prop_pcielinkwidth(Object *obj, Visit= or *v, const char *name, PCIExpLinkWidth *p =3D object_field_prop_ptr(obj, prop); int width; =20 - if (!visit_type_enum(v, name, &width, prop->info->enum_table, - errp)) { + if (!visit_type_enum(v, name, &width, + qdev_propinfo_enum_lookup(prop->info), errp)) { return; } =20 @@ -1191,8 +1213,8 @@ static void set_prop_pcielinkwidth(Object *obj, Visit= or *v, const char *name, =20 const PropertyInfo qdev_prop_pcie_link_width =3D { .type =3D "PCIELinkWidth", + .qapi_type =3D &PCIELinkWidth_type_info, .description =3D "1/2/4/8/12/16/32", - .enum_table =3D &PCIELinkWidth_lookup, .get =3D get_prop_pcielinkwidth, .set =3D set_prop_pcielinkwidth, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1241,6 +1263,7 @@ static void set_default_uuid_auto(ObjectProperty *op,= const Property *prop) =20 const PropertyInfo qdev_prop_uuid =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "UUID (aka GUID) or \"" UUID_VALUE_AUTO "\" for random value (default)", .get =3D get_uuid, @@ -1254,8 +1277,8 @@ QEMU_BUILD_BUG_ON(sizeof(S390CpuEntitlement) !=3D siz= eof(int)); =20 const PropertyInfo qdev_prop_cpus390entitlement =3D { .type =3D "S390CpuEntitlement", + .qapi_type =3D &S390CpuEntitlement_type_info, .description =3D "auto/low/medium/high (default medium)", - .enum_table =3D &S390CpuEntitlement_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1299,6 +1322,7 @@ static void release_iothread_vq_mapping_list(Object *= obj, =20 const PropertyInfo qdev_prop_iothread_vq_mapping_list =3D { .type =3D "IOThreadVirtQueueMappingList", + .qapi_type =3D &IOThreadVirtQueueMappingList_type_info, .description =3D "IOThread virtqueue mapping list [{\"iothread\":\"\", " "\"vqs\":[1,2,3,...]},...]", .get =3D get_iothread_vq_mapping_list, @@ -1310,8 +1334,8 @@ const PropertyInfo qdev_prop_iothread_vq_mapping_list= =3D { =20 const PropertyInfo qdev_prop_endian_mode =3D { .type =3D "EndianMode", + .qapi_type =3D &EndianMode_type_info, .description =3D "Endian mode, big/little/unspecified", - .enum_table =3D &EndianMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1319,8 +1343,8 @@ const PropertyInfo qdev_prop_endian_mode =3D { =20 const PropertyInfo qdev_prop_vmapple_virtio_blk_variant =3D { .type =3D "VMAppleVirtioBlkVariant", + .qapi_type =3D &VMAppleVirtioBlkVariant_type_info, .description =3D "unspecified/root/aux", - .enum_table =3D &VMAppleVirtioBlkVariant_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1364,6 +1388,7 @@ static void release_virtio_gpu_output_list(Object *ob= j, =20 const PropertyInfo qdev_prop_virtio_gpu_output_list =3D { .type =3D "VirtIOGPUOutputList", + .qapi_type =3D &VirtIOGPUOutputList_type_info, .description =3D "VirtIO GPU output list [{\"name\":\"\"},...]", .get =3D get_virtio_gpu_output_list, .set =3D set_virtio_gpu_output_list, diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index f891fc78ae..fb11eb1f1c 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -101,7 +101,7 @@ static ObjectPropertyAccessor *field_prop_setter(const = PropertyInfo *info) return info->set ? field_prop_set : NULL; } =20 -static const QEnumLookup *qdev_propinfo_enum_lookup(const PropertyInfo *in= fo) +const QEnumLookup *qdev_propinfo_enum_lookup(const PropertyInfo *info) { if (info->qapi_type) { assert(info->qapi_type->lookup); --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793631251; cv=none; d=zohomail.com; s=zohoarc; b=Tok9MXaj9b76aMe/rz28NZyTXdRSaG0tN9ODEGcexZqaMXiNMk/hiLC66xRU7fKKxdXj+aRuDcjrUFZmJb3BGVFlIUw7AfCnlz0NB3NPVI/VrTRaInDHGiynJDi3xDIg3S11W2s0jmuxm7IdSGJc94Pq8rhQaRiwg5xIu0DGW+k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631251; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ewvAgkD9GAfp3lCfHi8sHctDQKVaGgR88BS56rPMxYk=; b=cyFHZRwMNXGEL6OM4GmZGTHDiMRSAEFzqSIEHQjTjzs/6hvhrL0Y6D+j075P3C6IUTIhXWdHnmUhlg0pvE2JniCiAkZwIDsPSsKPcK/pt3rPP/f6f9XkOS+trI8UJNQbe1sO9ZZ3mscN8XFjCq0unrEVKHBHWEoEykEJx3alG6I= 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 179363125179760.98908775301038; Mon, 2 Nov 2026 06:54:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDp-0003Wr-US; Mon, 02 Nov 2026 09:41:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDN-0003JV-Ty for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDC-0008VK-8Z for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:49 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-335-jlDRAg_XO-6wmJGwza7oUA-1; Mon, 02 Nov 2026 09:40:34 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5D11A180A97C; Mon, 2 Nov 2026 14:40:33 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DED281800677; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 12A9A21E663A; Mon, 02 Nov 2026 15:40:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ewvAgkD9GAfp3lCfHi8sHctDQKVaGgR88BS56rPMxYk=; b=AswTisAFVwuJV/p2CvGfGTAApHC6ukakO4GCyrfUpKR+vHyUN4IBAa0Vt7xcWHtG9p8ZMu E3lIRa840UfMrBFB5iqzFRUNevM7ZGhPM2zRYv4BosC0Wf5fb0f4VjL+R5O4cnYm1dVs/l KYZGex8SJiYCDuxjKEDhkZ1RHS6Wqdw= X-MC-Unique: jlDRAg_XO-6wmJGwza7oUA-1 X-Mimecast-MFC-AGG-ID: jlDRAg_XO-6wmJGwza7oUA_1793630433 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 66/74] hw/ufs: Convert PropertyInfo to QAPITypeInfo Date: Mon, 2 Nov 2026 15:40:10 +0100 Message-ID: <20261102144018.3212223-67-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793631254317158500 This gives properties "x-fault-inject-tag" and "x-fault-inject-mode" 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 conversion is trivial for ufs_prop_get_fault_inject_tag. For ufs_prop_get_fault_inject_tag, we need to conver UfsFaultInjectMode to a QAPI enum. Signed-off-by: Markus Armbruster Message-ID: <87tslzr2a6.fsf_-_@pond.sub.org> Reviewed-by: Marc-Andr=C3=A9 Lureau --- qapi/common.json | 30 ++++++++++++++++++++++++++++++ hw/ufs/ufs.h | 34 ---------------------------------- hw/ufs/ufs.c | 15 +++------------ 3 files changed, 33 insertions(+), 46 deletions(-) diff --git a/qapi/common.json b/qapi/common.json index 68b649ecf2..84f12c133a 100644 --- a/qapi/common.json +++ b/qapi/common.json @@ -245,3 +245,33 @@ 'tm_hour': 'int32', 'tm_min': 'int32', 'tm_sec': 'int32' } } + +## +# @UfsFaultInjectMode: +# Fault injection modes for x-fault-inject-mode property. +# Controls how the held transfer request and subsequent Task +# Management Request (TMR) are resolved by the controller: +# +# @abort-success: TMR ABORT_TASK aborts the held request, clears its +# state, and returns SUCCESS (COMPL). +# +# @abort-failed: TMR ABORT_TASK returns TASK_MANAGEMENT_FUNC_FAILED, +# forcing host driver to escalate to Host Reset. +# +# @in-transition: TMR QUERY_TASK releases the held request to execute +# normally through the SCSI layer and returns the real task status +# (SUCCEEDED while the command is still in flight); ABORT_TASK +# cancels the held request and returns FUNCTION_COMPLETE. +# +# @timeout: TMR ABORT_TASK does not complete or clear doorbell, +# triggering hardware-level TMR timeout. +# +# @ssu-timeout: Intercepts SCSI START_STOP (0x1B) commands targeting +# the UFS Device WLUN when x-fault-inject-tag is armed. +# +# Since: 11.2 +## +{ 'enum': 'UfsFaultInjectMode', + 'prefix': 'UFS_FAULT_INJECT', + 'data': [ 'abort-success', 'abort-failed', 'in-transition', 'timeout', + 'ssu-timeout' ] } diff --git a/hw/ufs/ufs.h b/hw/ufs/ufs.h index 7ddc540546..0014978322 100644 --- a/hw/ufs/ufs.h +++ b/hw/ufs/ufs.h @@ -90,39 +90,6 @@ typedef struct UfsLu { UfsScsiOp scsi_op; } UfsLu; =20 -/* - * Fault injection modes for x-fault-inject-mode property. - * Controls how the held transfer request and subsequent Task Management - * Request (TMR) are resolved by the controller: - * - * UFS_FAULT_INJECT_ABORT_SUCCESS: TMR ABORT_TASK aborts the held request, - * clears its state, and returns SUCCESS - * (COMPL). - * UFS_FAULT_INJECT_ABORT_FAILED: TMR ABORT_TASK returns - * TASK_MANAGEMENT_FUNC_FAILED, forcing ho= st - * driver to escalate to Host Reset. - * UFS_FAULT_INJECT_IN_TRANSITION: TMR QUERY_TASK releases the held reques= t to - * execute normally through the SCSI layer= and - * returns the real task status (SUCCEEDED= while - * the command is still in flight); - * ABORT_TASK cancels the held request and - * returns FUNCTION_COMPLETE. - * UFS_FAULT_INJECT_TIMEOUT: TMR ABORT_TASK does not complete or cle= ar - * doorbell, triggering hardware-level TMR - * timeout. - * UFS_FAULT_INJECT_SSU_TIMEOUT: Intercepts SCSI START_STOP (0x1B) comma= nds - * targeting the UFS Device WLUN when - * x-fault-inject-tag is armed. - */ -typedef enum UfsFaultInjectMode { - UFS_FAULT_INJECT_ABORT_SUCCESS =3D 0, - UFS_FAULT_INJECT_ABORT_FAILED, - UFS_FAULT_INJECT_IN_TRANSITION, - UFS_FAULT_INJECT_TIMEOUT, - UFS_FAULT_INJECT_SSU_TIMEOUT, - UFS_FAULT_INJECT_MODE_MAX, -} UfsFaultInjectMode; - /* * Sentinel values for x-fault-inject-tag property. * Task Tags in UFS are 8-bit (0..255). Values >=3D 256 are reserved as @@ -375,6 +342,5 @@ void ufs_unrealize(UfsHc *u); =20 extern const PropertyInfo ufs_prop_fault_inject_tag; extern const PropertyInfo ufs_prop_fault_inject_mode; -extern const QEnumLookup UfsFaultInjectMode_lookup; =20 #endif /* HW_UFS_UFS_H */ diff --git a/hw/ufs/ufs.c b/hw/ufs/ufs.c index f8da7c9554..3de67831ea 100644 --- a/hw/ufs/ufs.c +++ b/hw/ufs/ufs.c @@ -15,6 +15,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/visitor.h" #include "scsi/constants.h" #include "hw/core/irq.h" @@ -3234,17 +3235,6 @@ static void ufs_init_hc(UfsHc *u) ufs_fault_inject_init(u); } =20 -const QEnumLookup UfsFaultInjectMode_lookup =3D { - .array =3D (const char *const[]) { - [UFS_FAULT_INJECT_ABORT_SUCCESS] =3D "abort-success", - [UFS_FAULT_INJECT_ABORT_FAILED] =3D "abort-failed", - [UFS_FAULT_INJECT_IN_TRANSITION] =3D "in-transition", - [UFS_FAULT_INJECT_TIMEOUT] =3D "timeout", - [UFS_FAULT_INJECT_SSU_TIMEOUT] =3D "ssu-timeout", - }, - .size =3D UFS_FAULT_INJECT_MODE_MAX, -}; - static void ufs_prop_get_fault_inject_tag(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) @@ -3300,6 +3290,7 @@ static void ufs_prop_set_default_fault_inject_tag(Obj= ectProperty *op, =20 const PropertyInfo ufs_prop_fault_inject_tag =3D { .type =3D "uint32", + .qapi_type =3D &uint32_type_info, .description =3D "Task tag to hold for fault injection", .get =3D ufs_prop_get_fault_inject_tag, .set =3D ufs_prop_set_fault_inject_tag, @@ -3309,9 +3300,9 @@ const PropertyInfo ufs_prop_fault_inject_tag =3D { =20 const PropertyInfo ufs_prop_fault_inject_mode =3D { .type =3D "UfsFaultInjectMode", + .qapi_type =3D &UfsFaultInjectMode_type_info, .description =3D "Fault injection mode: abort-success, abort-failed, " "in-transition, timeout, ssu-timeout", - .enum_table =3D &UfsFaultInjectMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630588; cv=none; d=zohomail.com; s=zohoarc; b=c5NHRsV1ior6QPnkBtHqVH0qtBAV8sYtZO9fln9iStEJUm+AIKYkHCKEWDxOLS4Ll1ypAS85BVsHnOAULtk6dsZSN6gtGwWpBBtCF0WRNmJ2kqD+2fanAVF+gF/LYsTu0rClwPCahhVNZwKb5rCzlh9lKt9oI/VF0iE8MYa6yCc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630588; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LGwT9Xba9basFM/Zk3ocexrZUU7eWJPbJZyN8Tmle90=; b=PT/jnGUTcOUi3vmJqwO4tV4xUbYbv64T3r67Xp+gkXBPnfPVPw6UsB8TLTNNc+mJ3ox1krkYdQua1fuigb2dXS/+9/dtQAVXnQWuEH1uqTa7fzhS75P95ZwKnxXlP1tVAv4eOy4RWImLXET9X0BvyvCX+fqw6Q5HRlVnfNTY+C4= 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 1793630588896663.255627527798; Mon, 2 Nov 2026 06:43:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtEz-00056r-SP; Mon, 02 Nov 2026 09:42:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDN-0003JT-Td for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDC-00004u-8s for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:49 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-53-LMzYdp5QNAq6uni54MuYJw-1; Mon, 02 Nov 2026 09:40:34 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5CCEE1953964; Mon, 2 Nov 2026 14:40:33 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DA3E01800347; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 16F2821E663D; Mon, 02 Nov 2026 15:40:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LGwT9Xba9basFM/Zk3ocexrZUU7eWJPbJZyN8Tmle90=; b=W6l/ZNn26ggaQ7siX2gGBiw7A2UceUhPAsMWaH+Ou3xtZIlEpZyKNch/LH+Vp4XNw1OBJm ajyJgvLjvnKxyXOwtdQ/oiLhjVHzI+B4t6SY6zZbr4YmbQwhxZ4VTONUBgQKo4RZ9YjYvJ 8FiNXRLrlKYwjK7p4XpzFFY61fX1680= X-MC-Unique: LMzYdp5QNAq6uni54MuYJw-1 X-Mimecast-MFC-AGG-ID: LMzYdp5QNAq6uni54MuYJw_1793630433 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 67/74] hw: convert device-local PropertyInfo definitions to use qapi_type Date: Mon, 2 Nov 2026 15:40:11 +0100 Message-ID: <20261102144018.3212223-68-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630590508158500 From: Marc-Andr=C3=A9 Lureau Add a .qapi_type pointer to PropertyInfo definitions in device-specific files. Mechanical, except for "display_mode" in apple-gfx.m, which is a string of a specific format. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-50-armbru@redhat.com> [hw/ufs/ufs.c updated for c821f2f69f1e (hw/ufs: Add experimental fault injection properties for holding requests)] --- hw/block/xen-block.c | 2 ++ hw/misc/xlnx-versal-trng.c | 2 ++ hw/nvme/nguid.c | 2 ++ hw/nvram/xlnx-bbram.c | 2 ++ hw/nvram/xlnx-efuse.c | 2 ++ hw/pci/pci.c | 2 ++ hw/s390x/ccw-device.c | 2 ++ hw/s390x/css.c | 3 +++ hw/s390x/s390-pci-bus.c | 2 ++ hw/vfio/pci-quirks.c | 2 ++ hw/display/apple-gfx.m | 2 ++ 11 files changed, 23 insertions(+) diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c index 474c12fe4a..ffdb080657 100644 --- a/hw/block/xen-block.c +++ b/hw/block/xen-block.c @@ -29,6 +29,7 @@ #include "dataplane/xen-block.h" #include "hw/xen/interface/io/xs_wire.h" #include "trace.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #define XVDA_MAJOR 202 #define XVDQ_MAJOR (1 << 20) @@ -664,6 +665,7 @@ invalid: */ static const PropertyInfo xen_block_prop_vdev =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Virtual Disk specifier (d*p*/xvd*/hd*/sd*)", .get =3D xen_block_get_vdev, .set =3D xen_block_set_vdev, diff --git a/hw/misc/xlnx-versal-trng.c b/hw/misc/xlnx-versal-trng.c index 0584ee089e..3204e083ea 100644 --- a/hw/misc/xlnx-versal-trng.c +++ b/hw/misc/xlnx-versal-trng.c @@ -36,6 +36,7 @@ #include "qapi/visitor.h" #include "migration/vmstate.h" #include "hw/core/qdev-properties.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #ifndef XLNX_VERSAL_TRNG_ERR_DEBUG #define XLNX_VERSAL_TRNG_ERR_DEBUG 0 @@ -663,6 +664,7 @@ static void trng_prop_fault_event_get(Object *obj, Visi= tor *v, =20 static const PropertyInfo trng_prop_fault_events =3D { .type =3D "uint32", + .qapi_type =3D &uint32_type_info, .description =3D "Set to trigger TRNG fault events", .set =3D trng_prop_fault_event_set, .get =3D trng_prop_fault_event_get, diff --git a/hw/nvme/nguid.c b/hw/nvme/nguid.c index 4cd6fad6ac..ccc12ac9f9 100644 --- a/hw/nvme/nguid.c +++ b/hw/nvme/nguid.c @@ -18,6 +18,7 @@ #include "qapi/visitor.h" #include "qemu/ctype.h" #include "nvme.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #define NGUID_SEPARATOR '-' =20 @@ -180,6 +181,7 @@ static void set_nguid(Object *obj, Visitor *v, const ch= ar *name, void *opaque, =20 const PropertyInfo qdev_prop_nguid =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "NGUID or \"" NGUID_VALUE_AUTO "\" for random value", .get =3D get_nguid, diff --git a/hw/nvram/xlnx-bbram.c b/hw/nvram/xlnx-bbram.c index e336874bde..8e7597621d 100644 --- a/hw/nvram/xlnx-bbram.c +++ b/hw/nvram/xlnx-bbram.c @@ -34,6 +34,7 @@ #include "hw/core/qdev-properties.h" #include "hw/core/qdev-properties-system.h" #include "hw/nvram/xlnx-efuse.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #ifndef XLNX_BBRAM_ERR_DEBUG #define XLNX_BBRAM_ERR_DEBUG 0 @@ -487,6 +488,7 @@ static void bbram_prop_release_drive(Object *obj, const= char *name, =20 static const PropertyInfo bbram_prop_drive =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Node name or ID of a block device to use as BBRAM ba= ckend", .realized_set_allowed =3D true, .get =3D bbram_prop_get_drive, diff --git a/hw/nvram/xlnx-efuse.c b/hw/nvram/xlnx-efuse.c index 03c9fbc0d0..7d2030f7aa 100644 --- a/hw/nvram/xlnx-efuse.c +++ b/hw/nvram/xlnx-efuse.c @@ -34,6 +34,7 @@ #include "system/blockdev.h" #include "hw/core/qdev-properties.h" #include "hw/core/qdev-properties-system.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #define TBIT0_OFFSET 28 #define TBIT1_OFFSET 29 @@ -252,6 +253,7 @@ static void efuse_prop_release_drive(Object *obj, const= char *name, =20 static const PropertyInfo efuse_prop_drive =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Node name or ID of a block device to use as eFUSE ba= ckend", .realized_set_allowed =3D true, .get =3D efuse_prop_get_drive, diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 2d2fe02c68..9691c514e0 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -53,6 +53,7 @@ #include "qapi/error.h" #include "qemu/cutils.h" #include "pci-internal.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #include "hw/xen/xen.h" #include "hw/i386/kvm/xen_evtchn.h" @@ -81,6 +82,7 @@ static void prop_pci_busnr_get(Object *obj, Visitor *v, c= onst char *name, =20 static const PropertyInfo prop_pci_busnr =3D { .type =3D "busnr", + .qapi_type =3D &uint8_type_info, .get =3D prop_pci_busnr_get, }; =20 diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c index 25c4273279..54766f53e1 100644 --- a/hw/s390x/ccw-device.c +++ b/hw/s390x/ccw-device.c @@ -17,6 +17,7 @@ #include "qapi/visitor.h" #include "qemu/ctype.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" =20 static void ccw_device_refill_ids(CcwDevice *dev) { @@ -75,6 +76,7 @@ static void ccw_device_set_loadparm(Object *obj, Visitor = *v, =20 const PropertyInfo ccw_loadparm =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Up to 8 chars in set of [A-Za-z0-9. ] to select" " a guest kernel", .get =3D ccw_device_get_loadparm, diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 65341c68c3..44805ceb49 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -24,6 +24,7 @@ #include "hw/s390x/s390-virtio-ccw.h" #include "hw/s390x/s390-ccw.h" #include "exec/cpu-common.h" +#include "qapi/qapi-builtin-type-infos.h" =20 typedef struct CrwContainer { CRW crw; @@ -2531,6 +2532,7 @@ out: =20 const PropertyInfo css_devid_propinfo =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Identifier of an I/O device in the channel " "subsystem, example: fe.1.23ab", .get =3D get_css_devid, @@ -2539,6 +2541,7 @@ const PropertyInfo css_devid_propinfo =3D { =20 const PropertyInfo css_devid_ro_propinfo =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Read-only identifier of an I/O device in the channel= " "subsystem, example: fe.1.23ab", .get =3D get_css_devid, diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index cdd75cdfd2..6703d4c1cb 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -35,6 +35,7 @@ #include "system/runstate.h" =20 #include "trace.h" +#include "qapi/qapi-builtin-type-infos.h" =20 S390pciState *s390_get_phb(void) { @@ -1852,6 +1853,7 @@ static void s390_pci_set_fid(Object *obj, Visitor *v,= const char *name, =20 static const PropertyInfo s390_pci_fid_propinfo =3D { .type =3D "uint32", + .qapi_type =3D &uint32_type_info, .description =3D "zpci_fid", .get =3D s390_pci_get_fid, .set =3D s390_pci_set_fid, diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index c5b4f9091d..a38a0e7a3a 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -26,6 +26,7 @@ #include "pci.h" #include "pci-quirks.h" #include "trace.h" +#include "qapi/qapi-builtin-type-infos.h" =20 /* * List of device ids/vendor ids for which to disable @@ -1437,6 +1438,7 @@ static void set_nv_gpudirect_clique_id(Object *obj, V= isitor *v, =20 const PropertyInfo qdev_prop_nv_gpudirect_clique =3D { .type =3D "uint8", + .qapi_type =3D &uint8_type_info, .description =3D "NVIDIA GPUDirect Clique ID (0 - 15)", .get =3D get_nv_gpudirect_clique_id, .set =3D set_nv_gpudirect_clique_id, diff --git a/hw/display/apple-gfx.m b/hw/display/apple-gfx.m index be0061b9db..4db80f0b10 100644 --- a/hw/display/apple-gfx.m +++ b/hw/display/apple-gfx.m @@ -15,6 +15,7 @@ #include "qemu/lockable.h" #include "qemu/cutils.h" #include "qemu/log.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qapi/error.h" #include "qemu/aio-wait.h" @@ -872,6 +873,7 @@ static void apple_gfx_set_display_mode(Object *obj, Vis= itor *v, =20 const PropertyInfo qdev_prop_apple_gfx_display_mode =3D { .type =3D "display_mode", + .qapi_type =3D &str_type_info, .description =3D "Display mode in pixels and Hertz, as x@ " "Example: 3840x2160@60", --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630856; cv=none; d=zohomail.com; s=zohoarc; b=OX9mmhZe0msoifHhKTDWVtIMVX7QZkfg0l9Wg+iCprsu38ofCW9p1ySUt12O7CAoEGMrmAkViKaQcdbtVaInhvJ3Zo2bcPl68VbssGXMiKkIU9sWfA+KShDWsnSJnkMyIJ9+7grgvrv96gA7MymSpj5zaMAYXjrqX0Wd6AXu1cI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630856; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=u0iU0ttoL7ujOmehcyyDtSdZYzSCwePenv3PHjWi51k=; b=bbVfTxovJm+2SOsHejBzeE8CR0lRbfdPiTmPVr9U6jftdUBj7Uz2/fpyOkje+UYWdkAeRyFo5q1EAiCD/V0tUc1whZXsiK3eZTG2hCKgN5oBYCJD+J53+H0TVwHjcxEakj6pifNehB32c+KTXXR49Rt5bFzM1H1ib1ucvsw7Ffk= 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 1793630856980150.54227711725048; Mon, 2 Nov 2026 06:47:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDn-0003Va-1x; Mon, 02 Nov 2026 09:41:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDM-0003Hk-BY for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDB-0008VZ-VJ for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:47 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-365-yG4_DhRjOoqwB77mUPaPKA-1; Mon, 02 Nov 2026 09:40:34 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6C1C9180AC71; Mon, 2 Nov 2026 14:40:33 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D921030000E3; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 1B47221E65C0; Mon, 02 Nov 2026 15:40:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u0iU0ttoL7ujOmehcyyDtSdZYzSCwePenv3PHjWi51k=; b=HEUabVP1eJOiMqB5noLsUi66/lmYE/UuNhfupIJCJG5T5DXQexrNTCerXPa+aKJQeBsZHm ozoCxrfedJZSIpaPnWWKPNrLswDpgNltS7uGtUBKzEdtrajHNVKift2eqi7/5EUoDWCgMw Oo1hhwbsNFJR6+ErM39XqS7bcCgMnFs= X-MC-Unique: yG4_DhRjOoqwB77mUPaPKA-1 X-Mimecast-MFC-AGG-ID: yG4_DhRjOoqwB77mUPaPKA_1793630433 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Alistair Francis Subject: [PULL 68/74] target/riscv: convert PropertyInfo definitions to use qapi_type Date: Mon, 2 Nov 2026 15:40:12 +0100 Message-ID: <20261102144018.3212223-69-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630859909154100 From: Marc-Andr=C3=A9 Lureau Mechanically add a .qapi_type pointer to PropertyInfo definitions in target/riscv/cpu.c. Reviewed-by: Alistair Francis Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-51-armbru@redhat.com> --- target/riscv/cpu.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index adb53aad96..362e561809 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1730,6 +1730,7 @@ static void prop_pmu_num_get(Object *obj, Visitor *v,= const char *name, =20 static const PropertyInfo prop_pmu_num =3D { .type =3D "uint8", + .qapi_type =3D &uint8_type_info, .description =3D "pmu-num", .get =3D prop_pmu_num_get, .set =3D prop_pmu_num_set, @@ -1772,6 +1773,7 @@ static void prop_pmu_mask_get(Object *obj, Visitor *v= , const char *name, =20 static const PropertyInfo prop_pmu_mask =3D { .type =3D "uint32", + .qapi_type =3D &uint32_type_info, .description =3D "pmu-mask", .get =3D prop_pmu_mask_get, .set =3D prop_pmu_mask_set, @@ -1804,6 +1806,7 @@ static void prop_mmu_get(Object *obj, Visitor *v, con= st char *name, =20 static const PropertyInfo prop_mmu =3D { .type =3D "bool", + .qapi_type =3D &bool_type_info, .description =3D "mmu", .get =3D prop_mmu_get, .set =3D prop_mmu_set, @@ -1837,6 +1840,7 @@ static void prop_pmp_get(Object *obj, Visitor *v, con= st char *name, =20 static const PropertyInfo prop_pmp =3D { .type =3D "bool", + .qapi_type =3D &bool_type_info, .description =3D "pmp", .get =3D prop_pmp_get, .set =3D prop_pmp_set, @@ -1877,6 +1881,7 @@ static void prop_num_pmp_regions_get(Object *obj, Vis= itor *v, const char *name, =20 static const PropertyInfo prop_num_pmp_regions =3D { .type =3D "uint8", + .qapi_type =3D &uint8_type_info, .description =3D "num-pmp-regions", .get =3D prop_num_pmp_regions_get, .set =3D prop_num_pmp_regions_set, @@ -1915,6 +1920,7 @@ static void prop_pmp_granularity_get(Object *obj, Vis= itor *v, const char *name, =20 static const PropertyInfo prop_pmp_granularity =3D { .type =3D "uint32", + .qapi_type =3D &uint32_type_info, .description =3D "pmp-granularity", .get =3D prop_pmp_granularity_get, .set =3D prop_pmp_granularity_set, @@ -1991,6 +1997,7 @@ static void prop_priv_spec_get(Object *obj, Visitor *= v, const char *name, =20 static const PropertyInfo prop_priv_spec =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "priv_spec", /* FIXME enum? */ .get =3D prop_priv_spec_get, @@ -2024,6 +2031,7 @@ static void prop_vext_spec_get(Object *obj, Visitor *= v, const char *name, =20 static const PropertyInfo prop_vext_spec =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "vext_spec", /* FIXME enum? */ .get =3D prop_vext_spec_get, @@ -2108,6 +2116,7 @@ static void prop_elen_get(Object *obj, Visitor *v, co= nst char *name, =20 static const PropertyInfo prop_elen =3D { .type =3D "uint16", + .qapi_type =3D &uint16_type_info, .description =3D "elen", .get =3D prop_elen_get, .set =3D prop_elen_set, @@ -2144,6 +2153,7 @@ static void prop_cbom_blksize_get(Object *obj, Visito= r *v, const char *name, =20 static const PropertyInfo prop_cbom_blksize =3D { .type =3D "uint16", + .qapi_type =3D &uint16_type_info, .description =3D "cbom_blocksize", .get =3D prop_cbom_blksize_get, .set =3D prop_cbom_blksize_set, @@ -2180,6 +2190,7 @@ static void prop_cbop_blksize_get(Object *obj, Visito= r *v, const char *name, =20 static const PropertyInfo prop_cbop_blksize =3D { .type =3D "uint16", + .qapi_type =3D &uint16_type_info, .description =3D "cbop_blocksize", .get =3D prop_cbop_blksize_get, .set =3D prop_cbop_blksize_set, @@ -2216,6 +2227,7 @@ static void prop_cboz_blksize_get(Object *obj, Visito= r *v, const char *name, =20 static const PropertyInfo prop_cboz_blksize =3D { .type =3D "uint16", + .qapi_type =3D &uint16_type_info, .description =3D "cboz_blocksize", .get =3D prop_cboz_blksize_get, .set =3D prop_cboz_blksize_set, @@ -2252,6 +2264,7 @@ static void prop_mvendorid_get(Object *obj, Visitor *= v, const char *name, =20 static const PropertyInfo prop_mvendorid =3D { .type =3D "uint32", + .qapi_type =3D &uint32_type_info, .description =3D "mvendorid", .get =3D prop_mvendorid_get, .set =3D prop_mvendorid_set, @@ -2288,6 +2301,7 @@ static void prop_mimpid_get(Object *obj, Visitor *v, = const char *name, =20 static const PropertyInfo prop_mimpid =3D { .type =3D "uint64", + .qapi_type =3D &uint64_type_info, .description =3D "mimpid", .get =3D prop_mimpid_get, .set =3D prop_mimpid_set, @@ -2345,6 +2359,7 @@ static void prop_marchid_get(Object *obj, Visitor *v,= const char *name, =20 static const PropertyInfo prop_marchid =3D { .type =3D "uint64", + .qapi_type =3D &uint64_type_info, .description =3D "marchid", .get =3D prop_marchid_get, .set =3D prop_marchid_set, --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630581; cv=none; d=zohomail.com; s=zohoarc; b=gKJ4mN/MnFlpGWylZBC1ofgT7yQy+MgSczdF7vPIYDP1rcGVZctRR43d3k6Lv/yRlfzXuhzSFQfsDTBvJTkGKCH8q5s4N1r2jtx4E7VTjBHiDLOQA6RLdatmdJulhllqHupVnSox9O75iD/iIBLXU9YD1cAxDs1ubkmUiXpwAdw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630581; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=swdG63NENFR1xPwCwOmnIXUcYihFHG3oU2L7OS1+cSk=; b=YQXYO52v/pzYfKmFnK+PrhzIzld2l3XxEAec7bBtSmAIY6/wZsUC51J567X/4YCD2ssPD+rTJkH3QAO0sxSIPIWv7UccS/n7ngczfQtB8d/XuThOL2YjwbO7IRerQa6EltiFUplfu5tBn3oqo/MX57IotnIasU/h85J/Eg4uEOc= 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 1793630581471736.2502471037733; Mon, 2 Nov 2026 06:43:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtEF-0004Jd-Du; Mon, 02 Nov 2026 09:41:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDI-0003HB-ON for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDA-0008V9-Vq for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:44 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-333-dNT5jaIVOeu3G8RcwI0m3w-1; Mon, 02 Nov 2026 09:40:34 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2484D19539B3; Mon, 2 Nov 2026 14:40:33 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D8DAD5BC; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 1FBE321E65C9; Mon, 02 Nov 2026 15:40:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=swdG63NENFR1xPwCwOmnIXUcYihFHG3oU2L7OS1+cSk=; b=hFSRbwgpKlPizCm7BXz4XIRjBeqsj58ci88LpX2X2Wqz253SjywcDYZ540RfVliNbsZm5e Fybn8xRWk8JzAKxXUU7+/3DAMgQN4YDiuWLIcb8cz5Kdv5mJL+aT0uoS+JGHZ3gV4iuPeg qPrrw5C13sJSJ5+5wvpMC/4ywj19tMw= X-MC-Unique: dNT5jaIVOeu3G8RcwI0m3w-1 X-Mimecast-MFC-AGG-ID: dNT5jaIVOeu3G8RcwI0m3w_1793630433 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Stefan Berger Subject: [PULL 69/74] qdev: convert PropertyInfo definitions to use qapi_type Date: Mon, 2 Nov 2026 15:40:13 +0100 Message-ID: <20261102144018.3212223-70-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630583401154100 From: Marc-Andr=C3=A9 Lureau Add a .qapi_type pointer to the remaining PropertyInfo definitions outside hw/. After this patch, all PropertyInfo definitions have .qapi_type set, except qdev_prop_link (uses .create) and qdev_prop_array (left for later). Reviewed-by: Stefan Berger Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-52-armbru@redhat.com> [Trivial conflict with commit b8bd33422586 (migration: forbid snapshots under Xen resolved] --- backends/spdm-socket.c | 3 ++- backends/tpm/tpm_util.c | 2 ++ migration/options.c | 3 +++ target/sparc/cpu.c | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/backends/spdm-socket.c b/backends/spdm-socket.c index 826efc276d..e1d5626062 100644 --- a/backends/spdm-socket.c +++ b/backends/spdm-socket.c @@ -17,6 +17,7 @@ #include "hw/core/qdev-properties.h" #include "hw/core/qdev-properties-system.h" #include "hw/core/qdev-prop-internal.h" +#include "qapi/qapi-type-infos-sockets.h" =20 static bool read_bytes(const int socket, uint8_t *buffer, size_t number_of_bytes) @@ -254,8 +255,8 @@ void spdm_socket_close(const int socket, SpdmTransportT= ype transport_type) =20 const PropertyInfo qdev_prop_spdm_trans =3D { .type =3D "SpdmTransportType", + .qapi_type =3D &SpdmTransportType_type_info, .description =3D "Spdm Transport, doe/nvme/mctp/scsi/unspecified", - .enum_table =3D &SpdmTransportType_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, diff --git a/backends/tpm/tpm_util.c b/backends/tpm/tpm_util.c index 7019f7fd3e..e52f342933 100644 --- a/backends/tpm/tpm_util.c +++ b/backends/tpm/tpm_util.c @@ -30,6 +30,7 @@ #include "system/tpm_backend.h" #include "system/tpm_util.h" #include "trace.h" +#include "qapi/qapi-builtin-type-infos.h" =20 /* tpm backend property */ =20 @@ -78,6 +79,7 @@ static void release_tpm(Object *obj, const char *name, vo= id *opaque) =20 const PropertyInfo qdev_prop_tpm =3D { .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "ID of a tpm to use as a backend", .get =3D get_tpm, .set =3D set_tpm, diff --git a/migration/options.c b/migration/options.c index 0b7f393492..bd40394aa7 100644 --- a/migration/options.c +++ b/migration/options.c @@ -19,7 +19,9 @@ #include "qapi/clone-visitor.h" #include "qapi/dealloc-visitor.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-commands-migration.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qapi-visit-migration.h" #include "qapi/qmp/qerror.h" #include "qapi/qobject-input-visitor.h" @@ -296,6 +298,7 @@ static void set_default_value_tls_opt(ObjectProperty *o= p, const Property *prop) */ const PropertyInfo qdev_prop_StrOrNull =3D { .type =3D "StrOrNull", + .qapi_type =3D &StrOrNull_type_info, .get =3D get_StrOrNull, .set =3D set_StrOrNull, .release =3D release_StrOrNull, diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 28ae629d50..7729413698 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -30,6 +30,7 @@ #include "tcg/tcg.h" #include "fpu/softfloat.h" #include "target/sparc/translate.h" +#include "qapi/qapi-builtin-type-infos.h" =20 //#define DEBUG_FEATURES =20 @@ -950,6 +951,7 @@ static void sparc_set_nwindows(Object *obj, Visitor *v,= const char *name, =20 static const PropertyInfo qdev_prop_nwindows =3D { .type =3D "int", + .qapi_type =3D &int_type_info, .description =3D "Number of register windows", .get =3D sparc_get_nwindows, .set =3D sparc_set_nwindows, --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630929; cv=none; d=zohomail.com; s=zohoarc; b=To7LC3pD7gfKkE7233EzYcKRNX9dWZ7UU5N7/lK9DwdRubyAs6WBxo59vrNfRaJZELedTLOiBapGoQU0egJhYaxVfcanDcHa2/4T9/2Cj3pVY66CatvyjXYQG9gj/TJx6aCvoH7HzWdfsmcdHi2ulpbAGyvJfb9/ggtgQ7nT91w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630929; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qaLGGKF0opda71yqFAD9mxSczRfJiJ5HeDFJIYvuvG8=; b=RRKZ9OFZYe1y1eCT7yuOA1p6BoDa3RBlkFwp2gqLj8cgqeF7pPud3JNlFe1rl45AD2os1AdfEikRJan8NbdFJuC+2ujrD15jvFEjm2bplPfS6+6hG3oWtl6FzIMvMAqUIifAQbLzjO2/xDX5a19pZs50TPa7fi0XkzKf+tRlv1Q= 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 1793630929267563.0162282779086; Mon, 2 Nov 2026 06:48:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDm-0003VZ-Sc; Mon, 02 Nov 2026 09:41:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDN-0003JS-Is for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDC-0008VH-0N for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:49 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-333-CgFTn6gwO9imXs3Q_vWTsw-1; Mon, 02 Nov 2026 09:40:34 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 24CFC180A9DA; Mon, 2 Nov 2026 14:40:33 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D966D30001A2; Mon, 2 Nov 2026 14:40:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 243B121E65E0; Mon, 02 Nov 2026 15:40:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qaLGGKF0opda71yqFAD9mxSczRfJiJ5HeDFJIYvuvG8=; b=IJYm2qp3tJTOAIVyH0qKmQP0jJehdM64LpC3jEz5bOx4N1k4Md8RODUdVk0KCfEJ02NAZA dP53krf9wOCU9VMG3+PWDmrIHmviB/BqHlDfE//8MqO6fcLI1ZlB7KGAJG8qbZCD2bUaeM DuVTBOM/b/c2TZ0VKVHqwJxylaCYI0A= X-MC-Unique: CgFTn6gwO9imXs3Q_vWTsw-1 X-Mimecast-MFC-AGG-ID: CgFTn6gwO9imXs3Q_vWTsw_1793630433 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 70/74] qdev: PropertyInfo.enum_table is no longer used, drop Date: Mon, 2 Nov 2026 15:40:14 +0100 Message-ID: <20261102144018.3212223-71-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793630930631158500 From: Marc-Andr=C3=A9 Lureau Now that all PropertyInfo for enums definitions use .qapi_type, remove the legacy .enum_table field from PropertyInfo, along with the qdev_propinfo_enum_lookup() helper. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-53-armbru@redhat.com> --- hw/core/qdev-prop-internal.h | 2 -- include/hw/core/qdev-properties.h | 1 - hw/core/qdev-properties-system.c | 12 +++++------- hw/core/qdev-properties.c | 17 ++++------------- 4 files changed, 9 insertions(+), 23 deletions(-) diff --git a/hw/core/qdev-prop-internal.h b/hw/core/qdev-prop-internal.h index c190b7b88c..d7b77844fe 100644 --- a/hw/core/qdev-prop-internal.h +++ b/hw/core/qdev-prop-internal.h @@ -8,8 +8,6 @@ #ifndef HW_CORE_QDEV_PROP_INTERNAL_H #define HW_CORE_QDEV_PROP_INTERNAL_H =20 -const QEnumLookup *qdev_propinfo_enum_lookup(const PropertyInfo *info); - void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp); void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name, diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-prope= rties.h index 1ea2ba66bb..a57291a5a1 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -33,7 +33,6 @@ struct Property { struct PropertyInfo { const char *type; const char *description; - const QEnumLookup *enum_table; const QAPITypeInfo *qapi_type; bool realized_set_allowed; /* allow setting property on realized devic= e */ char *(*print)(Object *obj, const Property *prop); diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 8924f84806..4d605c2056 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -592,7 +592,7 @@ static void qdev_propinfo_set_losttickpolicy(Object *ob= j, Visitor *v, int value; =20 if (!visit_type_enum(v, name, &value, - qdev_propinfo_enum_lookup(prop->info), errp)) { + prop->info->qapi_type->lookup, errp)) { return; } =20 @@ -1081,8 +1081,7 @@ static void get_prop_pcielinkspeed(Object *obj, Visit= or *v, const char *name, abort(); } =20 - visit_type_enum(v, name, &speed, - qdev_propinfo_enum_lookup(prop->info), errp); + visit_type_enum(v, name, &speed, prop->info->qapi_type->lookup, errp); } =20 static void set_prop_pcielinkspeed(Object *obj, Visitor *v, const char *na= me, @@ -1093,7 +1092,7 @@ static void set_prop_pcielinkspeed(Object *obj, Visit= or *v, const char *name, int speed; =20 if (!visit_type_enum(v, name, &speed, - qdev_propinfo_enum_lookup(prop->info), errp)) { + prop->info->qapi_type->lookup, errp)) { return; } =20 @@ -1167,8 +1166,7 @@ static void get_prop_pcielinkwidth(Object *obj, Visit= or *v, const char *name, abort(); } =20 - visit_type_enum(v, name, &width, - qdev_propinfo_enum_lookup(prop->info), errp); + visit_type_enum(v, name, &width, prop->info->qapi_type->lookup, errp); } =20 static void set_prop_pcielinkwidth(Object *obj, Visitor *v, const char *na= me, @@ -1179,7 +1177,7 @@ static void set_prop_pcielinkwidth(Object *obj, Visit= or *v, const char *name, int width; =20 if (!visit_type_enum(v, name, &width, - qdev_propinfo_enum_lookup(prop->info), errp)) { + prop->info->qapi_type->lookup, errp)) { return; } =20 diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index fb11eb1f1c..e2ea894595 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -101,22 +101,13 @@ static ObjectPropertyAccessor *field_prop_setter(cons= t PropertyInfo *info) return info->set ? field_prop_set : NULL; } =20 -const QEnumLookup *qdev_propinfo_enum_lookup(const PropertyInfo *info) -{ - if (info->qapi_type) { - assert(info->qapi_type->lookup); - return info->qapi_type->lookup; - } - return info->enum_table; -} - void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { const Property *prop =3D opaque; int *ptr =3D object_field_prop_ptr(obj, prop); =20 - visit_type_enum(v, name, ptr, qdev_propinfo_enum_lookup(prop->info), e= rrp); + visit_type_enum(v, name, ptr, prop->info->qapi_type->lookup, errp); } =20 void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name, @@ -125,14 +116,14 @@ void qdev_propinfo_set_enum(Object *obj, Visitor *v, = const char *name, const Property *prop =3D opaque; int *ptr =3D object_field_prop_ptr(obj, prop); =20 - visit_type_enum(v, name, ptr, qdev_propinfo_enum_lookup(prop->info), e= rrp); + visit_type_enum(v, name, ptr, prop->info->qapi_type->lookup, errp); } =20 void qdev_propinfo_set_default_value_enum(ObjectProperty *op, const Property *prop) { object_property_set_default_str(op, - qapi_enum_lookup(qdev_propinfo_enum_lookup(prop->info), + qapi_enum_lookup(prop->info->qapi_type->lookup, prop->defval.i)); } =20 @@ -970,7 +961,7 @@ void qdev_prop_set_enum(DeviceState *dev, const char *n= ame, int value) =20 prop =3D qdev_prop_find(dev, name); object_property_set_str(OBJECT(dev), name, - qapi_enum_lookup(qdev_propinfo_enum_lookup(prop->info), value), + qapi_enum_lookup(prop->info->qapi_type->lookup, value), &error_abort); } =20 --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630869; cv=none; d=zohomail.com; s=zohoarc; b=hV0RoOIZpZgrtTdqjwZiWCIMTfLxYFbHWzDK60CfNOqkMxO7T99roiqgtZAGGEEpkofGve2QJXq2yH+Ow0RkVJfG7J6NWJ9iKDXLBa83Em+Bey4ClEUVL6lgyNoJjOjSQlNhTOHznPz+SvIL5zXr21qTjPeCXOe4CCd1Ml5bwi4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630869; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iGTsBjtMHTNvAauBjjuihyYYodKSv/JbP/LnVjGiib4=; b=ZnhsSS6Wm+AP8Wab4t7taIxAN1JtaUxYmnbodQK/Qt6ueY7Orck/2GgUIK8ZqyvVktSrIyYlhVLgGxiBv/jAeMaXW2N5zoERxzjY/1+QkTyub5Ysl2lGlCIzoFw+mOPgLQvMCN/oHP9ztpDIR3Rk5UQHGQBNHYxb3rtIyYRLgm8= 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 179363086900573.35535996337012; Mon, 2 Nov 2026 06:47:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDr-0003Xy-Iy; Mon, 02 Nov 2026 09:41:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDQ-0003K5-Lw for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDC-00005E-Ro for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:50 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-342-7CYNUzsCPsauD3860NbzoQ-1; Mon, 02 Nov 2026 09:40:34 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D4F9819539A6; Mon, 2 Nov 2026 14:40:33 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5702C26C; Mon, 2 Nov 2026 14:40:33 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 28C9D21E65E7; Mon, 02 Nov 2026 15:40:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iGTsBjtMHTNvAauBjjuihyYYodKSv/JbP/LnVjGiib4=; b=VU3lBWUu5DTXTwRNf6TtQHkrOtsSO6VmDCWrz6TOZNXSaCzxDkC2YPNlNTge6HFNtRuVPV xXlC0vpLY7V+Y4inAW2APNRxkP3ITSDaH2i0AwPIkAet5JvjaBLs9vzgaSzPWJnge1GlZw lG7OJyFhsrhm2T2Kp74LfPucAUQ6Oj4= X-MC-Unique: 7CYNUzsCPsauD3860NbzoQ-1 X-Mimecast-MFC-AGG-ID: 7CYNUzsCPsauD3860NbzoQ_1793630434 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 71/74] hw/i386: convert PCSouthBridgeOption to QAPI enum Date: Mon, 2 Nov 2026 15:40:15 +0100 Message-ID: <20261102144018.3212223-72-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630872478154100 From: Marc-Andr=C3=A9 Lureau Move PCSouthBridgeOption from a hand-rolled C enum to a proper QAPI enum in qapi/machine.json. This gives the x-south-bridge property a generated type_info with a valid masked_name, so it appears in query-qmp-schema introspection and the qapi-type field of qom-list-properties output. The south_bridge/default_south_bridge fields change from const char * to PCSouthBridgeOption, with an explicit mapping table from enum value to QOM device type name. Enum values are changed: "PIIX3"->"ppix3", "piix4-isa"->"piix4", this is under a x-property, so shouldn't be a breaking change. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-54-armbru@redhat.com> --- qapi/machine.json | 13 +++++++++++ include/hw/i386/pc.h | 4 ++-- hw/i386/pc_piix.c | 52 +++++++++++--------------------------------- 3 files changed, 28 insertions(+), 41 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 2ee7055dcd..18d9dce849 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -416,6 +416,19 @@ { 'enum': 'LostTickPolicy', 'data': ['discard', 'delay', 'slew' ] } =20 +## +# @PCSouthBridgeOption: +# South bridge chipset option for PC i440FX machines. +# +# @piix3: Intel PIIX3 (default) +# +# @piix4: Intel PIIX4 +# +# Since: 11.2 +## +{ 'enum': 'PCSouthBridgeOption', + 'data': ['piix3', 'piix4'] } + ## # @inject-nmi: # Injects a Non-Maskable Interrupt (machine specific: for example diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 8edec62a1a..3afd376116 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -47,7 +47,7 @@ typedef struct PCMachineState { uint64_t max_ram_below_4g; OnOffAuto vmport; SmbiosEntryPointType smbios_entry_point_type; - const char *south_bridge; + PCSouthBridgeOption south_bridge; =20 bool acpi_build_enabled; bool wdat_enabled; @@ -94,7 +94,7 @@ struct PCMachineClass { =20 /* Device configuration: */ bool pci_enabled; - const char *default_south_bridge; + PCSouthBridgeOption default_south_bridge; =20 /* Compat options: */ =20 diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index ae07e6c56c..20bd4231c1 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -47,6 +47,7 @@ #include "hw/acpi/acpi.h" #include "hw/vfio/types.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-machine.h" #include "qemu/error-report.h" #include "system/xen.h" #ifdef CONFIG_XEN @@ -75,6 +76,11 @@ static GlobalProperty pc_piix_compat_defaults[] =3D { static const size_t pc_piix_compat_defaults_len =3D G_N_ELEMENTS(pc_piix_compat_defaults); =20 +static const char *pc_south_bridge_type[] =3D { + [PC_SOUTH_BRIDGE_OPTION_PIIX3] =3D TYPE_PIIX3_DEVICE, + [PC_SOUTH_BRIDGE_OPTION_PIIX4] =3D TYPE_PIIX4_PCI_DEVICE, +}; + /* * Return the global irq number corresponding to a given device irq * pin. We could also use the bus number to have a more precise mapping. @@ -236,7 +242,8 @@ static void pc_init1(MachineState *machine, const char = *pci_type) =20 gsi_state =3D pc_gsi_create(&x86ms->gsi, true); =20 - pci_dev =3D pci_new_multifunction(-1, pcms->south_bridge); + pci_dev =3D pci_new_multifunction(-1, + pc_south_bridge_type[pcms->south_bridg= e]); object_property_set_bool(OBJECT(pci_dev), "has-usb", machine_usb(machine), &error_abort); object_property_set_bool(OBJECT(pci_dev), "has-acpi", @@ -317,51 +324,18 @@ static void pc_init1(MachineState *machine, const cha= r *pci_type) } } =20 -typedef enum PCSouthBridgeOption { - PC_SOUTH_BRIDGE_OPTION_PIIX3, - PC_SOUTH_BRIDGE_OPTION_PIIX4, - PC_SOUTH_BRIDGE_OPTION_MAX, -} PCSouthBridgeOption; - -static const QEnumLookup PCSouthBridgeOption_lookup =3D { - .array =3D (const char *const[]) { - [PC_SOUTH_BRIDGE_OPTION_PIIX3] =3D TYPE_PIIX3_DEVICE, - [PC_SOUTH_BRIDGE_OPTION_PIIX4] =3D TYPE_PIIX4_PCI_DEVICE, - }, - .size =3D PC_SOUTH_BRIDGE_OPTION_MAX -}; - static int pc_get_south_bridge(Object *obj, Error **errp) { PCMachineState *pcms =3D PC_MACHINE(obj); - int i; =20 - for (i =3D 0; i < PCSouthBridgeOption_lookup.size; i++) { - if (g_strcmp0(PCSouthBridgeOption_lookup.array[i], - pcms->south_bridge) =3D=3D 0) { - return i; - } - } - - error_setg(errp, "Invalid south bridge value set"); - return 0; + return pcms->south_bridge; } =20 static void pc_set_south_bridge(Object *obj, int value, Error **errp) { PCMachineState *pcms =3D PC_MACHINE(obj); =20 - if (value < 0) { - error_setg(errp, "Value can't be negative"); - return; - } - - if (value >=3D PCSouthBridgeOption_lookup.size) { - error_setg(errp, "Value too big"); - return; - } - - pcms->south_bridge =3D PCSouthBridgeOption_lookup.array[value]; + pcms->south_bridge =3D value; } =20 #ifdef CONFIG_XEN @@ -398,7 +372,7 @@ static void pc_i440fx_machine_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); ObjectClass *oc =3D OBJECT_CLASS(m); - pcmc->default_south_bridge =3D TYPE_PIIX3_DEVICE; + pcmc->default_south_bridge =3D PC_SOUTH_BRIDGE_OPTION_PIIX3; pcmc->pci_root_uid =3D 0; pcmc->default_cpu_version =3D 1; =20 @@ -414,8 +388,8 @@ static void pc_i440fx_machine_options(MachineClass *m) machine_class_allow_dynamic_sysbus_dev(m, TYPE_UEFI_VARS_X64); =20 object_class_property_add_enum(oc, "x-south-bridge", - "PCSouthBridgeOption", NULL, - &PCSouthBridgeOption_lookup, + "PCSouthBridgeOption", + &PCSouthBridgeOption_type_info, NULL, pc_get_south_bridge, pc_set_south_bridge); object_class_property_set_description(oc, "x-south-bridge", --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630881; cv=none; d=zohomail.com; s=zohoarc; b=TgBvu9vt824LGJWzJXmiyAqY0yJKWKqvKC7Wakd6EVS4/eScpvEWkQSpYar3NilpqRJPnMbTlzXn+G7IFS5aBI93b+Q68KyYW5LsmYvjjfMYqAIAo/z27z5LuhQ1jA++tlzfSGo/cA/wV++417lDdVsiyTdxiBWsoWB8+DtMy08= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630881; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lVLdoa6aa4KRwq2JE0J2bZXJO/DLNHQgPxCy5ibw3Ws=; b=LGVzEbSo4rU3Jq4IcaKibge8z5pFkaCJabJ+Hdi1edPmnh5wEoEpG+CoDwYkxN9n6xd5OxhNfiIsaI3+dkJyK0u4+wFmr2VFGO8FqZLT9LJHtPtHGnqEF2UMs9g+nT8M7L+QZz6qA9SuKakoLCJ8CWOevhGsitWznTitBV8Bg0U= 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 1793630881399443.6351061070536; Mon, 2 Nov 2026 06:48:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtDm-0003VQ-0w; Mon, 02 Nov 2026 09:41:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDM-0003Hl-Bu for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:51 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDB-0008W3-Mi for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:47 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-342-hyvn4palPfupDHPBdtfHGQ-1; Mon, 02 Nov 2026 09:40:34 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D823019539A9; Mon, 2 Nov 2026 14:40:33 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 579111956049; Mon, 2 Nov 2026 14:40:33 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2D6E221E65EA; Mon, 02 Nov 2026 15:40:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lVLdoa6aa4KRwq2JE0J2bZXJO/DLNHQgPxCy5ibw3Ws=; b=Vblx3M0PfMtx+AETva3cgcgYw7xVrzSSY4WyxrBw/EVyt5tuXzhYizA6MM1Y8hjsqat9pK rlgIeD+P1bEF3EYCnvoJI8VCRkbaJCJZBm+Gon+RBzKsxPBH8d4PU6vQMkztYF0DtMXBC5 LlPsPNS4yyAHap2hbMCELZNyicxAOZs= X-MC-Unique: hyvn4palPfupDHPBdtfHGQ-1 X-Mimecast-MFC-AGG-ID: hyvn4palPfupDHPBdtfHGQ_1793630434 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 72/74] qom: Drop object_property_add_enum() parameter @lookup Date: Mon, 2 Nov 2026 15:40:16 +0100 Message-ID: <20261102144018.3212223-73-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630884295154100 All callers now pass non-null @qapi_type and null @lookup. Drop @lookup and simplify the code accordingly. Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-55-armbru@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau --- include/chardev/char.h | 3 +-- include/qom/object.h | 4 ---- accel/hvf/hvf-all.c | 2 +- accel/kvm/kvm-all.c | 2 +- accel/whpx/whpx-common.c | 4 ++-- authz/list.c | 1 - backends/hostmem-file.c | 2 +- backends/hostmem-memfd.c | 4 ++-- backends/hostmem.c | 2 +- crypto/secret_common.c | 2 +- crypto/tlscreds.c | 2 +- hw/arm/virt.c | 4 ++-- hw/i386/microvm.c | 15 ++++++--------- hw/i386/pc.c | 5 ++--- hw/i386/pc_piix.c | 5 ++--- hw/i386/x86.c | 12 ++++-------- hw/loongarch/virt.c | 14 +++++++------- hw/microblaze/petalogix_s3adsp1800_mmu.c | 2 +- hw/riscv/virt.c | 10 +++++----- monitor/qmp.c | 2 +- net/filter.c | 5 +++-- qom/object.c | 15 ++++----------- target/i386/kvm/kvm.c | 4 ++-- target/i386/sev.c | 2 +- target/i386/whpx/whpx-all.c | 7 +++---- tests/unit/check-qom-proplist.c | 3 +-- ui/dbus.c | 4 ++-- ui/input-linux.c | 2 +- 28 files changed, 58 insertions(+), 81 deletions(-) diff --git a/include/chardev/char.h b/include/chardev/char.h index 61e6957118..45fc3edb5e 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -358,8 +358,7 @@ static inline void chardev_vc_add_encoding_prop(ObjectC= lass *oc, void (*set)(Object *, int, Error **)) { object_class_property_add_enum(oc, "encoding", "ChardevVCEncoding", - &ChardevVCEncoding_type_info, NULL, - get, set); + &ChardevVCEncoding_type_info, get, set); } =20 #endif diff --git a/include/qom/object.h b/include/qom/object.h index 0fe97e9371..66197b406b 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1988,7 +1988,6 @@ ObjectProperty *object_class_property_add_bool(Object= Class *klass, * @name: the name of the property * @typename: the name of the enum data type * @qapi_type: QAPI type info descriptor - * @lookup: enum value namelookup table * @get: the getter or %NULL if the property is write-only. * @set: the setter or %NULL if the property is read-only * @@ -2000,7 +1999,6 @@ ObjectProperty *object_class_property_add_bool(Object= Class *klass, ObjectProperty *object_property_add_enum(Object *obj, const char *name, const char *typename, const QAPITypeInfo *qapi_type, - const QEnumLookup *lookup, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)); =20 @@ -2010,7 +2008,6 @@ ObjectProperty *object_property_add_enum(Object *obj,= const char *name, * @name: the name of the property * @typename: the name of the enum data type * @qapi_type: QAPI type info descriptor - * @lookup: enum value namelookup table * @get: the getter or %NULL if the property is write-only. * @set: the setter or %NULL if the property is read-only * @@ -2023,7 +2020,6 @@ ObjectProperty *object_class_property_add_enum(Object= Class *klass, const char *name, const char *typename, const QAPITypeInfo *qapi_type, - const QEnumLookup *lookup, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)); =20 diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 938379b9f2..f233d86c06 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -271,7 +271,7 @@ static void hvf_accel_class_init(ObjectClass *oc, const= void *data) =20 object_class_property_add_enum(oc, "kernel-irqchip", "on|off|split", &OnOffSplit_type_info, NULL, - NULL, hvf_set_kernel_irqchip); + hvf_set_kernel_irqchip); object_class_property_set_description(oc, "kernel-irqchip", "Configure HVF irqchip"); } diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index dcb1db139d..313c41c4a2 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -4299,7 +4299,7 @@ static void kvm_accel_class_init(ObjectClass *oc, con= st void *data) =20 object_class_property_add_enum(oc, "kernel-irqchip", "on|off|split", &OnOffSplit_type_info, NULL, - NULL, kvm_set_kernel_irqchip); + kvm_set_kernel_irqchip); object_class_property_set_description(oc, "kernel-irqchip", "Configure KVM in-kernel irqchip"); =20 diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c index 068258bf6c..78d2827809 100644 --- a/accel/whpx/whpx-common.c +++ b/accel/whpx/whpx-common.c @@ -510,12 +510,12 @@ static void whpx_accel_class_init(ObjectClass *oc, co= nst void *data) =20 object_class_property_add_enum(oc, "kernel-irqchip", "on|off|split", &OnOffSplit_type_info, NULL, - NULL, whpx_set_kernel_irqchip); + whpx_set_kernel_irqchip); object_class_property_set_description(oc, "kernel-irqchip", "Configure WHPX in-kernel irqchip"); object_class_property_add_enum(oc, "hyperv", "OnOffAuto", &OnOffAuto_type_info, NULL, - NULL, whpx_set_hyperv); + whpx_set_hyperv); object_class_property_set_description(oc, "hyperv", "Configure Hyper-V enlightenments"); =20 diff --git a/authz/list.c b/authz/list.c index 75155cf077..c3dd9d7b68 100644 --- a/authz/list.c +++ b/authz/list.c @@ -123,7 +123,6 @@ qauthz_list_class_init(ObjectClass *oc, const void *dat= a) =20 object_class_property_add_enum(oc, "policy", "QAuthZListPolicy", &QAuthZListPolicy_type_info, - NULL, qauthz_list_prop_get_policy, qauthz_list_prop_set_policy); =20 diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 2f65ca3678..6ad9cad032 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -293,7 +293,7 @@ file_backend_class_init(ObjectClass *oc, const void *da= ta) file_memory_backend_get_readonly, file_memory_backend_set_readonly); object_class_property_add_enum(oc, "rom", "OnOffAuto", - &OnOffAuto_type_info, NULL, + &OnOffAuto_type_info, file_memory_backend_get_rom, file_memory_backend_set_rom); object_class_property_set_description(oc, "rom", diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index a6e46aa706..46489212a2 100644 --- a/backends/hostmem-memfd.c +++ b/backends/hostmem-memfd.c @@ -204,8 +204,8 @@ memfd_backend_class_init(ObjectClass *oc, const void *d= ata) "Huge pages size (ex: 2M, 1G= )"); } =20 - object_class_property_add_enum(oc, "guest-memfd", "OnOffAuto", - &OnOffAuto_type_info, NULL, + object_class_property_add_enum(oc, "guest-memfd", "OnOffAuto", + &OnOffAuto_type_info, memfd_backend_get_guest_memfd, memfd_backend_set_guest_memfd); object_class_property_set_description(oc, "guest-memfd", diff --git a/backends/hostmem.c b/backends/hostmem.c index 0f39f4d1b7..173d042be3 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -554,7 +554,7 @@ host_memory_backend_class_init(ObjectClass *oc, const v= oid *data) object_class_property_set_description(oc, "host-nodes", "Binds memory to the list of NUMA host nodes"); object_class_property_add_enum(oc, "policy", "HostMemPolicy", - &HostMemPolicy_type_info, NULL, + &HostMemPolicy_type_info, host_memory_backend_get_policy, host_memory_backend_set_policy); object_class_property_set_description(oc, "policy", diff --git a/crypto/secret_common.c b/crypto/secret_common.c index 8e05f1365e..98898aa885 100644 --- a/crypto/secret_common.c +++ b/crypto/secret_common.c @@ -271,7 +271,7 @@ qcrypto_secret_class_init(ObjectClass *oc, const void *= data) ucc->complete =3D qcrypto_secret_complete; =20 object_class_property_add_enum(oc, "format", "QCryptoSecretFormat", - &QCryptoSecretFormat_type_info, NULL, + &QCryptoSecretFormat_type_info, qcrypto_secret_prop_get_format, qcrypto_secret_prop_set_format); object_class_property_add_str(oc, "keyid", diff --git a/crypto/tlscreds.c b/crypto/tlscreds.c index 021e4bf111..74d8d4fe00 100644 --- a/crypto/tlscreds.c +++ b/crypto/tlscreds.c @@ -223,7 +223,7 @@ qcrypto_tls_creds_class_init(ObjectClass *oc, const voi= d *data) qcrypto_tls_creds_prop_get_dir, qcrypto_tls_creds_prop_set_dir); object_class_property_add_enum(oc, "endpoint", "QCryptoTLSCredsEndpoin= t", - &QCryptoTLSCredsEndpoint_type_info, NUL= L, + &QCryptoTLSCredsEndpoint_type_info, qcrypto_tls_creds_prop_get_endpoint, qcrypto_tls_creds_prop_set_endpoint); object_class_property_add_str(oc, "priority", diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 2f03679afd..57bd78479f 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -4202,8 +4202,8 @@ static void virt_machine_class_init(ObjectClass *oc, = const void *data) mc->default_nic =3D "virtio-net-pci"; =20 object_class_property_add_enum(oc, "acpi", "OnOffAuto", - &OnOffAuto_type_info, NULL, - virt_get_acpi, virt_set_acpi); + &OnOffAuto_type_info, virt_get_acpi, + virt_set_acpi); object_class_property_set_description(oc, "acpi", "Enable ACPI"); object_class_property_add_bool(oc, "secure", virt_get_secure, diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index 7f010cb2f2..ed391c0596 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -658,25 +658,22 @@ static void microvm_class_init(ObjectClass *oc, const= void *data) hc->unplug_request =3D microvm_device_unplug_request_cb; hc->unplug =3D microvm_device_unplug_cb; =20 - object_class_property_add_enum(oc, MICROVM_MACHINE_RTC, - "OnOffAuto", - &OnOffAuto_type_info, NULL, + object_class_property_add_enum(oc, MICROVM_MACHINE_RTC, "OnOffAuto", + &OnOffAuto_type_info, microvm_machine_get_rtc, microvm_machine_set_rtc); object_class_property_set_description(oc, MICROVM_MACHINE_RTC, "Enable MC146818 RTC"); =20 - object_class_property_add_enum(oc, MICROVM_MACHINE_PCIE, - "OnOffAuto", - &OnOffAuto_type_info, NULL, + object_class_property_add_enum(oc, MICROVM_MACHINE_PCIE, "OnOffAuto", + &OnOffAuto_type_info, microvm_machine_get_pcie, microvm_machine_set_pcie); object_class_property_set_description(oc, MICROVM_MACHINE_PCIE, "Enable PCIe"); =20 - object_class_property_add_enum(oc, MICROVM_MACHINE_IOAPIC2, - "OnOffAuto", - &OnOffAuto_type_info, NULL, + object_class_property_add_enum(oc, MICROVM_MACHINE_IOAPIC2, "OnOffAuto= ", + &OnOffAuto_type_info, microvm_machine_get_ioapic2, microvm_machine_set_ioapic2); object_class_property_set_description(oc, MICROVM_MACHINE_IOAPIC2, diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 80940e81e5..4737eb471c 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1726,9 +1726,8 @@ static void pc_machine_class_init(ObjectClass *oc, co= nst void *data) object_class_property_set_description(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "Maximum ram below the 4G boundary (32bit boundary)"); =20 - object_class_property_add_enum(oc, PC_MACHINE_VMPORT, - "OnOffAuto", - &OnOffAuto_type_info, NULL, + object_class_property_add_enum(oc, PC_MACHINE_VMPORT, "OnOffAuto", + &OnOffAuto_type_info, pc_machine_get_vmport, pc_machine_set_vmport); object_class_property_set_description(oc, PC_MACHINE_VMPORT, diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 20bd4231c1..211e3c5f9e 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -389,9 +389,8 @@ static void pc_i440fx_machine_options(MachineClass *m) =20 object_class_property_add_enum(oc, "x-south-bridge", "PCSouthBridgeOption", - &PCSouthBridgeOption_type_info, NULL, - pc_get_south_bridge, - pc_set_south_bridge); + &PCSouthBridgeOption_type_info, + pc_get_south_bridge, pc_set_south_bridg= e); object_class_property_set_description(oc, "x-south-bridge", "Use a different south bridge than PI= IX3"); compat_props_add(m->compat_props, diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 4e5a7cf270..4b75b7406a 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -373,29 +373,25 @@ static void x86_machine_class_init(ObjectClass *oc, c= onst void *data) nc->raise_nmi =3D x86_nmi; =20 object_class_property_add_enum(oc, X86_MACHINE_SMM, "OnOffAuto", - &OnOffAuto_type_info, NULL, - x86_machine_get_smm, + &OnOffAuto_type_info, x86_machine_get_s= mm, x86_machine_set_smm); object_class_property_set_description(oc, X86_MACHINE_SMM, "Enable SMM"); =20 object_class_property_add_enum(oc, X86_MACHINE_ACPI, "OnOffAuto", - &OnOffAuto_type_info, NULL, - x86_machine_get_acpi, + &OnOffAuto_type_info, x86_machine_get_a= cpi, x86_machine_set_acpi); object_class_property_set_description(oc, X86_MACHINE_ACPI, "Enable ACPI"); =20 object_class_property_add_enum(oc, X86_MACHINE_PIT, "OnOffAuto", - &OnOffAuto_type_info, NULL, - x86_machine_get_pit, + &OnOffAuto_type_info, x86_machine_get_p= it, x86_machine_set_pit); object_class_property_set_description(oc, X86_MACHINE_PIT, "Enable i8254 PIT"); =20 object_class_property_add_enum(oc, X86_MACHINE_PIC, "OnOffAuto", - &OnOffAuto_type_info, NULL, - x86_machine_get_pic, + &OnOffAuto_type_info, x86_machine_get_p= ic, x86_machine_set_pic); object_class_property_set_description(oc, X86_MACHINE_PIC, "Enable i8259 PIC"); diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 1eae2bffe6..598898e0fb 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -1470,18 +1470,18 @@ static void virt_class_init(ObjectClass *oc, const = void *data) hc->unplug =3D virt_device_unplug; =20 object_class_property_add_enum(oc, "acpi", "OnOffAuto", - &OnOffAuto_type_info, NULL, - virt_get_acpi, virt_set_acpi); + &OnOffAuto_type_info, virt_get_acpi, + virt_set_acpi); object_class_property_set_description(oc, "acpi", "Enable ACPI"); object_class_property_add_enum(oc, "v-eiointc", "OnOffAuto", - &OnOffAuto_type_info, NULL, - virt_get_veiointc, virt_set_veiointc); + &OnOffAuto_type_info, virt_get_veiointc, + virt_set_veiointc); object_class_property_set_description(oc, "v-eiointc", "Enable Virt Extend I/O Interrupt Controller."= ); - object_class_property_add_enum(oc, "dmsi", "OnOffAuto", - &OnOffAuto_type_info, NULL, - virt_get_dmsi, virt_set_dmsi); + object_class_property_add_enum(oc, "dmsi", "OnOffAuto", + &OnOffAuto_type_info, virt_get_dmsi, + virt_set_dmsi); object_class_property_set_description(oc, "dmsi", "Enable direct Message-interrupts Controller."= ); machine_class_allow_dynamic_sysbus_dev(mc, TYPE_RAMFB_DEVICE); diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petal= ogix_s3adsp1800_mmu.c index b52f12924d..4ad04801ce 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -176,7 +176,7 @@ static void petalogix_s3adsp1800_machine_class_init(Obj= ectClass *oc, mc->is_default =3D true; =20 prop =3D object_class_property_add_enum(oc, "endianness", "EndianMode", - &EndianMode_type_info, NULL, + &EndianMode_type_info, machine_get_endianness, machine_set_endianness); object_property_set_default_str(prop, target_big_endian() ? "big" diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 31fecdc964..0cb731482a 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -1175,14 +1175,14 @@ static void virt_machine_class_init(ObjectClass *oc= , const void *data) } =20 object_class_property_add_enum(oc, "acpi", "OnOffAuto", - &OnOffAuto_type_info, NULL, - virt_get_acpi, virt_set_acpi); + &OnOffAuto_type_info, virt_get_acpi, + virt_set_acpi); object_class_property_set_description(oc, "acpi", "Enable ACPI"); =20 - object_class_property_add_enum(oc, "iommu-sys", "OnOffAuto", - &OnOffAuto_type_info, NULL, - virt_get_iommu_sys, virt_set_iommu_sys); + object_class_property_add_enum(oc, "iommu-sys", "OnOffAuto", + &OnOffAuto_type_info, virt_get_iommu_sy= s, + virt_set_iommu_sys); object_class_property_set_description(oc, "iommu-sys", "Enable IOMMU platform device"); } diff --git a/monitor/qmp.c b/monitor/qmp.c index c6341f1a20..d2e45d3993 100644 --- a/monitor/qmp.c +++ b/monitor/qmp.c @@ -136,7 +136,7 @@ static void monitor_qmp_class_init(ObjectClass *cls, co= nst void *data) monitor_qmp_set_pretty); object_class_property_add_enum(cls, "close-action", "MonitorQMPCloseAction", - &MonitorQMPCloseAction_type_info, NULL, + &MonitorQMPCloseAction_type_info, monitor_qmp_get_close_action, monitor_qmp_set_close_action); =20 diff --git a/net/filter.c b/net/filter.c index 9013d872ea..145c72107a 100644 --- a/net/filter.c +++ b/net/filter.c @@ -344,8 +344,9 @@ static void netfilter_class_init(ObjectClass *oc, const= void *data) object_class_property_add_str(oc, "netdev", netfilter_get_netdev_id, netfilter_set_n= etdev_id); object_class_property_add_enum(oc, "queue", "NetFilterDirection", - &NetFilterDirection_type_info, NULL, - netfilter_get_direction, netfilter_set_= direction); + &NetFilterDirection_type_info, + netfilter_get_direction, + netfilter_set_direction); object_class_property_add_str(oc, "status", netfilter_get_status, netfilter_set_stat= us); object_class_property_add_str(oc, "position", diff --git a/qom/object.c b/qom/object.c index 8444afd24f..10b3145f5f 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2501,8 +2501,7 @@ object_class_property_add_bool(ObjectClass *klass, co= nst char *name, } =20 typedef struct EnumProperty { - const QAPITypeInfo *qapi_type; /* non-null for QAPI enums */ - const QEnumLookup *lookup; + const QAPITypeInfo *qapi_type; int (*get)(Object *, Error **); void (*set)(Object *, int, Error **); } EnumProperty; @@ -2520,7 +2519,7 @@ static void property_get_enum(Object *obj, Visitor *v= , const char *name, return; } =20 - visit_type_enum(v, name, &value, prop->lookup, errp); + visit_type_enum(v, name, &value, prop->qapi_type->lookup, errp); } =20 static void property_set_enum(Object *obj, Visitor *v, const char *name, @@ -2529,7 +2528,7 @@ static void property_set_enum(Object *obj, Visitor *v= , const char *name, EnumProperty *prop =3D opaque; int value; =20 - if (!visit_type_enum(v, name, &value, prop->lookup, errp)) { + if (!visit_type_enum(v, name, &value, prop->qapi_type->lookup, errp)) { return; } prop->set(obj, value, errp); @@ -2539,15 +2538,12 @@ ObjectProperty * object_property_add_enum(Object *obj, const char *name, const char *typename, const QAPITypeInfo *qapi_type, - const QEnumLookup *lookup, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)) { EnumProperty *prop =3D g_malloc(sizeof(*prop)); =20 - assert(!qapi_type !=3D !lookup); prop->qapi_type =3D qapi_type; - prop->lookup =3D lookup ?: qapi_type->lookup; prop->get =3D get; prop->set =3D set; =20 @@ -2562,15 +2558,12 @@ ObjectProperty * object_class_property_add_enum(ObjectClass *klass, const char *name, const char *typename, const QAPITypeInfo *qapi_type, - const QEnumLookup *lookup, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)) { EnumProperty *prop =3D g_malloc(sizeof(*prop)); =20 - assert(!qapi_type !=3D !lookup); prop->qapi_type =3D qapi_type; - prop->lookup =3D lookup ?: qapi_type->lookup; prop->get =3D get; prop->set =3D set; =20 @@ -2607,7 +2600,7 @@ int object_property_get_enum(Object *obj, const char = *name, return -1; } =20 - ret =3D qapi_enum_parse(enumprop->lookup, str, -1, errp); + ret =3D qapi_enum_parse(enumprop->qapi_type->lookup, str, -1, errp); g_free(str); =20 return ret; diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index fcd6d79ce9..4a4087c6de 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -7101,7 +7101,7 @@ static void kvm_arch_set_honor_guest_pat(Object *obj,= int value, Error **errp) void kvm_arch_accel_class_init(ObjectClass *oc) { object_class_property_add_enum(oc, "notify-vmexit", "NotifyVMexitOptio= n", - &NotifyVmexitOption_type_info, NULL, + &NotifyVmexitOption_type_info, kvm_arch_get_notify_vmexit, kvm_arch_set_notify_vmexit); object_class_property_set_description(oc, "notify-vmexit", @@ -7141,7 +7141,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc) "Maximum number of Xen PIRQs"); =20 object_class_property_add_enum(oc, "honor-guest-pat", "OnOffAuto", - &OnOffAuto_type_info, NULL, + &OnOffAuto_type_info, kvm_arch_get_honor_guest_pat, kvm_arch_set_honor_guest_pat); object_class_property_set_description(oc, "honor-guest-pat", diff --git a/target/i386/sev.c b/target/i386/sev.c index c1c12d1125..604c2255ac 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -3019,7 +3019,7 @@ sev_guest_class_init(ObjectClass *oc, const void *dat= a) object_class_property_set_description(oc, "session-file", "guest owners session parameters (encoded with base64)"); object_class_property_add_enum(oc, "legacy-vm-type", "OnOffAuto", - &OnOffAuto_type_info, NULL, + &OnOffAuto_type_info, sev_guest_get_legacy_vm_type, sev_guest_set_legacy_vm_type); object_class_property_set_description(oc, "legacy-vm-type", diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index c459138c7e..e3e672dcd1 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -2974,17 +2974,16 @@ void whpx_arch_accel_class_init(ObjectClass *oc) { object_class_property_add_enum(oc, "ignore-unknown-msr", "OnOffAuto", &OnOffAuto_type_info, NULL, - NULL, whpx_set_unknown_msr); + whpx_set_unknown_msr); object_class_property_set_description(oc, "ignore-unknown-msr", "Configure unknown MSR behavior"); object_class_property_add_enum(oc, "intercept-msr-gp", "OnOffAuto", &OnOffAuto_type_info, NULL, - NULL, whpx_set_intercept_msr_gp); + whpx_set_intercept_msr_gp); object_class_property_set_description(oc, "intercept-msr-gp", "Intercept #GP to log erroring MSR accesses."); object_class_property_add_enum(oc, "ssd", "OnOffAuto", - &OnOffAuto_type_info, NULL, - NULL, whpx_set_ssd); + &OnOffAuto_type_info, NULL, whpx_set_ss= d); object_class_property_set_description(oc, "ssd", "Separate security domain"); } diff --git a/tests/unit/check-qom-proplist.c b/tests/unit/check-qom-proplis= t.c index 246935d714..381a868a80 100644 --- a/tests/unit/check-qom-proplist.c +++ b/tests/unit/check-qom-proplist.c @@ -152,8 +152,7 @@ static void dummy_class_init(ObjectClass *cls, const vo= id *data) dummy_get_sv, dummy_set_sv, NULL, NULL); object_class_property_add_enum(cls, "av", "DummyAnimal", - &dummy_animal_qapi_type_info, NULL, - dummy_get_av, + &dummy_animal_qapi_type_info, dummy_get= _av, dummy_set_av); } =20 diff --git a/ui/dbus.c b/ui/dbus.c index 9c21204771..f473a66889 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -511,8 +511,8 @@ dbus_display_class_init(ObjectClass *oc, const void *da= ta) object_class_property_add_str(oc, "addr", get_dbus_addr, set_dbus_addr= ); object_class_property_add_str(oc, "audiodev", get_audiodev, set_audiod= ev); object_class_property_add_enum(oc, "gl-mode", "DisplayGLMode", - &DisplayGLMode_type_info, NULL, - get_gl_mode, set_gl_mode); + &DisplayGLMode_type_info, get_gl_mode, + set_gl_mode); } =20 #define TYPE_CHARDEV_VC "chardev-vc" diff --git a/ui/input-linux.c b/ui/input-linux.c index 127be74450..c7f9114036 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -508,7 +508,7 @@ static void input_linux_class_init(ObjectClass *oc, con= st void *data) input_linux_get_repeat, input_linux_set_repeat); object_class_property_add_enum(oc, "grab-toggle", "GrabToggleKeys", - &GrabToggleKeys_type_info, NULL, + &GrabToggleKeys_type_info, input_linux_get_grab_toggle, input_linux_set_grab_toggle); } --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793631165; cv=none; d=zohomail.com; s=zohoarc; b=Mx7YCQrKFIXYXwpaZ+6jAZ1HvKAF/76zxKvxi2EJNiCxkjM6v/suCJbBe4SjQzFIx+u0gMy4ZRl0EurU+Ou4zJmaJkqFsnuuV7kMmZuaxNCNW1i+A+SLPaihlCbVVX0cfWV5rG/Ggi4ruhFDSD06iJiVUMvNivUULIKYrKxC1go= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793631165; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mfzC8RHKPf5q8JieM7szM0xznOIb3qwFGKTAZ6TF9tI=; b=CWgWG7jGW7Jkdh8m7IdVT6ptGhMe2XSAGG3UjynB5L/3mSTE56QvGc9mcDJUlexHCQDIlOGsGt1RUEaLBJHWbTPVGUBUysvwzWne6H8FzZ/wIDrY/PxvHve3ErjrAAwKLSIfMF1mxwb5Uas/GZhRtDexMQySC3rvBADEDBTXH2Q= 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 1793631165074769.2910389681017; Mon, 2 Nov 2026 06:52:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtFT-0007nf-FU; Mon, 02 Nov 2026 09:42:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDN-0003JQ-9M for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDB-0008Vs-Vu for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:48 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-367-8xnZZBblO6irrNlkN8hxzg-1; Mon, 02 Nov 2026 09:40:34 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D6C9C180A9DF; Mon, 2 Nov 2026 14:40:33 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 52AD630000E7; Mon, 2 Nov 2026 14:40:33 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 31A4221E65EC; Mon, 02 Nov 2026 15:40:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mfzC8RHKPf5q8JieM7szM0xznOIb3qwFGKTAZ6TF9tI=; b=XT9lc59qA4AbSeo8VAwC+6qOEvq2Knd1eFFkSMrWN1Fz2PbciaIR53esJeH/TAIwxYfskY NsOFTagv3xtjASKr3b8ROXhCLIjB9+PBd+mHEy+WBU9jaiUPLk8YBYHl6gdhSw0BxD3xTT kaD9+28FZp4dbZUkLEQYe5HUQB+i1Lc= X-MC-Unique: 8xnZZBblO6irrNlkN8hxzg-1 X-Mimecast-MFC-AGG-ID: 8xnZZBblO6irrNlkN8hxzg_1793630433 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 73/74] qom: use QAPITypeInfo in object_property_get_enum Date: Mon, 2 Nov 2026 15:40:17 +0100 Message-ID: <20261102144018.3212223-74-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: 1793631166707158500 From: Marc-Andr=C3=A9 Lureau The typename parameter becomes a QAPITypeInfo pointer, and the validation compares prop->qapi_type against it instead of matching prop->type strings. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-56-armbru@redhat.com> --- include/qom/object.h | 4 ++-- hw/core/machine-qmp-cmds.c | 4 +++- qom/object.c | 14 ++++++-------- tests/unit/check-qom-proplist.c | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 66197b406b..70d8ea3e29 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1562,7 +1562,7 @@ uint64_t object_property_get_uint(Object *obj, const = char *name, * object_property_get_enum: * @obj: the object * @name: the name of the property - * @typename: the name of the enum data type + * @type_info: the QAPITypeInfo of the enum * @errp: returns an error if this function fails * * Returns: the value of the property, converted to an integer (which @@ -1570,7 +1570,7 @@ uint64_t object_property_get_uint(Object *obj, const = char *name, * value is not an enum). */ int object_property_get_enum(Object *obj, const char *name, - const char *typename, Error **errp); + const QAPITypeInfo *type_info, Error **errp); =20 /** * object_property_set: diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 07a048d0a9..0558d6d703 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -18,6 +18,7 @@ #include "qapi/qapi-commands-accelerator.h" #include "qapi/qapi-commands-machine.h" #include "qobject/qobject.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qobject-input-visitor.h" #include "qapi/type-helpers.h" #include "qemu/uuid.h" @@ -278,7 +279,8 @@ static int query_memdev(Object *obj, void *opaque) } else { m->has_reserve =3D true; } - m->policy =3D object_property_get_enum(obj, "policy", "HostMemPoli= cy", + m->policy =3D object_property_get_enum(obj, "policy", + &HostMemPolicy_type_info, &error_abort); host_nodes =3D object_property_get_qobject(obj, "host-nodes", diff --git a/qom/object.c b/qom/object.c index 10b3145f5f..cd0590c3fd 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2575,32 +2575,30 @@ object_class_property_add_enum(ObjectClass *klass, = const char *name, } =20 int object_property_get_enum(Object *obj, const char *name, - const char *typename, Error **errp) + const QAPITypeInfo *type_info, Error **errp) { char *str; int ret; ObjectProperty *prop =3D object_property_find_err(obj, name, errp); - EnumProperty *enumprop; =20 if (prop =3D=3D NULL) { return -1; } =20 - if (!g_str_equal(prop->type, typename)) { + if (prop->qapi_type !=3D type_info) { error_setg(errp, "Property %s on %s is not '%s' enum type", - name, object_class_get_name( - object_get_class(obj)), typename); + name, object_class_get_name(object_get_class(obj)), + type_info->name); return -1; } =20 - enumprop =3D prop->opaque; - str =3D object_property_get_str(obj, name, errp); if (!str) { return -1; } =20 - ret =3D qapi_enum_parse(enumprop->qapi_type->lookup, str, -1, errp); + assert(prop->qapi_type); + ret =3D qapi_enum_parse(prop->qapi_type->lookup, str, -1, errp); g_free(str); =20 return ret; diff --git a/tests/unit/check-qom-proplist.c b/tests/unit/check-qom-proplis= t.c index 381a868a80..bf7c1386be 100644 --- a/tests/unit/check-qom-proplist.c +++ b/tests/unit/check-qom-proplist.c @@ -580,14 +580,14 @@ static void test_dummy_getenum(void) =20 val =3D object_property_get_enum(OBJECT(dobj), "av", - "DummyAnimal", + &dummy_animal_qapi_type_info, &error_abort); g_assert(val =3D=3D DUMMY_PLATYPUS); =20 /* A bad enum type name */ val =3D object_property_get_enum(OBJECT(dobj), "av", - "BadAnimal", + &dummy_str_qapi_type_info, &err); g_assert(val =3D=3D -1); error_free_or_abort(&err); @@ -595,7 +595,7 @@ static void test_dummy_getenum(void) /* A non-enum property name */ val =3D object_property_get_enum(OBJECT(dobj), "iv", - "DummyAnimal", + &dummy_animal_qapi_type_info, &err); g_assert(val =3D=3D -1); error_free_or_abort(&err); --=20 2.55.0 From nobody Mon Nov 23 04:28:01 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=1793630619; cv=none; d=zohomail.com; s=zohoarc; b=iMyHoSC75F8OLyi1ljtU9z83dOqowzUW/+3GAoQODJtOdf1Ez0GPRliwCaMTarfAlUFCUvWAFcESZwaXk/Jr9nl+vL3iDbixeBoH5AMkaywgLpYeLqWXhIaCmpg5HKrJUHv33jGngPn0g4hF6MsaLUJmNCIX+V3pA++uEHFkKXM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630619; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Zt1IwNVA008WpF9PA3iKHcPKXa43m0TgMdi3++9f5/U=; b=K48lZqWno85egOUHi71V1yeQSuVX81JdcSTssG58MIQMYWt1Wyi+pH4EETc3f5jrAcKLCfpM5Trws1OgLSHHATVtoj/a/t/eNDkX9HFByyP8r2BeugnjOCSjukMaN2F7oW7L4osBhnx81CJdbp6tOvExBiNigjwvujQd5ntIRX4= 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 1793630619314792.2002483197906; Mon, 2 Nov 2026 06:43:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNtFL-0007EP-SR; Mon, 02 Nov 2026 09:42:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDQ-0003K7-Mn for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNtDD-00005Q-1b for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:40:50 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-374-_HJrpYCOMZaw5d4kAR7ooA-1; Mon, 02 Nov 2026 09:40:35 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 528451802159; Mon, 2 Nov 2026 14:40:34 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 113DC1800444; Mon, 2 Nov 2026 14:40:34 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 35E1721E65F0; Mon, 02 Nov 2026 15:40:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793630438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Zt1IwNVA008WpF9PA3iKHcPKXa43m0TgMdi3++9f5/U=; b=K8opTi83FkSSYftWNGYN7rC4YcCSdDJkPLVWeOlbjiLgIaqZ/GjQB6pMxMO8DEVjJpTT3y Tdzl8q6mUXDl5ZSkCpo2QnTNAoVHTKo3l3oiqXIEI1rZhvXgGEG36eRchipiw2nmOVJJFb bgc9OCpzr9k473OCutJrGJWZLLx5VOc= X-MC-Unique: _HJrpYCOMZaw5d4kAR7ooA-1 X-Mimecast-MFC-AGG-ID: _HJrpYCOMZaw5d4kAR7ooA_1793630434 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 74/74] tests/qmp-cmd-test: assert qapi-type resolves in query-qmp-schema Date: Mon, 2 Nov 2026 15:40:18 +0100 Message-ID: <20261102144018.3212223-75-armbru@redhat.com> In-Reply-To: <20261102144018.3212223-1-armbru@redhat.com> References: <20261102144018.3212223-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.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: 1793630619992154100 From: Marc-Andr=C3=A9 Lureau For every QOM type returned by qom-list-types, call qom-list-properties and verify that each property's qapi-type value (when present) maps to a valid entry in the query-qmp-schema introspection output. The test is gated behind g_test_slow() since it iterates all registered QOM types. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-ID: <20261101201717.3911097-57-armbru@redhat.com> --- tests/qtest/qmp-cmd-test.c | 55 +++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/tests/qtest/qmp-cmd-test.c b/tests/qtest/qmp-cmd-test.c index 279a8f5614..acb7b0dd6a 100644 --- a/tests/qtest/qmp-cmd-test.c +++ b/tests/qtest/qmp-cmd-test.c @@ -15,6 +15,7 @@ #include "qapi/error.h" #include "qapi/qapi-visit-introspect.h" #include "qobject/qdict.h" +#include "qobject/qlist.h" #include "qapi/qobject-input-visitor.h" =20 const char common_args[] =3D "-nodefaults -machine none"; @@ -131,6 +132,8 @@ typedef struct { GHashTable *hash; } QmpSchema; =20 +static QmpSchema schema; + static void qmp_schema_init(QmpSchema *schema) { QDict *resp; @@ -343,9 +346,56 @@ static void test_object_add_failure_modes(void) qtest_quit(qts); } =20 +static void test_qapi_type(void) +{ + QTestState *qts; + g_autoptr(QDict) resp =3D NULL; + QList *types; + QListEntry *type_entry, *prop_entry; + + qts =3D qtest_init(common_args); + + resp =3D qtest_qmp(qts, + "{ 'execute': 'qom-list-types'," + " 'arguments': { 'abstract': true } }"); + g_assert(qdict_haskey(resp, "return")); + types =3D qdict_get_qlist(resp, "return"); + + QLIST_FOREACH_ENTRY(types, type_entry) { + QDict *type =3D qobject_to(QDict, qlist_entry_obj(type_entry)); + const char *name =3D qdict_get_str(type, "name"); + g_autoptr(QDict) props_resp =3D NULL; + QList *props; + + props_resp =3D qtest_qmp(qts, + "{ 'execute': 'qom-list-properties'," + " 'arguments': { 'typename': %s } }", + name); + if (!qdict_haskey(props_resp, "return")) { + continue; + } + props =3D qdict_get_qlist(props_resp, "return"); + + QLIST_FOREACH_ENTRY(props, prop_entry) { + QDict *prop =3D qobject_to(QDict, qlist_entry_obj(prop_entry)); + const char *qapi_type =3D qdict_get_try_str(prop, "qapi-type"); + const char *propname =3D qdict_get_str(prop, "name"); + const char *ty =3D qdict_get_str(prop, "type"); + + if (qapi_type) { + g_assert_nonnull(qmp_schema_lookup(&schema, qapi_type)); + } else if (!g_str_has_prefix(ty, "child<") && + !g_str_has_prefix(ty, "link<")) { + g_test_message("%s.%s %s has no associated qapi-type", + name, propname, ty); + } + } + } + qtest_quit(qts); +} + int main(int argc, char *argv[]) { - QmpSchema schema; int ret; =20 g_test_init(&argc, &argv, NULL); @@ -355,6 +405,9 @@ int main(int argc, char *argv[]) =20 qtest_add_func("qmp/object-add-failure-modes", test_object_add_failure_modes); + if (g_test_slow()) { + qtest_add_func("qmp/qapi-type", test_qapi_type); + } =20 ret =3D g_test_run(); =20 --=20 2.55.0