From nobody Mon May 25 20:32: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=1778420673; cv=none; d=zohomail.com; s=zohoarc; b=VZRIYJ697d8A9oMarUO9YrhntAUCdT7l7+6l4D88KH9BKsimkJDyA5vkThyc45Lnx1lBAcJcn/VjpDYJ85c4XfHlzeUDQikizksmY4hlrvyqmWXULTqBySsu/EatymaVQUx02tNo4oQ+UKqSL+l2tV2EflOc0+mp235rH5SRDAk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420673; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JLTM7UlfM2pcl1kfhxldekHF9MgNbRrfS8dL3DFlmHQ=; b=ldT3hhEXXPZI4t0bgzqNEYzJUgDAD/UTs9tYrBTWOHa0LkSbDcaXK8s9pnuwdA/mIB6yNTn0Li83BGb4XET9TN9TyM4WWUwWPUBS1t5ZL6fwJ9DY6hGgDOO/AxVkvG7UTMYOw7pwMPq9QuVx2hWYXVIVzHYOc0cqADBvg48PxbI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420673926648.5694930214868; Sun, 10 May 2026 06:44:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4Rr-0007qi-6X; Sun, 10 May 2026 09:43:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Rf-0007of-CL for qemu-devel@nongnu.org; Sun, 10 May 2026 09:43:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Rd-0004K8-W9 for qemu-devel@nongnu.org; Sun, 10 May 2026 09:43:47 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-544-1RYI-hJZOzy9vu4Mk-9UtQ-1; Sun, 10 May 2026 09:43:43 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 675F3180056E for ; Sun, 10 May 2026 13:43:42 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E37E53002D30; Sun, 10 May 2026 13:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JLTM7UlfM2pcl1kfhxldekHF9MgNbRrfS8dL3DFlmHQ=; b=cD9wNhiM5WGChHJh+FlTGqJgSsCgWcmH1CZB/gQnDppSbYJnaGjvGFkgEU0WwlGaueWIHq 2Vwi7tnpy2XsaeuFW2Zwhosatjibq8IBtqRwk5bLVLUs00CMB6FJOSUHKzkQT4xa2WZOMw El89n0258ou1s5i0lp/i8A9zuo8AFWI= X-MC-Unique: 1RYI-hJZOzy9vu4Mk-9UtQ-1 X-Mimecast-MFC-AGG-ID: 1RYI-hJZOzy9vu4Mk-9UtQ_1778420622 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:42:58 +0400 Subject: [PATCH 01/54] qapi: add QAPITypeInfo struct definition MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-1-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1077; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=SbF0347iS9KGewslgupoZANFsDp/EFCir1K5kbjzQyc=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItuVXWs7IRMOD6iOebR376lWpbJKUkbDNmVa WZYuJP4BAaJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbgAKCRDa6OEJdZac 5So5D/4vrP220B3HJPdf4V+jgOrRZ1LLXDdswPkhmdueJEdu8LIOLV5QXu+4/LJ7B3oiF4kGogi 8xK0GxesxXGY8LkBbtPbSL5enu1a2aKCTTItlzHYJyHY1GBC+/5SNCqpQd63Y2kfv9R1VK2U8Kc AiiVx4ZGvQmcB6g50zuf2qnJbbSyx3Ktp68NMKA3CBLAW6Jft/koKZiQVMR9QTArH49m3GRiJyj ExVT6GELZuh47hqiOwCzRG3mceOm9yCo2UbHM2KkkaCxCdNICSmvUCNYYEj822nPlV/mIlB/Wm+ 4t0WJtjOSpRFNV8UP28xsSG4oWv0CyK+iPZUZflT0YqDUw2nHkptm6KSabAAcSwBJTi5+dwV2B7 /6XgJTLDCWhQiGjaN1MdJSKjwpQFVCxiLr5c/PX+C+A9FzDBZlKRB8jbIdFSiF9/mWENBiAE0C0 7WDkyTFmwwQ2MjVSNjPTrT8RyxUWkh9uYX+7qiax942oPdbTy/Qk+pIdg5PVIyuCsxayyxnLR6w 9gHd0ChhLH5QP7Ps/UFw+6CeucY9DS/XRfWOzK6awpQbTR9e26847JmZcdRxLxXYZt+Odn4w65R X5JfCGoZmu9hG8FDIX9C7uvSnAXFxf8B08sAsUBCWcxKJRWZmcUs+MI0rSqzRKCITV4o8guI8lH UuAsRC2YhZ0HmZg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420674496158500 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. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/qapi/qapi-type-info.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/qapi/qapi-type-info.h b/include/qapi/qapi-type-info.h new file mode 100644 index 00000000000..53b4732297d --- /dev/null +++ b/include/qapi/qapi-type-info.h @@ -0,0 +1,19 @@ +/* + * QAPITypeInfo =E2=80=94 associates a QOM property with its QAPI schema t= ype. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef QAPI_TYPE_INFO_H +#define QAPI_TYPE_INFO_H + +#include "qapi/util.h" + +typedef struct QAPITypeInfo { + const char *name; + const char *schema_name; + const QEnumLookup *lookup; + const struct QAPITypeInfo *list; +} QAPITypeInfo; + +#endif /* QAPI_TYPE_INFO_H */ --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420655; cv=none; d=zohomail.com; s=zohoarc; b=Cs8McGNNo6UsZQrr1YKF42mwixnDnL22i2iXkCW4OCYDXDUs5ls1dOXI8bS0JlKO7DQSiTz5SRdJ4HU6OpfDUMasqHDQzWRPVVhuvNpXC2GSClkwladR+xThWtbRzK8QkfifC6ZF81hQ2mAIOSk8XeHX+I9OMTzncgY2PLSiHjM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420655; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2IzJU7fLiQ+OI3OVxJg3BiQ9kVmShuma5bxJM/6bUzE=; b=UQrbFTvJ748xGtn8EdfYJ0qjQa2aMB0Z0EFbPJY/hW1QzovtOyEL24sbjX5jQZJOzLVIc43p50TMviYnyOuG62CrMq7j6Ku1g3ILN5CSyh5XWN1uvrzjy5wCQFK0MtRIrhmPc8rUp8EMFeMUWAkbzIInHMlpFry4LX28a3W3cAk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420655354739.9533940464665; Sun, 10 May 2026 06:44:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4S0-0007rM-SX; Sun, 10 May 2026 09:44:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Rs-0007r8-T5 for qemu-devel@nongnu.org; Sun, 10 May 2026 09:44:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Rr-0004Lw-Ed for qemu-devel@nongnu.org; Sun, 10 May 2026 09:44:00 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-362-7MEzvOv4Ox6g8R_vviQqow-1; Sun, 10 May 2026 09:43:56 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E05EC19560A2 for ; Sun, 10 May 2026 13:43:55 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A056C18004A3; Sun, 10 May 2026 13:43:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2IzJU7fLiQ+OI3OVxJg3BiQ9kVmShuma5bxJM/6bUzE=; b=aQkW30UB9wSWSSn0aJ9VYhZbhUppFTi8tYMrKZ6BOLjM8nfTkGDTDJJST4zQrDShRWShIQ 5aeao/A8UNnzeMdLn27CSxz53XFL6zosP2S7ltq9gLg53XLqvS/9XIJangcfruPoer1iqy tn/+DLGzqPcvZuPJ5KJQoEnbFW8oFVM= X-MC-Unique: 7MEzvOv4Ox6g8R_vviQqow-1 X-Mimecast-MFC-AGG-ID: 7MEzvOv4Ox6g8R_vviQqow_1778420636 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:42:59 +0400 Subject: [PATCH 02/54] qapi/introspect: expose the type name map MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-2-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2078; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=5ld04Km69gTihvCVA+G8/s2NgBnD5vvjVRkp5Y12BUQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItu48nc2dBcrLXo9GKXCMWRahu0t5LW3Y4ai NVahXzvS7WJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbgAKCRDa6OEJdZac 5WJrD/9/T16S2A1pehu+mZ/CJN0Agoy7Uc0WVJo8mqYorNmipAdrta3x7KkB/g9y45X9z6pVYbr VUtQ6V48LJ4A06Kp0yHk2sJXL/9h8HjE46P06v+m68CyeNerEWbUedAK2YrXoWalvDe1hso9YrY gN50dvxkFKlsg80XWj5DJFQiLzi5a7GwwC582mzV03AiC6inpmdB1tDKd9DcpyqYNa8QbAJW5uC o51pbJeNI4b0Bhyreu23HAd4go56vykgcEekab9XqOGdJ58TrtUXt+suWN/9vL3hZxbld/F/3OI j2u8JTr9T6bfuaSL+kDGjsSlcLdmTWppw/dqXG5Qy1El5dIOqrhOoedK/qW0oIZF/+YAf3OgDaU InpKfxJYO+mSBZUrRtC8A5LQGL+w7Rm07VyeqSSEwfEqLzQYclAlK7yTU6TG7LYWlZ1diGaZZoj 9mxpxM7LT10J0u7A5P2QrmOmNhUMRvAw4+ZQzGi3wCQvXvqtu5r01FH3RNT61ro0Fp5Hj9ZV9PX mp/3BTE0Kmymh/HglDhEG7iJ7gvP6Tsa6iyH9XLqyDj7Y2P/oZ1Le/gXFvgztXOYUhL+ocqA4Q/ c0s42ep1Aszow9TDUJC2pB4H+e21SsnCQR204nApFNI9jtc5//6kS1i2mijXttdyZRSIMvELbB3 TERG18WlBQcF3TQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420656403158500 Preserve the internal-to-masked name map computed during introspection visitation and return it from gen_introspect(). The type-infos generator will consume this map to produce per-type QAPITypeInfo constants with correct masked names. Signed-off-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi/introspect.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 7e28de2279a..d3d3de481f4 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -178,6 +178,7 @@ def __init__(self, prefix: str, unmask: bool): self._trees: List[Annotated[SchemaInfo]] =3D [] self._used_types: List[QAPISchemaType] =3D [] self._name_map: Dict[str, str] =3D {} + self._final_name_map: Dict[str, str] =3D {} self._genc.add(mcgen(''' #include "qemu/osdep.h" #include "%(prefix)sqapi-introspect.h" @@ -208,8 +209,17 @@ def visit_end(self) -> None: self._schema =3D None self._trees =3D [] self._used_types =3D [] + self._final_name_map =3D dict(self._name_map) self._name_map =3D {} =20 + def name_map(self) -> Dict[str, str]: + """Return the QAPI-name-to-schema-name map. + + Must be called after visit() has completed; the map is + populated during visit_end(). + """ + return self._final_name_map + def visit_needed(self, entity: QAPISchemaEntity) -> bool: # Ignore types on first pass; visit_end() will pick up used types return not isinstance(entity, QAPISchemaType) @@ -387,7 +397,8 @@ def visit_event(self, name: str, info: Optional[QAPISou= rceInfo], =20 =20 def gen_introspect(schema: QAPISchema, output_dir: str, prefix: str, - opt_unmask: bool) -> None: + opt_unmask: bool) -> Dict[str, str]: vis =3D QAPISchemaGenIntrospectVisitor(prefix, opt_unmask) schema.visit(vis) vis.write(output_dir) + return vis.name_map() --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420671; cv=none; d=zohomail.com; s=zohoarc; b=gX7yCS4c+XQEk/AI4vwZeNkYfcgvSuCV4CpXlS4Ks5YMszLf2INN+YCxNW828uTYWjKJVJYzyH8Z0Xu74E1H0/EpPn0+r3RudMAf21iatFg+CM0qCOOCNH76s/djxRJ/2RotZb1uHX16PssOPVjJVqr9y5bUfQ+PQARKdLgV1MM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420671; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+38+VZ6Pmd0MFgR6FoHfrmM7yO6Iys6cW09ihGsXkVo=; b=lV4YwnbKTHJGUIvApG/mskvmoSIeh1U4l1RfFKoxUoNHKtQT7s/7937KDa43SwyW+h44yroAjIkpf5kptXioCZSGGKKMWBkY0kcDVJk5EdVtkR+yALeFWu02jd8OPgG9IfZBSyTHShgneDRzCSjwrmIzC8itu3vf52onTy+Lqqk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177842067151279.07423511846662; Sun, 10 May 2026 06:44:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4SB-00080b-6D; Sun, 10 May 2026 09:44:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4S8-0007za-0T for qemu-devel@nongnu.org; Sun, 10 May 2026 09:44:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4S5-0004PL-2n for qemu-devel@nongnu.org; Sun, 10 May 2026 09:44:14 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-373-UP8J0AdRO9yNayZA61AigQ-1; Sun, 10 May 2026 09:44:10 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D4B4419560AA for ; Sun, 10 May 2026 13:44:09 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1FFE318004A3; Sun, 10 May 2026 13:44:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+38+VZ6Pmd0MFgR6FoHfrmM7yO6Iys6cW09ihGsXkVo=; b=OYHhrUTyvs9oeNPO9qzb2bYkAdtiGWIES0pSByA0fG8lHi/oWt3DxY9731GN540OTGUlXr EkoSh9//jaT0vZRuwThvSsHDFkRPSq8kQCvppKdUm6tCTaUWuaP3LEf8sVQShipR1eeE4A R/UDo3X7gfI0wilIeL/KrBFLeVsvCZg= X-MC-Unique: UP8J0AdRO9yNayZA61AigQ-1 X-Mimecast-MFC-AGG-ID: UP8J0AdRO9yNayZA61AigQ_1778420649 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:00 +0400 Subject: [PATCH 03/54] qapi: add type-infos generator MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-3-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=11421; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=qHb8b82GU+OQNQNEluK510LJkdY+C23LVofbl02FKPY=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItuSKz/3vEVuI2u4OHgQjY1eM31i7c57+vq2 DOzsvjXUg+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbgAKCRDa6OEJdZac 5US3D/9rTl4dktMf4AbLQX5Cob4r3Uid++IH4S8M/oBuJibdCd+ngYyf/oLnkzOR9+PhyELcQcF 7AOg80TX8lVCqhqRBHuW9+LiekqdLCrp2Z7CJusJVKF69rrI620teBXe4dszKulb15CfaOqWfRN /S2bwW8M/yvIeqQAX1/8tVEtC4/wlLrEw6Oqsd7CmNhTWVPm82pA1sl9lhC+uNduVznYAQgkjK/ zGNK8WJzeTtpnF6gZ64N3GF6L7cC7KfTxTE2Qmpc35zCEHDzXCts2ivcyJw1XDyfmvGsXZFn3dp +IVPLW68whGQLqllbKIEdk+KqF1BP3ujqTab/mnDYgvSmuxzHfNrIfLRKdEoXK15tm6d55D16aD bCv/GZo7TZQPYjCGF6JALbAqEJyUp6ifgt68Z3ZRW7OsUQPOIrYlc9nJn+LSZIT3WKQ4VTR1kPQ fOlQNDPvv3GKc1MDH4PW2odaLlmETY89kKDbHakQtHp/+PnMBII4Ucm39H+/+7YUFUn0YKc2iEV loa+eP+HdJSubqo2QqsF/vks14I4Psn4vMoIZbMfgmqwvQ1+8MowEbmr4846+L8i+AZTLFvhfOp t7mH8En8nWdm52yXS2oLXJNB0vLjO+IKFWfOn5d16lL7jz1WUOMi2jMCaKSymAowtx6aGeRV0ps iSpW9unAkD4YswQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=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: 1778420672657158500 New QAPISchemaGenTypeInfoVisitor produces per-module qapi-type-infos-*.h/c files. Each file declares QAPITypeInfo constants pairing the QAPI type name with its masked introspection name. Signed-off-by: Marc-Andr=C3=A9 Lureau --- docs/devel/qapi-code-gen.rst | 90 +++++++++++++++++++++ meson.build | 1 + scripts/qapi/type_infos.py | 182 +++++++++++++++++++++++++++++++++++++++= ++++ 3 files changed, 273 insertions(+) diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst index 3a632b4a648..bb2e8d9c675 100644 --- a/docs/devel/qapi-code-gen.rst +++ b/docs/devel/qapi-code-gen.rst @@ -2103,3 +2103,93 @@ Example:: })); =20 [Uninteresting stuff omitted...] + + +Code generated for type information +----------------------------------- + +The following files are created: + + ``$(prefix)qapi-type-infos.c`` + A ``QAPITypeInfo`` instance for each schema-defined type, providing + a mapping between the C type name and the schema name used by + introspection, along with optional enum lookup table and list-element + pointers. + + ``$(prefix)qapi-type-infos.h`` + Declarations for the above type info instances + +Each ``QAPITypeInfo`` struct has the following fields: + +``name`` + The C identifier of the type (e.g. ``"UserDefOne"``). + +``schema_name`` + The masked name used in ``query-qmp-schema`` output, or ``NULL`` + for built-in types whose schema name equals their C name. This + allows management tools to cross-reference a QOM property's + ``qapi-type`` against the introspection schema. + +``lookup`` + For enum types, a pointer to the corresponding ``QEnumLookup`` + table. ``NULL`` for non-enum types. + +``list`` + For types that have an array variant, a pointer to the list type's + ``QAPITypeInfo``. ``NULL`` when no list type exists. + +These type info instances are used by QOM property registration +functions (``object_property_add_qapi()``, +``object_class_property_add_qapi_enum()``, etc.) to associate each +property with its QAPI schema type. The ``qom-list`` and +``device-list-properties`` QMP commands then expose the ``qapi-type`` +field, giving management tools a formal type reference into the +introspection schema. + +Implicit types (names starting with ``q_``) are skipped. + +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", + .schema_name =3D "1", + .list =3D &UserDefOneList_type_info, + }; + + const QAPITypeInfo UserDefOneList_type_info =3D { + .name =3D "UserDefOneList", + .schema_name =3D "[1]", + }; + + [Uninteresting stuff omitted...] + +For a modular QAPI schema (see section `Include directives`_), code for +each sub-module SUBDIR/SUBMODULE.json is actually generated into :: + + SUBDIR/$(prefix)qapi-type-infos-SUBMODULE.h + SUBDIR/$(prefix)qapi-type-infos-SUBMODULE.c + +If qapi-gen.py is run with option --builtins, additional files are +created: + + ``qapi-builtin-type-infos.h`` + Type info instances for built-in types + + ``qapi-builtin-type-infos.c`` + Definitions for the above type info instances diff --git a/meson.build b/meson.build index 5fbdc75a0fc..f239ed24fae 100644 --- a/meson.build +++ b/meson.build @@ -3518,6 +3518,7 @@ qapi_gen_depends =3D [ meson.current_source_dir() / '= scripts/qapi/__init__.py', meson.current_source_dir() / 'scripts/qapi/parser.py', meson.current_source_dir() / 'scripts/qapi/schema.py', meson.current_source_dir() / 'scripts/qapi/source.py', + meson.current_source_dir() / 'scripts/qapi/type_infos= .py', meson.current_source_dir() / 'scripts/qapi/types.py', meson.current_source_dir() / 'scripts/qapi/visit.py', meson.current_source_dir() / 'scripts/qapi-gen.py' diff --git a/scripts/qapi/type_infos.py b/scripts/qapi/type_infos.py new file mode 100644 index 00000000000..dc7e2bace9e --- /dev/null +++ b/scripts/qapi/type_infos.py @@ -0,0 +1,182 @@ +""" +QAPI type info generator + +SPDX-License-Identifier: GPL-2.0-or-later +""" + +from typing import ( + Dict, + List, + Optional, + Set, +) + +from .common import c_name, mcgen +from .gen import QAPISchemaModularCVisitor, ifcontext +from .schema import ( + QAPISchema, + QAPISchemaAlternatives, + QAPISchemaBranches, + QAPISchemaEnumMember, + QAPISchemaFeature, + QAPISchemaIfCond, + QAPISchemaObjectType, + QAPISchemaObjectTypeMember, + QAPISchemaType, + QAPISchemaVisitor, +) +from .source import QAPISourceInfo + + +class _ArrayTypeCollector(QAPISchemaVisitor): + def __init__(self) -> None: + self.list_types: Set[str] =3D set() + + def visit_array_type(self, + name: str, + info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + element_type: QAPISchemaType) -> None: + self.list_types.add(name) + + +class QAPISchemaGenTypeInfoVisitor(QAPISchemaModularCVisitor): + + def __init__(self, prefix: str, name_map: Dict[str, str], + list_types: Set[str]): + super().__init__( + prefix, 'qapi-type-infos', + ' * Schema-defined QAPI type info', + ' * Built-in QAPI type info', __doc__) + self._name_map =3D name_map + self._list_types =3D list_types + + def _begin_builtin_module(self) -> None: + self._genc.preamble_add(mcgen(''' +#include "qemu/osdep.h" +#include "qapi/qapi-builtin-types.h" +#include "qapi/qapi-builtin-type-infos.h" +''')) + self._genh.preamble_add(mcgen(''' +#include "qapi/qapi-type-info.h" +''')) + + def _begin_user_module(self, name: str) -> None: + type_infos =3D self._module_basename('qapi-type-infos', name) + types =3D self._module_basename('qapi-types', name) + self._genc.preamble_add(mcgen(''' +#include "qemu/osdep.h" +#include "%(types)s.h" +#include "%(type_infos)s.h" +''', + types=3Dtypes, + type_infos=3Dtype_infos)) + self._genh.preamble_add(mcgen(''' +#include "qapi/qapi-builtin-type-infos.h" +''')) + + def _gen_type_info(self, name: str, + ifcond: Optional[QAPISchemaIfCond] =3D None, + with_lookup: bool =3D False, + with_list: bool =3D False, + schema_name: Optional[str] =3D None) -> None: + c_id =3D c_name(name + '_type_info') + lookup =3D '' + if with_lookup: + lookup =3D mcgen(''' + .lookup =3D &%(c_name)s_lookup, +''', + c_name=3Dc_name(name)) + list_ref =3D '' + if with_list: + list_ref =3D mcgen(''' + .list =3D &%(list_id)s, +''', + list_id=3Dc_name(name + 'List_type_info')) + if schema_name is None: + masked =3D self._name_map.get(name) + schema_name =3D '"%s"' % masked if masked is not None else 'NU= LL' + else: + schema_name =3D '"%s"' % schema_name + with ifcontext(ifcond or QAPISchemaIfCond(), + self._genh, self._genc): + self._genh.add(mcgen(''' + +extern const QAPITypeInfo %(c_id)s; +''', + c_id=3Dc_id)) + self._genc.add(mcgen(''' + +const QAPITypeInfo %(c_id)s =3D { + .name =3D "%(name)s", + .schema_name =3D %(schema_name)s, +%(lookup)s%(list_ref)s}; +''', + c_id=3Dc_id, name=3Dname, + schema_name=3Dschema_name, + lookup=3Dlookup, + list_ref=3Dlist_ref)) + + def _has_list(self, name: str) -> bool: + return name + 'List' in self._list_types + + def visit_builtin_type(self, + name: str, + info: Optional[QAPISourceInfo], + json_type: str) -> None: + self._gen_type_info(name, with_list=3Dself._has_list(name)) + + def visit_enum_type(self, + name: str, + info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + features: List[QAPISchemaFeature], + members: List[QAPISchemaEnumMember], + prefix: Optional[str]) -> None: + self._gen_type_info(name, ifcond, with_lookup=3DTrue, + with_list=3Dself._has_list(name)) + + def visit_object_type(self, + name: str, + info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + features: List[QAPISchemaFeature], + base: Optional[QAPISchemaObjectType], + members: List[QAPISchemaObjectTypeMember], + branches: Optional[QAPISchemaBranches]) -> None: + if name.startswith('q_'): + return + self._gen_type_info(name, ifcond, + with_list=3Dself._has_list(name)) + + def visit_array_type(self, + name: str, + info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + element_type: QAPISchemaType) -> None: + elem_schema =3D self._name_map.get(element_type.name, + element_type.name) + self._gen_type_info(name, ifcond, + schema_name=3D'[' + elem_schema + ']') + + def visit_alternate_type(self, + name: str, + info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + features: List[QAPISchemaFeature], + alternatives: QAPISchemaAlternatives) -> None: + self._gen_type_info(name, ifcond, + with_list=3Dself._has_list(name)) + + +def gen_type_infos(schema: QAPISchema, + output_dir: str, + prefix: str, + opt_builtins: bool, + name_map: Dict[str, str]) -> None: + collector =3D _ArrayTypeCollector() + schema.visit(collector) + vis =3D QAPISchemaGenTypeInfoVisitor(prefix, name_map, + collector.list_types) + schema.visit(vis) + vis.write(output_dir, opt_builtins) --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420677; cv=none; d=zohomail.com; s=zohoarc; b=PcR0CePETL18GtfLa0n4COI/e90H/BQCqzwBQ8+bVgRU25+jLLxovBhTloz99AJ+4TbuV21ovdfBLWqJUegUf/TpWp1nAd5NlIPg7yYkIAaXeiIpr6Vd62PDdiijmG/gVaXq67TK7fvyJMHW9A1/HZbhv1pdPJsPPX185CqmUOQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420677; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PFVw19IYcg8Vi68AQsWHVfWaq1NgmtwviDz8DJlU8Ec=; b=GWYbX5YlcS1WC08i0hRrZZdMcSfk/TQWUObddgKjDyFBLBvW8C7Kwg0D/LZIFBtxIU0tePXNufANmK0o/K31c5TBttO5x1iYojAFRj0GQF/PZdp5ICh5CeMvOoZcuGHhprvg3GxexqGhFmXVVusqnUJK2lqEJwUCqu79U96EM6U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420677061426.83230881917723; Sun, 10 May 2026 06:44:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4SO-00089s-P9; Sun, 10 May 2026 09:44:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4SK-00085c-9O for qemu-devel@nongnu.org; Sun, 10 May 2026 09:44:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4SI-0004R5-PQ for qemu-devel@nongnu.org; Sun, 10 May 2026 09:44:28 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-674-oAnmq4nxO4qG68X8vxCIwQ-1; Sun, 10 May 2026 09:44:22 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 81FF4180056E for ; Sun, 10 May 2026 13:44:21 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 924431955D84; Sun, 10 May 2026 13:44:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PFVw19IYcg8Vi68AQsWHVfWaq1NgmtwviDz8DJlU8Ec=; b=Jt1k9LF83aHmljx/6zyjoNjT1bzePPrHbijS6QsWfKGHQe1+cSo8YkZ9HcFkjrtBLO+UdW 1dA8QoQdJ2eX5jOW1XcrHtUvtXwmjCTAHEpt22juqqwbmdguQ0Gqq80pNOCM6HY5i2DM5J A1vrlx2+K6Wsf+mOloLAQJzqaJNxy7E= X-MC-Unique: oAnmq4nxO4qG68X8vxCIwQ-1 X-Mimecast-MFC-AGG-ID: oAnmq4nxO4qG68X8vxCIwQ_1778420661 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:01 +0400 Subject: [PATCH 04/54] qapi/backend: wire up type-infos generation MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-4-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1109; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=uvjz2W2mHnyexv8i2EcHpZHrtNOIG6lMcGZHXJTUUWQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItuyfp17HI893poHEPlQLUuaZfSyPZ+SlXVH MisOmLIFWKJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbgAKCRDa6OEJdZac 5fDOD/0cilySVlkaHT78MDjZGex+ViOei/tTYZCTbHF7kF5qrt082QSZXjeBa0qTzV/py32PXOM y9dQOAHBSk0sEa/PZ9q5E7ORv/79WOzkYSRPWvQYTE4AgtszHdtMsIjFOYMbZYMremWKDzq5GCi Dd0HoM61RRc2hXgUW2bzHyAyRB9hgpbG+mxIsdV4mnjBeTtdmx4U8O/kFq3OiB+FVD+87Q1e9g0 d9LVde4aJ0yfeP38p1HF5ZKl2N1CpzLHjlzo/OkpRZpSjiVJxtxg52jieybl9pzMwjeegPuOmAq TTZ1NHdONq2Z8jFjZc9mm7wM/eELg+Uono9/XqxcNMJp7pJsFjXoGlARIWc/oU30BMHvc98y5hQ e8VuNIp631pHNivch1mqTvU/NVhJIwYYQMv3ZS9rgZftqbhDoByUYTDYn9NC4i2FdiaCQPb1NRK KTmjcexDLdE/g+9EsYNUFTOJGof7bq/9mZDui/Y4lYStm3Aq5pRiEQP2U2G0pX/Me23aXJj4VIu zuKF8wks6s6rpSjf1MbpU5zWLLYphgAmWkL1lT8bJb7lQQ8QIMMcijRxqJR20Ci4lj4woPo0Etn 8ovumdL8wHTTOnoIFOkjL3kwyrQ46sqLSxeEm8HDpRyIlv+hyVyhfKD/onG2MGaut1MIw2Hrioq +eVR1wSRU1LA+yQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420678573154100 Call gen_type_infos() after gen_introspect(), passing the name map so type-info constants get the correct masked names. Signed-off-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi/backend.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/qapi/backend.py b/scripts/qapi/backend.py index 49ae6ecdd33..353f7801149 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 @@ -62,4 +63,5 @@ def generate(self, gen_visit(schema, output_dir, prefix, builtins) gen_commands(schema, output_dir, prefix, gen_tracing) gen_events(schema, output_dir, prefix) - gen_introspect(schema, output_dir, prefix, unmask) + name_map =3D gen_introspect(schema, output_dir, prefix, unmask) + gen_type_infos(schema, output_dir, prefix, builtins, name_map) --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420688; cv=none; d=zohomail.com; s=zohoarc; b=C0b3zYLMHGTe+4OTmodqyK+2OQ4I5TL2Be6Esarz5y0JVG2cXrmL5Sazn7+z5knAnd5RGqlAzH51jZQfqEC4dQv6FQwzsS5WSL8vMyOfu9t5o+6LG69tDUa7unM6UCDnkwOeetrLXYKhANbb3cb1x5DYZMNNlCKfN0CDnm4D7a8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420688; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cnu/XDNhZBPnevIcXIp/sF0jXfGvDvpqUjDIedb8ZgM=; b=YdT4Og6DelsfBgjeOy04KanXd53wQGwC5RrrAcGi6spzwVwlMvcaXg2vkNoYDrlKm0WEWbljz0JOsSiACqPKUNOxavjBrX/m1YN3UrJP2A+D9mbhnO7fzcQNBCYpDhxgnu4FkXhWfclqqrCO3pi1zRAqcrUAl3Ad7zI9RxDnAM0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420688329213.45268553966582; Sun, 10 May 2026 06:44:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4ST-0008OQ-FO; Sun, 10 May 2026 09:44:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4SR-0008Es-FT for qemu-devel@nongnu.org; Sun, 10 May 2026 09:44:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4SP-0004T2-S9 for qemu-devel@nongnu.org; Sun, 10 May 2026 09:44:35 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-694-A508j30APj6_2y56KL7N0A-1; Sun, 10 May 2026 09:44:31 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6A9B319560AA for ; Sun, 10 May 2026 13:44:30 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 34B0C1803A92; Sun, 10 May 2026 13:44:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cnu/XDNhZBPnevIcXIp/sF0jXfGvDvpqUjDIedb8ZgM=; b=Xs7a35ksTZd1cH7oqso25ClBUvyVyht/z5U+xRtNoqPF8KDpZafdqL22Bt2Lqi7aZr8o3C DimaurCUZXxZA/PJZj3kHcREQS/TZ2U5/ZB/czcMozTwWXVMYe4k0c9d344669DLvOS7DE oewFuytpvVL1LHFxS/zcGJRglg+HLXA= X-MC-Unique: A508j30APj6_2y56KL7N0A-1 X-Mimecast-MFC-AGG-ID: A508j30APj6_2y56KL7N0A_1778420670 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:02 +0400 Subject: [PATCH 05/54] qapi/gen: fix _module_basename for multi-dash 'what' parameters MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-5-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1009; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=S2BoGZEFYq/GkpuRjSxq1QDOG+49zZ+uxEpclFTvRGc=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItuaBSXA59ZonjJXldk/1dlC6F3JfXoqvJWs 2XcpXFaqa6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbgAKCRDa6OEJdZac 5SkCEACgKMlHa58x55VYxWOphtE+XemYZ5JPOpvydCHpAYQ0MpB1j5AflQluGlOLkqQZbdRb9kW yXxabjpAfiC0/UyoUbahJXgo0FMClQfiRn4rWUqog8cix/OG7nok1BMxcr9Td0nXI//+uTwl9zQ B+WPYP6tdCRxktt9PaKlgt5xmTvZGZj4C7OnXC7mvCFiMvgjDitXnEBhuH2SmyY4tJiOUF70Zji gdVcxpNOta5tSsnwzmVDLm8PFI4V5FFmkaNvx7qH+GeD4MEquf3gHYSw5MQvixuNEgqIcf9bINj TB9Lb+VsT3lVBxmfLki40UDZrHID9b/TGlHbg3SivtqjcyT3CverQDab3n3YEVBEfKj6Al5FAcJ DthfG6Jv7gVWpHuaL7K5Yq8VpGCpH252lDBDpYyOy+gtFwQ9jp36R+T6cFUeIkdwDcP5eUdwzM8 0hBj92RdlttzU/2J8lSSFaXbPKRbl4MbTjZQ1pMWyi95nyH+ZP0P+8ZVz/C4au71o7CS7a3qx9T IPDLGxe88OJsejY+R1aeWorpkQxTmBMtK7a1A8yWY4gRavclhiU6Gu4cTcE9CTV8K6J6vMs5w5K 1yxq0J3e6w8DblOMTQlzCQW/0Ow2gM6z0aDvMtG1JyO5Ybi0j2taRLC16bmH5dTdhg7E58brqfG Yo8lOWvgLf9iRSw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420690708154100 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. Signed-off-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi/gen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index 0c9b8db3b02..690187d4280 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.54.0 From nobody Mon May 25 20:32: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=1778420765; cv=none; d=zohomail.com; s=zohoarc; b=en4DvgqO+0JD3X6FPfP2II4x7MBvatxC2reaJr3QiJlqEGwxE0XsqgncISloGdFjgGZzkeHg/IEwB7n6iLwuCb843+VK9MlximW0zoNjk3MONXIU5YgFSomSpZg0qGi4+KJWXRUdFsljlwgoF9okVrvC/Jt2+R+QzJYRv4JCrM8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420765; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hvHRxFe3/9M3A6EjGylUHZk1jWRUsW9eQVfc9KOscS0=; b=crpVSfGs+Qohuo2L7x+GF+SZ/j3FsbqCkm7cMA0dZd3qd6ch5TogdpzyW2YqquqPj181wu7nqDjEKUFhsUIwS5WzsEsKBtCibw/YOOSGdR7GbSoNSE+Qe1JY/f7sst3IRgqgIQtUnvGm80Rlieifp/YoLhRByh9flr02UDjxd0Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420765363878.1253456317822; Sun, 10 May 2026 06:46:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4TT-0000rz-Fk; Sun, 10 May 2026 09:45:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Sg-0000Oz-4j for qemu-devel@nongnu.org; Sun, 10 May 2026 09:44:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Se-0004X1-Gh for qemu-devel@nongnu.org; Sun, 10 May 2026 09:44:49 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-265-EyzExoFuOIm3UONmJ9vqDA-1; Sun, 10 May 2026 09:44:45 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 335FD1956094 for ; Sun, 10 May 2026 13:44:45 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 243CC3002D30; Sun, 10 May 2026 13:44:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hvHRxFe3/9M3A6EjGylUHZk1jWRUsW9eQVfc9KOscS0=; b=EvPpzkn/unq7pIK0yAJbtc2AS4hH9vTwFEMC6Cpf/rEbIzo4ev9VT70ye7z57ZCnyM/cQR n6ykHy13w2CKnfX8XkffL/c8iZELReaCMExsiNreR605KXdcsdCLxs4vrVzxFd1DvWURyE hPWgZmfkfZB7GKcdlSrDF3eiO9WRCeE= X-MC-Unique: EyzExoFuOIm3UONmJ9vqDA-1 X-Mimecast-MFC-AGG-ID: EyzExoFuOIm3UONmJ9vqDA_1778420685 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:03 +0400 Subject: [PATCH 06/54] meson: add qapi-type-infos-*.c/h to build MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-6-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=3553; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=cS7ulu1ICbMh1wDUayERuLbRYYPk58SNz3mbLGycoZU=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItuAZJgg44I40Iv4KBw5IAkWWfiCuSzGxxUr NVC7zh/5GaJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbgAKCRDa6OEJdZac 5TvyEACx5aKpJ2sUHlhZZ4udp/IwtrM73t4vp9xNkURrgu9y/t0iOx7WXBRHKa7gc+tpjLIBM0Y 2YEKQ+CCjwQ3Q+7K3BP8n+Vk6Rk1A5xNWaIQ1IxS95g+zPHBA24hkmzhRsWmTqNsrqANKWrOK4t MRNWxRoQ1ZAXiCtQs6EX50fbryFcKn72w2jAxraSKXZtmtbXy3dJAe9Y67yoOH+JwE7Ky/5f6CX QBuzc7q1iYx6mqW5Zx6aoXh5fpy9oCqxHR2y8Ro24FVWYpYJPsHbYuuTyZLs4XCWAnt59dO+fgZ PIB0iJU7CiQI1ZEvx4BWv1ADWyiRsEFcRYwnfr1huGWNtLe3dMA9rheWE76YaCDC2QmrQf4nx9C s21NgwpAGJohyGZqOl2qStf3L746Z7/UPH51EGR+xJoQPFL/q0X/hEBGprklv5HnsmXLQrcTLPA psiC/uCK/KVDI6JA9aajr0blEiSFheRnuxFAUTb8yKNREv2TQTNshLWXErM2vdV9vf/BNOhKoS3 7YWc0o+LfXLCQDMjEGIwbmQoybk/gBUs5czM6apHjlActxCzlt6OyHLpJmKZBVJsffSH+OEbbOt j7P/tpnlgNstd3PpeNCdc24woVd6jBlhgIBdFshq0fUpFbxbPtEHAKXSE0d8OuqjP8S+tVcqVAm iANVdCcwckHYHng== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=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: 1778420767270158500 Register the new per-module type-infos output files so they are generated during the QAPI code generation step and compiled into the build. Signed-off-by: Marc-Andr=C3=A9 Lureau --- qapi/meson.build | 4 ++++ tests/include/meson.build | 2 ++ tests/meson.build | 6 ++++++ tests/qapi-schema/meson.build | 1 + 4 files changed, 13 insertions(+) diff --git a/qapi/meson.build b/qapi/meson.build index a46269b5a0c..7ae3843de6e 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -80,6 +80,7 @@ endif qapi_nonmodule_outputs =3D [ 'qapi-introspect.c', 'qapi-introspect.h', 'qapi-types.c', 'qapi-types.h', + 'qapi-type-infos.c', 'qapi-type-infos.h', 'qapi-visit.h', 'qapi-visit.c', 'qapi-commands.h', 'qapi-commands.c', 'qapi-init-commands.h', 'qapi-init-commands.c', @@ -90,6 +91,7 @@ qapi_nonmodule_outputs =3D [ qapi_outputs =3D qapi_nonmodule_outputs + [ 'qapi-builtin-types.c', 'qapi-builtin-visit.c', 'qapi-builtin-types.h', 'qapi-builtin-visit.h', + 'qapi-builtin-type-infos.c', 'qapi-builtin-type-infos.h', ] =20 qapi_inputs =3D [] @@ -100,6 +102,8 @@ foreach module : qapi_all_modules 'qapi-types-@0@.h'.format(module), 'qapi-visit-@0@.c'.format(module), 'qapi-visit-@0@.h'.format(module), + 'qapi-type-infos-@0@.c'.format(module), + 'qapi-type-infos-@0@.h'.format(module), ] if have_system or have_tools qapi_module_outputs +=3D [ diff --git a/tests/include/meson.build b/tests/include/meson.build index 8e8d1ec4e69..026480d9685 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 9ba04bbedd3..71dc4ac8bf9 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 debff633ac1..b10f081554d 100644 --- a/tests/qapi-schema/meson.build +++ b/tests/qapi-schema/meson.build @@ -232,6 +232,7 @@ custom_target('QAPI doc', '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-types.c', 'doc-good-qapi-types.h', + 'doc-good-qapi-type-infos.c', 'doc-good-qapi-type-i= nfos.h', 'doc-good-qapi-visit.c', 'doc-good-qapi-visit.h' ], input: files('doc-good.json'), command: [ qapi_gen, '-o', meson.current_build_dir(), --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420766; cv=none; d=zohomail.com; s=zohoarc; b=c1mZtwIziYo0g8OKdLW2z5kXfE3ZKqE2j1AKDS4QH9jQTPpH1TBx9itSdalyhCUhkA31KFQpr5ZyZSFWfq0RVZjfYmfwu3z7TnWoBfMVSGYnbD299EJNpjxSaXWaQ8fJrVk5oT/96XSEtSwZtTBPI+zfHR3zDMmGj/rOtUjNqOQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420766; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=96aVvIKYi/+IKghTyv8FAOjWg2CZgFa5wUJKmBhpQFs=; b=dV6cV+LbRlBLy3N1E2MwaQA2i4kcFgtr1szYbZT6UOzY7Yrf2ISfEAnfVHAFyk2RVOkOr4iN2C7AFAdnA20klULWBiGBN43PpH5nYiTJnGhaDonGQz2WED0P4wsTv3Rzi/cX/1LuQ9z6lstUEVDuW2ZN36oiaVWftrR9Ur0Cvn0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420766889923.8811388329517; Sun, 10 May 2026 06:46:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4Tb-00010r-Fx; Sun, 10 May 2026 09:45:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4So-0000ad-Op for qemu-devel@nongnu.org; Sun, 10 May 2026 09:45:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Sn-0004XD-Cr for qemu-devel@nongnu.org; Sun, 10 May 2026 09:44:58 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-606-v3UEtQPPMpmPpNQ1nVL5SQ-1; Sun, 10 May 2026 09:44:54 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CA4861800344 for ; Sun, 10 May 2026 13:44:53 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A0D221953952; Sun, 10 May 2026 13:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=96aVvIKYi/+IKghTyv8FAOjWg2CZgFa5wUJKmBhpQFs=; b=Rt4HRUvb9JMYQtd8L7P0pObEk4lzHZhFPMR7H4GNSxrFT5pbbFUnOk78B3oQhRbUclOU5k QqCqXi6fBhXlUAP87sT46JvMJ8bgfLmHpCFdbFXOrLJ5r1JlOhTw7YM3dzGfY8EMIsWxvo BHeky9ebJVzhoEmcClvjFBNDiFiKrtc= X-MC-Unique: v3UEtQPPMpmPpNQ1nVL5SQ-1 X-Mimecast-MFC-AGG-ID: v3UEtQPPMpmPpNQ1nVL5SQ_1778420693 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:04 +0400 Subject: [PATCH 07/54] qom: add qapi_type field to ObjectProperty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-7-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1364; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=hiZ7iR3bOaD93l4sMZ0atw37En0Wxn36sEmBAxTmkJU=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItuwzEJ7SSRaN3FthKesxRu7/uRtiiCxyBak 3LGalOzE+SJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbgAKCRDa6OEJdZac 5VfbD/46o0kotYQIWtHQeVD/6hBd+K9lk09rCxovQ9XnQqV7o+cusN2mRwAQLIYiJUPRh+QcK+c nlTmFuKzKFRChgB1U9WyVsNsc5GjplJVEzii0CtlTzMXo2/Nvtvl/uRj0ZvCupFZiO3lt6X8gzr Ggmnb2u30gcfSvamyYKDslSmzKE29d+ybFT0U5pYMA2Kg7/muZi5SQBg+xs20xz4QJ9gwBu84Nt 9IungrCNSoi7GibfpXZWIgm2kuuLBTuhSxDw2LfevYBnmPJhiP+4TFsAxIRtM/XLt5Lkt2Dx2CD nLMcMRe/Sdy+E2+ov2FAdQB2m50DSZjthk02i2MXfilNSQTo5Q0GrlLVFhZcsk6vYmICUH2X+dt RPk3Zs0YUrmJsOtOQw04Qw0tNeeTZWnRP2yQTFpHh3mo4K5pHZRaJ7Ici4HtJ2DAv8rHR7L0grZ IKanhQAGx1vrHPN1QLn5nB1s9eaUgiMsEYLKFjZRp9zZUA/7sYxJgY/OSfwFPqGoN1+XNttZQa7 Zc/ZjtpCBaNrMaRpdrQrqEKqvNldu4ACZUh8y3PCBcCJyFno4hwlLuRk0nnLf5P8LWbGA1kzNuM AfA0IzFuwHYavNQoG4FNzOJUR9UHSu+IbwdJOlveXqWuXoyR3nWZTu0LEXgM+nQfO/HmayXJGWC jg93MURaAI5QqFQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420769970154100 Add a const pointer to QAPITypeInfo in ObjectProperty. NULL for legacy properties, set by new QAPI-aware registration wrappers. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/qom/object.h | 2 ++ qom/object.c | 1 + 2 files changed, 3 insertions(+) diff --git a/include/qom/object.h b/include/qom/object.h index 510885218ba..d47ae209170 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 f981e270440..dd657903f7c 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2803,6 +2803,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.54.0 From nobody Mon May 25 20:32: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=1778420777; cv=none; d=zohomail.com; s=zohoarc; b=B3+KO7AT/jLZTf63E5EIwmuxV8P6s6kBf0NdtnkPhe/XmJ0Y0W7655DeuSDwIBQEHDFsw38KvSm4mMOhbpkQRCmbyWqiwpAAFM5TtUPzzZK4YHidg5rd/0F035B33Ih2Vhb/spGEuFTVkRnFXjPcVC5RIHEKlIYn8S+zFk/juKM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420777; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=CcXfLzNY8fSZYo9PLVA3EmHZ0GPkDr4koAHbu3BXWIg=; b=NFaRJ/vhNaE/NS8ze2mx8xrg109x8NXIpzhS8+Xcppby1pl/Cv3rVQIFUMWuwLsEel3QzH7abf5TBYDhrEKG323Oh1oetDhG+OgUngKsKxhr54fe+0uqpod9LmPVjJfhYdrz7bSYHUfDX/Ph78rJ7DAPHh4WwUUYbBjGYfg6XWM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420777254816.74337209965; Sun, 10 May 2026 06:46:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4U1-0001IG-Fi; Sun, 10 May 2026 09:46:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4T1-0000c6-0p for qemu-devel@nongnu.org; Sun, 10 May 2026 09:45:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Sz-0004lU-3w for qemu-devel@nongnu.org; Sun, 10 May 2026 09:45:10 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-112-ouaLQO3BP7mNG6Nkb1QhOA-1; Sun, 10 May 2026 09:45:06 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 896C3180034E for ; Sun, 10 May 2026 13:45:05 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 53E9219560A7; Sun, 10 May 2026 13:45:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CcXfLzNY8fSZYo9PLVA3EmHZ0GPkDr4koAHbu3BXWIg=; b=OpzirniKAMag+lM/JsIc0Jc7ZZ/XlcpF6j6I7x+yVB0BqGFJfEHAXj+XwzX4HUeojMRpfv bsFCmxa6gZ8V6oFI1TPC3YE67H2tQ/UlFVu+PmbVVA7JchgC5BWBachHGBlPM4X7JIQhko cEU4q2sfoj8Sa8ReMvJto5q5R+G34l0= X-MC-Unique: ouaLQO3BP7mNG6Nkb1QhOA-1 X-Mimecast-MFC-AGG-ID: ouaLQO3BP7mNG6Nkb1QhOA_1778420705 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:05 +0400 Subject: [PATCH 08/54] qapi/qom: add qapi-type field to ObjectPropertyInfo MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-8-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1867; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=l98NcHIYxcIgRoI9lT+AEGU4cey8Hr4xwKBBC+to5GQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItuHAYzltGcdqubEA5XlgSxkpr2aiKaRVLy/ WNTH1zgZTGJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbgAKCRDa6OEJdZac 5fMTEACt2AGvjc4zTcN67lYHel5D8sT5gzgMSiwqeqlbfWxOzlZC9sNFYmKhfmogdbZ8e4mgFEU yb0ERDt9gQYS6lwIBSWg5oUyJEKZgmOGbdK9ui1AM4gsLeZ7etcghQm6ZqBfBV+dN9v8OGfJMwX Jaxui/cwqYbRMvrHjK42FwwpU9Hpjs/e/ryCmnMWCeNQSxXnuw8q462IiYJowrU0rTcBT3EdloX Y52OgUbF/UbaK4G00M/KG15vilzLYmhTGhYAv+UQtH2jyXKANbDAKPDBtk0lYUMkV3El0cNJO8n Qv6LxwsBYXb+qBoL5EIcQx1T91lsrI9EbL7uJoo8JeGSE7832nmZ+JCqIWWPo6JhJ2gc0hAeaRC B3lTqyyDG0noZGEVKa66iU/541n2V+1bJnW4sd+LIVpaVNKVY4i6cUzQ6tJMIKSJHo1P2z90+H3 XYdHwv0sa3SYlJQurekSuYvXrydEoXxJ5GyFsbcgNm0IbYM2Ej7aU1GeVv/sCnvC3+FnrXnoY9+ nylhcixYUU8KobUaKfhxJSu/Cx9X4C0XDRT9xvqsU7bN9uQAedyl48i9rZ1U1YLZ/Ja/mCu+r0N XKDmgxHPh+l8iqO8tRaORfEiqCu/S2rd6YRne0hNs5y889J0LyBGSoeStp6YlfT0Q0N+WKybiI+ erMwQ42wk2RC8tQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420779144158500 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. Signed-off-by: Marc-Andr=C3=A9 Lureau --- qapi/qom.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/qapi/qom.json b/qapi/qom.json index dd45ac1087c..a655be0beaa 100644 --- a/qapi/qom.json +++ b/qapi/qom.json @@ -35,6 +35,11 @@ # qdev device type name. Link properties form the device model # graph. # +# @qapi-type: if the property was registered with a QAPI type +# association, the type name as it appears in the output of +# ``query-qmp-schema``. Absent for properties without a QAPI +# type association. (since 11.1) +# # @description: if specified, the description of the property. # # @default-value: the default value, if any (since 5.0) @@ -44,6 +49,7 @@ { 'struct': 'ObjectPropertyInfo', 'data': { 'name': 'str', 'type': 'str', + '*qapi-type': 'str', '*description': 'str', '*default-value': 'any' } } =20 @@ -55,6 +61,11 @@ # @type: the type of the property, as described in # `ObjectPropertyInfo`. # +# @qapi-type: if the property was registered with a QAPI type +# association, the type name as it appears in the output of +# ``query-qmp-schema``. Absent for properties without a QAPI +# type association. (since 11.1) +# # @value: the value of the property. Absent when the property cannot # be read. # @@ -63,6 +74,7 @@ { 'struct': 'ObjectPropertyValue', 'data': { 'name': 'str', 'type': 'str', + '*qapi-type': 'str', '*value': 'any' } } =20 ## --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420781; cv=none; d=zohomail.com; s=zohoarc; b=A2268BCQIebxhFbcB/EnoSsDj9p4DO+PHu3c50ckBHbPcDvA8l3qRF7I1xOCEPWBYzP5VJvcq8yrJwm4f3jgzL+Dc+Jx1SGX2xxic8axT15CjE+50zSgHku7niFSWchddpy4zNOpYWAvzr5IQ0UXIfRoGrVLCfstrGjNmbxOFxk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420781; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EbnCJ8KhbnfJGLdBe0wqiH9aHQKYgPcb5yn/6ly/rUM=; b=LuVKPJJvvgHDXqklk2ZMw+6m3llZLdBBkIsZWsBTNrwOOaKeeUBWQeyBOpk6q24cheXRObwmIukqw4gOhOGsu//TJe3SQOUUYMpgNpkGhD0acID7SXxXCHRf25/XAxbq9+oh0reR2IzsgcXKVS1iqhk8lbEXXrZrhZmnKk9etQg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420781384586.2281781138637; Sun, 10 May 2026 06:46:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4U0-0001Hc-EK; Sun, 10 May 2026 09:46:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4TH-0000uJ-RZ for qemu-devel@nongnu.org; Sun, 10 May 2026 09:45:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4TA-0004mR-1t for qemu-devel@nongnu.org; Sun, 10 May 2026 09:45:21 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-160-mXh2AQHUOvepGEgNrEWZKQ-1; Sun, 10 May 2026 09:45:17 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E3484180034A for ; Sun, 10 May 2026 13:45:16 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CB8171955D84; Sun, 10 May 2026 13:45:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EbnCJ8KhbnfJGLdBe0wqiH9aHQKYgPcb5yn/6ly/rUM=; b=Cao2aitpkEW0lOHqJjI+bp29rJyliGECApybIt3Qc25tIq8cs8j613gxrm/gi61Q0ZZdVi CaUyBR6AG2Rjnj8+1jAmkVdZAH+LbvDpgpNm06cMwhZ9hs6MTi4qU5nGfIo/e8ECb+4H3d I/kjSCavAaLMm5vi8txv/kecTyWiFS8= X-MC-Unique: mXh2AQHUOvepGEgNrEWZKQ-1 X-Mimecast-MFC-AGG-ID: mXh2AQHUOvepGEgNrEWZKQ_1778420717 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:06 +0400 Subject: [PATCH 09/54] qom/qmp: populate qapi-type in QMP handlers MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-9-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=3243; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=r+eXTVaOUCoKIvVLtys96ITsZDTbvm7APkbtzQtAcRk=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItuvc5WbsnmLVhBuOT6QQMo9SQmYJVBg1k+O HsRLvOOw9+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbgAKCRDa6OEJdZac 5UoSD/0XOfNXrc6tmyVHX0rZLK7EUbDOME/D1Ll9bkOsx/kyiKce6Vg4rUb7cXgAuMeWFh39Vfg r+vm2qGvAEQm2TvG+dRrH8ERfKPxr8eU3uJ7l8lSn1PTFmvWapVKMTVlQW1hlQ+n7AhCDhXt1Xz /i+blORyIiC4vSjoXC6TsH7DIy67wDcWElNHvu3HhjOJ15NmuN3mqRPnliLrFDssvIaDpob/bnh AKOjSDifziu2a9W8Oi5qbDU7mgbGOyKCUXP9g7wIV9FM7IRXYN2XBMg4YIG1r6T6Xbs12qnPT8e dA6wfkP5FJoZuJLyleLkGMNgBotR+Wyli4dqtg/HQKZMnt1qdAkz4guSdY2gUEqlxkCnrn9YdjC 7k+0VrneFsxaTf7PIR0R1afZlgu3dgwwfOs4tM58Q9cY+/Si8AjT0tjVHPttLha/XrAXdoxM8Ne NB//6v7ZB28dYk7erj3pjAV4jstxD7EOAXc0EGlDiC2H65xOLM/Nt+cx7Gc8vQ2jI9u/Nysbzi8 s+Ih/ZZTLH8OXMOGR5PeHryxcAexCv8zgby70KhmIMeNoICIX9TXjotzW4PsQB5XAXHjYFaaO+P 7NgwC5Oy4/w21ZR9QPsFUNUlezZQWuYmVy9Q8my1Fo+1oBx+J2IlYe75RhhBeghVc57hVEWOF5d Z55nJmVBntEHqsQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420783234158500 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. Signed-off-by: Marc-Andr=C3=A9 Lureau --- qom/qom-qmp-cmds.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c index 48b38d2b7f7..30af2cef53e 100644 --- a/qom/qom-qmp-cmds.c +++ b/qom/qom-qmp-cmds.c @@ -25,9 +25,22 @@ #include "qapi/qobject-input-visitor.h" #include "qapi/qobject-output-visitor.h" #include "qemu/cutils.h" +#include "qapi/qapi-type-info.h" #include "qom/object_interfaces.h" #include "qom/qom-qobject.h" =20 +static ObjectPropertyInfo *qom_property_info(ObjectProperty *prop) +{ + ObjectPropertyInfo *info =3D g_new0(ObjectPropertyInfo, 1); + + info->name =3D g_strdup(prop->name); + info->type =3D g_strdup(prop->type); + if (prop->qapi_type) { + info->qapi_type =3D g_strdup(prop->qapi_type->schema_name); + } + return info; +} + static Object *qom_resolve_path(const char *path, Error **errp) { bool ambiguous =3D false; @@ -58,12 +71,7 @@ ObjectPropertyInfoList *qmp_qom_list(const char *path, E= rror **errp) =20 object_property_iter_init(&iter, obj); while ((prop =3D object_property_iter_next(&iter))) { - ObjectPropertyInfo *value =3D g_new0(ObjectPropertyInfo, 1); - - QAPI_LIST_PREPEND(props, value); - - value->name =3D g_strdup(prop->name); - value->type =3D g_strdup(prop->type); + QAPI_LIST_PREPEND(props, qom_property_info(prop)); } =20 return props; @@ -78,6 +86,9 @@ static void qom_list_add_property_value(Object *obj, Obje= ctProperty *prop, =20 item->name =3D g_strdup(prop->name); item->type =3D g_strdup(prop->type); + if (prop->qapi_type) { + item->qapi_type =3D g_strdup(prop->qapi_type->schema_name); + } item->value =3D object_property_get_qobject(obj, prop->name, NULL); } =20 @@ -225,9 +236,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 @@ -268,11 +277,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.54.0 From nobody Mon May 25 20:32: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=1778420805; cv=none; d=zohomail.com; s=zohoarc; b=ERQNDEraVzSLvPu/she3MRSTjaaosMv6zwkzSIL52ga2H1SMCqEuwRzm1zRAUJh53NtBalNEd1njokIVjLiVQOn9LQtzOmL5IPd8DH3wINTcnghspfxdt3QHti2JiHsEI20lJKNljw0e2A10cEaZtaySiWGTfeRZn/jTpnKn6Lg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420805; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GXZpk1eE9g26alQ0GfwKiLM1XnWDbIv9gIdhp+lFY28=; b=kGNYtbJrq3POuinrdS+nyz4K+EIqW3bdRZ4iMejle/FOz57HVtkLqzp09PuxCUga9BFrkxGPoIkqBXLO19YCZ9u6h/dLBttIozCOrLOh/QO6uRo3DX6ttfKaiZKy18xKHUMHpTHTwd46V7pm9fyHZnsGSLLHNt+yIk53wt7APkE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420805962723.748387688515; Sun, 10 May 2026 06:46:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4UR-0001jv-2I; Sun, 10 May 2026 09:46:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4TN-0000yW-S2 for qemu-devel@nongnu.org; Sun, 10 May 2026 09:45:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4TI-0004og-V1 for qemu-devel@nongnu.org; Sun, 10 May 2026 09:45:30 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-631-23IcJhaCNr6QpeF04CbOYQ-1; Sun, 10 May 2026 09:45:26 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A4EC0195608E for ; Sun, 10 May 2026 13:45:25 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 508BB1955D84; Sun, 10 May 2026 13:45:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GXZpk1eE9g26alQ0GfwKiLM1XnWDbIv9gIdhp+lFY28=; b=H8WIYwgP2UGNLkkqpXBlOdqUdIJgwXkJxVXHwL+jQ78wC/G0MpB1sPEKKCFpCI0KmZxDi/ n5+pQsvqK6yVRudwGdlR6O6Of720Gu9YSQUg7KmtG4rZg4etQ4mgdbeE3wRTl56W2Y5vOF Aj8/tU4w5fBOZedwG27/l1IgRyLWULM= X-MC-Unique: 23IcJhaCNr6QpeF04CbOYQ-1 X-Mimecast-MFC-AGG-ID: 23IcJhaCNr6QpeF04CbOYQ_1778420725 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:07 +0400 Subject: [PATCH 10/54] qom: add QAPI-aware property registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-10-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=11019; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=wW4x16+vXvay3SmGEDnSWxWn+hbEIonX5OGKML9nN7E=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItuSExP9Xdd7bG4V7o/ubXCzNmF3Hj+/+pi7 esrKmS2zXyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbgAKCRDa6OEJdZac 5QR9D/0ZC3GX/lerOfWhp96vNrDzjWcrB6TpyEZENRI7R7p0osUygYhkFWOEee3sL2XJvkOutqC 7MHCMGAysaqGv26xEz1dVk6md51b5/QEk3RRe8/4Ij2lkytArtt0xfwR/U6jWC5isl4HrYGQdzS 6utu7f74niIKIt3XZzOyjxwO5kqYaPOTk/GNI61xprQrxoiNGglbIyqZ/rhCUIa6XIkrK6Ng0aS bPUo6j1QP0APzu0edhHCkpMd96C3N03DNeLj+0Nt0s+VtdGcg3TW1W25cSpjvoB8iA6qMLDh169 WcquXqhE28g5MpI7meP7fM6SD2ygGpuoehdpa/jOYT+zE2a2rm37o0gA/Cm/5EAYIudblZ09CvO M5IhTR0ojaJDhA0F97KiUei6xDzub27mIkRW6hXh8FHj86PnhhpreeZ9pZ3xI+WT9ph5DGWrnpn zzNLB7TSBptpaxG3VAgQEAMFXZ5uiZj8AVi0vQEaQOmwWzMhyDELxthIsxkr9LkP6KviuIZcSX8 GyScxVBcgZRZR9aDwGcR+D3+Qb9WRPjFlKyysaetYfCoIN5kZImBVyGKR4ipHGUx/FxMp7gpDfx HaPrlq57qIWF30rCPdF8n4NHHR75KQYBHOPwtrvHzmB0nsooICWwvk4oUH3DWpldz03RtSy516m uQ5UctWavh1kFKQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=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: 1778420808688154100 Add object{_class}_property_add_qapi_enum(), and object_{_class}_property_add_qapi() functions. Set the qapi_type pointer on the resulting ObjectProperty. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/qom/object.h | 105 +++++++++++++++++++++++++++++++++++++++++ qom/object.c | 131 +++++++++++++++++++++++++++++++++++++++++++++++= ++-- 2 files changed, 232 insertions(+), 4 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index d47ae209170..0eaa02688b0 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1140,6 +1140,15 @@ void object_property_set_default_bool(ObjectProperty= *prop, bool value); */ void object_property_set_default_str(ObjectProperty *prop, const char *val= ue); =20 +/** + * object_property_set_default_enum: + * @prop: the property to set + * @value: the value to be written to the property + * + * Set the property default value. + */ +void object_property_set_default_enum(ObjectProperty *prop, int value); + /** * object_property_set_default_list: * @prop: the property to set @@ -1815,6 +1824,102 @@ ObjectProperty *object_class_property_add_enum(Obje= ctClass *klass, int (*get)(Object *, Error **), void (*set)(Object *, int, Error **)); =20 +/** + * struct QapiEnumProp - Descriptor for a QOM property backed by a QAPI en= um type + * + * Binds a QOM object property to a QAPI enum, providing automatic + * string<->int conversion through QAPI visitors and optional + * default-value initialization during object instance init. + * + * Use the QAPI_ENUM_PROP() macro to construct instances inline. + * + * @name: property name exposed on the QOM object + * @description: human-readable description (shown in ``-device help``, et= c.) + * @default_value: initial enum value applied via @set during instance ini= t, + * or -1 (the QAPI_ENUM_PROP default) to skip initializati= on + * @qapi_type: pointer to the generated QAPITypeInfo for the enum + * (provides the string<->int lookup table) + * @get: getter =E2=80=94 returns the current enum value as int, or -1 on = error + * @set: setter =E2=80=94 receives the enum value as int; %NULL for read-o= nly props + */ +typedef struct QapiEnumProp { + const char *name; + const char *description; + const int default_value; + const QAPITypeInfo *qapi_type; + int (*get)(Object *, Error **); + void (*set)(Object *, int, Error **); +} QapiEnumProp; + +#define QAPI_ENUM_PROP(...) ({ \ + static const QapiEnumProp _prop =3D { = \ + .default_value =3D -1, __VA_ARGS__ = \ + }; \ + &_prop; }) + +/** + * object_property_add_qapi_enum: + * @obj: the object to add a property to + * @prop: property descriptor + * + * Add an enum property with QAPI type association. + * + * Use the QAPI_ENUM_PROP() macro to construct the property descriptor + * inline. If .default_value is not set, the property is not initialized + * (default_value is -1). Otherwise, the setter is called with + * default_value during object instance init. + * + * Example:: + * + * object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + * .name =3D "policy", + * .description =3D "Set the NUMA policy", + * .default_value =3D HOST_MEM_POLICY_DEFAULT, + * .qapi_type =3D &HostMemPolicy_type_info, + * .get =3D my_get_policy, + * .set =3D my_set_policy, + * )); + * + * Returns: The newly added property on success, or %NULL on failure. + */ +ObjectProperty * +object_property_add_qapi_enum(Object *obj, const QapiEnumProp *prop); + +ObjectProperty * +object_class_property_add_qapi_enum(ObjectClass *klass, const QapiEnumProp= *prop); + +/** + * object_property_add_qapi: + * @obj: the object to add a property to + * @name: the name of the property + * @qapi_type: QAPI type info descriptor + * @get: the getter or %NULL if the property is write-only. + * @set: the setter or %NULL if the property is read-only + * @release: called when the property is removed from the object + * @opaque: opaque pointer for get/set/release + * + * Add a property with a QAPI type association. The property type name + * is derived from @qapi_type->name. + * + * Returns: The newly added property on success, or %NULL on failure. + */ +ObjectProperty * +object_property_add_qapi(Object *obj, const char *name, + const QAPITypeInfo *qapi_type, + ObjectPropertyAccessor *get, + ObjectPropertyAccessor *set, + ObjectPropertyRelease *release, + void *opaque); + +ObjectProperty * +object_class_property_add_qapi(ObjectClass *klass, + const char *name, + const QAPITypeInfo *qapi_type, + ObjectPropertyAccessor *get, + ObjectPropertyAccessor *set, + ObjectPropertyRelease *release, + void *opaque); + /** * object_property_add_tm: * @obj: the object to add a property to diff --git a/qom/object.c b/qom/object.c index dd657903f7c..164907289a6 100644 --- a/qom/object.c +++ b/qom/object.c @@ -23,6 +23,7 @@ #include "qapi/qobject-input-visitor.h" #include "qapi/forward-visitor.h" #include "qapi/qapi-builtin-visit.h" +#include "qapi/qapi-type-info.h" #include "qobject/qjson.h" #include "trace.h" =20 @@ -1547,6 +1548,15 @@ void object_property_set_default_str(ObjectProperty = *prop, const char *value) object_property_set_default(prop, QOBJECT(qstring_from_str(value))); } =20 +void object_property_set_default_enum(ObjectProperty *prop, int value) +{ + assert(prop && prop->qapi_type && prop->qapi_type->lookup); + + object_property_set_default(prop, QOBJECT(qstring_from_str( + qapi_enum_lookup(prop->qapi_type->lookup, value) + ))); +} + void object_property_set_default_list(ObjectProperty *prop) { object_property_set_default(prop, QOBJECT(qlist_new())); @@ -1605,7 +1615,6 @@ int object_property_get_enum(Object *obj, const char = *name, char *str; int ret; ObjectProperty *prop =3D object_property_find_err(obj, name, errp); - EnumProperty *enumprop; =20 if (prop =3D=3D NULL) { return -1; @@ -1618,14 +1627,17 @@ int object_property_get_enum(Object *obj, const cha= r *name, return -1; } =20 - enumprop =3D prop->opaque; - str =3D object_property_get_str(obj, name, errp); if (!str) { return -1; } =20 - ret =3D qapi_enum_parse(enumprop->lookup, str, -1, errp); + if (prop->qapi_type) { + ret =3D qapi_enum_parse(prop->qapi_type->lookup, str, -1, errp); + } else { + EnumProperty *enumprop =3D prop->opaque; + ret =3D qapi_enum_parse(enumprop->lookup, str, -1, errp); + } g_free(str); =20 return ret; @@ -2418,6 +2430,117 @@ object_class_property_add_enum(ObjectClass *klass, = const char *name, prop); } =20 +static void get_qapi_enum(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + const QapiEnumProp *prop =3D opaque; + int value; + Error *err =3D NULL; + + value =3D prop->get(obj, &err); + if (err) { + error_propagate(errp, err); + return; + } + + visit_type_enum(v, name, &value, prop->qapi_type->lookup, errp); +} + +static void set_qapi_enum(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + const QapiEnumProp *prop =3D opaque; + int value; + + if (!visit_type_enum(v, name, &value, prop->qapi_type->lookup, errp)) { + return; + } + prop->set(obj, value, errp); +} + +static void init_qapi_enum(Object *obj, ObjectProperty *prop) +{ + const QapiEnumProp *e =3D prop->opaque; + + if (e->set && e->default_value >=3D 0) { + e->set(obj, e->default_value, &error_abort); + } +} + +ObjectProperty * +object_property_add_qapi_enum(Object *obj, const QapiEnumProp *e) +{ + ObjectProperty *prop; + + assert(e && e->qapi_type && e->qapi_type->lookup); + + prop =3D object_property_add(obj, e->name, e->qapi_type->name, + e->get ? get_qapi_enum : NULL, + e->set ? set_qapi_enum : NULL, + NULL, + (void *)e); + prop->qapi_type =3D e->qapi_type; + prop->description =3D g_strdup(e->description); + if (e->default_value >=3D 0) { + prop->init =3D init_qapi_enum; + } + + return prop; +} + +ObjectProperty * +object_class_property_add_qapi_enum(ObjectClass *klass, const QapiEnumProp= *e) +{ + ObjectProperty *prop; + + assert(e && e->qapi_type && e->qapi_type->lookup); + + prop =3D object_class_property_add(klass, e->name, e->qapi_type->name, + e->get ? get_qapi_enum : NULL, + e->set ? set_qapi_enum : NULL, + NULL, + (void *)e); + prop->qapi_type =3D e->qapi_type; + prop->description =3D g_strdup(e->description); + if (e->default_value >=3D 0) { + prop->init =3D init_qapi_enum; + } + + return prop; +} + +ObjectProperty * +object_property_add_qapi(Object *obj, const char *name, + const QAPITypeInfo *qapi_type, + ObjectPropertyAccessor *get, + ObjectPropertyAccessor *set, + ObjectPropertyRelease *release, + void *opaque) +{ + ObjectProperty *prop; + + prop =3D object_property_add(obj, name, qapi_type->name, + get, set, release, opaque); + prop->qapi_type =3D qapi_type; + return prop; +} + +ObjectProperty * +object_class_property_add_qapi(ObjectClass *klass, const char *name, + const QAPITypeInfo *qapi_type, + ObjectPropertyAccessor *get, + ObjectPropertyAccessor *set, + ObjectPropertyRelease *release, + void *opaque) +{ + ObjectProperty *prop; + + prop =3D object_class_property_add(klass, name, qapi_type->name, + get, set, release, opaque); + prop->qapi_type =3D qapi_type; + return prop; +} + typedef struct TMProperty { void (*get)(Object *, struct tm *, Error **); } TMProperty; --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420868; cv=none; d=zohomail.com; s=zohoarc; b=B8Dg7KQ7WC05zz97pMynU09P7jUVfj7Ty9SuvmC3/p5U6M6xT/fD8bmOkndsGkVa65fNBrQ9iHwDgDNWOCTOzYSXb/HKVjGNJX8GTmWIchvTfNfBp8hdIVrLRC1Bwftd+/TuLEGbhdJofz3fp3167976f5uSeLiGjKpJO6RoF0k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420868; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5G459n7lWCR6RHTw6ZXPgMDR6fRbZNSZklrPlvbvRh8=; b=hY67vkK9FZ3volaqct93QYqksBuXaIg8KTXdLKqvCySJNynpYjzZy0CsAAripiNOH4Kq0SPo64Fk3Gpiapz9SWmqOTr7umQJsIMO2a+hSZzvZLTeXePAbB7lkA9FeJ/gBtQSzBpm7QqR/fnQxMat3KPMKXzIyYldu25A/TQ59WQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420867889569.13421121803; Sun, 10 May 2026 06:47:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4UR-0001jH-2L; Sun, 10 May 2026 09:46:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4TW-00013l-CD for qemu-devel@nongnu.org; Sun, 10 May 2026 09:45:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4TS-0004pZ-NI for qemu-devel@nongnu.org; Sun, 10 May 2026 09:45:40 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-711-lcI3LTA7MImIj7vmDntVAQ-1; Sun, 10 May 2026 09:45:36 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 399A7195608A for ; Sun, 10 May 2026 13:45:35 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7EEDD19560A2; Sun, 10 May 2026 13:45:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5G459n7lWCR6RHTw6ZXPgMDR6fRbZNSZklrPlvbvRh8=; b=V+Pnwu9uA8zda3lqyzcOUx1eqPooSdXdrHr3cKBSRPpDzd0dgsP1NnW4eUM3Xwzin40feS blYeFDo0uDXRw9LdvfxSKEE0UcWjHuyi03FA17ewNGLC2tvpWBm7p9hKVQGBf3hnMSUve7 wQhF8ITtUAW0n2vk6Tzi57HoPasz5Q0= X-MC-Unique: lcI3LTA7MImIj7vmDntVAQ-1 X-Mimecast-MFC-AGG-ID: lcI3LTA7MImIj7vmDntVAQ_1778420735 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:08 +0400 Subject: [PATCH 11/54] tests: update check-qom-proplist for QAPI-aware property registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-11-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=5561; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=AYySB4whkyxqj4vvcpXqAD8zNJIJd16aWiD3AOenPUQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItul/Y9cbWxeV5ZWNEHQbbJvzyQcNQbi63gc PWIINSZXzuJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbgAKCRDa6OEJdZac 5YT2EACrLs2+Z/izomzenr8vm/CVB2rjnJW8oO3Btpqu5NU3B9XzTn9NHoFD3I1H5/XEZKGyVVo 8jNoKLerfoQpdZgAPRIM3COVPNyhslw8GXrGQ9EQNPHuFDzmVMaYG/8PDnqbIaVXKFglqvedC7A JeYuIQgRdWIMkuuCFcsZZVPeU77Ak1/c9+3oQmYTDEsXPMhBJeKQwIYbVl3YJuXY8NDslhvzNEG ys/MNeRne1Qopv6dlSEh3Ah3SvUDprXfMkP7lyhheNWlSKEQ1HMgbELnM5qAK5FkUB25/VH0Lyq l0vuKQgEZMY2lsXtA7oA11/PisqH9sxOmSj9bShn9TgCJTiTJxVEFHJkStj/gocMA9kw3ahW0YK iKsKLRgVw/Th1y5yrz5U3mHwUazeA1ilaKAscIHvJ4hFCwvLwkhUD+dmqCwYxC8qtH+RTTJZ4nV aCzH++N+RfyCIwb2wCdnfSw7+azNRTyrMXHZ3+R9p45JnkhHI60heMd+vkmLAIpRDBxoDsi9SN1 0tzOAblNq4nus9wI2gpF4q0XbY0luCzaZMi6FW8+UEIIPn94J20VJfmQrPgrpCjI3GB0Rxc1wlA jbZGtVPCP4EABnM/Mt5J5VqPZ59KOjhdQOLNWdBu1ldQhiCNf8Eok2enFEUsGTwF6R79siOF59E 2bPTVUMo52wRz+g== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=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: 1778420869807158500 Migrate the dummy object's string and enum properties from the legacy object_class_property_add_str/enum() helpers to the new QAPI-aware object_class_property_add_qapi/qapi_enum() registration. Add test cases verifying that the qapi_type metadata is correctly populated on properties registered through the new API, and that it remains NULL for properties using the old-style registration. Signed-off-by: Marc-Andr=C3=A9 Lureau --- tests/unit/check-qom-proplist.c | 94 ++++++++++++++++++++++++++++++++++---= ---- 1 file changed, 78 insertions(+), 16 deletions(-) diff --git a/tests/unit/check-qom-proplist.c b/tests/unit/check-qom-proplis= t.c index ee3c6fb32b1..7f10befe687 100644 --- a/tests/unit/check-qom-proplist.c +++ b/tests/unit/check-qom-proplist.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" =20 #include "qapi/error.h" +#include "qapi/qapi-type-info.h" #include "qapi/qobject-input-visitor.h" #include "qobject/qdict.h" #include "qobject/qobject.h" @@ -108,22 +109,21 @@ static int dummy_get_av(Object *obj, } =20 =20 -static void dummy_set_sv(Object *obj, - const char *value, - Error **errp) +static void dummy_set_sv(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DummyObject *dobj =3D DUMMY_OBJECT(obj); =20 - g_free(dobj->sv); - dobj->sv =3D g_strdup(value); + g_clear_pointer(&dobj->sv, g_free); + visit_type_str(v, name, &dobj->sv, errp); } =20 -static char *dummy_get_sv(Object *obj, - Error **errp) +static void dummy_get_sv(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DummyObject *dobj =3D DUMMY_OBJECT(obj); =20 - return g_strdup(dobj->sv); + visit_type_str(v, name, &dobj->sv, errp); } =20 =20 @@ -135,16 +135,28 @@ static void dummy_init(Object *obj) } =20 =20 +static const QAPITypeInfo dummy_animal_qapi_type_info =3D { + .name =3D "DummyAnimal", + .schema_name =3D "DummyAnimalSchema", + .lookup =3D &dummy_animal_map, +}; + +static const QAPITypeInfo dummy_str_qapi_type_info =3D { + .name =3D "str", + .schema_name =3D "StrSchema", +}; + static void dummy_class_init(ObjectClass *cls, const void *data) { - object_class_property_add_str(cls, "sv", - dummy_get_sv, - dummy_set_sv); - object_class_property_add_enum(cls, "av", - "DummyAnimal", - &dummy_animal_map, - dummy_get_av, - dummy_set_av); + object_class_property_add_qapi(cls, "sv", &dummy_str_qapi_type_info, + dummy_get_sv, dummy_set_sv, + NULL, NULL); + object_class_property_add_qapi_enum(cls, QAPI_ENUM_PROP( + .name =3D "av", + .qapi_type =3D &dummy_animal_qapi_type_info, + .get =3D dummy_get_av, + .set =3D dummy_set_av, + )); } =20 =20 @@ -648,6 +660,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->schema_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->schema_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); @@ -666,6 +726,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.54.0 From nobody Mon May 25 20:32: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=1778420806; cv=none; d=zohomail.com; s=zohoarc; b=fQ9n4263BI1ayGkRHeKBzyq53N3azENMACnAHyhlxUM1Nq4T1u8q7zF4oLtXEkudF3Vu51qWvkkXUk80Tn+Z66Kyen/o//4qdBA2h/vbZqvYpb2znjW2uEy83xp1edlis+pzZ0wyNeL245/SxE5G6T5t/024xISw7ronSDoTjxo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420806; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jlpNWzEH2URs6ypQvsreVVrnHaohFQM5KvyXgRsDq8U=; b=MU1lQZJuNQY2KmQMbIZqQyf0KlMJHYBS7JFegGhL536tCM+0T+a91G9YppxkZANhiz0dI6vXp/6M0+fnk56A9kZSaFWjoDogDJPGBBycz7pftK7cI4Qh4woDjMd7eSPkke0IX3l/uL2hm7qyIReCc8yD/h2b5KNpmG3RCGt5K8A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420805907828.9583688524889; Sun, 10 May 2026 06:46:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4UT-00025C-36; Sun, 10 May 2026 09:46:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Tl-00017V-Hf for qemu-devel@nongnu.org; Sun, 10 May 2026 09:46:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Tj-0004rD-7l for qemu-devel@nongnu.org; Sun, 10 May 2026 09:45:57 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-672-LhUjEhZ0PWqdgJE7zYk18A-1; Sun, 10 May 2026 09:45:50 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E9E3D1956080 for ; Sun, 10 May 2026 13:45:49 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F30991800352; Sun, 10 May 2026 13:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jlpNWzEH2URs6ypQvsreVVrnHaohFQM5KvyXgRsDq8U=; b=UmDtxoBGKYiAibe5obWJPPzO5eacjfU4bip8YZgwKIyCxbCdg6+Tid3abfOiGyh+UbjKSj plOqB2pkkWCMvIiiUrCffFHRzPTS9nDws+oCPhtABAPuCrwVa5PNvYqW8BLsF9l9sQVh+y IFOAO6/EoJL3j5vewcMxbiEvcyEsyQc= X-MC-Unique: LhUjEhZ0PWqdgJE7zYk18A-1 X-Mimecast-MFC-AGG-ID: LhUjEhZ0PWqdgJE7zYk18A_1778420750 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:09 +0400 Subject: [PATCH 12/54] qom: convert enum properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-12-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=16067; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=61VKb+MXQWmOoOzubfj4Jen5EvP7iPFQOu3r1qby2tg=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItueBjUtWqKgfblToYHxU1r93fObGn7Q78qJ 7Ts8ay15y2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbgAKCRDa6OEJdZac 5UM1D/0U65rqhyyhG6gHOK3NT76S286ubDv0i5ZmcVo0gbfbyg6ud5uPHK1s1Uw3HqgxfVmZI3M Z/sGSUDFrIqJIt1xxRcV9icFbZ0bgfZzFA009y8K8OIPDR80KlCIrQObTaWId8k49Rx0NsOFd91 f0/kEIidvJ6nqLwpDZPsLVamcrsl+/odSpBVE4+IycCLD943O0ut44y8cNP4YFP7gRneKi9bVLh 2hjU2RORuMMXjGH/lkk7bpMKOoRnjscPPikpPl8S0esZs1fE/jmhLl1DkMx5CK/+fM5IVv65MVt SYsjtuZ19d+j3vmqDoxEnGgb97DWDT3EoBEt7U1qT8Cu9IsfYqEEnLLY5kPM89TWPZwRkIAEJMw em1/U06srTlh0PptdK4egMb1+akbIQQLmixcsqAW5eQMiw0dJmVEoXXT8hPcAKtEHs6jW9tqgrM eUf83tTzAJ9FmPmqJS7puGuqUAYV1RncATzmOi5kDpGrRDiVnkeGy5LtjMyaBVSqJyj/WzToAi4 AvagMyAwcYhmqd3L8iwXx0uwyy9i3CxNE7so09tDd/UWlCIspV+GHg8289pKsegABtVKKzj+rjG Ms8HlBGi0grgXCKFWWUBMjUNFuyWGyAyPutzXSz7zZjjaStd+nvcF1N+tTPlv5whUpLNshsq29w +nt0Hi1RutRAbzQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420807666158500 Convert all callers of object_class_property_add_enum() to use the new object_class_property_add_qapi_enum() with the QAPI_ENUM_PROP() macro, which provides type information via QAPITypeInfo instead of raw lookup tables and string type names. This enables QMP introspection to report accurate QAPI type names for enum properties. Where a separate set_description call was used, the description is now embedded in the QAPI_ENUM_PROP initializer. Signed-off-by: Marc-Andr=C3=A9 Lureau --- authz/list.c | 12 +++++++----- backends/hostmem.c | 14 ++++++++------ crypto/secret_common.c | 12 +++++++----- crypto/tlscreds.c | 12 +++++++----- hw/i386/pc_piix.c | 19 +++++++++++++------ hw/microblaze/petalogix_s3adsp1800_mmu.c | 19 +++++++++++-------- net/filter.c | 10 +++++++--- target/i386/kvm/kvm.c | 30 +++++++++++++++++-----------= -- ui/dbus.c | 10 +++++++--- ui/input-linux.c | 11 +++++++---- 10 files changed, 91 insertions(+), 58 deletions(-) diff --git a/authz/list.c b/authz/list.c index 17aa0efd80e..363b2ee12c9 100644 --- a/authz/list.c +++ b/authz/list.c @@ -22,6 +22,7 @@ #include "authz/list.h" #include "trace.h" #include "qom/object_interfaces.h" +#include "qapi/qapi-type-infos-authz.h" #include "qapi/qapi-visit-authz.h" #include "qemu/module.h" =20 @@ -120,11 +121,12 @@ qauthz_list_class_init(ObjectClass *oc, const void *d= ata) { QAuthZClass *authz =3D QAUTHZ_CLASS(oc); =20 - object_class_property_add_enum(oc, "policy", - "QAuthZListPolicy", - &QAuthZListPolicy_lookup, - qauthz_list_prop_get_policy, - qauthz_list_prop_set_policy); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "policy", + .qapi_type =3D &QAuthZListPolicy_type_info, + .get =3D qauthz_list_prop_get_policy, + .set =3D qauthz_list_prop_set_policy, + )); =20 object_class_property_add(oc, "rules", "QAuthZListRule", qauthz_list_prop_get_rules, diff --git a/backends/hostmem.c b/backends/hostmem.c index cd2085fb3cd..d0977552b40 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" @@ -548,12 +549,13 @@ host_memory_backend_class_init(ObjectClass *oc, const= void *data) NULL, NULL); object_class_property_set_description(oc, "host-nodes", "Binds memory to the list of NUMA host nodes"); - object_class_property_add_enum(oc, "policy", "HostMemPolicy", - &HostMemPolicy_lookup, - host_memory_backend_get_policy, - host_memory_backend_set_policy); - object_class_property_set_description(oc, "policy", - "Set the NUMA policy"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "policy", + .description =3D "Set the NUMA policy", + .qapi_type =3D &HostMemPolicy_type_info, + .get =3D host_memory_backend_get_policy, + .set =3D host_memory_backend_set_policy, + )); object_class_property_add_bool(oc, "share", host_memory_backend_get_share, host_memory_backend_set_share); object_class_property_set_description(oc, "share", diff --git a/crypto/secret_common.c b/crypto/secret_common.c index a5ecb876aeb..381d23ecc8e 100644 --- a/crypto/secret_common.c +++ b/crypto/secret_common.c @@ -22,6 +22,7 @@ #include "crypto/secret_common.h" #include "crypto/cipher.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-crypto.h" #include "qom/object_interfaces.h" #include "qemu/base64.h" #include "qemu/module.h" @@ -269,11 +270,12 @@ qcrypto_secret_class_init(ObjectClass *oc, const void= *data) =20 ucc->complete =3D qcrypto_secret_complete; =20 - object_class_property_add_enum(oc, "format", - "QCryptoSecretFormat", - &QCryptoSecretFormat_lookup, - qcrypto_secret_prop_get_format, - qcrypto_secret_prop_set_format); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "format", + .qapi_type =3D &QCryptoSecretFormat_type_info, + .get =3D qcrypto_secret_prop_get_format, + .set =3D qcrypto_secret_prop_set_format, + )); object_class_property_add_str(oc, "keyid", qcrypto_secret_prop_get_keyid, qcrypto_secret_prop_set_keyid); diff --git a/crypto/tlscreds.c b/crypto/tlscreds.c index fb09e295a65..54859720bf7 100644 --- a/crypto/tlscreds.c +++ b/crypto/tlscreds.c @@ -20,6 +20,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-crypto.h" #include "qapi-types-crypto.h" #include "qemu/module.h" #include "qemu/error-report.h" @@ -221,11 +222,12 @@ qcrypto_tls_creds_class_init(ObjectClass *oc, const v= oid *data) object_class_property_add_str(oc, "dir", qcrypto_tls_creds_prop_get_dir, qcrypto_tls_creds_prop_set_dir); - object_class_property_add_enum(oc, "endpoint", - "QCryptoTLSCredsEndpoint", - &QCryptoTLSCredsEndpoint_lookup, - qcrypto_tls_creds_prop_get_endpoint, - qcrypto_tls_creds_prop_set_endpoint); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "endpoint", + .qapi_type =3D &QCryptoTLSCredsEndpoint_type_info, + .get =3D qcrypto_tls_creds_prop_get_endpoint, + .set =3D qcrypto_tls_creds_prop_set_endpoint, + )); object_class_property_add_str(oc, "priority", qcrypto_tls_creds_prop_get_priority, qcrypto_tls_creds_prop_set_priority); diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 82457bdb167..91a371b12d7 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-info.h" #include "qemu/error-report.h" #include "system/xen.h" #ifdef CONFIG_XEN @@ -336,6 +337,11 @@ static const QEnumLookup PCSouthBridgeOption_lookup = =3D { .size =3D PC_SOUTH_BRIDGE_OPTION_MAX }; =20 +static const QAPITypeInfo PCSouthBridgeOption_type_info =3D { + .name =3D "PCSouthBridgeOption", + .lookup =3D &PCSouthBridgeOption_lookup, +}; + static int pc_get_south_bridge(Object *obj, Error **errp) { PCMachineState *pcms =3D PC_MACHINE(obj); @@ -418,12 +424,13 @@ static void pc_i440fx_machine_options(MachineClass *m) machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE); machine_class_allow_dynamic_sysbus_dev(m, TYPE_UEFI_VARS_X64); =20 - object_class_property_add_enum(oc, "x-south-bridge", "PCSouthBridgeOpt= ion", - &PCSouthBridgeOption_lookup, - pc_get_south_bridge, - pc_set_south_bridge); - object_class_property_set_description(oc, "x-south-bridge", - "Use a different south bridge than PI= IX3"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "x-south-bridge", + .description =3D "Use a different south bridge than PIIX3", + .qapi_type =3D &PCSouthBridgeOption_type_info, + .get =3D pc_get_south_bridge, + .set =3D pc_set_south_bridge, + )); compat_props_add(m->compat_props, pc_piix_compat_defaults, pc_piix_compat_defaults_len); } diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petal= ogix_s3adsp1800_mmu.c index c5f64319009..9a8fcc66781 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -27,6 +27,7 @@ #include "qemu/target-info.h" #include "qemu/units.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "target/microblaze/cpu.h" #include "hw/core/sysbus.h" #include "net/net.h" @@ -174,14 +175,16 @@ static void petalogix_s3adsp1800_machine_class_init(O= bjectClass *oc, mc->init =3D petalogix_s3adsp1800_init; mc->is_default =3D true; =20 - prop =3D object_class_property_add_enum(oc, "endianness", "EndianMode", - &EndianMode_lookup, - machine_get_endianness, - machine_set_endianness); - object_property_set_default_str(prop, target_big_endian() ? "big" - : "little"); - object_class_property_set_description(oc, "endianness", - "Defines whether the machine runs in big or little endian mode= "); + prop =3D object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "endianness", + .description =3D + "Defines whether the machine runs in big or little endian mode= ", + .qapi_type =3D &EndianMode_type_info, + .get =3D machine_get_endianness, + .set =3D machine_set_endianness, + )); + object_property_set_default_enum(prop, + target_big_endian() ? ENDIAN_MODE_BIG : ENDIAN_MODE_LITTLE); } =20 static const TypeInfo petalogix_s3adsp1800_machine_types[] =3D { diff --git a/net/filter.c b/net/filter.c index c7cc6615dc9..42e5d7c9072 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 @@ -340,9 +341,12 @@ static void netfilter_class_init(ObjectClass *oc, cons= t void *data) =20 object_class_property_add_str(oc, "netdev", netfilter_get_netdev_id, netfilter_set_n= etdev_id); - object_class_property_add_enum(oc, "queue", "NetFilterDirection", - &NetFilterDirection_lookup, - netfilter_get_direction, netfilter_set_= direction); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "queue", + .qapi_type =3D &NetFilterDirection_type_info, + .get =3D netfilter_get_direction, + .set =3D netfilter_set_direction, + )); object_class_property_add_str(oc, "status", netfilter_get_status, netfilter_set_stat= us); object_class_property_add_str(oc, "position", diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 9e352882c8c..ecf0c76fcdf 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 @@ -7086,12 +7088,13 @@ static void kvm_arch_set_honor_guest_pat(Object *ob= j, int value, Error **errp) =20 void kvm_arch_accel_class_init(ObjectClass *oc) { - object_class_property_add_enum(oc, "notify-vmexit", "NotifyVMexitOptio= n", - &NotifyVmexitOption_lookup, - kvm_arch_get_notify_vmexit, - kvm_arch_set_notify_vmexit); - object_class_property_set_description(oc, "notify-vmexit", - "Enable notify VM exit"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "notify-vmexit", + .description =3D "Enable notify VM exit", + .qapi_type =3D &NotifyVmexitOption_type_info, + .get =3D kvm_arch_get_notify_vmexit, + .set =3D kvm_arch_set_notify_vmexit, + )); =20 object_class_property_add(oc, "notify-window", "uint32", kvm_arch_get_notify_window, @@ -7124,13 +7127,14 @@ void kvm_arch_accel_class_init(ObjectClass *oc) object_class_property_set_description(oc, "xen-evtchn-max-pirq", "Maximum number of Xen PIRQs"); =20 - object_class_property_add_enum(oc, "honor-guest-pat", "OnOffAuto", - &OnOffAuto_lookup, - kvm_arch_get_honor_guest_pat, - kvm_arch_set_honor_guest_pat); - object_class_property_set_description(oc, "honor-guest-pat", - "Disable KVM quirk that ignores = guest PAT " - "memory type settings (default: = auto)"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "honor-guest-pat", + .description =3D "Disable KVM quirk that ignores guest PAT " + "memory type settings (default: auto)", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D kvm_arch_get_honor_guest_pat, + .set =3D kvm_arch_set_honor_guest_pat, + )); } =20 void kvm_set_max_apic_id(uint32_t max_apic_id) diff --git a/ui/dbus.c b/ui/dbus.c index 794b65c4ada..a9cc0c48ac7 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -37,6 +37,7 @@ #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-ui.h" #include "trace.h" =20 #include "dbus.h" @@ -448,9 +449,12 @@ dbus_display_class_init(ObjectClass *oc, const void *d= ata) object_class_property_add_bool(oc, "p2p", get_dbus_p2p, set_dbus_p2p); object_class_property_add_str(oc, "addr", get_dbus_addr, set_dbus_addr= ); object_class_property_add_str(oc, "audiodev", get_audiodev, set_audiod= ev); - object_class_property_add_enum(oc, "gl-mode", - "DisplayGLMode", &DisplayGLMode_lookup, - get_gl_mode, set_gl_mode); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "gl-mode", + .qapi_type =3D &DisplayGLMode_type_info, + .get =3D get_gl_mode, + .set =3D set_gl_mode, + )); } =20 #define TYPE_CHARDEV_VC "chardev-vc" diff --git a/ui/input-linux.c b/ui/input-linux.c index 74bc8511428..5014a306e7d 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" @@ -507,10 +508,12 @@ static void input_linux_class_init(ObjectClass *oc, c= onst void *data) object_class_property_add_bool(oc, "repeat", input_linux_get_repeat, input_linux_set_repeat); - object_class_property_add_enum(oc, "grab-toggle", "GrabToggleKeys", - &GrabToggleKeys_lookup, - input_linux_get_grab_toggle, - input_linux_set_grab_toggle); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "grab-toggle", + .qapi_type =3D &GrabToggleKeys_type_info, + .get =3D input_linux_get_grab_toggle, + .set =3D input_linux_set_grab_toggle, + )); } =20 static const TypeInfo input_linux_info =3D { --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420822; cv=none; d=zohomail.com; s=zohoarc; b=gsmUJi5B9TVkTy3bOzZWTDQu6+I5P8DA1qsmX6NepNU240y1c3RU86GQsCK88TmjgKJB1Jyi7LlDDDDbPEZNR0HZBQd/ySnTS+wVFAvvRVi9FhNt7hvOFMIY5M/mWtRbVOQ6bSt3YDnGOAtwsUtqwMwyvRdMQG6y8l8OPOkX5/s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420822; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=da49YcjtyzZ7IWUjNAm74XjosgyIF8J3ZpDMLUAi2dw=; b=W64tqyvMKxhNTRW9dXkQX1g99kkdiOPru9Paym2ZbYiyPKeKYwIuX6ybYG46WU3mX65jV0hXpf+CNuJ8PIRnbnJlSBi5nL0IUR+QrDeLi8UvuJ4vMBq2L6k7N8w3KB5Xb5FMApTVDSUjsyBYcUv72gOfoS1fiU60j6Kja11Wdkk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420822442823.3017210834539; Sun, 10 May 2026 06:47:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4UU-0002H0-4N; Sun, 10 May 2026 09:46:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4U6-0001RP-Gc for qemu-devel@nongnu.org; Sun, 10 May 2026 09:46:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4U2-0004si-5u for qemu-devel@nongnu.org; Sun, 10 May 2026 09:46:17 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-533-4ygrH8IGNcecsuChCZmEFA-1; Sun, 10 May 2026 09:46:11 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 68968195608B for ; Sun, 10 May 2026 13:46:10 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0E5651800374; Sun, 10 May 2026 13:46:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=da49YcjtyzZ7IWUjNAm74XjosgyIF8J3ZpDMLUAi2dw=; b=E4BD8pyevrVoDvHyp7EtAGef8db2PxjIF968GCTi6nqGKF0CWQPuB1cpsqk5gXY5YF9u5n G6yP68T6ll/rmqFDAxlmnZsIAxKi7FrusY8IubBi4XErBuEG7Q/rD2i3JAq+EaMcUHtZDj NNwpVjhAGkQuH8o7YT7wchkzVeY/kwc= X-MC-Unique: 4ygrH8IGNcecsuChCZmEFA-1 X-Mimecast-MFC-AGG-ID: 4ygrH8IGNcecsuChCZmEFA_1778420770 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:10 +0400 Subject: [PATCH 13/54] qom: remove old enum property registration API MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-13-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=7006; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=ptvW9hb7yA9/uf7GEQJoTFW9arADjSwFMNUBwLBxgVw=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItv0ZxSXZ+eH5Ta4L1wlqAcjkmjLQ8Cgekby kErwQHY/0OJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbwAKCRDa6OEJdZac 5fF/EACiO7OVT/El9ro9vX2Ar7KJsvzQH1UEp80fiK1eQWHnqSeCretWzk1d1JWpyjUNJS1PJuj 89DxmGOzHIosnligZYs7vEU9ewikefsT6cLuctjRo5hR6ASQTBtYD+++9Hn0UWpgjqK2Gm2j04/ JC+WJlAJBmatjz016ZI5ZWQvmif0DzYSfIETq8/+rf4BbRMeOoJJ/fWrU+TpxHwnrYwTTpqkIe+ /krjR43nOeeXtqcDPYXVPHn35xAKxzAgdPTGRWJVwVSpC0+cPRG09Ji9xqO7u24yTlzhlHXwT8t +uf/xBcWhcHnU7J7MzjyzSSYjTskB16Irgd0+jhRuxbxfvaZ2V3h+9zN+hd1Fp439ddbYVAsoVf ey9zQ6Fh33D8Bd1E7sLG2UrPieCvUiBK4D/VmWIiazC6sUtx90uesTV/PZQghyj0qyrwwJeDyFP 8+K4XWNQS3cDntX+6qqs2SlHFZEybVRW2sJB9MV5IY87k+6EnsOGVrgw4lNOhJ13hghMNE9i4u8 RLTPDzRr8G6wqwT5pdWGcqJIctNh9QPuyK/vZ7A76nJ1Fb7jEUtGX6zIUHKvIjMCdTd0OmLUR3c rehLC68qiGP7WUHKMYImXi5qG6X2XBusq7LD6Ynoc9I1Kqa41m67VctXoYSq9QBj2ZKTFZvUxCj c7xdhzifvdihoag== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=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: 1778420823592158500 Now that all callers use object_class_property_add_qapi_enum(), remove the legacy object_property_add_enum() and object_class_property_add_enum() functions along with their EnumProperty struct and property_get_enum / property_set_enum helpers. Simplify object_property_get_enum() to assert on qapi_type rather than falling back to the old EnumProperty opaque data. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/qom/object.h | 31 ++----------------- qom/object.c | 84 ++----------------------------------------------= ---- 2 files changed, 5 insertions(+), 110 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 0eaa02688b0..14238e4b844 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1577,12 +1577,12 @@ char *object_get_canonical_path(const Object *obj); * because it was ambiguous, or %NULL. Set to %false on success. * * There are two types of supported paths--absolute paths and partial path= s. - *=20 + * * Absolute paths are derived from the root object and can follow child<> = or * link<> properties. Since they can follow link<> properties, they can be * arbitrarily long. Absolute paths look like absolute filenames and are * prefixed with a leading slash. - *=20 + * * Partial paths look like relative filenames. They do not begin with a * prefix. The matching rules for partial paths are subtle but designed t= o make * specifying objects easy. At each level of the composition tree, the pa= rtial @@ -1797,33 +1797,6 @@ ObjectProperty *object_class_property_add_bool(Objec= tClass *klass, bool (*get)(Object *, Error **), void (*set)(Object *, bool, Error **)); =20 -/** - * object_property_add_enum: - * @obj: the object to add a property to - * @name: the name of the property - * @typename: the name of the enum data type - * @lookup: enum value namelookup table - * @get: the getter or %NULL if the property is write-only. - * @set: the setter or %NULL if the property is read-only - * - * Add an enum property using getters/setters. This function will add a - * property of type '@typename'. - * - * Returns: The newly added property on success, or %NULL on failure. - */ -ObjectProperty *object_property_add_enum(Object *obj, const char *name, - const char *typename, - const QEnumLookup *lookup, - int (*get)(Object *, Error **), - void (*set)(Object *, int, Error **)); - -ObjectProperty *object_class_property_add_enum(ObjectClass *klass, - const char *name, - const char *typename, - const QEnumLookup *lookup, - int (*get)(Object *, Error **), - void (*set)(Object *, int, Error **)); - /** * struct QapiEnumProp - Descriptor for a QOM property backed by a QAPI en= um type * diff --git a/qom/object.c b/qom/object.c index 164907289a6..48d7a88ee43 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1055,7 +1055,7 @@ static void object_class_foreach_tramp(gpointer key, = gpointer value, return; } =20 - if (data->implements_type &&=20 + if (data->implements_type && !object_class_dynamic_cast(k, data->implements_type)) { return; } @@ -1603,12 +1603,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) { @@ -1632,12 +1626,8 @@ int object_property_get_enum(Object *obj, const char= *name, return -1; } =20 - if (prop->qapi_type) { - ret =3D qapi_enum_parse(prop->qapi_type->lookup, str, -1, errp); - } else { - EnumProperty *enumprop =3D prop->opaque; - ret =3D qapi_enum_parse(enumprop->lookup, str, -1, errp); - } + assert(prop->qapi_type); + ret =3D qapi_enum_parse(prop->qapi_type->lookup, str, -1, errp); g_free(str); =20 return ret; @@ -2362,74 +2352,6 @@ object_class_property_add_bool(ObjectClass *klass, c= onst char *name, prop); } =20 -static void property_get_enum(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - EnumProperty *prop =3D opaque; - int value; - Error *err =3D NULL; - - value =3D prop->get(obj, &err); - if (err) { - error_propagate(errp, err); - return; - } - - visit_type_enum(v, name, &value, prop->lookup, errp); -} - -static void property_set_enum(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - EnumProperty *prop =3D opaque; - int value; - - if (!visit_type_enum(v, name, &value, prop->lookup, errp)) { - return; - } - prop->set(obj, value, errp); -} - -ObjectProperty * -object_property_add_enum(Object *obj, const char *name, - const char *typename, - const QEnumLookup *lookup, - int (*get)(Object *, Error **), - void (*set)(Object *, int, Error **)) -{ - EnumProperty *prop =3D g_malloc(sizeof(*prop)); - - prop->lookup =3D lookup; - prop->get =3D get; - prop->set =3D set; - - return object_property_add(obj, name, typename, - get ? property_get_enum : NULL, - set ? property_set_enum : NULL, - property_release_data, - prop); -} - -ObjectProperty * -object_class_property_add_enum(ObjectClass *klass, const char *name, - const char *typename, - const QEnumLookup *lookup, - int (*get)(Object *, Error **), - void (*set)(Object *, int, Error **)) -{ - EnumProperty *prop =3D g_malloc(sizeof(*prop)); - - prop->lookup =3D lookup; - prop->get =3D get; - prop->set =3D set; - - return object_class_property_add(klass, name, typename, - get ? property_get_enum : NULL, - set ? property_set_enum : NULL, - NULL, - prop); -} - static void get_qapi_enum(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420846; cv=none; d=zohomail.com; s=zohoarc; b=RyUG3GR1YxxAXVOPU67U1wqAgQme/zuVZpmCfqjfWYwBNreUaitAzs0URlnrqPFhC4cc2vdFDTJGU6dyXGju1NhNgmnbE3YIk4TOYRYJ7dkERyAQIR+4+k5GI0qsM29pkGEdjr72Yih6wJ1Hh3a7UwM8ggSLRqj/sQwTQ5hfD+w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420846; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3k5GcK7tkohWojWEr3yv8uJGegYcRXKyOwYa76tqI7k=; b=EQX4z0rY+qwp6BeTWthL/SOfO7ClxMlQuYmNOSgi4icck7s/BxZb3dEReZHM4s7q/nIIKAgGfDkE3blaLzgH/vZX+yKhkgWbgUPHYCLLQ/CFVS6YyeWWtBrECgvdOcGWGY1tGoWrVnRDRAAuOHwz3hRYcJ6qrTPAWWmdL6eF/X8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420846677788.168135814035; Sun, 10 May 2026 06:47:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4UV-0002T1-7A; Sun, 10 May 2026 09:46:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4UJ-0001h6-KL for qemu-devel@nongnu.org; Sun, 10 May 2026 09:46:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4UH-0004uG-1Z for qemu-devel@nongnu.org; Sun, 10 May 2026 09:46:31 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-232-oLXIuUvkNQi-8fbJvdv3mg-1; Sun, 10 May 2026 09:46:23 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1BED81800344 for ; Sun, 10 May 2026 13:46:22 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 37B643002D31; Sun, 10 May 2026 13:46:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3k5GcK7tkohWojWEr3yv8uJGegYcRXKyOwYa76tqI7k=; b=MrdSGz/9mQte/8Z7aSBALblH4jPWJG6urWqjmILOhTvhl4HdJ73D8MIUpLeo/p1DQnFfC4 clhtM6Hhxc5D63VPXRKWJA86rMbzSnVo2RrzWztqD5AZuShncA3iYRog6OW1YGCjdu5q9l 9pg83BUC5umIY/n+kT3ZzPfpRAfFHi4= X-MC-Unique: oLXIuUvkNQi-8fbJvdv3mg-1 X-Mimecast-MFC-AGG-ID: oLXIuUvkNQi-8fbJvdv3mg_1778420782 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:11 +0400 Subject: [PATCH 14/54] qom: convert struct properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-14-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=11042; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=eSC9/qItjtj4PED9ZnqsEUvcHj++6ICjnFw742cBUkg=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItvD1HhLlaFVFDg+s0YZcsYAeMixlcvsxo8+ nT3EY71tzqJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbwAKCRDa6OEJdZac 5TXAD/9zujifDaB1tazKbX5MQG1RpqkgENZQhhDLMFfjdq0NTTkfn8AFcBvshoUsftBIWBgMNw4 HvaCkg3SmLcJnCvZmSZfgJruewpaK3Zln3VND7ezRIA5x4FNez+EY5QBEYr+S79m8RHFIrwb3tW pM9ZWo31xCj8jodaai59WK/QPLZBLA8r01KmqBr4OrCL5zzOBE/oyOghDGghZg3t+3UIj81tgSn fhuzGR3mZy7x71Pzmyj5Gli7uydziyLnauUvSQrsnM2xQ3ERXFgdGAaRTjKvo1vazUUH4qFiF3z CHQbrL2bL57gH7mOLM1F9/EOP0uN28wk422JXxET/Zz05LhxhvTVT3J7gG8aKtv+Jms7P2002oG ZyIZ5aE8ErMvW7E3fSbUoI54bXPZbGu+nyiivG6ed10QakjmxYVSIdUmeENivK/KNAprx5RPz5R ZChADmcciK6GRQeoAPwbyEODH+TSAeAP7YLlpyKrDB4ZwfF4crM14ZDNKWAcGu8DtoY/OoVlAWx 1E6qhN4HZFSLcuOqado8h8iNM6VgsaAfJYX70ruTVBO6F0hdLmC1DcsAIbDRuTyCOIP9HmbwbPp yTsAg+1bjRG5rj3LSdLAEMxJs1HUSQZJfoHGp/7APa//7B31gmgFE4ZMGrDj/7QPqWKxZkkvpKj balbgZmcsQApZXQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420849265154100 Convert all callers of object_property_add() and object_class_property_add() that register struct-typed properties with QAPI visitor-based getters/setters to use object_property_add_qapi() and object_class_property_add_qapi() instead. This replaces the manual string type name with a reference to the generated QAPITypeInfo constant, enabling QMP introspection to report accurate QAPI type information for struct properties. Existing getters/setters are preserved unchanged. The cxl-fmw property type is corrected from "CXLFixedMemoryWindow" (not a real QAPI type) to "CXLFixedMemoryWindowOptions". Signed-off-by: Marc-Andr=C3=A9 Lureau --- authz/list.c | 2 +- chardev/char-socket.c | 3 ++- hw/core/machine.c | 11 +++++++---- hw/cxl/cxl-host.c | 4 +++- hw/remote/vfio-user-obj.c | 5 +++-- hw/vfio-user/pci.c | 5 +++-- target/i386/cpu.c | 11 ++++++++--- target/i386/kvm/tdx.c | 4 +++- target/s390x/cpu-system.c | 4 +++- 9 files changed, 33 insertions(+), 16 deletions(-) diff --git a/authz/list.c b/authz/list.c index 363b2ee12c9..ed3d346004c 100644 --- a/authz/list.c +++ b/authz/list.c @@ -128,7 +128,7 @@ qauthz_list_class_init(ObjectClass *oc, const void *dat= a) .set =3D qauthz_list_prop_set_policy, )); =20 - object_class_property_add(oc, "rules", "QAuthZListRule", + object_class_property_add_qapi(oc, "rules", &QAuthZListRule_type_info, qauthz_list_prop_get_rules, qauthz_list_prop_set_rules, NULL, NULL); diff --git a/chardev/char-socket.c b/chardev/char-socket.c index e064b105c50..5268e037872 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" @@ -1569,7 +1570,7 @@ static void char_socket_class_init(ObjectClass *oc, c= onst void *data) cc->chr_listener_cleanup =3D tcp_chr_listener_cleanup; cc->chr_get_filename =3D tcp_chr_get_filename; =20 - object_class_property_add(oc, "addr", "SocketAddress", + object_class_property_add_qapi(oc, "addr", &SocketAddress_type_info, char_socket_get_addr, NULL, NULL, NULL); =20 diff --git a/hw/core/machine.c b/hw/core/machine.c index 1b661fd36ae..1dd5375caea 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" @@ -1094,19 +1095,20 @@ static void machine_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, "dumpdtb", "Dump current dtb to a file and quit"); =20 - object_class_property_add(oc, "boot", "BootConfiguration", + object_class_property_add_qapi(oc, "boot", &BootConfiguration_type_inf= o, machine_get_boot, machine_set_boot, NULL, NULL); object_class_property_set_description(oc, "boot", "Boot configuration"); =20 - object_class_property_add(oc, "smp", "SMPConfiguration", + object_class_property_add_qapi(oc, "smp", &SMPConfiguration_type_info, machine_get_smp, machine_set_smp, NULL, NULL); object_class_property_set_description(oc, "smp", "CPU topology"); =20 - object_class_property_add(oc, "smp-cache", "SmpCachePropertiesWrapper", + object_class_property_add_qapi(oc, "smp-cache", + &SmpCachePropertiesWrapper_type_info, machine_get_smp_cache, machine_set_smp_cache, NULL, NULL); object_class_property_set_description(oc, "smp-cache", "Cache properties list for SMP machine"); @@ -1188,7 +1190,8 @@ static void machine_class_init(ObjectClass *oc, const= void *data) "Set RAM backend" "Valid value is ID of hostmem ba= sed backend"); =20 - object_class_property_add(oc, "memory", "MemorySizeConfiguration", + object_class_property_add_qapi(oc, "memory", + &MemorySizeConfiguration_type_info, machine_get_mem, machine_set_mem, NULL, NULL); object_class_property_set_description(oc, "memory", diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index a94b893e999..87067b94b34 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" @@ -350,7 +351,8 @@ void cxl_machine_init(Object *obj, CXLState *state) "Set on/off to enable/disable " "CXL instantiation"); =20 - object_property_add(obj, "cxl-fmw", "CXLFixedMemoryWindow", + object_property_add_qapi(obj, "cxl-fmw", + &CXLFixedMemoryWindowOptions_type_info, machine_get_cfmw, machine_set_cfmw, NULL, state); object_property_set_description(obj, "cxl-fmw", diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c index 12ecdab6dea..d0d0a7be7d2 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" @@ -928,8 +929,8 @@ static void vfu_object_class_init(ObjectClass *klass, c= onst void *data) =20 k->nr_devs =3D 0; =20 - object_class_property_add(klass, "socket", "SocketAddress", NULL, - vfu_object_set_socket, NULL, NULL); + object_class_property_add_qapi(klass, "socket", &SocketAddress_type_in= fo, + NULL, vfu_object_set_socket, NULL, NULL); object_class_property_set_description(klass, "socket", "SocketAddress " "(ex: type=3Dunix,path=3D/tmp/so= ck). " diff --git a/hw/vfio-user/pci.c b/hw/vfio-user/pci.c index facc79727ac..a4427ed0353 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 @@ -468,8 +469,8 @@ static void vfio_user_pci_class_init(ObjectClass *klass= , const void *data) device_class_set_legacy_reset(dc, vfio_user_pci_reset); device_class_set_props(dc, vfio_user_pci_properties); =20 - object_class_property_add(klass, "socket", "SocketAddress", NULL, - vfio_user_pci_set_socket, NULL, NULL); + object_class_property_add_qapi(klass, "socket", &SocketAddress_type_in= fo, + NULL, vfio_user_pci_set_socket, NULL, NULL); object_class_property_set_description(klass, "socket", "SocketAddress (UNIX sockets onl= y)"); =20 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 97c66c22262..a98bcc218ba 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -34,6 +34,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" @@ -10506,10 +10508,12 @@ static void x86_cpu_initfn(Object *obj) =20 x86_cpu_init_default_topo(cpu); =20 - object_property_add(obj, "feature-words", "X86CPUFeatureWordInfo", + object_property_add_qapi(obj, "feature-words", + &X86CPUFeatureWordInfo_type_info, x86_cpu_get_feature_words, NULL, NULL, (void *)env->features); - object_property_add(obj, "filtered-features", "X86CPUFeatureWordInfo", + object_property_add_qapi(obj, "filtered-features", + &X86CPUFeatureWordInfo_type_info, x86_cpu_get_feature_words, NULL, NULL, (void *)cpu->filtered_features); =20 @@ -10969,7 +10973,8 @@ static void x86_cpu_common_class_init(ObjectClass *= oc, const void *data) NULL, NULL); =20 #if !defined(CONFIG_USER_ONLY) - object_class_property_add(oc, "crash-information", "GuestPanicInformat= ion", + object_class_property_add_qapi(oc, "crash-information", + &GuestPanicInformation_type_info, x86_cpu_get_crash_info_qom, NULL, NULL, NULL= ); #endif =20 diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c index 4714c9d514e..3bdecbe9c5d 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" @@ -1572,7 +1573,8 @@ static void tdx_guest_init(Object *obj) tdx_guest_get_mrownerconfig, tdx_guest_set_mrownerconfig); =20 - object_property_add(obj, "quote-generation-socket", "SocketAddress", + object_property_add_qapi(obj, "quote-generation-socket", + &SocketAddress_type_info, tdx_guest_get_qgs, tdx_guest_set_qgs, NULL, NULL); diff --git a/target/s390x/cpu-system.c b/target/s390x/cpu-system.c index 285f5999661..349f2198c93 100644 --- a/target/s390x/cpu-system.c +++ b/target/s390x/cpu-system.c @@ -30,6 +30,7 @@ #include "system/reset.h" #include "qemu/timer.h" #include "trace.h" +#include "qapi/qapi-type-infos-run-state.h" #include "qapi/qapi-visit-run-state.h" #include "system/hw_accel.h" =20 @@ -130,7 +131,8 @@ void s390_cpu_system_init(Object *obj) S390CPU *cpu =3D S390_CPU(obj); =20 cs->start_powered_off =3D true; - object_property_add(obj, "crash-information", "GuestPanicInformation", + object_property_add_qapi(obj, "crash-information", + &GuestPanicInformation_type_info, s390_cpu_get_crash_info_qom, NULL, NULL, NULL); cpu->env.tod_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_tod_timer, cpu); --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420841; cv=none; d=zohomail.com; s=zohoarc; b=AjHdZnJhweLYk9A6gxYjmJVIMM8pQoQPWxZqcuBLuvqVtedVQnIEUz9F7wOJSdLtDaLaWUudegEzTNq0z97/oNPr5uJv8jXh/owWNWGNZJvqMwHILf8znY5OKAec+uWcC+XCg8lbHG1OopHuEfzppyjnSKqpwi/kV1evXO9vv9o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420841; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=FJVPgFmkndqxhAeNe76OT5PkkkXmq2X5amAic4RIpMo=; b=LnsanyHsdbnscY4pV78B73gj44otJdaIXQbtMSm4HeJG3vpGXDDVC7a9CU4zETU4Y2OwlbCkzErbSef3UL1qdyNHdsKNlGKWaG5chJ8TtolmuAhVAe4hUiOvzSeC4n2bcppNPRc6CFvSL71cgQm+DgV0jaiA6pYz/WmAKOUcUWs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420841486994.6391274826209; Sun, 10 May 2026 06:47:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4Ul-0003DF-QK; Sun, 10 May 2026 09:47:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4UT-0002CB-Iy for qemu-devel@nongnu.org; Sun, 10 May 2026 09:46:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4US-0004w5-0P for qemu-devel@nongnu.org; Sun, 10 May 2026 09:46:41 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-62-btbGTpBtMZatRjv0xhoKtw-1; Sun, 10 May 2026 09:46:37 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 231C718005B3 for ; Sun, 10 May 2026 13:46:37 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C3BC218004A3; Sun, 10 May 2026 13:46:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FJVPgFmkndqxhAeNe76OT5PkkkXmq2X5amAic4RIpMo=; b=Du+n02s4iDVkWW30bq+jPOrtfhcFSObPV6T8Av2P1j4082L+xEl+4g7mCwNa3pDZ95hwId 1q3Dpj+XHMIoFA8ewN56Pn4pdLy6AUcUhS3Y//9ntm3tbocGWqu/iCee1ipbVkI437XgyV xBILFxxsPf3xbnd55bjabKg6DpTm0RI= X-MC-Unique: btbGTpBtMZatRjv0xhoKtw-1 X-Mimecast-MFC-AGG-ID: btbGTpBtMZatRjv0xhoKtw_1778420797 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:12 +0400 Subject: [PATCH 15/54] qom: convert struct properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-15-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1701; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=SrT2x1EQeUZfUkznMNB+UxE+epWiRHNKJ0FEXJcLuWE=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItvWHt2hMCrZ9nGCVXdEYPTn2QN0ymay5jIP QMMfV7FHVeJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbwAKCRDa6OEJdZac 5YYYEACIcBMr2WU0JQ4y293rozmEYD9g5G4hBeofsW77c2EMWRHNFi5TkLhlyyhZC5wflm62EMX ZljS3X8m/aQIYwWPRUkCzvCigGAX/dT1Gaca1x36fZaaQgySvn+s42ujb8xxGXbOIcmdG86CyqQ kzcQBcKd9Cvtm0/UTOUklhyW7qZP/0eFRikfBt4yPQm23e4GQPwdYLofTQgaE+Nn3Nd2qLaMhLD vunkV6d0VOOCokbQddBq07HvHCY8QfsrzBvW5qNg5ZpEaECWS/CXQy7X8+JioxU+BK/3G37xLTP +Z5xD90pccViZjz1Oe+Z/1HzSGWBbPq4NAmh3KqbmeiQTPlLXcmzU7IEORS2Eflk1QMIDhoMm2u VmNbcP9H5fCOLmXBc7o6tItKnaI5zOTUG0krT4F/6yIx9MajQQzo8RQVbsh+F4pbETAHtVvCu0W JvTbZBJSNVDBq2LFp+nMCvkafDALiq+4rcyOWtzMU5zyDVokyq4yBvHeEUDjrM4dQEN96JCbPtM ApsA2mpPuFFH27G2VeWa4EnzBRq9x0QiNdJNO8tryk0ofMs0pfE5Ogn0xow5GdaxWzNdSXa+Xqw /m5ydkue60y2DWpakvmeE3b5OIXOu+rQUipTSpQAeNhqANCp3t5+5igpdeYK8qeOYJgevKRU9US qVxAlojBnWZ3eBg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420843285154100 Convert all callers of object_property_add() and object_class_property_add() that register struct-typed properties with QAPI visitor-based getters/setters to use object_property_add_qapi() and object_class_property_add_qapi() instead. This replaces the manual string type name with a reference to the generated QAPITypeInfo constant, enabling QMP introspection to report accurate QAPI type information for struct properties. Existing getters/setters are preserved unchanged. The cxl-fmw property type is corrected from "CXLFixedMemoryWindow" (not a real QAPI type) to "CXLFixedMemoryWindowOptions". Signed-off-by: Marc-Andr=C3=A9 Lureau --- block/throttle-groups.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/block/throttle-groups.c b/block/throttle-groups.c index 4b1b1944c20..b161576432a 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" @@ -985,8 +986,8 @@ static void throttle_group_obj_class_init(ObjectClass *= klass, } =20 /* ThrottleLimits */ - object_class_property_add(klass, - "limits", "ThrottleLimits", + object_class_property_add_qapi(klass, + "limits", &ThrottleLimits_type_info, throttle_group_get_limits, throttle_group_set_limits, NULL, NULL); --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420858; cv=none; d=zohomail.com; s=zohoarc; b=BWwLlye8wpY7HRCOYxr/DT5ShHq9djuAHU4plCTKat76+cetHTwzc+r2K2S6IQhZzXr5utzBsJK4HYQc+pf+FuTEsCmw/xz27VkLVmW0eLdYAPrI34omdTwn6coKvVudm2GbxnjWbxTjOQ16WOk8hMOsfbyZsjIPPX0nJS+5S7I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420858; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=i8rs449LfDTxHtjHkOxpL0qIgNKWl9rdFoq/MMZVE5w=; b=naH+X+w29Q0yaZYW5LXwxkL/Mysc2eD2/vjEHk6xlsGfPtlJ5vSMPeC72OWPqtHuQNYVGlVx7m6KahaAz4CCo/+0Ts2gVzDmecGQGO24J5reIiy/ESdwhocg7cphRHDJ264bMSukheYH5VIshWx6/CaeQ1Zu1hENpmU1UwiCUW4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420858043426.6798086465733; Sun, 10 May 2026 06:47:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4V4-0003hI-7W; Sun, 10 May 2026 09:47:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Ue-0003Gb-Gr for qemu-devel@nongnu.org; Sun, 10 May 2026 09:46:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Ub-0004wi-5i for qemu-devel@nongnu.org; Sun, 10 May 2026 09:46:50 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-570-WgN0zaiDPeCuJ1F3zn7s2g-1; Sun, 10 May 2026 09:46:46 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 86C6319541BA for ; Sun, 10 May 2026 13:46:45 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1C4F71803A8E; Sun, 10 May 2026 13:46:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i8rs449LfDTxHtjHkOxpL0qIgNKWl9rdFoq/MMZVE5w=; b=JZIc1GKWK0G0t2/lNucmKXhbKh4+YW3+JR+v0m9atJ3Md70JeqqxMxq+vh8W+km82SgxQy xVzaQHjuaiDA0KeL/muS2zpczo8qqMQiA2C527OyUX4WHUZuQcmFnk4qMO3fr4DBQ36wNV q1zzl5aQmmHpZ1N0fVQkdLiGuNpM2mE= X-MC-Unique: WgN0zaiDPeCuJ1F3zn7s2g-1 X-Mimecast-MFC-AGG-ID: WgN0zaiDPeCuJ1F3zn7s2g_1778420805 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:13 +0400 Subject: [PATCH 16/54] x86: convert OnOffAuto properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-16-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=6517; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=NrLhEHoFQXaokeIgTjPY6OWSe2IOgXlTauMOsYsWoy0=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItvZBhDFWizmhqdg64Gyy1zoOkye6L8zfVdV mu5YgLCDAmJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbwAKCRDa6OEJdZac 5Qu/D/0XtlTz2Z8AItbe1ATDSHyeUtI/Q+ko0YmnfzBiKsS2iPhUdRANAcb/RzEXuLTjxYJahT/ o7/Aznn669tIWkSVjTJoDAiN79VsiJa9GxC3sv0+z9xhEwBjUlgpENdLfF4OcyQXuk0XxSiHfm+ vMEz2XHkLCoEJo4X50179xMGzeQfJ4HVIcNaCOvS46iRq/t/mDB9WzpufxCdITEEapxwIBFq4/X fI5+WwnrLyAFeNWwKak08/oWL3O3CcT2AUzo/Q+aHJX3nU4ivX6OXfbrLxp+v5gEFfyMrNnDko3 v8MFsURGg1D6njTQywzqM4FItwgK7tPNEndQuG0rkFh8HMUJivT4plGZN9Q9nrtKRZkH2KyI3WP 3qMJpggc8f0pcedPm1Z273+Zv2hue/Lhc3khkM/fIIH3BZEL6qHKi0IGopGl7p0PU6ic3H0ab7Q v/lT3Sokls3EUZszTYnHAHbmhURR4ZVCSqv0SPP8vMuS3yx0RFJOEQza2Oh5/MSVXZgudNRu9j7 wc+CRhezD3BDr66UwWNXJdgOxyGToq5ztpkIem3KDC0e8JdRIt4RIY+kB5vlXHO1yXHfSXbA7Hc 7LUUW6OqOPqE65rJUmQ/+mF3OpowmQYJw7Vk2CGfYvVUH22VDI90kHx5X00tl2ZhjSJlhR/YF9/ BCYEUDqnwtyaTIw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420859677158500 Convert the smm, acpi, pit, and pic OnOffAuto properties from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/i386/x86.c | 110 +++++++++++++++++++++++++-----------------------------= ---- 1 file changed, 48 insertions(+), 62 deletions(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 01872cba073..b76926a00bd 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) @@ -383,31 +363,37 @@ static void x86_machine_class_init(ObjectClass *oc, c= onst void *data) mc->kvm_type =3D x86_kvm_type; nc->nmi_monitor_handler =3D x86_nmi; =20 - object_class_property_add(oc, X86_MACHINE_SMM, "OnOffAuto", - x86_machine_get_smm, x86_machine_set_smm, - NULL, NULL); - object_class_property_set_description(oc, X86_MACHINE_SMM, - "Enable SMM"); - - object_class_property_add(oc, X86_MACHINE_ACPI, "OnOffAuto", - x86_machine_get_acpi, x86_machine_set_acpi, - NULL, NULL); - object_class_property_set_description(oc, X86_MACHINE_ACPI, - "Enable ACPI"); - - object_class_property_add(oc, X86_MACHINE_PIT, "OnOffAuto", - x86_machine_get_pit, - x86_machine_set_pit, - NULL, NULL); - object_class_property_set_description(oc, X86_MACHINE_PIT, - "Enable i8254 PIT"); - - object_class_property_add(oc, X86_MACHINE_PIC, "OnOffAuto", - x86_machine_get_pic, - x86_machine_set_pic, - NULL, NULL); - object_class_property_set_description(oc, X86_MACHINE_PIC, - "Enable i8259 PIC"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D X86_MACHINE_SMM, + .description =3D "Enable SMM", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D x86_machine_get_smm, + .set =3D x86_machine_set_smm, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D X86_MACHINE_ACPI, + .description =3D "Enable ACPI", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D x86_machine_get_acpi, + .set =3D x86_machine_set_acpi, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D X86_MACHINE_PIT, + .description =3D "Enable i8254 PIT", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D x86_machine_get_pit, + .set =3D x86_machine_set_pit, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D X86_MACHINE_PIC, + .description =3D "Enable i8259 PIC", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D x86_machine_get_pic, + .set =3D x86_machine_set_pic, + )); =20 object_class_property_add_str(oc, X86_MACHINE_OEM_ID, x86_machine_get_oem_id, --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420866; cv=none; d=zohomail.com; s=zohoarc; b=cIzWplut+DsD97gzmqWgUjZuk0MyeAPWsSC10z9jalFQfS7KfWgPZz0WjAOK4+dijDNV7eg/yS5tj2pmD0JPEluo8If2lpXEhvmGXgl7ZhNWhZ8ec72gla6tRHIx0hgD8RLivvSacxzIBj1a/eSLRAci6mrb2PS74dj8oVPX+8M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420866; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7u9zogX3P0JAeuJRmCXuJczbBXaLBM6jDEKlOB3rLiQ=; b=HimgLUJZTWTOcgICrYk0HsNBgLwHiCVGfPz9LYrA3sIlVkCtxHPGwQZA2+LL7KaUAxbRNXqKnBaIMn9uV5WG4k+e97/UjMQPK5HAvbdEpuwXJEgSwQLnlbPih7s3184o0qDE4wUoY6XksHVKoMKUFffhM3VUAAouAZM5QqRGCKQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420866363690.4482662787132; Sun, 10 May 2026 06:47:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4VG-0003vr-4O; Sun, 10 May 2026 09:47:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Um-0003NI-Ht for qemu-devel@nongnu.org; Sun, 10 May 2026 09:47:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Uj-00053r-GH for qemu-devel@nongnu.org; Sun, 10 May 2026 09:46:59 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-311-Y6OjNzVjPM6Pgk17jMygHg-1; Sun, 10 May 2026 09:46:54 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EE3E01956095 for ; Sun, 10 May 2026 13:46:53 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B2E7B3002D30; Sun, 10 May 2026 13:46:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7u9zogX3P0JAeuJRmCXuJczbBXaLBM6jDEKlOB3rLiQ=; b=Ha2MsxaI1hsV0NhxgN6zbnkevvj3xpAPhAcL1ZATOJnBq+3miW0x7W8ZcYTY4B8UObqju2 1q2fTKB+UvXzDXbhrAqXgczJWKToJUi2vh9D6RHkndwJMjCQR4GKB2DJt3U13yIRrpPz0e JbFVWJIJr9FVxn8sg3xjtJrwHwh7hE0= X-MC-Unique: Y6OjNzVjPM6Pgk17jMygHg-1 X-Mimecast-MFC-AGG-ID: Y6OjNzVjPM6Pgk17jMygHg_1778420814 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:14 +0400 Subject: [PATCH 17/54] microvm: convert OnOffAuto properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-17-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=5488; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=Iu7GG3sr59ODnv4VSdfdXSvssxBqtJhK0LiuLiI+exg=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItv1fgWP5dQEgYigslvfPrCX18FvKpeMD3E1 zGYBYTbYqeJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbwAKCRDa6OEJdZac 5UBuD/0ZvgUI/Ctl/R8m8G81AwJDGsHw37XEvS0L7QgMGQn8ssze+Z7HYtrHy1Znh2AZ8DZMZCl VtcFnTZMwOeJ55/BIeFycxa+2NNQn7fHF0I+Z8RDzax/lyZKn4dNxVzuVbr/eltvr8mpJDTMFqj yC9+1JNc0F5eSj502UatXev0RQLoryJa86n1iGUSH78Mg42b0HXfuD39h6hz4n/ne0l4DFi0hKf IfVxT8oZegCK9FYHyuPVKBE6d7XfHnXZLg+vTeSOMI8Ggel6XGSi+WFFtwBw+oAsZq+TmOF42sA oDUPLlBylR8H/naoNDUDyapfoNYJBkSDt0z1VvMevAX4uWDEkDG6/mqxS2Vhi3r6h1OugUinPRy O4+f1Ry2askVn7T5FWHB6+qz3jAnAnUpKbQnLPUih2hBOq5XQ85Yx8fKBrmZ1DB3ABFnKlmw3/U G2lTt3droJqAfpKrLBcK3B2bE75Nb2vQZFepSzS1CMvuHhmMNokePWkb7zwg3WvWzzdS+KklGr3 a8jFhEaUHmXkheW5IuuSjCnCF2pUBTMyVP7sb6NJBBFJCYOAv3ekmGHQrex0r/WsOqZOB0RLKlf UVqZo6Gga55gvEDUDF3X8IMzVgXNVpeO7WRf2CAobh6ydswrdGEUVAylWWRQ62pcxQLGEHDWAfz t5/BGXR7DSdbqFg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=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: 1778420867792158500 Convert the rtc, pcie, and ioapic2 OnOffAuto properties from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/i386/microvm.c | 84 ++++++++++++++++++++++++---------------------------= ---- 1 file changed, 36 insertions(+), 48 deletions(-) diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index 5a7889f21b8..54bdde515b1 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -21,7 +21,7 @@ #include "qemu/units.h" #include "qapi/error.h" #include "qapi/visitor.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "system/system.h" #include "system/cpus.h" #include "system/numa.h" @@ -519,55 +519,40 @@ static void microvm_machine_reset(MachineState *machi= ne, ResetType type) } } =20 -static void microvm_machine_get_rtc(Object *obj, Visitor *v, const char *n= ame, - void *opaque, Error **errp) +static int microvm_machine_get_rtc(Object *obj, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - OnOffAuto rtc =3D mms->rtc; - - visit_type_OnOffAuto(v, name, &rtc, errp); + return mms->rtc; } =20 -static void microvm_machine_set_rtc(Object *obj, Visitor *v, const char *n= ame, - void *opaque, Error **errp) +static void microvm_machine_set_rtc(Object *obj, int value, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &mms->rtc, errp); + mms->rtc =3D value; } =20 -static void microvm_machine_get_pcie(Object *obj, Visitor *v, const char *= name, - void *opaque, Error **errp) +static int microvm_machine_get_pcie(Object *obj, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - OnOffAuto pcie =3D mms->pcie; - - visit_type_OnOffAuto(v, name, &pcie, errp); + return mms->pcie; } =20 -static void microvm_machine_set_pcie(Object *obj, Visitor *v, const char *= name, - void *opaque, Error **errp) +static void microvm_machine_set_pcie(Object *obj, int value, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &mms->pcie, errp); + mms->pcie =3D value; } =20 -static void microvm_machine_get_ioapic2(Object *obj, Visitor *v, const cha= r *name, - void *opaque, Error **errp) +static int microvm_machine_get_ioapic2(Object *obj, Error **errp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - OnOffAuto ioapic2 =3D mms->ioapic2; - - visit_type_OnOffAuto(v, name, &ioapic2, errp); + return mms->ioapic2; } =20 -static void microvm_machine_set_ioapic2(Object *obj, Visitor *v, const cha= r *name, - void *opaque, Error **errp) +static void microvm_machine_set_ioapic2(Object *obj, int value, Error **er= rp) { MicrovmMachineState *mms =3D MICROVM_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &mms->ioapic2, errp); + mms->ioapic2 =3D value; } =20 static bool microvm_machine_get_isa_serial(Object *obj, Error **errp) @@ -673,26 +658,29 @@ static void microvm_class_init(ObjectClass *oc, const= void *data) hc->unplug_request =3D microvm_device_unplug_request_cb; hc->unplug =3D microvm_device_unplug_cb; =20 - object_class_property_add(oc, MICROVM_MACHINE_RTC, "OnOffAuto", - microvm_machine_get_rtc, - microvm_machine_set_rtc, - NULL, NULL); - object_class_property_set_description(oc, MICROVM_MACHINE_RTC, - "Enable MC146818 RTC"); - - object_class_property_add(oc, MICROVM_MACHINE_PCIE, "OnOffAuto", - microvm_machine_get_pcie, - microvm_machine_set_pcie, - NULL, NULL); - object_class_property_set_description(oc, MICROVM_MACHINE_PCIE, - "Enable PCIe"); - - object_class_property_add(oc, MICROVM_MACHINE_IOAPIC2, "OnOffAuto", - microvm_machine_get_ioapic2, - microvm_machine_set_ioapic2, - NULL, NULL); - object_class_property_set_description(oc, MICROVM_MACHINE_IOAPIC2, - "Enable second IO-APIC"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D MICROVM_MACHINE_RTC, + .description =3D "Enable MC146818 RTC", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D microvm_machine_get_rtc, + .set =3D microvm_machine_set_rtc, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D MICROVM_MACHINE_PCIE, + .description =3D "Enable PCIe", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D microvm_machine_get_pcie, + .set =3D microvm_machine_set_pcie, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D MICROVM_MACHINE_IOAPIC2, + .description =3D "Enable second IO-APIC", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D microvm_machine_get_ioapic2, + .set =3D microvm_machine_set_ioapic2, + )); =20 object_class_property_add_bool(oc, MICROVM_MACHINE_ISA_SERIAL, microvm_machine_get_isa_serial, --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420912; cv=none; d=zohomail.com; s=zohoarc; b=cnqTEZsWw3b6OLGGdUiIbRmc/+6yUAyFKUugKqWkDCpw1EAawE2GJ0qNwt+gFlq8JSWUquo+gXwK+FQGEyT8EKoduoDFFf95oGDJQzEDhHCTrW37V3jsnWi1L+nSCUeXlXnbEZ4Bg8doZTJfNq+aWBzRDqOMQFo6xJZzGBCmrUc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420912; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nF/cntTLQgSDNskyD9TtxEb9BydSOVYtLSszBBpe5GI=; b=ja8UBBqGjh56jtSX9nzuxs00440B2mb+5C+mPRqUIRf/2NHY/2Db7+vRnLnym/GFcBZ9y3pvYjDLXt9pMJEF54o0wgOKIKikQNZilIoqOHsyS6gqdchb0jCnr5tkbZHHc198VEcpuHJHsns5t0MXCj7BW970u6gq+qlTGfGKCPg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420912463329.02839938258137; Sun, 10 May 2026 06:48:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4VX-0004CW-8j; Sun, 10 May 2026 09:47:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Uv-0003UZ-0Z for qemu-devel@nongnu.org; Sun, 10 May 2026 09:47:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Us-00054r-Nx for qemu-devel@nongnu.org; Sun, 10 May 2026 09:47:08 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-335-OovMOV3DOgieNcRsdp39BA-1; Sun, 10 May 2026 09:47:04 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EF5FA1956080 for ; Sun, 10 May 2026 13:47:03 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BEF531800240; Sun, 10 May 2026 13:46:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nF/cntTLQgSDNskyD9TtxEb9BydSOVYtLSszBBpe5GI=; b=QTcawLyS9j/UFZLYn1HMERFfzghmSUOKjltUADy7m4KjYIdSXxgWfjWPNbIqNVyHwnWTuk c7ZSYN/Gny28t3ykCdXrxEXibLfwL27XKnHALwGbhSsI8MJpP9to3lKPBNIk207DSUJLTe oCy2JMnLcOwq+P9dtL3SDkVumetSNVQ= X-MC-Unique: OovMOV3DOgieNcRsdp39BA-1 X-Mimecast-MFC-AGG-ID: OovMOV3DOgieNcRsdp39BA_1778420824 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:15 +0400 Subject: [PATCH 18/54] pc: convert OnOffAuto vmport property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-18-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2472; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=TZ9resH5GV3T2agEDTnUC7y/xCP2iY9Bvn5Xykd3Gpo=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItvhaEU3mulFozRucTm4K+XMMr75eI+ynk5I 5hZsUQNeKuJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbwAKCRDa6OEJdZac 5VuAD/4p6bltS1ieGF0reGetxhtyLns+//ghNshrBj755ncbS+iFjm5bGCLAkFV7l4hbHB+wX20 opPlE+cMhZ18Q78OkoeOLvvdxPNp3ufczqF0+eS/VwU9jJS4vFctOArCb3c3hlZ5WTiabFOJnJs 3xzBpGYsuOMBfOW6Ht7BV8SpnrDsaQzpEFayp91k8oUGs12KXC1dPmfmeNzBS4RvyIzMOzQIpju /bNx6In3gvLN2DONETy9WgFbZasZjmr8kH6AfTA2k+ia1jasbhEMha7StuYuCKBUjn/mH7pqp4k yZ6zNMegTwedx0oHXeraWdz8+C8Rkb23ULqa8uqCHFbGhdjoidgJ4eKcIw3kHzx+rhb8l42/hlY vYrOA+UtcyIqTSc5AGmVGRAp8ESh386S38dNB9XWHBAEblmo2ZMFk1kuCFXGZaOleSsRGYvgDrv /4oDwlVDcoKgOW1nuK4CSWnV4WhMUU+89NH4gek9w43wjSAe32+EWhGxIseKH1BI3QWpYp3cVlJ WJP6b+X2/6x9o0gHJEam2hZaeyqd+f5Vu/GUWOoQlQkvaSQe7fAWdW/Iyh4VjLu4dmnLX07ELsC W2InSdb/b+P5QiXJdWvXOFjqnQ3pDKrnzRwwWRWxz9qr4+KxZhvtfzfiepW0bhSVgbZhOQ1kQJX nWrfgpsu/fgXlfg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=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: 1778420914291154100 Convert the vmport OnOffAuto property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/i386/pc.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 2ecad3c503f..6a4fe126bc0 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" @@ -1379,21 +1380,16 @@ static HotplugHandler *pc_get_hotplug_handler(Machi= neState *machine, return NULL; } =20 -static void pc_machine_get_vmport(Object *obj, Visitor *v, const char *nam= e, - void *opaque, Error **errp) +static int pc_machine_get_vmport(Object *obj, Error **errp) { PCMachineState *pcms =3D PC_MACHINE(obj); - OnOffAuto vmport =3D pcms->vmport; - - visit_type_OnOffAuto(v, name, &vmport, errp); + return pcms->vmport; } =20 -static void pc_machine_set_vmport(Object *obj, Visitor *v, const char *nam= e, - void *opaque, Error **errp) +static void pc_machine_set_vmport(Object *obj, int value, Error **errp) { PCMachineState *pcms =3D PC_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &pcms->vmport, errp); + pcms->vmport =3D value; } =20 static bool pc_machine_get_fd_bootchk(Object *obj, Error **errp) @@ -1681,11 +1677,13 @@ static void pc_machine_class_init(ObjectClass *oc, = const void *data) object_class_property_set_description(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "Maximum ram below the 4G boundary (32bit boundary)"); =20 - object_class_property_add(oc, PC_MACHINE_VMPORT, "OnOffAuto", - pc_machine_get_vmport, pc_machine_set_vmport, - NULL, NULL); - object_class_property_set_description(oc, PC_MACHINE_VMPORT, - "Enable vmport (pc & q35)"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D PC_MACHINE_VMPORT, + .description =3D "Enable vmport (pc & q35)", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D pc_machine_get_vmport, + .set =3D pc_machine_set_vmport, + )); =20 object_class_property_add_bool(oc, PC_MACHINE_SMBUS, pc_machine_get_smbus, pc_machine_set_smbus); --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420911; cv=none; d=zohomail.com; s=zohoarc; b=b9E7W80IMtftQk/YubHQBHOrhea/qydY38X4ijkHRZ4aX9mcxYjmksmViHgvFfzsq5UN4KgpcJiBTt6lWsm+ijceZDdoX3M7HSdwGlTauUTR35Tccddsa2fO6khNqTrCGF+sw235m39z7h9x4qJBk/TSRaCakyy8r54o9Y4Ebks= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420911; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=uB75Ye8pK8wFpuDAX3oRKzLaJhiRW6tuCzi7k6hh/tM=; b=Bg5kyg7f0qYm9tOkaRLPbnZSsiraxh4D3mGL0T2aa657XdQiy40/kP8X8IPtqcyU2SSn0El9PJ7Q8T6jO3Thaw6RggLWdGSEqbi9IunWFPFyYEXrWPXBQRi1lYm3jCYa0LUXnQ2lqvV1oNYAPG5BeOTJMyomkMoDyaH8Cw2h/rE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420911080304.8950463050147; Sun, 10 May 2026 06:48:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4W1-0004Xf-Ap; Sun, 10 May 2026 09:48:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4V4-0003rj-M5 for qemu-devel@nongnu.org; Sun, 10 May 2026 09:47:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4V3-00057R-88 for qemu-devel@nongnu.org; Sun, 10 May 2026 09:47:18 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-686-4SrzJpIuPEqFHUivYtFupA-1; Sun, 10 May 2026 09:47:15 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5F1B819560B5 for ; Sun, 10 May 2026 13:47:14 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AECB91800352; Sun, 10 May 2026 13:47:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uB75Ye8pK8wFpuDAX3oRKzLaJhiRW6tuCzi7k6hh/tM=; b=UY1uPPyAsr/ZnKIbaqMidtRw4LFH6ue/to61gVORBaUS39PU/hiNNthJckxjL33ofSVkhW XINev3KLuja/VxRxKBO1VcCuGIuqjKwwhclS8HJfuDhOaoG33Zef1ihr1A3BOYZAvaPITj GmomasMMBtO6gisRV8QXAD/ZDO29ohc= X-MC-Unique: 4SrzJpIuPEqFHUivYtFupA-1 X-Mimecast-MFC-AGG-ID: 4SrzJpIuPEqFHUivYtFupA_1778420834 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:16 +0400 Subject: [PATCH 19/54] arm/virt: convert OnOffAuto acpi property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-19-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2369; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=+lggsc9y2Az4imzVXGrupIXX34Zn6fwQfsIsTkLWaqU=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItv/ORAVjleBbyoJEMfhlailgCifol3Nfsdd Y9b1l/2UH+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbwAKCRDa6OEJdZac 5TFDD/4rBYOZEpZnRwaZtifRoQB3a4EVahAhpbxywgMP7WTUP+K5nF8xwaR0xsqjTOctMD9/0Vs yjvDaFg0YOUAHzj6gx1kwzsvxhmMqcIjRdfQ+dGuC055WDSawKsRz/0jnqThQh/15niAmIf97HS MrIZPUKn61KP8PfTayCqppyoFHaojbUBuOszn20n82tDtldx3FlL25WK8ZImAcoensnzIq8Mjzv Q57ujMqQjsDN4UWfSrkZEmS4rAxY+r5eJfB/CfvOEqOgH8F+YWoSg+PAEA0B7e2TDFnz8mrOTte SwSVJ3LKzKyVf7qbwHWBtkLhcsarwOrAG7pmX5F7+yEppuckxAHNkQniJcAOrXABGRKs04lWn6U srK2+KZdEDGHDNXrvOJfoOa487GLVk3GBRkClTURnFx4Tx5/172GIDol+fJvpVE5xtXaz++GiFX w49XIGkhoFalTdRREaj6h7bjMCqZCLiim5+pMp0M5bZZ3+m7cNS77EV+uH82zfYX2k1o4Enx6X6 SyX7Ok4FlmCLM2rgSziKHviQ0U4qCdRvPt8PMcme/8856zcTxKN8Q2kY7Hd0qIJ38rp+0sXE5MV hbZyBpUn+cCNVp9UWZdk+8y7EWhgdnRvxO0aJm1eNbqCa9Ay0Z2N8LnzXRtbLoBonBlvZkbzN3t 7CxiukqCWq+zVCg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420911991158500 Convert the acpi OnOffAuto property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/arm/virt.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index fe19030886b..e4c75cb1bae 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -73,7 +73,7 @@ #include "whpx_arm.h" #include "hw/firmware/smbios.h" #include "qapi/visitor.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "qobject/qlist.h" #include "standard-headers/linux/input.h" #include "hw/arm/smmuv3.h" @@ -3267,21 +3267,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) @@ -3868,11 +3863,13 @@ static void virt_machine_class_init(ObjectClass *oc= , const void *data) mc->default_ram_id =3D "mach-virt.ram"; mc->default_nic =3D "virtio-net-pci"; =20 - object_class_property_add(oc, "acpi", "OnOffAuto", - virt_get_acpi, virt_set_acpi, - NULL, NULL); - object_class_property_set_description(oc, "acpi", - "Enable ACPI"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "acpi", + .description =3D "Enable ACPI", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D virt_get_acpi, + .set =3D virt_set_acpi, + )); object_class_property_add_bool(oc, "secure", virt_get_secure, virt_set_secure); object_class_property_set_description(oc, "secure", --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420912; cv=none; d=zohomail.com; s=zohoarc; b=Y27fkOtPWlfoXzoBVBXy8iNOo37IDl5y7Crl8Nczbi7qp3+Pn5fBe+ZFPjvDTOFo6muoxahCxd5855NWbt+Y+VUAiVdoAL+meR9ejaFb9kfljqxJL5Rup27bAih5lV2S+xKLYPl8iGGwI1iuPGTAkGz/rrYuTq98p1ql+oroZLE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420912; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UZT3Yl01MVKTtVMyH6IlztVF9/tm42DD2dHPy90kCxU=; b=Ak9K0gLtIbpNWSkJrMBruOY9l6j6RjawiQDpv4Vlj9l0kBjMYmY/lGTa9Gu+Jkshbl0GKRzNtFZPRbsnicNOsr7cHy5b4fs9OkQXHekAFSjbMrGMcj73emwYW+FOVCIpechUgTofgLR1Iuwanqq1DEP1Ojy3x6VGLq19RX/lCTA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420912046901.1127516334171; Sun, 10 May 2026 06:48:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4WB-0004qx-Af; Sun, 10 May 2026 09:48:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4VG-00040T-5s for qemu-devel@nongnu.org; Sun, 10 May 2026 09:47:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4VE-000588-JJ for qemu-devel@nongnu.org; Sun, 10 May 2026 09:47:29 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-618-JNq9szX_M9CYP0ryj8Z9ew-1; Sun, 10 May 2026 09:47:26 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C4E761956088 for ; Sun, 10 May 2026 13:47:25 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8319C1955D84; Sun, 10 May 2026 13:47:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UZT3Yl01MVKTtVMyH6IlztVF9/tm42DD2dHPy90kCxU=; b=US9J8GWcoYn7ghsynkPTV26TXfy/ZAM/3kZgGrXeRwCIr7NuhCeLBJW+DJqbCi43Jnvcwo kdS8D3j6uebEdeTTwjhQXHKfxJH6U/4OZyJmOtCoLE7TeOKGLK1bNK1aUCvT6EyliKODqU 2ZiJ06Do0rSPKVVmYT2BQBLRLuTNHDw= X-MC-Unique: JNq9szX_M9CYP0ryj8Z9ew-1 X-Mimecast-MFC-AGG-ID: JNq9szX_M9CYP0ryj8Z9ew_1778420845 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:17 +0400 Subject: [PATCH 20/54] riscv/virt: convert OnOffAuto properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-20-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=3914; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=Xq10Utl/I4ulIkL29AFDE/OGEVdWosO49c5rxOXmNQA=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItvLi1gh8Rkaxvp/d+zOqhV3XaTRyn2EXOM5 zR72TL5+7yJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbwAKCRDa6OEJdZac 5QvND/0XT7xMhWk4QjM7h6Rrv8s16PEKD71fTUuR99dmerJdQ1DEPXn7xCIX0mtzZzqg75z/sNT 2mLPOrGYmu44A/J1rV7Ho8NhXrVb5GrH/O1d9vhYm5D+PY2vpO4L31JOO/xUnaTu/ioINY9XX8I XEisFALAQim0he1aSb/Ip+j5I+GXxpFj1DTNHOSXqq5ik0aPcuW4hgueIfy7y64K4Sm+f4kMnOZ Epf9i1c6U/tYmYCcUUUQNv2mxyi93ZNh1kS8NanSbjgXjtS35QWi7LIoP4QuikV1F2c/bnyuXrN 3dSBx6n1Gz3RLenvFwPR6LPQEl27QZ71MH93Sa5UEkG2+aOixBgFW0Lt0d24IG9PX7sNNIkcXdZ GBIQBfsM1M5oJM/ia8yeJp36VfiZKeiKWd7A8vQcetv4welPEQZFMXaZJnhfeSQaiGBw7Qmt6Hc /iD+bkifoj61tTDoLyJJ/yBJONKgDMGD2E9yoFrNHtg25A67qfwy75qC5+rj7TKbi+psbhgby5X rrYU5CL8rmo/4P4K8r3+nwv513RHGnIB5DsTTzynYkc5Mf8CV7uVh8LF7bcSIQbPTDDrf2nHzQi 3h1vXt8OG7ISQOQi+9swzMfQx5pLFHSMgz70vh/TfdZGViDB1E1lCD15MvRgbKd7Ct/joAyR7Iq nQwyMWof0WtTkdg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420914113154100 Convert the acpi and iommu-sys OnOffAuto properties from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Alistair Francis --- hw/riscv/virt.c | 54 ++++++++++++++++++++++++------------------------------ 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index a1c323e66df..5148044df95 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -55,7 +55,7 @@ #include "hw/pci-host/gpex.h" #include "hw/display/ramfb.h" #include "hw/acpi/aml-build.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "hw/virtio/virtio-iommu.h" #include "hw/uefi/var-service-api.h" =20 @@ -1832,21 +1832,16 @@ bool virt_is_iommu_sys_enabled(RISCVVirtState *s) return s->iommu_sys =3D=3D ON_OFF_AUTO_ON; } =20 -static void virt_get_iommu_sys(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int virt_get_iommu_sys(Object *obj, Error **errp) { RISCVVirtState *s =3D RISCV_VIRT_MACHINE(obj); - OnOffAuto iommu_sys =3D s->iommu_sys; - - visit_type_OnOffAuto(v, name, &iommu_sys, errp); + return s->iommu_sys; } =20 -static void virt_set_iommu_sys(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void virt_set_iommu_sys(Object *obj, int value, Error **errp) { RISCVVirtState *s =3D RISCV_VIRT_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &s->iommu_sys, errp); + s->iommu_sys =3D value; } =20 bool virt_is_acpi_enabled(RISCVVirtState *s) @@ -1854,21 +1849,16 @@ bool virt_is_acpi_enabled(RISCVVirtState *s) return s->acpi !=3D ON_OFF_AUTO_OFF; } =20 -static void virt_get_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int virt_get_acpi(Object *obj, Error **errp) { RISCVVirtState *s =3D RISCV_VIRT_MACHINE(obj); - OnOffAuto acpi =3D s->acpi; - - visit_type_OnOffAuto(v, name, &acpi, errp); + return s->acpi; } =20 -static void virt_set_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void virt_set_acpi(Object *obj, int value, Error **errp) { RISCVVirtState *s =3D RISCV_VIRT_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &s->acpi, errp); + s->acpi =3D value; } =20 static HotplugHandler *virt_machine_get_hotplug_handler(MachineState *mach= ine, @@ -1966,17 +1956,21 @@ static void virt_machine_class_init(ObjectClass *oc= , const void *data) object_class_property_set_description(oc, "aia-guests", str); } =20 - object_class_property_add(oc, "acpi", "OnOffAuto", - virt_get_acpi, virt_set_acpi, - NULL, NULL); - object_class_property_set_description(oc, "acpi", - "Enable ACPI"); - - object_class_property_add(oc, "iommu-sys", "OnOffAuto", - virt_get_iommu_sys, virt_set_iommu_sys, - NULL, NULL); - object_class_property_set_description(oc, "iommu-sys", - "Enable IOMMU platform device"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "acpi", + .description =3D "Enable ACPI", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D virt_get_acpi, + .set =3D virt_set_acpi, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "iommu-sys", + .description =3D "Enable IOMMU platform device", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D virt_get_iommu_sys, + .set =3D virt_set_iommu_sys, + )); } =20 static const TypeInfo virt_machine_typeinfo =3D { --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420920; cv=none; d=zohomail.com; s=zohoarc; b=I3wASWrNoSpveoruABKENhTDxd5nKDkm7eHKO6Z/gYerwfvg5BprVk9BmZ7oH9DaOrLFdfnRyLRpp+6RglC272ug9pUv8jfLEDZj1+G4NjpIdxGwF4BJSGdBjey9jr+gAMiPOSZvD4dvs/3wjQzT1rkULM6WPnHDdEehMjaBi58= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420920; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XK6hQBJWe6s0pE48BHhzuffI9fvmlLQPWRYr4LvE39c=; b=n5ilmObCgKZjd7Ng6O8bsvDKR46IoDZvgu+iHE6qL/JfcB/aFdUi8AViFWVub1LHj3xeBNEtxjXE5rsPcfcBD3dW0EDbUq/RHrPLbKAdNNaTdJ9y2fM0ws29dTGBjgWaD8VEuwl5taZL07cS1fg82AALu8x7qc+hLGDWyNrdw+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 1778420920188704.3974247061742; Sun, 10 May 2026 06:48:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4WD-00059K-AL; Sun, 10 May 2026 09:48:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4VT-00048Y-GS for qemu-devel@nongnu.org; Sun, 10 May 2026 09:47:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4VR-0005AZ-FU for qemu-devel@nongnu.org; Sun, 10 May 2026 09:47:43 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-478-aUYDuIzOMCGchI8lGjA7Og-1; Sun, 10 May 2026 09:47:39 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5E5FF19560B4 for ; Sun, 10 May 2026 13:47:38 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DB7A219560A2; Sun, 10 May 2026 13:47:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XK6hQBJWe6s0pE48BHhzuffI9fvmlLQPWRYr4LvE39c=; b=Okxxa/ddQetPew0Gnm3RloDWuVVcXmPPxmcUObIuXNxE4YY2uK7fhbxpk1pBDm5ZgbrnB+ +Xlef9q3p7DQ8U3aY+QPjJmqsr/odj07AULR6ojltS/bx1w7mDkn9aW1rQOrxuW/L81v7W sht1+9AmjNypMW+XQ6HP0FxKlX4p9qQ= X-MC-Unique: aUYDuIzOMCGchI8lGjA7Og-1 X-Mimecast-MFC-AGG-ID: aUYDuIzOMCGchI8lGjA7Og_1778420858 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:18 +0400 Subject: [PATCH 21/54] loongarch/virt: convert OnOffAuto properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-21-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=5899; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=VKaT/RM+bX6JnsN2i4XW8lfpbA4Tsvv3WOtvPasSpx8=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItv4V6F7PsL6IpCGSCSWzYBAjUgaHa1KIrvH ixX4MJn2X6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbwAKCRDa6OEJdZac 5SxPEACw9pd9zqk31+SnWzMBqruXB2lDxXcAyhBf96WbOZuLxTTJM7QgGZclP75s/PanFYZql+l c95dTlu81GasPOKKKNF6YGxGZT1gSlRYujtGnbYQCRiWAzn1NdN/QE58A86jojUIkuYkJc05Dqr d+7tX6HG8G4oOJpHexvnqoFRDKq+MGl+rLZKxvIV5AYV+qb9CX8SKIKqLTezKAqqbFdWxPDCq2A OowVUSHcaxwjsE8NMiY9+ro6c164shjbVsaQwsUSdCiyB63DIKZnbT2bZYVhV7NTiYDIZ+cJUnN WXt1oJEbC2yEpbXA/UtxFEgOQBfN7vxXW7TRUH4NnXgHi3Q9X+2r5dvehjZHiujezl1O3NJ7tlj QocsDzyn09uUDn2ClCeroLwAIYnHMk4WaYIxkfuNqMyUTUzIdCCzGoyHiP5dHmtaU4YODnWoaJe 1r0Y020TizMuRtNaQ+QYb4Q5Lj3oqf2G+jVMOPjcLMwFanlysWkdJp6tr20PTl5w7X6Uxq194A8 dCWY5KJ2oMEQxjc6/vQ1ZVBqUFHyduQT5ryt+L5maxVMQbtyyIgBrEhnvMtD/z3e0A/BlxQj8RK Vq+tXa8GPJ1zKq1rgfMe3TbHvITaYZ4kCkcXElNSmztuigginMME8a3v75f+aXPXbFJmdmG8XVP tv2p/WecL1HvLjQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420922245154100 Convert the acpi, v-eiointc, and dmsi OnOffAuto properties from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/loongarch/virt.c | 85 +++++++++++++++++++++++++------------------------= ---- 1 file changed, 40 insertions(+), 45 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 2fc15261309..b301398d1bd 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) @@ -1484,20 +1470,29 @@ static void virt_class_init(ObjectClass *oc, const = void *data) hc->unplug_request =3D virt_device_unplug_request; hc->unplug =3D virt_device_unplug; =20 - object_class_property_add(oc, "acpi", "OnOffAuto", - virt_get_acpi, virt_set_acpi, - NULL, NULL); - object_class_property_set_description(oc, "acpi", - "Enable ACPI"); - object_class_property_add(oc, "v-eiointc", "OnOffAuto", - virt_get_veiointc, virt_set_veiointc, - NULL, NULL); - object_class_property_set_description(oc, "v-eiointc", - "Enable Virt Extend I/O Interrupt Controller."= ); - object_class_property_add(oc, "dmsi", "OnOffAuto", - virt_get_dmsi, virt_set_dmsi, NULL, NULL); - object_class_property_set_description(oc, "dmsi", - "Enable direct Message-interrupts Controller."= ); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "acpi", + .description =3D "Enable ACPI", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D virt_get_acpi, + .set =3D virt_set_acpi, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "v-eiointc", + .description =3D "Enable Virt Extend I/O Interrupt Controller.", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D virt_get_veiointc, + .set =3D virt_set_veiointc, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "dmsi", + .description =3D "Enable direct Message-interrupts Controller.", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D virt_get_dmsi, + .set =3D virt_set_dmsi, + )); machine_class_allow_dynamic_sysbus_dev(mc, TYPE_RAMFB_DEVICE); machine_class_allow_dynamic_sysbus_dev(mc, TYPE_UEFI_VARS_SYSBUS); #ifdef CONFIG_TPM --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420911; cv=none; d=zohomail.com; s=zohoarc; b=U9ebSeswHgs3bS902xNXszjGImpWgYIp7k35QU9h1XcVaMcWZLx9ryiQmSUGHF3L6iRzlPFbZZYx1eNwjbtovFdlOvMlPIzQiueouooPMuR1UiiLfklxnf0PyIu8pnOWTs4ReiRunJTEVuC7FNL8qLP27ZnLBeZG9AIcWCJ/rFw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420911; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dTVSsz2qCp97WwEvttSm7q5i8iO+M//bld04U21UP3Q=; b=DfVRSYUnWDygDUB1J5TaShqc7RxxMh6FDZaYwp8rq+B6jeCggMZJQ32MAkZVancAvQYpGUG69UnugINNwQRKAaUSGtK58zhVilUxFus66hcQeqIRvnz6MFlZc5cQEhY5XpJyZ4PT0qPBogzW4RpSKUA/gvPPp9vO9aN2vPSuf98= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177842091149791.70745710172594; Sun, 10 May 2026 06:48:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4W5-0004bn-2x; Sun, 10 May 2026 09:48:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Ve-0004Pj-Cg for qemu-devel@nongnu.org; Sun, 10 May 2026 09:47:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Va-0005Gy-Je for qemu-devel@nongnu.org; Sun, 10 May 2026 09:47:52 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-590-JOElgxXxNJWkRRbs1VCaxA-1; Sun, 10 May 2026 09:47:48 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5576F195608C for ; Sun, 10 May 2026 13:47:47 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EF23E1955D84; Sun, 10 May 2026 13:47:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dTVSsz2qCp97WwEvttSm7q5i8iO+M//bld04U21UP3Q=; b=BIkhdWUtGd5uqfni3Jumm8qiCTL+R/7kcGAlea8GFpgxl39uuASym4/2wBuUsVBV5eCnfu /rB9KKrSI7u3b6VJROsxnq4vtNDdwzd9ZMR9Wfr6T/0nY9al0Ix6P6dMp9jG1+1GSyerrv GfuBshcmVil2Bc3jmsXqivERQOWRZ4I= X-MC-Unique: JOElgxXxNJWkRRbs1VCaxA-1 X-Mimecast-MFC-AGG-ID: JOElgxXxNJWkRRbs1VCaxA_1778420867 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:19 +0400 Subject: [PATCH 22/54] hostmem-file: convert OnOffAuto rom property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-22-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2943; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=CuFSJq8iGNGVCOyVHepOCVE13II6sJjnLOPYuRRy6k0=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItvqrymaHP3uKCUdw6hmj/CLxJ3CsRgxcrvX pmBTSgE4iiJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbwAKCRDa6OEJdZac 5S3dEACu7hxChSb4xMUSG+v9szs5ydc4HkK29LbUJ/KGIy0kTApBIdHu88VAL2HrjLXPSP7/nce yb5kFXNrTLdCKkEQ74LsRDnnYmDEHsVECEJB/aKKzW1+Kk/HGJwNykO6db8k8KAG6I1P2RF31lM u64GA/5Mfk/sq4RSvFgnxzbYCO7e0BUn5U08BS4Ik6vvzXKKmvVOJgCvg/qp//0lhd2WWWvg6C6 8vumOp0o0XHQFD1gxvopuV+gx2Fc/wVtEuabRYTB9xomL12autSkClEqb5DVxJ/APWV8bcWFLZI De4jWpX3Dkf+zUPLeYKOE5sHFEibpwfi5ERe0lf1lV7W8IWA3zZcKXhwgKBXWTjjuOMk/ZZ28Hq KJ9ik4Mos/EV8o2r95h9aGf3XtW39tYRaTrwvrSYDcBWnyuKKq2k1pBJjatKkDsSUQXTBc8TpCF n8D7FzwdoTuD0bFOqx9OUyKs5X4fXew2KuuLe6deG60zrcQ9uQq8T98yaJJo/Y5gsaFehVLCcoA 38AC2A59hh+Ib0uAR7V4N7hnrNnsvdMYGPnm7rbk4bu4Iv5UOV+dfwfes9/dVWPWMU1Z23KlqVv dF+ucZ4AizA/DrVeE6E6/SlpZjBD6idtVNMvuek9hSrRZF/W0HS076iAIUv4glC1ZbRggZCFPOs KYI/UxHbZycHe+w== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420912309154100 Convert the rom OnOffAuto property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- backends/hostmem-file.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 8e3219c0617..52b62f71533 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -19,7 +19,7 @@ #include "qom/object_interfaces.h" #include "qom/object.h" #include "qapi/visitor.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" =20 OBJECT_DECLARE_SIMPLE_TYPE(HostMemoryBackendFile, MEMORY_BACKEND_FILE) =20 @@ -230,30 +230,24 @@ static void file_memory_backend_set_readonly(Object *= obj, bool value, fb->readonly =3D value; } =20 -static void file_memory_backend_get_rom(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static int file_memory_backend_get_rom(Object *obj, Error **errp) { HostMemoryBackendFile *fb =3D MEMORY_BACKEND_FILE(obj); - OnOffAuto rom =3D fb->rom; - - visit_type_OnOffAuto(v, name, &rom, errp); + return fb->rom; } =20 -static void file_memory_backend_set_rom(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void file_memory_backend_set_rom(Object *obj, int value, Error **er= rp) { HostMemoryBackend *backend =3D MEMORY_BACKEND(obj); HostMemoryBackendFile *fb =3D MEMORY_BACKEND_FILE(obj); =20 if (host_memory_backend_mr_inited(backend)) { - error_setg(errp, "cannot change property '%s' of %s.", name, + error_setg(errp, "cannot change property 'rom' of %s.", object_get_typename(obj)); return; } =20 - visit_type_OnOffAuto(v, name, &fb->rom, errp); + fb->rom =3D value; } =20 static void file_backend_unparent(Object *obj) @@ -298,10 +292,13 @@ file_backend_class_init(ObjectClass *oc, const void *= data) object_class_property_add_bool(oc, "readonly", file_memory_backend_get_readonly, file_memory_backend_set_readonly); - object_class_property_add(oc, "rom", "OnOffAuto", - file_memory_backend_get_rom, file_memory_backend_set_rom, NULL, NU= LL); - object_class_property_set_description(oc, "rom", - "Whether to create Read Only Memory (ROM)"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "rom", + .description =3D "Whether to create Read Only Memory (ROM)", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D file_memory_backend_get_rom, + .set =3D file_memory_backend_set_rom, + )); } =20 static void file_backend_instance_finalize(Object *o) --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420916; cv=none; d=zohomail.com; s=zohoarc; b=JyF2Fp+CxAbF9M1ijPS+X3a6AJ+z02fHEQYGtujCGG51EVUJ3fKwCzDQTESQl/E/d3+DffcDG0aQX1mECEHe5Jq/PU6LctTiOVt2W2yaCCUReNkRU/xa5KWpHyWHg2uTaYpoHFqOwJN/A2rZN0OtDk6SgPNCg/z/uKQI6s4opvA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420916; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=A6IjphfFlkWecZxoxHHgYRag4X36gOO8u9OQ9MNBXLA=; b=FOBur/BEBFpNEHOJxqz8m0noKmMrqj2751/KzpqBNxvH/OpqSGwXKTvpWxtS3c5d5WdC9XOLt1vr24D4EgKC+L+nc7CHJZLxzJjiVc2L4xm/coicJzEa/gybOqiwiCyexsGBcZNha+09G9NVHoYLZYq7hqx4zPkx7QRVrB/8VZ8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420916558980.480930002161; Sun, 10 May 2026 06:48:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4WE-0005OS-Lh; Sun, 10 May 2026 09:48:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Vn-0004Ri-28 for qemu-devel@nongnu.org; Sun, 10 May 2026 09:48:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Vl-0005I6-Ev for qemu-devel@nongnu.org; Sun, 10 May 2026 09:48:02 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-573-T6lwaSEIO6qxP5n2yM-oRw-1; Sun, 10 May 2026 09:47:59 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9C857195608B for ; Sun, 10 May 2026 13:47:58 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D22BA3002D31; Sun, 10 May 2026 13:47:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A6IjphfFlkWecZxoxHHgYRag4X36gOO8u9OQ9MNBXLA=; b=RohUR+YEAVUamOJBknp0yHhKBBWGqDJZr96Rkix0picZcwKbTvvmz76mlO/5eSYlVPa5Nt xZtkZbMle54s0nre32g8IG9xsDgSvUHXOeBmbPziFT6Jw3uk0/5t9P/QE+LS9brrQfouX3 kTaM94jIIWsUIifNMbt0lFnOJ/4yFV0= X-MC-Unique: T6lwaSEIO6qxP5n2yM-oRw-1 X-Mimecast-MFC-AGG-ID: T6lwaSEIO6qxP5n2yM-oRw_1778420878 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:20 +0400 Subject: [PATCH 23/54] sev: convert OnOffAuto legacy-vm-type property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-23-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2858; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=MCVQzqetiyAUsBGisw6UOIizQC6YBYCi0CNUpoXUhDk=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItvvcs5t9ir5IO5svDXi7r6yUzm7yuZfIhCs mKoc2YLceyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbwAKCRDa6OEJdZac 5VapD/sFlagvuBiriF0fIxmnyQlCG0PHJWtQ0vwoH6H+y6Xr8QmxVqPbI2M2nPtQFqu9kqBEG8B 7VIrqdaN9iMF24ONJxg1zn/yahmcB0UC04kuJzoWylaC6lfKN0L25hlyuAmkYDumdi9xuc4qVS6 ZtbNlwoDt9tpO6WRGdQftVM4kqF881D+xA+gu73sbN13p2UYrFC6h8Gu4dd6PE8jOYhkeU961Qs Jfa0hoHiiR/Ha5iaqTHwFCTwAj7hcJOGjHXRm+wPej5ekszJII/124N1Llfrxv72FTdHdjlmewA pKq7FHCuBh5J007Q7POeaG8fmz/9YzB9OMNn95G3AqaIWhYR/2WnyDz1j9NnkRvmoIYMaB7/7bl 5t2dd6xfSFfdClbbyaDI2twDcASTvE7ydYzIeKnXTjaUqNFpnCZnW5ZWAkZg//eN4BQSOrThi4W uiR1cCCqdg6ES012lKqxaOZh0yWFowYrCucqk2FE53kyojY3jnoEuohZMR32QXuPfbHokiSmzgC Z9f9F8y+TGxvhG3cYmh0t2IXDA52fBhJSK1XwbgE5siAWWKt1CO2Xa8IWbK3tAIH+UsRZLnGCbf H1Av5Y3Zrimug9cFyN00Z2pwxlqG88u/eyh7CzsiMuS0HSejzLOnN15vjGjC/3UHPzwEc8Ac16k qTUvVrZqSwmJA2Q== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=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: 1778420918170154100 Convert the legacy-vm-type OnOffAuto property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- target/i386/sev.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index b44b5a1c2b9..50a9bfc35d7 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" @@ -2872,23 +2873,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 @@ -2914,11 +2908,14 @@ sev_guest_class_init(ObjectClass *oc, const void *d= ata) sev_guest_set_session_file); object_class_property_set_description(oc, "session-file", "guest owners session parameters (encoded with base64)"); - object_class_property_add(oc, "legacy-vm-type", "OnOffAuto", - sev_guest_get_legacy_vm_type, - sev_guest_set_legacy_vm_type, NULL, NULL); - object_class_property_set_description(oc, "legacy-vm-type", - "use legacy VM type to maintain measurement compatibility with= older QEMU or kernel versions."); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "legacy-vm-type", + .description =3D "use legacy VM type to maintain measurement " + "compatibility with older QEMU or kernel versions.", + .qapi_type =3D &OnOffAuto_type_info, + .get =3D sev_guest_get_legacy_vm_type, + .set =3D sev_guest_set_legacy_vm_type, + )); } =20 static void --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420931; cv=none; d=zohomail.com; s=zohoarc; b=dg8nR2VdgDM/eetku3r4YjTFHUgPT/9Vamz5PRkL+DIdXU5aJFztruHeohqC0XtL+ZE2YGq8yFgsbgiGht2GZ1R2dsUuM9xnwDvoe3WkPpMKAi0Ch3Wu0dVOPVdcpS8m+T4huOPJW1eJ0SuDjNp/XCpzL2fbwNm3B7qcK2rwttE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420931; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=vUOuphh7lwDnDlIAl256jv50Zp2Hh7oDJoVpT2dTnLY=; b=iXdFFUv+DDSveyEWpnhfZo0QwpVRr8xXqSma2Ca6xUsUhb0wxcJPQm8Tdo/elvmk1nvPRVewsFzlanKoSZZrsZCzaC9rjXQnV+3+au/7r/edOLOgrd4lvJfPbGNBHvOyNnYb8gbR4w9FjigpUi97rZGlnB1fjzd18bHAYf/rc0o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420931346951.6766387790608; Sun, 10 May 2026 06:48:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4WE-0005OP-LZ; Sun, 10 May 2026 09:48:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4W2-0004e7-Gb for qemu-devel@nongnu.org; Sun, 10 May 2026 09:48:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4W0-0005K9-W2 for qemu-devel@nongnu.org; Sun, 10 May 2026 09:48:18 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-647-Ue7ULSP4OgyVpUsbZ9UV9A-1; Sun, 10 May 2026 09:48:11 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 65961195608E for ; Sun, 10 May 2026 13:48:10 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3664A3002D30; Sun, 10 May 2026 13:48:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vUOuphh7lwDnDlIAl256jv50Zp2Hh7oDJoVpT2dTnLY=; b=WPQXOIooUyIfCdPlJGOEhPfBfswL7OzGgeoXpaf0/cSiryFOoBcEt8hOKatYGQAwPFbCxd IeXze16vKw18KovrSmYUwR2e4wf5qgcFUGR8JFd3oaZbZUnXvrCP+AiJIk/u/jueCKCVT+ tFdIwFvJjwm1EonA5+j3/QWQ2M49s+c= X-MC-Unique: Ue7ULSP4OgyVpUsbZ9UV9A-1 X-Mimecast-MFC-AGG-ID: Ue7ULSP4OgyVpUsbZ9UV9A_1778420890 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:21 +0400 Subject: [PATCH 24/54] whpx: convert OnOffAuto hyperv property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-24-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2550; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=tNUW/HBog+/AnPLyqxY75SQ9HHIGR8hgSoU/pzjmByg=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItvI5fn1713UO8RcMupeUPRW1Ss8xgLD0l9H PX48CuUNOWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbwAKCRDa6OEJdZac 5ef7EACa72qHz9n98mHFOQoOgSx+ec3utmD0LBWCGfpGFCUw58noJdyn2d6xtp4gisYpaq3E1di lJt5fzchHFVmf9E78OcmK/8se0kyJscfrZammeDs5P6tyUW59TmvGToQPXCrcZ7HaHgpFCuq0dw +pSEMbZK4Z5ospRX75ayywwZBE1+V5WuW4wy5BZnNGq/GcnUQRAtEIxS5+bPXqNcI0DN8maIFnL D5NIl3mD+hJtK36fdoRYf4BlmDtTLWG5sbByhomZ9ZBurdzzimirYa+4r0LVua+YXCxL99liI/b c7WwseIJtAixogQEGhqhyU0Ep74U3K56UHCE+bcM3B1sa0q5Cht/x/znFhr0GzcjCX4oYz7P85M NNyFNyQ9zovYQN5pQu/jR0Tulo4HhdlYERu3SgLmukIFz20G07zvMnVrBjDuIWZL82q5eoFOTy3 3jXLsFj5QNuBY/g3NgLqMbg6TeN1wF9YQZKJwr5WUDNWKfpglydd0iqYLM3S6MlDVenieUrhS7u BtLdZMAgDA7k6KOf3FHUz3BpErW8qmPtRs6unufDX1Ie3AR923CAzUFTd+qU7h8ytcAbtUZcEb2 HzcrPJKBk2IIVpchyiPMQahk0ZzoPx6D1aQS0tKB4QPbjXRpmbMimKYjC2oNWokxRTAu7FPlCo8 55hHi9qXzgl/neQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=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: 1778420932476154100 Convert the hyperv OnOffAuto property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- accel/whpx/whpx-common.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c index 247e12db812..187938c02b5 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; - - if (!visit_type_OnOffAuto(v, name, &mode, errp)) { - return; - } =20 - switch (mode) { + switch (value) { case ON_OFF_AUTO_ON: whpx->hyperv_enlightenments_allowed =3D true; whpx->hyperv_enlightenments_required =3D true; @@ -497,11 +491,7 @@ static void whpx_set_hyperv(Object *obj, Visitor *v, whpx->hyperv_enlightenments_required =3D false; break; default: - /* - * The value was checked in visit_type_OnOffAuto() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 @@ -533,11 +523,12 @@ static void whpx_accel_class_init(ObjectClass *oc, co= nst void *data) NULL, NULL); object_class_property_set_description(oc, "kernel-irqchip", "Configure WHPX in-kernel irqchip"); - object_class_property_add(oc, "hyperv", "OnOffAuto", - NULL, whpx_set_hyperv, - NULL, NULL); - object_class_property_set_description(oc, "hyperv", - "Configure Hyper-V enlightenments"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "hyperv", + .description =3D "Configure Hyper-V enlightenments", + .qapi_type =3D &OnOffAuto_type_info, + .set =3D whpx_set_hyperv, + )); =20 whpx_arch_accel_class_init(oc); } --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420931; cv=none; d=zohomail.com; s=zohoarc; b=OZGs3l50Z7obty2dpYLRlXaoZheJq3qdz/F75VckZ/+HE/6KRUmDrRW0foeGwM9vxnft+CLheC3YZdK9G/hnRIrqTjaxja1h4/j9bWm/4j2Wr65U0cAOtsuzfLqdAvLX0hq+H8x5GezJuRt20zwIETjzjqpXYmquAgZGZPA5UGU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420931; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=L0jtZDyAG6ut3FJS5KdqQHzzK1iO9S/wXHIo8VlO86w=; b=S27ibHnP9aLQboj2IrFOPUuxwh5JVKeCjoOoPfEDmsUG717uhAhvetkFepF2Kz8rmBm6acl+h0UpxSxu5UPrNnqfJ/dkqaybPNXOdloAw/HY1Gum6gPK9ak67l2eKqtwZYbr+vrq7ldrfz7OjOt3aobZigdfmdppyTcG/hEp4H8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420931086292.74169585209063; Sun, 10 May 2026 06:48:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4WD-00059i-Cq; Sun, 10 May 2026 09:48:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4W9-0004mU-Nr for qemu-devel@nongnu.org; Sun, 10 May 2026 09:48:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4W7-0005NG-VB for qemu-devel@nongnu.org; Sun, 10 May 2026 09:48:25 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-348-_ZhXd684OdGFiw4Sq528EQ-1; Sun, 10 May 2026 09:48:22 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 30EB3180044D for ; Sun, 10 May 2026 13:48:21 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9041B18004A3; Sun, 10 May 2026 13:48:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L0jtZDyAG6ut3FJS5KdqQHzzK1iO9S/wXHIo8VlO86w=; b=SlCYL1e4as+eOvVJJ7RO5sp4rCUbhB2gISc3a+nZg3+53Yo3ZcnMIS0JK+b4pQsa7hpcLT 66kQ5TWCdUZ8x05td2u0FefZrHGOOzbPgBXy7RvfU75GYQuA09PcgVYCjXu9OSE8n9G4+T ozi+chHkLNfz+/cqCSnbS4XwHI2IYAM= X-MC-Unique: _ZhXd684OdGFiw4Sq528EQ-1 X-Mimecast-MFC-AGG-ID: _ZhXd684OdGFiw4Sq528EQ_1778420901 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:22 +0400 Subject: [PATCH 25/54] whpx: convert OnOffAuto arch properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-25-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=6655; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=rc6etq1KNjRjMh12qePYEMBwWZktfhrnrhMoSB8Vxws=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItvEcKyIj/tgS+S3MrGk1v/P7jefP2kcOKNs fYFAUhsgVOJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbwAKCRDa6OEJdZac 5Rc7D/98b3YQAStp4t1b8cpfTegADn6C7mJc6VRQZy6tc0aMi0yfseAfgt9tnFdUFCzGZ6NnQqQ tHBez1GhakZTbuY5s2D8ojo8I64hp1BgE9IIZBg1E9GnWgoYOYxqG3OdT7h3Pu/yRFzDoVNjMv0 KVvDP7K6jnex2PSTW3O4RFwY9XdEv9oa12dZ2HSEDNJEVcru1/N7K/iG2/5YR6xtrEDYjCkzKYj 6TIlWh6rAS/BRAYaCUtHdwCVvJlum4U6ucN2PPykAb8W629QrcYzntjUWpSLfNBkq0AVRoNWWYI bNUJyFPQ3o9FJCtZKiBJ/FA0IfIxZMhqyRsuEI554cy5jSbpXIqPh1PpUYLCSOGnKEPQOz4Lvrx qBjAPRwY8auGNV9s9QZT5KCxeEOzeWogsSYqU55IK7g1ZnHZIH0nudFiCwj0kipNifQFVSRtZsC Lj01F69+dapJUUDBrYnULICUK4+DWeRwl/0/JWyqeFYYBaDxSC/gJM8uCrCCRIF+6m2Fk+QzdkV 8Sg0cirGTGs60DzBIGU4BN1bYYkB/s6FgzlnPZMlypNIIPHSxj2nEM60Nv9ym7Tsy9uxZgNF0Ze NRrKbGs3rFUTmtkrC19ZUZmFpuJWwt4FcWwUwF/f9UoAjr39fFbbM7L+EXDXkZTZCbmSfpmfPPo hZEfX3ZA4u23VvQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420932241158500 Convert the ignore-unknown-msr, intercept-msr-gp, and ssd OnOffAuto properties from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- target/i386/whpx/whpx-all.c | 102 +++++++++++++++-------------------------= ---- 1 file changed, 34 insertions(+), 68 deletions(-) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 9d0c391e36f..6826ac5bb18 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -30,7 +30,7 @@ #include "qemu/error-report.h" #include "qapi/error.h" #include "qapi/qapi-types-common.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "migration/blocker.h" #include "host-cpu.h" #include "accel/accel-cpu-target.h" @@ -1853,7 +1853,7 @@ void whpx_apply_breakpoints( } } =20 -bool whpx_arch_supports_guest_debug(void)=20 +bool whpx_arch_supports_guest_debug(void) { return true; } @@ -1938,7 +1938,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, ®); @@ -2042,7 +2042,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. @@ -2342,7 +2342,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 @@ -2898,120 +2898,86 @@ void whpx_cpu_instance_init(CPUState *cs) * Partition support */ =20 -static void whpx_set_unknown_msr(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_unknown_msr(Object *obj, int value, Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffAuto mode; - - if (!visit_type_OnOffAuto(v, name, &mode, errp)) { - return; - } =20 - 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; - - if (!visit_type_OnOffAuto(v, name, &mode, errp)) { - return; - } =20 - 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; - - if (!visit_type_OnOffAuto(v, name, &mode, errp)) { - return; - } =20 - switch (mode) { + switch (value) { case ON_OFF_AUTO_ON: whpx->separate_security_domain =3D true; break; - case ON_OFF_AUTO_OFF: whpx->separate_security_domain =3D false; break; - case ON_OFF_AUTO_AUTO: whpx->separate_security_domain =3D true; break; default: - /* - * The value was checked in visit_type_OnOffAuto() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 =20 void whpx_arch_accel_class_init(ObjectClass *oc) { - object_class_property_add(oc, "ignore-unknown-msr", "OnOffAuto", - NULL, whpx_set_unknown_msr, - NULL, NULL); - object_class_property_set_description(oc, "ignore-unknown-msr", - "Configure unknown MSR behavior"); - object_class_property_add(oc, "intercept-msr-gp", "OnOffAuto", - NULL, whpx_set_intercept_msr_gp, - NULL, NULL); - object_class_property_set_description(oc, "intercept-msr-gp", - "Intercept #GP to log erroring MSR accesses."); - object_class_property_add(oc, "ssd", "OnOffAuto", - NULL, whpx_set_ssd, - NULL, NULL); - object_class_property_set_description(oc, "ssd", - "Separate security domain"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "ignore-unknown-msr", + .description =3D "Configure unknown MSR behavior", + .qapi_type =3D &OnOffAuto_type_info, + .set =3D whpx_set_unknown_msr, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "intercept-msr-gp", + .description =3D "Intercept #GP to log erroring MSR accesses.", + .qapi_type =3D &OnOffAuto_type_info, + .set =3D whpx_set_intercept_msr_gp, + )); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "ssd", + .description =3D "Separate security domain", + .qapi_type =3D &OnOffAuto_type_info, + .set =3D whpx_set_ssd, + )); } =20 int whpx_accel_init(AccelState *as, MachineState *ms) --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420939; cv=none; d=zohomail.com; s=zohoarc; b=aL08aWxxquwnBlhe5vkhN4uJmTJkXSSVUGzC5T5SPc6TZEmFJ8esV61cgI0M5Voy7jLxpiDqArKgK4VnT21sQ7wEFJX8Wm1A4hAbAy6rWoh4TnzX7Xz7HsSBgjFdVamuqXlJ/PUoDFOF1ydruMbciUUQ00kfKfpnMCgRNkN/EXI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420939; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DWwxkLE91xXofymgFvGI+w9Kgvt7VkkQKMY2pY7orTU=; b=ArT0J/OWig4BdAFrkniCnJ9WgycKs0tPwxrfvC+zrJp02ahqZmSiRG52tPYOeI4hUeYyScM3CsT4aV0YMYBiYY0AYoeYYhoUzTlX5zJGFZYB505590UC0LBcTQkvRCe0YnvHEdyJeSjuDO8twts0q5TZkIhLOCZE5wFAMjSs+ns= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177842093937455.16111243172236; Sun, 10 May 2026 06:48:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4WS-0007In-Fc; Sun, 10 May 2026 09:48:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4WQ-00073w-Hv for qemu-devel@nongnu.org; Sun, 10 May 2026 09:48:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4WO-0005PK-Uq for qemu-devel@nongnu.org; Sun, 10 May 2026 09:48:42 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-14-kxOCISNzNRCYS5az5thCOQ-1; Sun, 10 May 2026 09:48:38 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B1028195608B for ; Sun, 10 May 2026 13:48:37 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 18A6819560A6; Sun, 10 May 2026 13:48:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DWwxkLE91xXofymgFvGI+w9Kgvt7VkkQKMY2pY7orTU=; b=Rsd9qm/g7n67SlpSxrMJi1yRYKloUc6uxBxgnXZuS0qKJm1HBkDNskrQdEzAyYp0QbM6FH R8Wp9dSZw6MVrL2S9bL8pYL55xoBncX9ZvzgvWiR/WzlwDU2QFEU2rVirrKv0NrzCkN1r+ w1khIwgsBz6vC93YrmJ6arfHEi9HOKo= X-MC-Unique: kxOCISNzNRCYS5az5thCOQ-1 X-Mimecast-MFC-AGG-ID: kxOCISNzNRCYS5az5thCOQ_1778420917 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:23 +0400 Subject: [PATCH 26/54] accel/kvm: convert OnOffSplit property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-26-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2731; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=1C5Es6ei64bnxBu+6I2DyhEV4JA9pADA42542Q0T2jY=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItvFtT7jDWgmd0qyt0mhsmEkIfRZhmoKTAH7 kmkZcQLxIOJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbwAKCRDa6OEJdZac 5YxAD/4heKCOXgE7BDbtXcNWTzApUn7LSSyu6AE61P8cQbXaGqJF/ROw/2xOCY5xL184Q+E38/F X85l165Ix9AqQWeNizJo04fqkO9rWDwWnyNpO7roKA+V5/JqETnxURExQ0TbgZqESyZdqACpLAC qt0KP00KpmKavBZzK0/5s0IANjerZQ3KFK6ribo3CcD0Sok4VDl2peytWTIsCEeU0zEsYwMGRDe 0QdUPEtPt5NKd+tcHQWbUFrdsokG9px+3+aihYilh7tPoozIvrHbZW4Ktb7DlMYHBQhxAX/nq3D q4/7VRSN4CKP9CmsWO4hhKf0jyQWCtEANVPGaw5utV0wP5wB5RerBHWq1JHMToO7V8cpX59fF/y fb/0jFt2pM4yjBpPfUqsurdxWbC26bQ9WLmfnGguGUCP0q01ReTIkG+/FvuxXidn9dr7ADEzSc+ bs6EPSFKOMhm9yF7vuDvL+Hz5bvr7ibAVxNaSyVUeDmqsY0xja5h15pa1A3O0ipRsKETMaNThaz TRprrhB96omoaxDravaIbniUzKF4x694/RVlyC3quZS4S/xi3AXrE/a21oS0rrgpIpDXyGQpR2H N2yozY1XWHU9wy93g8dAJwRhX1iZ5N7DGH6jP/Kc3oTiIEDcGv/80t0fCS+eyokqiLdNjuDQtqt JaVY8p95aeW0fcQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420940576154100 Convert the OnOffSplit property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- accel/kvm/kvm-all.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 92af42503b1..94b64cde621 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" @@ -4142,22 +4143,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; @@ -4174,10 +4170,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 @@ -4306,11 +4299,12 @@ static void kvm_accel_class_init(ObjectClass *oc, c= onst void *data) ac->allowed =3D &kvm_allowed; ac->gdbstub_supported_sstep_flags =3D kvm_gdbstub_sstep_flags; =20 - object_class_property_add(oc, "kernel-irqchip", "on|off|split", - NULL, kvm_set_kernel_irqchip, - NULL, NULL); - object_class_property_set_description(oc, "kernel-irqchip", - "Configure KVM in-kernel irqchip"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "kernel-irqchip", + .qapi_type =3D &OnOffSplit_type_info, + .set =3D kvm_set_kernel_irqchip, + .description =3D "Configure KVM in-kernel irqchip", + )); =20 object_class_property_add(oc, "kvm-shadow-mem", "int", kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_mem, --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420949; cv=none; d=zohomail.com; s=zohoarc; b=T2oTTVLtBKuRIZ8J2CGe/bImwdeziLcsaJLuyAL9zJZBFTI90rJOWTieCFMYl1uH+va/+RRLCzwzdeSgNaVTDmuW7+isZscPCDZM0BGqVNAA5utpXhDEGDaC7Wh8A0cyMlRKlebp1qHaixHSYkRQIJPhAtxzuropIDLnwau0IZg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420949; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+BND9yUE3GxPUKfjsdV3K95sn9j97eyDe1saK9Z1IW0=; b=N8ZwPadgajGkjMKi4Imqw06zRaMHmKrGnxc2HHhZyK2eEL/bj+Qv3HIlQNEyEK9LSztnZWPkNv1SQbz1SRfAl5A9pHTXXNSbMNXa/y6fTYURHKa7ozq/UckJMhAxCbn2gdjglSGupUvWDFiFBQ3PU9DgiiiYYHsjh/CiwZvbrac= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420949845216.56430876383013; Sun, 10 May 2026 06:49:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4Wl-0008Ua-Kh; Sun, 10 May 2026 09:49:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Wa-00082r-J9 for qemu-devel@nongnu.org; Sun, 10 May 2026 09:48:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4WX-0005QQ-WE for qemu-devel@nongnu.org; Sun, 10 May 2026 09:48:51 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-508-xptvokV2OzWBYgXcVzmBMg-1; Sun, 10 May 2026 09:48:47 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CE95419560BB for ; Sun, 10 May 2026 13:48:46 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 54B3E19560A6; Sun, 10 May 2026 13:48:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420929; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+BND9yUE3GxPUKfjsdV3K95sn9j97eyDe1saK9Z1IW0=; b=TAcyr4uhp8o+LFU1z3a1btZpKRyig4k3xEggKrcfZdhkLH4Cx2eTlmH+wuNSlqjBuqauCd aSPHuoBLfF584mkVKvqX4LXApnFdyeDERME8wBGVKr1bA+JGnIUFUjDXL+kcnOgIWeoJj0 75Vx4O6qnmsAzXZXqa8Dnw4sBVNkL2M= X-MC-Unique: xptvokV2OzWBYgXcVzmBMg-1 X-Mimecast-MFC-AGG-ID: xptvokV2OzWBYgXcVzmBMg_1778420927 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:24 +0400 Subject: [PATCH 27/54] whpx: convert OnOffSplit property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-27-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2331; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=SvoSExUYXPg6sVDa5rVzKfXzAc13YDagtIfmWECFwp8=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItveMqrfVIU/Eix9gwEk2txaSX6nIc77kP9R sOxiT1KSmuJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbwAKCRDa6OEJdZac 5UIsEAClL15ukfKZcv9gvdyDGb1n4cebPxryvugoIboXjRR1crRFy4wsEJJ8CyPtJEgzFt2ZhuK yAgicIX0mm3JK/9fr6LR7K+DigofI0q+ysxAmbhgm6hTlevMcZ3IbmBgHgT/AgPFdvMAbUgNM7G yfc5Ho6uhD7JuAU95uFVGQ2KC5NBBz96NUsGLne6HGaczvTHHNQv9vjn3/JtDeeua85DbXzgNoD 3VlNcCUxd32nHXMgYwyE23Z/rp5nODykgjoN3nYcrCLox7nX1UY5VtA/QnWm02xCqvRwGFYaVg2 NFaANeTqEMv09QgonhOCE1DJ6T5S3NbFoDvnLsHwRBBXUDP2I9XLEiTk93hbl62opYbachtOAAW ApGGMSOe6RMOWCX7K8sD8lIsBb9nDStlgKLtTLiZ2s+++RMJJ99b1iGMRmiK/6Iw6LQeVwI5nsw BoCSmFwFJC/jX77zrElwk3tk9sbKZGv0zITLqGvzJFoxuy5BeQSZr/0X3fBl9IivGuy8R7JQ52D tXDbFp38nngLBTDGI/sdLuv4yfFFgy91EQ/C6n2Cism/RDs7wHBUCjDDw56AUuj58qmfTiDFVqQ ElI42ICnj4ORGws2zBE7qPN4/WWSwm7fQVNDvHkQpNWZbK+UnNJdSNZ1iiHaOLrQNFBcjOy+/Si 68KrorE0crdvmRg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420950270158500 Convert the OnOffSplit property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- accel/whpx/whpx-common.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c index 187938c02b5..5d4b405e56d 100644 --- a/accel/whpx/whpx-common.c +++ b/accel/whpx/whpx-common.c @@ -434,18 +434,12 @@ error: return false; } =20 -static void whpx_set_kernel_irqchip(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void whpx_set_kernel_irqchip(Object *obj, int value, + Error **errp) { struct whpx_state *whpx =3D &whpx_global; - OnOffSplit mode; =20 - if (!visit_type_OnOffSplit(v, name, &mode, errp)) { - return; - } - - switch (mode) { + switch (value) { case ON_OFF_SPLIT_ON: whpx->kernel_irqchip_allowed =3D true; whpx->kernel_irqchip_required =3D true; @@ -463,11 +457,7 @@ static void whpx_set_kernel_irqchip(Object *obj, Visit= or *v, break; =20 default: - /* - * The value was checked in visit_type_OnOffSplit() above. If - * we get here, then something is wrong in QEMU. - */ - abort(); + g_assert_not_reached(); } } =20 @@ -518,11 +508,12 @@ static void whpx_accel_class_init(ObjectClass *oc, co= nst void *data) ac->pre_resume_vm =3D whpx_pre_resume_vm; ac->allowed =3D &whpx_allowed; =20 - object_class_property_add(oc, "kernel-irqchip", "on|off|split", - NULL, whpx_set_kernel_irqchip, - NULL, NULL); - object_class_property_set_description(oc, "kernel-irqchip", - "Configure WHPX in-kernel irqchip"); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "kernel-irqchip", + .qapi_type =3D &OnOffSplit_type_info, + .set =3D whpx_set_kernel_irqchip, + .description =3D "Configure WHPX in-kernel irqchip", + )); object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( .name =3D "hyperv", .description =3D "Configure Hyper-V enlightenments", --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420956; cv=none; d=zohomail.com; s=zohoarc; b=DXvAIpfmNIMzUO+5EHy95nQMub/P47YEzvEpALKnn0uhmj3SA4R+X8WZlripedbk+1Y8iZ/yVJYFBUOvKUbr2hOLuJg5g+EJVKVs9H8f34uWp+6nXURVEeDOKYmzNfATOzikzcI5DzT6K/arbNuHujgUfObZPiIiIEF+8sKtH0I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420956; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=97E8kvIBUdnloLAg6qkOj+YpOrhmZ/2mtZ7+0+Dz2Gg=; b=imadXdFiU3GVtrEuVzg2gfWLqa6MMWUt3p7VY/VKcDXGM2G++v2LmGLpyD4W+Q40TqaU1TSHIVhQYmXzrxXlLUtXhoOJg2JNq6pec8jpcPUQoFuDj/rM2NHZ2OA1LUoxSHCKqUrcVPtlSIUDDiKb0QDzcDwvy55nPnLJRgnmMrE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420956003683.8067276786984; Sun, 10 May 2026 06:49:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4Wn-0000Hq-Am; Sun, 10 May 2026 09:49:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Wl-0008Uy-Gj for qemu-devel@nongnu.org; Sun, 10 May 2026 09:49:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Wj-0005Rp-MS for qemu-devel@nongnu.org; Sun, 10 May 2026 09:49:03 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-107-TQSA3jyqMuOP8LNf3pYNTw-1; Sun, 10 May 2026 09:48:59 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BEA1A180034C for ; Sun, 10 May 2026 13:48:58 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 534801800240; Sun, 10 May 2026 13:48:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=97E8kvIBUdnloLAg6qkOj+YpOrhmZ/2mtZ7+0+Dz2Gg=; b=T7Id4/kNqxiIPM2NUcnQsCvtn0agOtxnD5lfXkVAreWDUMZOqqgV2CbMS/SOlE9ecK7DYF V4lnans2ozVM28ujDTg//G4beyga/1vYvcz6Yp/UYmP2bW0RAgLGhut4QpCvUIBtQ4aLFB yk5T6fzRNJAUC0uzWICREWoXqzSfKTI= X-MC-Unique: TQSA3jyqMuOP8LNf3pYNTw-1 X-Mimecast-MFC-AGG-ID: TQSA3jyqMuOP8LNf3pYNTw_1778420938 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:25 +0400 Subject: [PATCH 28/54] ppc/spapr-caps: convert to QAPI-aware property registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-28-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=6645; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=FPDD9TJ/rA9d7j48YFdPwG+J6OGlivYBOYyNTt7ax0k=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItvq94JydJi+g5KOzFRQEcogY3zoCu4//xmi aHA6PvJbaCJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLbwAKCRDa6OEJdZac 5egkD/4lrMflC90SmH/8CIHsgVlyft0Tc7lsOMXVYVRm5qAnMTrPRsQky6Fo4TFLWGJtgnVa/sl Us4kHt8G3JlShTHMKo1IgVFvW4qIbvfiI6gM84TEU7FeSXKqd5SKj4RSUHLkNoNsr4mhnb+56dA GzlfTiCdbB6lSDkJ7rs9nvtLTEP21+bsjteCTa/Vm59KN+BK/en7Z1qI6gtsutVS335gb02tarI 7kpdfoEYUNJVaXUN4eQA2GoKhAgQAtKOVfsRXyYjcTECOOdAqzua8urL2xUSn2sooi0y+mw3ky7 rz4rBrd/sPA2Q3Jc3+6BN8GaLKInkhWbCSP/cC55yVR16aHByu1hDYLWtmhDSm5Cje8ftJta3fL 5637v17u0ApKvVekTLnPDqongM9T/YZ3uuWwcVPUJgM8TuQh2sJlqX8TnVn3NGLR1/VqKt1PQhp fE5WpUf4Rcqs7yI4gFnY4im1kGR3nX+szNv0KuBzluOSCuKXu/aMFaY2xdrFgSJHJz9AEyw486G gmz2WsB390ALkK55hqSLIpxN6w3SNswWHTBL9mSQi772ywez07XZeXdKiHvS4f2Um/ug9UKOmLg T4A92FKexTghdwWLQ3JmjpcsALLvklQmtWkqlQQt6bAPxPOdpnQsWyAqvEwQcJFTzXW9+c05SnY TqcokwfQMlt1UVw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=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: 1778420957086154100 Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/ppc/spapr_caps.c | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index f4a26a85b50..779a5605a8f 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu/error-report.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "system/hw_accel.h" @@ -59,7 +60,7 @@ typedef struct SpaprCapabilityInfo { /* Getter and Setter Function Pointers */ ObjectPropertyAccessor *get; ObjectPropertyAccessor *set; - const char *type; + const QAPITypeInfo *type; /* Possible values if this is a custom string type */ SpaprCapPossible *possible; /* Make sure the virtual hardware can support this capability */ @@ -725,7 +726,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_HTM, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_htm_apply, }, [SPAPR_CAP_VSX] =3D { @@ -734,7 +735,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_VSX, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_vsx_apply, }, [SPAPR_CAP_DFP] =3D { @@ -743,7 +744,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_DFP, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_dfp_apply, }, [SPAPR_CAP_CFPC] =3D { @@ -752,7 +753,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_CFPC, .get =3D spapr_cap_get_string, .set =3D spapr_cap_set_string, - .type =3D "string", + .type =3D &str_type_info, .possible =3D &cap_cfpc_possible, .apply =3D cap_safe_cache_apply, }, @@ -762,7 +763,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_SBBC, .get =3D spapr_cap_get_string, .set =3D spapr_cap_set_string, - .type =3D "string", + .type =3D &str_type_info, .possible =3D &cap_sbbc_possible, .apply =3D cap_safe_bounds_check_apply, }, @@ -774,7 +775,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_IBS, .get =3D spapr_cap_get_string, .set =3D spapr_cap_set_string, - .type =3D "string", + .type =3D &str_type_info, .possible =3D &cap_ibs_possible, .apply =3D cap_safe_indirect_branch_apply, }, @@ -784,7 +785,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_HPT_MAXPAGESIZE, .get =3D spapr_cap_get_pagesize, .set =3D spapr_cap_set_pagesize, - .type =3D "int", + .type =3D &size_type_info, .apply =3D cap_hpt_maxpagesize_apply, .cpu_apply =3D cap_hpt_maxpagesize_cpu_apply, }, @@ -794,7 +795,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_NESTED_KVM_HV, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_nested_kvm_hv_apply, }, [SPAPR_CAP_NESTED_PAPR] =3D { @@ -803,7 +804,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_NESTED_PAPR, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_nested_papr_apply, }, [SPAPR_CAP_LARGE_DECREMENTER] =3D { @@ -812,7 +813,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_LARGE_DECREMENTER, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_large_decr_apply, .cpu_apply =3D cap_large_decr_cpu_apply, }, @@ -822,7 +823,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_CCF_ASSIST, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_ccf_assist_apply, }, [SPAPR_CAP_FWNMI] =3D { @@ -831,7 +832,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_FWNMI, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_fwnmi_apply, }, [SPAPR_CAP_RPT_INVALIDATE] =3D { @@ -840,7 +841,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_RPT_INVALIDATE, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_rpt_invalidate_apply, }, [SPAPR_CAP_AIL_MODE_3] =3D { @@ -849,7 +850,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_AIL_MODE_3, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_ail_mode_3_apply, }, [SPAPR_CAP_DAWR1] =3D { @@ -858,7 +859,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D= { .index =3D SPAPR_CAP_DAWR1, .get =3D spapr_cap_get_bool, .set =3D spapr_cap_set_bool, - .type =3D "bool", + .type =3D &bool_type_info, .apply =3D cap_dawr1_apply, }, }; @@ -1069,9 +1070,9 @@ void spapr_caps_add_properties(SpaprMachineClass *smc) g_autofree char *name =3D g_strdup_printf("cap-%s", cap->name); g_autofree char *desc =3D g_strdup(cap->description); =20 - object_class_property_add(klass, name, cap->type, - cap->get, cap->set, - NULL, cap); + object_class_property_add_qapi(klass, name, cap->type, + cap->get, cap->set, + NULL, cap); =20 object_class_property_set_description(klass, name, desc); } --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420962; cv=none; d=zohomail.com; s=zohoarc; b=BBaAjMtw5JB2MmsyCU1iq7MdDA6zEx5wBs5tOikA8tF1fqfXvRdr66duEGWnyTVfeM7zJ5nNQZEEwq2pIu66mF3GBly+t2BU62BLLgSFOZG+DcZX+qnn12rVq5kiTthOAhzRvZJddE+eChhRX5LNKsOpzIyjxaDf0QUzlYGBXnw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420962; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+ev1PeSHIFk2Iiuk7tPiVQatd/LOr8RRJQ84xO9C9mM=; b=jjLbcbGj7pgeXZXPNq5yeqjWp8JYUdm6qXQKL4WzChAznBj82yIJCMboMdZiRj2Y1zXGwlPUBtnaIZkKgxM948XhKOi85kAmHyKcWdXi+FKNAPtOLa+ZB7lFAg6e45y37Wu36U+JC/ihQueLzWOGF4sBkFeivIBbAkca4R9CBg0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420962493623.9772524682076; Sun, 10 May 2026 06:49:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4Wu-0000qP-Ck; Sun, 10 May 2026 09:49:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Wt-0000jt-7z for qemu-devel@nongnu.org; Sun, 10 May 2026 09:49:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Wr-0005Sm-P5 for qemu-devel@nongnu.org; Sun, 10 May 2026 09:49:10 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-624-S0LRcpGWOYKGaE2N4ctL6A-1; Sun, 10 May 2026 09:49:07 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C739D19560B6 for ; Sun, 10 May 2026 13:49:06 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0759318004A3; Sun, 10 May 2026 13:49:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+ev1PeSHIFk2Iiuk7tPiVQatd/LOr8RRJQ84xO9C9mM=; b=Vm0NlfcDMurF63XibpUJQswTh9EY1ge9EXxgGAndpZCWARyT7mLJ6iTtuaNfMgDIN4pRZN wVtWn/+p3+JKp990qjQ0rCFpcFmWmP3Dvk1UGhwlLDYXpmjz1hwxJ5G3BcC4vr7H4Xngl1 SVBpZRvnTP/g4npOjhJVIIOOGETro6Q= X-MC-Unique: S0LRcpGWOYKGaE2N4ctL6A-1 X-Mimecast-MFC-AGG-ID: S0LRcpGWOYKGaE2N4ctL6A_1778420946 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:26 +0400 Subject: [PATCH 29/54] system/memory: fix "priority" property typename MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-29-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=888; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=Xrt1FBAZRulDtkYOHNAjkH2vkSnHoHVfXqM5I051WW0=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItwlCq44+i++irgLdqQFKvGMJ34t+iJ+9il4 CXrieaHP1yJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcAAKCRDa6OEJdZac 5QzjEACxtuwQHVTk7UCY1t3/AcMT1/EGABJtXY9T0+4683ocEG9ZR0LhcBhSnseAFIDSejtnUfx p+mRYEXXyMF6mJ4HlpUAy1gFqsS/XAQUMQhHvPPBsz7DXpaMPn6TbMKI8c0Gf7QYcidMiX9/onb 64ZNWnB6TsMIqv6NDS5R2RO92QWn39cYSCsQVHCuJwE3ck5fINPh6PJRLuYK1tNgQryNDMbDJ1w nWo5da0Apvh72EOaSwukjmCJPzU/czqW5Ldwlvv0vendsDkHQksdJKIqAESX1OIe3aamwn2P/zD WskjOB10SDv/9lpYkpQ7ZLJ0gjfkbzygK7a0FBhv6XYf4enupqOqJUrhNr1FBVcsumtks8TG1tW BxFGSZMo3ZkRgD3pP6CY7ZvmXQE+ZN9YqUYWhuGRzplUYR0r4NQJ0fTY7FEczbvDEYLbrn5Lo+Q mZQL4wbbGoE3xJRVuDQne8+sKI9G/8l6LwnNUfv7+ZjgX7qH+oYwiT3RZRnC5K9BI1uv2d8zII6 tmcvWBqMvo2k1L7051r6kITxAmyFVMEh7idj2ikT5OzcWmgIE26+2ZkWRG0Hi/8FmZn9McEVwnQ S3rR/Nrxz0mPgZhK8azRiTI4mDwElko+P7k3QluWRAaOiWcYyzj4uMaUyXRLCIsQ8Ku+La/b7tp BBJhiLqw49ZNWpw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420964321158500 The value and the getter are int32. Fixes: d33382da9ab ("memory: MemoryRegion: Add may-overlap and priority pro= ps") Signed-off-by: Marc-Andr=C3=A9 Lureau --- system/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/memory.c b/system/memory.c index 739ba11da6f..aaf5ec40230 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1316,7 +1316,7 @@ static void memory_region_initfn(Object *obj) =20 object_property_add_uint64_ptr(OBJECT(mr), "addr", &mr->addr, OBJ_PROP_FLAG_READ); - object_property_add(OBJECT(mr), "priority", "uint32", + object_property_add(OBJECT(mr), "priority", "int32", memory_region_get_priority, NULL, /* memory_region_set_priority */ NULL, NULL); --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420974; cv=none; d=zohomail.com; s=zohoarc; b=SDFLMu9AziDG4x5C/DUutvT7mor4KqBtPs3HVWo6+JPUX9wX10AGxXogfF3To4pBI2vaddA/+B7jgrXFG2gaO4YdJ1wXfkrHeWRzIoze3AN+9GA+/sLc/5r5BWrhE7btqqtpqWNN1W4+68zYTVOiug2WHvre51M6HY4DzcJ9QOY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420974; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HcsOJYbV1t9bvR0CbyRVNBwzQwlu40sYNc0EtLJX0Lk=; b=KvT++0Dx21Uin3vF7SbJOPCq9Km+PmhJ63G6CNtN6D3YwlPBl97yRHAQB41RkLxH1CVCPdhRlreUmRu46yd/56N6ay+E6X7TMdyCuf7ukT4Xue/2vpNWztnG9SZODXxvVs+xUONwlAN7h9UW948LE+dxOv/TIGng3idIOMiERw4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420974832602.9490868083501; Sun, 10 May 2026 06:49:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4X9-0001L9-PW; Sun, 10 May 2026 09:49:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4X3-00018S-FI for qemu-devel@nongnu.org; Sun, 10 May 2026 09:49:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4X0-0005Tf-IT for qemu-devel@nongnu.org; Sun, 10 May 2026 09:49:20 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-670-chIUq745PtSfvMceFDeLuQ-1; Sun, 10 May 2026 09:49:16 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4A6231800359 for ; Sun, 10 May 2026 13:49:15 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CBFD53002D30; Sun, 10 May 2026 13:49:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420957; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HcsOJYbV1t9bvR0CbyRVNBwzQwlu40sYNc0EtLJX0Lk=; b=LsIneutSmjm4poOwYYyEEY1Y7AJSkvV1N+uVGzNh9by7Vj2Siw0jQ6oe74eFtVoQWGEySs nW9WaZX15UkU2o1qErlDS4GC/SIPYfKrXGK9BhXNesKkVDvTgGBa8PJNrEeUyiRJpfipEl kv66qgFqTiFqtdbe/UXoZgcrsh6xt4s= X-MC-Unique: chIUq745PtSfvMceFDeLuQ-1 X-Mimecast-MFC-AGG-ID: chIUq745PtSfvMceFDeLuQ_1778420955 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:27 +0400 Subject: [PATCH 30/54] hw/mem/nvdimm: fix "size" property typename MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-30-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=712; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=iLi46W9WFHxexD0wQx3j4fn0Sh6woma/VJ5/jKMvPFQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItwixCVrx75OFL/oiOSxn3WvU/rhwb32vR/Y 42eH2qwAYSJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcAAKCRDa6OEJdZac 5c3UD/98YEeNU/2jKyRwum5ot9eD8FlwwDBVLuiv8hzhdf59kcT8l4QUsRK4akaZ9pbENsCKJ4Q g+Ql35hoQTh3Ps+ugWN5szXABTb3aUsZJA2kGioqeiO0h4CwfKASyKZK2D4we9kEx3Qe8oFVqJT pdYQ/akITuZvyp1oBuZ9lm3bU/1EbyzSe+7dzMICiiuGpZwzPC2ikTLuu0hrfaKilvzlQDjJmLh JAj4L9Hg/mfI6txw6u8hUjO8jkPJo+gBj0IMsJjn7dCMd1yVLrzC8/8sPC7ukc3a0buctIt9HuV PPNSz46F3xM9M1Q05QUsk8ywBfY52v0tbnstvSeX/hJAXg0HRm+exfVcw1C6aV+CTT2on9mHzEX bjwiSAdFdenEqw3BNDdbdsJtt28IRAYT1svbRfsvLjuorQH37VVPeoEEZSnlYUdg+UWhXT3GEP6 1lVR+4giOcUQFCipGuYTSuI8Tu9sOGQ70OM2lms1o3xcKatAMK0KS9YHcXg62PYehsPEGEFx2VI rGYGNkB4qwiv9XJlwlncMOhTnN/cnHFnQIRxG9ojQDw45L7HImVF5o5OYpovMKnllj3HCPKkby8 0XuyWwGZXbDjNi9HaQfNAK4J2Se6iPP67stN0Ov0ZK7nNJHiLDjsNbPGYvO4gC3nctW7zHJ1GTx DIM0pCFR0yojEug== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420977158154100 The getter/setter use visit_type_size(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- 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 b7032525271..cf8a4d8c5f2 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -99,7 +99,7 @@ static void nvdimm_set_uuid(Object *obj, Visitor *v, cons= t char *name, =20 static void nvdimm_init(Object *obj) { - object_property_add(obj, NVDIMM_LABEL_SIZE_PROP, "int", + object_property_add(obj, NVDIMM_LABEL_SIZE_PROP, "size", nvdimm_get_label_size, nvdimm_set_label_size, NULL, NULL); =20 --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420998; cv=none; d=zohomail.com; s=zohoarc; b=INpRcNKN7oGCm9F2/mpD2JUUHzbw76Tb2iwOI6oBIsW6M2bxN34/saI0a5q6nEc2htDOMyJmtbkKbeh2VOP+FS7KgGR4xgKJO+DJj+VXkHxaYxemq2UQ5TEpcIA7soGxJ2aTsIdfEyE+wfOYm0vVZxciM9wUQ4rcNZm9/U8aNb8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420998; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=G+6hkyrm0ZKOaYd72Ww0P/FFcCghQun4Zis7Z9ad7RI=; b=T5kNF/BLD9+1C85TsV92ZmcKIuvPERl4v8/3o6W5sgPDdp9XsRoh/hoqLgalycFR1rTrdxP6mbNmFGXJ27E3nkt9oNjBV1a3n/hZFxptc8/jMUfPRn6vOzmhXFfzqtafGxMl96d4MCRvOygMhFf+h1vrNGqzepBtFWOt590Rd0U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420998338273.1055370953551; Sun, 10 May 2026 06:49:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4XQ-0001qJ-6S; Sun, 10 May 2026 09:49:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4XH-0001ao-S7 for qemu-devel@nongnu.org; Sun, 10 May 2026 09:49:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4XD-0005Wh-BB for qemu-devel@nongnu.org; Sun, 10 May 2026 09:49:35 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-531-fQimRupANOqT7Tb4_21z8w-1; Sun, 10 May 2026 09:49:27 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 057091800578 for ; Sun, 10 May 2026 13:49:27 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8054F3002D30; Sun, 10 May 2026 13:49:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=G+6hkyrm0ZKOaYd72Ww0P/FFcCghQun4Zis7Z9ad7RI=; b=d+G03ehjGy96wPkhJMJ49ck0MNz7kBfW8vxW2fwQnPmyFPt8DOfvuJaJGYGe/uthnRu9YZ xEGT7DRFUeV0jnHjyRV+7/Wiv5+AF/iU0TBLmrxlGsgOgYPs3IDh1N1rq92/8E9XPfUl9l VFIV794KXuvAJs/DLy3dIPSBiHAwJ7I= X-MC-Unique: fQimRupANOqT7Tb4_21z8w-1 X-Mimecast-MFC-AGG-ID: fQimRupANOqT7Tb4_21z8w_1778420967 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:28 +0400 Subject: [PATCH 31/54] qom: convert scalar properties to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-31-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=107457; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=Gcg1fjjpPfjnR2k23IKlYGMiR9y0QJ70qxwSWdRKrG4=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItw8bXURhHTuQ6Q0NrmC7v18nmrA49P1PUsn GLoDF6FeuSJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcAAKCRDa6OEJdZac 5TItD/4tmCg41Q4W2t66fKJPDTvELrgSi/5srxoM6h8q15/IRHRIuCTiGJkMnHTzMBQogvewq6F CH3UyjHrhkSw5rUc3kZWyDkNcpFmyW5y1bFpW05wlnM0c31yowZEyXMtu+05jIMf50dqt2pNvQR bwlnhHyDUBH50FDeLGbR3kAsoclDEGAxqQeqP0WUxLfaKz2cb7cIzjnpBivi/hJr3Khayc/EnyY lKSUGoRsQBsSc8TCJi8b5dOwk5dJlu+79mxzpgtxR0PQY9EQaEj0fCUtj+vGVzCnUKdoosJuT4S KsuPbHTfsC6hOrcL0puxUpmW1BhNL8fUKoMTgvpMc3plYpGWvf6aBGNp2oVKfdCJtnQqQvOv59G RrfMnaYwXuoNKf35hAcEZXKa7UD55LcpuW8ItmKFmbooK8xpm28IxrwrqMplF+NHl8rFpZkwYx5 JYRjv+Fk3AvZrbcm6Je2oQ+kx7fZRYq37zf7fP5KEb3uRifHTrO1ddAxdPd89zHevBDYEy3qr+f 0DuFbVxjupR2VCtliAiDBe82HyS7syBxir3JdgmuxOwUFjo384+BAJasDZEznjRp8yv19HTecSP H2BDagr0veJSfsVsBDt48yjSFHVv6rS1+T0WxWN8JmN6VonNpyhZVdop0xpU1mtZfcUS2z4/mHF WUMyXrlnCORniyA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=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: 1778421000744158500 Signed-off-by: Marc-Andr=C3=A9 Lureau --- accel/kvm/kvm-all.c | 5 ++- accel/nitro/nitro-accel.c | 3 +- accel/tcg/tcg-all.c | 3 +- backends/cryptodev.c | 7 ++-- backends/hostmem-file.c | 4 +- backends/hostmem-memfd.c | 3 +- backends/hostmem.c | 6 +-- block/throttle-groups.c | 5 ++- crypto/secret_keyring.c | 9 +++-- event-loop-base.c | 7 ++-- hw/acpi/ich9.c | 3 +- hw/acpi/pci.c | 5 ++- hw/arm/virt.c | 4 +- hw/core/clock.c | 3 +- hw/core/machine.c | 2 +- hw/cpu/core.c | 10 +++-- hw/cxl/cxl-host.c | 2 +- hw/gpio/aspeed_gpio.c | 5 ++- hw/gpio/aspeed_sgpio.c | 3 +- hw/gpio/pca9552.c | 6 ++- hw/gpio/pca9554.c | 6 ++- hw/gpio/stm32l4x5_gpio.c | 5 ++- hw/i386/pc.c | 6 +-- hw/i386/sgx-epc.c | 3 +- hw/i386/x86.c | 6 +-- hw/ide/ide-dev.c | 3 +- hw/intc/apic_common.c | 3 +- hw/loongarch/virt.c | 2 +- hw/mem/nvdimm.c | 7 ++-- hw/mem/pc-dimm.c | 3 +- hw/misc/aspeed_lpc.c | 73 +++++++++++++++++++++++++--------= ---- hw/misc/aspeed_sdmc.c | 3 +- hw/misc/npcm7xx_mft.c | 3 +- hw/net/ne2000-isa.c | 3 +- hw/nvme/ctrl.c | 3 +- hw/pci-bridge/pci_expander_bridge.c | 3 +- hw/pci-host/i440fx.c | 35 ++++++++++-------- hw/pci-host/pnv_phb3.c | 5 ++- hw/pci-host/pnv_phb4.c | 5 ++- hw/pci-host/q35.c | 9 +++-- hw/ppc/spapr_drc.c | 3 +- hw/riscv/microchip_pfsoc.c | 3 +- hw/s390x/sclpcpi.c | 8 ++-- hw/s390x/virtio-ccw-mem.c | 3 +- hw/sensor/adm1266.c | 3 +- hw/sensor/adm1272.c | 9 +++-- hw/sensor/emc141x.c | 9 +++-- hw/sensor/isl_pmbus_vr.c | 19 +++++----- hw/sensor/lsm303dlhc_mag.c | 9 +++-- hw/sensor/max34451.c | 5 ++- hw/sensor/tmp105.c | 3 +- hw/sensor/tmp421.c | 9 +++-- hw/usb/dev-storage-classic.c | 3 +- hw/virtio/virtio-balloon.c | 3 +- hw/virtio/virtio-mem-pci.c | 3 +- hw/virtio/virtio-mem.c | 18 +++++---- hw/xen/xen-pvh-common.c | 9 +++-- iothread.c | 9 +++-- net/colo-compare.c | 7 ++-- net/dump.c | 6 ++- net/filter-buffer.c | 3 +- qom/object.c | 42 ++++++++++----------- system/bootdevice.c | 3 +- system/memory.c | 5 ++- target/arm/cpu64.c | 11 +++--- target/arm/kvm.c | 3 +- target/arm/tcg/cpu64.c | 5 ++- target/i386/cpu.c | 12 +++--- target/i386/kvm/kvm.c | 8 ++-- target/i386/sev.c | 2 +- target/ppc/compat.c | 3 +- target/riscv/cpu.c | 11 +++--- target/riscv/kvm/kvm-cpu.c | 7 ++-- target/riscv/tcg/tcg-cpu.c | 7 ++-- target/s390x/cpu_models.c | 5 ++- tests/unit/test-qdev-global-props.c | 11 ++++-- ui/console.c | 3 +- util/thread-context.c | 7 ++-- 78 files changed, 336 insertions(+), 234 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 94b64cde621..84033b77473 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" @@ -4306,13 +4307,13 @@ static void kvm_accel_class_init(ObjectClass *oc, c= onst void *data) .description =3D "Configure KVM in-kernel irqchip", )); =20 - object_class_property_add(oc, "kvm-shadow-mem", "int", + object_class_property_add_qapi(oc, "kvm-shadow-mem", &int_type_info, kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_mem, NULL, NULL); object_class_property_set_description(oc, "kvm-shadow-mem", "KVM shadow MMU size"); =20 - object_class_property_add(oc, "dirty-ring-size", "uint32", + object_class_property_add_qapi(oc, "dirty-ring-size", &uint32_type_inf= o, kvm_get_dirty_ring_size, kvm_set_dirty_ring_size, NULL, NULL); object_class_property_set_description(oc, "dirty-ring-size", diff --git a/accel/nitro/nitro-accel.c b/accel/nitro/nitro-accel.c index a1e97a9162e..05841c1277d 100644 --- a/accel/nitro/nitro-accel.c +++ b/accel/nitro/nitro-accel.c @@ -29,6 +29,7 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qemu/rcu.h" @@ -238,7 +239,7 @@ static void nitro_accel_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, "debug-mode", "Start enclave in debug mode (enables console output)"); =20 - object_class_property_add(oc, "enclave-cid", "uint64", + object_class_property_add_qapi(oc, "enclave-cid", &uint64_type_info, nitro_get_enclave_cid, nitro_set_enclave_cid, NULL, NULL); diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 8eb4a6b89e8..4e9d7a1da33 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" @@ -272,7 +273,7 @@ static void tcg_accel_class_init(ObjectClass *oc, const= void *data) tcg_get_thread, tcg_set_thread); =20 - object_class_property_add(oc, "tb-size", "int", + object_class_property_add_qapi(oc, "tb-size", &int_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 79f8882d3be..014774d60fd 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" @@ -616,15 +617,15 @@ cryptodev_backend_class_init(ObjectClass *oc, const v= oid *data) ucc->can_be_deleted =3D cryptodev_backend_can_be_deleted; =20 QTAILQ_INIT(&crypto_clients); - object_class_property_add(oc, "queues", "uint32", + object_class_property_add_qapi(oc, "queues", &uint32_type_info, cryptodev_backend_get_queues, cryptodev_backend_set_queues, NULL, NULL); - object_class_property_add(oc, "throttle-bps", "uint64", + object_class_property_add_qapi(oc, "throttle-bps", &uint64_type_info, cryptodev_backend_get_bps, cryptodev_backend_set_bps, NULL, NULL); - object_class_property_add(oc, "throttle-ops", "uint64", + object_class_property_add_qapi(oc, "throttle-ops", &uint64_type_info, cryptodev_backend_get_ops, cryptodev_backend_set_ops, NULL, NULL); diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 52b62f71533..399aae02e2c 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", "int", + object_class_property_add_qapi(oc, "align", &int_type_info, file_memory_backend_get_align, file_memory_backend_set_align, NULL, NULL); - object_class_property_add(oc, "offset", "int", + object_class_property_add_qapi(oc, "offset", &int_type_info, file_memory_backend_get_offset, file_memory_backend_set_offset, NULL, NULL); diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index 923239f9cf6..ab069a70379 100644 --- a/backends/hostmem-memfd.c +++ b/backends/hostmem-memfd.c @@ -16,6 +16,7 @@ #include "qemu/memfd.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qom/object.h" #include "migration/cpr.h" =20 @@ -145,7 +146,7 @@ memfd_backend_class_init(ObjectClass *oc, const void *d= ata) memfd_backend_set_hugetlb); object_class_property_set_description(oc, "hugetlb", "Use huge pages"); - object_class_property_add(oc, "hugetlbsize", "int", + object_class_property_add_qapi(oc, "hugetlbsize", &int_type_info, memfd_backend_get_hugetlbsize, memfd_backend_set_hugetlbsize, NULL, NULL); diff --git a/backends/hostmem.c b/backends/hostmem.c index d0977552b40..ab20e9b79dc 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -526,7 +526,7 @@ host_memory_backend_class_init(ObjectClass *oc, const v= oid *data) host_memory_backend_set_prealloc); object_class_property_set_description(oc, "prealloc", "Preallocate memory"); - object_class_property_add(oc, "prealloc-threads", "int", + object_class_property_add_qapi(oc, "prealloc-threads", &int_type_info, host_memory_backend_get_prealloc_threads, host_memory_backend_set_prealloc_threads, NULL, NULL); @@ -537,13 +537,13 @@ host_memory_backend_class_init(ObjectClass *oc, const= void *data) object_property_allow_set_link, OBJ_PROP_LINK_STRONG); object_class_property_set_description(oc, "prealloc-context", "Context to use for creating CPU threads for preallocation"); - object_class_property_add(oc, "size", "int", + object_class_property_add_qapi(oc, "size", &int_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", "int", + object_class_property_add_qapi(oc, "host-nodes", &int_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 b161576432a..2a17ae79f74 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" @@ -977,9 +978,9 @@ static void throttle_group_obj_class_init(ObjectClass *= klass, =20 /* individual properties */ for (i =3D 0; i < sizeof(properties) / sizeof(ThrottleParamInfo); i++)= { - object_class_property_add(klass, + object_class_property_add_qapi(klass, properties[i].name, - "int", + &int_type_info, throttle_group_get, throttle_group_set, NULL, &properties[i]); diff --git a/crypto/secret_keyring.c b/crypto/secret_keyring.c index 78d7f09b3b9..de813e79d8d 100644 --- a/crypto/secret_keyring.c +++ b/crypto/secret_keyring.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include #include +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/error.h" #include "qom/object_interfaces.h" #include "trace.h" @@ -108,10 +109,10 @@ qcrypto_secret_keyring_class_init(ObjectClass *oc, co= nst void *data) QCryptoSecretCommonClass *sic =3D QCRYPTO_SECRET_COMMON_CLASS(oc); sic->load_data =3D qcrypto_secret_keyring_load_data; =20 - object_class_property_add(oc, "serial", "int32_t", - qcrypto_secret_prop_get_key, - qcrypto_secret_prop_set_key, - NULL, NULL); + object_class_property_add_qapi(oc, "serial", &int32_type_info, + qcrypto_secret_prop_get_key, + qcrypto_secret_prop_set_key, + NULL, NULL); } =20 =20 diff --git a/event-loop-base.c b/event-loop-base.c index 8ca143bea43..284f2f56b85 100644 --- a/event-loop-base.c +++ b/event-loop-base.c @@ -14,6 +14,7 @@ #include "qemu/osdep.h" #include "qom/object_interfaces.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "block/thread-pool.h" #include "system/event-loop-base.h" =20 @@ -104,15 +105,15 @@ static void event_loop_base_class_init(ObjectClass *k= lass, ucc->complete =3D event_loop_base_complete; ucc->can_be_deleted =3D event_loop_base_can_be_deleted; =20 - object_class_property_add(klass, "aio-max-batch", "int", + object_class_property_add_qapi(klass, "aio-max-batch", &int_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", "int", + object_class_property_add_qapi(klass, "thread-pool-min", &int_type_inf= o, event_loop_base_get_param, event_loop_base_set_param, NULL, &thread_pool_min_info); - object_class_property_add(klass, "thread-pool-max", "int", + object_class_property_add_qapi(klass, "thread-pool-max", &int_type_inf= o, 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 5c7dfb2c69d..f8196c771f2 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" @@ -405,7 +406,7 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs = *pm) (Object **)&pm->acpi_pci_hotplug.root, object_property_allow_set_link, OBJ_PROP_LINK_STRONG); - object_property_add(obj, ACPI_PM_PROP_GPE0_BLK, "uint32", + object_property_add_qapi(obj, ACPI_PM_PROP_GPE0_BLK, &uint32_type_info, ich9_pm_get_gpe0_blk, NULL, NULL, pm); object_property_add_uint32_ptr(obj, ACPI_PM_PROP_GPE0_BLK_LEN, diff --git a/hw/acpi/pci.c b/hw/acpi/pci.c index 8c7ed104796..727f3aade4a 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", "int", NULL, + object_class_property_add_qapi(oc, "node", &int_type_info, NULL, acpi_generic_initiator_set_node, NULL, NULL); object_class_property_set_description(oc, "node", "NUMA node associated with the PCI device"); @@ -253,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", "int", NULL, + object_class_property_add_qapi(oc, "node", &int_type_info, NULL, acpi_generic_port_set_node, NULL, NULL); object_class_property_set_description(oc, "node", "The NUMA node like ID to index HMAT/SLIT NUMA properties involving= GP"); diff --git a/hw/arm/virt.c b/hw/arm/virt.c index e4c75cb1bae..b045b4f8cc0 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -3918,7 +3918,7 @@ static void virt_machine_class_init(ObjectClass *oc, = const void *data) "Set on/off to enable/disable hi= gh " "memory region for PCI MMIO"); =20 - object_class_property_add(oc, "highmem-mmio-size", "size", + object_class_property_add_qapi(oc, "highmem-mmio-size", &size_type_inf= o, virt_get_highmem_mmio_size, virt_set_highmem_mmio_size, NULL, NULL); @@ -3926,7 +3926,7 @@ static void virt_machine_class_init(ObjectClass *oc, = const void *data) "Set the high memory region size= " "for PCI MMIO"); =20 - object_class_property_add(oc, "virtio-mmio-transports", "uint8", + object_class_property_add_qapi(oc, "virtio-mmio-transports", &uint8_ty= pe_info, virt_get_virtio_transports, virt_set_virtio_transports, NULL, NULL); diff --git a/hw/core/clock.c b/hw/core/clock.c index 3fc98a0c65d..f55cb17af77 100644 --- a/hw/core/clock.c +++ b/hw/core/clock.c @@ -13,6 +13,7 @@ =20 #include "qemu/osdep.h" #include "qemu/cutils.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "system/qtest.h" #include "hw/core/clock.h" @@ -185,7 +186,7 @@ static void clock_initfn(Object *obj) QLIST_INIT(&clk->children); =20 if (qtest_enabled()) { - object_property_add(obj, "qtest-clock-period", "uint64", + object_property_add_qapi(obj, "qtest-clock-period", &uint64_type_i= nfo, clock_period_prop_get, NULL, NULL, NULL); } } diff --git a/hw/core/machine.c b/hw/core/machine.c index 1dd5375caea..862e6174fef 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1113,7 +1113,7 @@ static void machine_class_init(ObjectClass *oc, const= void *data) object_class_property_set_description(oc, "smp-cache", "Cache properties list for SMP machine"); =20 - object_class_property_add(oc, "phandle-start", "int", + object_class_property_add_qapi(oc, "phandle-start", &int_type_info, machine_get_phandle_start, machine_set_phandle_start, NULL, NULL); object_class_property_set_description(oc, "phandle-start", diff --git a/hw/cpu/core.c b/hw/cpu/core.c index 26e488f3d8e..d7c89f47ab0 100644 --- a/hw/cpu/core.c +++ b/hw/cpu/core.c @@ -12,6 +12,7 @@ #include "hw/core/boards.h" #include "hw/cpu/core.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" =20 static void core_prop_get_core_id(Object *obj, Visitor *v, const char *nam= e, @@ -82,10 +83,11 @@ static void cpu_core_class_init(ObjectClass *oc, const = void *data) DeviceClass *dc =3D DEVICE_CLASS(oc); =20 set_bit(DEVICE_CATEGORY_CPU, dc->categories); - object_class_property_add(oc, "core-id", "int", core_prop_get_core_id, - core_prop_set_core_id, NULL, NULL); - object_class_property_add(oc, "nr-threads", "int", core_prop_get_nr_th= reads, - core_prop_set_nr_threads, NULL, NULL); + object_class_property_add_qapi(oc, "core-id", &int_type_info, core_pro= p_get_core_id, + core_prop_set_core_id, NULL, NULL); + object_class_property_add_qapi(oc, "nr-threads", &int_type_info, + core_prop_get_nr_threads, core_prop_set= _nr_threads, + NULL, NULL); } =20 static const TypeInfo cpu_core_type_info =3D { diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index 87067b94b34..e94ce29a00f 100644 --- a/hw/cxl/cxl-host.c +++ b/hw/cxl/cxl-host.c @@ -345,7 +345,7 @@ static void machine_set_cfmw(Object *obj, Visitor *v, c= onst char *name, =20 void cxl_machine_init(Object *obj, CXLState *state) { - object_property_add(obj, "cxl", "bool", machine_get_cxl, + object_property_add_qapi(obj, "cxl", &bool_type_info, machine_get_cxl, machine_set_cxl, NULL, state); object_property_set_description(obj, "cxl", "Set on/off to enable/disable " diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c index 7d0f87e90c3..3b8dd66f086 100644 --- a/hw/gpio/aspeed_gpio.c +++ b/hw/gpio/aspeed_gpio.c @@ -12,6 +12,7 @@ #include "hw/gpio/aspeed_gpio.h" #include "hw/misc/aspeed_scu.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/irq.h" #include "migration/vmstate.h" @@ -1481,7 +1482,7 @@ static void aspeed_gpio_init(Object *obj) int pin_idx =3D j % GPIOS_PER_GROUP; const char *group =3D &props->group_label[group_idx][0]; char *name =3D g_strdup_printf("gpio%s%d", group, pin_idx); - object_property_add(obj, name, "bool", aspeed_gpio_get_pin, + object_property_add_qapi(obj, name, &bool_type_info, aspeed_gp= io_get_pin, aspeed_gpio_set_pin, NULL, NULL); g_free(name); } @@ -1489,7 +1490,7 @@ static void aspeed_gpio_init(Object *obj) =20 for (int i =3D 0; i < agc->nr_gpio_sets; i++) { g_autofree char *name =3D g_strdup_printf("gpio-set[%d]", i); - object_property_add(obj, name, "uint32", aspeed_gpio_get_set, + object_property_add_qapi(obj, name, &uint32_type_info, aspeed_gpio= _get_set, aspeed_gpio_set_set, NULL, NULL); } } diff --git a/hw/gpio/aspeed_sgpio.c b/hw/gpio/aspeed_sgpio.c index 0c53b03464e..9234ae291d4 100644 --- a/hw/gpio/aspeed_sgpio.c +++ b/hw/gpio/aspeed_sgpio.c @@ -11,6 +11,7 @@ #include "qemu/log.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/irq.h" #include "hw/core/qdev-properties.h" @@ -300,7 +301,7 @@ static void aspeed_sgpio_init(Object *obj) { for (int i =3D 0; i < ASPEED_SGPIO_MAX_PIN_PAIR * 2; i++) { g_autofree char *name =3D g_strdup_printf("sgpio%03d", i); - object_property_add(obj, name, "bool", aspeed_sgpio_get_pin, + object_property_add_qapi(obj, name, &bool_type_info, aspeed_sgpio_= get_pin, aspeed_sgpio_set_pin, NULL, NULL); } } diff --git a/hw/gpio/pca9552.c b/hw/gpio/pca9552.c index dd3f1536b65..8132011736d 100644 --- a/hw/gpio/pca9552.c +++ b/hw/gpio/pca9552.c @@ -20,6 +20,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 "trace.h" #include "qom/object.h" @@ -437,8 +438,9 @@ static void pca955x_initfn(Object *obj) char *name; =20 name =3D g_strdup_printf("led%d", led); - object_property_add(obj, name, "bool", pca955x_get_led, pca955x_se= t_led, - NULL, NULL); + object_property_add_qapi(obj, name, &bool_type_info, + pca955x_get_led, pca955x_set_led, + NULL, NULL); g_free(name); } } diff --git a/hw/gpio/pca9554.c b/hw/gpio/pca9554.c index 8427e01e9b2..8ec1f94bb5c 100644 --- a/hw/gpio/pca9554.c +++ b/hw/gpio/pca9554.c @@ -16,6 +16,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 "trace.h" #include "qom/object.h" @@ -253,8 +254,9 @@ static void pca9554_initfn(Object *obj) char *name; =20 name =3D g_strdup_printf("pin%d", pin); - object_property_add(obj, name, "bool", pca9554_get_pin, pca9554_se= t_pin, - NULL, NULL); + object_property_add_qapi(obj, name, &bool_type_info, + 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 92fa397fbaf..d349d41e41a 100644 --- a/hw/gpio/stm32l4x5_gpio.c +++ b/hw/gpio/stm32l4x5_gpio.c @@ -25,6 +25,7 @@ #include "hw/core/qdev-properties.h" #include "qapi/visitor.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "migration/vmstate.h" #include "trace.h" =20 @@ -409,10 +410,10 @@ static void stm32l4x5_gpio_init(Object *obj) =20 s->clk =3D qdev_init_clock_in(DEVICE(s), "clk", NULL, s, 0); =20 - object_property_add(obj, "disconnected-pins", "uint16", + object_property_add_qapi(obj, "disconnected-pins", &uint16_type_info, disconnected_pins_get, disconnected_pins_set, NULL, &s->disconnected_pins); - object_property_add(obj, "clock-freq-hz", "uint32", + object_property_add_qapi(obj, "clock-freq-hz", &uint32_type_info, clock_freq_get, NULL, NULL, NULL); } =20 diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 6a4fe126bc0..b8dc955478c 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1671,7 +1671,7 @@ static void pc_machine_class_init(ObjectClass *oc, co= nst void *data) mc->default_ram_id =3D "pc.ram"; pcmc->default_smbios_ep_type =3D SMBIOS_ENTRY_POINT_TYPE_AUTO; =20 - object_class_property_add(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "size", + object_class_property_add_qapi(oc, PC_MACHINE_MAX_RAM_BELOW_4G, &size_= type_info, pc_machine_get_max_ram_below_4g, pc_machine_set_max_ram_below_4g, NULL, NULL); object_class_property_set_description(oc, PC_MACHINE_MAX_RAM_BELOW_4G, @@ -1709,13 +1709,13 @@ static void pc_machine_class_init(ObjectClass *oc, = const void *data) pc_machine_get_default_bus_bypass_iommu, pc_machine_set_default_bus_bypass_iommu); =20 - object_class_property_add(oc, PC_MACHINE_MAX_FW_SIZE, "size", + object_class_property_add_qapi(oc, PC_MACHINE_MAX_FW_SIZE, &size_type_= info, pc_machine_get_max_fw_size, pc_machine_set_max_fw_size, NULL, NULL); object_class_property_set_description(oc, PC_MACHINE_MAX_FW_SIZE, "Maximum combined firmware size"); =20 - object_class_property_add(oc, PC_MACHINE_SMBIOS_EP, "str", + object_class_property_add_qapi(oc, PC_MACHINE_SMBIOS_EP, &str_type_inf= o, pc_machine_get_smbios_ep, pc_machine_set_smbios_ep, NULL, NULL); object_class_property_set_description(oc, PC_MACHINE_SMBIOS_EP, diff --git a/hw/i386/sgx-epc.c b/hw/i386/sgx-epc.c index d3fe10028c5..d9b9ab3f7a9 100644 --- a/hw/i386/sgx-epc.c +++ b/hw/i386/sgx-epc.c @@ -15,6 +15,7 @@ #include "hw/mem/memory-device.h" #include "hw/core/qdev-properties.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "target/i386/cpu.h" #include "system/address-spaces.h" @@ -43,7 +44,7 @@ static void sgx_epc_get_size(Object *obj, Visitor *v, con= st char *name, =20 static void sgx_epc_init(Object *obj) { - object_property_add(obj, SGX_EPC_SIZE_PROP, "uint64", sgx_epc_get_size, + object_property_add_qapi(obj, SGX_EPC_SIZE_PROP, &uint64_type_info, sg= x_epc_get_size, NULL, NULL, NULL); } =20 diff --git a/hw/i386/x86.c b/hw/i386/x86.c index b76926a00bd..3ff54c6f3f9 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -412,9 +412,9 @@ static void x86_machine_class_init(ObjectClass *oc, con= st void *data) "in ACPI table header." "The string may be up to 8 bytes= in size"); =20 - object_class_property_add(oc, X86_MACHINE_BUS_LOCK_RATELIMIT, "uint64_= t", - x86_machine_get_bus_lock_ratelimit, - x86_machine_set_bus_lock_ratelimit, NULL, = NULL); + object_class_property_add_qapi(oc, X86_MACHINE_BUS_LOCK_RATELIMIT, &ui= nt64_type_info, + x86_machine_get_bus_lock_ratelimit, + x86_machine_set_bus_lock_ratelimit, NUL= L, NULL); object_class_property_set_description(oc, X86_MACHINE_BUS_LOCK_RATELIM= IT, "Set the ratelimit for the bus locks acquired in VMs"); =20 diff --git a/hw/ide/ide-dev.c b/hw/ide/ide-dev.c index 5d478588c61..e2dd2439991 100644 --- a/hw/ide/ide-dev.c +++ b/hw/ide/ide-dev.c @@ -19,6 +19,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-types-block.h" #include "qemu/error-report.h" #include "qemu/module.h" @@ -174,7 +175,7 @@ out: =20 static void ide_dev_instance_init(Object *obj) { - object_property_add(obj, "bootindex", "int32", + object_property_add_qapi(obj, "bootindex", &int32_type_info, ide_dev_get_bootindex, ide_dev_set_bootindex, NULL, NULL); object_property_set_int(obj, "bootindex", -1, NULL); diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c index bf4abc21d7b..d6c1a806727 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" @@ -439,7 +440,7 @@ static void apic_common_initfn(Object *obj) APICCommonState *s =3D APIC_COMMON(obj); =20 s->id =3D s->initial_apic_id =3D -1; - object_property_add(obj, "id", "uint32", + object_property_add_qapi(obj, "id", &uint32_type_info, apic_common_get_id, apic_common_set_id, NULL, NULL); } diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index b301398d1bd..9ab550c231b 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -1521,7 +1521,7 @@ static void virt_class_init(ObjectClass *oc, const vo= id *data) object_class_property_set_description(oc, "highmem-mmio", "Set on/off to enable/disable hi= gh " "memory region for PCI MMIO"); - object_class_property_add(oc, "highmem-mmio-size", "size", + object_class_property_add_qapi(oc, "highmem-mmio-size", &size_type_inf= o, virt_get_highmem_mmio_size, virt_set_highmem_mmio_size, NULL, NULL); diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index cf8a4d8c5f2..123ddc93854 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -26,6 +26,7 @@ #include "qemu/module.h" #include "qemu/pmem.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/mem/nvdimm.h" #include "hw/core/qdev-properties.h" @@ -99,9 +100,9 @@ static void nvdimm_set_uuid(Object *obj, Visitor *v, con= st char *name, =20 static void nvdimm_init(Object *obj) { - object_property_add(obj, NVDIMM_LABEL_SIZE_PROP, "size", - nvdimm_get_label_size, nvdimm_set_label_size, NULL, - NULL); + object_property_add_qapi(obj, NVDIMM_LABEL_SIZE_PROP, &size_type_info, + nvdimm_get_label_size, nvdimm_set_label_size,= NULL, + NULL); =20 object_property_add(obj, NVDIMM_UUID_PROP, "QemuUUID", nvdimm_get_uuid, nvdimm_set_uuid, NULL, NULL); diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 3efe47f499a..1328f1cfec0 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -26,6 +26,7 @@ #include "hw/mem/nvdimm.h" #include "hw/mem/memory-device.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "system/hostmem.h" @@ -176,7 +177,7 @@ static void pc_dimm_get_size(Object *obj, Visitor *v, c= onst char *name, =20 static void pc_dimm_init(Object *obj) { - object_property_add(obj, PC_DIMM_SIZE_PROP, "uint64", pc_dimm_get_size, + object_property_add_qapi(obj, PC_DIMM_SIZE_PROP, &uint64_type_info, pc= _dimm_get_size, NULL, NULL, NULL); } =20 diff --git a/hw/misc/aspeed_lpc.c b/hw/misc/aspeed_lpc.c index 68f0f6334bc..67a53a12725 100644 --- a/hw/misc/aspeed_lpc.c +++ b/hw/misc/aspeed_lpc.c @@ -12,6 +12,7 @@ #include "qemu/error-report.h" #include "hw/misc/aspeed_lpc.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/irq.h" #include "hw/core/qdev-properties.h" @@ -417,30 +418,54 @@ static void aspeed_lpc_realize(DeviceState *dev, Erro= r **errp) =20 static void aspeed_lpc_init(Object *obj) { - object_property_add(obj, "idr1", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr1", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str1", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr2", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr2", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str2", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr3", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr3", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str3", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "idr4", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "odr4", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); - object_property_add(obj, "str4", "uint32", aspeed_kcs_get_register_pro= perty, - aspeed_kcs_set_register_property, NULL, NULL); + object_property_add_qapi(obj, "idr1", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "odr1", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "str1", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "idr2", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "odr2", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "str2", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "idr3", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "odr3", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "str3", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "idr4", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "odr4", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); + object_property_add_qapi(obj, "str4", &uint32_type_info, + aspeed_kcs_get_register_property, + aspeed_kcs_set_register_property, + NULL, NULL); } =20 static const VMStateDescription vmstate_aspeed_lpc =3D { diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c index 59b4a9a4264..4f4331ec7e4 100644 --- a/hw/misc/aspeed_sdmc.c +++ b/hw/misc/aspeed_sdmc.c @@ -15,6 +15,7 @@ #include "hw/core/qdev-properties.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "trace.h" #include "qemu/units.h" #include "qemu/cutils.h" @@ -259,7 +260,7 @@ static void aspeed_sdmc_set_ram_size(Object *obj, Visit= or *v, const char *name, =20 static void aspeed_sdmc_initfn(Object *obj) { - object_property_add(obj, "ram-size", "int", + object_property_add_qapi(obj, "ram-size", &int_type_info, aspeed_sdmc_get_ram_size, aspeed_sdmc_set_ram_size, NULL, NULL); } diff --git a/hw/misc/npcm7xx_mft.c b/hw/misc/npcm7xx_mft.c index 742166c4e82..99e9e49788c 100644 --- a/hw/misc/npcm7xx_mft.c +++ b/hw/misc/npcm7xx_mft.c @@ -23,6 +23,7 @@ #include "hw/core/registerfields.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/bitops.h" #include "qemu/error-report.h" @@ -491,7 +492,7 @@ static void npcm7xx_mft_init(Object *obj) s->clock_2 =3D qdev_init_clock_out(dev, "clock2"); =20 for (int i =3D 0; i < NPCM7XX_PWM_PER_MODULE; ++i) { - object_property_add(obj, "max_rpm[*]", "uint32", + object_property_add_qapi(obj, "max_rpm[*]", &uint32_type_info, npcm7xx_mft_get_max_rpm, npcm7xx_mft_set_max_rpm, NULL, &s->max_rpm[i]); diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c index 673c785abc9..63e0d40ee72 100644 --- a/hw/net/ne2000-isa.c +++ b/hw/net/ne2000-isa.c @@ -29,6 +29,7 @@ #include "ne2000.h" #include "system/system.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qom/object.h" @@ -131,7 +132,7 @@ out: =20 static void isa_ne2000_instance_init(Object *obj) { - object_property_add(obj, "bootindex", "int32", + object_property_add_qapi(obj, "bootindex", &int32_type_info, isa_ne2000_get_bootindex, isa_ne2000_set_bootindex, NULL, NULL); object_property_set_int(obj, "bootindex", -1, NULL); diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index be6c7028cb5..b10b45f157e 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -200,6 +200,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" @@ -9536,7 +9537,7 @@ static void nvme_instance_init(Object *obj) "bootindex", "/namespace@1,0", DEVICE(obj)); =20 - object_property_add(obj, "smart_critical_warning", "uint8", + object_property_add_qapi(obj, "smart_critical_warning", &uint8_type_in= fo, nvme_get_smart_warning, nvme_set_smart_warning, NULL, NULL); } diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expand= er_bridge.c index 11623a5666f..f19dbe668aa 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" @@ -97,7 +98,7 @@ static void pxb_bus_class_init(ObjectClass *class, const = void *data) pbc->bus_num =3D pxb_bus_num; pbc->numa_node =3D pxb_bus_numa_node; =20 - object_class_property_add(class, "acpi_uid", "uint32", + object_class_property_add_qapi(class, "acpi_uid", &uint32_type_info, prop_pxb_uid_get, NULL, NULL, NULL); object_class_property_set_description(class, "acpi_uid", "ACPI Unique ID used to distinguish this PCI Host Bridge / ACPI000= 16"); diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index e7d638b296c..ada73d238ab 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" @@ -376,21 +377,25 @@ static void i440fx_pcihost_class_init(ObjectClass *kl= ass, const void *data) /* Reason: needs to be wired up by pc_init1 */ dc->user_creatable =3D false; =20 - object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_START, "uint32= ", - i440fx_pcihost_get_pci_hole_start, - NULL, NULL, NULL); - - object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_END, "uint32", - i440fx_pcihost_get_pci_hole_end, - NULL, NULL, NULL); - - object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE64_START, "uint= 64", - i440fx_pcihost_get_pci_hole64_start, - NULL, NULL, NULL); - - object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE64_END, "uint64= ", - i440fx_pcihost_get_pci_hole64_end, - NULL, NULL, NULL); + object_class_property_add_qapi(klass, PCI_HOST_PROP_PCI_HOLE_START, + &uint32_type_info, + i440fx_pcihost_get_pci_hole_start, + NULL, NULL, NULL); + + object_class_property_add_qapi(klass, PCI_HOST_PROP_PCI_HOLE_END, + &uint32_type_info, + i440fx_pcihost_get_pci_hole_end, + NULL, NULL, NULL); + + object_class_property_add_qapi(klass, PCI_HOST_PROP_PCI_HOLE64_START, + &uint64_type_info, + i440fx_pcihost_get_pci_hole64_start, + NULL, NULL, NULL); + + object_class_property_add_qapi(klass, PCI_HOST_PROP_PCI_HOLE64_END, + &uint64_type_info, + i440fx_pcihost_get_pci_hole64_end, + NULL, NULL, NULL); } =20 static const TypeInfo i440fx_pcihost_info =3D { diff --git a/hw/pci-host/pnv_phb3.c b/hw/pci-host/pnv_phb3.c index d6ab5153374..9af3059900f 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" @@ -1154,12 +1155,12 @@ static void pnv_phb3_root_bus_class_init(ObjectClas= s *klass, const void *data) { BusClass *k =3D BUS_CLASS(klass); =20 - object_class_property_add(klass, "phb-id", "int", + object_class_property_add_qapi(klass, "phb-id", &int_type_info, pnv_phb3_root_bus_get_prop, pnv_phb3_root_bus_set_prop, NULL, NULL); =20 - object_class_property_add(klass, "chip-id", "int", + object_class_property_add_qapi(klass, "chip-id", &int_type_info, pnv_phb3_root_bus_get_prop, pnv_phb3_root_bus_set_prop, NULL, NULL); diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index 396bc47817d..e301a54bab5 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" @@ -1766,12 +1767,12 @@ static void pnv_phb4_root_bus_class_init(ObjectClas= s *klass, const void *data) { BusClass *k =3D BUS_CLASS(klass); =20 - object_class_property_add(klass, "phb-id", "int", + object_class_property_add_qapi(klass, "phb-id", &int_type_info, pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop, NULL, NULL); =20 - object_class_property_add(klass, "chip-id", "int", + object_class_property_add_qapi(klass, "chip-id", &int_type_info, pnv_phb4_root_bus_get_prop, pnv_phb4_root_bus_set_prop, NULL, NULL); diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index e85e4227b37..093049037cd 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 @@ -215,19 +216,19 @@ static void q35_host_initfn(Object *obj) qdev_prop_set_uint64(DEVICE(s), PCI_HOST_PROP_PCI_HOLE64_SIZE, Q35_PCI_HOST_HOLE64_SIZE_DEFAULT); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE_START, &uint32_ty= pe_info, q35_host_get_pci_hole_start, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE_END, &uint32_type= _info, q35_host_get_pci_hole_end, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE64_START, &uint64_= type_info, q35_host_get_pci_hole64_start, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE64_END, &uint64_ty= pe_info, q35_host_get_pci_hole64_end, NULL, NULL, NULL); =20 diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 9bc65c760ea..62baf38a00e 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" @@ -583,7 +584,7 @@ static void spapr_dr_connector_instance_init(Object *ob= j) SpaprDrcClass *drck =3D SPAPR_DR_CONNECTOR_GET_CLASS(drc); =20 object_property_add_uint32_ptr(obj, "id", &drc->id, OBJ_PROP_FLAG_READ= ); - object_property_add(obj, "index", "uint32", prop_get_index, + object_property_add_qapi(obj, "index", &uint32_type_info, prop_get_ind= ex, NULL, NULL, NULL); object_property_add(obj, "fdt", "struct", prop_get_fdt, NULL, NULL, NULL); diff --git a/hw/riscv/microchip_pfsoc.c b/hw/riscv/microchip_pfsoc.c index 743f31f0057..7bfa0d4a47a 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" @@ -737,7 +738,7 @@ static void microchip_icicle_kit_machine_class_init(Obj= ectClass *oc, */ mc->default_ram_size =3D 1537 * MiB; =20 - object_class_property_add(oc, "clint-timebase-frequency", "uint32_t", + object_class_property_add_qapi(oc, "clint-timebase-frequency", &uint32= _type_info, microchip_icicle_kit_get_clint_timebase_freq, microchip_icicle_kit_set_clint_timebase_freq, NULL, NULL); diff --git a/hw/s390x/sclpcpi.c b/hw/s390x/sclpcpi.c index 68fc1b809bf..307eba9f765 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" @@ -190,12 +191,13 @@ static void cpi_class_init(ObjectClass *klass, const = void *data) "name of the cluster which the VM belongs to, if any" " e.g. \"PLEX \""); =20 - object_class_property_add(klass, "system_level", "uint64", get_system_= level, - NULL, NULL, NULL); + object_class_property_add_qapi(klass, "system_level", + &uint64_type_info, get_system_level, + NULL, NULL, NULL); object_class_property_set_description(klass, "system_level", "distribution and kernel version in Linux e.g. 748723438054305= 28"); =20 - object_class_property_add(klass, "timestamp", "uint64", get_timestamp, + object_class_property_add_qapi(klass, "timestamp", &uint64_type_info, = get_timestamp, NULL, NULL, NULL); object_class_property_set_description(klass, "timestamp", "latest update of CPI data in nanoseconds since the UNIX EPOCH= "); diff --git a/hw/s390x/virtio-ccw-mem.c b/hw/s390x/virtio-ccw-mem.c index dea30aacfb3..046dfd544cf 100644 --- a/hw/s390x/virtio-ccw-mem.c +++ b/hw/s390x/virtio-ccw-mem.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "hw/core/qdev-properties.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/module.h" #include "virtio-ccw-mem.h" #include "hw/mem/memory-device.h" @@ -205,7 +206,7 @@ static void virtio_ccw_mem_instance_init(Object *obj) OBJECT(&dev->vdev), VIRTIO_MEM_BLOCK_SIZE_PR= OP); object_property_add_alias(obj, VIRTIO_MEM_SIZE_PROP, OBJECT(&dev->vdev= ), VIRTIO_MEM_SIZE_PROP); - object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", + object_property_add_qapi(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, &size_ty= pe_info, virtio_ccw_mem_get_requested_size, virtio_ccw_mem_set_requested_size, NULL, NULL); } diff --git a/hw/sensor/adm1266.c b/hw/sensor/adm1266.c index 37d1cffd57a..62f563af7a7 100644 --- a/hw/sensor/adm1266.c +++ b/hw/sensor/adm1266.c @@ -14,6 +14,7 @@ #include "hw/core/irq.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h" @@ -217,7 +218,7 @@ static void adm1266_init(Object *obj) for (int i =3D 0; i < ADM1266_NUM_PAGES; i++) { pmbus_page_config(pmdev, i, flags); =20 - object_property_add(obj, "vout[*]", "uint16", + object_property_add_qapi(obj, "vout[*]", &uint16_type_info, adm1266_get, adm1266_set, NULL, &pmdev->pages[i].read_vout); } diff --git a/hw/sensor/adm1272.c b/hw/sensor/adm1272.c index 0aa2a865568..e1c1bf1c54d 100644 --- a/hw/sensor/adm1272.c +++ b/hw/sensor/adm1272.c @@ -12,6 +12,7 @@ #include "hw/core/irq.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h" @@ -493,19 +494,19 @@ static void adm1272_init(Object *obj) =20 pmbus_page_config(pmdev, 0, flags); =20 - object_property_add(obj, "vin", "uint16", + object_property_add_qapi(obj, "vin", &uint16_type_info, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_vin); =20 - object_property_add(obj, "vout", "uint16", + object_property_add_qapi(obj, "vout", &uint16_type_info, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_vout); =20 - object_property_add(obj, "iout", "uint16", + object_property_add_qapi(obj, "iout", &uint16_type_info, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_iout); =20 - object_property_add(obj, "pin", "uint16", + object_property_add_qapi(obj, "pin", &uint16_type_info, adm1272_get, adm1272_set, NULL, &pmdev->pages[0].read_pin); =20 diff --git a/hw/sensor/emc141x.c b/hw/sensor/emc141x.c index a51fc44395a..5efe94643ca 100644 --- a/hw/sensor/emc141x.c +++ b/hw/sensor/emc141x.c @@ -22,6 +22,7 @@ #include "hw/i2c/i2c.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qom/object.h" @@ -251,16 +252,16 @@ static void emc141x_reset(DeviceState *dev) =20 static void emc141x_initfn(Object *obj) { - object_property_add(obj, "temperature0", "int", + object_property_add_qapi(obj, "temperature0", &int_type_info, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature1", "int", + object_property_add_qapi(obj, "temperature1", &int_type_info, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature2", "int", + object_property_add_qapi(obj, "temperature2", &int_type_info, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); - object_property_add(obj, "temperature3", "int", + object_property_add_qapi(obj, "temperature3", &int_type_info, emc141x_get_temperature, emc141x_set_temperature, NULL, NULL); } diff --git a/hw/sensor/isl_pmbus_vr.c b/hw/sensor/isl_pmbus_vr.c index 0fad04def77..8923e9e8751 100644 --- a/hw/sensor/isl_pmbus_vr.c +++ b/hw/sensor/isl_pmbus_vr.c @@ -9,6 +9,7 @@ #include "qemu/osdep.h" #include "hw/sensor/isl_pmbus_vr.h" #include "hw/core/qdev-properties.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h" @@ -136,63 +137,63 @@ static void isl_pmbus_vr_add_props(Object *obj, uint6= 4_t *flags, uint8_t pages) PMBusDevice *pmdev =3D PMBUS_DEVICE(obj); for (int i =3D 0; i < pages; i++) { if (flags[i] & PB_HAS_VIN) { - object_property_add(obj, "vin[*]", "uint16", + object_property_add_qapi(obj, "vin[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_vin); } =20 if (flags[i] & PB_HAS_VOUT) { - object_property_add(obj, "vout[*]", "uint16", + object_property_add_qapi(obj, "vout[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_vout); } =20 if (flags[i] & PB_HAS_IIN) { - object_property_add(obj, "iin[*]", "uint16", + object_property_add_qapi(obj, "iin[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_iin); } =20 if (flags[i] & PB_HAS_IOUT) { - object_property_add(obj, "iout[*]", "uint16", + object_property_add_qapi(obj, "iout[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_iout); } =20 if (flags[i] & PB_HAS_PIN) { - object_property_add(obj, "pin[*]", "uint16", + object_property_add_qapi(obj, "pin[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_pin); } =20 if (flags[i] & PB_HAS_POUT) { - object_property_add(obj, "pout[*]", "uint16", + object_property_add_qapi(obj, "pout[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_pout); } =20 if (flags[i] & PB_HAS_TEMPERATURE) { - object_property_add(obj, "temp1[*]", "uint16", + object_property_add_qapi(obj, "temp1[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_temperature_1); } =20 if (flags[i] & PB_HAS_TEMP2) { - object_property_add(obj, "temp2[*]", "uint16", + object_property_add_qapi(obj, "temp2[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_temperature_2); } =20 if (flags[i] & PB_HAS_TEMP3) { - object_property_add(obj, "temp3[*]", "uint16", + object_property_add_qapi(obj, "temp3[*]", &uint16_type_info, isl_pmbus_vr_get, isl_pmbus_vr_set, NULL, &pmdev->pages[i].read_temperature_3); diff --git a/hw/sensor/lsm303dlhc_mag.c b/hw/sensor/lsm303dlhc_mag.c index cd5773ae64e..c8085739ca4 100644 --- a/hw/sensor/lsm303dlhc_mag.c +++ b/hw/sensor/lsm303dlhc_mag.c @@ -25,6 +25,7 @@ #include "hw/i2c/i2c.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qemu/log.h" @@ -509,19 +510,19 @@ static void lsm303dlhc_mag_reset(DeviceState *dev) */ static void lsm303dlhc_mag_initfn(Object *obj) { - object_property_add(obj, "mag-x", "int", + object_property_add_qapi(obj, "mag-x", &int_type_info, lsm303dlhc_mag_get_x, lsm303dlhc_mag_set_x, NULL, NULL); =20 - object_property_add(obj, "mag-y", "int", + object_property_add_qapi(obj, "mag-y", &int_type_info, lsm303dlhc_mag_get_y, lsm303dlhc_mag_set_y, NULL, NULL); =20 - object_property_add(obj, "mag-z", "int", + object_property_add_qapi(obj, "mag-z", &int_type_info, lsm303dlhc_mag_get_z, lsm303dlhc_mag_set_z, NULL, NULL); =20 - object_property_add(obj, "temperature", "int", + object_property_add_qapi(obj, "temperature", &int_type_info, lsm303dlhc_mag_get_temperature, lsm303dlhc_mag_set_temperature, NULL, NULL); } diff --git a/hw/sensor/max34451.c b/hw/sensor/max34451.c index 4d64434f3af..3c8fa3d4a86 100644 --- a/hw/sensor/max34451.c +++ b/hw/sensor/max34451.c @@ -11,6 +11,7 @@ #include "hw/core/irq.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h" @@ -727,7 +728,7 @@ static void max34451_init(Object *obj) =20 /* get and set the voltage in millivolts, max is 32767 mV */ for (int i =3D 0; i < MAX34451_NUM_PWR_DEVICES; i++) { - object_property_add(obj, "vout[*]", "uint16", + object_property_add_qapi(obj, "vout[*]", &uint16_type_info, max34451_get, max34451_set, NULL, &pmdev->pages[i].read_vout= ); } @@ -737,7 +738,7 @@ static void max34451_init(Object *obj) * centidegrees Celsius i.e.: 2500 -> 25.00 C, max is 327.67 C */ for (int i =3D 0; i < MAX34451_NUM_TEMP_DEVICES; i++) { - object_property_add(obj, "temperature[*]", "uint16", + object_property_add_qapi(obj, "temperature[*]", &uint16_type_info, max34451_get, max34451_set, NULL, diff --git a/hw/sensor/tmp105.c b/hw/sensor/tmp105.c index c5089d74f4b..ce4ff4856af 100644 --- a/hw/sensor/tmp105.c +++ b/hw/sensor/tmp105.c @@ -24,6 +24,7 @@ #include "migration/vmstate.h" #include "hw/sensor/tmp105.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "hw/core/registerfields.h" @@ -308,7 +309,7 @@ static void tmp105_realize(DeviceState *dev, Error **er= rp) =20 static void tmp105_initfn(Object *obj) { - object_property_add(obj, "temperature", "int", + object_property_add_qapi(obj, "temperature", &int_type_info, tmp105_get_temperature, tmp105_set_temperature, NULL, NULL); } diff --git a/hw/sensor/tmp421.c b/hw/sensor/tmp421.c index 127edd0ba56..60844e76b21 100644 --- a/hw/sensor/tmp421.c +++ b/hw/sensor/tmp421.c @@ -28,6 +28,7 @@ #include "hw/i2c/i2c.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" #include "qom/object.h" @@ -350,16 +351,16 @@ static void tmp421_class_init(ObjectClass *klass, con= st void *data) dc->vmsd =3D &vmstate_tmp421; sc->dev =3D (DeviceInfo *) data; =20 - object_class_property_add(klass, "temperature0", "int", + object_class_property_add_qapi(klass, "temperature0", &int_type_info, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature1", "int", + object_class_property_add_qapi(klass, "temperature1", &int_type_info, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature2", "int", + object_class_property_add_qapi(klass, "temperature2", &int_type_info, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); - object_class_property_add(klass, "temperature3", "int", + object_class_property_add_qapi(klass, "temperature3", &int_type_info, tmp421_get_temperature, tmp421_set_temperature, NULL, NULL); } diff --git a/hw/usb/dev-storage-classic.c b/hw/usb/dev-storage-classic.c index 977151c4a08..06584092bca 100644 --- a/hw/usb/dev-storage-classic.c +++ b/hw/usb/dev-storage-classic.c @@ -9,6 +9,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/usb/usb.h" #include "hw/usb/desc.h" @@ -122,7 +123,7 @@ out: =20 static void usb_msd_instance_init(Object *obj) { - object_property_add(obj, "bootindex", "int32", + object_property_add_qapi(obj, "bootindex", &int32_type_info, usb_msd_get_bootindex, usb_msd_set_bootindex, NULL, NULL); object_property_set_int(obj, "bootindex", -1, NULL); diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 4c5f486ba23..9e43948128f 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -27,6 +27,7 @@ #include "hw/virtio/virtio-balloon.h" #include "system/address-spaces.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-events-machine.h" #include "qapi/visitor.h" #include "trace.h" @@ -1022,7 +1023,7 @@ static void virtio_balloon_instance_init(Object *obj) object_property_add(obj, "guest-stats", "guest statistics", balloon_stats_get_all, NULL, NULL, NULL); =20 - object_property_add(obj, "guest-stats-polling-interval", "int", + object_property_add_qapi(obj, "guest-stats-polling-interval", &int_typ= e_info, balloon_stats_get_poll_interval, balloon_stats_set_poll_interval, NULL, NULL); diff --git a/hw/virtio/virtio-mem-pci.c b/hw/virtio/virtio-mem-pci.c index f592eb1a784..80e9bfedd9f 100644 --- a/hw/virtio/virtio-mem-pci.c +++ b/hw/virtio/virtio-mem-pci.c @@ -14,6 +14,7 @@ #include "virtio-mem-pci.h" #include "hw/mem/memory-device.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-events-machine.h" #include "qapi/qapi-events-misc.h" =20 @@ -211,7 +212,7 @@ static void virtio_mem_pci_instance_init(Object *obj) OBJECT(&dev->vdev), VIRTIO_MEM_BLOCK_SIZE_PR= OP); object_property_add_alias(obj, VIRTIO_MEM_SIZE_PROP, OBJECT(&dev->vdev= ), VIRTIO_MEM_SIZE_PROP); - object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", + object_property_add_qapi(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, &size_ty= pe_info, virtio_mem_pci_get_requested_size, virtio_mem_pci_set_requested_size, NULL, NULL); } diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c index a4b71974a1c..8cdaab50505 100644 --- a/hw/virtio/virtio-mem.c +++ b/hw/virtio/virtio-mem.c @@ -25,6 +25,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" @@ -1652,14 +1653,15 @@ static void virtio_mem_instance_init(Object *obj) notifier_list_init(&vmem->size_change_notifiers); QLIST_INIT(&vmem->rdl_list); =20 - object_property_add(obj, VIRTIO_MEM_SIZE_PROP, "size", virtio_mem_get_= size, - NULL, NULL, NULL); - object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size", - virtio_mem_get_requested_size, - virtio_mem_set_requested_size, NULL, NULL); - object_property_add(obj, VIRTIO_MEM_BLOCK_SIZE_PROP, "size", - virtio_mem_get_block_size, virtio_mem_set_block_si= ze, - NULL, NULL); + object_property_add_qapi(obj, VIRTIO_MEM_SIZE_PROP, &size_type_info, + virtio_mem_get_size, + NULL, NULL, NULL); + object_property_add_qapi(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, &size_ty= pe_info, + virtio_mem_get_requested_size, + virtio_mem_set_requested_size, NULL, NULL); + object_property_add_qapi(obj, VIRTIO_MEM_BLOCK_SIZE_PROP, &size_type_i= nfo, + virtio_mem_get_block_size, virtio_mem_set_blo= ck_size, + NULL, NULL); } =20 static void virtio_mem_instance_finalize(Object *obj) diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c index cca37202ffb..7b4fd933a8f 100644 --- a/hw/xen/xen-pvh-common.c +++ b/hw/xen/xen-pvh-common.c @@ -9,6 +9,7 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qemu/units.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/core/boards.h" #include "hw/core/irq.h" @@ -413,7 +414,7 @@ void xen_pvh_class_setup_common_props(XenPVHMachineClas= s *xpc) =20 #define OC_MEMMAP_PROP_BASE(c, prop_name, name) \ do { \ - object_class_property_add(c, prop_name "-base", "uint64_t", \ + object_class_property_add_qapi(c, prop_name "-base", &uint64_type_info= ,\ xen_pvh_get_ ## name ## _base, \ xen_pvh_set_ ## name ## _base, NULL, NULL); \ object_class_property_set_description(oc, prop_name "-base", \ @@ -422,7 +423,7 @@ do { = \ =20 #define OC_MEMMAP_PROP_SIZE(c, prop_name, name) \ do { \ - object_class_property_add(c, prop_name "-size", "uint64_t", \ + object_class_property_add_qapi(c, prop_name "-size", &size_type_info, \ xen_pvh_get_ ## name ## _size, \ xen_pvh_set_ ## name ## _size, NULL, NULL); \ object_class_property_set_description(oc, prop_name "-size", \ @@ -458,7 +459,7 @@ do { = \ OC_MEMMAP_PROP(oc, "pci-mmio", pci_mmio); OC_MEMMAP_PROP(oc, "pci-mmio-high", pci_mmio_high); =20 - object_class_property_add(oc, "pci-intx-irq-base", "uint32_t", + object_class_property_add_qapi(oc, "pci-intx-irq-base", &uint32_ty= pe_info, xen_pvh_get_pci_intx_irq_base, xen_pvh_set_pci_intx_irq_base, NULL, NULL); @@ -468,7 +469,7 @@ do { = \ =20 #ifdef CONFIG_TPM if (xpc->has_tpm) { - object_class_property_add(oc, "tpm-base-addr", "uint64_t", + object_class_property_add_qapi(oc, "tpm-base-addr", &uint64_type_i= nfo, xen_pvh_get_tpm_base, xen_pvh_set_tpm_base, NULL, NULL); diff --git a/iothread.c b/iothread.c index 3558535b40f..21fd5a91c5e 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", "int", + object_class_property_add_qapi(klass, "poll-max-ns", &int_type_info, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_max_ns_info); - object_class_property_add(klass, "poll-grow", "int", + object_class_property_add_qapi(klass, "poll-grow", &int_type_info, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_grow_info); - object_class_property_add(klass, "poll-shrink", "int", + object_class_property_add_qapi(klass, "poll-shrink", &int_type_info, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_shrink_info); - object_class_property_add(klass, "poll-weight", "int", + object_class_property_add_qapi(klass, "poll-weight", &int_type_info, iothread_get_poll_param, iothread_set_poll_param, NULL, &poll_weight_info); diff --git a/net/colo-compare.c b/net/colo-compare.c index abc1326b704..27d1499d4b4 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" @@ -1377,15 +1378,15 @@ static void colo_compare_init(Object *obj) object_property_add_str(obj, "notify_dev", compare_get_notify_dev, compare_set_notify_dev= ); =20 - object_property_add(obj, "compare_timeout", "uint64", + object_property_add_qapi(obj, "compare_timeout", &uint64_type_info, compare_get_timeout, compare_set_timeout, NULL, NULL); =20 - object_property_add(obj, "expired_scan_cycle", "uint32", + object_property_add_qapi(obj, "expired_scan_cycle", &uint32_type_info, compare_get_expired_scan_cycle, compare_set_expired_scan_cycle, NULL, NULL); =20 - object_property_add(obj, "max_queue_size", "uint32", + object_property_add_qapi(obj, "max_queue_size", &uint32_type_info, get_max_queue_size, set_max_queue_size, NULL, NULL); =20 diff --git a/net/dump.c b/net/dump.c index 0c39f09892c..3d7bb36182e 100644 --- a/net/dump.c +++ b/net/dump.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include "clients.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/error-report.h" #include "qemu/iov.h" #include "qemu/module.h" @@ -238,8 +239,9 @@ static void filter_dump_class_init(ObjectClass *oc, con= st void *data) { NetFilterClass *nfc =3D NETFILTER_CLASS(oc); =20 - object_class_property_add(oc, "maxlen", "uint32", filter_dump_get_maxl= en, - filter_dump_set_maxlen, NULL, NULL); + object_class_property_add_qapi(oc, "maxlen", &uint32_type_info, + filter_dump_get_maxlen, + filter_dump_set_maxlen, NULL, NULL); object_class_property_add_str(oc, "file", file_dump_get_filename, file_dump_set_filename); =20 diff --git a/net/filter-buffer.c b/net/filter-buffer.c index 427da24097f..9d7a9f5cb2c 100644 --- a/net/filter-buffer.c +++ b/net/filter-buffer.c @@ -10,6 +10,7 @@ #include "net/filter.h" #include "net/queue.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/timer.h" #include "qemu/iov.h" #include "qapi/qapi-builtin-visit.h" @@ -182,7 +183,7 @@ static void filter_buffer_class_init(ObjectClass *oc, c= onst void *data) { NetFilterClass *nfc =3D NETFILTER_CLASS(oc); =20 - object_class_property_add(oc, "interval", "uint32", + object_class_property_add_qapi(oc, "interval", &uint32_type_info, filter_buffer_get_interval, filter_buffer_set_interval, NULL, NULL); =20 diff --git a/qom/object.c b/qom/object.c index 48d7a88ee43..7f4d301cd86 100644 --- a/qom/object.c +++ b/qom/object.c @@ -22,9 +22,9 @@ #include "qapi/string-output-visitor.h" #include "qapi/qobject-input-visitor.h" #include "qapi/forward-visitor.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-builtin-visit.h" #include "qapi/qapi-type-info.h" -#include "qobject/qjson.h" #include "trace.h" =20 /* TODO: replace QObject with a simpler visitor to avoid a dependency @@ -2258,7 +2258,7 @@ object_property_add_str(Object *obj, const char *name, prop->get =3D get; prop->set =3D set; =20 - return object_property_add(obj, name, "string", + return object_property_add_qapi(obj, name, &str_type_info, get ? property_get_str : NULL, set ? property_set_str : NULL, property_release_data, @@ -2276,7 +2276,7 @@ object_class_property_add_str(ObjectClass *klass, con= st char *name, prop->get =3D get; prop->set =3D set; =20 - return object_class_property_add(klass, name, "string", + return object_class_property_add_qapi(klass, name, &str_type_info, get ? property_get_str : NULL, set ? property_set_str : NULL, NULL, @@ -2328,7 +2328,7 @@ object_property_add_bool(Object *obj, const char *nam= e, prop->get =3D get; prop->set =3D set; =20 - return object_property_add(obj, name, "bool", + return object_property_add_qapi(obj, name, &bool_type_info, get ? property_get_bool : NULL, set ? property_set_bool : NULL, property_release_data, @@ -2345,7 +2345,7 @@ object_class_property_add_bool(ObjectClass *klass, co= nst char *name, prop->get =3D get; prop->set =3D set; =20 - return object_class_property_add(klass, name, "bool", + return object_class_property_add_qapi(klass, name, &bool_type_info, get ? property_get_bool : NULL, set ? property_set_bool : NULL, NULL, @@ -2634,8 +2634,8 @@ object_property_add_uint8_ptr(Object *obj, const char= *name, setter =3D property_set_uint8_ptr; } =20 - return object_property_add(obj, name, "uint8", - getter, setter, NULL, (void *)v); + return object_property_add_qapi(obj, name, &uint8_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -2654,8 +2654,8 @@ object_class_property_add_uint8_ptr(ObjectClass *klas= s, const char *name, setter =3D property_set_uint8_ptr; } =20 - return object_class_property_add(klass, name, "uint8", - getter, setter, NULL, (void *)v); + return object_class_property_add_qapi(klass, name, &uint8_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -2674,8 +2674,8 @@ object_property_add_uint16_ptr(Object *obj, const cha= r *name, setter =3D property_set_uint16_ptr; } =20 - return object_property_add(obj, name, "uint16", - getter, setter, NULL, (void *)v); + return object_property_add_qapi(obj, name, &uint16_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -2694,8 +2694,8 @@ object_class_property_add_uint16_ptr(ObjectClass *kla= ss, const char *name, setter =3D property_set_uint16_ptr; } =20 - return object_class_property_add(klass, name, "uint16", - getter, setter, NULL, (void *)v); + return object_class_property_add_qapi(klass, name, &uint16_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -2714,8 +2714,8 @@ object_property_add_uint32_ptr(Object *obj, const cha= r *name, setter =3D property_set_uint32_ptr; } =20 - return object_property_add(obj, name, "uint32", - getter, setter, NULL, (void *)v); + return object_property_add_qapi(obj, name, &uint32_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -2734,8 +2734,8 @@ object_class_property_add_uint32_ptr(ObjectClass *kla= ss, const char *name, setter =3D property_set_uint32_ptr; } =20 - return object_class_property_add(klass, name, "uint32", - getter, setter, NULL, (void *)v); + return object_class_property_add_qapi(klass, name, &uint32_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -2754,8 +2754,8 @@ object_property_add_uint64_ptr(Object *obj, const cha= r *name, setter =3D property_set_uint64_ptr; } =20 - return object_property_add(obj, name, "uint64", - getter, setter, NULL, (void *)v); + return object_property_add_qapi(obj, name, &uint64_type_info, + getter, setter, NULL, (void *)v); } =20 ObjectProperty * @@ -2774,8 +2774,8 @@ object_class_property_add_uint64_ptr(ObjectClass *kla= ss, const char *name, setter =3D property_set_uint64_ptr; } =20 - return object_class_property_add(klass, name, "uint64", - getter, setter, NULL, (void *)v); + return object_class_property_add_qapi(klass, name, &uint64_type_info, + getter, setter, NULL, (void *)v); } =20 typedef struct { diff --git a/system/bootdevice.c b/system/bootdevice.c index 9538b08983f..7789e464186 100644 --- a/system/bootdevice.c +++ b/system/bootdevice.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "system/system.h" #include "qapi/visitor.h" #include "qemu/error-report.h" @@ -336,7 +337,7 @@ void device_add_bootindex_property(Object *obj, int32_t= *bootindex, prop->suffix =3D suffix; prop->dev =3D dev; =20 - object_property_add(obj, name, "int32", + object_property_add_qapi(obj, name, &int32_type_info, device_get_bootindex, device_set_bootindex, property_release_bootindex, diff --git a/system/memory.c b/system/memory.c index aaf5ec40230..1f2d44ce8b4 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" @@ -1316,11 +1317,11 @@ static void memory_region_initfn(Object *obj) =20 object_property_add_uint64_ptr(OBJECT(mr), "addr", &mr->addr, OBJ_PROP_FLAG_READ); - object_property_add(OBJECT(mr), "priority", "int32", + object_property_add_qapi(OBJECT(mr), "priority", &int32_type_info, memory_region_get_priority, NULL, /* memory_region_set_priority */ NULL, NULL); - object_property_add(OBJECT(mr), "size", "uint64", + object_property_add_qapi(OBJECT(mr), "size", &uint64_type_info, memory_region_get_size, NULL, /* memory_region_set_size, */ NULL, NULL); diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index a93ad2da5ad..67baeed8a3b 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -20,6 +20,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "cpu.h" #include "cpregs.h" #include "qemu/module.h" @@ -320,7 +321,7 @@ static void prop_bool_set_false(Object *obj, Visitor *v= , const char *name, =20 static void prop_add_stub_bool(Object *obj, const char *name) { - object_property_add(obj, name, "bool", prop_bool_get_false, + object_property_add_qapi(obj, name, &bool_type_info, prop_bool_get_fal= se, prop_bool_set_false, NULL, NULL); } =20 @@ -510,13 +511,13 @@ void aarch64_add_sve_properties(Object *obj) for (vq =3D 1; vq <=3D ARM_MAX_VQ; ++vq) { char name[8]; snprintf(name, sizeof(name), "sve%d", vq * 128); - object_property_add(obj, name, "bool", cpu_arm_get_vq, + object_property_add_qapi(obj, name, &bool_type_info, cpu_arm_get_v= q, cpu_arm_set_vq, NULL, &cpu->sve_vq); } =20 #ifdef CONFIG_USER_ONLY /* Mirror linux /proc/sys/abi/sve_default_vector_length. */ - object_property_add(obj, "sve-default-vector-length", "int32", + object_property_add_qapi(obj, "sve-default-vector-length", &int32_type= _info, cpu_arm_get_default_vec_len, cpu_arm_set_default_vec_len, NULL, &cpu->sve_default_vq); @@ -535,13 +536,13 @@ void aarch64_add_sme_properties(Object *obj) for (vq =3D 1; vq <=3D ARM_MAX_VQ; vq <<=3D 1) { char name[8]; snprintf(name, sizeof(name), "sme%d", vq * 128); - object_property_add(obj, name, "bool", cpu_arm_get_vq, + object_property_add_qapi(obj, name, &bool_type_info, cpu_arm_get_v= q, cpu_arm_set_vq, NULL, &cpu->sme_vq); } =20 #ifdef CONFIG_USER_ONLY /* Mirror linux /proc/sys/abi/sme_default_vector_length. */ - object_property_add(obj, "sme-default-vector-length", "int32", + object_property_add_qapi(obj, "sme-default-vector-length", &int32_type= _info, cpu_arm_get_default_vec_len, cpu_arm_set_default_vec_len, NULL, &cpu->sme_default_vq); diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 7d194ea112b..0aeb9b91a5e 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" @@ -1775,7 +1776,7 @@ static void kvm_arch_set_eager_split_size(Object *obj= , Visitor *v, =20 void kvm_arch_accel_class_init(ObjectClass *oc) { - object_class_property_add(oc, "eager-split-size", "size", + object_class_property_add_qapi(oc, "eager-split-size", &size_type_info, kvm_arch_get_eager_split_size, kvm_arch_set_eager_split_size, NULL, NULL); =20 diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c index 649d854a65b..270d4ff1343 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" @@ -1401,10 +1402,10 @@ void aarch64_max_tcg_initfn(Object *obj) aarch64_add_pauth_properties(obj); aarch64_add_sve_properties(obj); aarch64_add_sme_properties(obj); - object_property_add(obj, "sve-max-vq", "uint32", cpu_max_get_sve_max_v= q, + object_property_add_qapi(obj, "sve-max-vq", &uint32_type_info, cpu_max= _get_sve_max_vq, cpu_max_set_sve_max_vq, NULL, NULL); object_property_add_bool(obj, "x-rme", cpu_arm_get_rme, cpu_arm_set_rm= e); - object_property_add(obj, "x-l0gptsz", "uint32", cpu_max_get_l0gptsz, + object_property_add_qapi(obj, "x-l0gptsz", &uint32_type_info, cpu_max_= get_l0gptsz, cpu_max_set_l0gptsz, NULL, NULL); qdev_property_add_static(DEVICE(obj), &arm_cpu_lpa2_property); } diff --git a/target/i386/cpu.c b/target/i386/cpu.c index a98bcc218ba..e902d0e6d3f 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -10423,7 +10423,7 @@ static void x86_cpu_register_bit_prop(X86CPUClass *= xcc, fp =3D g_new0(BitProperty, 1); fp->w =3D w; fp->mask =3D mask; - object_class_property_add(oc, prop_name, "bool", + object_class_property_add_qapi(oc, prop_name, &bool_type_info, x86_cpu_get_bit_prop, x86_cpu_set_bit_prop, NULL, fp); @@ -10939,13 +10939,13 @@ static void x86_cpu_common_class_init(ObjectClass= *oc, const void *data) =20 dc->user_creatable =3D true; =20 - object_class_property_add(oc, "family", "int", + object_class_property_add_qapi(oc, "family", &int_type_info, x86_cpuid_version_get_family, x86_cpuid_version_set_family, NULL, NULL); - object_class_property_add(oc, "model", "int", + object_class_property_add_qapi(oc, "model", &int_type_info, x86_cpuid_version_get_model, x86_cpuid_version_set_model, NULL, NULL); - object_class_property_add(oc, "stepping", "int", + object_class_property_add_qapi(oc, "stepping", &int_type_info, x86_cpuid_version_get_stepping, x86_cpuid_version_set_stepping, NULL, NULL); object_class_property_add_str(oc, "vendor", @@ -10954,7 +10954,7 @@ static void x86_cpu_common_class_init(ObjectClass *= oc, const void *data) object_class_property_add_str(oc, "model-id", x86_cpuid_get_model_id, x86_cpuid_set_model_id); - object_class_property_add(oc, "tsc-frequency", "int", + object_class_property_add_qapi(oc, "tsc-frequency", &int_type_info, x86_cpuid_get_tsc_freq, x86_cpuid_set_tsc_freq, NULL, NULL); /* @@ -10967,7 +10967,7 @@ static void x86_cpu_common_class_init(ObjectClass *= oc, const void *data) x86_cpu_get_unavailable_features, NULL, NULL, NULL); =20 - object_class_property_add(oc, "avx10-version", "uint8", + object_class_property_add_qapi(oc, "avx10-version", &uint8_type_info, x86_cpuid_get_avx10_version, x86_cpuid_set_avx10_version, NULL, NULL); diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index ecf0c76fcdf..9b41d04259b 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -7096,7 +7096,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc) .set =3D kvm_arch_set_notify_vmexit, )); =20 - object_class_property_add(oc, "notify-window", "uint32", + object_class_property_add_qapi(oc, "notify-window", &uint32_type_info, kvm_arch_get_notify_window, kvm_arch_set_notify_window, NULL, NULL); @@ -7104,7 +7104,7 @@ void kvm_arch_accel_class_init(ObjectClass *oc) "Clock cycles without an event w= indow " "after which a notification VM e= xit occurs"); =20 - object_class_property_add(oc, "xen-version", "uint32", + object_class_property_add_qapi(oc, "xen-version", &uint32_type_info, kvm_arch_get_xen_version, kvm_arch_set_xen_version, NULL, NULL); @@ -7113,14 +7113,14 @@ void kvm_arch_accel_class_init(ObjectClass *oc) "(in XENVER_version form " "e.g. 0x4000a for 4.10)"); =20 - object_class_property_add(oc, "xen-gnttab-max-frames", "uint16", + object_class_property_add_qapi(oc, "xen-gnttab-max-frames", &uint16_ty= pe_info, kvm_arch_get_xen_gnttab_max_frames, kvm_arch_set_xen_gnttab_max_frames, NULL, NULL); object_class_property_set_description(oc, "xen-gnttab-max-frames", "Maximum number of grant table f= rames"); =20 - object_class_property_add(oc, "xen-evtchn-max-pirq", "uint16", + object_class_property_add_qapi(oc, "xen-evtchn-max-pirq", &uint16_type= _info, kvm_arch_get_xen_evtchn_max_pirq, kvm_arch_set_xen_evtchn_max_pirq, NULL, NULL); diff --git a/target/i386/sev.c b/target/i386/sev.c index 50a9bfc35d7..65570e032dc 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -3156,7 +3156,7 @@ sev_snp_guest_class_init(ObjectClass *oc, const void = *data) x86_klass->adjust_cpuid_features =3D sev_snp_adjust_cpuid_features; x86_klass->kvm_type =3D sev_snp_kvm_type; =20 - object_class_property_add(oc, "policy", "uint64", + object_class_property_add_qapi(oc, "policy", &uint64_type_info, sev_snp_guest_get_policy, sev_snp_guest_set_policy, NULL, NULL); object_class_property_add_str(oc, "guest-visible-workarounds", diff --git a/target/ppc/compat.c b/target/ppc/compat.c index 55de3bd5d5d..4d81225de37 100644 --- a/target/ppc/compat.c +++ b/target/ppc/compat.c @@ -23,6 +23,7 @@ #include "kvm_ppc.h" #include "system/cpus.h" #include "qemu/error-report.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "cpu-models.h" @@ -335,7 +336,7 @@ void ppc_compat_add_property(Object *obj, const char *n= ame, gchar *names, *desc; int i; =20 - object_property_add(obj, name, "string", + object_property_add_qapi(obj, name, &str_type_info, ppc_compat_prop_get, ppc_compat_prop_set, NULL, compat_pvr); =20 diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index a13727c0d4b..7d0cf88d48d 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -25,6 +25,7 @@ #include "cpu_vendorid.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 "hw/core/qdev-properties.h" @@ -1001,16 +1002,16 @@ void riscv_add_satp_mode_properties(Object *obj) RISCVCPU *cpu =3D RISCV_CPU(obj); =20 if (cpu->env.misa_mxl =3D=3D MXL_RV32) { - object_property_add(obj, "sv32", "bool", cpu_riscv_get_satp, + object_property_add_qapi(obj, "sv32", &bool_type_info, cpu_riscv_g= et_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); } else { - object_property_add(obj, "sv39", "bool", cpu_riscv_get_satp, + object_property_add_qapi(obj, "sv39", &bool_type_info, cpu_riscv_g= et_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv48", "bool", cpu_riscv_get_satp, + object_property_add_qapi(obj, "sv48", &bool_type_info, cpu_riscv_g= et_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv57", "bool", cpu_riscv_get_satp, + object_property_add_qapi(obj, "sv57", &bool_type_info, cpu_riscv_g= et_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); - object_property_add(obj, "sv64", "bool", cpu_riscv_get_satp, + object_property_add_qapi(obj, "sv64", &bool_type_info, cpu_riscv_g= et_satp, cpu_riscv_set_satp, NULL, &cpu->satp_modes); } } diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c index b047ffa9c0c..9e4eb2a6b08 100644 --- a/target/riscv/kvm/kvm-cpu.c +++ b/target/riscv/kvm/kvm-cpu.c @@ -24,6 +24,7 @@ =20 #include "qemu/timer.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qapi/visitor.h" @@ -519,7 +520,7 @@ static void riscv_cpu_add_kvm_unavail_prop(Object *obj,= const char *prop_name) * unknown to KVM and error out if the user attempts * to enable any of them. */ - object_property_add(obj, prop_name, "bool", + object_property_add_qapi(obj, prop_name, &bool_type_info, cpu_get_cfg_unavailable, cpu_set_cfg_unavailable, NULL, (void *)prop_name); @@ -550,7 +551,7 @@ static void kvm_riscv_add_cpu_user_properties(Object *c= pu_obj) misa_cfg->name =3D riscv_get_misa_ext_name(bit); misa_cfg->description =3D riscv_get_misa_ext_description(bit); =20 - object_property_add(cpu_obj, misa_cfg->name, "bool", + object_property_add_qapi(cpu_obj, misa_cfg->name, &bool_type_info, kvm_cpu_get_misa_ext_cfg, kvm_cpu_set_misa_ext_cfg, NULL, misa_cfg); @@ -566,7 +567,7 @@ static void kvm_riscv_add_cpu_user_properties(Object *c= pu_obj) for (i =3D 0; i < ARRAY_SIZE(kvm_multi_ext_cfgs); i++) { KVMCPUConfig *multi_cfg =3D &kvm_multi_ext_cfgs[i]; =20 - object_property_add(cpu_obj, multi_cfg->name, "bool", + object_property_add_qapi(cpu_obj, multi_cfg->name, &bool_type_info, kvm_cpu_get_multi_ext_cfg, kvm_cpu_set_multi_ext_cfg, NULL, multi_cfg); diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c index 02c98cc2dbb..1c311ea0aaf 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" @@ -1437,7 +1438,7 @@ static void riscv_cpu_add_misa_properties(Object *cpu= _obj) continue; } =20 - object_property_add(cpu_obj, name, "bool", + object_property_add_qapi(cpu_obj, name, &bool_type_info, cpu_get_misa_ext_cfg, cpu_set_misa_ext_cfg, NULL, (void *)misa_cfg); @@ -1491,7 +1492,7 @@ static void riscv_cpu_add_profiles(Object *cpu_obj) for (int i =3D 0; riscv_profiles[i] !=3D NULL; i++) { RISCVCPUProfile *profile =3D riscv_profiles[i]; =20 - object_property_add(cpu_obj, profile->name, "bool", + object_property_add_qapi(cpu_obj, profile->name, &bool_type_info, cpu_get_profile, cpu_set_profile, NULL, (void *)profile); =20 @@ -1554,7 +1555,7 @@ static void cpu_add_multi_ext_prop(Object *cpu_obj, { bool generic_cpu =3D riscv_cpu_is_generic(cpu_obj); =20 - object_property_add(cpu_obj, multi_cfg->name, "bool", + object_property_add_qapi(cpu_obj, multi_cfg->name, &bool_type_info, cpu_get_multi_ext_cfg, cpu_set_multi_ext_cfg, NULL, (void *)multi_cfg); diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 0b88868289b..bbf983afee9 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" @@ -906,13 +907,13 @@ void s390_cpu_model_class_register_props(ObjectClass = *oc) =20 for (feat =3D 0; feat < S390_FEAT_MAX; feat++) { const S390FeatDef *def =3D s390_feat_def(feat); - object_class_property_add(oc, def->name, "bool", get_feature, + object_class_property_add_qapi(oc, def->name, &bool_type_info, get= _feature, set_feature, NULL, (void *) feat); object_class_property_set_description(oc, def->name, def->desc); } for (group =3D 0; group < S390_FEAT_GROUP_MAX; group++) { const S390FeatGroupDef *def =3D s390_feat_group_def(group); - object_class_property_add(oc, def->name, "bool", get_feature_group, + object_class_property_add_qapi(oc, def->name, &bool_type_info, get= _feature_group, set_feature_group, NULL, (void *) group); object_class_property_set_description(oc, def->name, def->desc); } diff --git a/tests/unit/test-qdev-global-props.c b/tests/unit/test-qdev-glo= bal-props.c index 8ea362cbb90..204436fb727 100644 --- a/tests/unit/test-qdev-global-props.c +++ b/tests/unit/test-qdev-global-props.c @@ -27,6 +27,7 @@ #include "hw/core/qdev-properties.h" #include "qom/object.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" =20 =20 @@ -171,10 +172,12 @@ static void prop2_accessor(Object *obj, Visitor *v, c= onst char *name, =20 static void dynamic_instance_init(Object *obj) { - object_property_add(obj, "prop1", "uint32", prop1_accessor, prop1_acce= ssor, - NULL, NULL); - object_property_add(obj, "prop2", "uint32", prop2_accessor, prop2_acce= ssor, - NULL, NULL); + object_property_add_qapi(obj, "prop1", &uint32_type_info, + prop1_accessor, prop1_accessor, + NULL, NULL); + object_property_add_qapi(obj, "prop2", &uint32_type_info, + prop2_accessor, prop2_accessor, + NULL, NULL); } =20 static void dynamic_class_init(ObjectClass *oc, const void *data) diff --git a/ui/console.c b/ui/console.c index 799d61ec1a5..e048d694c35 100644 --- a/ui/console.c +++ b/ui/console.c @@ -27,6 +27,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" @@ -488,7 +489,7 @@ qemu_graphic_console_class_init(ObjectClass *oc, const = void *data) offsetof(QemuGraphicConsole, device), object_property_allow_set_link, OBJ_PROP_LINK_STRONG); - object_class_property_add(oc, "head", "uint32", + object_class_property_add_qapi(oc, "head", &uint32_type_info, qemu_graphic_console_prop_get_head, NULL, NULL, NULL); =20 diff --git a/util/thread-context.c b/util/thread-context.c index 0146154fa56..ee90d8d5d99 100644 --- a/util/thread-context.c +++ b/util/thread-context.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "qemu/thread-context.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-builtin-visit.h" #include "qapi/visitor.h" #include "qemu/config-file.h" @@ -278,13 +279,13 @@ static void thread_context_class_init(ObjectClass *oc= , const void *data) UserCreatableClass *ucc =3D USER_CREATABLE_CLASS(oc); =20 ucc->complete =3D thread_context_instance_complete; - object_class_property_add(oc, "thread-id", "int", + object_class_property_add_qapi(oc, "thread-id", &int_type_info, thread_context_get_thread_id, NULL, NULL, NULL); - object_class_property_add(oc, "cpu-affinity", "int", + object_class_property_add_qapi(oc, "cpu-affinity", &int_type_info, thread_context_get_cpu_affinity, thread_context_set_cpu_affinity, NULL, NULL); - object_class_property_add(oc, "node-affinity", "int", NULL, + object_class_property_add_qapi(oc, "node-affinity", &int_type_info, NU= LL, thread_context_set_node_affinity, NULL, NULL= ); } =20 --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420991; cv=none; d=zohomail.com; s=zohoarc; b=jsLT8Ce89UiMe3oOPXaZz7d2y+jwsHhg8QLcg94kcDdEgR7Wz+Efhsurxar4TXIzgWo/00wFW1YV0Dj0ziB7JU7mn/BbJpRPILTUmJd1D+PRTNFSrnP1D0fDKDJTD+Wr8ZlM6/t4iz+OIYLS0CwkDjSmL5vZYzCXxklTnpLdmOs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420991; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=c9M0jzjB5QWgA6OjrGy+78zDU5Q5ObVFQZ1cmiLj3RA=; b=Sf3lAnau8bgwaxD5gGALyHnQaIoTF0CdurG83EsZhFYKcy70slJnP+u8KtBZRy3N7CPG8gbe4Xui6sEyztJp+TofTV7hDf9TTAvpqaApOa604g+0PJzf7lJ4p0EMw/xL+cVSe6L5jX9SV4ePErPxDI+axQaI4w0jmLK6z0v2oU8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177842099186976.25874287699992; Sun, 10 May 2026 06:49:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4XP-0001od-QT; Sun, 10 May 2026 09:49:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4XN-0001eJ-Ix for qemu-devel@nongnu.org; Sun, 10 May 2026 09:49:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4XL-0005Xz-Sz for qemu-devel@nongnu.org; Sun, 10 May 2026 09:49:41 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-490-5tvfOHYaOqSwB_vy6y_dnA-1; Sun, 10 May 2026 09:49:36 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DEE1118005B5 for ; Sun, 10 May 2026 13:49:35 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 07F671955D84; Sun, 10 May 2026 13:49:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c9M0jzjB5QWgA6OjrGy+78zDU5Q5ObVFQZ1cmiLj3RA=; b=NjGDXcEJiYOnLa/UjirawfOxhFTFegngoKyrRuSu/ymW0DZBwVmo7ybrRbwxe0gr1Iu/6o cU1L7YgTAgEwvO29I/obVe1B6hRKjqCAlHhxXdKpobFBP8731J6+S1wp9Hz0JBBiEwAKog XLeTh6+in9LlTL9QwOvGfIwtgTgQCrk= X-MC-Unique: 5tvfOHYaOqSwB_vy6y_dnA-1 X-Mimecast-MFC-AGG-ID: 5tvfOHYaOqSwB_vy6y_dnA_1778420976 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:29 +0400 Subject: [PATCH 32/54] i386/cpu: convert strList property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-32-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=853; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=RpFxiGx7DlKF3M3cA7HlhzjYqpElkc/Xx+/zjTy887U=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItwzxyK1c0aBi/YNfaLWLLZfL64ONO25Do+m vsDW6gJR5CJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcAAKCRDa6OEJdZac 5cgKD/9qRZ+hylW+g4k37r6KsF1k3aqpTTaUdSceTZjXv5F+zyik9/aQoBNV8nyZdHgLM3J51IA fb3TzjTI9c+I0JD6yvY+TGzBrkOjvBqCuKye8EeZKCOFSqAs3wl4ISaSHMbWthKJh9WJHeK/GvB 98fNh3I04d1pSIfPhcTz3KVq5ox/bpO3JlXDXeFBpfmLLBeq8JVkUneUxXd0L+LS+gNqoT86niP VYfWVLDUc0ntiPT1TEtr3eWRI0XMH5kXHQE++vIBN/zVSkYfYPQhCeRbBBUdnPijFNalj0bETTz 667qkhKpIjBt+kloIyoH/tcmBK4MDvfm1SZ5l0++sfwE/R4svEwIZ4lAPJiTK4EVr7FBesODkUq JqSCIFpR1LV7qzv0urtQB0imMNCBlf/z/eUP8fIsGrmkTJJvuF6e7qK8mH5vs3u6WdDFeRnC5fo JIUpO79H85YygVqac0NeNC1KbTnEAfT7RQdX+yt0qzcBfR3t2dAq3CwXsaY/XkypkYiyKZWTD8k x9d0ofHwBpyTjBv/1u3Ao6p2Nr0/jD8C74K7ib3qhimo9Pk4I5XrSOrVysUzW0Tz3aJ95jgHrNk G3Dx7Ycf4g0IhN+JuTxzkPvQQo9fPnvGOH3Jz+nw/Em0lDa+TT48s9fNkn3VVN290z1yd7TElqS v77MTDaoG4XR2qA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778420992486158501 Signed-off-by: Marc-Andr=C3=A9 Lureau --- target/i386/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index e902d0e6d3f..b7f5cf6ddb7 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -10963,7 +10963,8 @@ static void x86_cpu_common_class_init(ObjectClass *= oc, const void *data) * QMP command: they list the features that would have prevented the * CPU from running if the "enforce" flag was set. */ - object_class_property_add(oc, "unavailable-features", "strList", + object_class_property_add_qapi(oc, "unavailable-features", + &strList_type_info, x86_cpu_get_unavailable_features, NULL, NULL, NULL); =20 --=20 2.54.0 From nobody Mon May 25 20:32: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=1778420996; cv=none; d=zohomail.com; s=zohoarc; b=Xchxra2UZXZvaRG/tTT37wpL1aOKum7b4dbSWGLLc1QFawwSYt4RsZFCDJn/JyyR1aeYpcabXnSiQUdzAD8X+ieZJax9y1j3GygObq8jASmIbV41MhLGiBNLMMIESUVstxDAbJ7aqnwVDgUmsHVmrzhJNXw2VDfNjjHX83z9VjM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778420996; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=C3pBO+XB8waPPvVWGGQ0Oe17o6K78G/MAtURYgwN84I=; b=OgaoEiwtWPSYA4jV1LJ/b1WXnNqNK5tzzaTJiW7DXWj1pzPlK/Bv9bcV5VhyG++NJWuNEqFmvNlAI37gPVmBbBKgLOe84C+AlN9HlwV2oRq1rrWPcES4Uyfe63TpGlbwnVyRCHhqGHSqAvPeF0efiWVNmLWahMHI5osYOH+WDd4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778420996014463.36513746299056; Sun, 10 May 2026 06:49:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4Xa-0002JR-Dv; Sun, 10 May 2026 09:49:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4XY-00029M-Ek for qemu-devel@nongnu.org; Sun, 10 May 2026 09:49:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4XW-0005eW-N6 for qemu-devel@nongnu.org; Sun, 10 May 2026 09:49:52 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-299-AqiqrxLgMuaPQMLcFF1-_Q-1; Sun, 10 May 2026 09:49:48 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6077D18002CB for ; Sun, 10 May 2026 13:49:47 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id ABAA23002D30; Sun, 10 May 2026 13:49:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C3pBO+XB8waPPvVWGGQ0Oe17o6K78G/MAtURYgwN84I=; b=eysxF5Un292/ogq0bt4KJNGfDX7PIp+k/FmBqdDBmo8uUF1f/vpLskylsyGfp4D1TOQNsU Pf/vsIS4ySyEolsoReQ4IiYRt1P6d/YlFPnbwrClBjCBiAP1mHTyw4TpVc2E0lk1XJ5CI0 b+1xUqQFFq6yULApju7eRnms+fewzwc= X-MC-Unique: AqiqrxLgMuaPQMLcFF1-_Q-1 X-Mimecast-MFC-AGG-ID: AqiqrxLgMuaPQMLcFF1-_Q_1778420987 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:30 +0400 Subject: [PATCH 33/54] accel/hvf: convert OnOffSplit property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-33-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2484; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=iwbaeAoF/33Kw17kEtq0TnwDPZ2R6UiTQZltouoz2ZI=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItwZqjsX6NBQDKWUfroFxmWO3D8J7VL1Gv/e B12q78XfkqJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcAAKCRDa6OEJdZac 5YXeEACKiq6b+6XcwYzUwbHcpbWEkD3GgNvrOI1cRAmCcXNRp9rrV/Kst1rpjBeoQchwsMstywL iZamoBM2Rz51eP/94IgZjvAq13WgvRX0K/dzDryepMc0SMc0I++uN4nAK5Y3ta7RT2rddHT1yYW fRyaNOj5TITqJoDxrar2MGiNoWDVU8V0lmkm5tJpIUYru4ysxBlbOmlUjhj/ORlVf0OZ2oZszDQ 3jtlJ9CpFmDD2e/uc5UIRJ5tZx8M9hkeHeCP0wJGgUsuiXVME109zsaT+g2abYUnvnhw5wjDjIb e6RSOW/UXDFsTeK/M0zPl41+dN3SYX9xSU5W5umSMBDrnk/kA4I3DBByb0aYYnta0mHe6X5TMCA JdddhFkVe9e9lTF27ycHmw8Du7ihxp0lSMzMxZBBZU6zf4nhN7WaupP+2HElo7WJctdqhJJmhpz 6IiDbR9t75/fywJt665nKEfCq5X4jOaGmoQncUawDEBk67krk28Uq7MGdG0YMTLSFuA7LV8Q4Bw FmIr79+60IpOT8AsOZOxJfqUXwVx0V/Gy4/FxXUxF3jh1zIgkPcwJQEDwGp+dUaXtyfifl5JoUd vOvokWRyjpU74Sv7HNOlHcdMtzoz1TKst6YqNu3wIkFOP8VsMgkWMIF4MZM+k4KonECfbr5R8rA b5wc6vV7CfrJBbw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=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: 1778420996540158500 Convert the OnOffSplit property from manual visitor-based callbacks to property_add_qapi_enum(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- accel/hvf/hvf-all.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 946dbca59d0..982072d17ea 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" @@ -233,18 +234,12 @@ static int hvf_gdbstub_sstep_flags(AccelState *as) return SSTEP_ENABLE | SSTEP_NOIRQ; } =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. */ @@ -264,11 +259,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 @@ -281,11 +272,13 @@ static void hvf_accel_class_init(ObjectClass *oc, con= st void *data) ac->gdbstub_supported_sstep_flags =3D hvf_gdbstub_sstep_flags; hvf_kernel_irqchip_override =3D false; hvf_kernel_irqchip =3D false; - object_class_property_add(oc, "kernel-irqchip", "on|off|split", - NULL, hvf_set_kernel_irqchip, - NULL, NULL); - object_class_property_set_description(oc, "kernel-irqchip", - "Configure HVF irqchip"); + + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "kernel-irqchip", + .qapi_type =3D &OnOffSplit_type_info, + .set =3D hvf_set_kernel_irqchip, + .description =3D "Configure HVF irqchip", + )); } =20 static const TypeInfo hvf_accel_type =3D { --=20 2.54.0 From nobody Mon May 25 20:32: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=1778421031; cv=none; d=zohomail.com; s=zohoarc; b=Tr6UPqv0Y/NF/pxamfHjlMli8F2D31knFzN2IWxsAWiojYO+v7GZjXkCoN2OQyHAYBmY1MRzkYYQKVcfZ5/jlsUoIz9Th3RfFDuwn11fktwnb+yc2duGv5KpxO4U5V9dPg4knuJgA0ewNFz65gekj5kKXKIGpepH5SR5XybcUB0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421031; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5VD7MU33aS37wQ5xXtxio1cC1VAVDMXY4axo0UiJUnA=; b=JbG2/lJZUXoZjYc5jJU1A8EzmdOkrhHKCnTq6iJfohVRffCrd36Pj89LqBeR+OKL4yS8Y0O+2Cu+RmXPR2JiT6mAhH8+b46eNP/hzYh816w0KGXq8iTrPkhipdWQZSPuQrK/GgpxryA8/6rEmlhKtS7GsOMMbPpoPsYb8kfT9oY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421031946634.5099506868983; Sun, 10 May 2026 06:50:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4Y2-0002nt-PJ; Sun, 10 May 2026 09:50:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Xh-0002YM-Nu for qemu-devel@nongnu.org; Sun, 10 May 2026 09:50:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Xe-0005jV-VC for qemu-devel@nongnu.org; Sun, 10 May 2026 09:50:00 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-122-GBLqX1TjPhq4AbXntb2jzg-1; Sun, 10 May 2026 09:49:56 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F3C0119560AA for ; Sun, 10 May 2026 13:49:55 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 36FE718004A3; Sun, 10 May 2026 13:49:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778420998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5VD7MU33aS37wQ5xXtxio1cC1VAVDMXY4axo0UiJUnA=; b=QjjFn/q70Xgx6wZRcslgBDxZP49A/cjnOQSmheOBkgWzN9YmQLSB0syTRkMOznE1AnuWjx x7dkn+7wfK7kukDRf90HI02UvYVf7qcl6UwKzYsuHMGxv84nOCn/s6ItYAA6ok9NL1KTCA wiCxT0UoIFgiHF0ZKzD2XWU5xCb88Wg= X-MC-Unique: GBLqX1TjPhq4AbXntb2jzg-1 X-Mimecast-MFC-AGG-ID: GBLqX1TjPhq4AbXntb2jzg_1778420996 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:31 +0400 Subject: [PATCH 34/54] i386/x86: convert SgxEPCList property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-34-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1048; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=Y9Qj8UB50a/ZpWUQWFjUUfCv5FpzLcPre8QWu0h9f+I=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItw7G4+wtQGGBLplWkrhNlwDelqUevJHekB1 51juw24oF6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcAAKCRDa6OEJdZac 5eAzEAC5oGLDiIphz5JIbtZyPrke0OSvR8hSqzTyZmeCItSv1T7pz99mQVoLz0nGbuYfDhy6z71 ZrS1N8CuNQQ+EydN6wAVPxH9Tp/90NFvLIpUFHio/SrdLcRKtEl7+WEVHJNpRlwyeXm/gsi6MTM b4vVbTMhdFNpZRHvKZby8YHAB+Krf35t5/HU/C7bKhMtaomYVcAQY7Y0TXT6BB2g3r284mmlWIC uFNuVXaH5DW7L6zPHjPwJCHWmGqoVSZjnUtBLiHTFEIcHdSzcTVMUe2LELzUUakYV6y6gAFMd4q 2JVkw+OdItf67dVKHETJLFXbQEcy++hqWtVJsZZ0Jd0KTzszsaXyn/1cjOSwwgzMHYbO2F0OPcF mYHA4i3fLQpuwOkwd8L/qZk1AkS+A1LZYOfVPhIYnwOPFWkwK3ARJ2eJ2qfXGwgRoK7ljb8ASaH ZszdaZDRDtPLQJJMUYOX2Ludq1hSfY33fvg4bWA6eNVrlR4WjnnEbrC4cirxGcL9SfCOxADKm9H qbi1qDGS6ghKk0kD3JXYXgtxUlVrLOosFzg+M8C0OIwqOqTm+sBp5TLiBrMZBQL2+JU2NGhiicQ BC0MlzObXdGuU4CzA8F1Fe8uVNT5hrnTCzytENVYR1em5aWqxalXhOVAeKfNS1jx0fSvf9V695H NGz79kiEEHsSJUQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778421034200154100 Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/i386/x86.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 3ff54c6f3f9..a3b4cc60315 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" @@ -418,7 +419,7 @@ static void x86_machine_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, X86_MACHINE_BUS_LOCK_RATELIM= IT, "Set the ratelimit for the bus locks acquired in VMs"); =20 - object_class_property_add(oc, "sgx-epc", "SgxEPC", + object_class_property_add_qapi(oc, "sgx-epc", &SgxEPCList_type_info, machine_get_sgx_epc, machine_set_sgx_epc, NULL, NULL); object_class_property_set_description(oc, "sgx-epc", --=20 2.54.0 From nobody Mon May 25 20:32: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=1778421034; cv=none; d=zohomail.com; s=zohoarc; b=Wd9Z+iXQcwZWM8jC4Pvff2Tq7vSW78oK0sRHpwkN2ZwgGSwDMuibAi4fAXvOcROFVzVfhmb7+bDa/XimuakysQoy/l7kckCXAVyySbH8fSKtK5HjPppf5uQJFzA5JVIFYmZSgi3KonmA1GX9Y7Per7kTtJ/0aFxcIdUkHcmtH9I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421034; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hOR5Fz4I8fH5dZge/t0gwMnAmkObJtYhqnACaNL668s=; b=hTCFK3ey0nUzn+F8LqX7cWtHCaq/wwstFQyx+YHl+sSQkxi/OnI1SKc+6TQDw8Ji5pZh19XACgYC2/gW3Mdk9f1Fy8EdMyqA8n7Wh39XWRub0JVxvRzsC3p3a/iCuY/AFgzk2TM14NHg9Gkm5Xx6bAs4KaiGHlhNCdveUlCLoEI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421034092495.6761224806604; Sun, 10 May 2026 06:50:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4Y6-0002wq-Q3; Sun, 10 May 2026 09:50:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Xw-0002nW-0W for qemu-devel@nongnu.org; Sun, 10 May 2026 09:50:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Xs-0005zf-4m for qemu-devel@nongnu.org; Sun, 10 May 2026 09:50:14 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-621-XdTSr5r1MfWqKz4vVh1gGA-1; Sun, 10 May 2026 09:50:09 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 287EF195609E for ; Sun, 10 May 2026 13:50:09 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 912961800240; Sun, 10 May 2026 13:50:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hOR5Fz4I8fH5dZge/t0gwMnAmkObJtYhqnACaNL668s=; b=dcHPaktwBAlLDcTefC/M2GY6ZHgwiosPFmwOlju1Wr/4OLWJb6YqQpOxVtgCwbB7QwDODe GdJNTh5d+srVfOZPKkFSkqm0jBLaHyPhcHlo6KG0UFtBZgA3u8XpeVkEoMcVMt0jUBgxms lF/dq0aXRf1exXXtNXGKH6No9lZS8Y4= X-MC-Unique: XdTSr5r1MfWqKz4vVh1gGA-1 X-Mimecast-MFC-AGG-ID: XdTSr5r1MfWqKz4vVh1gGA_1778421009 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:32 +0400 Subject: [PATCH 35/54] virtio-balloon: convert guest-stats property to QAPI type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-35-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=10057; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=XCk/M4Otn8oLL/1a9v9H08MZ1uICAg0OSwJBeYuC2LI=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItwJ3bbaf8JIHicbn3zy1pJeNb52NKKUB0Vz 9lA9NHmJeGJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcAAKCRDa6OEJdZac 5RfpD/9FjHyvf6ljvfdETWS+0UUDJjRzXQHMtW7pjcp/QkPgrYGls4QtWHmARo7DbIvyZqIawZl P4DFSpQ7pfDZo1/8rsYxdj6Wt198Oy+mPCKuD1z/HLqLzTGswoeAFuRP3ot7QuY7wvgeN+tITW7 h1Ec57ZbDLu5vEhAG38fAVNKfC7K+gqrCQCTI7L1KMCBDobtoK84Os5cg0V5mHCW5mwtJ6uvElU j4/vHiVqOt4COONa0BEWfpws4Lq83ckBQOIe6eyIEAzlri82u4IsvYK3rOtQHCcVWcT6+NpB3EJ M+BO9jk6MeE2f0pACFSwnkrM04mKyLqHEYvWnb/4/GO5lbJePfS+Qxa6mhmOYtepUw0FpvHgjg6 IDNaVfAWEg9335wUoiA2q6MN46Lomj9mBeJaVcYmKgG4KapzfBqUdSdJmDOc77FD7zqYWy6EmVY qD4tcx5yI8I5pdVvT4VAYE1CQBnYtu4q0mC/gL6EaxcjMOQ3G8zVGeblLyQmXUv9qC26uZyMfyS 80tUJ3ygwKOiCbnmmDBUfBflvp50INnzkze8yeWJnYGP0oUPUTsFCv3zjkBkVVLtMScEFGRtS/i OZ2XQwnB6TEcjOzF0cu+O76zrbqUoVMTSmozZusGZKc8Ad1oG4UopFzAOKc5RpHOtCjmJVH4OZu XdQL3/8hWlQ8YRw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=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: 1778421035222158500 Define VirtioBalloonStats and VirtioBalloonGuestStats QAPI struct types in the schema, replacing the hand-rolled visitor in balloon_stats_get_all() with a generated visit_type_VirtioBalloonGuestStats() call. The wire format is preserved: the JSON output from qom-get is identical to the previous hand-rolled visitor output. Signed-off-by: Marc-Andr=C3=A9 Lureau --- docs/interop/virtio-balloon-stats.rst | 22 +-------- qapi/machine.json | 92 +++++++++++++++++++++++++++++++= ++++ hw/virtio/virtio-balloon.c | 86 ++++++++++++-------------------- 3 files changed, 124 insertions(+), 76 deletions(-) diff --git a/docs/interop/virtio-balloon-stats.rst b/docs/interop/virtio-ba= lloon-stats.rst index b9a6a6edb22..88d3271bbb0 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 685e4e29b87..3327f985be2 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1131,6 +1131,98 @@ ## { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } } =20 +## +# @VirtioBalloonStats: +# +# VirtIO balloon device guest memory statistics. +# +# If the guest doesn't support a particular stat, or if it couldn't +# be retrieved, its value will be -1. +# +# @stat-swap-in: The amount of memory that has been +# swapped in (in bytes). +# +# @stat-swap-out: The amount of memory that has been +# swapped out to disk (in bytes). +# +# @stat-major-faults: The number of major page faults +# that have occurred. +# +# @stat-minor-faults: The number of minor page faults +# that have occurred. +# +# @stat-free-memory: The amount of memory not being used +# for any purpose (in bytes). +# +# @stat-total-memory: The total amount of memory available +# (in bytes). +# +# @stat-available-memory: An estimate of how much memory is available +# (in bytes) for starting new applications, without pushing the +# system to swap. +# +# @stat-disk-caches: The amount of memory, in bytes, that can be +# quickly reclaimed without additional I/O. Typically these pages +# are used for caching files from disk. +# +# @stat-htlb-pgalloc: The number of successful hugetlb page +# allocations +# +# @stat-htlb-pgfail: The number of failed hugetlb page +# allocations +# +# @stat-oom-kills: The number of OOM killer invocations +# +# @stat-alloc-stalls: The number of memory allocation stalls +# +# @stat-async-scans: The number of memory scanned asynchronously +# +# @stat-direct-scans: The number of memory scanned directly +# +# @stat-async-reclaims: The number of memory reclaimed asynchronously +# +# @stat-direct-reclaims: The number of memory reclaimed directly +# +# Since: 11.1 +## +{ 'struct': 'VirtioBalloonStats', + 'data': { + 'stat-swap-in': 'uint64', + 'stat-swap-out': 'uint64', + 'stat-major-faults': 'uint64', + 'stat-minor-faults': 'uint64', + 'stat-free-memory': 'uint64', + 'stat-total-memory': 'uint64', + 'stat-available-memory': 'uint64', + 'stat-disk-caches': 'uint64', + 'stat-htlb-pgalloc': 'uint64', + 'stat-htlb-pgfail': 'uint64', + 'stat-oom-kills': 'uint64', + 'stat-alloc-stalls': 'uint64', + 'stat-async-scans': 'uint64', + 'stat-direct-scans': 'uint64', + 'stat-async-reclaims': 'uint64', + 'stat-direct-reclaims': 'uint64' } } + +## +# @VirtioBalloonGuestStats: +# +# Guest statistics from the VirtIO balloon device. +# +# @last-update: timestamp in seconds of the last stats +# update from the guest (since this timestamp is generated +# by the host, a buggy guest can't influence its value), +# or 0 if no update has been received yet. +# +# @stats: balloon memory statistics +# +# Since: 11.1 +## +{ 'struct': 'VirtioBalloonGuestStats', + 'data': { + 'last-update': 'int', + 'stats': 'VirtioBalloonStats' } } + ## # @query-balloon: # diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 9e43948128f..c9873f8cf0c 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -29,6 +29,8 @@ #include "qapi/error.h" #include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-events-machine.h" +#include "qapi/qapi-type-infos-machine.h" +#include "qapi/qapi-visit-machine.h" #include "qapi/visitor.h" #include "trace.h" #include "qemu/error-report.h" @@ -169,33 +171,8 @@ static void balloon_deflate_page(VirtIOBalloon *balloo= n, } } =20 -/* - * All stats upto VIRTIO_BALLOON_S_NR /must/ have a - * non-NULL name declared here, since these are used - * as keys for populating the QDict with stats - */ -static const char *balloon_stat_names[] =3D { - [VIRTIO_BALLOON_S_SWAP_IN] =3D "stat-swap-in", - [VIRTIO_BALLOON_S_SWAP_OUT] =3D "stat-swap-out", - [VIRTIO_BALLOON_S_MAJFLT] =3D "stat-major-faults", - [VIRTIO_BALLOON_S_MINFLT] =3D "stat-minor-faults", - [VIRTIO_BALLOON_S_MEMFREE] =3D "stat-free-memory", - - [VIRTIO_BALLOON_S_MEMTOT] =3D "stat-total-memory", - [VIRTIO_BALLOON_S_AVAIL] =3D "stat-available-memory", - [VIRTIO_BALLOON_S_CACHES] =3D "stat-disk-caches", - [VIRTIO_BALLOON_S_HTLB_PGALLOC] =3D "stat-htlb-pgalloc", - [VIRTIO_BALLOON_S_HTLB_PGFAIL] =3D "stat-htlb-pgfail", - - [VIRTIO_BALLOON_S_OOM_KILL] =3D "stat-oom-kills", - [VIRTIO_BALLOON_S_ALLOC_STALL] =3D "stat-alloc-stalls", - [VIRTIO_BALLOON_S_ASYNC_SCAN] =3D "stat-async-scans", - [VIRTIO_BALLOON_S_DIRECT_SCAN] =3D "stat-direct-scans", - [VIRTIO_BALLOON_S_ASYNC_RECLAIM] =3D "stat-async-reclaims", - - [VIRTIO_BALLOON_S_DIRECT_RECLAIM] =3D "stat-direct-reclaims", -}; -G_STATIC_ASSERT(G_N_ELEMENTS(balloon_stat_names) =3D=3D VIRTIO_BALLOON_S_N= R); +/* Update VirtioBalloonStats QAPI type when new stats are added */ +G_STATIC_ASSERT(VIRTIO_BALLOON_S_NR =3D=3D 16); =20 /* * reset_stats - Mark all items in the stats array as unset @@ -257,33 +234,31 @@ static void balloon_stats_get_all(Object *obj, Visito= r *v, const char *name, void *opaque, Error **errp) { VirtIOBalloon *s =3D VIRTIO_BALLOON(obj); - bool ok =3D false; - int i; - - 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); + VirtioBalloonStats stats =3D { + .stat_swap_in =3D s->stats[VIRTIO_BALLOON_S_SWAP_IN], + .stat_swap_out =3D s->stats[VIRTIO_BALLOON_S_SWAP_OUT], + .stat_major_faults =3D s->stats[VIRTIO_BALLOON_S_MAJFLT], + .stat_minor_faults =3D s->stats[VIRTIO_BALLOON_S_MINFLT], + .stat_free_memory =3D s->stats[VIRTIO_BALLOON_S_MEMFREE], + .stat_total_memory =3D s->stats[VIRTIO_BALLOON_S_MEMTOT], + .stat_available_memory =3D s->stats[VIRTIO_BALLOON_S_AVAIL], + .stat_disk_caches =3D s->stats[VIRTIO_BALLOON_S_CACHES], + .stat_htlb_pgalloc =3D s->stats[VIRTIO_BALLOON_S_HTLB_PGALLOC], + .stat_htlb_pgfail =3D s->stats[VIRTIO_BALLOON_S_HTLB_PGFAIL], + .stat_oom_kills =3D s->stats[VIRTIO_BALLOON_S_OOM_KILL], + .stat_alloc_stalls =3D s->stats[VIRTIO_BALLOON_S_ALLOC_STALL], + .stat_async_scans =3D s->stats[VIRTIO_BALLOON_S_ASYNC_SCAN], + .stat_direct_scans =3D s->stats[VIRTIO_BALLOON_S_DIRECT_SCAN], + .stat_async_reclaims =3D s->stats[VIRTIO_BALLOON_S_ASYNC_RECLAIM], + .stat_direct_reclaims =3D s->stats[VIRTIO_BALLOON_S_DIRECT_RECLAIM= ], + }; + VirtioBalloonGuestStats guest_stats =3D { + .last_update =3D s->stats_last_update, + .stats =3D &stats, + }; + VirtioBalloonGuestStats *argp =3D &guest_stats; + + visit_type_VirtioBalloonGuestStats(v, name, &argp, errp); } =20 static void balloon_stats_get_poll_interval(Object *obj, Visitor *v, @@ -1020,7 +995,8 @@ static void virtio_balloon_instance_init(Object *obj) s->free_page_hint_cmd_id =3D VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN; s->free_page_hint_notify.notify =3D virtio_balloon_free_page_hint_noti= fy; =20 - object_property_add(obj, "guest-stats", "guest statistics", + object_property_add_qapi(obj, "guest-stats", + &VirtioBalloonGuestStats_type_info, balloon_stats_get_all, NULL, NULL, NULL); =20 object_property_add_qapi(obj, "guest-stats-polling-interval", &int_typ= e_info, --=20 2.54.0 From nobody Mon May 25 20:32: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=1778421042; cv=none; d=zohomail.com; s=zohoarc; b=CyUBqCLJjYA30iVQhUwOI6UnnqdCNRZAOe2EVoPQfGipS3F/8N6MbawCQAD/K3dM3v0CDub4OxO3Ci3HOVvX7w/EGxR9P5GW+P3WA11BqtwnhP7lQZI72raeUsMjXzZquUK4XNAZik7RAkiA/eWVisAlLjzkOydtQZ22Cdc2/To= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421042; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Q3O9/3drz3R7uunb+d8pvw9xVjRomqq7ZrcXLbUuSZE=; b=fzISt30d6t8VintpZ6T/QencEHt/UBn+tM8dGoSOb129ej2lYIgLdBLGF2cD0Z6tNV0MF12E9fBLK2iktJ5iX2+whldkbckefPVNTVgu2LLnhTlquYI1uBSAU0GsNVuai1Sxx+tI6T6wKvteRamLlsa5E0psb6HnNFdnKyPiq5k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421042662474.5174437645968; Sun, 10 May 2026 06:50:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4YG-0003L6-JT; Sun, 10 May 2026 09:50:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Y9-00033i-0P for qemu-devel@nongnu.org; Sun, 10 May 2026 09:50:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Y6-00060Y-3N for qemu-devel@nongnu.org; Sun, 10 May 2026 09:50:27 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-318-hUIZZxbJP7ynlgCqYDKHhQ-1; Sun, 10 May 2026 09:50:24 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 49FA819560B5 for ; Sun, 10 May 2026 13:50:21 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0A5751955D84; Sun, 10 May 2026 13:50:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q3O9/3drz3R7uunb+d8pvw9xVjRomqq7ZrcXLbUuSZE=; b=ZQmLMHpZQs6u0opvJj+tECfKHdmaFSIzWZq1FdEIItJrlPHCGdOeowXsPqRiFE1G1zSCmf NiFIss3SQ/2ItpcB93B0poLHIiZl2kZ7qZ+b49+oInw9sgqBCEmCeZs2EUDfoLKwf7ycDT szs1TIEXRTblqr6IZU2J6vBNrGZuMi8= X-MC-Unique: hUIZZxbJP7ynlgCqYDKHhQ-1 X-Mimecast-MFC-AGG-ID: hUIZZxbJP7ynlgCqYDKHhQ_1778421023 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:33 +0400 Subject: [PATCH 36/54] qom: replace object_property_add_tm with StructTm QAPI type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-36-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=9338; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=GX+Xf9BfFJQFmSKbKE+cmji4y84REBZZ59VJBVcv79U=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItwL5z1CpLdG1rxG5x5w4bOBQ8l1NXYohDE8 gHUypJrTNWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcAAKCRDa6OEJdZac 5Uc0EACVBn3rqweptO1+vzN2EPV00NRk47Jj3KgETJzTAGE0JyYhXod/BDP339Rh0q9mADWYz/+ +1ttqXYSmcATgmSM8cPqxAQWBgSDP9napRXSPhYYqymeRniyzxYe9glAogmqfCEQWqlz/qtD87d 08pxY0jIVdewSqyYz7Fe7FkWYNPT1q0loMxuoB13rujsnXHJjZzKLXQx4TvC5wlPI61ffU0iSyp 1khZ4f7YGwUM8uzY28M+TLYURnVhIKijssbz6BaJS0OlasGV6F9lxh/kPf2jSCLfjT0tTH9bPuu dCGyFuRF5zbkLf+sZw4P2sEpeqCHMAZrpJINHqa7LMEyc+FnH+FVt0YIfrTrJIvuHRfJFMdTU8+ wuuh9P7DEDvaqDHuso/ebthOu+TJ2r0DILbkQqmad+yN7+h1JrRbYaWcJsiJoPbVw9dd5iFBAH+ je0JdzkW4xwFWISPAt7SaIRFqk77ngMOllolh6nBuxEqTvphJ5k1pBAq9HEctVLPVWdS8GSkL0E T+pKFevVat5SsfWX7OSbu928zzjO9fqJVP4eQButkp02V2l34DbwxwC9SOuQvW/eNLA607I+07T USxNT3nO9VYVv7gPp49ru3l1LPP9ipQeifYMuDZcICvq7DTYbCPI1fKuh7xfw11+F/4qYn8B99P HUqA2FCP0lsAbqA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778421044322154100 Define a StructTm QAPI struct in common.json matching the existing "struct tm" property wire format (tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec as int32). Convert the two callers (mc146818rtc and spapr_rtc) to use object_property_add_qapi() with a standard ObjectPropertyAccessor that populates a StructTm and calls the generated visitor. Remove object_property_add_tm(), object_class_property_add_tm(), the TMProperty type, and the property_get_tm() helper from qom/object.c, along with their declarations in object.h. Signed-off-by: Marc-Andr=C3=A9 Lureau --- qapi/common.json | 28 +++++++++++++++++++++ qapi/pragma.json | 1 + include/qom/object.h | 18 -------------- hw/ppc/spapr_rtc.c | 18 +++++++++++--- hw/rtc/mc146818rtc.c | 16 +++++++++--- qom/object.c | 69 ------------------------------------------------= ---- 6 files changed, 57 insertions(+), 93 deletions(-) diff --git a/qapi/common.json b/qapi/common.json index af7e3d618a7..68b29126cbc 100644 --- a/qapi/common.json +++ b/qapi/common.json @@ -228,3 +228,31 @@ ## { 'enum': 'EndianMode', 'data': [ 'unspecified', 'little', 'big' ] } + +## +# @StructTm: +# +# Broken-down time. Field semantics match C ``struct tm``. +# +# @tm_year: years since 1900 +# +# @tm_mon: months since January (0-11) +# +# @tm_mday: day of the month (1-31) +# +# @tm_hour: hours since midnight (0-23) +# +# @tm_min: minutes after the hour (0-59) +# +# @tm_sec: seconds after the minute (0-59, 60-61 for leap seconds) +# +# Since: 11.1 +## +{ '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 24aebbe8f5f..8283149693d 100644 --- a/qapi/pragma.json +++ b/qapi/pragma.json @@ -108,6 +108,7 @@ 'QKeyCode', # send-key, input-sent-event 'QapiErrorClass', # QMP error replies 'SshHostKeyCheckMode', # blockdev-add, -blockdev + 'StructTm', # qom-get of RTC date property 'SysEmuTarget', # query-cpu-fast, query-target 'UuidInfo', # query-uuid 'VncClientInfo', # query-vnc, query-vnc-servers, ... diff --git a/include/qom/object.h b/include/qom/object.h index 14238e4b844..d0134a94281 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1893,24 +1893,6 @@ object_class_property_add_qapi(ObjectClass *klass, ObjectPropertyRelease *release, void *opaque); =20 -/** - * object_property_add_tm: - * @obj: the object to add a property to - * @name: the name of the property - * @get: the getter or NULL if the property is write-only. - * - * Add a read-only struct tm valued property using a getter function. - * This function will add a property of type 'struct tm'. - * - * Returns: The newly added property on success, or %NULL on failure. - */ -ObjectProperty *object_property_add_tm(Object *obj, const char *name, - void (*get)(Object *, struct tm *, Error **)); - -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 1f7d2d8f898..a4a2b3237e2 100644 --- a/hw/ppc/spapr_rtc.c +++ b/hw/ppc/spapr_rtc.c @@ -33,6 +33,9 @@ #include "migration/vmstate.h" #include "qapi/error.h" #include "qapi/qapi-events-misc.h" +#include "qapi/qapi-type-infos-common.h" +#include "qapi/qapi-visit-common.h" +#include "qapi/visitor.h" #include "qemu/cutils.h" #include "qemu/module.h" =20 @@ -131,9 +134,17 @@ static void rtas_set_time_of_day(PowerPCCPU *cpu, Spap= rMachineState *spapr, rtas_st(rets, 0, RTAS_OUT_SUCCESS); } =20 -static void spapr_rtc_qom_date(Object *obj, struct tm *current_tm, Error *= *errp) +static void spapr_rtc_qom_date(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { - spapr_rtc_read(SPAPR_RTC(obj), current_tm, NULL); + struct tm value; + StructTm tm, *tmp =3D &tm; + + spapr_rtc_read(SPAPR_RTC(obj), &value, NULL); + + tm =3D (StructTm) { value.tm_year, value.tm_mon, value.tm_mday, + value.tm_hour, value.tm_min, value.tm_sec }; + visit_type_StructTm(v, name, &tmp, errp); } =20 static void spapr_rtc_realize(DeviceState *dev, Error **errp) @@ -150,7 +161,8 @@ static void spapr_rtc_realize(DeviceState *dev, Error *= *errp) rtc_ns =3D qemu_clock_get_ns(rtc_clock); rtc->ns_offset =3D host_s * NANOSECONDS_PER_SECOND - rtc_ns; =20 - object_property_add_tm(OBJECT(rtc), "date", spapr_rtc_qom_date); + object_property_add_qapi(OBJECT(rtc), "date", &StructTm_type_info, + spapr_rtc_qom_date, NULL, NULL, NULL); } =20 static const VMStateDescription vmstate_spapr_rtc =3D { diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index ccbb2797169..e130cb4eaf7 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 @@ -855,12 +857,19 @@ static const MemoryRegionOps cmos_ops =3D { .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 -static void rtc_get_date(Object *obj, struct tm *current_tm, Error **errp) +static void rtc_get_date(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { MC146818RtcState *s =3D MC146818_RTC(obj); + struct tm value; + StructTm tm, *tmp =3D &tm; =20 rtc_update_time(s); - rtc_get_time(s, current_tm); + rtc_get_time(s, &value); + + tm =3D (StructTm) { value.tm_year, value.tm_mon, value.tm_mday, + value.tm_hour, value.tm_min, value.tm_sec }; + visit_type_StructTm(v, name, &tmp, errp); } =20 static void rtc_realizefn(DeviceState *dev, Error **errp) @@ -921,7 +930,8 @@ static void rtc_realizefn(DeviceState *dev, Error **err= p) memory_region_add_subregion(&s->io, 0, &s->coalesced_io); memory_region_add_coalescing(&s->coalesced_io, 0, 1); =20 - object_property_add_tm(OBJECT(s), "date", rtc_get_date); + object_property_add_qapi(OBJECT(s), "date", &StructTm_type_info, + rtc_get_date, NULL, NULL, NULL); =20 qdev_init_gpio_out(dev, &s->irq, 1); } diff --git a/qom/object.c b/qom/object.c index 7f4d301cd86..1e6c3a9f91d 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2463,75 +2463,6 @@ object_class_property_add_qapi(ObjectClass *klass, c= onst char *name, return prop; } =20 -typedef struct TMProperty { - void (*get)(Object *, struct tm *, Error **); -} TMProperty; - -static void property_get_tm(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - TMProperty *prop =3D opaque; - Error *err =3D NULL; - struct tm value; - - prop->get(obj, &value, &err); - if (err) { - error_propagate(errp, err); - return; - } - - if (!visit_start_struct(v, name, NULL, 0, errp)) { - return; - } - if (!visit_type_int32(v, "tm_year", &value.tm_year, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_mon", &value.tm_mon, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_mday", &value.tm_mday, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_hour", &value.tm_hour, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_min", &value.tm_min, errp)) { - goto out_end; - } - if (!visit_type_int32(v, "tm_sec", &value.tm_sec, errp)) { - goto out_end; - } - visit_check_struct(v, errp); -out_end: - visit_end_struct(v, NULL); -} - -ObjectProperty * -object_property_add_tm(Object *obj, const char *name, - void (*get)(Object *, struct tm *, Error **)) -{ - TMProperty *prop =3D g_malloc0(sizeof(*prop)); - - prop->get =3D get; - - return object_property_add(obj, name, "struct tm", - get ? property_get_tm : NULL, NULL, - property_release_data, - prop); -} - -ObjectProperty * -object_class_property_add_tm(ObjectClass *klass, const char *name, - void (*get)(Object *, struct tm *, Error **)) -{ - TMProperty *prop =3D g_malloc0(sizeof(*prop)); - - prop->get =3D get; - - return object_class_property_add(klass, name, "struct tm", - get ? property_get_tm : NULL, - NULL, NULL, prop); -} =20 static char *object_get_type(Object *obj, Error **errp) { --=20 2.54.0 From nobody Mon May 25 20:32: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=1778421049; cv=none; d=zohomail.com; s=zohoarc; b=FinpvkX9qfLekNvf1OlDMCKJqLfq/+2gbJdm2aEr0gqZlL4+BFWa3m6QWv4ekUWDO99NBB0+hQeoBOFn+QMrP6rku6gI9dbLKtyNxsZTpEyGFg4VzixIszzWLC9mygCnMeigqXhIkqh/+XzGSuW4d8ReAGbjBKIvcr3AXxcVfAo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421049; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iK6p34NeRCxzvFd3/PxdfEqrfFR+rupWElGG0xvLF+M=; b=dNm2KMUgRSUa4V4bbOyitbwYQgiAZxhkpbeRxgvzyOnwLBxXKkMXxGvsJuLdtLnYWfZKwzxheWT6FGChGM2ZuBnnVr98PkJMOytPmttnEYQJBCDcpq6eYqN19FMS5PNSseHGaNjiGqhcqPJtjTdM3EwPzLUqTmQqFT/QNsSuO4E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421049287635.6893292284844; Sun, 10 May 2026 06:50:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4YO-0003Zv-Ap; Sun, 10 May 2026 09:50:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4YJ-0003Rs-ON for qemu-devel@nongnu.org; Sun, 10 May 2026 09:50:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4YI-00063e-8z for qemu-devel@nongnu.org; Sun, 10 May 2026 09:50:39 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-90-pKXR-_esO--9bgo2cRYTjw-1; Sun, 10 May 2026 09:50:35 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 28C6419560B7 for ; Sun, 10 May 2026 13:50:35 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 57463180034E; Sun, 10 May 2026 13:50:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iK6p34NeRCxzvFd3/PxdfEqrfFR+rupWElGG0xvLF+M=; b=JdvumAbz+1barQzIEIRaYTzAypxkKmULVrz3ZRoaEMhKVeetj2ojHH9C5LMVGXEb2dgGY2 shK6YEY3zG/EkW61BtwDCMhleskd1KHuVR5UDSe0yeTFW+1NLapNLMnLWiH1RL0jdv5vkz vZAnnDF06kjHrIkeBk8hHM0j3WVJrlE= X-MC-Unique: pKXR-_esO--9bgo2cRYTjw-1 X-Mimecast-MFC-AGG-ID: pKXR-_esO--9bgo2cRYTjw_1778421035 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:34 +0400 Subject: [PATCH 37/54] hw/nvdimm: convert UUID property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-37-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2291; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=fjqQ6W0fz1f2OTCsCzNtLVDoI46ZtMBL144FqIZ8uxQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItwQSioNR/IlUXW5d1G6Tmw6kZVgrGdRWCNR 80r3tJnqaaJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcAAKCRDa6OEJdZac 5RvID/4gGS1ZzfCH12LqWYbElVX5r0+7l3WwmzkCBJQ+7LEHHt1HnRXvvUTBe2+a7rSCkAW7oAG T5nakkyjlYaY0SLcfHKgf4w8yJLDbYeCcE+clPQQQIMkZgWEm373KDMZGdBHH+I6AGqcDhxwj0H Pvki+AUBNd148KhAmVLY+QsxCkJ4iBcZrOvJ9nEBen40SFi/9Aic/Nuah7/9MXVvSc8ZTqmRH/+ 91brxtFpsQuIkFcTKKG35c/vzTc1/EZOOvVPmz/7r7QNDbnZSvby8iTWt/hb/4uvn9PDthMyxrL edfS41/kYr0hjzpOGGviFHJbFArPuRi83KP3id7DcZ7vgb0IpzI0P2brDNIFEn4OwjVj3GPTOqX wkBPnMpu5w40/3dKLBKseQ5tOn5LtOwCQtKAlUiiaclEWpbOGyvC44I0mZggp1nGJxkYo9po02Q LCh4bEB/LJSROfOKDqaTpVwh13iUlYvS4DmWhAwKBGynw7OMpqKISzIli2pjTUqcUWyBccCbDbo NmAYqLVjf9Cn+0QYVzhMt0UkRo7OFDjpm6C05tU294SE+hdTVq9PE1f+iPfSGjGpA1+v0QTprTw 1shyRMLlR7aybaQK88E5WWI0GlZOPaNfDY/kZexJ7yGvv9EUWUk5Vm8LPHEAUiGxKveAGLN8Sqi ng4zjFXDzznlrlA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778421052740154100 Add a QemuUUID_type_info and use object_property_add_qapi() instead of object_property_add() for the nvdimm UUID property. The type info is defined manually in uuid.c rather than generated, since QAPI does not yet support string typedefs. An alternative would be to extend the QAPI schema language with a 'typedef' construct (e.g. { 'typedef': 'UUID', 'data': 'str' }), which would let the generator produce the type info, C typedef, and introspection entry automatically. Alternatively, the exposed type being a string, we could change the property to be str_type_info. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/qemu/uuid.h | 4 ++++ hw/mem/nvdimm.c | 4 ++-- util/uuid.c | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/qemu/uuid.h b/include/qemu/uuid.h index 869f84af09d..ed0c62327d4 100644 --- a/include/qemu/uuid.h +++ b/include/qemu/uuid.h @@ -16,6 +16,8 @@ #ifndef QEMU_UUID_H #define QEMU_UUID_H =20 +#include "qapi/qapi-type-info.h" + =20 /* Version 4 UUID (pseudo random numbers), RFC4122 4.4. */ =20 @@ -99,4 +101,6 @@ QemuUUID qemu_uuid_bswap(QemuUUID uuid); =20 uint32_t qemu_uuid_hash(const void *uuid); =20 +extern const QAPITypeInfo QemuUUID_type_info; + #endif diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index 123ddc93854..b7ccb5c9367 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -104,8 +104,8 @@ static void nvdimm_init(Object *obj) nvdimm_get_label_size, nvdimm_set_label_size,= NULL, NULL); =20 - object_property_add(obj, NVDIMM_UUID_PROP, "QemuUUID", nvdimm_get_uuid, - nvdimm_set_uuid, NULL, NULL); + object_property_add_qapi(obj, NVDIMM_UUID_PROP, &QemuUUID_type_info, + nvdimm_get_uuid, nvdimm_set_uuid, NULL, NULL); } =20 static void nvdimm_finalize(Object *obj) diff --git a/util/uuid.c b/util/uuid.c index 234619dd5e6..4468520c414 100644 --- a/util/uuid.c +++ b/util/uuid.c @@ -17,6 +17,10 @@ #include "qemu/uuid.h" #include "qemu/bswap.h" =20 +const QAPITypeInfo QemuUUID_type_info =3D { + .name =3D "QemuUUID", +}; + void qemu_uuid_generate(QemuUUID *uuid) { int i; --=20 2.54.0 From nobody Mon May 25 20:32: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=1778421057; cv=none; d=zohomail.com; s=zohoarc; b=baZpnHJW/XhIUxOWqf5/4XnPwvP0btqLd9mZgLqVCGDIh3ccDDh0gTUZpl5k37LatK3cHuZA8zg2vkwIm85AfmyfhIkAF79rClvgILyTF1CitStZox9/SoeAJve28k4MPZXJTjk1cW3HHKTaWSSP9jGxTQhC60JB1EDHlI2JXSU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421057; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bL0YotY8U+w1vhp/ZdhhG6qZnzRYwTMrPjsj6IHAqwQ=; b=oLGbUSJasbvgmVfxcrD2uKn5Pt8Ac73T3REJ5lCs7FN/5TgtO0bjjvSAVhLMlwwSvcQXc5O/nHKSBPdV67NbYDwq4+n4Bt0WDXjR42luC4Q3zv35pVduJiHXqNPsXnIRrIcm4hB7ncgETN2h18rABh49JFkDT4MVuSfpHhYRr6o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421057428572.7629589709162; Sun, 10 May 2026 06:50:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4YX-0004Ne-CS; Sun, 10 May 2026 09:50:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4YU-0004HF-W5 for qemu-devel@nongnu.org; Sun, 10 May 2026 09:50:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4YT-00065g-8X for qemu-devel@nongnu.org; Sun, 10 May 2026 09:50:50 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-397-Bss_fv4-PGuglr9h2xPoZQ-1; Sun, 10 May 2026 09:50:46 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 271EA180034E for ; Sun, 10 May 2026 13:50:46 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3F98A19560A2; Sun, 10 May 2026 13:50:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bL0YotY8U+w1vhp/ZdhhG6qZnzRYwTMrPjsj6IHAqwQ=; b=MqCVjLpiA3TRxI1AHEhq8qKvSe72DHPhrRwzQJLUHW/W0XDL+SgcmXnMLT6xbJ9HeBVLBb 5Dpa4Sxu4doGQu7ooyd9MxkwUnBTirOYVexu2SpUiuPNnRsFocz7T+AHsYO+iTqzST+fJG EYSINbfwVlY/V7oRzZzIUJnYUxU3SmA= X-MC-Unique: Bss_fv4-PGuglr9h2xPoZQ-1 X-Mimecast-MFC-AGG-ID: Bss_fv4-PGuglr9h2xPoZQ_1778421046 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:35 +0400 Subject: [PATCH 38/54] hw/s390-virtio-ccw: convert loadparm property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-38-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1348; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=D6LPPuOFDLk2mp6M40+tSW3VFNMIGGCKwaJbYFaghiw=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItwW4RGv1VJOrtrMvU1Pvce7XIr2k8o/hI8N thLtVplJ6mJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcAAKCRDa6OEJdZac 5ZoNEACmKfOdflLrTfXDbr2JDolVSIg2nXIAC+4rv8Qkb8Ins9zm9LVStRUdpa2AOUV3II4pADV dI0CVnSUt2OEALw1SwxVW66C/aqs4KpKfUk1b5ZbiVTiN8NjMs588nSr2g2uh1D1dkGAiAWor08 Ryi7IfPzRU8VA2hLJ69OQKC7STL2ogESqP/dMDh42+XT7sB3/Kz0YPKBk8JUUEVIBtyrEjOkB5t O8Qw+PEXakyU9jXUj7FCihq2COrX8Pr8V7aGVMUP2vLYh1fQoeWTjp6ksn+UA73D9HbYrL1EGDr Jccr7TDega0bgOJ0Yg4rRa/rg+Ea5U5ZPVqFchfis6HUSKB8rp5YcgJ6B1yaWEQ/8HoW1e8Dynp 0qTHO/Ygay51f4x4DMov3R5g2Can/KGrL0XfZTgoPcd/t7QdRTGZnbK+MKeqaK6bO7T/0IOFzWL HPA6uBsGJPUHZx/N6+fmt5Gn7U/5EWpZLZ9EkFFNOWH5+0m5GBzLl47N1vXS4I64okvx7+x6hVF JVtb85fhREVaIoSAKEAy8xTgsyEihLb3TXfIhDGwyACsgoPUTzB9vq8qEEgW/G8yB27m6u94RAN iUnf5IVllWH+Rkdsr2HIZ111C9ziDU2lomNzxbSFC2J+d/ExaKj6HoVE3EThBS7ERiVJlMNmvVO l8i7QEbT0OnbWzw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=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: 1778421058683154100 The QAPI type is actually a string. Here also, if we had typedef support we could expose a more specific type. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/s390x/s390-virtio-ccw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 4d35f9b10bc..638eddfd121 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -43,6 +43,7 @@ #include "system/hostmem.h" #include "target/s390x/kvm/pv.h" #include "migration/blocker.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/s390x/cpu-topology.h" #include "kvm/kvm_s390x.h" @@ -849,7 +850,8 @@ static void ccw_machine_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, "dea-key-wrap", "enable/disable DEA key wrapping using the CPACF wrapping key"= ); =20 - object_class_property_add(oc, "loadparm", "loadparm", + /* if QAPI learns to typedef str, we could expose a more specific type= */ + object_class_property_add_qapi(oc, "loadparm", &str_type_info, machine_get_loadparm, machine_set_loadparm, NULL, NULL); object_class_property_set_description(oc, "loadparm", --=20 2.54.0 From nobody Mon May 25 20:32: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=1778421084; cv=none; d=zohomail.com; s=zohoarc; b=mjMeU/i4VBVFoVXPfQtFwjjhv7h8laYMhWzJDKdjdFq1gILGxa3BVFkXweu0l0bdjoCOejUlQ/Mb9CfDT5+qe2z9dlwuCA2OBB9N5Uee9HaTIike5um4CiIGZVKcbTkKH2B8P6WBhyfGxqEnw9XGT8/vft+j5U2BWS1Dqym1O48= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421084; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fblFAfWvPjTcuTdOqmHwe2ln7ZdoKOzUMwULX0TawoE=; b=GVt6wJEkGj8pRQoEhRhgsJQaQJpUHlrL7QLis5ZJj2QcOQDmVqLZTgrpVmUHEGGtBBOqm+khdEK1QCHYehxxZuGkW6ZJ/llss6jAQliYz+K0OSqefTceBHgrWDV2C1iXHBlEHP0ZWzsI/fC+w2HrYoZpV11W3BMWmn4uSiJbI4A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421084153589.0076697960806; Sun, 10 May 2026 06:51:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4Yu-0004fr-MA; Sun, 10 May 2026 09:51:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Yd-0004WT-HW for qemu-devel@nongnu.org; Sun, 10 May 2026 09:51:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Yb-00066J-UU for qemu-devel@nongnu.org; Sun, 10 May 2026 09:50:59 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-226-HFPnqCgoNRyHWjPPdUjnhg-1; Sun, 10 May 2026 09:50:55 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1E50A19560AF for ; Sun, 10 May 2026 13:50:55 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9BCF83002D31; Sun, 10 May 2026 13:50:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fblFAfWvPjTcuTdOqmHwe2ln7ZdoKOzUMwULX0TawoE=; b=Qm2ho7RerCsITtwSn8eMp7iG4238d2laLNr8Ecq//F+tejFA352uGp9JB76FOqhIVD8oyv iIdGaGSXKEr9LKMtt/4TlYY5BiX0jh+dF2Vx58tJTtsocf4qUTjvTej2B4X12G43C+KH/6 IEntRgnHylhVp1vrIpstRFX9OWTxTMA= X-MC-Unique: HFPnqCgoNRyHWjPPdUjnhg-1 X-Mimecast-MFC-AGG-ID: HFPnqCgoNRyHWjPPdUjnhg_1778421055 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:36 +0400 Subject: [PATCH 39/54] hw/ppc/spapr_drc: convert fdt property to QAPI-aware registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-39-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=998; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=oNnnydeZ+Z/4woqlL+ZtQDVgVy8svDVrLv4Ho4BK3Dc=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItw9CxQvn9K1jS+QvITYdbWoMLhHmmE1uNFL CWWMfrXTrWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcAAKCRDa6OEJdZac 5Y6kEACDli5AF77NrTOgm79NPM7Vz+vd+BCGVV0t9UiobBUOrhkyQ3C5znfk2I+wmCr0e70yGZf QXhfl30foTEzeEb0o699NqHEnt5cARnxqFdAOxqRdJhhSPhmom+THR9IFnYZwHIaRyBKqqf6vor xcKLlfP69XLJsMcg+m5+7nY4nN06a98ayxXrLeGfcWlZJXdBONVk2DVXGVRgRgCrIHwltrJTFS5 prgAZyOIUgLIcrjtcBEN1ZJlKKjXDkid32kBWC5JB9NVolCm9kOUS1u5QNgD9baNJBDu3ap5MOs 3T4Lot/MxhyE5uKGl7xTV775B5Gy52+1LrDkDQE2xOymqBa/qZzSPxh1zfr7ca/UsDObffaGLGI baLAUq33xv5+yAqoFQJ85EPDVdnQJi9gts3bDIzOQW0QO2Hc4HylWKuz7y9YxN/ByOvDexuVtkj CU3rj83sg3BqcPR7e0xTZHhT3Ix8B1zQi3MgGL8LSSleO5XP9SboBNI5tNm/KIzQ9zGIi35QDJ8 gXZfNFzzjO2drRYMjguCSVdux6cexwZU1zWREGhKdt5SHX8nF/1nuqU0afLFo7uGVWtp2zYuXaJ +PP4Yp0BWtgtKAvd2lTsxcHq6eh5cO4vGC6PyteyNqDuDyFHEBwaMX76R28wPWQzXDYI00/D20T T6vgA+ToZTMw+tw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778421087056154100 Use object_property_add_qapi() with any_type_info for the "fdt" property, since the FDT structure is dynamically shaped at runtime and cannot be represented as a static QAPI type. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/ppc/spapr_drc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 62baf38a00e..fcafdef7dff 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -586,7 +586,7 @@ static void spapr_dr_connector_instance_init(Object *ob= j) object_property_add_uint32_ptr(obj, "id", &drc->id, OBJ_PROP_FLAG_READ= ); object_property_add_qapi(obj, "index", &uint32_type_info, prop_get_ind= ex, NULL, NULL, NULL); - object_property_add(obj, "fdt", "struct", prop_get_fdt, + object_property_add_qapi(obj, "fdt", &any_type_info, prop_get_fdt, NULL, NULL, NULL); drc->state =3D drck->empty_state; } --=20 2.54.0 From nobody Mon May 25 20:32: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=1778421082; cv=none; d=zohomail.com; s=zohoarc; b=nQoTVWuM4xxgmRzbn7qnDjUdmq4gfZib/xC36Saw6jvk7g41dsBTESDfSfHd+ItGYzoba5s7tG8UVp3vP/T+a3nHtPvinCE+qtItVsS6CkJE+pw18UnwsTB8zePxfStRekCdMNvB8lym8ZtTecyz5DgtVm1LROJU2YiF2dHxT1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421082; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=T0Fqjl75wKXDMdOiRL0Bi1Jn3WnH3jnr2jg1Rrh5wbc=; b=dzrG86PqJXj3bPCLOfjlgzkUKggohTpT/NKiyD4xsEU4Fg7Jx56GumvYziAMp06AjDPGGkR1SFlMn5W3TR8wUH/eVrWMTLWRIL12l4xeV/SXdR2KhgN4t0ijsUvDGggxeqsI4cfoLjcSujlp7sXPxd8vxTeMOrXItUgERlphSSk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421082864395.0322179660153; Sun, 10 May 2026 06:51:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4Yw-0004rR-Pj; Sun, 10 May 2026 09:51:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Yq-0004fp-Of for qemu-devel@nongnu.org; Sun, 10 May 2026 09:51:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Yn-00066h-T1 for qemu-devel@nongnu.org; Sun, 10 May 2026 09:51:11 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-297-R1zWVs8FMMyevMGvEVq8IQ-1; Sun, 10 May 2026 09:51:07 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E7B171956096 for ; Sun, 10 May 2026 13:51:06 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2BBE419560A2; Sun, 10 May 2026 13:51:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T0Fqjl75wKXDMdOiRL0Bi1Jn3WnH3jnr2jg1Rrh5wbc=; b=Zcm1eOUM5pjcFFU3oreJkxIJhw3KvEZZtAes6MWRpEeaooFE3CLh7unyOPD+F/rVyOJj3l hj/OKGT9BLyvRnqi3gdRngWzSBT/Wu76dKarHhApAhLjaKRLDzW0O9ZmfOL7eZ/KB8z2XF uxdvlGiktMd646FhXpvLmQlRHHTG64w= X-MC-Unique: R1zWVs8FMMyevMGvEVq8IQ-1 X-Mimecast-MFC-AGG-ID: R1zWVs8FMMyevMGvEVq8IQ_1778421067 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:37 +0400 Subject: [PATCH 40/54] spdm-socket: convert SpdmTransportType to QAPI enum MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-40-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=13513; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=prJyBWTOMW+oLPTzuG1ld9mKGV8wIhGGWr9aZ3q7KSk=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItw+6vr+spKoicH+2yBP4cza0E3MUvlk8e3W TIijUqeqWCJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcAAKCRDa6OEJdZac 5WDtD/4hQd2iW0U5pNYLn9Ff6FC52SGZUk4xSTZAicHdLS67WRIUlyA5wtVXcyM3ErBs9nRy2f/ 0dib+hUye4Osq0YGtHQsAr+5lx4w8Z9Lg34SY2TApF8AfJ7rADvsdIIcxQyIPRp1F3w25BzUxej WvF1IJKUNck7oWXIaqm8EOULmIWCE9JnUyLBAj9RwV/pDq6LMuAzCM86RDV2OssHvKsfqlqzqst 9G1ZTjM5NaUUSAF1nC6prQIOUn/sUow5+RN9w4l35Y13NoUYbbKaEqJepv7fRSPyHTgdr/SpGaz 0QDiHBvEd9hLa4gGlGa/Sc/uODDXvdGU1+fxkkZqyuH4GaAvkknYL3DTZecB6WbyC4rpH8FPHF4 ovUOV2UfxkdKoaE8eEMMva5hE8gwHR4Ieovt8IheLDaWd3+Dtkr9YRxFJBjmwYClB+SOZeDqunR zChVOKUYxbNunwrlinDnOfWiYTGB7idW5Ib16tbBE+QsdvScZ+RO1WAlr4Qxx1whMWioyqmTKV2 jmclhJX7eWXrUATojt9++9et+7pKNepvNNDtgLD75DFD5T9LxKmca1gnb2B4yx4VMmmR5addwZx WD5BFPdEqeuiKbrpwFuiP1qBDtk+fdeQ3pE/CyxGtrLthICztJeTBWu9VKNzS3dbTxUpV0mdoPf qSMxPg0v7Trfejw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=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: 1778421083829158500 Replace the hand-written SpdmTransportType C enum and QEnumLookup table with a QAPI schema definition in qapi/sockets.json. Update all users in hw/nvme/ctrl.c to use the QAPI-generated enum constants (SPDM_TRANSPORT_TYPE_* instead of SPDM_SOCKET_TRANSPORT_TYPE_*). Signed-off-by: Marc-Andr=C3=A9 Lureau --- qapi/sockets.json | 20 ++++++++++++++++++++ include/system/spdm-socket.h | 28 +++++++++++----------------- backends/spdm-socket.c | 23 +++++++---------------- hw/nvme/ctrl.c | 26 +++++++++++++------------- 4 files changed, 51 insertions(+), 46 deletions(-) diff --git a/qapi/sockets.json b/qapi/sockets.json index 473be2ac58a..dbb452cfb72 100644 --- a/qapi/sockets.json +++ b/qapi/sockets.json @@ -252,3 +252,23 @@ 'unix': 'UnixSocketAddress', 'vsock': 'VsockSocketAddress', 'fd': 'FdSocketAddress' } } + +## +# @SpdmTransportType: +# +# SPDM transport type +# +# @unspecified: Unspecified transport +# +# @mctp: MCTP transport +# +# @doe: PCI Data Object Exchange (DOE) transport +# +# @scsi: SCSI transport +# +# @nvme: NVMe transport +# +# Since: 11.1 +## +{ 'enum': 'SpdmTransportType', + 'data': [ 'unspecified', 'mctp', 'doe', 'scsi', 'nvme' ] } diff --git a/include/system/spdm-socket.h b/include/system/spdm-socket.h index 00cb0e97f36..b5a68d3d60b 100644 --- a/include/system/spdm-socket.h +++ b/include/system/spdm-socket.h @@ -23,6 +23,8 @@ #ifndef SPDM_REQUESTER_H #define SPDM_REQUESTER_H =20 +#include "qapi/qapi-types-sockets.h" + /** * spdm_socket_connect: connect to an external SPDM socket * @port: port to connect to @@ -37,7 +39,7 @@ int spdm_socket_connect(uint16_t port, Error **errp); /** * spdm_socket_rsp: send and receive a message to a SPDM server * @socket: socket returned from spdm_socket_connect() - * @transport_type: SPDM_SOCKET_TRANSPORT_TYPE_* macro + * @transport_type: the SPDM transport type * @req: request buffer * @req_len: request buffer length * @rsp: response buffer @@ -46,14 +48,14 @@ int spdm_socket_connect(uint16_t port, Error **errp); * Send platform data to a SPDM server on socket and then receive * a response. */ -uint32_t spdm_socket_rsp(const int socket, uint32_t transport_type, +uint32_t spdm_socket_rsp(const int socket, SpdmTransportType transport_typ= e, void *req, uint32_t req_len, void *rsp, uint32_t rsp_len); =20 /** * spdm_socket_rsp: Receive a message from an SPDM server * @socket: socket returned from spdm_socket_connect() - * @transport_type: SPDM_SOCKET_TRANSPORT_TYPE_* macro + * @transport_type: the SPDM transport type * @rsp: response buffer * @rsp_len: response buffer length * @@ -61,14 +63,14 @@ uint32_t spdm_socket_rsp(const int socket, uint32_t tra= nsport_type, * received or 0 on failure. This can be used to receive a message from th= e SPDM * server without sending anything first. */ -uint32_t spdm_socket_receive(const int socket, uint32_t transport_type, +uint32_t spdm_socket_receive(const int socket, SpdmTransportType transport= _type, void *rsp, uint32_t rsp_len); =20 /** * spdm_socket_rsp: Sends a message to an SPDM server * @socket: socket returned from spdm_socket_connect() * @socket_cmd: socket command type (normal/if_recv/if_send etc...) - * @transport_type: SPDM_SOCKET_TRANSPORT_TYPE_* macro + * @transport_type: the SPDM transport type * @req: request buffer * @req_len: request buffer length * @@ -77,16 +79,17 @@ uint32_t spdm_socket_receive(const int socket, uint32_t= transport_type, * spdm_socket_receive(). */ bool spdm_socket_send(const int socket, uint32_t socket_cmd, - uint32_t transport_type, void *req, uint32_t req_len= ); + SpdmTransportType transport_type, void *req, + uint32_t req_len); =20 /** * spdm_socket_close: send a shutdown command to the server * @socket: socket returned from spdm_socket_connect() - * @transport_type: SPDM_SOCKET_TRANSPORT_TYPE_* macro + * @transport_type: the SPDM transport type * * This will issue a shutdown command to the server. */ -void spdm_socket_close(const int socket, uint32_t transport_type); +void spdm_socket_close(const int socket, SpdmTransportType transport_type); =20 /* * Defines the transport encoding for SPDM, this information shall be pass= ed @@ -115,15 +118,6 @@ typedef struct { #define SPDM_SOCKET_MAX_MESSAGE_BUFFER_SIZE 0x1200 #define SPDM_SOCKET_MAX_MSG_STATUS_LEN 0x02 =20 -typedef enum SpdmTransportType { - SPDM_SOCKET_TRANSPORT_TYPE_UNSPEC =3D 0, - SPDM_SOCKET_TRANSPORT_TYPE_MCTP, - SPDM_SOCKET_TRANSPORT_TYPE_PCI_DOE, - SPDM_SOCKET_TRANSPORT_TYPE_SCSI, - SPDM_SOCKET_TRANSPORT_TYPE_NVME, - SPDM_SOCKET_TRANSPORT_TYPE_MAX -} SpdmTransportType; - extern const PropertyInfo qdev_prop_spdm_trans; =20 #define DEFINE_PROP_SPDM_TRANS(_name, _state, _field, _default) \ diff --git a/backends/spdm-socket.c b/backends/spdm-socket.c index b625a65d28f..826efc276dc 100644 --- a/backends/spdm-socket.c +++ b/backends/spdm-socket.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "system/spdm-socket.h" #include "qapi/error.h" +#include "qapi/qapi-types-sockets.h" #include "hw/core/qdev-properties.h" #include "hw/core/qdev-properties-system.h" #include "hw/core/qdev-prop-internal.h" @@ -205,7 +206,7 @@ static bool spdm_socket_command_valid(uint32_t command) } } =20 -uint32_t spdm_socket_receive(const int socket, uint32_t transport_type, +uint32_t spdm_socket_receive(const int socket, SpdmTransportType transport= _type, void *rsp, uint32_t rsp_len) { uint32_t command; @@ -223,13 +224,14 @@ uint32_t spdm_socket_receive(const int socket, uint32= _t transport_type, } =20 bool spdm_socket_send(const int socket, uint32_t socket_cmd, - uint32_t transport_type, void *req, uint32_t req_len) + SpdmTransportType transport_type, void *req, + uint32_t req_len) { return send_platform_data(socket, transport_type, socket_cmd, req, req_len); } =20 -uint32_t spdm_socket_rsp(const int socket, uint32_t transport_type, +uint32_t spdm_socket_rsp(const int socket, SpdmTransportType transport_typ= e, void *req, uint32_t req_len, void *rsp, uint32_t rsp_len) { @@ -244,27 +246,16 @@ uint32_t spdm_socket_rsp(const int socket, uint32_t t= ransport_type, return spdm_socket_receive(socket, transport_type, rsp, rsp_len); } =20 -void spdm_socket_close(const int socket, uint32_t transport_type) +void spdm_socket_close(const int socket, SpdmTransportType transport_type) { send_platform_data(socket, transport_type, SPDM_SOCKET_COMMAND_SHUTDOWN, NULL, 0); } =20 -const QEnumLookup SpdmTransport_lookup =3D { - .array =3D (const char *const[]) { - [SPDM_SOCKET_TRANSPORT_TYPE_UNSPEC] =3D "unspecified", - [SPDM_SOCKET_TRANSPORT_TYPE_MCTP] =3D "mctp", - [SPDM_SOCKET_TRANSPORT_TYPE_PCI_DOE] =3D "doe", - [SPDM_SOCKET_TRANSPORT_TYPE_SCSI] =3D "scsi", - [SPDM_SOCKET_TRANSPORT_TYPE_NVME] =3D "nvme", - }, - .size =3D SPDM_SOCKET_TRANSPORT_TYPE_MAX -}; - const PropertyInfo qdev_prop_spdm_trans =3D { .type =3D "SpdmTransportType", .description =3D "Spdm Transport, doe/nvme/mctp/scsi/unspecified", - .enum_table =3D &SpdmTransport_lookup, + .enum_table =3D &SpdmTransportType_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index b10b45f157e..85ecb910858 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -7363,14 +7363,14 @@ static uint16_t nvme_sec_prot_spdm_send(NvmeCtrl *n= , NvmeRequest *req) } =20 spdm_res =3D spdm_socket_send(n->spdm_socket, SPDM_SOCKET_STORAGE_CMD_= IF_SEND, - SPDM_SOCKET_TRANSPORT_TYPE_NVME, sec_buf, + SPDM_TRANSPORT_TYPE_NVME, sec_buf, transport_transfer_len); if (!spdm_res) { return NVME_DATA_TRAS_ERROR | NVME_DNR; } =20 /* The responder shall ack with message status */ - recvd =3D spdm_socket_receive(n->spdm_socket, SPDM_SOCKET_TRANSPORT_TY= PE_NVME, + recvd =3D spdm_socket_receive(n->spdm_socket, SPDM_TRANSPORT_TYPE_NVME, &nvme_cmd_status, SPDM_SOCKET_MAX_MSG_STATUS_LEN); =20 @@ -7426,14 +7426,14 @@ static uint16_t nvme_sec_prot_spdm_receive(NvmeCtrl= *n, NvmeRequest *req) =20 /* Forward if_recv to the SPDM Server with SPSP0 */ spdm_res =3D spdm_socket_send(n->spdm_socket, SPDM_SOCKET_STORAGE_CMD_= IF_RECV, - SPDM_SOCKET_TRANSPORT_TYPE_NVME, + SPDM_TRANSPORT_TYPE_NVME, &hdr, sizeof(hdr)); if (!spdm_res) { return NVME_DATA_TRAS_ERROR | NVME_DNR; } =20 /* The responder shall ack with message status */ - recvd =3D spdm_socket_receive(n->spdm_socket, SPDM_SOCKET_TRANSPORT_TY= PE_NVME, + recvd =3D spdm_socket_receive(n->spdm_socket, SPDM_TRANSPORT_TYPE_NVME, &nvme_cmd_status, SPDM_SOCKET_MAX_MSG_STATUS_LEN); if (recvd < SPDM_SOCKET_MAX_MSG_STATUS_LEN) { @@ -7453,7 +7453,7 @@ static uint16_t nvme_sec_prot_spdm_receive(NvmeCtrl *= n, NvmeRequest *req) } =20 recvd =3D spdm_socket_receive(n->spdm_socket, - SPDM_SOCKET_TRANSPORT_TYPE_NVME, + SPDM_TRANSPORT_TYPE_NVME, rsp_spdm_buf, alloc_len); if (!recvd) { return NVME_DATA_TRAS_ERROR | NVME_DNR; @@ -8927,7 +8927,7 @@ static bool pcie_doe_spdm_rsp(DOECap *doe_cap) uint32_t rsp_len =3D SPDM_SOCKET_MAX_MESSAGE_BUFFER_SIZE; =20 uint32_t recvd =3D spdm_socket_rsp(doe_cap->spdm_socket, - SPDM_SOCKET_TRANSPORT_TYPE_PCI_DOE, + SPDM_TRANSPORT_TYPE_DOE, req, req_len, rsp, rsp_len); doe_cap->read_mbox_len +=3D DIV_ROUND_UP(recvd, 4); =20 @@ -9029,7 +9029,7 @@ static bool nvme_init_pci(NvmeCtrl *n, PCIDevice *pci= _dev, Error **errp) uint16_t doe_offset =3D PCI_CONFIG_SPACE_SIZE; =20 switch (pci_dev->spdm_trans) { - case SPDM_SOCKET_TRANSPORT_TYPE_PCI_DOE: + case SPDM_TRANSPORT_TYPE_DOE: if (n->params.sriov_max_vfs) { doe_offset +=3D PCI_ARI_SIZEOF; } @@ -9044,7 +9044,7 @@ static bool nvme_init_pci(NvmeCtrl *n, PCIDevice *pci= _dev, Error **errp) return false; } break; - case SPDM_SOCKET_TRANSPORT_TYPE_NVME: + case SPDM_TRANSPORT_TYPE_NVME: n->spdm_socket =3D spdm_socket_connect(pci_dev->spdm_port, err= p); if (n->spdm_socket < 0) { return false; @@ -9347,10 +9347,10 @@ static void nvme_exit(PCIDevice *pci_dev) assert(!(pci_dev->doe_spdm.spdm_socket > 0 && n->spdm_socket >=3D 0)); if (pci_dev->doe_spdm.spdm_socket > 0) { spdm_socket_close(pci_dev->doe_spdm.spdm_socket, - SPDM_SOCKET_TRANSPORT_TYPE_PCI_DOE); + SPDM_TRANSPORT_TYPE_DOE); } else if (n->spdm_socket >=3D 0) { spdm_socket_close(pci_dev->doe_spdm.spdm_socket, - SPDM_SOCKET_TRANSPORT_TYPE_NVME); + SPDM_TRANSPORT_TYPE_NVME); } =20 if (n->pmr.dev) { @@ -9406,7 +9406,7 @@ static const Property nvme_props[] =3D { DEFINE_PROP_UINT16("mqes", NvmeCtrl, params.mqes, 0x7ff), DEFINE_PROP_UINT16("spdm_port", PCIDevice, spdm_port, 0), DEFINE_PROP_SPDM_TRANS("spdm_trans", PCIDevice, spdm_trans, - SPDM_SOCKET_TRANSPORT_TYPE_PCI_DOE), + SPDM_TRANSPORT_TYPE_DOE), DEFINE_PROP_BOOL("ctratt.mem", NvmeCtrl, params.ctratt.mem, false), DEFINE_PROP_BOOL("atomic.dn", NvmeCtrl, params.atomic_dn, 0), DEFINE_PROP_UINT16("atomic.awun", NvmeCtrl, params.atomic_awun, 0), @@ -9484,7 +9484,7 @@ static void nvme_pci_write_config(PCIDevice *dev, uin= t32_t address, =20 /* DOE is only initialised if SPDM over DOE is used */ if (pcie_find_capability(dev, PCI_EXT_CAP_ID_DOE) && - dev->spdm_trans =3D=3D SPDM_SOCKET_TRANSPORT_TYPE_PCI_DOE) { + dev->spdm_trans =3D=3D SPDM_TRANSPORT_TYPE_DOE) { pcie_doe_write_config(&dev->doe_spdm, address, val, len); } pci_default_write_config(dev, address, val, len); @@ -9497,7 +9497,7 @@ static uint32_t nvme_pci_read_config(PCIDevice *dev, = uint32_t address, int len) uint32_t val; =20 if (dev->spdm_port && pcie_find_capability(dev, PCI_EXT_CAP_ID_DOE) && - (dev->spdm_trans =3D=3D SPDM_SOCKET_TRANSPORT_TYPE_PCI_DOE)) { + (dev->spdm_trans =3D=3D SPDM_TRANSPORT_TYPE_DOE)) { if (pcie_doe_read_config(&dev->doe_spdm, address, len, &val)) { return val; } --=20 2.54.0 From nobody Mon May 25 20:32: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=1778421106; cv=none; d=zohomail.com; s=zohoarc; b=C0+q3dpe0MgfKVaLE0Zp3vIbjUAA7ahxxj5INTa4ugVyX/bUSn+5joOxAv9VEymB16AKQktF/KONezwSsfu6ega/9mvr8JOcJ2eUfn9tosYNt9pm3/PDTIv5f4aur0OhIwNU7ogWzdBC4FJUG6xSyI1GlOkIP69YF2pwCEzM/2o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421106; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9A6TNHDVjfMCbZR4x/d7sPzRvpGiP+bJTDAPcvrrpVs=; b=AT8XdhQMTHgO9aThdv1RzoEVtgcnBOpc254deGsDvi9Uj1WagCB1NXBIuDjbjmencvjukPlOjLX2YBy7DF49JGZDr9cSL14WBY9aes9mJM+TnoUVOk42AaY3aFbzzOJsgJMBL+W71gU0bAF0AilwMQQAFMQfV2Isguiai+t/k8w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17784211069051023.5138004084178; Sun, 10 May 2026 06:51:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4ZE-0005Q9-3U; Sun, 10 May 2026 09:51:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Z1-0005FP-Oh for qemu-devel@nongnu.org; Sun, 10 May 2026 09:51:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Z0-00067K-DP for qemu-devel@nongnu.org; Sun, 10 May 2026 09:51:23 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-688-0iKwnn_vNhmwF1hJrE9VrQ-1; Sun, 10 May 2026 09:51:20 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1426B1956089 for ; Sun, 10 May 2026 13:51:19 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BC71C1953952; Sun, 10 May 2026 13:51:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9A6TNHDVjfMCbZR4x/d7sPzRvpGiP+bJTDAPcvrrpVs=; b=W6v5/umGoqnqAuLDN61KtDAD65i1Bkajd0/swOVLzzOjmumev2RwglsCca0Jc2rNLqQovv FyNoyfAIeMMBH+QB6VsEB79fYv7k2trgbBHKcqLq5XvsdbpGJ/ZpTkzvxqZ9TnP5msxWeC kxsAMwpCR5uhPD4TccEDdGAW618nbM8= X-MC-Unique: 0iKwnn_vNhmwF1hJrE9VrQ-1 X-Mimecast-MFC-AGG-ID: 0iKwnn_vNhmwF1hJrE9VrQ_1778421079 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:38 +0400 Subject: [PATCH 41/54] hw/pci: change the busnr type to uint8 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-41-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=602; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=DAKh0HtkgMpWyu1S2vxlRbQW640yT0MQaWlrJcuKrAE=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItwZ/Fssc3JB7TiVmfV6PAuNE8ZMjzIx0Izl JwepCsgts2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcAAKCRDa6OEJdZac 5bjKD/9kfy71czxpMhyuZEZFkjSCzT5G40orjWnDMx+Jxdp8+VHEVTXOm5ixesf5I1puqekcoET cpZ+cWlu3vLc4AxF7SICJSGUsE+16/hJhAih4aEtzdtJdzvo6BBrJMYfduFLC0mjAKKKp2Cd3wP cE6r29cBrVxbXE53E88Xl020VZzOTnI+RW3dcxGK2yDQ5Lx7OftaUkciyFvQsmknSisUvdftqdv gj2VAmmglL84oOtGC6B6xafeZRVI36huIJn1JRF/t69Rs8jBuclR/E0IpZ1v0xC2jC25EKaH/Yv JqOadDk+l4/+chm4uA96RuFsPa/YiUIBwxKfGCfN+7YECNcqkNe71KoMFXxy+UZsqZpKLdReFMX W2Gp3X1hn0XTsm8w9OFhnwOFrk/MVvGvgLPEPhgpQTUvbITKJM4GA1sX5LYefCeXUb0ZCpvsbzx iFPJn8RHX13KPABd4uyrSyX0d9KxrD0w7YLVfVz/AyeCnPTZXgh2NQ/Wzez6Y1NQXFY/G2NDtCn +PBBJQ7TbisUzjkA7THZi8J5gBu3CIiKqbF24aelfeH2vNtxpts/AD+4T25EyK8Vq/JR6xc/B0U yYiVnp7L8bw1DT6r+7KUu8Qfbd5CrYH/38+VZLeJOR/pI0JGUvVJU2lI3ptfSkd8fshnN7+ZfS8 LZ/whbbGO/x+UIg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778421109510154100 It is effectively a u8. The next changes are going to use the uint8_type_info for it. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 4298adf5a0a..c65cf6e089b 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -72,7 +72,7 @@ static void prop_pci_busnr_get(Object *obj, Visitor *v, c= onst char *name, } =20 static const PropertyInfo prop_pci_busnr =3D { - .type =3D "busnr", + .type =3D "uint8", .get =3D prop_pci_busnr_get, }; =20 --=20 2.54.0 From nobody Mon May 25 20:32: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=1778421127; cv=none; d=zohomail.com; s=zohoarc; b=ZiCKWZ/mHXjQNxxhBswJA64u0snS+j/APDCb8O2DZYoIqXp7d44gRncsA1wnPGUv6qf9FhysPts2Yz/7rsm6OPBkBSPSLhqIxXE8qA6eLOw4z9NGaLeT4NxrP8h7L9fTWyQiqJpLhl8v95gXiegxXvBxQwdZoOlP5/s0lmCP0G0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421127; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ELQ2Jz9mBNnU4CG5YzKJ0CYjxCpkx4NH59Wdsf+TZXI=; b=CAhsvsEHWjZKuKZCEumlKo7v2H7S6CM255vA2+8jdRZsUhz51OY5sw5MYC+TsAw7Mwulvr0HOQhhypFcPMviMNUjLCritnzv013f+8UJ5xTOBrMrkWX/lowtKiroDqC35SuETr62axpo8sQBWT7pE9RGSgXp+ByBCkW3Dg2EBKE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421127673159.60068791195272; Sun, 10 May 2026 06:52:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4Za-0005i7-8D; Sun, 10 May 2026 09:51:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4ZH-0005TI-Eg for qemu-devel@nongnu.org; Sun, 10 May 2026 09:51:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4ZF-0006DR-MH for qemu-devel@nongnu.org; Sun, 10 May 2026 09:51:39 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-394-EnmFJjusOo-PyXXxuNiv7Q-1; Sun, 10 May 2026 09:51:35 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0C00B195608B for ; Sun, 10 May 2026 13:51:35 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A61171955D84; Sun, 10 May 2026 13:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ELQ2Jz9mBNnU4CG5YzKJ0CYjxCpkx4NH59Wdsf+TZXI=; b=Mme7l4ZqnRkRR/XwbFG8dQ7LTobjiewq4Ivr6dtkt+V0CPK7CFZhLwDep21wlgjj4oiS+6 en0BoZJ87+4f4iFjPOk4g7BTu1nmMThUPpbynqbo7uqObfeli3cl3JvFdWPzvcHiPIR0wW BLKwaWJQTCn0/WNdfWBfVgGNkuLWr+E= X-MC-Unique: EnmFJjusOo-PyXXxuNiv7Q-1 X-Mimecast-MFC-AGG-ID: EnmFJjusOo-PyXXxuNiv7Q_1778421095 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:39 +0400 Subject: [PATCH 42/54] qdev: add qapi_type field to PropertyInfo with fallback registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-42-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=7090; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=Wwh7buzscwJbNXPhO4VYG5a2f+zRJrKude+oVOyfVK0=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItwEAvoFdG1UfPdEtUCzVgFus4b1r0EzPp+Z Zs7ojQSnz+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcAAKCRDa6OEJdZac 5dNBD/9/TGqVlGa40JrSFRo4XtAbjjnEIs/jmrNGODy2pEJ6R3HovAwxpryu3yLrF64IrQDLbSP zNWkoNl+SJHi5hSrlS6gJn7iViP3whb95Xa2aixmeqWQxWHcElExDUOe62KdOnidWA+AGKETKOo F6dMoH+Cg+8QB448/oOGq2eGKkXEncv4q3ihajrE8fxUq76KI+hs7fJvLQzlbpP3d4EiA6bdEvd 8l1BbKadZGxSlMH80cgHfNYucmLu3rtFZ0+UaQBpPKByA1BkM6q/BU01z3VB/Kaony2hNYOfDjO 2pvPw3JzRsL0DsW8LLyMELi4mczTW6e2PBqpenPBoeQJlFOijA8Cbhq19lVgP1/5G/ThxtzKTU7 Ekg1RovhQ2uxjksmx4Y0wU15wyDe9VNjN5ldjfLSPdaOxsEOB01yaYs8wrIcxbhNKPub5GwS/B4 uyvSi3hL91+JkG+D+yTJakl4s+ibEG+zAFaXOi7fNR2rn6XxtGqCVRY0uVJxwddaoI8DjlmIrSB GH9T5ylY2WtHnVkPw1yto7H8iaklm6Pic3O2Trxv8u6dfx9F5uGWsbJZg6j+rZJ3pjGNnBQo39l Seas38PCxKasQiGa7eNt3rc8o0vXZrz6lMdTJE2iANuBHubspGVVpl8PUYiC11UxM7KRxgttYuF kaF35xZTFQ92tpA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778421129907154100 Add a qapi_type field to PropertyInfo to prepare for the transition from string-based type metadata to QAPI type-info. Add a qdev_prop_qapi_type() helper that resolves the QAPI type for a property from .qapi_type. It will be later extended to cope with array types. Update qdev_property_add_static() and qdev_class_add_property() to prefer object_property_add_qapi() when a QAPI type is available, falling back to the old object_property_add() for unconverted properties. Update the shared enum accessor functions to prefer .qapi_type->lookup over .enum_table via a new qdev_propinfo_enum_lookup() helper. No PropertyInfo definitions are changed, all .qapi_type fields default to NULL, so the fallback paths are always taken. This patch is no-op for now. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/hw/core/qdev-properties.h | 1 + hw/core/qdev-properties.c | 67 +++++++++++++++++++++++++++++------= ---- 2 files changed, 52 insertions(+), 16 deletions(-) diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-prope= rties.h index 17543957a6c..441f77a501d 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 73539c727b3..eb7caa32557 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -99,13 +99,22 @@ static ObjectPropertyAccessor *field_prop_setter(const = PropertyInfo *info) return info->set ? field_prop_set : NULL; } =20 +static const QEnumLookup *qdev_propinfo_enum_lookup(const PropertyInfo *in= fo) +{ + if (info->qapi_type) { + assert(info->qapi_type->lookup); + return info->qapi_type->lookup; + } + return info->enum_table; +} + void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { const Property *prop =3D opaque; int *ptr =3D object_field_prop_ptr(obj, prop); =20 - visit_type_enum(v, name, ptr, prop->info->enum_table, errp); + visit_type_enum(v, name, ptr, qdev_propinfo_enum_lookup(prop->info), e= rrp); } =20 void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name, @@ -114,14 +123,14 @@ void qdev_propinfo_set_enum(Object *obj, Visitor *v, = const char *name, const Property *prop =3D opaque; int *ptr =3D object_field_prop_ptr(obj, prop); =20 - visit_type_enum(v, name, ptr, prop->info->enum_table, errp); + visit_type_enum(v, name, ptr, qdev_propinfo_enum_lookup(prop->info), e= rrp); } =20 void qdev_propinfo_set_default_value_enum(ObjectProperty *op, const Property *prop) { object_property_set_default_str(op, - qapi_enum_lookup(prop->info->enum_table, prop->defval.i)); + qapi_enum_lookup(qdev_propinfo_enum_lookup(prop->info), prop->defv= al.i)); } =20 /* Bit */ @@ -940,8 +949,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) @@ -1065,18 +1074,33 @@ const PropertyInfo qdev_prop_link =3D { .create =3D create_link_property, }; =20 +static const QAPITypeInfo *qdev_prop_qapi_type(const Property *prop) +{ + /* this will be later extended to cope with QAPI array properties */ + return prop->info->qapi_type; +} + void qdev_property_add_static(DeviceState *dev, const Property *prop) { Object *obj =3D OBJECT(dev); ObjectProperty *op; + const QAPITypeInfo *qapi_type =3D qdev_prop_qapi_type(prop); =20 assert(!prop->info->create); =20 - op =3D object_property_add(obj, prop->name, prop->info->type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); + if (qapi_type) { + op =3D object_property_add_qapi(obj, prop->name, qapi_type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); + } else { + op =3D object_property_add(obj, prop->name, prop->info->type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); + } =20 object_property_set_description(obj, prop->name, prop->info->description); @@ -1098,12 +1122,23 @@ static void qdev_class_add_property(DeviceClass *kl= ass, const char *name, if (prop->info->create) { op =3D prop->info->create(oc, name, prop); } else { - op =3D object_class_property_add(oc, - name, prop->info->type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); + const QAPITypeInfo *qapi_type =3D qdev_prop_qapi_type(prop); + + if (qapi_type) { + op =3D object_class_property_add_qapi(oc, + name, qapi_type, + field_prop_getter(prop->inf= o), + field_prop_setter(prop->inf= o), + prop->info->release, + (Property *)prop); + } else { + op =3D object_class_property_add(oc, + name, prop->info->type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); + } } if (prop->set_default) { prop->info->set_default_value(op, prop); --=20 2.54.0 From nobody Mon May 25 20:32: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=1778421167; cv=none; d=zohomail.com; s=zohoarc; b=BGsGVvNli4aWwTxeNZ1fxpS8z/cl9wko1jbFweTAypf087IjCTKzq3MMBUNYGVLZwnt91eSPSdmeO7ZP31soOgP5l1MN5oi0jseTzswTQ6Le9unmWROKE3ZQ6ddhFkibze1TPPMWW9UMbtoyENk9IgDrgL88bnwChvKhtl+mHfc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421167; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lJ6YVk9irKlQOlbGHeKV4DjlzShkLcal/Hj1rNSds4s=; b=hQWGxyAQ61plKbzyY/+b+qDfZ/bsTmEctlsd7pyjqbtAsDfemNdHJvtSjHr3Qg/HGUkgk0GYLN2e0YJio/seM9UK0ONzE6e8eWczYK7a8wmW0Ci/aE+Uqci0ddI3WyQ1K+C/GYYQuXZX+mjeM5UcgATl7iy2y4zSHukvRPoBfyw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421167302796.0057923412083; Sun, 10 May 2026 06:52:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4aD-00062f-NI; Sun, 10 May 2026 09:52:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4ZU-0005dp-Sa for qemu-devel@nongnu.org; Sun, 10 May 2026 09:51:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4ZT-0006EI-2B for qemu-devel@nongnu.org; Sun, 10 May 2026 09:51:52 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-220-ZD3JaHjEPPyjCYLUJNL5Hg-1; Sun, 10 May 2026 09:51:48 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 73D511800578 for ; Sun, 10 May 2026 13:51:47 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8CF7618004A3; Sun, 10 May 2026 13:51:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lJ6YVk9irKlQOlbGHeKV4DjlzShkLcal/Hj1rNSds4s=; b=VG6rr5TQ0KI+qIE934jJSsHcmA/YGF5xuWNVhCzG01tu7pYiVShfhqOGzCbGlqO+p5++dL wmlM2wwAp9EuW9G0sDa8KfW8jspeKcTKN8iXRkevGfoO6g0JXp+5rMbSySWvD9EtBKKLt1 JKkbHpe4VAH9e1KA6WlQgJHTNAI77sM= X-MC-Unique: ZD3JaHjEPPyjCYLUJNL5Hg-1 X-Mimecast-MFC-AGG-ID: ZD3JaHjEPPyjCYLUJNL5Hg_1778421107 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:40 +0400 Subject: [PATCH 43/54] qdev: convert core PropertyInfo definitions to use qapi_type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-43-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=6552; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=tcRQLOx7yH29wX/F2qmEq+1s28yNGkCzWFTucYIoVMM=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItwxDBt9ZRgPYXy9dOLsX0R6XCl/1H60ezbL q66mzp9/GqJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcAAKCRDa6OEJdZac 5anMD/oDYyVz4/I34R7whghXrq0QbYAMbgRkpX8zP8MR0/z1CHmGfnyucXhJrm96PtuTeBHYcYk AqAr0UmCnh4/eyRbOInaB+vKUaYHmAQiLhD1YPLI7HRNHrwu0/ZxB2N89HzlhvVSjjcUZfEs2hQ rdweMnplJffhiaWUKdpziLKOU1o+RP+JFqDMN0iOPcKtZEtjo6G/YLMkqdYRjb2ieK4ShgUio08 ap0zuER8ofWR8Xb/NjMsXaI4/1ZYvkKCEM+VrpaNhf/I9OV3fd0AFWVmtWJeCoVSBnJ9xvDlSbm xKLtIaFd40tVDpx2teo1efQlchOM2APuvTJ+rkz2KvD4jqccOfOx29mBOiABroSJlRsCYOdSo0D b7DdqcdKxUdUhuN81VXwaAHOKP2b82PNzC9poSYT71vLyZuHe97294e4tfHp177Bx9kBf669pVh osekbExNiPfjLnbCcmaNyq5iyye0wLF44X+jEQREPpMd2CYCeNNCsVB6lxgTdXKv88nxjILUN6c Mzg9Hazqzk4DZrvtnwpWnmRX0eU8Fpg18nA6Elmmq/BbiYMXJepu0et/G4LCeBM5xn8NBKIQOxZ ciNhwnFxPm3G1gT/cIjjqq2GYbNTLpkwnNKBIZQ/q6MFp3qDDUU6AqBPhwDhumrBKCQO4kfFHFC c1lhkHM5k/SROJg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778421167948158500 Replace .type string with .qapi_type pointer on all core PropertyInfo definitions in qdev-properties.c. Remove .enum_table from enum definitions, since the lookup is now accessed through .qapi_type->lookup via the qdev_propinfo_enum_lookup() fallback helper. Note that qdev_prop_usize now reports "uint32" or "uint64" depending on the host. If usize is worth preserving, it should be added as a QAPI builtin type. Or perhaps we should simply use "size" everywhere (u64)? It's also strange to use type "size" for both u32 (prop_size32) and u64 (prop_size). The qdev_prop_link and qdev_prop_array definitions are unchanged: link uses .create for registration, and array will be refactored in a subsequent patch. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-properties.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index eb7caa32557..7e562518184 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -12,6 +12,8 @@ #include "qdev-prop-internal.h" #include "qom/compat-properties.h" #include "qom/qom-qobject.h" +#include "qapi/qapi-builtin-type-infos.h" +#include "qapi/qapi-type-infos-common.h" =20 void qdev_prop_set_after_realize(DeviceState *dev, const char *name, Error **errp) @@ -180,7 +182,7 @@ static void set_default_value_bool(ObjectProperty *op, = const Property *prop) } =20 const PropertyInfo qdev_prop_bit =3D { - .type =3D "bool", + .qapi_type =3D &bool_type_info, .description =3D "on/off", .get =3D prop_get_bit, .set =3D prop_set_bit, @@ -230,7 +232,7 @@ static void prop_set_bit64(Object *obj, Visitor *v, con= st char *name, } =20 const PropertyInfo qdev_prop_bit64 =3D { - .type =3D "bool", + .qapi_type =3D &bool_type_info, .description =3D "on/off", .get =3D prop_get_bit64, .set =3D prop_set_bit64, @@ -292,9 +294,8 @@ static void prop_set_on_off_auto_bit64(Object *obj, Vis= itor *v, } =20 const PropertyInfo qdev_prop_on_off_auto_bit64 =3D { - .type =3D "OnOffAuto", + .qapi_type =3D &OnOffAuto_type_info, .description =3D "on/off/auto", - .enum_table =3D &OnOffAuto_lookup, .get =3D prop_get_on_off_auto_bit64, .set =3D prop_set_on_off_auto_bit64, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -321,7 +322,7 @@ static void set_bool(Object *obj, Visitor *v, const cha= r *name, void *opaque, } =20 const PropertyInfo qdev_prop_bool =3D { - .type =3D "bool", + .qapi_type =3D &bool_type_info, .description =3D "on/off", .get =3D get_bool, .set =3D set_bool, @@ -361,7 +362,7 @@ void qdev_propinfo_set_default_value_uint(ObjectPropert= y *op, } =20 const PropertyInfo qdev_prop_uint8 =3D { - .type =3D "uint8", + .qapi_type =3D &uint8_type_info, .get =3D get_uint8, .set =3D set_uint8, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -388,7 +389,7 @@ static void set_uint16(Object *obj, Visitor *v, const c= har *name, } =20 const PropertyInfo qdev_prop_uint16 =3D { - .type =3D "uint16", + .qapi_type =3D &uint16_type_info, .get =3D get_uint16, .set =3D set_uint16, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -433,14 +434,14 @@ static void set_int32(Object *obj, Visitor *v, const = char *name, void *opaque, } =20 const PropertyInfo qdev_prop_uint32 =3D { - .type =3D "uint32", + .qapi_type =3D &uint32_type_info, .get =3D get_uint32, .set =3D set_uint32, .set_default_value =3D qdev_propinfo_set_default_value_uint, }; =20 const PropertyInfo qdev_prop_int32 =3D { - .type =3D "int32", + .qapi_type =3D &int32_type_info, .get =3D qdev_propinfo_get_int32, .set =3D set_int32, .set_default_value =3D qdev_propinfo_set_default_value_int, @@ -485,14 +486,14 @@ static void set_int64(Object *obj, Visitor *v, const = char *name, } =20 const PropertyInfo qdev_prop_uint64 =3D { - .type =3D "uint64", + .qapi_type =3D &uint64_type_info, .get =3D get_uint64, .set =3D set_uint64, .set_default_value =3D qdev_propinfo_set_default_value_uint, }; =20 const PropertyInfo qdev_prop_int64 =3D { - .type =3D "int64", + .qapi_type =3D &int64_type_info, .get =3D get_int64, .set =3D set_int64, .set_default_value =3D qdev_propinfo_set_default_value_int, @@ -514,7 +515,7 @@ static void set_uint64_checkmask(Object *obj, Visitor *= v, const char *name, } =20 const PropertyInfo qdev_prop_uint64_checkmask =3D { - .type =3D "uint64", + .qapi_type =3D &uint64_type_info, .get =3D get_uint64, .set =3D set_uint64_checkmask, }; @@ -550,7 +551,11 @@ static void set_usize(Object *obj, Visitor *v, const c= har *name, void *opaque, } =20 const PropertyInfo qdev_prop_usize =3D { - .type =3D "usize", +#if HOST_LONG_BITS =3D=3D 32 + .qapi_type =3D &uint32_type_info, +#else + .qapi_type =3D &uint64_type_info, +#endif .get =3D get_usize, .set =3D set_usize, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -594,7 +599,7 @@ static void set_string(Object *obj, Visitor *v, const c= har *name, } =20 const PropertyInfo qdev_prop_string =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .release =3D release_string, .get =3D get_string, .set =3D set_string, @@ -603,9 +608,8 @@ const PropertyInfo qdev_prop_string =3D { /* --- on/off/auto --- */ =20 const PropertyInfo qdev_prop_on_off_auto =3D { - .type =3D "OnOffAuto", + .qapi_type =3D &OnOffAuto_type_info, .description =3D "on/off/auto", - .enum_table =3D &OnOffAuto_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -646,7 +650,7 @@ static void set_size32(Object *obj, Visitor *v, const c= har *name, void *opaque, } =20 const PropertyInfo qdev_prop_size32 =3D { - .type =3D "size", + .qapi_type =3D &size_type_info, .get =3D qdev_propinfo_get_size32, .set =3D set_size32, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -1052,7 +1056,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, --=20 2.54.0 From nobody Mon May 25 20:32: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=1778421175; cv=none; d=zohomail.com; s=zohoarc; b=kIWqf3iKv252vRT6Ej0f16I1Z0cIOIPBabLLzO0CL3spsc1o4c0+SfN89mhhkxvO7HBLrRHzaoRHug5mdKsyFQBe1vsDF+PN9f0Gj3CFzYV28YxGzWo/4q1sGM/IsCMEAx7IhMUYSoYDJ5sCiLefaS9aO0uI7jx/AKWqYJ0Ymbo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421175; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TcrGBjuVCyta7ZW2/ggJXvCFgnKnKfGh6WTHVhdMlqA=; b=gJIvZLxbdwLYanZajvw2+5+6HVADrFwAUAkOwIXTHEt2HBxdN649m86gBwhssLDGkbdB2WmEIZvy8gjeXr5MTk9jDSk0v8KbKCeH46KY3tJKIajuBidc35KzWCg/ZOuJCwMHdSFXl570HQnyZ45nx83wxP7oVb8vWlkyholS6Cw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421175930456.0478898661339; Sun, 10 May 2026 06:52:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4aL-00069P-Mk; Sun, 10 May 2026 09:52:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Zk-0005uy-BE for qemu-devel@nongnu.org; Sun, 10 May 2026 09:52:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Zg-0006Ge-Bj for qemu-devel@nongnu.org; Sun, 10 May 2026 09:52:06 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-286--uwV3Ji6N9mOSl_ha5LHJg-1; Sun, 10 May 2026 09:52:02 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 669B9195608C for ; Sun, 10 May 2026 13:52:01 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0D80818004A3; Sun, 10 May 2026 13:51:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TcrGBjuVCyta7ZW2/ggJXvCFgnKnKfGh6WTHVhdMlqA=; b=Ke4B0sLA77J4ddy3mgewweKOnuQpnSmnEV0SQg5PbQmJsRSduSU9tILv8gzclR2i3n1ZQx LDtNTBLLFy92SXWv7sDDg0KFrFcYs0/wVfWxJnmFz8eKZsNx6DVeXfYb4sGTwAAIWujIcv Thou/WaxoyZy7gKcWzQ5SgXRC6JgCtk= X-MC-Unique: -uwV3Ji6N9mOSl_ha5LHJg-1 X-Mimecast-MFC-AGG-ID: -uwV3Ji6N9mOSl_ha5LHJg_1778421121 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:41 +0400 Subject: [PATCH 44/54] qdev: convert system PropertyInfo definitions to use qapi_type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-44-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=16328; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=IeX0KlHWmS/C0FJArtdK37K3QFR+XSLDoZnx8zCppns=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItwALxMytdoihhBlU/5+AugT+aHviaj9xsiW bKZbVQ8JqeJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcAAKCRDa6OEJdZac 5cZhD/49YXcokCEPHzv09z1YStYTcWE/MQv0Xn3kE60gpk1tNXVQZ4nZrqxRMPKoqKPKBmVuZS5 Lr68XWBPiORqFmTJmHiNaazwacUBCjQ7YKrc2joSzXH3WWMXoHmUBwizzQvqdLuuwBpyFIXLZPo d4rpSxjKQiE/+FAQsHJ807H8cqRDZJT+O9Wfif11VhIVffbScyNCi16oVSDkbWsfxdw9VHHEC9P U0UsnC4BBYl/Lm+Le6WK9O/dkKL+Qz0MqMp8uP5hcWIfbdVjDrRkV3fi80sMwjaL5IVToM1PerE kUcixu1xk7qpcWVfEuRTz8/oXqDK8CeYzl0O9T906NtW3/wEEGUCWU2qGV1nUDkr92VGy1H3uqU 8bKA6Dte0hvPt9+DLqe3HHvbpTqid2TItbgxx7i4GJWz/WrdE9DphCZnJ/oIuWx5TywMKCLReoj iS9MXRJ/CmCrRYr0ATXv62+QKL2rZZqkkVAt2U34KLZ0timQWIwiEcOVU14oQVRdDYkQIWhDbkm Wh0V3P8GMs019HJqzQJhuBmqVIwDU/JaiT8teSPbJvgu7caYa/IgRrAGAJLzyxigqYtj//4XTjo tatkA7YLcXKZyiqWw8RwaiS5twwPAQhcwxGSiny2XhpFqUd1EYFVr9tAAPTl2LY+plic3nbktv0 AwEIHkhLdOrQFZw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778421177840158500 Replace .type string and .enum_table pointer with .qapi_type in all PropertyInfo definitions in qdev-properties-system.c Update file-private enum accessor functions to use .qapi_type->lookup instead of .enum_table. Note, this should be a faithful conversion, but it would be worth to consider better types than just "str" for references (block node names, chardev/netdev IDs, MAC addrs, etc) Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-prop-internal.h | 2 + hw/core/qdev-properties-system.c | 92 +++++++++++++++++-------------------= ---- hw/core/qdev-properties.c | 2 +- 3 files changed, 43 insertions(+), 53 deletions(-) diff --git a/hw/core/qdev-prop-internal.h b/hw/core/qdev-prop-internal.h index d7b77844fe0..c190b7b88cf 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 5bfdfe1ab9d..12be7b80a59 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -27,6 +27,7 @@ #include "qemu/uuid.h" #include "qemu/error-report.h" #include "qdev-prop-internal.h" +#include "qapi/qapi-type-infos.h" =20 #include "qemu/audio.h" #include "chardev/char-fe.h" @@ -238,7 +239,7 @@ static void release_drive(Object *obj, const char *name= , void *opaque) } =20 const PropertyInfo qdev_prop_drive =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Node name or ID of a block device to use as a backen= d", .realized_set_allowed =3D true, .get =3D get_drive, @@ -247,7 +248,7 @@ const PropertyInfo qdev_prop_drive =3D { }; =20 const PropertyInfo qdev_prop_drive_iothread =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Node name or ID of a block device to use as a backen= d", .realized_set_allowed =3D true, .get =3D get_drive, @@ -315,7 +316,7 @@ static void release_chr(Object *obj, const char *name, = void *opaque) } =20 const PropertyInfo qdev_prop_chr =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "ID of a chardev to use as a backend", .get =3D get_chr, .set =3D set_chr, @@ -389,7 +390,7 @@ inval: } =20 const PropertyInfo qdev_prop_macaddr =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Ethernet 6-byte MAC Address, example: 52:54:00:12:34= :56", .get =3D get_mac, .set =3D set_mac, @@ -477,7 +478,7 @@ out: } =20 const PropertyInfo qdev_prop_netdev =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "ID of a netdev to use as a backend", .get =3D get_netdev, .set =3D set_netdev, @@ -514,7 +515,7 @@ static void set_audiodev(Object *obj, Visitor *v, const= char* name, } =20 const PropertyInfo qdev_prop_audiodev =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "ID of an audiodev to use as a backend", /* release done on shutdown */ .get =3D get_audiodev, @@ -584,7 +585,8 @@ static void qdev_propinfo_set_losttickpolicy(Object *ob= j, Visitor *v, int *ptr =3D object_field_prop_ptr(obj, prop); int value; =20 - if (!visit_type_enum(v, name, &value, prop->info->enum_table, errp)) { + if (!visit_type_enum(v, name, &value, + qdev_propinfo_enum_lookup(prop->info), errp)) { return; } =20 @@ -604,9 +606,8 @@ static void qdev_propinfo_set_losttickpolicy(Object *ob= j, Visitor *v, QEMU_BUILD_BUG_ON(sizeof(LostTickPolicy) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_losttickpolicy =3D { - .type =3D "LostTickPolicy", + .qapi_type =3D &LostTickPolicy_type_info, .description =3D "Policy for handling lost ticks (discard/delay/slew)", - .enum_table =3D &LostTickPolicy_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_losttickpolicy, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -631,7 +632,7 @@ static void set_blocksize(Object *obj, Visitor *v, cons= t char *name, } =20 const PropertyInfo qdev_prop_blocksize =3D { - .type =3D "size", + .qapi_type =3D &size_type_info, .description =3D "A power of two between " MIN_BLOCK_SIZE_STR " and " MAX_BLOCK_SIZE_STR, .get =3D qdev_propinfo_get_size32, @@ -644,9 +645,8 @@ const PropertyInfo qdev_prop_blocksize =3D { QEMU_BUILD_BUG_ON(sizeof(BlockdevOnError) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_blockdev_on_error =3D { - .type =3D "BlockdevOnError", + .qapi_type =3D &BlockdevOnError_type_info, .description =3D "Error handling policy (report/ignore/enospc/stop/aut= o)", - .enum_table =3D &BlockdevOnError_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -657,10 +657,9 @@ const PropertyInfo qdev_prop_blockdev_on_error =3D { QEMU_BUILD_BUG_ON(sizeof(BiosAtaTranslation) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_bios_chs_trans =3D { - .type =3D "BiosAtaTranslation", + .qapi_type =3D &BiosAtaTranslation_type_info, .description =3D "Logical CHS translation algorithm " " (auto/none/lba/large/rechs)", - .enum_table =3D &BiosAtaTranslation_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -669,9 +668,8 @@ const PropertyInfo qdev_prop_bios_chs_trans =3D { /* --- FDC default drive types */ =20 const PropertyInfo qdev_prop_fdc_drive_type =3D { - .type =3D "FloppyDriveType", + .qapi_type =3D &FloppyDriveType_type_info, .description =3D "Floppy drive type (144/288/120/none/auto)", - .enum_table =3D &FloppyDriveType_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -680,10 +678,9 @@ const PropertyInfo qdev_prop_fdc_drive_type =3D { /* --- MultiFDCompression --- */ =20 const PropertyInfo qdev_prop_multifd_compression =3D { - .type =3D "MultiFDCompression", + .qapi_type =3D &MultiFDCompression_type_info, .description =3D "multifd compression method" " (none/zlib/zstd/qpl/uadk/qatzip)", - .enum_table =3D &MultiFDCompression_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -694,9 +691,8 @@ const PropertyInfo qdev_prop_multifd_compression =3D { QEMU_BUILD_BUG_ON(sizeof(MigMode) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_mig_mode =3D { - .type =3D "MigMode", + .qapi_type =3D &MigMode_type_info, .description =3D "Migration mode (normal/cpr-reboot)", - .enum_table =3D &MigMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -707,18 +703,16 @@ const PropertyInfo qdev_prop_mig_mode =3D { QEMU_BUILD_BUG_ON(sizeof(GranuleMode) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_granule_mode =3D { - .type =3D "GranuleMode", + .qapi_type =3D &GranuleMode_type_info, .description =3D "Granule page size (4k/8k/16k/64k/host)", - .enum_table =3D &GranuleMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, }; =20 const PropertyInfo qdev_prop_zero_page_detection =3D { - .type =3D "ZeroPageDetection", + .qapi_type =3D &ZeroPageDetection_type_info, .description =3D "Zero page detection (none/legacy/multifd)", - .enum_table =3D &ZeroPageDetection_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -729,9 +723,8 @@ const PropertyInfo qdev_prop_zero_page_detection =3D { QEMU_BUILD_BUG_ON(sizeof(SsidSizeMode) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_ssidsize_mode =3D { - .type =3D "SsidSizeMode", + .qapi_type =3D &SsidSizeMode_type_info, .description =3D "ssidsize mode: auto, 0-20", - .enum_table =3D &SsidSizeMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -742,9 +735,8 @@ const PropertyInfo qdev_prop_ssidsize_mode =3D { QEMU_BUILD_BUG_ON(sizeof(OasMode) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_oas_mode =3D { - .type =3D "OasMode", + .qapi_type =3D &OasMode_type_info, .description =3D "oas mode: auto, 32, 36, 40, 42, 44, 48, 52, 56", - .enum_table =3D &OasMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -824,7 +816,7 @@ out: } =20 const PropertyInfo qdev_prop_reserved_region =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Reserved Region, example: 0xFEE00000:0xFEEFFFFF:0", .get =3D get_reserved_region, .set =3D set_reserved_region, @@ -904,7 +896,7 @@ static char *print_pci_devfn(Object *obj, const Propert= y *prop) } =20 const PropertyInfo qdev_prop_pci_devfn =3D { - .type =3D "str", + .qapi_type =3D &str_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, @@ -1010,7 +1002,7 @@ inval: } =20 const PropertyInfo qdev_prop_pci_host_devaddr =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Address (bus:device.function) of " "the host device, example: 04:10.0", .get =3D get_pci_host_devaddr, @@ -1020,9 +1012,8 @@ const PropertyInfo qdev_prop_pci_host_devaddr =3D { /* --- OffAutoPCIBAR off/auto/bar0/bar1/bar2/bar3/bar4/bar5 --- */ =20 const PropertyInfo qdev_prop_off_auto_pcibar =3D { - .type =3D "OffAutoPCIBAR", + .qapi_type =3D &OffAutoPCIBAR_type_info, .description =3D "off/auto/bar0/bar1/bar2/bar3/bar4/bar5", - .enum_table =3D &OffAutoPCIBAR_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1061,7 +1052,8 @@ static void get_prop_pcielinkspeed(Object *obj, Visit= or *v, const char *name, abort(); } =20 - visit_type_enum(v, name, &speed, prop->info->enum_table, errp); + visit_type_enum(v, name, &speed, + qdev_propinfo_enum_lookup(prop->info), errp); } =20 static void set_prop_pcielinkspeed(Object *obj, Visitor *v, const char *na= me, @@ -1071,8 +1063,8 @@ static void set_prop_pcielinkspeed(Object *obj, Visit= or *v, const char *name, PCIExpLinkSpeed *p =3D object_field_prop_ptr(obj, prop); int speed; =20 - if (!visit_type_enum(v, name, &speed, prop->info->enum_table, - errp)) { + if (!visit_type_enum(v, name, &speed, + qdev_propinfo_enum_lookup(prop->info), errp)) { return; } =20 @@ -1102,9 +1094,8 @@ static void set_prop_pcielinkspeed(Object *obj, Visit= or *v, const char *name, } =20 const PropertyInfo qdev_prop_pcie_link_speed =3D { - .type =3D "PCIELinkSpeed", + .qapi_type =3D &PCIELinkSpeed_type_info, .description =3D "2_5/5/8/16/32/64", - .enum_table =3D &PCIELinkSpeed_lookup, .get =3D get_prop_pcielinkspeed, .set =3D set_prop_pcielinkspeed, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1146,7 +1137,8 @@ static void get_prop_pcielinkwidth(Object *obj, Visit= or *v, const char *name, abort(); } =20 - visit_type_enum(v, name, &width, prop->info->enum_table, errp); + visit_type_enum(v, name, &width, + qdev_propinfo_enum_lookup(prop->info), errp); } =20 static void set_prop_pcielinkwidth(Object *obj, Visitor *v, const char *na= me, @@ -1156,8 +1148,8 @@ static void set_prop_pcielinkwidth(Object *obj, Visit= or *v, const char *name, PCIExpLinkWidth *p =3D object_field_prop_ptr(obj, prop); int width; =20 - if (!visit_type_enum(v, name, &width, prop->info->enum_table, - errp)) { + if (!visit_type_enum(v, name, &width, + qdev_propinfo_enum_lookup(prop->info), errp)) { return; } =20 @@ -1190,9 +1182,8 @@ static void set_prop_pcielinkwidth(Object *obj, Visit= or *v, const char *name, } =20 const PropertyInfo qdev_prop_pcie_link_width =3D { - .type =3D "PCIELinkWidth", + .qapi_type =3D &PCIELinkWidth_type_info, .description =3D "1/2/4/8/12/16/32", - .enum_table =3D &PCIELinkWidth_lookup, .get =3D get_prop_pcielinkwidth, .set =3D set_prop_pcielinkwidth, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1240,7 +1231,7 @@ static void set_default_uuid_auto(ObjectProperty *op,= const Property *prop) } =20 const PropertyInfo qdev_prop_uuid =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "UUID (aka GUID) or \"" UUID_VALUE_AUTO "\" for random value (default)", .get =3D get_uuid, @@ -1253,9 +1244,8 @@ const PropertyInfo qdev_prop_uuid =3D { QEMU_BUILD_BUG_ON(sizeof(S390CpuEntitlement) !=3D sizeof(int)); =20 const PropertyInfo qdev_prop_cpus390entitlement =3D { - .type =3D "S390CpuEntitlement", + .qapi_type =3D &S390CpuEntitlement_type_info, .description =3D "auto/low/medium/high (default medium)", - .enum_table =3D &S390CpuEntitlement_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1298,7 +1288,7 @@ static void release_iothread_vq_mapping_list(Object *= obj, } =20 const PropertyInfo qdev_prop_iothread_vq_mapping_list =3D { - .type =3D "IOThreadVirtQueueMappingList", + .qapi_type =3D &IOThreadVirtQueueMappingList_type_info, .description =3D "IOThread virtqueue mapping list [{\"iothread\":\"\", " "\"vqs\":[1,2,3,...]},...]", .get =3D get_iothread_vq_mapping_list, @@ -1309,18 +1299,16 @@ const PropertyInfo qdev_prop_iothread_vq_mapping_li= st =3D { /* --- Endian modes */ =20 const PropertyInfo qdev_prop_endian_mode =3D { - .type =3D "EndianMode", + .qapi_type =3D &EndianMode_type_info, .description =3D "Endian mode, big/little/unspecified", - .enum_table =3D &EndianMode_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, }; =20 const PropertyInfo qdev_prop_vmapple_virtio_blk_variant =3D { - .type =3D "VMAppleVirtioBlkVariant", + .qapi_type =3D &VMAppleVirtioBlkVariant_type_info, .description =3D "unspecified/root/aux", - .enum_table =3D &VMAppleVirtioBlkVariant_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -1363,7 +1351,7 @@ static void release_virtio_gpu_output_list(Object *ob= j, } =20 const PropertyInfo qdev_prop_virtio_gpu_output_list =3D { - .type =3D "VirtIOGPUOutputList", + .qapi_type =3D &VirtIOGPUOutputList_type_info, .description =3D "VirtIO GPU output list [{\"name\":\"\"},...]", .get =3D get_virtio_gpu_output_list, .set =3D set_virtio_gpu_output_list, diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 7e562518184..5edcca42056 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.54.0 From nobody Mon May 25 20:32: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=1778421178; cv=none; d=zohomail.com; s=zohoarc; b=Zgf32RoV6OHXK9XjU4JYuAXxMNcHMneKInI50ztfwXtUFAEcWRUl+berjhQU/yRkoQWIyv8ODe5nsNXi2kHKGSLUYpHjY8gVbpEHhU6HpKb6IK3fIAMrBeLiNI0DGfHU4oHc4AMed4lXeHCk08RYx4Mlk1ntpYsu0iOlB6kD/kI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421178; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QFvF2wHuybLN0/ylLzW5QkzS2+7pxZJbHZXPboEd8JE=; b=ia/AbTXqvP0sg0GqlrKtDd7hyMeBbLvSXpY2XBYuVu2+6WxclwghVQSg2N7y/tZA+yzead4vlWE9LrqWAHC0qh54PKxAinE6KMdfTONSIxvhnWvJLN9mbggkMLQYsA3BqKFUhi84f3956vR0PDK68SsK3luUN7MtqjdP3dNr618= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421178291516.6263713381858; Sun, 10 May 2026 06:52:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4aR-0006Ad-8p; Sun, 10 May 2026 09:52:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Zt-0005wo-IW for qemu-devel@nongnu.org; Sun, 10 May 2026 09:52:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Zq-0006HP-NB for qemu-devel@nongnu.org; Sun, 10 May 2026 09:52:17 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-578-73NC-F-dMdGYxZCpGhRlvg-1; Sun, 10 May 2026 09:52:10 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F2272195608A for ; Sun, 10 May 2026 13:52:09 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6A69519560A2; Sun, 10 May 2026 13:52:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QFvF2wHuybLN0/ylLzW5QkzS2+7pxZJbHZXPboEd8JE=; b=jPl0BiMIk07YR8VttOARggfBwrnccucHL7NgJIEmod5o7FTXhAAAfJcIhasDBkSA9nhgkD 0gL9PHCtyYzBW/9g+lQc/Jq0IcTgv7LGdgyxyYn3cd6YcRUyygUp1m1/ayxPoLCkoStinL 10bCheYk3h2RQyi6EvpdjAkaSyEWmvo= X-MC-Unique: 73NC-F-dMdGYxZCpGhRlvg-1 X-Mimecast-MFC-AGG-ID: 73NC-F-dMdGYxZCpGhRlvg_1778421130 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:42 +0400 Subject: [PATCH 45/54] hw: convert device-local PropertyInfo definitions to use qapi_type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-45-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=8639; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=3I2WuYw4vFPMH8Ir1mFjxpbKEzAwCx4bK7UExLGhVdM=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItwG0Dv41x1/9nUFnBolzzHQY0bRJPxiNI21 hUklqmOHfGJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcAAKCRDa6OEJdZac 5SG7D/9if9hAHi2mcZapnun9EZk8B2osVprIwTuRRmP3NjBRBeTwdXj82F5lgX/Wiv3a3Q0tcRZ uTCSvxtMeswO4dl0aYFJRcyhayyL7dX4BwH3x+/NOkhBSOuYoNISWleKbMeXWGWPBRpXeR7XrdC /ajje80sN5Dkkq50MOPetRMbBSp62OGJJp/8HFhixRGYuBZ4wNxw7OzR2yAuiOSHnVHGmx9zmGv +bkCZKwAkOufJ0bdpYsm8cWQIgFzcR34GYfS5trESMXEbmu+r76J3MvNHhqbF7MSN/cbYENNeYa 9UcaaXJgOPRcyNuGIwzQnqXoEufMTgdjvqLedEuFcMacb452mIBNGyi1kVk5cS2dqNnbOwtaYZh 21numCh2p3Q8HXqD8reld7PqmT70tQPBmnfKEpFhYczBce2sxbn45GNyb/ffdl00M3iobZmC5gf kB2V+cJWYgLNESOemh2/Y43FamoM9VpQBB/GwX+/OmSaYzAX3mh/bMhmruuBid42QktXmnGVIdo 4YxGa/zbIlmOYFKCh7Mv1d1OHxWvhA9zOntXyS15yzu7hvknH2+4O9jcpx/qHrxvQXNZcsw49e2 GQaPyNqMIecGecCNAPYrR4SiTNUucEm0MFmyUOoCq9BCXdccBlzVzxigKwgUt+Sy5y/7JiXqPLm UkV7l6tQltJNEbg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778421180398154100 Mechanical conversion of PropertyInfo definitions in device-specific files, replacing .type string with .qapi_type pointer to the corresponding QAPITypeInfo. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/block/xen-block.c | 3 ++- hw/misc/xlnx-versal-trng.c | 3 ++- hw/nvme/nguid.c | 3 ++- hw/nvram/xlnx-bbram.c | 3 ++- hw/nvram/xlnx-efuse.c | 3 ++- hw/pci/pci.c | 3 ++- hw/s390x/ccw-device.c | 3 ++- hw/s390x/css.c | 5 +++-- hw/s390x/s390-pci-bus.c | 3 ++- hw/vfio/pci-quirks.c | 3 ++- hw/display/apple-gfx.m | 3 ++- 11 files changed, 23 insertions(+), 12 deletions(-) diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c index 474c12fe4ac..d9721c565c5 100644 --- a/hw/block/xen-block.c +++ b/hw/block/xen-block.c @@ -29,6 +29,7 @@ #include "dataplane/xen-block.h" #include "hw/xen/interface/io/xs_wire.h" #include "trace.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #define XVDA_MAJOR 202 #define XVDQ_MAJOR (1 << 20) @@ -663,7 +664,7 @@ invalid: * https://xenbits.xen.org/docs/unstable/man/xen-vbd-interface.7.html */ static const PropertyInfo xen_block_prop_vdev =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Virtual Disk specifier (d*p*/xvd*/hd*/sd*)", .get =3D xen_block_get_vdev, .set =3D xen_block_set_vdev, diff --git a/hw/misc/xlnx-versal-trng.c b/hw/misc/xlnx-versal-trng.c index aa1d65de7b7..4c358104c50 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 @@ -651,7 +652,7 @@ static void trng_prop_fault_event_set(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, .realized_set_allowed =3D true, diff --git a/hw/nvme/nguid.c b/hw/nvme/nguid.c index 4cd6fad6ac9..6eaf90fca88 100644 --- a/hw/nvme/nguid.c +++ b/hw/nvme/nguid.c @@ -18,6 +18,7 @@ #include "qapi/visitor.h" #include "qemu/ctype.h" #include "nvme.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #define NGUID_SEPARATOR '-' =20 @@ -179,7 +180,7 @@ static void set_nguid(Object *obj, Visitor *v, const ch= ar *name, void *opaque, } =20 const PropertyInfo qdev_prop_nguid =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "NGUID or \"" NGUID_VALUE_AUTO "\" for random value", .get =3D get_nguid, diff --git a/hw/nvram/xlnx-bbram.c b/hw/nvram/xlnx-bbram.c index edfb592a5ec..8198790b98f 100644 --- a/hw/nvram/xlnx-bbram.c +++ b/hw/nvram/xlnx-bbram.c @@ -34,6 +34,7 @@ #include "hw/core/qdev-properties.h" #include "hw/core/qdev-properties-system.h" #include "hw/nvram/xlnx-efuse.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #ifndef XLNX_BBRAM_ERR_DEBUG #define XLNX_BBRAM_ERR_DEBUG 0 @@ -486,7 +487,7 @@ static void bbram_prop_release_drive(Object *obj, const= char *name, } =20 static const PropertyInfo bbram_prop_drive =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Node name or ID of a block device to use as BBRAM ba= ckend", .realized_set_allowed =3D true, .get =3D bbram_prop_get_drive, diff --git a/hw/nvram/xlnx-efuse.c b/hw/nvram/xlnx-efuse.c index 1a9650ba128..50a7f2baba1 100644 --- a/hw/nvram/xlnx-efuse.c +++ b/hw/nvram/xlnx-efuse.c @@ -34,6 +34,7 @@ #include "system/blockdev.h" #include "hw/core/qdev-properties.h" #include "hw/core/qdev-properties-system.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #define TBIT0_OFFSET 28 #define TBIT1_OFFSET 29 @@ -251,7 +252,7 @@ static void efuse_prop_release_drive(Object *obj, const= char *name, } =20 static const PropertyInfo efuse_prop_drive =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Node name or ID of a block device to use as eFUSE ba= ckend", .realized_set_allowed =3D true, .get =3D efuse_prop_get_drive, diff --git a/hw/pci/pci.c b/hw/pci/pci.c index c65cf6e089b..99c583f3aeb 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -52,6 +52,7 @@ #include "qapi/error.h" #include "qemu/cutils.h" #include "pci-internal.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #include "hw/xen/xen.h" #include "hw/i386/kvm/xen_evtchn.h" @@ -72,7 +73,7 @@ static void prop_pci_busnr_get(Object *obj, Visitor *v, c= onst char *name, } =20 static const PropertyInfo prop_pci_busnr =3D { - .type =3D "uint8", + .qapi_type =3D &uint8_type_info, .get =3D prop_pci_busnr_get, }; =20 diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c index 25c42732795..fd21a434652 100644 --- a/hw/s390x/ccw-device.c +++ b/hw/s390x/ccw-device.c @@ -17,6 +17,7 @@ #include "qapi/visitor.h" #include "qemu/ctype.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" =20 static void ccw_device_refill_ids(CcwDevice *dev) { @@ -74,7 +75,7 @@ static void ccw_device_set_loadparm(Object *obj, Visitor = *v, } =20 const PropertyInfo ccw_loadparm =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "Up to 8 chars in set of [A-Za-z0-9. ] to select" " a guest kernel", .get =3D ccw_device_get_loadparm, diff --git a/hw/s390x/css.c b/hw/s390x/css.c index ecd28fed5c3..541a53db2c1 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -23,6 +23,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; @@ -2494,7 +2495,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, @@ -2502,7 +2503,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 4de7b587e8a..6de5caab411 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -32,6 +32,7 @@ #include "system/runstate.h" =20 #include "trace.h" +#include "qapi/qapi-builtin-type-infos.h" =20 S390pciState *s390_get_phb(void) { @@ -1540,7 +1541,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 bccf31751fd..288bcab9f21 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -26,6 +26,7 @@ #include "pci.h" #include "pci-quirks.h" #include "trace.h" +#include "qapi/qapi-builtin-type-infos.h" =20 /* * List of device ids/vendor ids for which to disable @@ -1436,7 +1437,7 @@ static void set_nv_gpudirect_clique_id(Object *obj, V= isitor *v, } =20 const PropertyInfo qdev_prop_nv_gpudirect_clique =3D { - .type =3D "uint8", + .qapi_type =3D &uint8_type_info, .description =3D "NVIDIA GPUDirect Clique ID (0 - 15)", .get =3D get_nv_gpudirect_clique_id, .set =3D set_nv_gpudirect_clique_id, diff --git a/hw/display/apple-gfx.m b/hw/display/apple-gfx.m index 77d80fb7cef..982b7c6597d 100644 --- a/hw/display/apple-gfx.m +++ b/hw/display/apple-gfx.m @@ -15,6 +15,7 @@ #include "qemu/lockable.h" #include "qemu/cutils.h" #include "qemu/log.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qapi/error.h" #include "qemu/aio-wait.h" @@ -871,7 +872,7 @@ static void apple_gfx_set_display_mode(Object *obj, Vis= itor *v, } =20 const PropertyInfo qdev_prop_apple_gfx_display_mode =3D { - .type =3D "display_mode", + .qapi_type =3D &str_type_info, .description =3D "Display mode in pixels and Hertz, as x@ " "Example: 3840x2160@60", --=20 2.54.0 From nobody Mon May 25 20:32: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=1778421194; cv=none; d=zohomail.com; s=zohoarc; b=DeQuon5gJmtzFt+RG02q2+a7R0OX8e49h83hflZVdwwuYm+cZ6OvMuoATFcVkI7qmMftGI8auEKH6lYaU2aj3Y1pTuSwX++2fxyUEu6GAh/hpb0tGCpA8FloBJHisjX6rgiI8k0SrshDcIltarqoh1EWpjhg1Vwowg+u5ZgH4bY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421194; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=oFFF/vb3C0DgB9pfHJE5MTx0Y3d5kkHf/ZwA8oUKhNI=; b=dMVN69pw35/lAUQjkGzEctLI4GLhFGh3k7Dh6hY8gFWoIlw9S/BIAqDbFOOjqx5t+FOeKARb/3yIHT5Zbc8Ulw3UNtuweJsZLZ1CrC7VP3W8fMqGzc+LahIgZlx2c2mcH/6e4AADR0r6+ZCm1/9jQm121YkpyexJMMHdkD2tQ90= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421194346531.1653273036884; Sun, 10 May 2026 06:53:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4aV-0006LC-Jv; Sun, 10 May 2026 09:52:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4a1-0005y7-9J for qemu-devel@nongnu.org; Sun, 10 May 2026 09:52:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4Zz-0006Kl-MA for qemu-devel@nongnu.org; Sun, 10 May 2026 09:52:24 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-433-9FPhYdqyNWWXYZLX20JSbQ-1; Sun, 10 May 2026 09:52:21 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AA5131956089 for ; Sun, 10 May 2026 13:52:20 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 244511955D84; Sun, 10 May 2026 13:52:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oFFF/vb3C0DgB9pfHJE5MTx0Y3d5kkHf/ZwA8oUKhNI=; b=KoOyl9VVa40cpUVWT9oa+4Vn/yW80judwRsVy0Q+d9+2BN63IQpqAwx6maMqq2gPytYhah 05QR+OV33gaada36AopUs0GM88xscwjw7wjJ0Ifw6tOD+ooHEo6X5m29ZcDn2Yz4kUXYhD Hr8qo7nxKnEmZSz61U4ERVTLZsFvvI8= X-MC-Unique: 9FPhYdqyNWWXYZLX20JSbQ-1 X-Mimecast-MFC-AGG-ID: 9FPhYdqyNWWXYZLX20JSbQ_1778421140 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:43 +0400 Subject: [PATCH 46/54] target/riscv: fix incorrect QAPI types and u8 casting MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-46-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1618; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=UE7mY6S0DrxxAQ3iVf+YTP5Z3aNRTDFraZUT6j5SWbc=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItxlKIy4DBS7G+RqTsod0nA+/hkgMVnuhWpM 6Oh3q7crxGJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcQAKCRDa6OEJdZac 5b8pEACbtTdC7RotXUOUuVBTcY9EXjbtcOfPMvJqn8VIekbhO68fSYLZuXaEHDmenU897whI/nw x7/WS/cgqCLZ8IBxFjnCvWxGAVJFwTFB0CBop5DgVAQdlxx9bF16ijyxFLZaBaT4e7npKlQ/xp1 ahkRlFjTy45H0KkLw8RfPyOe9Dvul2g2lO+2n9Er/BwImZSFc5jSeRZ2SaJXDLvMrQvAAnP3vcv h/4jeDNLfeKfrUS6QHAmxaOLkxjN3OLw9aGnEEybkw0WEVDbIp4levSkJq/JQiYU30SuMNbTUci HKferJ9VNNu5ogPyGwcKkRbNS9jzTtXdd6F8UoBfvSrxHQy0WM1X1ZP+YCKdEnknuDl89N0O4+t kKkAreGxbhgqonRuhxntIvPPTC9OsA0YsrfP1veaKQIAICu8FeiIC3BEb1Me7o6TySGyRfw9G1p XltmT3BYAyZ1kJ9IKVxuXPGveU273ARHnwx9ovDePowNrvGG8Oa9+9suu9x6uIJTFDhkHvFWpAq zApjwTVIpUiQ0HHphcArmtkyEdvAy/YmfbVQkd5J98ODZpZh40vZOE2ZJVk9X4JPNva25mzButw HE4Ih0UVajg5zHEGIlpobsyPOHTskA6gY1w1Vqm+i48HHo/SdBjBEts/5SJzLiS8BM+18zTWyZ+ B5vJJF6Li4TP8nQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=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: 1778421196634154100 "pmu_num" is u8, "pmu_mask" is u32, so is "pmp-granularity" Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 7d0cf88d48d..235764462cb 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1467,7 +1467,7 @@ static void prop_pmu_num_get(Object *obj, Visitor *v,= const char *name, } =20 static const PropertyInfo prop_pmu_num =3D { - .type =3D "int8", + .type =3D "uint8", .description =3D "pmu-num", .get =3D prop_pmu_num_get, .set =3D prop_pmu_num_set, @@ -1503,13 +1503,13 @@ static void prop_pmu_mask_set(Object *obj, Visitor = *v, const char *name, static void prop_pmu_mask_get(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { - uint8_t pmu_mask =3D RISCV_CPU(obj)->cfg.pmu_mask; + uint32_t pmu_mask =3D RISCV_CPU(obj)->cfg.pmu_mask; =20 - visit_type_uint8(v, name, &pmu_mask, errp); + visit_type_uint32(v, name, &pmu_mask, errp); } =20 static const PropertyInfo prop_pmu_mask =3D { - .type =3D "int8", + .type =3D "uint32", .description =3D "pmu-mask", .get =3D prop_pmu_mask_get, .set =3D prop_pmu_mask_set, @@ -1651,6 +1651,7 @@ static void prop_pmp_granularity_get(Object *obj, Vis= itor *v, const char *name, } =20 static const PropertyInfo prop_pmp_granularity =3D { + .type =3D "uint32", .description =3D "pmp-granularity", .get =3D prop_pmp_granularity_get, .set =3D prop_pmp_granularity_set, --=20 2.54.0 From nobody Mon May 25 20:32: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=1778421194; cv=none; d=zohomail.com; s=zohoarc; b=ik1FMqtH4yTIem/Fxi5u2q4wy33a5GxsDDDbfnUOxIVAHoPD33usF8jnXVS1xQ+RrqukSjgQi6lipDbVrMitPEHhMUCZGJpajNg5rbDZ296QN6aMv2Udor4PD633RGqvipc1vGTnxmDYx8OgmG2OPcY0H5pysadWBSDsuXZRw3s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421194; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0GjCGtKeG9fzev/GMINLw7UjJKRN2NVyc3EF+6PoAeI=; b=nyKMD9yElEtl4VN4j9hB2uDH9ucdeWR2cnV/Db9s1gviRMNrhnQeJEpl4Cu4iTPWBzcRJma6waToIzWyO1SEAlDN6EX6zKjYv11hR5lxomZlg+HZvB//gjuXokeux+c6mdZ671Zaeiv8Ut4xz4BG6uUJhgCvuYY9N67EVo1TE9I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421194089906.5182767354768; Sun, 10 May 2026 06:53:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4aW-0006Y8-Pg; Sun, 10 May 2026 09:52:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4aB-000634-Kt for qemu-devel@nongnu.org; Sun, 10 May 2026 09:52:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4aA-0006MF-0L for qemu-devel@nongnu.org; Sun, 10 May 2026 09:52:35 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-686-WbsENzMiMPylPCufIUhdnQ-1; Sun, 10 May 2026 09:52:31 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0093E180056E for ; Sun, 10 May 2026 13:52:31 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D37AF1955D84; Sun, 10 May 2026 13:52:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421153; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0GjCGtKeG9fzev/GMINLw7UjJKRN2NVyc3EF+6PoAeI=; b=Mar3NN6qPyeLPTQuOQAYD2X59UVGhXLpo/5hxG0+p9f4ysRs2R1d/1qdAwMPrFBF9C+LQo sg2CCGObyYpk/REnzIeGsKWc1B104XtoO3mqzdsAYoSvT4Ci6x3ZTIu3ncy5HGfiXLHTwj BdKhxYTem+nMDaxr6XyEE5Y20AYvmIk= X-MC-Unique: WbsENzMiMPylPCufIUhdnQ-1 X-Mimecast-MFC-AGG-ID: WbsENzMiMPylPCufIUhdnQ_1778421151 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:44 +0400 Subject: [PATCH 47/54] target/riscv: convert PropertyInfo definitions to use qapi_type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-47-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=5356; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=3wfdhLWQPZkv6/pR3DsVZoEn9q6Nl9IcCviTZIy4xD0=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItxJBsLnjWCHbRJ8NjdRP8c5YhWC9Ax3LRMY U3ppy3zxkaJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcQAKCRDa6OEJdZac 5VuJD/4k1almgcxpfFtlfip6kAHD4uT+1e4YjOtmU5zvX3MmorUUF5k76bAQ3P46mPc1MSq5fE9 QupXJFDrtAIqgaKn8P2pRr+sLkkLDYy+9S7adXYUc6vs6GPo/Rv7Sgu17WI469154QbfDP136Ie HoSae4yxwwKJidMGexXbDr0arq3UbSewtUq+2brc9EGe5nOuiPNDnceZ/tU0fRZb0p3n6JOy1Cy YjWgWpBIugw74RV7b4p6kxUuHfagHgYs+JNnqj3UxZfTPjL3QmqdH08ssMxV/UOAZN3EeOAlg5K igKbqnGFM0SoSywrgLF0f2X/v1xm3m9un4mXvuhXCvulMt9NOmMgLwjaj3Cyul9IN/3IxK/vChV zhrnbJ2O/0H7we2V+XexC05jMZPsXuaGcnCfBAMfVyfWu0y9CMmke6k7IEV6zf4ceR0PrpEnUkq EAlo4l9c75aR1PMblInDZpnIiKtokFGgScCwMFa0aF7E/qZLHbajmDU7hZlklfPkvvWUrwmsK3D iW+JnOCXHbqHlU4KFN6yi7+zNE5veHLEP3+XpMxtHPPRr/3fZ9ZegAfKhiAGXVhDvPUirqx0FRo pm+3ulSnEu/RBj5nHKKfWMtUPttDJFBiV1dJUSPImCLuEELs6gOTm6pXn43A9yXvkdK7AL3REUe KDQ25WGrG//Mgxg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778421196010158500 Mechanical conversion of all local PropertyInfo definitions in target/riscv/cpu.c Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 235764462cb..bd01884fb30 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1467,7 +1467,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, @@ -1509,7 +1509,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, @@ -1541,7 +1541,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, @@ -1573,7 +1573,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, @@ -1613,7 +1613,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, @@ -1651,7 +1651,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, @@ -1726,7 +1726,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, @@ -1759,7 +1759,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, @@ -1802,7 +1802,7 @@ static void prop_vlen_get(Object *obj, Visitor *v, co= nst char *name, } =20 static const PropertyInfo prop_vlen =3D { - .type =3D "uint16", + .qapi_type =3D &uint16_type_info, .description =3D "vlen", .get =3D prop_vlen_get, .set =3D prop_vlen_set, @@ -1843,7 +1843,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, @@ -1879,7 +1879,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, @@ -1915,7 +1915,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, @@ -1951,7 +1951,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, @@ -1987,7 +1987,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, @@ -2023,7 +2023,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, @@ -2080,7 +2080,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.54.0 From nobody Mon May 25 20:32: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=1778421183; cv=none; d=zohomail.com; s=zohoarc; b=ENlfAC+Y3McbtM/FHnztO828KlFLKLOW4JNJtjYQ2EiBF09C1QB4VEmy96rkHTM9vkSm69cLerVxA/DQOjDTnivo94raW1qSyt17WpD2htT05BSrCfYzWvDogkaU0ffXgnKOGxCfTBBXRP3VR/rCcSSp4uhmJcxuEwMDgp5D4F0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421183; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sIbnyunO4q+6Y28HodZK8cqJ+CdQBboCwLp2Hj1XDo0=; b=G44fLAnWd7XuqZee4zxPmIuDwl4uFkQQYqAv/oai/gHqhVKoZlBaEHwrUOWQP6l7sunjBtHJBJ59YPVeEaASBtx6ui0fSlx119qnbPpM9lNh0ZXkBXzlAFv+O04QihR3NgfcJ5L3z7frmGgLGQYr3M2foFRYQDYRiM7nBz3DmUo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421183462346.9701126774788; Sun, 10 May 2026 06:53:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4aZ-000713-IA; Sun, 10 May 2026 09:52:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4aL-0006B5-G7 for qemu-devel@nongnu.org; Sun, 10 May 2026 09:52:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4aJ-0006Me-9n for qemu-devel@nongnu.org; Sun, 10 May 2026 09:52:44 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-427-lKIFfg7FOgi1XcLUZ7c8qA-1; Sun, 10 May 2026 09:52:39 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3EE2218002C7 for ; Sun, 10 May 2026 13:52:38 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3B7861803A8E; Sun, 10 May 2026 13:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sIbnyunO4q+6Y28HodZK8cqJ+CdQBboCwLp2Hj1XDo0=; b=QVZ/v9ASNHH0Onl1xWy3DqQZFVToct/FmgJCZKr7694aDZHZFWbnOvugR9OANlrRYlVTVC uPQdU+Cepcaw1rh8S9pMon0dQLtb6i68ZRSAyYu6bbHthq1NesOG/j0bxBA+1tOsIJqd1m etYzxZP81XsJXCOSCmBwxmvcfGGGiL8= X-MC-Unique: lKIFfg7FOgi1XcLUZ7c8qA-1 X-Mimecast-MFC-AGG-ID: lKIFfg7FOgi1XcLUZ7c8qA_1778421158 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:45 +0400 Subject: [PATCH 48/54] qdev: convert PropertyInfo definitions to use qapi_type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-48-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=3532; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=YlwueDnCTHy/YbpLDJR4HKSWfvxwh811dbqG5oHpTWM=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItxpsOJvp97DQUkb41tUmsSwG2bHES+fGydd IbSXMcePOeJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcQAKCRDa6OEJdZac 5VFqD/wO0QPl+BezogUarpJPdG/wH32KbCzZo5p/iOTGjI/9rG/JR9foEe7RxpGnvgYgRy4j9jm u78qjt8mtpFnHzgVowu3hqWYcYcYtLs7ZfVA79xm/FXQubV9cMmQkx83sWoRC2wVcQkHzrUW5eH RmStrjI7eOYPvC8oOPyRR326eLlcw29pdcdOxyC3vdzdOwY74EwN3rDaAZRVIPySMW4OMSxCS7q BK0ekqIEBJ7w8yQVCyPTT7yR92YsgImUu9eon26cjqJVFz9+b0zK35GW/azVAdnF+lyPKRyjoDc 87wdCjAEY6yvDiiqQvxAnAnkclTHgAJapvupylNroHJDeBksa1z0Fi11wnERGXR6xg7XvJRh/Xn 6FxaZEEbYL3Cw600ugKADlp7woqwHl7/H6x4nRkDxPkQdrD8BgcGoikcdYXPTrVFIpUdiqlPvgU hoTeXDgzeNiinMr2Oirk7qW0cMu8I9p8r4v9jum545Z4Aui5H12J1plHrQ99LhipPOUp6l/Bx+3 adaEbVECQvcWwcKjDhd0SHpjsS89LOWLC6TA8BFoXJXHzP6/lYN2pVeHfWxwoZmzMoIzzHZ32a9 YJNwgDxvudTan47gXQwo7f6aZunn9qHmv6GzcTMZ0VPBquRwl20MjXLH8RrrUprmcI/qqrtvq6x jjorqo/izH6wxVw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=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: 1778421184578154100 Convert the remaining PropertyInfo definitions outside hw/ After this patch, all PropertyInfo definitions have .qapi_type set, except qdev_prop_link (uses .create) and qdev_prop_array (refactored in the next patches). Signed-off-by: Marc-Andr=C3=A9 Lureau --- backends/spdm-socket.c | 4 ++-- backends/tpm/tpm_util.c | 3 ++- migration/options.c | 4 +++- target/sparc/cpu.c | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/backends/spdm-socket.c b/backends/spdm-socket.c index 826efc276dc..4a430797596 100644 --- a/backends/spdm-socket.c +++ b/backends/spdm-socket.c @@ -17,6 +17,7 @@ #include "hw/core/qdev-properties.h" #include "hw/core/qdev-properties-system.h" #include "hw/core/qdev-prop-internal.h" +#include "qapi/qapi-type-infos-sockets.h" =20 static bool read_bytes(const int socket, uint8_t *buffer, size_t number_of_bytes) @@ -253,9 +254,8 @@ void spdm_socket_close(const int socket, SpdmTransportT= ype transport_type) } =20 const PropertyInfo qdev_prop_spdm_trans =3D { - .type =3D "SpdmTransportType", + .qapi_type =3D &SpdmTransportType_type_info, .description =3D "Spdm Transport, doe/nvme/mctp/scsi/unspecified", - .enum_table =3D &SpdmTransportType_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, diff --git a/backends/tpm/tpm_util.c b/backends/tpm/tpm_util.c index 264bff22a91..ecbc771baa6 100644 --- a/backends/tpm/tpm_util.c +++ b/backends/tpm/tpm_util.c @@ -30,6 +30,7 @@ #include "system/tpm_backend.h" #include "system/tpm_util.h" #include "trace.h" +#include "qapi/qapi-builtin-type-infos.h" =20 /* tpm backend property */ =20 @@ -77,7 +78,7 @@ static void release_tpm(Object *obj, const char *name, vo= id *opaque) } =20 const PropertyInfo qdev_prop_tpm =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .description =3D "ID of a tpm to use as a backend", .get =3D get_tpm, .set =3D set_tpm, diff --git a/migration/options.c b/migration/options.c index 5cbfd29099b..7ef7db667a8 100644 --- a/migration/options.c +++ b/migration/options.c @@ -31,6 +31,8 @@ #include "ram.h" #include "options.h" #include "system/kvm.h" +#include "qapi/qapi-builtin-type-infos.h" +#include "qapi/qapi-type-infos-common.h" =20 /* Maximum migrate downtime set to 2000 seconds */ #define MAX_MIGRATE_DOWNTIME_SECONDS 2000 @@ -285,7 +287,7 @@ static void set_default_value_tls_opt(ObjectProperty *o= p, const Property *prop) * TYPE_MIGRATION's TLS options. */ const PropertyInfo qdev_prop_StrOrNull =3D { - .type =3D "StrOrNull", + .qapi_type =3D &StrOrNull_type_info, .get =3D get_StrOrNull, .set =3D set_StrOrNull, .release =3D release_StrOrNull, diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index c6989229da6..463eb34f354 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -29,6 +29,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 @@ -947,7 +948,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.54.0 From nobody Mon May 25 20:32: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=1778421186; cv=none; d=zohomail.com; s=zohoarc; b=OR1bcqbTx1tohdcr4EVnpwsZvgReSFoi2Ydq1nBgDkPJAvfbzSLsKs39rhp52vjZmv0e8NcLbgzbO+k/Z1EE5jolU/LizYyudNnSTNjRUgUMXExmnYffQPpcL9ixNTci1tK4ThRqZ5V7CCuhyeOqn3SqYmYkJz9qg100Sas2U+Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421186; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=OPXK+TIqAQEmdSRN8FjkkCmWxs36NAlkOvx2AVMYUm0=; b=O/Zyvq62/wbcKIFZrrN3nueF6m8JDdKSiRlgukMdFHOr+72NDeASNZGZq75YrzQKqI1hPW2YZQ7Sx0zjIAn+3JDT+NW672RREI3ipxyIMD+57T+AnhPAqXrU0BJ/fWdkMwsjXW8zW4X6WJXfYRfXs/NGBHWqI7ijIj4u2NM/jSw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421186787634.3185612174433; Sun, 10 May 2026 06:53:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4aX-0006fc-Gn; Sun, 10 May 2026 09:52:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4aR-0006FH-Gi for qemu-devel@nongnu.org; Sun, 10 May 2026 09:52:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4aP-0006NF-A5 for qemu-devel@nongnu.org; Sun, 10 May 2026 09:52:51 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-166-OJy_shrQNt6F0c1LztWsBA-1; Sun, 10 May 2026 09:52:47 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2FA4518002CF for ; Sun, 10 May 2026 13:52:46 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0DA1B19560A2; Sun, 10 May 2026 13:52:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OPXK+TIqAQEmdSRN8FjkkCmWxs36NAlkOvx2AVMYUm0=; b=aQYC4F8jD5H1tf8bSUjI0yhxNbjxb9poeBCDtPLkUV1v9H7gzeGQ60lm2QdoS4IGrbnhF+ +7lfsJQvXWUtkOFT75BFjOd5tatWvSCYto2WQl0hvlVrAlxryrb2Mv6lZOkxRKSZIMxzWs baTV1T0tClbFUjhQ3bfLtrlh3d2889Y= X-MC-Unique: OJy_shrQNt6F0c1LztWsBA-1 X-Mimecast-MFC-AGG-ID: OJy_shrQNt6F0c1LztWsBA_1778421166 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:46 +0400 Subject: [PATCH 49/54] qdev: introduce typed array PropertyInfos MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-49-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=13687; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=tuarpS1Y87KEtQtBGyHZf8w0meUXImK8ViR230IgMpA=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItxlUWq5F0YZFHPOX/Gis9be3NgupP7AdcWA 1v3Fo3tcf+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcQAKCRDa6OEJdZac 5cWqD/4uiapgYytrFL70VI6Um5dDRBruTefRaGP0qCmoCqAMA8BJeK/XU8Eqdkgu+EG45HPyaWX By5u8Rac9bwIyuHyJLtBSASf+tJaCsVJoUCBLjM9To1R5tbjOLI22R4QYzQNtAtCAK6WxHldPFe OKgkz0QdEKIRlvV6HXW0niBvfJHtldo13fXMmVbzjChZMEbDe1ppfN9iIH1L7r9BV5pKf8cFGLi 2sAefZltYGS4khP85/kVSJ3qbnvAkkuqQ7vfR5C2k7Wdet1334UQrnrwDxzFr3svGK3j5zyYPxA PJgjO6exk2Mh+1OZiBZjXwVQgU6jSYeglhW13L/tLVIvSJ9IxJQzYXwXp5bWje7Z8/4nRTpOY5I n7sZRc2xE4QsTxLsmXW4fgIQX4Y18eCFyXqYKuQOKCWEcScGfAbs70CN6PniHYepE+ghCFx6kg9 qFwwZUUwTw7dQ+bBqpD+IG2gEzROXMSK3BANjqY2tBHlRCI+CFAppCtstR3AY6ToLoCKKexfouN j+egES2c9gq/w2Wt5AGuSilmiseeDc2srJQ7w0tvpxQh291Q2V4Bf2c5UOQCVm/UoZo/YL+TdDa fmGbOey3fCBGrRXhHb27qrLbrqA6+FtCr+awBguISr1ey6gs2RZZ5eO3z2s1E5EeVQvsh2hM9L1 jiBi/jUb/HGs7Ag== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778421188070158500 Add element_info and element_size fields to PropertyInfo, and extend qdev_prop_qapi_type() to derive QAPI types for array properties via element_info->qapi_type->list. Add typed list PropertyInfo definitions that replace the generic qdev_prop_array. Each typed list PropertyInfo knows its element type at compile time through the element_info and element_size fields, which allows the QAPI type to be derived automatically. Infrastructure changes: - Add prop_array_info() and prop_array_elem_size() helpers that prefer the new element_info/element_size fields with fallback to the old arrayinfo/arrayfieldsize fields for compatibility - Make get_prop_array, set_prop_array, release_prop_array, and default_prop_array non-static so they can be used by DEFINE_PROP_ARRAY_INFO in other translation units - Add DEFINE_PROP_ARRAY_INFO macro in qdev-prop-internal.h New typed list PropertyInfos: - qdev_prop_uint8_list, qdev_prop_uint16_list, qdev_prop_uint32_list, qdev_prop_uint64_list, qdev_prop_string_list (in qdev-properties.c) - qdev_prop_netdev_list, qdev_prop_reserved_region_list (in qdev-properties-system.c) The old qdev_prop_array and DEFINE_PROP_ARRAY macro are preserved for compatibility; they will be replaced in the next patch. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-prop-internal.h | 18 +++++++ include/hw/core/qdev-properties-system.h | 2 + include/hw/core/qdev-properties.h | 7 +++ hw/core/qdev-properties-system.c | 5 ++ hw/core/qdev-properties.c | 82 ++++++++++++++++++++++++----= ---- 5 files changed, 93 insertions(+), 21 deletions(-) diff --git a/hw/core/qdev-prop-internal.h b/hw/core/qdev-prop-internal.h index c190b7b88cf..b9d9812346d 100644 --- a/hw/core/qdev-prop-internal.h +++ b/hw/core/qdev-prop-internal.h @@ -27,4 +27,22 @@ void qdev_propinfo_get_int32(Object *obj, Visitor *v, co= nst char *name, void qdev_propinfo_get_size32(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp); =20 +void get_prop_array(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp); +void set_prop_array(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp); +void release_prop_array(Object *obj, const char *name, void *opaque); +void default_prop_array(ObjectProperty *op, const Property *prop); + +/* .qapi_type is derived from element_info->qapi_type->list by qdev_prop_q= api_type() */ +#define DEFINE_PROP_ARRAY_INFO(_elem_prop_info, _elem_type) \ + { \ + .element_info =3D &(_elem_prop_info), \ + .element_size =3D sizeof(_elem_type), \ + .get =3D get_prop_array, \ + .set =3D set_prop_array, \ + .release =3D release_prop_array, \ + .set_default_value =3D default_prop_array, \ + } + #endif diff --git a/include/hw/core/qdev-properties-system.h b/include/hw/core/qde= v-properties-system.h index 2cbea16d615..819dce7d5e5 100644 --- a/include/hw/core/qdev-properties-system.h +++ b/include/hw/core/qdev-properties-system.h @@ -23,6 +23,8 @@ extern const PropertyInfo qdev_prop_fdc_drive_type; extern const PropertyInfo qdev_prop_drive; extern const PropertyInfo qdev_prop_drive_iothread; extern const PropertyInfo qdev_prop_netdev; +extern const PropertyInfo qdev_prop_netdev_list; +extern const PropertyInfo qdev_prop_reserved_region_list; extern const PropertyInfo qdev_prop_pci_devfn; extern const PropertyInfo qdev_prop_blocksize; extern const PropertyInfo qdev_prop_pci_host_devaddr; diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-prope= rties.h index 441f77a501d..14db07cf9f4 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -35,6 +35,8 @@ struct PropertyInfo { const char *description; const QEnumLookup *enum_table; const QAPITypeInfo *qapi_type; + const struct PropertyInfo *element_info; + int element_size; bool realized_set_allowed; /* allow setting property on realized devic= e */ char *(*print)(Object *obj, const Property *prop); void (*set_default_value)(ObjectProperty *op, const Property *prop); @@ -75,6 +77,11 @@ extern const PropertyInfo qdev_prop_string; extern const PropertyInfo qdev_prop_on_off_auto; extern const PropertyInfo qdev_prop_size32; extern const PropertyInfo qdev_prop_array; +extern const PropertyInfo qdev_prop_uint8_list; +extern const PropertyInfo qdev_prop_uint16_list; +extern const PropertyInfo qdev_prop_uint32_list; +extern const PropertyInfo qdev_prop_uint64_list; +extern const PropertyInfo qdev_prop_string_list; extern const PropertyInfo qdev_prop_link; =20 #define DEFINE_PROP(_name, _state, _field, _prop, _type, ...) { \ diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 12be7b80a59..81f37ec44b2 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -484,6 +484,8 @@ const PropertyInfo qdev_prop_netdev =3D { .set =3D set_netdev, }; =20 +const PropertyInfo qdev_prop_netdev_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_netdev, NICPeers); =20 /* --- audiodev --- */ static void get_audiodev(Object *obj, Visitor *v, const char* name, @@ -822,6 +824,9 @@ const PropertyInfo qdev_prop_reserved_region =3D { .set =3D set_reserved_region, }; =20 +const PropertyInfo qdev_prop_reserved_region_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_reserved_region, ReservedRegion); + /* --- pci address --- */ =20 /* diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 5edcca42056..2860de1d010 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -665,6 +665,22 @@ struct ArrayElementList { void *value; }; =20 +static const PropertyInfo *prop_array_info(const Property *prop) +{ + if (prop->info->element_info) { + return prop->info->element_info; + } + return prop->arrayinfo; +} + +static int prop_array_elem_size(const Property *prop) +{ + if (prop->info->element_size) { + return prop->info->element_size; + } + return prop->arrayfieldsize; +} + /* * Given an array property @parent_prop in @obj, return a Property for a * specific element of the array. Arrays are backed by an uint32_t length = field @@ -674,7 +690,7 @@ static Property array_elem_prop(Object *obj, const Prop= erty *parent_prop, const char *name, char *elem) { return (Property) { - .info =3D parent_prop->arrayinfo, + .info =3D prop_array_info(parent_prop), .name =3D name, /* * This ugly piece of pointer arithmetic sets up the offset so @@ -691,19 +707,21 @@ static Property array_elem_prop(Object *obj, const Pr= operty *parent_prop, * underlying element's property release hook for each element and free the * property array. */ -static void release_prop_array(Object *obj, const char *name, void *opaque) +void release_prop_array(Object *obj, const char *name, void *opaque) { const Property *prop =3D opaque; uint32_t *alenptr =3D object_field_prop_ptr(obj, prop); void **arrayptr =3D (void *)obj + prop->arrayoffset; char *elem =3D *arrayptr; int i; + const PropertyInfo *elem_info =3D prop_array_info(prop); + int elem_size =3D prop_array_elem_size(prop); =20 - if (prop->arrayinfo->release) { + if (elem_info->release) { for (i =3D 0; i < *alenptr; i++) { Property elem_prop =3D array_elem_prop(obj, prop, name, elem); - prop->arrayinfo->release(obj, NULL, &elem_prop); - elem +=3D prop->arrayfieldsize; + elem_info->release(obj, NULL, &elem_prop); + elem +=3D elem_size; } } =20 @@ -717,8 +735,8 @@ static void release_prop_array(Object *obj, const char = *name, void *opaque) * (a pointer to which is stored in the additional field described by * prop->arrayoffset). */ -static void set_prop_array(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +void set_prop_array(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { ERRP_GUARD(); const Property *prop =3D opaque; @@ -726,6 +744,8 @@ static void set_prop_array(Object *obj, Visitor *v, con= st char *name, void **arrayptr =3D (void *)obj + prop->arrayoffset; ArrayElementList *list, *elem, *next; const size_t size =3D sizeof(*list); + const PropertyInfo *elem_info =3D prop_array_info(prop); + int elem_size =3D prop_array_elem_size(prop); char *elemptr; bool ok =3D true; =20 @@ -744,9 +764,9 @@ static void set_prop_array(Object *obj, Visitor *v, con= st char *name, while (elem) { Property elem_prop; =20 - elem->value =3D g_malloc0(prop->arrayfieldsize); + elem->value =3D g_malloc0(elem_size); elem_prop =3D array_elem_prop(obj, prop, name, elem->value); - prop->arrayinfo->set(obj, v, NULL, &elem_prop, errp); + elem_info->set(obj, v, NULL, &elem_prop, errp); if (*errp) { ok =3D false; goto out_obj; @@ -768,8 +788,8 @@ out_obj: for (elem =3D list; elem; elem =3D next) { Property elem_prop =3D array_elem_prop(obj, prop, name, elem->value); - if (prop->arrayinfo->release) { - prop->arrayinfo->release(obj, NULL, &elem_prop); + if (elem_info->release) { + elem_info->release(obj, NULL, &elem_prop); } next =3D elem->next; g_free(elem->value); @@ -782,19 +802,19 @@ out_obj: * Now that we know how big the array has to be, move the data over to= a * linear array and free the temporary list. */ - *arrayptr =3D g_malloc_n(*alenptr, prop->arrayfieldsize); + *arrayptr =3D g_malloc_n(*alenptr, elem_size); elemptr =3D *arrayptr; for (elem =3D list; elem; elem =3D next) { - memcpy(elemptr, elem->value, prop->arrayfieldsize); - elemptr +=3D prop->arrayfieldsize; + memcpy(elemptr, elem->value, elem_size); + elemptr +=3D elem_size; next =3D elem->next; g_free(elem->value); g_free(elem); } } =20 -static void get_prop_array(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +void get_prop_array(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { ERRP_GUARD(); const Property *prop =3D opaque; @@ -804,6 +824,8 @@ static void get_prop_array(Object *obj, Visitor *v, con= st char *name, ArrayElementList *list =3D NULL, *elem; ArrayElementList **tail =3D &list; const size_t size =3D sizeof(*list); + const PropertyInfo *elem_info =3D prop_array_info(prop); + int elem_size =3D prop_array_elem_size(prop); int i; bool ok; =20 @@ -811,7 +833,7 @@ static void get_prop_array(Object *obj, Visitor *v, con= st char *name, for (i =3D 0; i < *alenptr; i++) { elem =3D g_new0(ArrayElementList, 1); elem->value =3D elemptr; - elemptr +=3D prop->arrayfieldsize; + elemptr +=3D elem_size; =20 *tail =3D elem; tail =3D &elem->next; @@ -824,7 +846,7 @@ static void get_prop_array(Object *obj, Visitor *v, con= st char *name, elem =3D list; while (elem) { Property elem_prop =3D array_elem_prop(obj, prop, name, elem->valu= e); - prop->arrayinfo->get(obj, v, NULL, &elem_prop, errp); + elem_info->get(obj, v, NULL, &elem_prop, errp); if (*errp) { goto out_obj; } @@ -846,7 +868,7 @@ out_obj: } } =20 -static void default_prop_array(ObjectProperty *op, const Property *prop) +void default_prop_array(ObjectProperty *op, const Property *prop) { object_property_set_default_list(op); } @@ -859,6 +881,17 @@ const PropertyInfo qdev_prop_array =3D { .set_default_value =3D default_prop_array, }; =20 +const PropertyInfo qdev_prop_uint8_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint8, uint8_t); +const PropertyInfo qdev_prop_uint16_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint16, uint16_t); +const PropertyInfo qdev_prop_uint32_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint32, uint32_t); +const PropertyInfo qdev_prop_uint64_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint64, uint64_t); +const PropertyInfo qdev_prop_string_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_string, char *); + /* --- public helpers --- */ =20 static const Property *qdev_prop_walk(DeviceClass *cls, const char *name) @@ -1080,8 +1113,15 @@ const PropertyInfo qdev_prop_link =3D { =20 static const QAPITypeInfo *qdev_prop_qapi_type(const Property *prop) { - /* this will be later extended to cope with QAPI array properties */ - return prop->info->qapi_type; + if (prop->info->qapi_type) { + return prop->info->qapi_type; + } + if (prop->info->element_info) { + assert(prop->info->element_info->qapi_type); + assert(prop->info->element_info->qapi_type->list); + return prop->info->element_info->qapi_type->list; + } + return NULL; } =20 void qdev_property_add_static(DeviceState *dev, const Property *prop) --=20 2.54.0 From nobody Mon May 25 20:32: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=1778421204; cv=none; d=zohomail.com; s=zohoarc; b=j2kNyLQ6HrtgfAwzJFQQTDznOxu1aqHk407UXMxkRUpsnsO/6FIy2+eMb/arHzAgaZTt53uTc8KvezGTc1BJxrfkqO0K/Aq7Mdar6F6jDegq/DUbt80cMZUEht7W5uXzqY9DR2a0UjWjnQEOla3vFZJygSbEvRBcxIj08kZJYuc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421204; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UQsaHKAX05Q5xAjIgSbWujya453f/Ps3wj8W9lHgt4E=; b=WbIXEezVCqnndKznTp0Vt+y+pcsyQMHafVfK5GrX+bdpEnTqpg1ErtFTgyAPdn1EVQHyRqDzrOUNmV72WujObp80fzc5lXyqVqJ3yyShM4p+TPyCRl2+kZ9OG1GpNu0blm5gJCP4OQyW7rRgOW8i/3wdaEvqyuKgJvQmePQpwEA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421203994440.5362186727958; Sun, 10 May 2026 06:53:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4ac-0007Ok-7t; Sun, 10 May 2026 09:53:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4aa-0007CX-Ib for qemu-devel@nongnu.org; Sun, 10 May 2026 09:53:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4aY-0006QE-3v for qemu-devel@nongnu.org; Sun, 10 May 2026 09:53:00 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-330-9dsdqW69OmGx1KF6E829SA-1; Sun, 10 May 2026 09:52:56 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 44151195608C for ; Sun, 10 May 2026 13:52:55 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 85F261955D84; Sun, 10 May 2026 13:52:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UQsaHKAX05Q5xAjIgSbWujya453f/Ps3wj8W9lHgt4E=; b=Hfb8Hosmp1u0wU7ZxgFXndzXn2xjnt7Q0d7WLg01HgVSguKna8w61gfBz10KPcH0ORmjNj uZuXtvgpruZtffAgKUQkKY5hpcean7JX49PIJtvqyhfwCTso2URHREmxzFYUDuQlux3ylk kLx0R1fb19rHGvOneo4Y/YBiMFNByUM= X-MC-Unique: 9dsdqW69OmGx1KF6E829SA-1 X-Mimecast-MFC-AGG-ID: 9dsdqW69OmGx1KF6E829SA_1778421175 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:47 +0400 Subject: [PATCH 50/54] qdev: simplify DEFINE_PROP_ARRAY and remove generic array PropertyInfo MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-50-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=16219; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=BPUzymJ4Un/WX1SV//REzF+H92xcur0pQe3Jea9zzTg=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItxzbShA+bzzEQI1y2N1eaul/K+uY/r6M+qI Ly+/7Dzwu+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcQAKCRDa6OEJdZac 5TJJEACHHzUE46vHUXtXEw7DMUApycS5NED3HqTQfa9D4tbsLzUtyxlWebE7SrToTa1teRecy++ Jmvp6tcePVhnxyHE11rEbZF5WVVuPieX4mN7sjz4tIBIAeUAG1xx7aLzl9TAk2JEZ+/EI0cO77L HUwT9WcDQowjcODY8wDeuvkJXDuOZEAEoMA8fZPliYRk1OGdG5+2Idw620ht2g4a3wwJOKyiF9j wf3zy9qssmgr7ELlbwPltVcfhcnbBQZnL2I7f10T0uzTfhe4LZ+CIPrrJ+iAtJ14eGJ3hjYJxTC 82YGZJ3aDN+6GD3RRXoeE+OKNeLC0MCyOc69wPgIUXhvsRKBaLmY/y4RSu8i9nZeANPHLj6y+l8 haBIQhP7LVdLf/+uKcGutJU9hN/WvZLwO5EEW2c7LaLAfp/tTRXgmLSz3UfUSIGHryEMgmR+BaI ZJjsXzgPzDIJifRUC4cdAIdUoFebJftqxKuCNLKwPQSj6jJEqvqhtpE6YRq6Zzf1Qz3G6KU9qvi ftM01MkhHYPrSkKadDlt19F9/d0zhBKJh6rzmJEEq4JLeoqK1IecQHoCvfP0+m0OMA09ulm0QKd 7UuESUEiBcMgy7BOGOByxiWKN6XKsWNqmlzrp1MH6QUDkLTq3yLX3FHEaSz6Mvns4zaIWTf8BS2 fX4t4Ho/7Vsprsw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778421206163158500 Change DEFINE_PROP_ARRAY, the macro now uses _arrayprop##_list to resolve the typed list PropertyInfo (introduced in the previous patch) instead of the generic qdev_prop_array. This means the element type and size information is carried by the PropertyInfo itself rather than duplicated at each callsite. Since the typed list PropertyInfos encode element_info and element_size, the .arrayinfo and .arrayfieldsize fields are no longer set by the macro (they will be removed from the Property struct in the next patch). Remove qdev_prop_array, which is now unused. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/display/apple-gfx.h | 1 + include/hw/block/block.h | 2 +- include/hw/core/qdev-properties.h | 17 +++++++---------- hw/core/qdev-properties.c | 8 -------- hw/input/stellaris_gamepad.c | 2 +- hw/intc/arm_gicv3_common.c | 2 +- hw/intc/rx_icu.c | 4 ++-- hw/misc/arm_sysctl.c | 4 ++-- hw/misc/mps2-scc.c | 2 +- hw/net/rocker/rocker.c | 2 +- hw/net/virtio-net.c | 2 +- hw/nvram/xlnx-efuse.c | 2 +- hw/nvram/xlnx-versal-efuse-ctrl.c | 2 +- hw/riscv/riscv_hart.c | 6 ++---- hw/virtio/virtio-iommu-pci.c | 2 +- tests/unit/test-qdev.c | 2 +- hw/display/apple-gfx-mmio.m | 2 +- hw/display/apple-gfx-pci.m | 2 +- hw/display/apple-gfx.m | 4 ++++ 19 files changed, 30 insertions(+), 38 deletions(-) diff --git a/hw/display/apple-gfx.h b/hw/display/apple-gfx.h index 3197bd853da..b7eef7b9b14 100644 --- a/hw/display/apple-gfx.h +++ b/hw/display/apple-gfx.h @@ -69,6 +69,7 @@ void *apple_gfx_host_ptr_for_gpa_range(uint64_t guest_phy= sical, MemoryRegion **mapping_in_region); =20 extern const PropertyInfo qdev_prop_apple_gfx_display_mode; +extern const PropertyInfo qdev_prop_apple_gfx_display_mode_list; =20 #endif =20 diff --git a/include/hw/block/block.h b/include/hw/block/block.h index 7dc19d8a453..d6b4492a27a 100644 --- a/include/hw/block/block.h +++ b/include/hw/block/block.h @@ -71,7 +71,7 @@ static inline unsigned int get_physical_block_exp(BlockCo= nf *conf) _conf.account_failed, ON_OFF_AUTO_AUTO), \ DEFINE_PROP_ARRAY("stats-intervals", _state, \ _conf.num_stats_intervals, _conf.stats_intervals, \ - qdev_prop_uint32, uint32_t) + qdev_prop_uint32) =20 #define DEFINE_BLOCK_PROPERTIES(_state, _conf) \ DEFINE_PROP_DRIVE("drive", _state, _conf.blk), \ diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-prope= rties.h index 14db07cf9f4..8dd80501fb8 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -76,7 +76,6 @@ extern const PropertyInfo qdev_prop_size; extern const PropertyInfo qdev_prop_string; extern const PropertyInfo qdev_prop_on_off_auto; extern const PropertyInfo qdev_prop_size32; -extern const PropertyInfo qdev_prop_array; extern const PropertyInfo qdev_prop_uint8_list; extern const PropertyInfo qdev_prop_uint16_list; extern const PropertyInfo qdev_prop_uint32_list; @@ -147,15 +146,15 @@ extern const PropertyInfo qdev_prop_link; * @_name: name of the array * @_state: name of the device state structure type * @_field: uint32_t field in @_state to hold the array length - * @_arrayfield: field in @_state (of type '@_arraytype *') which - * will point to the array - * @_arrayprop: PropertyInfo defining what property the array elements have - * @_arraytype: C type of the array elements + * @_arrayfield: field in @_state which will point to the array + * @_arrayprop: PropertyInfo for the array elements (e.g. qdev_prop_uint32= ); + * a corresponding list PropertyInfo named @_arrayprop##_list + * must exist * * Define device properties for a variable-length array _name. The array = is * represented as a list in the visitor interface. * - * @_arraytype is required to be movable with memcpy(). + * The element type must be movable with memcpy(). * * When the array property is set, the @_field member of the device * struct is set to the array length, and @_arrayfield is set to point @@ -165,12 +164,10 @@ extern const PropertyInfo qdev_prop_link; * @_arrayfield memory. */ #define DEFINE_PROP_ARRAY(_name, _state, _field, \ - _arrayfield, _arrayprop, _arraytype) \ - DEFINE_PROP(_name, _state, _field, qdev_prop_array, uint32_t, \ + _arrayfield, _arrayprop) \ + DEFINE_PROP(_name, _state, _field, _arrayprop##_list, uint32_t, \ .set_default =3D true, \ .defval.u =3D 0, \ - .arrayinfo =3D &(_arrayprop), \ - .arrayfieldsize =3D sizeof(_arraytype), \ .arrayoffset =3D offsetof(_state, _arrayfield)) =20 #define DEFINE_PROP_LINK(_name, _state, _field, _type, _ptr_type) \ diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 2860de1d010..c9c29578d99 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -873,14 +873,6 @@ void default_prop_array(ObjectProperty *op, const Prop= erty *prop) object_property_set_default_list(op); } =20 -const PropertyInfo qdev_prop_array =3D { - .type =3D "list", - .get =3D get_prop_array, - .set =3D set_prop_array, - .release =3D release_prop_array, - .set_default_value =3D default_prop_array, -}; - const PropertyInfo qdev_prop_uint8_list =3D DEFINE_PROP_ARRAY_INFO(qdev_prop_uint8, uint8_t); const PropertyInfo qdev_prop_uint16_list =3D diff --git a/hw/input/stellaris_gamepad.c b/hw/input/stellaris_gamepad.c index 42d43f9af51..0714aaff188 100644 --- a/hw/input/stellaris_gamepad.c +++ b/hw/input/stellaris_gamepad.c @@ -72,7 +72,7 @@ static void stellaris_gamepad_reset_enter(Object *obj, Re= setType type) =20 static const Property stellaris_gamepad_properties[] =3D { DEFINE_PROP_ARRAY("keycodes", StellarisGamepad, num_buttons, - keycodes, qdev_prop_uint32, uint32_t), + keycodes, qdev_prop_uint32), }; =20 static void stellaris_gamepad_class_init(ObjectClass *klass, const void *d= ata) diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c index f7ba74e6d52..1298b6b735e 100644 --- a/hw/intc/arm_gicv3_common.c +++ b/hw/intc/arm_gicv3_common.c @@ -615,7 +615,7 @@ static const Property arm_gicv3_common_properties[] =3D= { */ DEFINE_PROP_BOOL("force-8-bit-prio", GICv3State, force_8bit_prio, 0), DEFINE_PROP_ARRAY("redist-region-count", GICv3State, nb_redist_regions, - redist_region_count, qdev_prop_uint32, uint32_t), + redist_region_count, qdev_prop_uint32), DEFINE_PROP_LINK("sysmem", GICv3State, dma, TYPE_MEMORY_REGION, MemoryRegion *), DEFINE_PROP_UINT32("first-cpu-index", GICv3State, first_cpu_idx, 0), diff --git a/hw/intc/rx_icu.c b/hw/intc/rx_icu.c index 992b069ae24..125a6dcb680 100644 --- a/hw/intc/rx_icu.c +++ b/hw/intc/rx_icu.c @@ -356,9 +356,9 @@ static const VMStateDescription vmstate_rxicu =3D { =20 static const Property rxicu_properties[] =3D { DEFINE_PROP_ARRAY("ipr-map", RXICUState, nr_irqs, map, - qdev_prop_uint8, uint8_t), + qdev_prop_uint8), DEFINE_PROP_ARRAY("trigger-level", RXICUState, nr_sense, init_sense, - qdev_prop_uint8, uint8_t), + qdev_prop_uint8), }; =20 static void rxicu_class_init(ObjectClass *klass, const void *data) diff --git a/hw/misc/arm_sysctl.c b/hw/misc/arm_sysctl.c index ebc95b9bb54..1df85593a5c 100644 --- a/hw/misc/arm_sysctl.c +++ b/hw/misc/arm_sysctl.c @@ -626,10 +626,10 @@ static const Property arm_sysctl_properties[] =3D { DEFINE_PROP_UINT32("proc_id", arm_sysctl_state, proc_id, 0), /* Daughterboard power supply voltages (as reported via SYS_CFG) */ DEFINE_PROP_ARRAY("db-voltage", arm_sysctl_state, db_num_vsensors, - db_voltage, qdev_prop_uint32, uint32_t), + db_voltage, qdev_prop_uint32), /* Daughterboard clock reset values (as reported via SYS_CFG) */ DEFINE_PROP_ARRAY("db-clock", arm_sysctl_state, db_num_clocks, - db_clock_reset, qdev_prop_uint32, uint32_t), + db_clock_reset, qdev_prop_uint32), }; =20 static void arm_sysctl_class_init(ObjectClass *klass, const void *data) diff --git a/hw/misc/mps2-scc.c b/hw/misc/mps2-scc.c index 7877b31479c..5c77239d2cf 100644 --- a/hw/misc/mps2-scc.c +++ b/hw/misc/mps2-scc.c @@ -464,7 +464,7 @@ static const Property mps2_scc_properties[] =3D { * motherboard configuration controller to suit the FPGA image. */ DEFINE_PROP_ARRAY("oscclk", MPS2SCC, num_oscclk, oscclk_reset, - qdev_prop_uint32, uint32_t), + qdev_prop_uint32), }; =20 static void mps2_scc_class_init(ObjectClass *klass, const void *data) diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c index 910dce901b6..afbc32e99d9 100644 --- a/hw/net/rocker/rocker.c +++ b/hw/net/rocker/rocker.c @@ -1466,7 +1466,7 @@ static const Property rocker_properties[] =3D { DEFINE_PROP_UINT64("switch_id", Rocker, switch_id, 0), DEFINE_PROP_ARRAY("ports", Rocker, fp_ports, - fp_ports_peers, qdev_prop_netdev, NICPeers), + fp_ports_peers, qdev_prop_netdev), }; =20 static const VMStateDescription rocker_vmsd =3D { diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 2a5d642a647..092a262269a 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -4234,7 +4234,7 @@ static const Property virtio_net_properties[] =3D { DEFINE_PROP_BIT64("hash", VirtIONet, host_features, VIRTIO_NET_F_HASH_REPORT, false), DEFINE_PROP_ARRAY("ebpf-rss-fds", VirtIONet, nr_ebpf_rss_fds, - ebpf_rss_fds, qdev_prop_string, char*), + ebpf_rss_fds, qdev_prop_string), DEFINE_PROP_BIT64("guest_rsc_ext", VirtIONet, host_features, VIRTIO_NET_F_RSC_EXT, false), DEFINE_PROP_UINT32("rsc_interval", VirtIONet, rsc_timeout, diff --git a/hw/nvram/xlnx-efuse.c b/hw/nvram/xlnx-efuse.c index 50a7f2baba1..6514ee84caf 100644 --- a/hw/nvram/xlnx-efuse.c +++ b/hw/nvram/xlnx-efuse.c @@ -266,7 +266,7 @@ static const Property efuse_properties[] =3D { DEFINE_PROP_UINT32("efuse-size", XlnxEFuse, efuse_size, 64 * 32), DEFINE_PROP_BOOL("init-factory-tbits", XlnxEFuse, init_tbits, true), DEFINE_PROP_ARRAY("read-only", XlnxEFuse, ro_bits_cnt, ro_bits, - qdev_prop_uint32, uint32_t), + qdev_prop_uint32), }; =20 static void efuse_class_init(ObjectClass *klass, const void *data) diff --git a/hw/nvram/xlnx-versal-efuse-ctrl.c b/hw/nvram/xlnx-versal-efuse= -ctrl.c index f5d5587cb65..101320b82fd 100644 --- a/hw/nvram/xlnx-versal-efuse-ctrl.c +++ b/hw/nvram/xlnx-versal-efuse-ctrl.c @@ -740,7 +740,7 @@ static const Property efuse_ctrl_props[] =3D { TYPE_XLNX_EFUSE, XlnxEFuse *), DEFINE_PROP_ARRAY("pg0-lock", XlnxVersalEFuseCtrl, extra_pg0_lock_n16, - extra_pg0_lock_spec, qdev_prop_uint16, uint16_t), + extra_pg0_lock_spec, qdev_prop_uint16), }; =20 static void efuse_ctrl_class_init(ObjectClass *klass, const void *data) diff --git a/hw/riscv/riscv_hart.c b/hw/riscv/riscv_hart.c index e675358e1a1..69d605c71e6 100644 --- a/hw/riscv/riscv_hart.c +++ b/hw/riscv/riscv_hart.c @@ -48,11 +48,9 @@ static const Property riscv_harts_props[] =3D { * defined by "rnmi-exception-vector". */ DEFINE_PROP_ARRAY("rnmi-interrupt-vector", RISCVHartArrayState, - num_rnmi_irqvec, rnmi_irqvec, qdev_prop_uint64, - uint64_t), + num_rnmi_irqvec, rnmi_irqvec, qdev_prop_uint64), DEFINE_PROP_ARRAY("rnmi-exception-vector", RISCVHartArrayState, - num_rnmi_excpvec, rnmi_excpvec, qdev_prop_uint64, - uint64_t), + num_rnmi_excpvec, rnmi_excpvec, qdev_prop_uint64), }; =20 static void riscv_harts_cpu_reset(void *opaque) diff --git a/hw/virtio/virtio-iommu-pci.c b/hw/virtio/virtio-iommu-pci.c index 7b5ffddc1e9..1f3a07c5d11 100644 --- a/hw/virtio/virtio-iommu-pci.c +++ b/hw/virtio/virtio-iommu-pci.c @@ -38,7 +38,7 @@ static const Property virtio_iommu_pci_properties[] =3D { DEFINE_PROP_UINT32("class", VirtIOPCIProxy, class_code, 0), DEFINE_PROP_ARRAY("reserved-regions", VirtIOIOMMUPCI, vdev.nr_prop_resv_regions, vdev.prop_resv_regions, - qdev_prop_reserved_region, ReservedRegion), + qdev_prop_reserved_region), }; =20 static void virtio_iommu_pci_realize(VirtIOPCIProxy *vpci_dev, Error **err= p) diff --git a/tests/unit/test-qdev.c b/tests/unit/test-qdev.c index 20eae38e03f..1199b761a32 100644 --- a/tests/unit/test-qdev.c +++ b/tests/unit/test-qdev.c @@ -23,7 +23,7 @@ static const Property my_dev_props[] =3D { DEFINE_PROP_UINT32("u32", MyDev, prop_u32, 100), DEFINE_PROP_STRING("string", MyDev, prop_string), DEFINE_PROP_ARRAY("array-u32", MyDev, prop_array_u32_nb, prop_array_u3= 2, - qdev_prop_uint32, uint32_t), + qdev_prop_uint32), }; =20 static void my_dev_class_init(ObjectClass *oc, const void *data) diff --git a/hw/display/apple-gfx-mmio.m b/hw/display/apple-gfx-mmio.m index 58beaadd1f1..dcd04617eb8 100644 --- a/hw/display/apple-gfx-mmio.m +++ b/hw/display/apple-gfx-mmio.m @@ -258,7 +258,7 @@ static void apple_gfx_mmio_reset(Object *obj, ResetType= type) static const Property apple_gfx_mmio_properties[] =3D { DEFINE_PROP_ARRAY("display-modes", AppleGFXMMIOState, common.num_display_modes, common.display_modes, - qdev_prop_apple_gfx_display_mode, AppleGFXDisplayMod= e), + qdev_prop_apple_gfx_display_mode), }; =20 static void apple_gfx_mmio_class_init(ObjectClass *klass, const void *data) diff --git a/hw/display/apple-gfx-pci.m b/hw/display/apple-gfx-pci.m index b0694f4cb85..74f79c8b157 100644 --- a/hw/display/apple-gfx-pci.m +++ b/hw/display/apple-gfx-pci.m @@ -118,7 +118,7 @@ static void apple_gfx_pci_reset(Object *obj, ResetType = type) static const Property apple_gfx_pci_properties[] =3D { DEFINE_PROP_ARRAY("display-modes", AppleGFXPCIState, common.num_display_modes, common.display_modes, - qdev_prop_apple_gfx_display_mode, AppleGFXDisplayMod= e), + qdev_prop_apple_gfx_display_mode), }; =20 static void apple_gfx_pci_class_init(ObjectClass *klass, const void *data) diff --git a/hw/display/apple-gfx.m b/hw/display/apple-gfx.m index 982b7c6597d..f9314eff748 100644 --- a/hw/display/apple-gfx.m +++ b/hw/display/apple-gfx.m @@ -16,6 +16,7 @@ #include "qemu/cutils.h" #include "qemu/log.h" #include "qapi/qapi-builtin-type-infos.h" +#include "hw/core/qdev-prop-internal.h" #include "qapi/visitor.h" #include "qapi/error.h" #include "qemu/aio-wait.h" @@ -879,3 +880,6 @@ static void apple_gfx_set_display_mode(Object *obj, Vis= itor *v, .get =3D apple_gfx_get_display_mode, .set =3D apple_gfx_set_display_mode, }; + +const PropertyInfo qdev_prop_apple_gfx_display_mode_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_apple_gfx_display_mode, AppleGFXDispl= ayMode); --=20 2.54.0 From nobody Mon May 25 20:32: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=1778421206; cv=none; d=zohomail.com; s=zohoarc; b=nWUNjI1nas11ucJPP6BBKw46cIi3yx/tjpA1HVElc8alnjM9PifoE6GO/P7YgXiQXszkUMEBmHZWjm6k7EKFOE5s8rw3emm1UwVNquPjo9J4ZCYrzakLYRHgoXQqjFXmvKDOb0qgqwBFj++HjbwQe8PJjUdnmJqv9I3aZ/aXeUg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421206; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yo/Nvg6Y//tEguXBrroJoZiFeTiHQvGZ1kkoGApg3/U=; b=SLGeGfcNBA1S1PlH8gs6Oxk+TG9h2MM8rD1vFBNwLbTyX7KjdtiblrTlZ7t+PK5W5X6+sWHk+9b38di0JCXREb0Z1lUj8q1EwV2Uvpabrt4KZaY7GQiJbaESh6ZACiYbReK4AVGG7HXPF7/H2NddXBuKQYWOmJGJL41XJhAczQE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421206534214.3855209485007; Sun, 10 May 2026 06:53:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4am-0007vi-TA; Sun, 10 May 2026 09:53:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4ah-0007nR-A0 for qemu-devel@nongnu.org; Sun, 10 May 2026 09:53:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4af-0006QX-EM for qemu-devel@nongnu.org; Sun, 10 May 2026 09:53:07 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-484-QW5D73tIMK60UeK-gou61Q-1; Sun, 10 May 2026 09:53:03 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9CDA418002C7 for ; Sun, 10 May 2026 13:53:02 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3D66F1800577; Sun, 10 May 2026 13:53:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yo/Nvg6Y//tEguXBrroJoZiFeTiHQvGZ1kkoGApg3/U=; b=TLuD2rTQ3Plef+vadpO44nqjBQCSYLDyIE4ooVVXLhT+D8YA0BYf8oOlEp7mI7Dvbn+1vN PD+tULwX0Eq4HNMAEZrMSmGLOXxJWZBEpXg84HfBkey1sRe0wUxJHeNB6q64VmmeOxGToe tn+fuWgSk4mOO4RuoSipp3acnivLZYA= X-MC-Unique: QW5D73tIMK60UeK-gou61Q-1 X-Mimecast-MFC-AGG-ID: QW5D73tIMK60UeK-gou61Q_1778421182 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:48 +0400 Subject: [PATCH 51/54] qdev: remove deprecated PropertyInfo.type and .enum_table fields MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-51-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=5800; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=mvHMJmtd0kWYzF11uNTZ2Qn7xXg8JQssC2aVzNRHecU=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItxQXhNHuW6Yf12SiDiCvnM+558NQhleVVhz 4gkbTv2aJGJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcQAKCRDa6OEJdZac 5Wp6D/9/k9Sd8T6Xv8cY1jnUZUfUI8VzEc8zLGbawW0gjj+XEabrzTdfISRbEUjU0J2nfNocyzx 3Pz+LCV94W+8t8vr6DzSFnQxOSyrvi/xcwnlZKEqiGIjed6CiPHqeycjIjFp1AVx+pH5tDdBBBH MCxAZgYuT0KVoWP4IcFkXgI2VcKxssaqqZ/GlGoPEsEaa7OlGMP1a+zpMHnw7mzMpaPRJEGoSBe BxoYzt2EGGTSakeEpTg611S+i+iSVrrcBcqDCBp5k4Jv2cDEJdWccfiWkNtVYvA4lWYM1nxXb5U 4RqoTK6wBxOM1qKR3RvvW0JbK87N9Y6b7r+DDUL08QlE0KqS3bbHDyeGOw7l4KEREBteu1I1akf QzVS50E5UDYSR9AdhtxqCopzBYsNmDYm6MzqXzW06X+5/A76C9KyTb5ojt1m/fJgPlrVxoY6U7N Ug9mIpx2Et1ph1GQfVUV0aejWXI34aIaJSHCrfUI1DMD85p9NyOPcsrogaICXko+LZ7sljqJyu1 E82KWxVe1drAdxMsLOVJY49i7kiD5SrLbnOgCDc4BnMiQXeZKzLOjW+dvgCuIHsAVxUbywbM6C5 gV6RHHGWiB80V+Kr8BG/uvwkkO3wg8XhsSi/O1lE7lHCY3UolSWEnVk/f3UHJiZcHnUaqckctC8 b+b8EDNaUY9csHQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778421208032158500 Now that all PropertyInfo definitions use .qapi_type, remove the legacy .type (string) and .enum_table fields from PropertyInfo, and the .arrayinfo/.arrayfieldsize fields from Property. Remove fallback branches in qdev_property_add_static() and qdev_class_add_property() that used object_property_add() with prop->info->type =E2=80=94 these always use the QAPI-aware registration path now. Simplify qdev_propinfo_enum_lookup(), prop_array_info() and prop_array_elem_size() to use the new fields directly. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/hw/core/qdev-properties.h | 4 --- hw/core/qdev-properties.c | 59 +++++++++++------------------------= ---- 2 files changed, 17 insertions(+), 46 deletions(-) diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-prope= rties.h index 8dd80501fb8..937b11dad09 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -23,17 +23,13 @@ struct Property { int64_t i; uint64_t u; } defval; - const PropertyInfo *arrayinfo; int arrayoffset; - int arrayfieldsize; uint8_t bitnr; bool set_default; }; =20 struct PropertyInfo { - const char *type; const char *description; - const QEnumLookup *enum_table; const QAPITypeInfo *qapi_type; const struct PropertyInfo *element_info; int element_size; diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index c9c29578d99..bcf72222d8d 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -103,11 +103,8 @@ static ObjectPropertyAccessor *field_prop_setter(const= PropertyInfo *info) =20 const QEnumLookup *qdev_propinfo_enum_lookup(const PropertyInfo *info) { - if (info->qapi_type) { - assert(info->qapi_type->lookup); - return info->qapi_type->lookup; - } - return info->enum_table; + assert(info->qapi_type->lookup); + return info->qapi_type->lookup; } =20 void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, @@ -667,18 +664,12 @@ struct ArrayElementList { =20 static const PropertyInfo *prop_array_info(const Property *prop) { - if (prop->info->element_info) { - return prop->info->element_info; - } - return prop->arrayinfo; + return prop->info->element_info; } =20 static int prop_array_elem_size(const Property *prop) { - if (prop->info->element_size) { - return prop->info->element_size; - } - return prop->arrayfieldsize; + return prop->info->element_size; } =20 /* @@ -1099,7 +1090,6 @@ static ObjectProperty *create_link_property(ObjectCla= ss *oc, const char *name, } =20 const PropertyInfo qdev_prop_link =3D { - .type =3D "link", .create =3D create_link_property, }; =20 @@ -1123,20 +1113,13 @@ void qdev_property_add_static(DeviceState *dev, con= st Property *prop) const QAPITypeInfo *qapi_type =3D qdev_prop_qapi_type(prop); =20 assert(!prop->info->create); + assert(qapi_type); =20 - if (qapi_type) { - op =3D object_property_add_qapi(obj, prop->name, qapi_type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); - } else { - op =3D object_property_add(obj, prop->name, prop->info->type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); - } + op =3D object_property_add_qapi(obj, prop->name, qapi_type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); =20 object_property_set_description(obj, prop->name, prop->info->description); @@ -1160,21 +1143,13 @@ static void qdev_class_add_property(DeviceClass *kl= ass, const char *name, } else { const QAPITypeInfo *qapi_type =3D qdev_prop_qapi_type(prop); =20 - if (qapi_type) { - op =3D object_class_property_add_qapi(oc, - name, qapi_type, - field_prop_getter(prop->inf= o), - field_prop_setter(prop->inf= o), - prop->info->release, - (Property *)prop); - } else { - op =3D object_class_property_add(oc, - name, prop->info->type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); - } + assert(qapi_type); + op =3D object_class_property_add_qapi(oc, + name, qapi_type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); } if (prop->set_default) { prop->info->set_default_value(op, prop); --=20 2.54.0 From nobody Mon May 25 20:32: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=1778421205; cv=none; d=zohomail.com; s=zohoarc; b=DfXqE40I6Hk95l7JxuEtSF4Ud4vIFTJ07JjmD3WX8MUinu1ht0xuejosN6AG7FZrORD9v/7pTFtWmlvGao0P0Qgrgt607h0vaEi/xiyL6WR8X9VLnzbpL5keu48RKfQSluIidbkI6nvnJLb5fRvfkWzjZ98qX07fP5IhrXbCwwc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421205; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=D0vfuOhVza4nNb0TtZR3j3xGIuJ5GsdWW+k0W3gKgWU=; b=ilgswHv/fKUjgoNS9g4Yc9BfZYlszq8fZ8gip7ENjMsnb+16F2psG3TSm/SsJ7oO8DB07S39k2QO+d0rEP9qdflC//dk92WbQgv4G7XTDv7mQ/cEPOxTO5pfc2Iie9SvsLUfk4mlQSNbUJvohSc875PijD3xYCCfpWy6uZagw0k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421205808438.48042692387617; Sun, 10 May 2026 06:53:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4ar-0000AI-3p; Sun, 10 May 2026 09:53:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4ap-0008Oj-PX for qemu-devel@nongnu.org; Sun, 10 May 2026 09:53:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4ao-0006Ql-2O for qemu-devel@nongnu.org; Sun, 10 May 2026 09:53:15 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-685-2MURqV4FNcC7g9WfSL7Xfg-1; Sun, 10 May 2026 09:53:12 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 32F5E1956096 for ; Sun, 10 May 2026 13:53:11 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7B84F1955D84; Sun, 10 May 2026 13:53:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D0vfuOhVza4nNb0TtZR3j3xGIuJ5GsdWW+k0W3gKgWU=; b=fOfhk4cYcl/yJ9A8WvCjP3nGn3Vy9E1no83TnJJ33dG2eDjsB4/3c6jcoQq/S0/fdkywZv FPi1aY1tovV0Sfn+7LODjrdsjjcxGEV6ObMnKnO8CWRFNt0gX9cYIuPaM84CiEuA2wzksi FejCUC0zZKBe1eE6PI9ARpuXENEcrM4= X-MC-Unique: 2MURqV4FNcC7g9WfSL7Xfg-1 X-Mimecast-MFC-AGG-ID: 2MURqV4FNcC7g9WfSL7Xfg_1778421191 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:49 +0400 Subject: [PATCH 52/54] memory: use object_property_add_link for container property MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-52-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2956; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=HXMxxNqr+o3gGHkiksXT8rf4U6WekZ1b2dqHkPAQWHo=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItxrF4xIHO1asoNvM6jUM1uuuWiJ4K45OJJF AKoxQN8J1WJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcQAKCRDa6OEJdZac 5UcTD/9CpMLA0XYpph+sr+TVHnzrf6VpaNziuvu0jx7wTgALpIUe82pesje6bY7aFgbdulpUpln jI/rjIVmqHPLRr9t/8zq1c1mvbJJ3dqOpcdU94O46u9HVDp8XR7w+tyVYXzZhk6/jIfYG8ToyCf VN85KFvrmLYmGDydniVV/wHHeNmtgRYZ8JHMitpgc2pnWQHJLOskQ4a2ZTeIh5Vo+FpKXPNb5Ba n5r1j0N5cvJFgiLhPfTJIaFcaZO40YFS3SB/axyJZ7ZwqAexcovg3WCjOwP/88qApDbofLV6Jki iNiqMoUisYIeTfpJx9k2L+eKG+vg01wGfu+DUtBfOs99h4SrakIrPPhIkT4hmkjTSdXtqrCPxqh c1GZamiWrHuAlCm8HcvWeG4n6hgquVnKF8CcjmUn801PbIKwubyT2k7w/104W3H1tYmKuPoB4xg ACvcN0oeijI1scgx0Ht/1rdL/cXa3DATiEvtXTUjsadr0HRYaJJkGMs9gIkvSWsm1mJ8xHjinxU 2G8SVJf7Mg+Y6VZ1OShA9JCMc6sMOuRteERnOUqaJAkDfdp+LLlGwOd+1q96Yo/x25W1J3Ov6ko 4v9BkPZNUf90cDYRBE+igNbpgDGxUOfoayH+MP10PoWkypTCjNHGKlrGdfNMb0PooW8JX/jyA8/ 48NusUQ9yTgyBSQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=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: 1778421206843154100 Replace the hand-rolled container property with object_property_add_link(). With check=3DNULL the link has no setter (read-only), matching the existing behaviour. The built-in link getter and resolver are functionally identical to the removed memory_region_get_container() and memory_region_resolve_container(). The non-STRONG flag avoids refcount interference =E2=80=94 mr->container is managed externally by memory_region_add/del_subregion(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- system/memory.c | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/system/memory.c b/system/memory.c index 1f2d44ce8b4..d06b14d8338 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1253,29 +1253,6 @@ void memory_region_init(MemoryRegion *mr, memory_region_do_init(mr, owner, name, size); } =20 -static void memory_region_get_container(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) -{ - MemoryRegion *mr =3D MEMORY_REGION(obj); - char *path =3D (char *)""; - - if (mr->container) { - path =3D object_get_canonical_path(OBJECT(mr->container)); - } - visit_type_str(v, name, &path, errp); - if (mr->container) { - g_free(path); - } -} - -static Object *memory_region_resolve_container(Object *obj, void *opaque, - const char *part) -{ - MemoryRegion *mr =3D MEMORY_REGION(obj); - - return OBJECT(mr->container); -} =20 static void memory_region_get_priority(Object *obj, Visitor *v, const char *name, void *opaque, @@ -1299,7 +1276,6 @@ static void memory_region_get_size(Object *obj, Visit= or *v, const char *name, static void memory_region_initfn(Object *obj) { MemoryRegion *mr =3D MEMORY_REGION(obj); - ObjectProperty *op; =20 mr->ops =3D &unassigned_mem_ops; mr->enabled =3D true; @@ -1308,12 +1284,11 @@ static void memory_region_initfn(Object *obj) QTAILQ_INIT(&mr->subregions); QTAILQ_INIT(&mr->coalesced); =20 - op =3D object_property_add(OBJECT(mr), "container", - "link<" TYPE_MEMORY_REGION ">", - memory_region_get_container, - NULL, /* memory_region_set_container */ - NULL, NULL); - op->resolve =3D memory_region_resolve_container; + object_property_add_link(obj, "container", + TYPE_MEMORY_REGION, + (Object **)&mr->container, + NULL, /* read-only: no check means no setter = */ + 0); =20 object_property_add_uint64_ptr(OBJECT(mr), "addr", &mr->addr, OBJ_PROP_FLAG_READ); --=20 2.54.0 From nobody Mon May 25 20:32: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=1778421208; cv=none; d=zohomail.com; s=zohoarc; b=bjUndW1pokQoyHKTZbGSIZ1NLmP6fhzzR4n1Fm22Id3fkGuwomp7CWSBq+C3ldJ/ksG7Vg/I93T3igTWTBRyLJ9k9nAC3tnq1vEdSyamR5r9FUNdBed+udmvZo0SGjNkwvJuEXlGWNstME4pfqVCGksHbjoh/pJFhBo/NY2QIEI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421208; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AAiIwDFNhKTjy1wUXIZY/njao/HKRmnjb6K05LMnizs=; b=ZzDOdbumE7NyUg7p/WQKk6WAFspibvVRX/F5YakQlr08P2wI5tTINcpdOgMHjaIqT0AbtFPuwtAC73NbHk6L/GWNsAQsQMCezn8hTlnKTmzkGzGi/Pzg9RkJuta0qksRbmfUKyLxAuNZreVZxA/s80Mie29LDUB7OXDHZuKUMs4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421208506940.6090745283627; Sun, 10 May 2026 06:53:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4ay-0001UI-U3; Sun, 10 May 2026 09:53:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4aw-0001Am-VV for qemu-devel@nongnu.org; Sun, 10 May 2026 09:53:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4av-0006RL-7Y for qemu-devel@nongnu.org; Sun, 10 May 2026 09:53:22 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-328-84u0wfT0NgyfpHG6KRN7hw-1; Sun, 10 May 2026 09:53:18 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4725F19560A7 for ; Sun, 10 May 2026 13:53:17 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 155BF19560A7; Sun, 10 May 2026 13:53:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AAiIwDFNhKTjy1wUXIZY/njao/HKRmnjb6K05LMnizs=; b=K4q/OIq3n/Mvfh+hOWOnplecfP9kWpsCK0n4xRzUPFEbxbA7EgHTLy1rgEBmsVLS30II0I mH3RNzSRP6tETxjFdn4/WKqZ81D+F7EFHfaNzPNNUKeAAyYiOw5SiEOo9I7dkxBiSaxmcn Ppr3IkzhPlJjlbkIf66lwLKti/KriR0= X-MC-Unique: 84u0wfT0NgyfpHG6KRN7hw-1 X-Mimecast-MFC-AGG-ID: 84u0wfT0NgyfpHG6KRN7hw_1778421197 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:50 +0400 Subject: [PATCH 53/54] qom: drop free-form property typename registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-53-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=3615; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=j8k4RT5G1PHBwcE2vQ0BwXA7M2uZzRADNZTy4/j7E0A=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItx6XY/BNLSJFCV4ejk0PiIcfJk0oJLP/7ZF 1MVxXV8B2WJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcQAKCRDa6OEJdZac 5WyDD/44Iv2SNZeXh5+k3op9tcAU5Hcx6QhH2nNy5vxN0GwmIsWvDpSi2OtakhXz3X8NCp0N5Cc 51ZQ7veo/ekrdAs5+oiCwjhyMS5W8W+CyaaENkfhi3+KYMZUE6q1nwBi4jyW4RMjAgrXrJ6qGdU mIlNVVlRK3lBNNa3UbkowdSLRuTZoK/vhZJGcIB/TcP64xBDHHSVUslgv94OKO3Azg4vWxDIFk4 8vU7xwY06UtOJfsjqePrWbbyPKicNeIFYNGhZltQ7fTzL/5idBUjH+Xq5jdtWVrotafGD/sgZNM HWWgzSHV0wgE6l8yRLybB+klf36Mp/XGNrG694daOB1yTp17uFz6DWrbqdMQOVcvkOXZVV9oXvl zpi/BWNCvNMTdyL/EPBzv7zTouAz8Owjmhcp/omj7nbPPNbcfU2wGOvqHllHHNT8w6RzXcVKJaX mob7C+b+1APwcZtU7TZ0njpJxjmWVr1HMd4Senj+DDN10WKYf6YMBDphin7D9VM8c/zfLz13gmO RgePzPIbPmT+qVrj4H9CDGOlWIVwCQ8AI3PcGhPybsrh8+z4Sosgs4ockeArRi15F2PYiF8Qcwd nPia5N2zS0pBC8PJ4b9+26/H3Ubqb5i6rH/0RIg3fk+As1nOtZGKc4FFov/6yqLBfkllmMFDgdh mk2bfpvNnBwKeFA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_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: 1778421210003158500 All properties must now use builtin registration helpers or QAPI-based properties. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/qom/object.h | 36 ------------------------------------ qom/object.c | 4 ++-- 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index d0134a94281..ba2df54258b 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1084,44 +1084,8 @@ ObjectProperty *object_property_try_add(Object *obj,= const char *name, ObjectPropertyRelease *release, void *opaque, Error **errp); =20 -/** - * object_property_add: - * Same as object_property_try_add() with @errp hardcoded to - * &error_abort. - * - * @obj: the object to add a property to - * @name: the name of the property. This can contain any character except= for - * a forward slash. In general, you should use hyphens '-' instead of - * underscores '_' when naming properties. - * @type: the type name of the property. This namespace is pretty loosely - * 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'. - * @get: The getter to be called to read a property. If this is NULL, then - * the property cannot be read. - * @set: the setter to be called to write a property. If this is NULL, - * then the property cannot be written. - * @release: called when the property is removed from the object. This is - * meant to allow a property to free its opaque upon object - * destruction. This may be NULL. - * @opaque: an opaque pointer to pass to the callbacks for the property - */ -ObjectProperty *object_property_add(Object *obj, const char *name, - const char *type, - ObjectPropertyAccessor *get, - ObjectPropertyAccessor *set, - ObjectPropertyRelease *release, - void *opaque); - void object_property_del(Object *obj, const char *name); =20 -ObjectProperty *object_class_property_add(ObjectClass *klass, const char *= name, - const char *type, - ObjectPropertyAccessor *get, - ObjectPropertyAccessor *set, - ObjectPropertyRelease *release, - void *opaque); - /** * object_property_set_default_bool: * @prop: the property to set diff --git a/qom/object.c b/qom/object.c index 1e6c3a9f91d..c378d20c4db 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1225,7 +1225,7 @@ object_property_try_add(Object *obj, const char *name= , const char *type, return prop; } =20 -ObjectProperty * +static ObjectProperty * object_property_add(Object *obj, const char *name, const char *type, ObjectPropertyAccessor *get, ObjectPropertyAccessor *set, @@ -1236,7 +1236,7 @@ object_property_add(Object *obj, const char *name, co= nst char *type, opaque, &error_abort); } =20 -ObjectProperty * +static ObjectProperty * object_class_property_add(ObjectClass *klass, const char *name, const char *type, --=20 2.54.0 From nobody Mon May 25 20:32: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=1778421221; cv=none; d=zohomail.com; s=zohoarc; b=CU9eq1JbbhdXYOkILGanOJOxqE/R5WVU9BvTPgFv1DJ5IXjHQneIKyq7g9sY35FrJB4n8wklyIBkde0l7yGITIypm+hdB2GR8xN76ES9Eun9fbmE96oYO7AFINsl6rQkYe9IUHAYp2qoHdZmvowZxFsq0pXjLX+e4KEESiP7gCY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778421221; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kMHgE33Hk8bxjc8Z7+XxgDyHkUfsz/F1aWHoVzZJB6g=; b=FbQ3AfTF+Mo/X/ZgDg5wTCJh9isD2PfljZrsjT8UnKDiCz1ZNjsRoPIRFhIzjHB4xR1z4bp2M+eXSUk+kXoCIjrqZXj1yGfGhfspXuyYqLp9BPZbnFj2QOwveigtkbqbWrD63gC7c8eOM/4Gt3x/RU1xxlBLfd6Nyxc/Gn5cnRM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778421221895736.6895360187133; Sun, 10 May 2026 06:53:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wM4b8-00027F-5T; Sun, 10 May 2026 09:53:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4b2-0001wC-Ft for qemu-devel@nongnu.org; Sun, 10 May 2026 09:53:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wM4b0-0006Rs-Gm for qemu-devel@nongnu.org; Sun, 10 May 2026 09:53:28 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-489-3rAwoZ9sOA2yuzwkP3XQ1A-1; Sun, 10 May 2026 09:53:23 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1F58C1956080 for ; Sun, 10 May 2026 13:53:23 +0000 (UTC) Received: from localhost (unknown [10.44.24.4]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D26D13002D32; Sun, 10 May 2026 13:53:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778421205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kMHgE33Hk8bxjc8Z7+XxgDyHkUfsz/F1aWHoVzZJB6g=; b=N7QM6OLmOBjEVU3TlyQu6uHlYqU0NpDEs7mKIBytqv4Yfb7edwazxo2F2aGsowEZLxK/th m69blQyub7rTFlNtMlri2Sh6RZVsAwwi7msSIYPPD+SRgf6UXMpS6cHHPPQuyUsPh/vD5X 7T/0xpGjJKRWyCWbSK4jXwzaU30Ix6s= X-MC-Unique: 3rAwoZ9sOA2yuzwkP3XQ1A-1 X-Mimecast-MFC-AGG-ID: 3rAwoZ9sOA2yuzwkP3XQ1A_1778421203 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Sun, 10 May 2026 17:43:51 +0400 Subject: [PATCH 54/54] qom: use QAPITypeInfo in object_property_get_enum MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260510-qom-qapi-v1-54-48ba6a1a1fa5@redhat.com> References: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=4649; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=RI9rLy0513Xk0Jg11GM3GXY46K98BlGPdQxdRVl/trQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqAItxnmMmUi+8nbXZV5kDZFF9J3thfQNCCBbL4 Ji6+BbwCjiJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCagCLcQAKCRDa6OEJdZac 5VB7D/wMybTPK75VO0ZA44e5hqNFOBAZvltaMM0UGqZQb9IByol8zCnnwCPTgOvAdyOYlact8X/ izyXLRI24V+ImHSEcgUi1MlVA6DQLG2ZhvZZ9O+Wcyj0N97dUXEnrg8BDfyktKjy2yU8VxjG9qM WYAvlkrwHKkDZzZIwdegaN0bf4Drwl1g5tn/GA4lxol1xeRvxWWJMjNuyee4eyTosma6kl0WOD6 IRUFGwJbQCT4I9JwzWoJGa+OrAOi2taygAmE2ebJQaqdtfkb47FKP3qhM5A3GN18ZM2yHOYoqsC YooqVtuyVmbawgm7x/qX8+53BZs0slDtLg2scwaaCFwyRj9Cf56sw9t429ir0KVfYbtfH9Iajmu PLVmKuSZsh8owbBvY7vgVTA+sNU31PA6GbBxjfFXG6H1QUI1j1TBu12XW76G1RNsxWCmIrb//0I /z41EeGTnfJPuWLArKz0KzYMRtqy2kdEvWaYirURN+gO3qzwil0AA2Rs2vLAfWdHr3zRhl5M4+G d2v4ckFCd7LkUi2KqCrts+r2wJw+koLhFeutgpO0rRIyzelOQVk0pzoXWSjEtQXDYfoy2aZGSjn Ru7BlI4aHFCR8LgjeSzR4Ej95LaU7Ev4W+kVTC2wrOfVrDRyVjxiLo6oJkWMDHqL1WXBEeJP0S8 1Pr5TXStepPw/Zw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=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: 1778421223107154100 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 --- include/qom/object.h | 4 ++-- hw/core/machine-qmp-cmds.c | 3 ++- qom/object.c | 8 ++++---- tests/unit/check-qom-proplist.c | 6 +++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index ba2df54258b..573414c7270 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1410,7 +1410,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 @@ -1418,7 +1418,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 e62cb4ec888..9b449080dd5 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -17,6 +17,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" @@ -218,7 +219,7 @@ static int query_memdev(Object *obj, void *opaque) } else { m->has_reserve =3D true; } - m->policy =3D object_property_get_enum(obj, "policy", "HostMemPoli= cy", + m->policy =3D object_property_get_enum(obj, "policy", &HostMemPoli= cy_type_info, &error_abort); host_nodes =3D object_property_get_qobject(obj, "host-nodes", diff --git a/qom/object.c b/qom/object.c index c378d20c4db..08f2e93d0a1 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1604,7 +1604,7 @@ uint64_t object_property_get_uint(Object *obj, const = char *name, } =20 int object_property_get_enum(Object *obj, const char *name, - const char *typename, Error **errp) + const QAPITypeInfo *type_info, Error **errp) { char *str; int ret; @@ -1614,10 +1614,10 @@ int object_property_get_enum(Object *obj, const cha= r *name, return -1; } =20 - if (!g_str_equal(prop->type, typename)) { + if (prop->qapi_type !=3D type_info) { error_setg(errp, "Property %s on %s is not '%s' enum type", - name, object_class_get_name( - object_get_class(obj)), typename); + name, object_class_get_name(object_get_class(obj)), + type_info->name); return -1; } =20 diff --git a/tests/unit/check-qom-proplist.c b/tests/unit/check-qom-proplis= t.c index 7f10befe687..d6703e64827 100644 --- a/tests/unit/check-qom-proplist.c +++ b/tests/unit/check-qom-proplist.c @@ -528,14 +528,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); @@ -543,7 +543,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.54.0