From nobody Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781555935; cv=none; d=zohomail.com; s=zohoarc; b=gLarjzq0tu2BVMAmaabgp2uU3TAD18lYAaBuM/t1F6i6OyJs0GmoldKrRttcnkJB1x/f8J/SuZfzS6COXmH7/PHGjk5rfAmC5flHRXDe8Cun7R+ZVo1z8AgzfOy72kdF7gX2n5qGQsuOeotrFiB0SyYpqDf22NKQJHN9zesA57s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781555935; h=Content-Type:Content-Transfer-Encoding:Cc: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=UNPn1A4TdwsMh4HPlKL0Z67HnF1LgGZKTOf/5QZrKao=; b=fmGAqhbPoo3Xf9nlFlbGqQLjQGg/i5f/2K6yFDzxulrcWXWguVk4WhQ7wyrD2+xj0kUsv4z8Jj5DHYBkIn31jtCBeCUhpTBVkVb2j5ExWMc7gusOf5WbdH+TERAyMV9gJobxZisAIWb4O3Y6ziCG6cjD83YuCVjZj7BcvYK98Sk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781555935740240.50383445371733; Mon, 15 Jun 2026 13:38:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE4B-0002m8-Sz; Mon, 15 Jun 2026 16:37: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 1wZE4B-0002ln-6Z for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:37:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE49-00029t-Os for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:37:54 -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-161-Oqvay1yDO_KWNtM4EeItIQ-1; Mon, 15 Jun 2026 16:37:51 -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 6C19018002C2; Mon, 15 Jun 2026 20:37:50 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B488119560B2; Mon, 15 Jun 2026 20:37:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UNPn1A4TdwsMh4HPlKL0Z67HnF1LgGZKTOf/5QZrKao=; b=DOuYSylXlS3hcL44ltViJiDafYLvqTmL/+ya0P1+muOLqjkF04oMS5VaXt/Yi7fV5CF0Kg onnYDYUCyGSeqcdtEN1Ipj5FflhuIUu80PhDrRPymh95vYlN3Gb7wQLugT0O3bZJmWX3O6 5XPVYSe3ia4ZhFaVkeFDwoxsQEn5Yac= X-MC-Unique: Oqvay1yDO_KWNtM4EeItIQ-1 X-Mimecast-MFC-AGG-ID: Oqvay1yDO_KWNtM4EeItIQ_1781555870 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:27 +0400 Subject: [PATCH v2 01/53] qapi: add QAPITypeInfo struct definition MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260616-qom-qapi-v2-1-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1779; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=3Hn5p3o8GowD4Url147++P7OrZcqEPX+kxr1mdBFGto=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKNM30xR+GP00pIZfH7nbN0k6mKvPijkfg5L VI0al4NXdCJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijQAKCRDa6OEJdZac 5eBeD/0cYbfrNYbCTsfr/fdIyogOOGmhtEbQ6Fg7jViRks2R/KBENQxZPIv2Fqwv9AVzoGYpzjd Coyoddn0VQG7i2uFlRescH2zZYkUPLh9AnmaEUPMgNREtVGH+tdKNnkex/KThGdApdwJL5qA9CE NOzCy1V6mNq3aUwJ/0Y7Ue2iCeSL9gqXD9MY2nHWpaFPcrHE5jSeyP97j0XFkei/0U8FIOe7oNg xjMCvwGxRGIFlH4DVI4e4HShNHW3y0YgVTI4Fsldb7I7OY1YLrz/JWc81i6RMunOQq7Gba2sSK9 CcXN4QZ6JrHO1UB67WJRqhhlxtNc/p8HabxhenibasU1G+l3aF0SzssRE/4aykDi+oji0UZf2oD jpK+7+1aWlQRYffrcpaaKnU8czsW1kfQo8GhgG0sMxMPcfYFoHHot2BQPrntUL7ReLnyJkBdoQp HunOFr4LyBrMXCcgiq5oXElIjL4VhcIHfarL81Kviap788IZqYKU31lwFsOZMS85+0g/LANVz52 Sxy2QrHA8VdUjt7/yOwRF/g6UInpTN/SAgv61WSauoHzcstysln9jFYrePZsV5WuzSIp6HiA0M6 dmGOismdiUL5cJplkAmYmZ/0jvg3bmqk/JFmLQeIdsi8jNk5xP78+DM0A5XzQM5v2TedSfugzkf C/AS0WfOb8LE/Hg== 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781555937581158500 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 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/include/qapi/qapi-type-info.h b/include/qapi/qapi-type-info.h new file mode 100644 index 00000000000..a7a470af731 --- /dev/null +++ b/include/qapi/qapi-type-info.h @@ -0,0 +1,32 @@ +/* + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef QAPI_TYPE_INFO_H +#define QAPI_TYPE_INFO_H + +#include "qapi/util.h" + +/** + * QAPITypeInfo - QAPI type metadata + * + * @name: QAPI type name (e.g. "str", "OnOffAuto", "int32List"). + * QOM uses this as the property type string. + * @schema_name: Name of the type in the QAPI introspection schema, assign= ed by + * scripts/qapi/introspect.py (e.g. "368"). NULL for builtin types = not + * individually present in the schema. + * @lookup: QEnumLookup for this type, or NULL for non-enum types. + * visit_type_enum(), qapi_enum_parse(), and qapi_enum_lookup() + * all rely on it. + * @list: The list-type counterpart, or NULL if none exists. + * str_type_info.list points to strList_type_info. qdev array + * properties follow this to find the list type for their element. + */ +typedef struct QAPITypeInfo { + const char *name; + const char *schema_name; + const QEnumLookup *lookup; + const struct QAPITypeInfo *list; +} QAPITypeInfo; + +#endif /* QAPI_TYPE_INFO_H */ --=20 2.54.0 From nobody Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781555957; cv=none; d=zohomail.com; s=zohoarc; b=ARLpckOm6M9qxjzL/sFrewb9qHzQyHZtKjaas5UXfeDFGWx8PeAGQOTdjYmUIh+Jb7TVkZKL+00otMiPvXSPK+VxgKD1SS8K97hDpMGqIzIEA/9fCtZsbKitCegqRrWcbzXN62Rry9isNd21rn39CiLosv6e+ae8i3gDbhrHWpk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781555957; h=Content-Type:Content-Transfer-Encoding:Cc: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=hvqqYXRUOsyszmocDZX28WJczCKlrcuow+cmJQzIYE0y2r1TcuxEAMXFxe8BaP/Cll9apLYa9RXaxoiVUGgokuHQ6MPtfHWgFKOeWsFotWikDdWdeEZ2x/zEXLKRDpaEnY5MRfa0Lzbs97tIZVdzcSP7PM51OpcJSyImgwwKHXw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781555957228669.1165647536772; Mon, 15 Jun 2026 13:39:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE4J-0002r9-NB; Mon, 15 Jun 2026 16:38: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 1wZE4I-0002qM-AR for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38: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 1wZE4G-0002BG-TM for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:02 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-520-Q1qmkLoBNVGzs-ZIk9F5iA-1; Mon, 15 Jun 2026 16:37:56 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9948318001F0; Mon, 15 Jun 2026 20:37:55 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5D491414; Mon, 15 Jun 2026 20:37:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=JY9e1zUfqHx3HgXBp4IPS0s7gNQmM752rM9mOwqyRg5flYO6v+cY/HkqO6UvnXXWVJ91h+ acmrb6F7VRL7Go/Esi2kEP+xcDShAZ0qpkf8Vd1di0WQaACp/nGN1rUVI8koTQJZnrogBF ijTY+yvcnN+mcjFH/j40WV4PRYP4ZRw= X-MC-Unique: Q1qmkLoBNVGzs-ZIk9F5iA-1 X-Mimecast-MFC-AGG-ID: Q1qmkLoBNVGzs-ZIk9F5iA_1781555875 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:28 +0400 Subject: [PATCH v2 02/53] 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: <20260616-qom-qapi-v2-2-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2078; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=5ld04Km69gTihvCVA+G8/s2NgBnD5vvjVRkp5Y12BUQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKN3D3zL00infnm2V5p5rBs32JpbMpVIYeUV zVK1lPzU8WJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijQAKCRDa6OEJdZac 5VQyEACVWn/8b757+m+nqX+psomUPZw4iLfKrEyLRTjG9rZejTRS4qI9OKiWOhU6IEQOKSPW0iI bVRuAhn/mIj6DArt/sXAu10eyvpRYk9gFkkOk1kdQsbFZdc5QNPtsU3ltksn8rpeAddXMuFFIpH T+7X4nx7y/CbrlTqlV3N53UygPIE+M8bzLR0S/KY//7gCviwdWpoVqtrubb984WerFTc/bT+5Sm 6UzpF+5eEMs4HqTiA83F8qCY6+wF4VfKsAD3CzZAzXsw5PkmJ446KyhMn7pG6NrcXjozN881IO6 VJNX+bQ2xUyXWr6TeAPBOTHfp8xnvKNfnkRgSZWoWPDS79TwkTvaWWVLiD1g28GbFAW/hyxhPv2 48cWzDYdphbytEYYPtuaLQ5pW7ZLT55og9PZYM/J0XuTMI88GAnnEOFsw3AtnQlevFm5mQm4hOo pRbNr74uaGOtd/xnnu6TnMsEmmmhCdDzXTtOAhET1F0x8K3EI52rAgTlxaZRMIZMyubD7MaSCVP TU2C4aHM1vGqOqn5mn+oJHTgVFDNObug8u45V/QJ7UkwItqhEOh7WvRce2mFXT3lG1VVcZDZjhh dWwVM0eGmEzMoVqNfhKiQYbV9F1Z9cdwoZFO9ag/L28vi3u2bYmK7Z6GGVFgX3bYtfEDRAgPaCr DI0hLJhK8J++a9w== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -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: 1781555957854158500 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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556022; cv=none; d=zohomail.com; s=zohoarc; b=GuYC3ZnvtkLjB79t8hmmGUMd5pfaZ1TdwTkeflHcvUhq2jtinJbyc6YrvuNXK1VbhZYSAD3FDVeWIfvjjmrmlhmsBP219eFCg25JcRbI9mGTLySCcnIke9QXQILyzszoUnUbqA+1Rlqm/bj8ySDVpCa+3nvMLID6dL5H0mU3FO8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556022; h=Content-Type:Content-Transfer-Encoding:Cc: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=tqGifrq1a1GHXpAFx7De+5GdUyzhFTm4nCqxznZjdhE=; b=XrJArVTp6K7BUa2AWbrbtM3Hx+tNScccwK6ryliuNYjKHTtATXKE/FnIZYCLSCyOcuiHqbZA8EedUBdqkDbsan/OiG0/v6FGzAKYYfmtsRNYNXFg2x9aMFtE40LPdkqm3aR5tzxab4KkTypy2Evws99LmdqVvRWM1ZDoJwnhNu8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556022827222.46788343956712; Mon, 15 Jun 2026 13:40:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE4T-0002uJ-4q; Mon, 15 Jun 2026 16:38:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE4P-0002sc-AQ for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE4N-0002Cm-53 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:08 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-642-p22b8Dj1NnS4NYzDAUhIEQ-1; Mon, 15 Jun 2026 16:38:01 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 955DB195609E; Mon, 15 Jun 2026 20:38:00 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6613A414; Mon, 15 Jun 2026 20:37:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tqGifrq1a1GHXpAFx7De+5GdUyzhFTm4nCqxznZjdhE=; b=B9XzO0oS8elA3013i/YAxhe79VCMcTDsCJjHGD/8gY8iDn0rNk3IFrPXcX8qxjbupOPYR9 1BNSIRHtzX7qXLa+INJzc345OmMy/Rn9CNc2VgpncPofnHkjKoijFhKgnhfUib1V/f8aev 6Fkzl2GNGVM63vJU2UUlwEqn9mMEzKs= X-MC-Unique: p22b8Dj1NnS4NYzDAUhIEQ-1 X-Mimecast-MFC-AGG-ID: p22b8Dj1NnS4NYzDAUhIEQ_1781555880 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:29 +0400 Subject: [PATCH v2 03/53] qapi: add type-infos generator MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260616-qom-qapi-v2-3-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=11421; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=ces1+L5lSePCQpib/l8nz+v9wX+7eQ0C239vWF7ZXg4=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKNPJhde+2XMNRUQew6RfLO2/0YV97GysnaU JTr5SC0kraJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijQAKCRDa6OEJdZac 5a1AD/9R9pSeVcs3en9bnSAPJE9LkhPdCuzFQF20ak7IwqY11VIJF+2IpQIRICbsUfTTrt9s5FH xacCH+UDyPsWGieL6gDAEJ0vmVyf18KUUtThG4NgIA1f8mhBQhzxbyv/KwwBmKHlC9n6OReFNPp r7mJwdN/GA3sGudsZJRmkca7Cyuf37TPi2wa73kFkwB9ACGBspTwFxPMIbhmFsXBB8sMaDsJrfF 9lcrJlj/0XYxFINTtjZ/1ks36ZDn0lGroTKzOf78MzQ9ycuFUhw7kxEo/XrwTLeckVuBmclTZtF BilP1TJrNP41hYuSl8L81oJwHJrLmFo0Tq2xVlEjA054GPnRCU5SoVU0je6ZFajgn6qKrSmR+9q Pg5MqF0+vHqLq6nPQma/UVF/DLfr/7QrpDiWxcWvHRsEeXuc6bEa/l9YHPvX9DiBPx5S89wWHCT TNRP552SIkB3BLzLZXIZDGACQIPD2NrD88e9FWEn/WVp1mbWXN7uPqA/mseOru2U0vhjQmLfThY 2CZXcoX6BA5yk055Ow/KnVGWJJnk5XsC0CyCPeLljs2oTTIU8LNJmpL5JopJPSTdqTwdN51xydo N0CZXrAvGgdq6ctCeShaI5LCJKlO7XhPpfAy2nCWkavMLA6UrW1uDtRboWXCKd5ncatGVto926t 7kWv3ESCzxBPfdg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556024078158500 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 19e123423b5..f135eddad12 100644 --- a/meson.build +++ b/meson.build @@ -3487,6 +3487,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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556100; cv=none; d=zohomail.com; s=zohoarc; b=m1b/GpV03X2AX552lZl285dEAr4iNL2YAiFwOkBzjUbt1ygzvn0TwyYWXUt7VmjiKGCUCCZHKYXdFn3aFTl8Dqhl4SzFntIJG4mhVLqily2enSM+WKFq82K5oVgFZeTEpzaDPmGBeix0u3j8rcKNEpOPFBiOqXpfWnyu2tXDIpw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556100; h=Content-Type:Content-Transfer-Encoding:Cc: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=b/WKeGz6Q4ZvXKkGKoPqqmkd+VSfjzduxKuy+/NIahjP4s3n+CKe6pX1/gQJQaq7LrIG3pMAb5ip5Wi8UZd/XjRDkagSQBoY4TF35vf91sVDrL1YuOfGpzaIfxdsA8BOIdceHTSpCj6jQQnLb7fEClAJAn0A+W4f0JAry5jhx6s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556100506692.7720748965204; Mon, 15 Jun 2026 13:41:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE4W-0002xV-MD; Mon, 15 Jun 2026 16:38: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 1wZE4S-0002th-I2 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE4R-0002Dv-0t for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:12 -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-541-gv-xwEjHP3aIAIMK4j4zTw-1; Mon, 15 Jun 2026 16:38:06 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6CE011800350; Mon, 15 Jun 2026 20:38:05 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7ED15414; Mon, 15 Jun 2026 20:38:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=Z3/D6aMtkYBEPMQTvB6VfK/MhQduHMzhM2vPhPR/+5qDS4g1HT+cwANDuFfd40I//tX+NV OHMUnE/2yRBtLlXbFWPmTDAB/xPO4mTHSp4V8KLGa5w3I51BkrDCr7TrRVCQtqi7vEwF4c RvNIQbqP6NpLkzCB+P3Han/XsfJY8ZA= X-MC-Unique: gv-xwEjHP3aIAIMK4j4zTw-1 X-Mimecast-MFC-AGG-ID: gv-xwEjHP3aIAIMK4j4zTw_1781555885 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:30 +0400 Subject: [PATCH v2 04/53] 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: <20260616-qom-qapi-v2-4-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1109; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=uvjz2W2mHnyexv8i2EcHpZHrtNOIG6lMcGZHXJTUUWQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKNFn83iRGjfo38dm5SFIum1NFCosaZRr+Mo m7223BzD+mJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijQAKCRDa6OEJdZac 5Z6ED/907h9wvPND8kuDseWhCRUHyd8x5vtHtWFAbUl/xs6yj94vg8exq6GbxB/x+tzX8ldEY8Q e31YsuddgPfh7IhAV77e3crtsoyzayku0Bxaqc1SpswGwXrDKhKr+YHMQtHv0Q6h2ZhM6mXW53c oTD+/jRcv8/C+Ul72laFwccZUUxzYGYCv7m9krZH9Qnjbr6s64W0ENbBIv88eXVGgDULxQWv7a2 buBGm79L+R33HLaPkRSWBv6b4HrSe+nY14LNCqYg5fkkog0fSp4cth4C8F8mlc80ohKHeJhY/OX G0JbLblbY9BZiGHbd5TC8nUAWW6nlv7MWhlrOOzQB0TmI8kXF9IyxrCGPDfFEZ3dS7+M6uvyBLM fIFZjRUDBmuHDu9D3ddqemzpOzUvok7sw00Qbu2TUKXUGYBhbxdrw0oLCXe5DGLXExN/bLQ+5WY qVyFI0o8kLU8iL7Rkwr4BQkaLABCYGrr/RmyEKNAUMZFnQOG3Cwvs/PUMvX80h3QUznCI7eO/Em cuUmDg6Gx3Wj5VjV9y/dBJU8BcPYESeb8TisgF+CqOGRE9evDLT9aj0Dw8ABWuUL2XDbsy2SB89 d/2csuUw5+gx7cC+l8LjDH7Ktim6b1ULPm/h8zQibZmzClpBns/sw4tuKiHeNx+7l1whPMABwHz TUftp12SoML2syw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556102359158500 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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556104; cv=none; d=zohomail.com; s=zohoarc; b=EaSt0iz18QKFX9jOVCwlXusRarVSTVcuIzHoboU3Cv56pne803plkFYHnbE7mdHDj9jb+fN5ApV4nP03g5svkTf4HH9F1ZGQjv0OhSdASXVQYh+odXg7MkcxESLyFEThTckIobtEIJVh4BVJvoyOkg9MpGz70oiq/DpBvmm/Ghs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556104; h=Content-Type:Content-Transfer-Encoding:Cc: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=LOyJnb0uqSS6qAas+Xp8CXQe/by4jXRhx7FT8g5r4effehbXyWJweaLUb+4Dkzg2hNcRGtjNVHpBDQfYxSV8DvsW0TerIqy1eU3n1DpDqry7W+SDTJngUn3w2AaL6b+5BPglLknLlo1MfohtN1HIe8v6cmrcgrHckH1eUlhOT2o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556104774681.4499489330678; Mon, 15 Jun 2026 13:41:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE4Z-00030a-3F; Mon, 15 Jun 2026 16:38: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 1wZE4X-0002xj-45 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE4V-0002FP-QX for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:16 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-102-E6wCXHy4PTSz_FeQEHhsDQ-1; Mon, 15 Jun 2026 16:38: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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C10D618004D8; Mon, 15 Jun 2026 20:38:10 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8340B180058F; Mon, 15 Jun 2026 20:38:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=UKq3HNd7Pt+W4V8HYnzpiWNRrhmshAgCaX9EyTgcdftLshOqfSO4Mi4fPb4V2qj/MHiX6J e6EMjKdDnOwvSBs6lvy6eh2nlvIrKnUpsibH7dQ3JFD/LNFB8/9mNKwnJiJ8CGro0TTUgP 8ONtOLoeEbaeobzyj/m+1ETOl4szenI= X-MC-Unique: E6wCXHy4PTSz_FeQEHhsDQ-1 X-Mimecast-MFC-AGG-ID: E6wCXHy4PTSz_FeQEHhsDQ_1781555890 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:31 +0400 Subject: [PATCH v2 05/53] 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: <20260616-qom-qapi-v2-5-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1009; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=S2BoGZEFYq/GkpuRjSxq1QDOG+49zZ+uxEpclFTvRGc=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKNBaMSdlzFvr3C+vLX1aeN5gsCGaVuTniyv 5EycleJukWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijQAKCRDa6OEJdZac 5cTED/4jry7KxNwWj4co4HuSTmaDmMfrNfJRiOq8GFBMbsZH2gKOeflMSj6Qum+w3HQPFnhkO1N yt0ujiBcNwcxpRbXeL+bnLqfi6ut4ZQOPzjTk0VCrdtXF1N02DrUbbx2B/YWd/06esziUen96Kh 9/xvIzgRdVDDLk+ByPrCN7mJiwI7vNOtmij0JBwl/wgHZVNm6i1f7+cJir+Gy1EM2QULF6yNu97 Y4hS7Uv1CN4X/UhtsWV/CnrUTXAZTQ3fTgYtPWgCj8gWU5iJlYOwQt0afbM5MyFdCX60+cxkGFA 8EpCO157VrJY6zsKmo2jrmdK8oD+S1zL+yUsZjV6hwaIM31xOBUYVFd0jO238lq4crccNkPhh23 DSmvJDkGRpwpelPR10EAgSTZieaRTB8tKfuTVa1fXMfbUtCdfEoNxixyKPib4pTFLtCMmWbP27V N98fuXdGLGFEqmfIGAieEsvNeXS0PWz7bAYG7MxGYH2pUe0KuucLp91sUJBpskx73UmViaEw4Ah Agt+iX215Xc9ZkPdhO6pbp6hNZAactO60/riLO2dFODgTFpmqwrRHjb+fhBtOoyJNhFfGgbMtUn ELl4FhoBfhi/1A1NWSw5hTXdHltObiL6+IDgTsR4a4J66FaaU5mzj7XSnbSkLLenWd/3PyTeiHl x6+oUvB2KLcJKFg== 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: 1781556106372158500 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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556114; cv=none; d=zohomail.com; s=zohoarc; b=Ytiq0KwdixC87n0peSutJ6gr5cR/HTj9cJkw8MMfd1g09GY123dNYydX+M6KFSYj5XB1v4z6jSnyrvEtoQCiFKDi1b0DHHRuVhqPmNA4IkHOUxagBn/zrSEGLnNCpHFVL0pmfqxOjl698q8LF+k3PxyAIdTstekFfH61h7qeDuk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556114; h=Content-Type:Content-Transfer-Encoding:Cc: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=eWe2C7Pb6pRexdg1t8s0ttquHBDazqLMtskp4qRUyOgpB/0MpYvEi3prNJMs0FMHAIi58ISct+38jN3wxDT8ZAl+7yl6fF2rBhrwbxcWoz0VWAFycWAdpUS5h9uTZKazO9Q2s9wPSfZvz6pELGGMSPR2pIpcRdKp9/tVKSp7Qvo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556114842646.0749776180404; Mon, 15 Jun 2026 13:41:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE4d-00033K-0F; Mon, 15 Jun 2026 16:38:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE4c-00032x-5e for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38: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 1wZE4a-0002GO-N3 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:21 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-380-LX-IQhroM7uun9Kor_yr_A-1; Mon, 15 Jun 2026 16:38:16 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A43701955D71; Mon, 15 Jun 2026 20:38:15 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 98A6030A8; Mon, 15 Jun 2026 20:38:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=haqI7wyK28I2Yu27OswLAE7tkbLb1crP2Fd8Az3yhuqYG21FDUjPIG49g6DPzRmo/qaAtQ D9TQt+ZbtjZu6pvoaJJVlcWZSP9GynG+Fw5JoPyyhii3Jbr1Mia9R4E7fhHkuLEc//l/pT OPqgj7H+109soiMgtxYvxAVWDR7Zi/4= X-MC-Unique: LX-IQhroM7uun9Kor_yr_A-1 X-Mimecast-MFC-AGG-ID: LX-IQhroM7uun9Kor_yr_A_1781555895 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:32 +0400 Subject: [PATCH v2 06/53] 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: <20260616-qom-qapi-v2-6-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=3553; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=cS7ulu1ICbMh1wDUayERuLbRYYPk58SNz3mbLGycoZU=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKNU/tOECvlixGbrSwe7WcE4rh5j0LgvMUK0 esd+jyslSCJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijQAKCRDa6OEJdZac 5UGBD/99xNBurF/5VshodU2JJAtIp02GK/btP3837Db070LTFPg/fDLj3DVRlAzmr2l1LLb0JZx eX8+GGMj3lUPPodab2TqsKZpynPSbnTJ2V9UO86TfYM4luLPIRPNbcDNWa6ihfof9ylfdTz9IOQ IEdbdXSIOGHJoPW/3M5ZdW7n+UGVj575dvXBMaJ7tfeIVGz9CPvMxAddy951jqFUQYr5rZ/cnRV rvF7XxFp8ZD/L/LCFpJxYWUL98CXSBA2elzJTzMq1tvVBX9ZTAPG+590umRNs1Xrv9djhQhwfE9 FVY2w8Q8HLzLzcsLXyEOMW7tn5F+92bVkDCPJzE6PYYEzVDZyaBY2TLU85tvmRSaZoI6Jmo75lD h5Pjf/OP5LQKoAVV2geq4A/iFCmMV8zqGNIASES6c/ls1jMxX/VkjQsUGZRi6e0TMSsr7b5kgg+ rGvo3vlqXLSA3QHjcF2Ip4AGlN/D6s9bHEorPj5uofi7TWwiPizslrGK/jY/yvxukzh/m8Oauiv FAP2HuD7OpGdEPPVqbqeiF4Xpq7wne9+uDkb7TqWkzA1DEC6oCn9iajc152ZVhYz8H1rCkFbYxZ b84aLt+t3mUmvH0ha1wSfOCZNbyy3LQWeOLcs75nR3c0a2sSIfuKbgYG1BmuglhYV2ZT5xlMHbD eMX43t8+SH0IEcw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556116414158500 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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781555966; cv=none; d=zohomail.com; s=zohoarc; b=FUAkjQPRyq77oZCyigWt4n9I18NR30OrtnuM55729Hwe80Cwfwr7ANea9qFIoFaVRjrNVjnhZWzCpR9K3dapeqRLizLHM/kFPZ9fU8R5isRJtO5CFZc54M5Blfl6ufdXdiPu6RdmcUKv/qDdiz660xd9rUfaJahI9nJWtfRhZh4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781555966; h=Content-Type:Content-Transfer-Encoding:Cc: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=iyOQAUddVNtmDatH7lxL3sxCN4XPHqwBQyPQsmq5+cM=; b=ZvhYhbCQS6DhExh3+DZgP5XLTkh+fqO9IKDPzami+T3VlIaubrbaxFbxeNvET2N0gA+6ol2TOmv1bqNHKs3ZvoM2XBU4x1/dtCARI/cEi/pbNShDeepC50WyKoIKBhPlsted2w9j3UXtFZ/mF156ftkYcFbnwQvQZ+ce4YgmKfY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781555966390283.03183471049806; Mon, 15 Jun 2026 13:39:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE4g-00034q-Rh; Mon, 15 Jun 2026 16:38:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE4f-00034G-CR for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE4e-0002Gi-04 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:25 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-629-XS1RV2gtMT2nR0UpR1kOEQ-1; Mon, 15 Jun 2026 16:38: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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 06A9A1956065; Mon, 15 Jun 2026 20:38:21 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BBEE6195419D; Mon, 15 Jun 2026 20:38:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iyOQAUddVNtmDatH7lxL3sxCN4XPHqwBQyPQsmq5+cM=; b=PNGgG8xS5pHrdEBCyvIxolbeYT3y32Hm5wM97wB4xMJs+MXh5R93By564eUcETylKpi9Kw Eeynthzj3xRhtKsvQ4AOlJ2/6BjdQ9nU5c2TIvGHy1mfAjVG+9jVVZTWRqlruKG4ezAxLB N0rQhhouKku3zN3wKGo9YcmQCzddbGo= X-MC-Unique: XS1RV2gtMT2nR0UpR1kOEQ-1 X-Mimecast-MFC-AGG-ID: XS1RV2gtMT2nR0UpR1kOEQ_1781555901 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:33 +0400 Subject: [PATCH v2 07/53] 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: <20260616-qom-qapi-v2-7-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1364; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=DdWuVZOt3ryTUGsa9/KXofVoIx7nhAY+BCfyooCOOxg=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKOTZlLU5gcthweMlXCoDt04ljsnXdob8/8O dPDaxd76k+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijgAKCRDa6OEJdZac 5STAD/9y4/sRXAMVtH3HvKLgE6P9Pc/h250bU4pJOH81bLU1fS2jXwqDt1bxvKXuwQt5yVg5gNB W+pQiv9JT00wsH/CEf0g1L56YWUuCUJ50FaOqIGWMy14o8X8HwU2lwrLHN7WOQYUYwFWOqHsThO 72wHpAdywey0U8pv9jaeDG5DJCzaeu81emCwx40tomRsNRqRWmBPE7B6Y8D7RjQWVBW9HfwW6ro aI0/f920t0YzUSg+rDhhUo6OICvA3gtYg5a46ha/z/wAMQnLIu4xCXA7YfNMDdUpyLwXNkM1pd5 3khV0vxjY1kDsVMY9M8k+PFNV5d9JE/lyZF9O/zRZCAf42DiQMAYIR92mz/DHnsRkEsiQiYFYOD RGimGDWwld983b3antE/mCQ4lcQTan0xsNX0zpU37bTPZuRwcYfcmzt1VpabDcZVESyJAhzEmit HthXUrTAfBDOR6JZCWysVgu0aK2PCFjxsyw6RodTttkFk/jeoM9ihnxsd/UCwsfXphdjWQAHx55 Ru0t6lMfewwDN7bbnx70auaUAjQ4uBde3ZuHqmyFUo1jbqnoZsGpJf7k5GYO6YX3XEx7PHnNs/3 lVVfbgbK4TPE2P/MKG/DynZmsLfIsJHpd2lsGcnATB9PWF4icQ8tR5mkRi9ia5wL7+0mdmYzRPH e1gleXtNf0nbyHA== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781555967757158500 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 11f55613fcd..d96a9afe21d 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 0ac201de4c1..a085e78557f 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2983,6 +2983,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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556103; cv=none; d=zohomail.com; s=zohoarc; b=n/1n8478k9KYeACErdEyRb2QU6y5lRnlfqZ4tY+09Z6qbwWQkQawl11Fu6mVUKkElcY16RtLBMDAOcCw9Ote78QCWpF3fUzZfRWceBZw5JotIZ3j9RdSlnFE5ipHDGXKAQVrifnGB61CE8Xzj+09RzVyeNySsfawHqi5abnC8oc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556103; h=Content-Type:Content-Transfer-Encoding:Cc: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=k6yZDR97ydrDjlLHFTYRB+QNKxZthh+Tl2u+yALtvgJe7XqBqHP9pEF8lx2XJ3Vff9Rz8wrj/y41vDbCBKYE5WSc7y3K3Mdb4XMH4ckZLBLlpaJ354ZlyBA342pYdfGgK1ScRC85rCbMUvjCcLLZeCPW9PIX0bQDpzRGOsZbWpc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556103662772.4121894701169; Mon, 15 Jun 2026 13:41:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE4o-0003CV-Hq; Mon, 15 Jun 2026 16:38: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 1wZE4m-0003BM-Aq for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:32 -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 1wZE4k-0002HO-Tp for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:32 -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-538-Jk1EO7zmODCYpvhLP684Ag-1; Mon, 15 Jun 2026 16:38:26 -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 C511619560B3; Mon, 15 Jun 2026 20:38:25 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D86F7180049F; Mon, 15 Jun 2026 20:38:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=fhJvc4o23amNpDtlnYTudOGSliyFHcU3S/0vPxJohAnfnA/gRsqmiLU4Z7JAuKQADiv+W3 KOISp+GlFJqyIp+Bmg+d4s9mmf1Stk9d/sM2i/zVTN4Te/2Gd+MQCyVDuUMr/w18XLfcEb UgMwv7UN9ykyTAvMKT+hQ2Vlklu6ZAQ= X-MC-Unique: Jk1EO7zmODCYpvhLP684Ag-1 X-Mimecast-MFC-AGG-ID: Jk1EO7zmODCYpvhLP684Ag_1781555905 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:34 +0400 Subject: [PATCH v2 08/53] 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: <20260616-qom-qapi-v2-8-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1867; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=l98NcHIYxcIgRoI9lT+AEGU4cey8Hr4xwKBBC+to5GQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKOyYTrKyfEqmrLB+Sb79rEj4qlPmzcKI4UQ 1Nt7FhFMQ2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijgAKCRDa6OEJdZac 5cq4EACWWySCz529dhE1qlmg69na1t7nQbHVSijr8LZagzISuMD6q9tfFop2yf5/gEddTXt0TBb P6xtekVDcFtFaf2V8SJgYowR8bsRRwx3cvvZ/WzQnNR4xFeTSzfI+pWUHSd1B1cwfIeSMB/OKeM x879AeCKBRg+TjpZ0ERExtFjLLB8IUYMR6kqa0QcJaV4pwGg9se7mK9tK49tAAg/KjQwHJRvXJi GTom+X2Qg1cHAUjfeylOi8we0I27QBWb3SWVEoAhPeFdepcxYzluOZHJ7/Si2c24h4ySnjyvRDA AHK448MbRO1FpV1zZSQqkfT24U7kxfBjUDGZrj5i2u4T9AjITDaBit6tykSp3MKLgaDSBpIXEG6 p5Pg9qwwgxmK6WIUDgkzW8UsHdsahb8GMfb+JTxS4gtDgVCL1dRhq56odnD3NLnLnSOiAQT0SDB wwV6EqNRItQFtd0SZcokbL4fHQL1FD9ZHuy3QIkO5BHDdNNtg7IdKoKhWtp6UgeUAC5VbnS6v3m e9AtWj8Vhj3ARQasJ3TWGh25tBNHdW6A9EVUnD/n9+G0Oi8826Df4ggvPE+fnQy695tHVHWEPwg xlMpwGJhCLRhgFu/jB/XgsKtmyp8sXJ+DNALgeM91sfoUvP40AKJalAB5U1d269TE0+lz+tgMPq MZ9+OCmRuzU/2aw== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556104374158500 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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781555942; cv=none; d=zohomail.com; s=zohoarc; b=fAPgTJitx4UI9s/qpbIgqbY8njL2Ali5jLqAVoe4vwNZuSK8ExZjbTvGVpKiLS8oNf+YkrLMCZB59/QB4tJ60h8oHwP9EiffZVLmSRSEwhBGr1YWh+H1oveGzf3DrAd8BCNNTETeWJao5i8Jw7vSP6tuR8iRuM4JbHvHVN4gHfo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781555942; h=Content-Type:Content-Transfer-Encoding:Cc: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=h7KI87SEwxAMEp187qmI+2fU28+8S4tBFvw6AeIJ4Q6qqlbc7XLLJVfigiITwXkEI6cSL/ZFLI+zMi31Tiske6tsmT5kCfojuEvRuMM9p2HfvnuTAnlzMbnVYqY4zdcFVG94a6DMG85SWXCi04ZyS+Wx9n8jf/6KCgW4ZsSRa6M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178155594262257.2807242716259; Mon, 15 Jun 2026 13:39:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE4t-0003L5-8V; Mon, 15 Jun 2026 16:38: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 1wZE4r-0003IZ-Rk for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE4q-0002I7-BG for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:37 -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-103-iSg_RFBgNKKJoe-LNs-xVw-1; Mon, 15 Jun 2026 16:38:32 -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 4679519560A6; Mon, 15 Jun 2026 20:38:31 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id ED3A13008B37; Mon, 15 Jun 2026 20:38:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=G7pQ9YM5DlubQKlWLrqVVTOTyO4WxQkBRgmOegkzU2REaCAG/qq9ibvHDzJDjwSzKXpTKC QxHQb+Hy6BjAboJwJeH7Xm0qERcQglpRy9XdxumT4t9Z3bmjOrMdK+R7myyXFgW9RIoZ4U rLVr62vGk5AvHZhwd2vhPDrHu6V4j2U= X-MC-Unique: iSg_RFBgNKKJoe-LNs-xVw-1 X-Mimecast-MFC-AGG-ID: iSg_RFBgNKKJoe-LNs-xVw_1781555911 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:35 +0400 Subject: [PATCH v2 09/53] 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: <20260616-qom-qapi-v2-9-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=3243; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=r+eXTVaOUCoKIvVLtys96ITsZDTbvm7APkbtzQtAcRk=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKOda2xEEyHTgaQJ82Tefoc8Hdw/tRnb0UdT hTnKE92SciJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijgAKCRDa6OEJdZac 5e7ZD/9cjyJMC+yIhsAlnYikNVXGKu1Wc3Qw5izh8YhBUX9uEkSHFauRIPD8F36sx40qYoZMt3N MUrgHurYhVBND9x5iGoi8iuVXv51rAosO4niqP+/dbX0pZAOdN9cfZMLvHspIlIrxQwmQK7s3uB HkArxWoaJ4OdAQ+6H4eg48VI8yUM8AlWqlTEwsMle7CugdETI8mma5+SaSzs4iiR+jSJ9S5Fb/1 HPSoA0ig1Lw7M6JDL4ZzDMXYqOFOUOVuJJHjIod2TL4gKoq8WKNof8Pb6V20aVZvaQ0JO7eRUDi sfOLRv4BqDE8Db6HPKenq0Dx0oj9AUbrUfljEkHJR6QR096287danr5aqcqtmcymevNqk9cOLyc Y0NOcxTJ8QSfqqYWZRwuHl6gHCQT1k8kuY79RvmAkI3Zz/QsIYR8kouYMGT+jzLWLqjE19xrGL2 fHWZ8DQYnDXoCOSYIwXx8eQQeq/zcnjDGG3kygnsWxNSA3pk27bSNeGUCPhlM9Hdu97WNaOuSOl WdmmzL/tofkqoknA4KFSrRAfi2JessaOFZ9B604Oo317zqfP/6NqpCrcFogVL6yzGhzJ86hqYDy Xnfi/8FIfmA4x1dZeeunJ9v+MnJkn4txYGIVXVl1X3Z0mLsg0FwR/KDywZM6jdUEH0gMF2NGB8e IKFmViJVoAMBT2g== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781555943485158500 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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781555926; cv=none; d=zohomail.com; s=zohoarc; b=iPyLsC37Dlnm9jO3g+0Yz5flOm4YcmrYxpUsI+dlWM5KOn9hGx+YXe9IWaAWBU6SIjzbjLoibrZwCHygBvf7QoioHCUwtc3gN6k7ZgCibEWP9SsRgac3Hb9OX7XWwmPx7v7vN2rAuXhUDsA205KuksVXaxjRpKdvvW762Bo5BlM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781555926; h=Content-Type:Content-Transfer-Encoding:Cc: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=MoUKEH3gnZh2AHlqJmyp/DbswGxCG7RiHkCtvRfiz+w=; b=EdoFa/K21zizWTYCbBM4WFhgSB1KAJIcjC+t3d2bHUlp6jYxETTYziJQCJx1e1DNAZBbkFZHKjdCOo6T+WML/kV3voQHSnc5m5dMsVUm60NXHluanagpmVkaJqIUHICNft7F3dozyX396GOUwmxOtSIS/hLENylSsJNWfNl9LeU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781555926142810.2940378166842; Mon, 15 Jun 2026 13:38:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE4y-0003oq-13; Mon, 15 Jun 2026 16:38: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 1wZE4w-0003hl-O2 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38: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 1wZE4u-0002IY-MI for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:42 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-28-yV5kHtNhPJ-LTUY8hWxIFw-1; Mon, 15 Jun 2026 16:38:37 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 80A251955F03; Mon, 15 Jun 2026 20:38:36 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4D4D4175F; Mon, 15 Jun 2026 20:38:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MoUKEH3gnZh2AHlqJmyp/DbswGxCG7RiHkCtvRfiz+w=; b=cKEPvJaENwDLU1RNRR6cN5hFwyWJZc7BkhqKjg2AZJQt5G+adqCWgSd7a/haaZtS3T0B4W uXx7N0xo5+lFukFq9JGbsvdpw9F8Hu9ZA/qyeOutj3Pk4s02z7mKlRTY7aktiIjR68OUEN hbBlAJdXQwKL1I9Oef6oBmnVmQSdEQM= X-MC-Unique: yV5kHtNhPJ-LTUY8hWxIFw-1 X-Mimecast-MFC-AGG-ID: yV5kHtNhPJ-LTUY8hWxIFw_1781555916 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:36 +0400 Subject: [PATCH v2 10/53] qom: add QAPI-aware property registration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260616-qom-qapi-v2-10-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=11038; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=nTO3Ini0MhAK38pzKixH6YsYP0a1QoyWP8p7LzxxFMU=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKOUYapivWo69HJo65rE8vn5WSBSnI+/h1tr o9CRLEeD1yJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijgAKCRDa6OEJdZac 5V0YEACtVLtuq/g2FNh/1cCsVCC2OKEh9vU6+hhLPgEMk+7kkJwJ2SbsJAvVfD9TMSy49pYUYks b52RuZBzvZIHRJh3Bnb55BpNUKO1sG752FCC92zLfw3dzurHhZVZuTk/OPIrAP1Aq3Ijs4YVlQ9 KALdbcfO5DHGjlP+1MNkMYkbsnrZe6ITSQQtkh7JTKYI03dFdjSrUvm/idGEIPGXZHMY+3Fr9p8 SkB1mBSZ2gIJiouJHnyI4fFvOvS2+O8By0QfjNz6O/vn8rCO2LJ8KSNvLinrQBUK20mBk0rIfLe woNl+5JksI1PyBiYDSZ+8WJ1tqAgLtmO5jesi7eopJYm4wcIcEXIWswHWarhxnfg5ikoh5St/wi nA+OQISpG5VZn+GzRphHJh9al3B/XK7nJdYZjaUi1wB0anDHj+MMUXxJ/csVwOLqO184EsPobm9 OPWfJSrMCQxf0A2M4TZoTUYrK8Z5RD5u3zVHZhgTw9F+4q2ZicSIun3J2VgoNMINeK6eUYhXxe6 dZ77wu043Dio6ZBh9Fa78Uee3CpfpaEvBm5xh/dZ5iFLWT+mABlzdbtfLYDsQXCE3S8FyCmStf8 jROAqGw7xQr0HXMPZvEVLt/Fr2enrnlda1+5o63JIiCH6H7Lr4EHvpKf56XkZO/6mbo15H09Tix ypbkaRGG0Hb70zQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781555927805158500 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 d96a9afe21d..ebfdbff9a94 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1223,6 +1223,15 @@ void object_property_set_default_bool(ObjectProperty= *prop, bool value); */ void object_property_set_default_str(ObjectProperty *prop, const char *val= ue); =20 +/** + * object_property_set_default_enum: + * @prop: the property to set + * @value: the value to be written to the property + * + * Set the property default value. + */ +void object_property_set_default_enum(ObjectProperty *prop, int value); + /** * object_property_set_default_list: * @prop: the property to set @@ -1915,6 +1924,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 that returns the current enum value as int, or -1 on error + * @set: setter that receives the enum value as int; %NULL for read-only p= rops + */ +typedef struct QapiEnumProp { + const char *name; + const char *description; + const int default_value; + const QAPITypeInfo *qapi_type; + int (*get)(Object *, Error **); + void (*set)(Object *, int, Error **); +} QapiEnumProp; + +#define QAPI_ENUM_PROP(...) ({ \ + static const QapiEnumProp _prop =3D { = \ + .default_value =3D -1, __VA_ARGS__ = \ + }; \ + &_prop; }) + +/** + * object_property_add_qapi_enum: + * @obj: the object to add a property to + * @prop: property descriptor + * + * Add an enum property with QAPI type association. + * + * Use the QAPI_ENUM_PROP() macro to construct the property descriptor + * inline. If .default_value is not set, the property is not initialized + * (default_value is -1). Otherwise, the setter is called with + * default_value during object instance init. + * + * Example:: + * + * object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + * .name =3D "policy", + * .description =3D "Set the NUMA policy", + * .default_value =3D HOST_MEM_POLICY_DEFAULT, + * .qapi_type =3D &HostMemPolicy_type_info, + * .get =3D my_get_policy, + * .set =3D my_set_policy, + * )); + * + * Returns: The newly added property on success, or %NULL on failure. + */ +ObjectProperty * +object_property_add_qapi_enum(Object *obj, const QapiEnumProp *prop); + +ObjectProperty * +object_class_property_add_qapi_enum(ObjectClass *klass, const QapiEnumProp= *prop); + +/** + * object_property_add_qapi: + * @obj: the object to add a property to + * @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 a085e78557f..e5e2f09a0a2 100644 --- a/qom/object.c +++ b/qom/object.c @@ -24,6 +24,7 @@ #include "qapi/forward-visitor.h" #include "qapi/qapi-builtin-visit.h" #include "qobject/qdict.h" +#include "qapi/qapi-type-info.h" #include "qobject/qjson.h" #include "qemu/id.h" #include "qapi/qmp/qerror.h" @@ -1717,6 +1718,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())); @@ -1775,7 +1785,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; @@ -1788,14 +1797,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; @@ -2598,6 +2610,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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556079; cv=none; d=zohomail.com; s=zohoarc; b=gb7bFPHq7/L0ycmZCXkPj1Nhx+3ohHXRLQk4sFkuOhnHT4tv33uHRsRWGFEN4v0T08YrgUGLyPfemolp031KfFNJ5cAoWhX1pgrUlmzlC+K2qMdLVHvB1o1BN556aAZ3UfKfoA6SqKuC43UDXneShhv2CzozpRCn9cYET7ZJcQo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556079; h=Content-Type:Content-Transfer-Encoding:Cc: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=OIJ8wiYX4hBouo8bMRvFFBAm62qqOG8BUT4dNTuI/gk=; b=QOrxGav4k8owIKU4Up5peS0GYm0hCRvNxkzti7w56gAOR2jSQ+EQWPE83DOEBMRAQcQt5h8Tre3qLMkd0geaeXcJILUsAglduT0/ptNtFjvDQGM9vRj2azVdreOV7Rp5wBFRwQcxJfaC0NVn/nKTbJL/hXwMg7U+rBx6s951IF0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556079077333.27632399524396; Mon, 15 Jun 2026 13:41:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE54-0004Ah-NU; Mon, 15 Jun 2026 16:38:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE4z-0003vV-WB for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE4y-0002J9-Eg for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:45 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-330-CI8rW7muNGm6n6lViQkP-A-1; Mon, 15 Jun 2026 16:38:42 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AC83F19560AD; Mon, 15 Jun 2026 20:38:41 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 70D49195419D; Mon, 15 Jun 2026 20:38:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OIJ8wiYX4hBouo8bMRvFFBAm62qqOG8BUT4dNTuI/gk=; b=R8CX9eET2v6gPH+Wt8v82kr45Gw/1hbYb4JiJbutPvbhpfDAnDM/QOohBoxKEpMNEid8YA /lVRuYpOOkD6MZAofQl+LF+rgTkILqYnrbuB+ZOXFVPuDM3C1owpy0JSSH+EVlQxGI4JFA HLJgQTDwXWG8jS21NigBAEbGl9HU4RA= X-MC-Unique: CI8rW7muNGm6n6lViQkP-A-1 X-Mimecast-MFC-AGG-ID: CI8rW7muNGm6n6lViQkP-A_1781555921 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:37 +0400 Subject: [PATCH v2 11/53] 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: <20260616-qom-qapi-v2-11-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=5561; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=oM1MtOJQd4L/PsvmfXXNV0ZRzHil2m7HqwwICsFzsrU=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKODpWcZSTD47f4q2AkSejXiGdjWTLiqkXYg AldVQnyztOJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijgAKCRDa6OEJdZac 5d/2EACk9Lsytp4SJP/mO/XV5ABHAzIh4/uS/ETwSm/jLZQ3z7OTb73rwp0tJs6oV/wwzPop4GX vhgkVEqrNCeAd8qXt0xOz537hPvjFnGsOk5JAoeOhWznhmc8cWY5NoLCVI6k4EzNblZ22y/nM2I JXwNd/gstteqwkt5FUOHJSDlBAyiqvrjIeEX+f/QHbZ4uePc8BagV8Bky6Ys+J1x7i/K4ut1n1v Z10XJcbfqu2JJOxdjJw0wwrZjWE+ecpPEFs8/L8lSMiUALTuP6mxphGnbFa8YFYD34C6y5AjZFb 1ZI7aYphYJGX7MxNqOKDSlkTXE/QTutcLbPOUq6iEz0apRdBmwnJsqvYVfZK9KHBSArJ1L63kHm +ebBzPAXX+cs39ZAHZwy/Ga8arw7//SLFtju35fhvU8li1x16u6bw/fBvGQuEQA+ig6gtw8+QZ2 SIgv4R0cXN0Kq04KuiSyWVQIg9qADqPqJke+SRUUsbdPNpQpPFs44+1jrqz8p1uavQxvt96Dy5T Vr79FT5ujmSdGK1fFwkLFvhCTsyqNzCkFz1F0a000/CSn/GRDi96xb7n8eULOFoM49ybpl1N+jz IwSULj0XKE7TxzcRJoU3WnoOz12FFW1Z3xfHAVmI0dI5Naj5BuhrwSc2lUlpn7+G5KESuGpSYtQ r0SMpJS0UDfr5nw== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556080296158500 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 89de92b7d91..b053237f0b2 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 @@ -703,6 +715,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); @@ -727,6 +787,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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556086; cv=none; d=zohomail.com; s=zohoarc; b=WzPR3K8Svw99rgvg2jHgld8zcxLSd14fXe3Z12Zy6ZDIHwN+FnHZGJBJw4ZmH4a2Ru5NiPDKxUXH2rIZGHRKd6eeIYNjjq5ZCyou68VmA0NU4WiEtxcQhkjENyVn1j96m6NVIIY/48Q/vb9Orxr75DDwsOGapAFPd1nHHmZ/Pxg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556086; h=Content-Type:Content-Transfer-Encoding:Cc: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=DuDRW6V+aWzKlJuNxqSfmtV/QT53trqII/zulWui71g=; b=M2HNPqodBb+H68fQN+FRsdWAM7+z1vM+5lzU7EcCuNlfNM6Hh/7JNvotHrDUckwmzFmTccBt57Ee/H9NNX0irle1LdzoaZX3gid1NXnsB5kV0hBgzJzYzVZ4WNk0k6bZ5/yupcZK1WGcthsxIHsBZglDeaHCfVBJ9D90uZHkOms= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556086385821.3964326125117; Mon, 15 Jun 2026 13:41:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE5C-0004gc-87; Mon, 15 Jun 2026 16:38:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE59-0004Qq-Mt for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:55 -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 1wZE57-0002Jc-AJ for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:55 -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-154-cmAT4Iw7P46kZ81oNyZaaQ-1; Mon, 15 Jun 2026 16:38:48 -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 36ECF195608E; Mon, 15 Jun 2026 20:38:47 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A533619560B2; Mon, 15 Jun 2026 20:38:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DuDRW6V+aWzKlJuNxqSfmtV/QT53trqII/zulWui71g=; b=YVFh5mvOKJ4lP1Ul9uClwKaFC6MTnRsmth9UTzlcCU3dUDl+lfm9konHCQOLtb7BpKYGO3 yeZQu5RsxltbZMD0ZGN2n/X8nX7Hqy2WR+lblfbBSRHyr7oJTjesZkQIFin3UZ1OBX6VFG y9qX7Y+LFyJtr1nJo7j9Qkc4DagdFBE= X-MC-Unique: cmAT4Iw7P46kZ81oNyZaaQ-1 X-Mimecast-MFC-AGG-ID: cmAT4Iw7P46kZ81oNyZaaQ_1781555927 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:38 +0400 Subject: [PATCH v2 12/53] 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: <20260616-qom-qapi-v2-12-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=18173; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=EKTLk9xasxbVdTFQRFQCLxASDX1dmN60PxBcWGsOCO8=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKObeXy9QIvMwe0iqHFAI8JZTnNpRTRGUn4p nWZt2ly/V2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijgAKCRDa6OEJdZac 5TnEEACvuzaNNymF3OSIThnVlgJEIor1o8b3cIImsK5MuGxi2K8psxa3N0e+F9+1RKAL4m80TmY /BPlTxjrugn4EOZKWcJquq2w4FaQLwefflBw0s7ghyZNWd5T6bHeeOi9/3qiopA+MT1dBVCpw+3 c8+kqKM9k55VSQN2A+2tDqfyDK5NxzisO+6X3fFK49dLI4E38mwbMatQTOy1JjqQ7AqZmTqMIM0 8GgU8Vz3W1JgNgrs8Eeizl2X2bmdLO5v8OZalYdIVgA4sK2cuaYl40OP0mS1wViWI8q7F4uHLWK LeqwrFW8DuLJQAB/dTtq1G3nSpsCSYdpXyDuaCKEFIvHnGkSUqeCqMNkQ0V2N3TG0CWK/SFNqM5 bI0qkWdSPQe+ucSLwjrFwZENAX5QnIZt4s2IKQLlR1ie2YTxb+i2R00tbZi+AV/N3o40P8mIz8X fN+GItvBizyZ7g5CXSjwLMae6Z+/SCEstA0ADiqEdVvWZyrFTRTm75p0w6gMOskqXTShPw3jNLz SXqYkzkp8VQNqfRtnVuX3YgPSz8HnqbPkICXGqO+YKwNwXCeu51MQmGE57IgSil3yQzetsCft54 o0jogNmG3sQ0CEOaFtFdpz3diBmiT4MYl2ghBEZO1KmuWM8Dq/c8jUuaRUy8M7vDTc1nQ6+/ohS V1QaZXVn8gv0y3A== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556088501158500 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 --- include/chardev/char.h | 8 -------- 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/console-vc.c | 8 +++++++- ui/dbus.c | 18 ++++++++++++++---- ui/input-linux.c | 11 +++++++---- 12 files changed, 105 insertions(+), 68 deletions(-) diff --git a/include/chardev/char.h b/include/chardev/char.h index 7377d8e60a0..f5e53b3867a 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -343,12 +343,4 @@ static void set_encoding(Object *obj, int value, Error= **errp) \ cast_func(obj)->encoding =3D value; \ } =20 -static inline void chardev_vc_add_encoding_prop(ObjectClass *oc, - int (*get)(Object *, Error **), - void (*set)(Object *, int, Error **)) -{ - object_class_property_add_enum(oc, "encoding", "ChardevVCEncoding", - &ChardevVCEncoding_lookup, get, set); -} - #endif diff --git a/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 389f3b0bfef..79883af22a5 100644 --- a/net/filter.c +++ b/net/filter.c @@ -8,6 +8,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qmp/qerror.h" #include "qemu/error-report.h" =20 @@ -342,9 +343,12 @@ static void netfilter_class_init(ObjectClass *oc, cons= t void *data) =20 object_class_property_add_str(oc, "netdev", netfilter_get_netdev_id, netfilter_set_n= etdev_id); - object_class_property_add_enum(oc, "queue", "NetFilterDirection", - &NetFilterDirection_lookup, - netfilter_get_direction, netfilter_set_= direction); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "queue", + .qapi_type =3D &NetFilterDirection_type_info, + .get =3D netfilter_get_direction, + .set =3D netfilter_set_direction, + )); object_class_property_add_str(oc, "status", netfilter_get_status, netfilter_set_stat= us); object_class_property_add_str(oc, "position", diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 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/console-vc.c b/ui/console-vc.c index 828e78c41ea..286b39fe8ae 100644 --- a/ui/console-vc.c +++ b/ui/console-vc.c @@ -6,6 +6,7 @@ =20 #include "chardev/char.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-char.h" #include "qemu/option.h" #include "qemu/queue.h" #include "qom/compat-properties.h" @@ -317,7 +318,12 @@ static void char_vc_class_init(ObjectClass *oc, const = void *data) cc->supports_size_opts =3D true; cc->supports_encoding_opts =3D true; =20 - chardev_vc_add_encoding_prop(oc, get_encoding, set_encoding); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "encoding", + .qapi_type =3D &ChardevVCEncoding_type_info, + .get =3D get_encoding, + .set =3D set_encoding, + )); } =20 static void char_vc_init(Object *obj) diff --git a/ui/dbus.c b/ui/dbus.c index e02a94df2f3..ce3e1ad0055 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -38,6 +38,8 @@ #include "qemu/audio.h" #include "audio/audio_int.h" /* FIXME: use QOM dynamic cast instead of drv= ->name */ #include "qapi/error.h" +#include "qapi/qapi-type-infos-char.h" +#include "qapi/qapi-type-infos-ui.h" #include "trace.h" =20 #include "dbus.h" @@ -449,9 +451,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" @@ -543,7 +548,12 @@ dbus_vc_class_init(ObjectClass *oc, const void *data) cc->chr_open =3D dbus_vc_open; cc->supports_encoding_opts =3D true; =20 - chardev_vc_add_encoding_prop(oc, get_encoding, set_encoding); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "encoding", + .qapi_type =3D &ChardevVCEncoding_type_info, + .get =3D get_encoding, + .set =3D set_encoding, + )); } =20 static void diff --git a/ui/input-linux.c b/ui/input-linux.c index f4eee1ffd7e..715d1f58929 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -6,6 +6,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-common.h" #include "qemu/config-file.h" #include "qemu/main-loop.h" #include "qemu/module.h" @@ -506,10 +507,12 @@ static void input_linux_class_init(ObjectClass *oc, c= onst void *data) object_class_property_add_bool(oc, "repeat", input_linux_get_repeat, input_linux_set_repeat); - object_class_property_add_enum(oc, "grab-toggle", "GrabToggleKeys", - &GrabToggleKeys_lookup, - input_linux_get_grab_toggle, - input_linux_set_grab_toggle); + object_class_property_add_qapi_enum(oc, QAPI_ENUM_PROP( + .name =3D "grab-toggle", + .qapi_type =3D &GrabToggleKeys_type_info, + .get =3D input_linux_get_grab_toggle, + .set =3D input_linux_set_grab_toggle, + )); } =20 static const TypeInfo input_linux_info =3D { --=20 2.54.0 From nobody Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781555958; cv=none; d=zohomail.com; s=zohoarc; b=KLFQwOMtqAENpN/MK78WqxoQgqXxR91Oq9QJ1bRE8ccbWZSWZVZWIIgy/EoeW+G2kWGfg8CBJFp/xJRHcJftdUSETNS7aECb8kObV4C0Fql60WcmVhbKZ5w0Xw5G1StlyXBuEWAYGrRov3Jtvr3LMQCZHF3ifSQyF/6jsCuPH5w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781555958; h=Content-Type:Content-Transfer-Encoding:Cc: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=P9QlbbdOYQCcI2YItnjsPTMcvIqr508sLt5xiZsAmv0=; b=G02DnOeD/LqGiKPN/D3ZcOOSALvqdJNMHhUE64NFB9VWYfnmqvxOtcuCQ17ps55DsvK8TcIr5942L3kSI50Y1u9UfBvHhPlhdlgO9BTVuMDCEwloVQie96sfDSWnpppI2C7gFZ92AvitIhWqeoTpXeyvTSA0JmYMGzSDjbx+bQo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781555958094995.834974014423; Mon, 15 Jun 2026 13:39:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE5F-0004pq-5L; Mon, 15 Jun 2026 16:39:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE5B-0004fu-LH for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE59-0002Jr-RF for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:38:57 -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-500-kVxluq7RMziJBQvXuUzaag-1; Mon, 15 Jun 2026 16:38:53 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 23E891956067; Mon, 15 Jun 2026 20:38:52 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DACCD3008B37; Mon, 15 Jun 2026 20:38:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P9QlbbdOYQCcI2YItnjsPTMcvIqr508sLt5xiZsAmv0=; b=gdzUuJI/mtypg5KbaDAdbtBULDoehOvBVdHzwXdeVYmLLamnCZgolOBDLodWQiES/DJT5J XDQKAmCEk/rMPUlUiw4mNTgzE5VHrEWOXSGLJm/t1LrYPqS/+09QPisJmXtehbnNtzmHx7 JBd183x/KJdarXL1kV5W08DOeC9zGB4= X-MC-Unique: kVxluq7RMziJBQvXuUzaag-1 X-Mimecast-MFC-AGG-ID: kVxluq7RMziJBQvXuUzaag_1781555932 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:39 +0400 Subject: [PATCH v2 13/53] 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: <20260616-qom-qapi-v2-13-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=7006; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=jvt2N7853ZAZdS40i/AdDe2545eEYC74FdiyRnRc2PA=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKOzZ+oO1HlwgWeqiacob07aAtnrjDcqXGFW Po6hFA/GBeJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijgAKCRDa6OEJdZac 5TDhD/9n9xC3KdQFl6cbUFi7P6LpfNqmPqyrOFS5y0lFAZJ7qO+pJr2rTrDv38gl4MYyvq8mNUo ThNZdI4Peka/yqpbSWbpgk6u7PDCrjQNpLlfwurDoWanJ9V5AVtJzKwK5CdIjfggIB7jyRIgENE zA92tR/ax0XitOfBt1/L1sBtM8jjOSsqrwa9KS+Cqt1PhsVL8TxLKeY4VZwSg6IRsX5oJJRgVER uNc7QJ5OhktBnoj+ADG2uAecfuRZlQyVJyuE7w/aDxGKvAomuE/yn9aRcUb0Td5/RtgdWomrrqC FVDzjeIIUeXAw+QqLHc/6J00k67+YagH7R05lyujZCoP5f7jUKYBZmHtDsPgseopYC+/xQxXc3N 8zRfodBNLXklxZqVOVvdkDAK8PSjfEA4ZIk7mx9QrSq9h9LjRVY4uxdwtvmVM7hSNOOvnX0cHDt BZKPFai7wtbPOEipZmuURL0iRMzH402OaM74J/fgyZ7oHrsIekEexnVO2JPUj0CNzYJo7p4atSk UPPWeRZMqcg2j+yZJNaPR3GtuWBKJGEZ//lJ8eUpMm8ZekzQ2PtOpG3IW0EkpxKzxpQxFriJF4z 3PK2+JCTPS84JoMzRGOEHC91RUfM8tYvLOOvlXZ730oPXTtUmIHB4t1ayWKsRkzsCc/04MITSdp i0QzHs2h9JMxg/w== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781555959639158500 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 ebfdbff9a94..0b2089bb9ac 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1660,12 +1660,12 @@ char *object_get_canonical_path(const Object *obj); * because it was ambiguous, or %NULL. Set to %false on success. * * There are two types of supported paths--absolute paths and partial path= s. - *=20 + * * Absolute paths are derived from the root object and can follow child<> = or * link<> properties. Since they can follow link<> properties, they can be * arbitrarily long. Absolute paths look like absolute filenames and are * prefixed with a leading slash. - *=20 + * * Partial paths look like relative filenames. They do not begin with a * prefix. The matching rules for partial paths are subtle but designed t= o make * specifying objects easy. At each level of the composition tree, the pa= rtial @@ -1897,33 +1897,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 e5e2f09a0a2..1a3e224ea2c 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1219,7 +1219,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; } @@ -1773,12 +1773,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) { @@ -1802,12 +1796,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; @@ -2542,74 +2532,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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556247; cv=none; d=zohomail.com; s=zohoarc; b=ZpqnH9Y68uBAu0TT4bfkG+lurv6zsBFqfgE2k6v4nSc+yF8ILvW/RekT9QL1gIv3Tce8fzcS3eBoVgk+4KWv53tPdRUVLYCxLdIeDZWXhAbMaV0knCA+uTsusEk4BcvAdTNWyoxSnrZ5dknonlNaNbUB++Bs6h5Fr1AM/tLytT0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556247; h=Content-Type:Content-Transfer-Encoding:Cc: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=D/2czgj8V+QZCutRsWOfW0AAK7YEOkrYNi4fx26tcRA=; b=liQzBmh5C33EJ6pcJrkWJ7UmnVvIWxmUjbTgIwL54Hf8GSriUdEnDMshAudaE8eNcmlBnTFdvurK1SoW8+9rAIl1a9ZIjn4xDkjIJNGF7PETPQ26nwr61SLsNSo2qtCR0VbXcVRgwO2Ame6nLg+isgmQD01pqF1s9Dru3nrD/oU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178155624705037.09477293116515; Mon, 15 Jun 2026 13:44:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE5V-0005Lp-9A; Mon, 15 Jun 2026 16:39: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 1wZE5G-0004yo-SL for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE5E-0002LH-JZ for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39:02 -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-611-YjDBuVDhPraDDXWtKemL1A-1; Mon, 15 Jun 2026 16:38:58 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 50C3B1800603; Mon, 15 Jun 2026 20:38:57 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1F03519560B2; Mon, 15 Jun 2026 20:38:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D/2czgj8V+QZCutRsWOfW0AAK7YEOkrYNi4fx26tcRA=; b=E2NUViNU+h+NkUjo/OlggD0buOYoeG70tN0UsrqdOp0N4nTHAhDYY32+cBc/IiWEF4D/SZ nP0ogle/D7Wn2mLo254/qJBoGzRDIAfeeEZHQ/edJRi3QKthS5MynE+SYmH6PS1K+61Qgx ogoUpnpmVXzY68LmYypgni5u8QzsDuc= X-MC-Unique: YjDBuVDhPraDDXWtKemL1A-1 X-Mimecast-MFC-AGG-ID: YjDBuVDhPraDDXWtKemL1A_1781555937 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:40 +0400 Subject: [PATCH v2 14/53] 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: <20260616-qom-qapi-v2-14-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=11042; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=9VaCiFvveeXzrcKlgqYXF2Rp/FPcyYb2NXmRgCsiNcQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKOIcikhNb9VAkEhE64YN04Vuotv+GbjVzDo 2kmqWjifO6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijgAKCRDa6OEJdZac 5XvKD/9nVOevUX1YyoQIIO7bPz0CtB6sQDP2l15bGE8oPkNggDntc1AzZAxo2Ey+9GsvvzutOd1 OW+iNN/ua21WZhTJ8Qj6xw9NmqYBCLRLOBVCVQr9Tk1qddgX/dfDF5agytPh1nhUHNf7FgeOxVn 1C4CEO3dz9go28vm7UYl3FKAaqKdQDbrcv5MCrtrMGFs7Pf/9Mg1s83JxNQCe8FBgCXnj6FGSbt 4VlLDoxaXWLPMNC1SaQ/4GU/ltV9LYCDx/RvaLwbbUCOeLNLJv4nsA9tnnrZcsp9oeCN8BPzJPy MHx+hUUOIvQZ4+UXa1cw5MsKacyQcxpUJGAYXX+nFIZUD42ZjEmZR+13pRoeXw+aPHWOYYtxUA7 amNAtoREqAvgH4ZiAnjjmfcqgpByKB0wENTOH1yFH8FbdporsxqTcnczftc3xnmopYS87V2m1mV hycVAcvjw8BF15ZcSsjlbePjTT4+0kTxjfBi1cGihv8EKM6gLAjuL4w9d3Yz1a3Kb3eEn3e1QC5 VODB0zS9eMhxKteL7WIMgn/oF/uUMDlz6+AhjdhIX4tP2TW0hxLjBMzr9AoRU9+BXnl1K+P+dES 5vvzZSCwIP6CAkDA+2byMSZOjVJ7cgtjdtlw7OBJVQAvCvu/qN/uV7pse01rdRWunVeYbK7NKrp ow/gQxIguGktY1Q== 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556249247158500 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 b629575fcf8..99173d9f3e6 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -31,6 +31,7 @@ #include "qemu/option.h" #include "qapi/error.h" #include "qapi/clone-visitor.h" +#include "qapi/qapi-type-infos-sockets.h" #include "qapi/qapi-visit-sockets.h" #include "qemu/yank.h" #include "trace.h" @@ -1573,7 +1574,7 @@ static void char_socket_class_init(ObjectClass *oc, c= onst void *data) cc->chr_listener_cleanup =3D tcp_chr_listener_cleanup; cc->chr_get_filename =3D tcp_chr_get_filename; =20 - object_class_property_add(oc, "addr", "SocketAddress", + object_class_property_add_qapi(oc, "addr", &SocketAddress_type_info, char_socket_get_addr, NULL, NULL, NULL); =20 diff --git a/hw/core/machine.c b/hw/core/machine.c index 4d8b15d99e9..e3075592673 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" @@ -1098,19 +1099,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"); @@ -1192,7 +1194,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 87fa7b65722..229b2d1dcd2 100644 --- a/hw/remote/vfio-user-obj.c +++ b/hw/remote/vfio-user-obj.c @@ -47,6 +47,7 @@ #include "hw/core/boards.h" #include "hw/remote/machine.h" #include "qapi/error.h" +#include "qapi/qapi-type-infos-sockets.h" #include "qapi/qapi-visit-sockets.h" #include "qapi/qapi-events-misc.h" #include "qemu/notify.h" @@ -931,8 +932,8 @@ static void vfu_object_class_init(ObjectClass *klass, c= onst void *data) =20 k->nr_devs =3D 0; =20 - object_class_property_add(klass, "socket", "SocketAddress", NULL, - vfu_object_set_socket, NULL, NULL); + object_class_property_add_qapi(klass, "socket", &SocketAddress_type_in= fo, + NULL, vfu_object_set_socket, NULL, NULL); object_class_property_set_description(klass, "socket", "SocketAddress " "(ex: type=3Dunix,path=3D/tmp/so= ck). " diff --git a/hw/vfio-user/pci.c b/hw/vfio-user/pci.c index e7573d4a9f0..246bd5a9092 100644 --- a/hw/vfio-user/pci.c +++ b/hw/vfio-user/pci.c @@ -8,6 +8,7 @@ =20 #include "qemu/osdep.h" #include +#include "qapi/qapi-type-infos-sockets.h" #include "qapi-visit-sockets.h" #include "qemu/error-report.h" =20 @@ -466,8 +467,8 @@ static void vfio_user_pci_class_init(ObjectClass *klass= , const void *data) device_class_set_legacy_reset(dc, vfio_user_pci_reset); device_class_set_props(dc, vfio_user_pci_properties); =20 - object_class_property_add(klass, "socket", "SocketAddress", NULL, - vfio_user_pci_set_socket, NULL, NULL); + object_class_property_add_qapi(klass, "socket", &SocketAddress_type_in= fo, + NULL, vfio_user_pci_set_socket, NULL, NULL); object_class_property_set_description(klass, "socket", "SocketAddress (UNIX sockets onl= y)"); =20 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 8929a75c7c9..3f0d8d8f1e8 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 df46fce7693..675f9ccdaf9 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 cc9685221ae..4c2a91d0ff5 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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556167; cv=none; d=zohomail.com; s=zohoarc; b=k11/LjtPFozn0p1Cb1q7Q21anAFEiKbJa4dInw1KrtwkZq+7/ou12PQAdMUrN+U68ik1HKxXZ27hhnh4bC8J6hSMMj7L4/yWpcow2fmOmaNeUnr3yLe5V2lR03YAjrfo0UpJJwM3/SHMoPTy439OXPdaXxKY9Qd6V9x3fnGJe/E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556167; h=Content-Type:Content-Transfer-Encoding:Cc: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=P9t+8OD8mc9U4J3hIUksQfCAInEU186x0pB7pHCtHw2aWbH58JrS/RKyjG0yES/QiQR3l6RMR5512/DUVO+20OOhVOF4xYFoxivcxvwgA3SvolWJxwzuez0TP6xBCdn82PJmgdcvAc/BhZnnE8bvEqVfLY8Yn3js0muTqM7V/I0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556167787431.1373779622428; Mon, 15 Jun 2026 13:42:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE5X-0005eT-2V; Mon, 15 Jun 2026 16:39: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 1wZE5R-00056t-ND for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39: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 1wZE5L-0002TG-Qu for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39: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-43-44cY4LPuP8SbO083Ow4a1w-1; Mon, 15 Jun 2026 16:39:03 -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 69BDE19560B0; Mon, 15 Jun 2026 20:39:02 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 33F3119560B2; Mon, 15 Jun 2026 20:39:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=HjhyF59+dxTMxLtyDvGGRQow2S3wDpf8ZK2cmtJMB+50qGnYBzDZ+TqP8IA6WW2IuLGPIt nXhMs4Y1ZDtJLP8lJPqpbJJhiKqkQJR7XxGwMTEcUZT2y62yaer46gX7RPOHps0IGHFu12 Eup0hogKems4jyGZijBDkVPwOa3FKxA= X-MC-Unique: 44cY4LPuP8SbO083Ow4a1w-1 X-Mimecast-MFC-AGG-ID: 44cY4LPuP8SbO083Ow4a1w_1781555942 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:41 +0400 Subject: [PATCH v2 15/53] 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: <20260616-qom-qapi-v2-15-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1701; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=SrT2x1EQeUZfUkznMNB+UxE+epWiRHNKJ0FEXJcLuWE=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKO2u+RiTL67Ly9IXbxwEJCzQ0+wg/uqAFbl 0K/yNXEabCJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijgAKCRDa6OEJdZac 5Wm4D/9p5+vor6Vg7jzySD5ulCCHGUfnu6D0pOT9/4TDPmdYIdwVu1+gj3GImQbwGbergvRny7A +NdBo10xVVyNwVl6knviad/wZBBRINAVQTSC4e5h3gwSUXUNkjjGenP7uFnZfcQnEwuewXgirWc 3MFLd2YSUJlrORnBJC/yAmDlQlTj+fPcDG+zeoVMkWzpEWupM330m488Rx0GtDadv/4UmV/Zd79 gpK1NrZ/ex4LF+DoUJmB0zj8h2XM8sU+/P8wlhzkRmkZSG1G3Ze+WWmtzCKBI2GO++mNCXyq70F v4+ZsMOgDo4j0Fkf9N9CZfiwTk4qiOlQs+WENGkzUFsBIPR+tRvza67nxB3oNTOzhnp9ek/z2Ij TRl7CbAb5EntrTIatPXC/52a39NBn5j2bfPCLhFcXEtBpUpPMc7/eWuIVp8dgRS9OnE5JyC65HJ H0Fs6JHlVawYSCmgE4pGUl3QVRZ5WfFxWfUiA2REnLBg2LsCecE6Nfu5XW8RYI/Cx5p3NpY/OsG X8Wz8HwzpHNaJL8PM7T/dYQWJnw4bhzgSUrvG2YvMP6DRanvIuGhXIyvq/35tU/UiLDOf9EaeTt xMPHx1dmXMMh8DwaiJW3c2X+AohII+xh2AJ4TjarCY1YLQS8051fY0jlfbrTuOX9lEc05ibWYe6 3eKOkn9xo0/cerA== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556168783158500 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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556140; cv=none; d=zohomail.com; s=zohoarc; b=ZlKCFTSZSjslVN52Tx2RtCkpnDqmNTRenZbwVYUv4MtjdECJA9tKYv9g26MRUYNTyRc6nNeMrVpKH8GzxlZQqHh/DHC9QEKqk38hAJfD4ivwnIJwmuLsmnykLLzVAnzk+iFE7r1oC10lK1ZxcuRtG8qDx7KgZzHsr72Ej3Sr6+Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556140; h=Content-Type:Content-Transfer-Encoding:Cc: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=ZAvsi/ypZkY9bYTYXMYdE8m2fARyesQx7GcFiTarqNA=; b=dvxJx9YFWUVElztmHtSTq32A8w8ulZyFwOld5M5izyzDXCnlWhdfNjXF+4KYlF+aPCqlxYNM4sCtrPdm/z2a4eZd0k2QWZa8AiY479FpaAQLeLZ6/cX73LsLgM5NfBK5EPiVI+fdNEkASlRSmlgobds/mRv80UaWFDRmKr6Rp58= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556140207327.38437791943204; Mon, 15 Jun 2026 13:42:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE5W-0005Vs-2W; Mon, 15 Jun 2026 16:39: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 1wZE5T-0005B3-Ob for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39:15 -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 1wZE5P-0002UF-HN for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39:14 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-638-JBfSN67hNjeGkI0b95f1GA-1; Mon, 15 Jun 2026 16:39:08 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A71EC1800BD4; Mon, 15 Jun 2026 20:39:07 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6ADB7175F; Mon, 15 Jun 2026 20:39:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZAvsi/ypZkY9bYTYXMYdE8m2fARyesQx7GcFiTarqNA=; b=XxShItWue2wbeRwHkfEVEfmwufgWMEtSefZsBZ3smsgG4WY0hd+DjDyuAM6OxQ90/NAXcn vqcQBvRizTAXsrBk6s7iTHSPJC829zQPMoTj4MwS8XGfmE6TzogIuHUMICwypA6jLPwT9a IcA7XbcrRW84rgors2xRwnQYvmgVvm8= X-MC-Unique: JBfSN67hNjeGkI0b95f1GA-1 X-Mimecast-MFC-AGG-ID: JBfSN67hNjeGkI0b95f1GA_1781555947 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:42 +0400 Subject: [PATCH v2 16/53] 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: <20260616-qom-qapi-v2-16-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=6517; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=MImBeImgefjPchPWxiBRSQZBA7NyEy4h07IQTQ8DlSo=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKOyrOWScdv2qWk4mNlKRWkBHdQlYcFmiL7H m60RMf5hD+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijgAKCRDa6OEJdZac 5VK0EACF3YmwkmiHWe8191gB5cJXjaGtT7wWFmTkLh9eNrK1cbV2vV7xZMA1ksJiNF93Meb1b5x a0a3QPb3QOImfLzS1e0hTnkN7mEkLYA2kQ/81pY1cSWWROsnzKQx6B+USc/oEj24Js4qkZAOxl7 CzxFtrt02bamSSf4lko3Cp7COj5rMgdUgkqcdMP/6TJxNUP/EWI6U0IEbh9jTkGhAJJASkyZmJQ Erb7kmcsSM5jfUw/7BJgKvg80q6Xaw8G1MOAT7SkSn0Fwvt0+EPqPJ2pIZV3zGrbZUkibisHQvJ mCJ7FUt82Wpm4WeGOVSJdpzDblmRsseYMbKfpQH2TvAEl1hhwFTKJCPBMu0g09xV500WU9+YU8P y2xBnYgouEQ0AIZAhBICtw1pklanCaF+aEFMLk2BkwDVCap42dpC4kXm2ekOa+2kJ2IIZCGVj7g MbbteUVTEuRcrUoz7c1HBoyBD8GG1cSAMeVNhHvcox0AMaKUfAR2c+Fg+OmGqCfUMtGPtTgNYkX qd45DazxOsQ2b9FHIf41E+hUjKlv4QkPE4DBorOR9o9p0igvVcmbElQ6tH5iMpYgf+pC7jsgV8b Wj10jEEXU7MLRbChoYPJfCQYexEO7Nn8MINoGDl1dFlrUqY7V1pHDUtY/4+GGz5UhW55i49enas ZpiBLhAO+POs+XA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -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: 1781556140577158500 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 dc7f0d56b01..155763b1c98 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -24,7 +24,7 @@ #include "qemu/error-report.h" #include "qemu/units.h" #include "qapi/error.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "qapi/qapi-visit-machine.h" #include "qapi/visitor.h" #include "system/qtest.h" @@ -188,21 +188,16 @@ bool x86_machine_is_smm_enabled(const X86MachineState= *x86ms) return false; } =20 -static void x86_machine_get_smm(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int x86_machine_get_smm(Object *obj, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - OnOffAuto smm =3D x86ms->smm; - - visit_type_OnOffAuto(v, name, &smm, errp); + return x86ms->smm; } =20 -static void x86_machine_set_smm(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void x86_machine_set_smm(Object *obj, int value, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &x86ms->smm, errp); + x86ms->smm =3D value; } =20 bool x86_machine_is_acpi_enabled(const X86MachineState *x86ms) @@ -213,55 +208,40 @@ bool x86_machine_is_acpi_enabled(const X86MachineStat= e *x86ms) return true; } =20 -static void x86_machine_get_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int x86_machine_get_acpi(Object *obj, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - OnOffAuto acpi =3D x86ms->acpi; - - visit_type_OnOffAuto(v, name, &acpi, errp); + return x86ms->acpi; } =20 -static void x86_machine_set_acpi(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void x86_machine_set_acpi(Object *obj, int value, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &x86ms->acpi, errp); + x86ms->acpi =3D value; } =20 -static void x86_machine_get_pit(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int x86_machine_get_pit(Object *obj, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - OnOffAuto pit =3D x86ms->pit; - - visit_type_OnOffAuto(v, name, &pit, errp); + return x86ms->pit; } =20 -static void x86_machine_set_pit(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void x86_machine_set_pit(Object *obj, int value, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &x86ms->pit, errp); + x86ms->pit =3D value; } =20 -static void x86_machine_get_pic(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static int x86_machine_get_pic(Object *obj, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - OnOffAuto pic =3D x86ms->pic; - - visit_type_OnOffAuto(v, name, &pic, errp); + return x86ms->pic; } =20 -static void x86_machine_set_pic(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void x86_machine_set_pic(Object *obj, int value, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(obj); - - visit_type_OnOffAuto(v, name, &x86ms->pic, errp); + x86ms->pic =3D value; } =20 static char *x86_machine_get_oem_id(Object *obj, Error **errp) @@ -391,31 +371,37 @@ static void x86_machine_class_init(ObjectClass *oc, c= onst void *data) mc->kvm_type =3D x86_kvm_type; nc->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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556127; cv=none; d=zohomail.com; s=zohoarc; b=l0SR0ygp4H3rU/LWSyibNxsXpFypTyeuHBEOqaJ92S9UbyhUL6WuJGyk+Bz6g9nNmnjitMExDlVgMtQOXMw7Eo5zurS/u3VmN7ozuWhrgkh1sLIWXCqVFbmuoj3VDzyNfx8hjRKwTYEQpKlk6LCmVicpmjFH3lZP1/jtZiQLQ9I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556127; h=Content-Type:Content-Transfer-Encoding:Cc: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=5MkfTv3kRX7qWXQEIqqM6kAHVI9kM5hc75Db7cJOP9Q=; b=dX/kLU18HeWGESFMiP/W1j3iJuTvxebJahPXc6FA9Bk+TOJKpj2DpRWTT2Rfpe/AsOzVQgIxme4x4xL4SaxuqQaMmdRQp1yA1oaTKBbcoi3x8BSh8sjSN36Rz9o19CwqS/Fg2IxLvMt4Rt0HaIf5+0TrOIja54XjTDat3eqBy6s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556127654594.6903799897298; Mon, 15 Jun 2026 13:42:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE5Y-0005uI-VX; Mon, 15 Jun 2026 16:39:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE5W-0005a7-EN for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE5U-0002W6-An for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39:18 -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-381-vwMJ7qsYNkqTKUkEnvOkqA-1; Mon, 15 Jun 2026 16:39:14 -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 0903419560B8; Mon, 15 Jun 2026 20:39:13 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B84D13008B37; Mon, 15 Jun 2026 20:39:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5MkfTv3kRX7qWXQEIqqM6kAHVI9kM5hc75Db7cJOP9Q=; b=MgOAsHs9Ri1F4ZThnvD+6aNoG70Bdr2sP6weDwuPsNy/ANPR8FvsuVuGEBZVChRz4tpqVt IJLGunvvJskG+NEj4M4pULoDK9HeOXgwqDGoVN+xk7y4nAq9MQY6G7VBJSJsEmExUpeU+2 FS7ROBbjDgVL/5uTxRWZWRVT7Y2sr2I= X-MC-Unique: vwMJ7qsYNkqTKUkEnvOkqA-1 X-Mimecast-MFC-AGG-ID: vwMJ7qsYNkqTKUkEnvOkqA_1781555953 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:43 +0400 Subject: [PATCH v2 17/53] 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: <20260616-qom-qapi-v2-17-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=5488; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=NinzCqv4VpD3pzSuuYsNjRHolWxLn5IZPLOPaiH19nQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKOWKGv+g8zBh/hdFekgfmytlEODzS1jwj+M GkmXZo5gHiJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijgAKCRDa6OEJdZac 5e4QD/wOw9vy4XzonyFo6CpYzOsQlj3p4kBFmFreHzE7Xp/DVwZNbLXG526CgMzru4SO9/LZzFM zqwS0e+a+tLK7jRKQ5UXlnul7jH0dcbTrQkmlKvQbCiFCYNv/GFiYTZDMTDuwSX5G7sfBrkzILi B11OkAbP9Dl9AJvfmf8dlYtDhGT4AhABDelecKaUf3YdtX0STnYvxzoZYHo/EmXCZSxoUxULw9R fV/jYIvpS2cR4psQs10N+biLeneGRiu/O9rbyjq4egVWEiY3oUJd6L1a9nnB2vvxWo7FiZ+ruTL eYObnVrkkpOreQzcdTCPmtqjCLkac8+G9JjuW5a97yj1MUuHc3bCoyHtLb4uXI43jRxyGzRXN+z tzt0IucviQRpxmUwbXmfXisaNGWKLqP6RUwEiQDyk3n6yjic13ZfAzVi1XKimBSqeHEUfQWperg zI69hFi9iGBS1klvzgTCTwb09/wCM7smp/+EiKgZjTtv1GuDsCJFKXfNWrsXJGQcNdURhftAP+r 36f+klApByrO+CUYKMF/UjfHD/lptX5praAWObR5ZNmfpPNh5pZsXfULV7u7zp5zl0sLViwiK6l h0I+OudeYObIFsiP6kMEb4iTqEXk3cyoIgiHzh/RLfUF98b4CALnplvM6NxNs/N+zRPh/in/3Yb UgGtNurNIE8GLUQ== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556128576158500 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 779741ec76e..f09d7d8f905 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" @@ -520,55 +520,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) @@ -674,26 +659,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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556006; cv=none; d=zohomail.com; s=zohoarc; b=HgzWwsc8WrCUp0Alsbr+UkfDx/dVxITXNMLgDspSCnrECKBvnkmvXSwtQ0QZi+ZuTi5rLH7JUtlWUUPr+yHQfaSOL0Me/boUHrAOyy4rGkuA6qHLzvv/olOJK9Po0MwmftYna9hKtbP308WSMCazEfvVe5QLbZcqRlmBBvzVXhI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556006; h=Content-Type:Content-Transfer-Encoding:Cc: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=mezgjvaEYR//SPKOUWSTyWjjgHy/9nYm7jhJ/qsslAQ=; b=TvD7qt5zfyEU7M0UKVg8fZDqmfs+6D10BRJu8ijtLEKqfNM88GLi8siNYkPhpYUJ2LWXgSMbtucR+Q1/8u7YFway54MU7rzmEPo0TdyiqFF3AuHus8/TSM4ixAfLyMiwzTFLMscp+rlMXh5GvldyIndfw0zUFm3r/Hz3W0aXAmY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556006949673.5048829023401; Mon, 15 Jun 2026 13:40:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE5e-0006gl-5M; Mon, 15 Jun 2026 16:39:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE5c-0006Oc-87 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39:24 -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 1wZE5a-0002XU-Ld for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39: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-157-q-9-UL68OjKmCoHof58lIQ-1; Mon, 15 Jun 2026 16:39:20 -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 1EC6F1955F56; Mon, 15 Jun 2026 20:39:18 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id ED0CF180049F; Mon, 15 Jun 2026 20:39:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mezgjvaEYR//SPKOUWSTyWjjgHy/9nYm7jhJ/qsslAQ=; b=PuZOpVGYyvU1z9aHzoZ7V1/WZQNv8tVxNkFrV35LbPyR3QLFamnK05xwZbM1CPaHbLpO5m /UprUutP5Imi943rHVRAAMf6U+J6dGsNejUvsm96HLN1mtkEVKjUPw763K0vYzzT1yXrDd aDFI7xF0vfZ/aSXagCpFfZEZBu92h7Q= X-MC-Unique: q-9-UL68OjKmCoHof58lIQ-1 X-Mimecast-MFC-AGG-ID: q-9-UL68OjKmCoHof58lIQ_1781555958 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:44 +0400 Subject: [PATCH v2 18/53] 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: <20260616-qom-qapi-v2-18-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2472; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=jUV5EJL+Ahl2xTzfLPqcvx2LR6oIh7/oALahJaomXgo=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKOvZj/4ovFk4jEBSphDfOIMJZrgdNhq5zWD KiABK9Pg9GJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijgAKCRDa6OEJdZac 5f6rEACULxEaxMoWGwMUC3UfDE/OjPgds/529Ixt2F0LHeG4fl3JognA9JVyXM5hapc4jK5jO6f SPUVUMGa4dbVmP1laksFmHMnPJ9lnYXJzSzSJraDbfv5VhZT3lVxr350fz4GadFUBWNWHej0obr InFsJ6tD6CvmUJVZjJwxbM0C7h0jCTV73qlZng0uQM6sRZ8A9PC128tHbevrsfg3wSva6dzXFCZ da6gLtv4WZteSpa5M5VHmR/95BkqaweNNvWoFBot3QMUC4RiIJrxy+KmKfdlbD4kx4s/yrMKZxC SdBN0Kv0qMZD3Y9nyjcNeI7LHDZzgVB2p83QTZalqOTpm6ex9xvJ5ydR3R5DXBvIMP3eaHFLhN0 Qi8rLoHydLKUKAaYPH2nLk9Z1lga4ejkI3EHLjYsxluxUkFiMQjVj+7R6QsgXwQdc1IdgTLIJ6D tfx6HSpzUiL8xPmRV5JDQViPjhr3+AgYXHClDBGhAbhYSATtBFKGsAFUrveRsYO+gCWef36+bGn zQk9dZ9r1fDIklGj6eARqQpnCv9bxBNSpJMjUR6O0BmK+LaiOqGnG5+5I3a8rTXopuJBt4RrLI3 02J0kXJpyrP1YpQMHspQcDbG9iQq1HfHS0LL5BNYSEHDn72udMTuBoj9iStMDiadnwWSQZwsXoa Zmh5ANye4S/eYew== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556007864158500 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 7b6ad97e5a9..836a26cc72f 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) @@ -1690,11 +1686,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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781555990; cv=none; d=zohomail.com; s=zohoarc; b=mGERtuIiPU4cgQJZxqQCsmr5nb8MV/Qn2P25i0eIWhHcE1U1DDP+k6FKUHFiMeR0WwDn/PpmG3n6ehBhTogF/lHbRdhCSQEzgMwpKQ07RjUYR+jirFwd3AXfCKJs2v3zNDh18tdZdDrrtTKqUA2Mo7EKAWtPiiv19UBq+Ep8Ju4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781555990; h=Content-Type:Content-Transfer-Encoding:Cc: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=3xDGZearArcK6U6s4qALfmytfIFNAxrt6ZDAc37vT1w=; b=JXvLURCFb/aTgdYbKPH/JUhCp2GCa4aBI5FOC+5Kcg1jdeuG4KrLf4qNAUKBVJKuotQd9VoX+/hT8qryvgpKAyBSd5nE05S9jeSU1sj15Lei8T3GswXsDk/+77nQBhUyMKpRM3WW2Kp8pdeessHyP0becnifd3/4miVBpbipls4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781555990885343.2983306205696; Mon, 15 Jun 2026 13:39:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE5i-0007Iv-1a; Mon, 15 Jun 2026 16:39: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 1wZE5g-00071t-3T for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39: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 1wZE5e-0002ZV-Di for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39:27 -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-569-g2NOLyAhM3m176MpWJV7-Q-1; Mon, 15 Jun 2026 16:39:24 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1188118005BC; Mon, 15 Jun 2026 20:39:23 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1946E3008B37; Mon, 15 Jun 2026 20:39:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3xDGZearArcK6U6s4qALfmytfIFNAxrt6ZDAc37vT1w=; b=HknnkMVVfhmy90h+UTHv1Vj3qnuVHcGrPWNnHhjq5YhMN4HSJwp9m1ZBFfaCkL6unAlj7Y 7w3pW/Ldh9q4b1r+QtvVKpycUk1Zw3STci0qn6rpqSxfF5X/Y0zO0n/PFIW8OYlMzPxuwT oi/Pp30sejeNw8NW13SqJpb3bTzHj34= X-MC-Unique: g2NOLyAhM3m176MpWJV7-Q-1 X-Mimecast-MFC-AGG-ID: g2NOLyAhM3m176MpWJV7-Q_1781555963 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:45 +0400 Subject: [PATCH v2 19/53] 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: <20260616-qom-qapi-v2-19-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2369; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=YBHVPr06YgVVJfPrw3ui9iojXGjY0dulKC1PFm6+46c=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKOHAc6/9US4FRsmQhwf//qhvUfsrvZbT1PA gBRZCa1Az2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijgAKCRDa6OEJdZac 5fmDD/sHiQZvWnSguNWGdYKedQDzhBRbjwBZ2Umu+zqONnoKll6G5RXqu87f+r+U8svtbV/GWRq 5UXT9ThgWPYpW0DbanrrgyfargnKaSkN7t4u3wo5Mexx6yctMqHAPvDi1/fHZpicuDRU46vOCyW e0G6UaCgPPyUSBHBsLkjJJpxIasDXS5v6YZkA/ffgmhAvHqK36/qIRqRFZTNZg2gF/9lj0Whavd GZoCrhX14ZK2efnuxQ/VNFNeggzRD8pw5gBQSPPaGh9M/Am7hHnsR/MuecUAGYAJl6hoWhyXjgi JNta6xdWcOI15zS3YoWJo0wXUUc1mG8l+IkbEYC+oYpBSnExzcihwAnNtmr7x9YMG+ghsg/+gKW HnX99zHmyUdJLmlx/JjQWZQMP9tmiVGQu2DkGBdnthb7C3KWDCA0v/faIPHFopfwIXSOrew2iCF fMHGU5uWyPjNyZed98y8+rtxlGfQcrQRjRQ+IG5UGplhE5la6pF4r1E5PluqAMu7uvs9DLxPGJ5 KwI2dYR/XFE72C2HCLLEEmB/YgGhRLves0OOEi/07hQl8lccQbck7Lp8352bJIeXbVoOh6+/SJm Wy1ygOqLKywVx+GZj5beQr/DKhVngcybSvG5SjFG/dhfbVVn8sK3uvWJ/29AKxIOe5lr2bDfXq/ 8PZq/A9JbnGEccQ== 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781555991865158500 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 b090233893c..295cc053768 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -74,7 +74,7 @@ #include "whpx_arm.h" #include "hw/firmware/smbios.h" #include "qapi/visitor.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "qobject/qlist.h" #include "standard-headers/linux/input.h" #include "hw/arm/smmuv3.h" @@ -3519,21 +3519,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) @@ -4125,11 +4120,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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556215; cv=none; d=zohomail.com; s=zohoarc; b=NlJ2c93MpzJ/uNDw8N//ZUffn8aY3lEHo5euVYzd2NyYeTLr/ZvzvduOK94poq/SHUzUsMPLuDRgLk6S8kaU6SodiD/MP4WmnZHhTUCeg5E/gQP9VWDUjLEF1kV+iybCL++iNjTohQgmacZX0Sfh+RR8k2qzn0MKJwpMPpc+6yc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556215; h=Content-Type:Content-Transfer-Encoding:Cc: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=1OKcE1tBHE4ezXS8ORt03lDrgoDt2tSDBjHLWw4GEYY=; b=Saq3dMPBR2oAK6IIyudh/eg9zh/N5T8OVxPikcyqoAA/MdNtNAe48w5GR2FLIyu1WL6vkq1WrN3wjnbUMR0d979zQgYfufRgAbF0wa7lErmSUst2uGKkRm0lPRzStM3Z0fTh17/A+dnYVEF8cS1XY2obl6BqICsYOr0NnqUt2Xg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556215691238.6561102636383; Mon, 15 Jun 2026 13:43:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE5n-0007f0-Qj; Mon, 15 Jun 2026 16:39:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE5n-0007dP-2X for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE5l-0002bk-Gb for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39:34 -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-209-hTf2mXObMT6iUVqBTlDaHw-1; Mon, 15 Jun 2026 16:39:29 -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 816301956064; Mon, 15 Jun 2026 20:39:28 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3DB53195419D; Mon, 15 Jun 2026 20:39:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1OKcE1tBHE4ezXS8ORt03lDrgoDt2tSDBjHLWw4GEYY=; b=ck55HigGm0v4fRF+A+NB0HvKcSrWHNuZiw2KWBQFS6U5Tdtc42e8+YhgcEEPtWwuOL9lsE 6ZiKqTJB9YRq+neP6MpG5vS2pip+5GjHqzurSfKHUg82RPbTSkA7w/emOAQPHDBVkgJWoU hiOYRP3Xm+qn0ulpx/f8pARXzZeHi2k= X-MC-Unique: hTf2mXObMT6iUVqBTlDaHw-1 X-Mimecast-MFC-AGG-ID: hTf2mXObMT6iUVqBTlDaHw_1781555968 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:46 +0400 Subject: [PATCH v2 20/53] 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: <20260616-qom-qapi-v2-20-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=3914; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=uR6kVLaM8mSy4Bf8TP3PcRSxK9XSaw4JpV1OTvl+FF8=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKOQoEmnkfmdqaO1WnJgBgY8UJ3zTVPnL623 BH5BMw+yuKJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijgAKCRDa6OEJdZac 5dSvD/sFGSRNCCuj8HGW+KNshZRRsxN4UUpZdRSXswfYulHI6MLg0mHAEwrSdBkqdBA4vaGlORT Aor/0Ikcnfw+5g0+N5D9GBoLSjqXPHS3/cc1qpt/zXxbvSBLDQdZMw+JK9yTSwg71ETDP8p3r8r Ei6/c16dFjJc8U6Vfxsi/JUBEBiBaidn213My1C6qu/zbcv4iZ9NPFJs7hqYM9jWOqlxJeV78Tl CwoMaDy1/IRvPUZggXfmOWC2jV5gk0AAgugybCNrr0/eTFAdZtMPwBKDbyQfHFEog+xaGiaryjy JDWagg7XDB0L0I306iWFgpBdYto2u5svQvVLf81F+mhJQAxPl7qt7itHUCgxCfI+armrLybBWOE OUW6/zZiz0amU8qDxa+J6IHIdwbtjvwi/7CdSJeXYjczMkOvEvqLyoPq5+XFxmtjUuzkbHseVrL Dv6xV2v6J2rISHAgjQYkaMLSUMFu/UuWJvYMKBGspDGbSM6s9/DCbU3KSIfOtpDKohxJbdzu+Xp w10gkSvn3ErYYn0qcJoPqJUwoTvKTyQ74L1NAaDlZF/KVWL/u/EfU6pJ5xfI5/kUoQzhEU2lpVH wGgZrog2BBSSACYU7Vc8nkQFjJYlO7mz2VxKa+7iYx4HjTl/yH1l1zAxGD4MJaJ35AQeC1u+gDQ 341bKhorK+RCguA== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556217215158500 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 Acked-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 ce64eaaef7d..65c3e27ec85 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -56,7 +56,7 @@ #include "hw/pci-host/gpex.h" #include "hw/display/ramfb.h" #include "hw/acpi/aml-build.h" -#include "qapi/qapi-visit-common.h" +#include "qapi/qapi-type-infos-common.h" #include "hw/virtio/virtio-iommu.h" #include "hw/uefi/var-service-api.h" =20 @@ -1846,21 +1846,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) @@ -1868,21 +1863,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, @@ -1980,17 +1970,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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781555988; cv=none; d=zohomail.com; s=zohoarc; b=T2vDVrfG+ebwbjKSRxjBqThdCS9V5ZbUUk0J00muFCh0AgCbKSZCWD7gvTnzt/1neWyWxsAvnvuf1dvoYnCiq5SmUegiLgv75j9qh+sAvhmki4CjUG2LJi0esPrhZaEWHLU8Z5HfGYHreKiQL736G5ASfI3gZLNuxNU/9U1E6aE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781555988; h=Content-Type:Content-Transfer-Encoding:Cc: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=JRFWGll3IkilQEFX0rHGHdSOIWzyx67oA+haIuO3TJ4=; b=Ns9nKXPXcEp6eO/KnQYQEtuFg1yD2RlWPl8JhLKCQv8tTo+aNRxQGjbiiilueeJuKNuaqknHc2OYQCaHTikp6D7WZKOYlQEfpl7angoBfbf4h/ImEoJrz8efRh2GElAoUxPGhpSknZSqf/iEdzj9eo3k19CYkKMveFRLQ55hqEg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178155598842175.47201682632056; Mon, 15 Jun 2026 13:39:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE5s-00083R-Ab; Mon, 15 Jun 2026 16:39:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE5q-0007py-If for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39: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 1wZE5o-0002cK-Pd for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39:38 -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-294-FEAm52tkOGCu1x_AxUKx7Q-1; Mon, 15 Jun 2026 16:39: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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D361919560AF; Mon, 15 Jun 2026 20:39:33 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8EF761800347; Mon, 15 Jun 2026 20:39:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JRFWGll3IkilQEFX0rHGHdSOIWzyx67oA+haIuO3TJ4=; b=Umw8Qnc8Ah3Qq3cLFyOrCyCK87ort7d+jJcGjfRDZhS7Yk3CHjX1WO//ZXe9vbygQeISoA K9F7dRvvOuf5s5y/2exUxwJ1aW+LBVUs3yE+NEMvDgK/NxcHNYJbc8puK+olxzGvNXLULo DM/MmMHlK35/uAayllsDetP4Fawt4eE= X-MC-Unique: FEAm52tkOGCu1x_AxUKx7Q-1 X-Mimecast-MFC-AGG-ID: FEAm52tkOGCu1x_AxUKx7Q_1781555973 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:47 +0400 Subject: [PATCH v2 21/53] 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: <20260616-qom-qapi-v2-21-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=5899; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=pajruQ5bPVDgsoNYK0ed43PMp2q1WJ0D5LSh6fG8Q70=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKOkglhKGDBBLOdbW7mp7kBHQyvK6T1D97eI Djp9Pg5RyuJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijgAKCRDa6OEJdZac 5XdhD/0bzHriMLT0U392uoiLqFhBHSTT4yJfrPCAY81Ntwlgayc84REAvDvlWL5rIvnhTtYjWVz 4kPGN5LsJG6Klm3SDwC5d3AUoS/fRkiptpUEIdW1AACMH4g/Js+ys7OejszpLHmIlLypB6qzm+R wTThtj9QZb4Rwh1Dno784fMIjfuTTqBZXtPMI8W2Z7ELj4JCCwiGkkGPpt6P8nPGvCK8UewCGu1 y6rAPDRn13GIyPoejK8nYjaZZlAv6uTCokmbXu12nFoVPO2BQ6Gn+C0C4NR0DGmZcf+VU7Ehawg iLiL7LjpFTro7HiXq3PDF8o97BHJvWl6VsUwjilM+R6jbCG50VAN+CnY7f8/6Q7FqGB0FDsMRlO CsO06CnAxIYFuxpk6u7AQRV2Du8RCW9bQfYxeYBttsEbVfvTqR7U7EJhzJllaeH9v0rr7Vxpy8S l3mAGP3XJ3FBnX1xJtMHgkxAE/nBzm7x+avc5LSsRVyaQmZYhz9+JzbW038Zcd2SsoFRL88nIXd KH9lX4mRX/H+DeztD584AqF5wHogNDVVGxvrT3Mv/AsfDZU82psVDectX856ajIPQdpAQW93NEz q45+MDknnVIc7MJUH2SBOoe8ZJpVpKkW2bWAaWAk2JUTbaMkiEl0wUTKGSIb9Ln2b1o7X7bH9xF uHayP0LQPlg0W8g== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781555989714158500 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 6693dea647b..5b99c95fec9 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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556215; cv=none; d=zohomail.com; s=zohoarc; b=aFq6+BBGc6og6JktkUfSWeVgqL/H5qAaFbu8KHh/MF7r3ASR1yeQm3xEo7dgFPCnWdR5qA3PqrUO4cEVEwMKquwtybmqGERjt6zXNW/GHsP6r0NiYsr0nllc5jFabFzqetCiRxAD8vAkpsqzR/J4f3rbdIZCFEYcXIT7MH5CoRY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556215; h=Content-Type:Content-Transfer-Encoding:Cc: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=XTYd+Fe8i7GJJyt+q6Z4Va3dxaA5E/x0nQVGBLQ/tIR3INkHfL4Y8gFyX+VQY5Tdeed55BTAjy8zhtixzxtm/6FKECfSIvUK0mC+hcdlh1GArqY1yaAkUULmoB/mwivfJnDp8wV5z22RQTAZFbQfJj8c28NwIVPFHk0V1MZZ0VM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556215813833.0312046801746; Mon, 15 Jun 2026 13:43:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE5y-00005g-Hy; Mon, 15 Jun 2026 16:39:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE5w-0008W9-VF for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39: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 1wZE5v-0002dE-Bx for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39: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-588-1S5iQQ4jOQSGL6nRPDF-ww-1; Mon, 15 Jun 2026 16:39:39 -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 A24391800599; Mon, 15 Jun 2026 20:39:38 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 99B5F195410F; Mon, 15 Jun 2026 20:39:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=LTgMyc0oCFph/YntCpHdvmfBTyi1jTBeFJib4eZG/puHP8RA45MqdGrqLqMK2v1WVFcZoc 3CFFrqtG2IsF7q4hu900PBP+OpEo5UwEDbUaF9CMhMOgbqL7G6OTIiIwVFomdcT4BqDxIF mvBIPkfIyCWgUTpMT2x6v9Od1oaJh9g= X-MC-Unique: 1S5iQQ4jOQSGL6nRPDF-ww-1 X-Mimecast-MFC-AGG-ID: 1S5iQQ4jOQSGL6nRPDF-ww_1781555978 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:48 +0400 Subject: [PATCH v2 22/53] 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: <20260616-qom-qapi-v2-22-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2943; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=CuFSJq8iGNGVCOyVHepOCVE13II6sJjnLOPYuRRy6k0=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKOFqLZRoYv2uovHN/RR4QqzidVcYexW54cs d+wtldpX12JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijgAKCRDa6OEJdZac 5WZsD/0fj7mMfshUVoFGqx0YaoTkRbEzV2MH6yhJEGyyPE6BBfo67ErLWWn/cjBzUUKbbnKM765 qa+G0I3kMJl4dR9oTKhNJXwNxFPAvG2p0toNORuSrViVgGVHYnP6miD7vv+Rl1sY+pRXCNNIjIo 3vZLEzFKlbBv5lUQgfHuyzH21fHkUGbWFpLWzFzQOLQ9H5H9rfWcXLw4REDhOdVvkg5fVCDsUV6 j24/G8jKGpyjsB9lWXj5xnxBP7c0TAsZ1/9vDFI4SbARunwfNRwS0koRWAaEXtKtYHK+/tPAxLZ RvSazXE+BpuUBzVuEN0vH945ciC+xHb0kAfjguK/Ven2tSqW2h4AWLhWHbejDgSlDazH+GJ3OHB 8GbKNa1ZXrrKuBdoLYO4uXkclX1BnFN5F6aOItwj+22KHGFtTWNBg3ETCDblQlNrQb7KzvD2zDp fHG8Ob5MxJXLgUO9MzTPIZtzHQPl4QVsZY4ooHgsCqbKhhCwHfygrzY/1C3c1JABJc+e/Qg9/e1 I/JIYQ1HWw8a4EMCyudRcUT8YFM+bfak0hddyxRlmeqf2srBCePpwBsZLTXNvB3/vf9VHv/vfZM JmU83nIuU5YFPDBXPKj3ZmyVysTdwW1e6Py8uZjw+B4AF0nMI6nLom8U6mR7U/GdlHYXIm/qkpJ FKwkESaGkvi3KGw== 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: 1781556217195158500 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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556096; cv=none; d=zohomail.com; s=zohoarc; b=YixH0YbUzj0jJGqyRBEnKrw/oraPfsUR7MX1dLL+LfJf8FrBM6aSdGM7EumudOcFXEUof0qBTuxS5CbHLk7U8Ewb5QC1XsBpRVtGkhq8x0boCMwXAOwFL8C2DMJm/FDI51Ov0JgaVhyhEw9yimhlNjRcYxNQeZ+mNszhWPz9m3Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556096; h=Content-Type:Content-Transfer-Encoding:Cc: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=DbC92ksq5of7KZTbfXcdyg2RQLwK8IIt/OArcqPyFI8=; b=EaqpdYD1MojE3uKeH8kChHuPwVBIpWVoavFwX0g7neyoYcK0h8jWH/p5Ke5TQnVL7rHhvXl1dpjVI6bPbcJ1jpElEMBQUFqjDZiTccsq7U7a/FDNO4h2FJs4BWQeW7p+Sr8KVzlwtPq4P7FWH8mfPPdHf2YPjkW4D9/f6Q924u0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556096254171.20627898067448; Mon, 15 Jun 2026 13:41:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE63-0000WN-UR; Mon, 15 Jun 2026 16:39:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE62-0000UR-TP for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE61-0002dc-Fs for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39: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-609-TaDKJwpANWGE9TWbWvUXPA-1; Mon, 15 Jun 2026 16:39:45 -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 4813D1954B1C; Mon, 15 Jun 2026 20:39:44 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DFACC19560B2; Mon, 15 Jun 2026 20:39:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DbC92ksq5of7KZTbfXcdyg2RQLwK8IIt/OArcqPyFI8=; b=SEoVPxHwEKkukGmPnNbw5fFFsYVLcv/XfO+4FyPrhKUTAWIKk366d6C8KVMusZIotmqsnk nNy6mUnWGt1xboKJHdyd5twj+V0OpLcF9I6FEjYIeBaOyKJIQe5M33eLRJlMda2eyvSbaC edC01y3JtLuI9KbkEdRJAVEizoUr2gs= X-MC-Unique: TaDKJwpANWGE9TWbWvUXPA-1 X-Mimecast-MFC-AGG-ID: TaDKJwpANWGE9TWbWvUXPA_1781555984 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:49 +0400 Subject: [PATCH v2 23/53] 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: <20260616-qom-qapi-v2-23-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2858; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=AJinG3zfRjZMCV6VAf3JzTG4jCr2+Ek+86GoMl4GKrY=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKOMCm7Cd0KJHqxNobnVWNFuG5ZUCnLDD6Yv jThgn7tS4GJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijgAKCRDa6OEJdZac 5ervEACjW4qHXaKANxc5KsrCux24ucjxQDm3Su7wdHjaod2eDAU5al+1yXGFoDJt8Nxu5Oj21iu Q0UuGEUx6vHVzUbtJm8BZYISstnzqrwFLqhOazqwjoIcPg0eEulOJAsCpDoQC94kZMoKiI4Nh4R Cc3sq+c7St82nSoV/gAC7d9l7wNZ/CaIZmfdPx8odAx4KrdEoESDRn5sfjRBXF/k/Di9RuR+Vyk zBk1tpiF15PbHwwEwdnws5juL2rZlKqpfCLyvGyNsAJw8s8jf5kJNNE53woUTFEJO5mfezbyoS7 clx2WYmAyjy5+p5p18EIFNNeJAtxGEjnd4P9fMdjFOMsZ5x6gsVvSEVOCUBiXACAO+5AY8gHhV1 uKz4Ou2/yZh1/4OB29VHDJQLMIbDFycjBXRDWIFAWoaKSRkeuhyL2EA0evxCTNq5NCRQ7etD7Pv ZfFuC+XQzhdBc5k+P+0zL/OlkffNwmY02kyH7G/kPaknrVHZz5xsdtakAE/TfiQ8k8DAKkt+Q6a l1DLzaTs+xQRCmWMNOHuEIG3HGzMx0JEFQjgJ5E2Cn3n3qN+j4HBFvVmf7TgJfjwPZXr+v8Rt9I lS2y6ujLEt+/6iCpONB3NkSDQjRAHgIri9RTq4HEB08nSE2uud0uTFIJDsL0skMroXK23+1LFHz PSxuecS67iJFfpQ== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556098555158500 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 99cf30806be..63ccae4c26c 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" @@ -2884,23 +2885,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 @@ -2926,11 +2920,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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556096; cv=none; d=zohomail.com; s=zohoarc; b=Kg1UEk0M3hv5zygKfObCW2uWPeMbf8vAZ9jJegJo00ZpoaP3pkQGU4ZGOFST9nm9xwfZ8Obl8pwdq7/7SLB4HinKB4yxeFYTwkyzihcjqoB1rNmlWQzHCyMLFfsmu0fV/0l5GB2jME1rmwGMpAq2aH7W94HZCrPrf7W88y/PCKg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556096; h=Content-Type:Content-Transfer-Encoding:Cc: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=R4TU15BEUcotAVKw8+csM+2ci9LbEJH4f55m0J0dC6hZmWyt1u/fAVbadnjkYvZdwblfugxwi20SGhQEEcdBadkbIf+3uSgOpJ5lw7jLsS+L7YY4Dj4+KzpcbuzyNcPiU8lDnHlJERLo+o8HKpQS0CdOi2p6K0ZqTYNz4NdirRU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556096388788.5045022015375; Mon, 15 Jun 2026 13:41:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE68-0000zU-Qa; Mon, 15 Jun 2026 16:39: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 1wZE66-0000gs-9N for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39:54 -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 1wZE64-0002eB-Kj for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:39:53 -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-245-Jy_RTC4IOkKFlH20FSBEog-1; Mon, 15 Jun 2026 16:39:50 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BB1B818005B6; Mon, 15 Jun 2026 20:39:49 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8915A180049F; Mon, 15 Jun 2026 20:39:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=enCKtFaX0dPGvIBl7ow6ainy550Z726lZkxnScq9MdNjwlKTITK6FH1a3RB2aPX7LlkNLW thqQTaBKn8LfnSekwVs58Zob/j6fReTXcubYqplaFy82b7EQaJYPI3MuH/RetYED69wp0X 7eZtTncQqwIqmwHhFPa25O7iSJEzzkU= X-MC-Unique: Jy_RTC4IOkKFlH20FSBEog-1 X-Mimecast-MFC-AGG-ID: Jy_RTC4IOkKFlH20FSBEog_1781555989 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:50 +0400 Subject: [PATCH v2 24/53] 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: <20260616-qom-qapi-v2-24-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2550; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=tNUW/HBog+/AnPLyqxY75SQ9HHIGR8hgSoU/pzjmByg=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKONKXa1XJmVftGWrVrlLb0SO3ZktLCGOUdI xXtqzIjKi+JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijgAKCRDa6OEJdZac 5XISD/49CJHz5Qf/Go7dF+Wz3DjwQkQKE5g76KanvKn6AW2qEnERJq5oCvF/BlyCFlSPutZU5Q+ JKFXPSss9vJX5H6Jb/mXuDVdzvHnDC3Qyqz8E5ZjDDNLBdBgxPimMor2jJSM9/nfyr71ZZukOcV OThRueV1uyGtxqU+6HjnNh91y8TjZ1Y/w9PrEJdirZMU6dJ/TKMe9ko0Ks8nfhifWnMEXM1HtgD ww9QWkwwhflv8bqP7PRJyPhVEaW1uZDMkVi1fgkZNOZlZpPkdIaq2CzbDB+7Dkytd0kNNb8hoyc B8iQZ84rGZwV95f2HRbGfCeWlmndi4yp/B7flp4111vDDa1wMTP+sXDKA+GUYjOPaWC6x22rFm7 D1wVHIFIoG54N9vH7amanNiJLgBosw3sOdCnd9WnhTEXDdd5BNGX9K76KFe69Sc1trqpy8v6/yX ZtUbDO9S39K63DsgAmuffW8XVL1c4nZqqqZWmAzqUOfxcRIf6R2AGQwREcqWo/p0KCmsuV7lhYk xIIBdXj1sC6QGFyNl22y7xxhi/KnujtAsnproAZ+9UjwWl0diKD4H2QaIK7n1ppQgshPnt4pF0d h2VeCbUrVH28H7q036Nx8UnBZE8SXSCwROXz87FBRVT9WYDkOyl/tw6uTB2rNi+QDpEj3ubBkKV FeySrfxxU542jcQ== 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556098589158500 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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556151; cv=none; d=zohomail.com; s=zohoarc; b=ak7yAXTPnwLTMa0obpuA8HbDHbfvCFWUT9ZzbNETcc1Cqu7dviT4i9pXZm6QKpjSUbYZa7guhoXSu0CGyvOptxr3Nef5bSrra8Bai/9SrI4LsxuClgK4g+0d0GbD0HjeZyTbeH4hjq9A9wScF6Ww60CSKyxqosHFIpOhHf1uN7o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556151; h=Content-Type:Content-Transfer-Encoding:Cc: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=HE0K4FWAFLU/nTUXlylWqdn6JEHOpkgSeYBgtcj3Ews=; b=iLOr1F/moHEnJWSRPBlIDgF/S33wdw0buZmf2q9DOc12HtOvf+TS1eXgdKurO4GYHOUP8CISPU8z3GZ9VWzKnQlWh3IsUrueouW9zf++wsb4FrGTTFhbxQqYaWa+4Lb3j7X34s+Y3U+cFBKf+eIbc9cKYNb4BnwJPhnafPiNXMs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556151595141.66865156816095; Mon, 15 Jun 2026 13:42:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE6H-0001hU-2r; Mon, 15 Jun 2026 16:40: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 1wZE6E-0001SY-CO for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40:02 -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 1wZE6C-0002fw-Bl for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40:02 -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-359-5VT564HwNPStkg-BO2n0UA-1; Mon, 15 Jun 2026 16:39:56 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D625419560AA; Mon, 15 Jun 2026 20:39:54 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A5CE63008B37; Mon, 15 Jun 2026 20:39:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781555999; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HE0K4FWAFLU/nTUXlylWqdn6JEHOpkgSeYBgtcj3Ews=; b=ebAdL0Lb2xJAe4U8KuV9kO4QRaZke2NFX/vCWKHCrzQr402t3lYxfJ5WMtHbA35ABUpDG9 YbLSvdgAFkrg3Kc5gDtJFIYv9MfritXoRffXlqH9dzlSp4J8MZdb4K8m4y21nEPprIaDm5 Ox5p0jW6VsIVoNzqAblJoWSGi0+/p6g= X-MC-Unique: 5VT564HwNPStkg-BO2n0UA-1 X-Mimecast-MFC-AGG-ID: 5VT564HwNPStkg-BO2n0UA_1781555994 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:51 +0400 Subject: [PATCH v2 25/53] 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: <20260616-qom-qapi-v2-25-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=6655; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=BzBiTMpuo1MafDbjkgRY9tNBSnfuxdeq+gbfJzPWWY4=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKPWYmBQeOQsxPaOTWeMCBKW5JdCUPjtvrs1 9BLIxYWkxGJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijwAKCRDa6OEJdZac 5S5OEACSLs8P6AOzqCdPFNl+QBOoS0xaEq+I4lxjFxJOr2AR5fqL2/xVGYESSE0iaFxILJ4FByD eXjVmCmZ4Q+UKCm8UMILHZ4aJxBKC/ruN7UL/oNjsNmz17SXYBS1s3Xo8vbI6CRth3WaY+b9BnT jcGDESCvtqGFPtDjuNlBuACLOkLAWmf4mYkX99BXLMLKcBZuA9td/cSYNiSHuztjJfwvYVf3GYE dBBScaPbsR5AlINBpxCsZpPrzMbgJM/8+49GOACKGyscrSSS3F/RlYl+pAqWrbibvEF6dzGs11q P+xIo/Ea063uctSe5IuZUo9r5NCvflTeQQUpZgYt+mgAfBoZsY2WF8Amf+t8+g3TPfYEC8ER0gv G5l/KewTWL6whh9lwknoDYoLgnIsEa/r+Oe+pOunAkaWERA4b4pIgkESolippQb7psM2e9Es0aS OE9QBiW+u81f4o3bmHBSKaTPBAGSyCd6Uk8gJTY9/QsBL90eSb4adt+zYzwsX8wWCV0G3TLUlJq c4pqbtPJC3zxsxK6gw8XU7cgTJI3rmKbdmcB853r5WhUuF6rxOL9hjMe7IV/Utm2sZjwTCtwO2A vaDMJivAgyBQMzD4+rrTz0u98fnluIkBE/cNxn94++q5ZySwqFk6x9f6zfz1N8w7xqokIij8LJk XBUo+CIE7Rrdusg== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556152685158500 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 e626acef2f0..08714248b1f 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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556160; cv=none; d=zohomail.com; s=zohoarc; b=RwHGiLGEOYW052Zl75+t1F20PI0dNPm0A6pCWu8Ocj2U7wQ3ITDPZpOKFemZ6jGn/qZOYcCUD4vpmfl+2EE/tPPmu/M1cDhwPovtx2e1Kov2mYFmS4jZr9Eh6FGh7Yy09ddCTkvZBs6ftVDVb8Ql85xey3F6cnVVBA09AJzjFp4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556160; h=Content-Type:Content-Transfer-Encoding:Cc: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=8Frjwggwt5fYfOz4q7epWBVwQpwOtLLEeEkSKyTYSEg=; b=aX5C1vMpAygwkjAf00Vw/jMsJrcl2viTmU51viUJCL90pfkW2j+C+Gpkmn+2lto1L4tEu8adM4kzMZCmwTsJ4S3rdjaJaEikyDQR0tFxmKQpj+ceNAoxECtadlGktjKFYbFlte3tb0AolbO6LwmB5Z9hLQwDHurtTjFcfi+Afhg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556160671601.1448997842435; Mon, 15 Jun 2026 13:42:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE6I-0001qC-9Y; Mon, 15 Jun 2026 16:40:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE6G-0001jA-VD for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE6F-0002hp-6w for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40:04 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-166-1SEF028jOFCHg0rgSW_UPw-1; Mon, 15 Jun 2026 16:40:01 -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 0D6CD19560BE; Mon, 15 Jun 2026 20:40:00 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0620F1800361; Mon, 15 Jun 2026 20:39:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8Frjwggwt5fYfOz4q7epWBVwQpwOtLLEeEkSKyTYSEg=; b=ehKwSW3qD8NpvVNfN4JKver30ZHVFjtP8Nz7Ns0s6InRLEFAPleZMe6vyrOJWndfu+iXRU 430dGKDVPEATl8mHz1kpUNBv3xJtTXAPBErGLRBhA1PTIO9SAfMyt0ZnAX80bDHZuoGQJW azZs6/iH26qhhTWxmHt6uLSuUgjdwkc= X-MC-Unique: 1SEF028jOFCHg0rgSW_UPw-1 X-Mimecast-MFC-AGG-ID: 1SEF028jOFCHg0rgSW_UPw_1781556000 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:52 +0400 Subject: [PATCH v2 26/53] 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: <20260616-qom-qapi-v2-26-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2731; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=/3IO55xELM6+dKrmQ2yiMLnkAVUOYThh9YVCdhUxcvA=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKP/qiCQpT4lFkDrqgqcQx9qpNoySiT6z6LK YFayqjS8VWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijwAKCRDa6OEJdZac 5fJID/9MI4dFxl/Mf/gSlkhuuhYLjZBziDfXkEyA92+amcLFmLMJjTvAgJxFyaJMoFNLIGhBPYL VdJBxPvme8xWQtRhReIUZPBIUMh9yVZtCPgBr8CdSS1pF621nTVlxsvOecY8xph0CZCeLhZK0GZ A12mpZJWeZN8pYM5DDdBjyPhTBBs7oxhRboPqENUJnGjJJQwABo67SOPJfNuvAHC4TAPggBONlu oCFlO+ccD+Fy4qBYEW34eh7OPTu4TERwxXx0oHWba32nuLj/Q6RCuLcGfEnmetlcsBJogsS+tqV Ho6ffBKj5NGzYlChXeE0itf5Jm16PeLUhv+u6HDGyNXi6YcmCsYmx9XXRs7uESO0cERa1uKre5N COq+PTLZAuvqU1LZt2OqY5X/8LRnWSjuBZ+x/Bq01pE5R+KmsiAJFG7ambr+Q/RR3hQmitMiUBA 4auFDkVQtKe8xOEGb/9DAQLCMmXsxUk7efGCRj2hPuUUhrshqQskTJz3M5s4k4oYxMJ74ZBNEfC IE5hnfvL8nfoW6mLH2Ek6cL0meXrE9OU/7Z6HmqR0My+xBRahbImxMNmFHPKsyqjgn0pml3WWYg Wo0vDDE1n+5A5Vb0Ddc/apV92SITVYN8DdQ2ncP182lc38e26wDrfxNSbltwk5gQrYn7y64YBEv pKp3Pbpin8mZoKQ== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556162685158500 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 96f90ebb240..14e3c7fcc80 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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556125; cv=none; d=zohomail.com; s=zohoarc; b=JUhh+7fNUCns2UsujneaxqCtOyBSprug13kISyKFUP0tBaQguZ5ZdLlsgtd+y5yH930CrUObv5C7BK/igS3kUHnO3HPWyxS+MmYQZPQ1SE+R4h+A45dXqnvPT/9zrahWBaqUQsmGjD3bdoEKnqOhI9hewQBiddD70hWNaV0ZEKA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556125; h=Content-Type:Content-Transfer-Encoding:Cc: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=ioZchpqbpq9yo14qjDhyg2N3yNGifAYY1b2+J/US9ZuG14f2pjC+pjNbAXOYXc4QYL8sRLpGBEJrf0Zvj5EY1OXg59cpTn9Uj6W5Nep3F+33Mw9b+RPKsbkbt8dkwCQxBtBtlcXA5tC654s6PB1L6GFD102HzVH4Ck/IQINTYRA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556125198323.2849839001077; Mon, 15 Jun 2026 13:42:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE6Q-0002YA-6i; Mon, 15 Jun 2026 16:40: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 1wZE6O-0002RL-5R for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40: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 1wZE6M-0002uu-L0 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40:11 -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-180-CnN8Y3poMX6xhnMWoVQdpA-1; Mon, 15 Jun 2026 16:40:05 -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 D0ECE180058C; Mon, 15 Jun 2026 20:40:04 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D7DAA3008B37; Mon, 15 Jun 2026 20:40:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=OPJaJwN8gvcV3S0dSjYjhaQ6ZV9uHDmyOUwk/74vf17qKKiw6Wt8O3ESaq29/9GxIkE823 eH4v9CGZx7gXeODzSoWA/jknOHjQ6Um93Q8a+D1lmKOAhqtjQeIAUfGkXCe7TBwV6wjAzw 8aOLz+MSzAVnixxg+yDfhF5Vj3dgRfw= X-MC-Unique: CnN8Y3poMX6xhnMWoVQdpA-1 X-Mimecast-MFC-AGG-ID: CnN8Y3poMX6xhnMWoVQdpA_1781556004 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:53 +0400 Subject: [PATCH v2 27/53] 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: <20260616-qom-qapi-v2-27-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2331; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=SvoSExUYXPg6sVDa5rVzKfXzAc13YDagtIfmWECFwp8=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKPYtMkLyBZ+6Aun8V2yVYoQkkOdeHouuzWI 448uarC6y6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijwAKCRDa6OEJdZac 5X/SD/0d2DcwdWdKk4q+RW1gEg/uyU1yrrKMX41U8qZet9Xk5IEZG1eEB3a9Zr7SqhJSFkXAyuA Rzvw5ImNE8S2mmSCWiGrueazUUfOqLgEpvwV7bQYVXsyR2WlJePQ4FeyIr3xDbFOLk6WTDlG3fK 8zOkC7Q9J53g4RJUkS/74F2ogIA+z+HN+P4RZxSI+kK+iHx/h5ju9G/GZJt6CqHHR0N0ILbp1Iu sD6kI5dKzPE1jJGCgKKJ4qpO8jM+lnJod8cP60YnMbv/z8Wi664W6YOWZxpL1qTK/7qHS4zNjeq Ydq4xSqfQWza87kC2/oY3UM7vI6ptd93R4RwDqnYRMlC1cb2u/yCaNSZHEOH+Zqi4BGwoMzQsvi KpXrqwGdmaikdOaDc9HDOEiXFWF9bfqJfHitafPNcqXaKfY1VHe0ZEhd1DLhWpXOApNpIbPcVWV RFaXtaP6xK2Lk+shM8eE1FmZaNBVgS9w4e7nJtN0wLfBl69G5nbHtMOx+Hpr34H6HK/ZGp8pwur Amqz4h0LDGKnQdCGSSEm49rg98s3LF9AQxgYdduEgrMto6NGZQ1ZrWR5E+/2XcfDRO6+4UZXpDE 2iaiqK3kKHsWVGBOPdbs+FSSRm7O81ERTBhq0hzapNEByKlilLt+EwXkGI4RU9WlCdFgoUZOO0J Brsmrql2rwo4IqQ== 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: 1781556126496158500 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 Fri Jun 19 17:25:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556123; cv=none; d=zohomail.com; s=zohoarc; b=mGVkJibStLfbn6A4LqDkTzbQ+RDyMvt+WDrPNrP0wD8RQ5YklGq+SJXix0LRbOsogvw2rA6qtGx3LSD0IJ8+iXKLxZjd+Eo2jpymBCfqtVdxMwmqIbpBEqrOI776BWASZlhJP5pYadRuPccIYv5raOdcWN8xM7t4Wj03WfJIr/0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556123; h=Content-Type:Content-Transfer-Encoding:Cc: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=Ew0qAFh1tG40W5UQ044B+KRKulqYRP7Lu0I+gP5YJ8Vppjhj0Mv/L/YAela6lykXmWDCbShwsisQcsHGy3exfuWXvu79EUSSF2zPHjsAsRfx8HwPBUQCzt5bBR1ugow5YviBy5tYNP8aYOCwW+O9/P5NZzoudNbSxRNALJH40KE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556123076900.3976849853112; Mon, 15 Jun 2026 13:42:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE6U-0002jt-MC; Mon, 15 Jun 2026 16:40: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 1wZE6S-0002hP-Oo for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40: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 1wZE6Q-0002vs-V6 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40:16 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-433-zA2t-PLrMC-3CPvHJx_Vyw-1; Mon, 15 Jun 2026 16:40:11 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2D95018007E9; Mon, 15 Jun 2026 20:40:10 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F3BD7414; Mon, 15 Jun 2026 20:40:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=I723YSRbLKBS1BW0bWi1nmcvhMx8hUgL9SYjqsAHRdBL4GlyQGjK9HBSUYezjtEQxHNvs9 ftagItfKyGoLPBDjMrhdafqp7pC2YEY3UQ0+ktVa3JOsx3eKmnAMUaPeWPUIjpG1JKeR+Y xGwPVdsW7xrkdTvCgNirLu2H7lLj+pI= X-MC-Unique: zA2t-PLrMC-3CPvHJx_Vyw-1 X-Mimecast-MFC-AGG-ID: zA2t-PLrMC-3CPvHJx_Vyw_1781556010 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:54 +0400 Subject: [PATCH v2 28/53] 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: <20260616-qom-qapi-v2-28-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=6645; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=FPDD9TJ/rA9d7j48YFdPwG+J6OGlivYBOYyNTt7ax0k=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKPcmpScDRNeHbpJ+lHPetmufr4Z5GcbZrca +tkaiUVz8GJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijwAKCRDa6OEJdZac 5bGwD/44eV0IaZdCpwuOa7/eYS5JwIivz1+V59ZWdhjkXmK8CoLt1cej8yzyMEvwuBxPh5cduLr PPrMdZWagfAzoOEchPJqjgSpRGUhPMHQVNOdX6+VvrJ+rDqgxN7HI3z9NsmMchsKf474ThzJwap VAwVgsTidkaWX73l8zau25vZ4cLu5PFBw6zzINkfeL2kXQa1tqnIZmLIXFwQSiY/vujFRBkt9qF mjQzZLq2e3Q2u4/zTBX4ABYizAsqpEDrCsuMhD3MUqfDk6IV9BVj6GOBOX56c0ManuQ74Ylp4Uo 7QvtWd2ee5Gj3JXhkQNA/hNB4PYf1LlUT0DhyN/RWPRsVyz9IB3E5EtoXlJ3qsNbHmhz8aZAm62 kUeegd4pzVBnL+wgWZrO660GrD/XyYLL+fNErbwEeVqRDvS3zeuLHJU+G6Xqgtoq954zw12ZpeJ PTqR1fBj/ikLW0Oi79cVx61fpmmLUKN1sTmmv0paB0fRid5wJaMU8zTX2lpzQcc1KqCjfXF6y4A +tPwCEgRd3fNZVrfNUkrL+ar/Ezs3Wd5/iW5SLX31xBp5/GlnwbElkoWKO7TrYt8uRrsIMU2aeP QMnubAlw/C7ikEMIFgwxOPjQ0vrcQfLUCwmHyKGnFlZ8xLSxOw+/99fxWKfeaLNmpW9lsgxddQY npuCO8v6u166sxA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556124547158500 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 Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556166; cv=none; d=zohomail.com; s=zohoarc; b=JQBUqfmjy9OqTvXM5G3v+QTKrje8KP2POF2pmNL6Ooi1N0OccdevxOnInylogoPHlwyd5qKpP+m2ow7rBBOrMUeV7UQCWNWt6MWr46c17ju+i1GlfMOVteL/4DtU5vANYHQMfqqfAH+/dvEokzli72OGMPrC4jzXI98rBoIJsyk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556166; h=Content-Type:Content-Transfer-Encoding:Cc: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=LxoQeI2gHk69twQ6XwsG4qfRL6f0pUgyawNsSpANROzDen8C3BVMb2qGStjNMktcL9j37juwoda3Qq6f/nCZU/geJjPcNIFhOpDWaw8pQYtJeAqaTd23O2InNBGfV8L78LSqL8idCpAfmWRqaAF+J6cposNqTnWMcIXcK+dqdsA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556166940386.05396611201263; Mon, 15 Jun 2026 13:42:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE6a-0002ry-5o; Mon, 15 Jun 2026 16:40: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 1wZE6Y-0002pP-Hr for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40: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 1wZE6X-0002wa-6L for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40:22 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-622-6VuWKVDZNsKurZReR0Uz_A-1; Mon, 15 Jun 2026 16:40:16 -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 767F419540D2; Mon, 15 Jun 2026 20:40:15 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0BC861955BCE; Mon, 15 Jun 2026 20:40:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=OYMmEmctS4wU9XYqLy1tcncWjFy9qQXip2TdTpxJQZq8r+wlA0RdelWuSwIrUQG07AYp7T EfogRWcXD+jSMbipDONCZOWNbiwacVgCOhpl5hZkH7Fg4KmKqb0MbWiHiUS+4fP02LfSGx peUChlmfH3ng58bc9IMBOFZi63ksevU= X-MC-Unique: 6VuWKVDZNsKurZReR0Uz_A-1 X-Mimecast-MFC-AGG-ID: 6VuWKVDZNsKurZReR0Uz_A_1781556015 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:55 +0400 Subject: [PATCH v2 29/53] system/memory: fix "priority" property typename MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260616-qom-qapi-v2-29-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=888; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=Xrt1FBAZRulDtkYOHNAjkH2vkSnHoHVfXqM5I051WW0=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKPy7jRAwRM008+AO9MEFGo7G4JBq9wdfkBr 35mkuFGH2aJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijwAKCRDa6OEJdZac 5fmtEACddxwA8WP4p/Uh20BBnZfwD5v3m9304QzxraszLKnq88ValBStFs4ZJ0UR8iHWdbBINhM l3GIUlxOifj+QTHEZ54NmjuDE49M+AiX9Hc4/7q8egpD75xU04fMzRmx60D0YB6kkYI0W5xpfXv 18VhqaMoelnU/bkX+WkKvkBq9aiXJPlpUpUZ6jYFUIa5+k4E5LVl4fE5hmvNl6u6cDlPmRcyo0J u91r0y1md0XK3l6wjXf2mwurgqNX3p5LbJ+QlAZLoUb5cCHTa5ov3A1F2I8d+FGSF1KXqTJhCUl jCzC7KN/5rjVV6Jx1RwQq7N99DoAhNKOPN3OnpHrKVVtyU1DEFAVMmYrEZ8cMUfqC3teeOxv8nr /CztfDPjFEEQLry3MfaQ6fO8fKjdLGplpuvRPc3pVcxuXKnibxVQ4SVl8+9lTKFaDLgdivAbeLs s2uQ3y1r8s2pC2wDd5OuTGnET1UPiwyO/wNKF7fznhCbxHBrBI6t+05O+EutEzDtMzaSMdIZYuo 6C22cTYLMAnA4XMAnGHQCARM+L0zHLPg+5kMxySURAomGki4E9KCO0F4pY9oL2GxnhQtAalLB2p E4A9cLh26R7qs74qx4aTqot0/QYhOm9/OdOlQQNY93POJkf3erSBIHOmxWQBJRgt8ze/pzYusGt L8FTXCV9eQpuEmw== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556168768158500 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 Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556138; cv=none; d=zohomail.com; s=zohoarc; b=RWwtXZEgO94a1Uc61IvqFBIOFBvD7VwObjAY9zF2qMvhU49uXBk5QdeaF9aJUI3WyYbPEzCv4ukbFL3qxspM4iIcPy9wSbCvi4+kj0EMuo59hNJN5YSF2bDvon8L0Tur2aikYoUgXJc0yLrRTysTeSH4YEI/ZQYN/wiIEmVhivs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556138; h=Content-Type:Content-Transfer-Encoding:Cc: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=DoF9iUC9jnieNlhdLClv5kBnMSOjzEoyg/6tVBXCRRrLC3btbUAVvSsoouEa/NZh0lOnXRD1Uzmam9VSWCHz/atfM5Mg9boGJOfJNQxfRdHSidF258IxvgOn0J2ELBbktxtXN6RmZAi6aE8PxK2UeG1v8JfCqdMP9LaWEDHnp0g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17815561385181015.0458908737942; Mon, 15 Jun 2026 13:42:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE6c-0002zc-J9; Mon, 15 Jun 2026 16:40:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE6a-0002uP-Q2 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE6Z-0002xC-F3 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40:24 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-134-iTp-nj1OPIO5pnS_X2fxHA-1; Mon, 15 Jun 2026 16:40:21 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 879F11956065; Mon, 15 Jun 2026 20:40:20 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 41D8B3008B37; Mon, 15 Jun 2026 20:40:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=YRd0/cnYahjjU8fYaoaEBbY7w6gsc0CxHAXSdPBNBbL2AsijyLEZN/GlTtTkSri6Aq9+Hf RRt9fqfEG2bfO1VYcFWLooGtvitVb0XacM6KxNBHDd7lFonDtr+kU58CfJwGXHsEu98jOT B7avo/SoxCDTp2kEvHLacjRaxr/PPgo= X-MC-Unique: iTp-nj1OPIO5pnS_X2fxHA-1 X-Mimecast-MFC-AGG-ID: iTp-nj1OPIO5pnS_X2fxHA_1781556020 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:56 +0400 Subject: [PATCH v2 30/53] 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: <20260616-qom-qapi-v2-30-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=712; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=iLi46W9WFHxexD0wQx3j4fn0Sh6woma/VJ5/jKMvPFQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKPSFnFj/+Ic4gBtgNoXIQ9yBlour1jdUals Qy9fM6FHP2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijwAKCRDa6OEJdZac 5daNEACK4ynnCxQM54q0x/E5r0WP8+MUiiz0wRb/1W362UeqDWHbNlyJ15EhJxyMLsnVpqQ4HUb cNyENNVzVteY+yFmm1SYy1QbBcQgnV5hDc7/BW0f8RpKELFPdaCz9pnmHxdYM2AuWCeTvlnf9YZ PXAC/gY7CszSu89Zm9YvIfGwj/oFpV9qijdkDptYvA1D67HaQNvLieoZmcLtoLkxttc0CIgl2/9 EgE668/G9f4J6VfkviJkwTjNVPSnxXQslIDrTzGwUUzQuMVwSiHK7M5hFYJcfDrkLr5fzO8E6L1 0SpgGIOznJqiWVTnBK/8ebV8OqZr5YOBAWRjvRRd7LdoaCfMa5JQignNydTKI/znyIRWXYtGErT sv8y769ZuqsG6IiRFOwBXdNlSGSetHNnwJG5ngtqYWAeIhcYo2N/Qn0tITw5hnvcLWUaZCnBCxS k8lz9jON1L8pfEZ6HRR+ijnEKFWOG/GfWfaQK+vAzUIqqOlyekwPVd1ZfnFWdoZWVCUhFW5JWKe 3GdMZ+gV5FpOlbpTzuBuqAEi5pdQ8mxSfx5+8cKk0OQYRe459HOH4qYX67WvzzaVkOgDwLdYqBu +/0janWRYl7mF0nlNISUaO0s5fkbOVn5M1X5Cm4nyl+ofscix6agH+Sput4jyogU3gD9fLgUjBE Vrlomd7vdwA+UVQ== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556140566158500 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 Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556120; cv=none; d=zohomail.com; s=zohoarc; b=WgDdqyiG9d3oP1ysjIjeK3HIoyjHzno63Vz2gaHuLBTNR4XhpWafM67GhjDNBlyWtJuPTcNRVf4whAJ7/etTsTUxUkOW9Wv2fOTfsj1gi5xJxbYOFRnDPP/paO3iw+DTjH4BxzeENRB/s4+bkAgYiSa4jz/wHMkAM0DoVEZK910= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556120; h=Content-Type:Content-Transfer-Encoding:Cc: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=ZnnNupxWguigi8DRMAxMDfsERlDSYXV475GSx1RIrb4=; b=J+H/DmXvB9wLFA9Mim1vixToJcWV73hJu/59njGaHWjLCgMbznzK3o8VJCUlZDVOQSk2aGfMmrS5WOzk6ckN42Aga7n1CZVgYCj7KrxvgFBeCR8kAouxbGG3T0w9jusuaT5ibhporolGHraYC37BKm1PS6glRBzi8lai7mYfLoU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17815561203607.797029935327259; Mon, 15 Jun 2026 13:42:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE6o-0003dD-9C; Mon, 15 Jun 2026 16:40: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 1wZE6l-0003Vm-Po for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE6h-0002xr-JR for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40:35 -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-77-u-WVn10iN_6kim_QH5eSDw-1; Mon, 15 Jun 2026 16:40:28 -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 3F62A19560BE; Mon, 15 Jun 2026 20:40:27 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5F485180058F; Mon, 15 Jun 2026 20:40:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZnnNupxWguigi8DRMAxMDfsERlDSYXV475GSx1RIrb4=; b=K9BTDqxA+EyQzsiun5rh8VDN/Wvjhj7Wnq+8CU3ry1ufe2st5edVu6QLi+7B3XvkaCzli+ JVDAlKjzT+ghACcEdrN4+GI9JKjpX/+xiPZ/YJlz1jmYqwjwk4kinLUZNmmnC8puYyV6IC bLXwaaWoyu+e/fhZRUM3Dj5+9+a1fDM= X-MC-Unique: u-WVn10iN_6kim_QH5eSDw-1 X-Mimecast-MFC-AGG-ID: u-WVn10iN_6kim_QH5eSDw_1781556027 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:57 +0400 Subject: [PATCH v2 31/53] 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: <20260616-qom-qapi-v2-31-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=107033; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=ZtFoZ0Tg0NsFu+Pz5mdVbvNDOMkxnRsR2dPQaERxVYA=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKP44FqWYgW5C/4vZJTyeO67gOkjW8VAQfdB QSIZW9nuQGJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijwAKCRDa6OEJdZac 5bNfD/9VvZrrtZLlYAGMcKSpaXeKGCWbccHe5jGejP/NDnbS8b59Onhc20ysiftBUjRnAEpN3Ht CO1mBM8wD0wAijwyzxq/x7//C6vl1E/HEqFXV9r4DYhE9/xq9On7xtQV+rtIF8RStHgYdxYBIt+ W6ZrKKUXpRURlgHB8RUBd35hr9WIiAvTWZ/2xMaumZY2AQ1Hz9QkLzhpog0u5Jmb2DycYW3M72w qxMMUcOHzdgJsOAtZUwyxiTOywKB+71Ouo/SmDreGls+55w1frOwf3/j/kc8m+7TcJugyCfZtL/ mRaG+SzY/MlfvvrPgJj8DDAXSEraNqDImx5md/o6tr0w3l1baed2RrduafhdOx/5MfX2BCpG5IU emm9LQA/CKRjHMta0YPQTQB7FM8ZQh22Iv30zrmlkBHR60/AAAJgdD2IViuUzJ3sGmBGEMzQqyE Zsh3xfng+byT8O02xudCKebENxIVALG+ipN9/FCx+ZurDBDOH2p83Wj2KtT95544hVL/4UZYbTM zDnDpGEriJkLYbBJcFx9jahqFmNnLqpWPnCwq3wcxBc6XJ+Lys+LB7TUmnq6xvcJQk91sogXS99 Cy0NsCeQ4JEdotWYirnqeYVxGYT/Oi8iuftIiR1S/vLjycJd+7Vc/2KNooxmT0IwfbatZjuEQBM uhQLBoOMZMk9PFQ== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556122693158500 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 | 5 ++- 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, 335 insertions(+), 233 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 14e3c7fcc80..0742c9bb52c 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 295cc053768..0c793fdcf15 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -4175,7 +4175,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); @@ -4183,7 +4183,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 e3075592673..354e557d822 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1117,7 +1117,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 1cf6f5df550..0c90bcd723d 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 7d2f7369952..67b0c10d79f 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 472d8ad9571..5d55bd32ef4 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 836a26cc72f..86f20477524 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1680,7 +1680,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, @@ -1718,13 +1718,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 155763b1c98..361286019f5 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -420,9 +420,9 @@ static void x86_machine_class_init(ObjectClass *oc, con= st void *data) "in ACPI table header." "The string may be up to 8 bytes= in size"); =20 - object_class_property_add(oc, X86_MACHINE_BUS_LOCK_RATELIMIT, "uint64_= t", - x86_machine_get_bus_lock_ratelimit, - x86_machine_set_bus_lock_ratelimit, NULL, = NULL); + object_class_property_add_qapi(oc, X86_MACHINE_BUS_LOCK_RATELIMIT, &ui= nt64_type_info, + x86_machine_get_bus_lock_ratelimit, + x86_machine_set_bus_lock_ratelimit, NUL= L, NULL); object_class_property_set_description(oc, X86_MACHINE_BUS_LOCK_RATELIM= IT, "Set the ratelimit for the bus locks acquired in VMs"); =20 diff --git a/hw/ide/ide-dev.c b/hw/ide/ide-dev.c index 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 49c03a5bcee..43ed8cc29f0 100644 --- a/hw/intc/apic_common.c +++ b/hw/intc/apic_common.c @@ -22,6 +22,7 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "hw/i386/apic.h" #include "hw/i386/apic_internal.h" @@ -442,7 +443,7 @@ static void apic_common_initfn(Object *obj) APICCommonState *s =3D APIC_COMMON(obj); =20 s->id =3D s->initial_apic_id =3D -1; - object_property_add(obj, "id", "uint32", + object_property_add_qapi(obj, "id", &uint32_type_info, apic_common_get_id, apic_common_set_id, NULL, NULL); } diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 5b99c95fec9..1d678c7ae35 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 7f7e4f1a098..e2d9b7572f2 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 f8fbaebee6a..d096cc88f5c 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 815f39173c8..74f209946a2 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -202,6 +202,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" @@ -9561,7 +9562,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 40ffbc4e082..9bb7d3c9deb 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -12,6 +12,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "hw/pci/pci.h" #include "hw/pci/pci_bus.h" #include "hw/pci/pci_host.h" @@ -103,7 +104,7 @@ static void pxb_bus_class_init(ObjectClass *class, cons= t void *data) pbc->bus_num =3D pxb_bus_num; pbc->numa_node =3D pxb_bus_numa_node; =20 - object_class_property_add(class, "acpi_uid", "uint32", + object_class_property_add_qapi(class, "acpi_uid", &uint32_type_info, prop_pxb_uid_get, NULL, NULL, NULL); object_class_property_set_description(class, "acpi_uid", "ACPI Unique ID used to distinguish this PCI Host Bridge / ACPI000= 16"); diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index c1982f7962a..feafa6a72fe 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -32,6 +32,7 @@ #include "hw/core/qdev-properties.h" #include "hw/core/sysbus.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "migration/vmstate.h" #include "qapi/visitor.h" #include "qemu/error-report.h" @@ -387,21 +388,25 @@ static void i440fx_pcihost_class_init(ObjectClass *kl= ass, const void *data) /* Reason: needs to be wired up by pc_init1 */ dc->user_creatable =3D false; =20 - object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_START, "uint32= ", - i440fx_pcihost_get_pci_hole_start, - NULL, NULL, NULL); - - object_class_property_add(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 355e81bfa20..b952e81fd5b 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -35,6 +35,7 @@ #include "hw/core/qdev-properties.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/module.h" =20 @@ -226,19 +227,19 @@ static void q35_host_initfn(Object *obj) qdev_prop_set_uint64(DEVICE(s), PCI_HOST_PROP_PCI_HOLE64_SIZE, Q35_PCI_HOST_HOLE64_SIZE_DEFAULT); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE_START, &uint32_ty= pe_info, q35_host_get_pci_hole_start, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE_END, &uint32_type= _info, q35_host_get_pci_hole_end, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE64_START, &uint64_= type_info, q35_host_get_pci_hole64_start, NULL, NULL, NULL); =20 - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64", + object_property_add_qapi(obj, PCI_HOST_PROP_PCI_HOLE64_END, &uint64_ty= pe_info, q35_host_get_pci_hole64_end, NULL, NULL, NULL); =20 diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 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 5e48a297083..37319cb0699 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" @@ -738,7 +739,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 5986fb1e880..e5e79ce1091 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -16,6 +16,7 @@ #include "qemu/error-report.h" #include "trace.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "net/net.h" #include "net/eth.h" #include "qom/object_interfaces.h" @@ -1373,15 +1374,15 @@ static void colo_compare_init(Object *obj) object_property_add_str(obj, "notify_dev", compare_get_notify_dev, compare_set_notify_dev= ); =20 - object_property_add(obj, "compare_timeout", "uint64", + object_property_add_qapi(obj, "compare_timeout", &uint64_type_info, compare_get_timeout, compare_set_timeout, NULL, NULL); =20 - object_property_add(obj, "expired_scan_cycle", "uint32", + object_property_add_qapi(obj, "expired_scan_cycle", &uint32_type_info, compare_get_expired_scan_cycle, compare_set_expired_scan_cycle, NULL, NULL); =20 - object_property_add(obj, "max_queue_size", "uint32", + object_property_add_qapi(obj, "max_queue_size", &uint32_type_info, get_max_queue_size, set_max_queue_size, NULL, NULL); =20 diff --git a/net/dump.c b/net/dump.c index 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 1a3e224ea2c..f5d3e1e1e00 100644 --- a/qom/object.c +++ b/qom/object.c @@ -22,10 +22,10 @@ #include "qapi/string-output-visitor.h" #include "qapi/qobject-input-visitor.h" #include "qapi/forward-visitor.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-builtin-visit.h" #include "qobject/qdict.h" #include "qapi/qapi-type-info.h" -#include "qobject/qjson.h" #include "qemu/id.h" #include "qapi/qmp/qerror.h" #include "trace.h" @@ -2438,7 +2438,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, @@ -2456,7 +2456,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, @@ -2508,7 +2508,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, @@ -2525,7 +2525,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, @@ -2814,8 +2814,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 * @@ -2834,8 +2834,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 * @@ -2854,8 +2854,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 * @@ -2874,8 +2874,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 * @@ -2894,8 +2894,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 * @@ -2914,8 +2914,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 * @@ -2934,8 +2934,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 * @@ -2954,8 +2954,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 28167355773..62c0fa5a9e5 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 a54ef51ec2a..e1709552f68 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -20,6 +20,7 @@ #include "qemu/main-loop.h" #include "qom/object.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "system/system.h" #include "system/runstate.h" #include "system/ramblock.h" @@ -1776,7 +1777,7 @@ static void kvm_arch_set_eager_split_size(Object *obj= , Visitor *v, =20 void kvm_arch_accel_class_init(ObjectClass *oc) { - object_class_property_add(oc, "eager-split-size", "size", + object_class_property_add_qapi(oc, "eager-split-size", &size_type_info, kvm_arch_get_eager_split_size, kvm_arch_set_eager_split_size, NULL, NULL); =20 diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c index f7a920a202e..d23f92a9bd3 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" @@ -1431,10 +1432,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 3f0d8d8f1e8..58c78a8c607 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 63ccae4c26c..53d3e310c51 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -3179,7 +3179,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 5903df99548..a63961bb713 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 "qemu/timer.h" @@ -1021,16 +1022,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 53d88339c13..de2a91b81b4 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" @@ -529,7 +530,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); @@ -549,7 +550,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); @@ -565,7 +566,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 3e22e7ed53d..1b9c68bff54 100644 --- a/target/riscv/tcg/tcg-cpu.c +++ b/target/riscv/tcg/tcg-cpu.c @@ -26,6 +26,7 @@ #include "pmu.h" #include "time_helper.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/visitor.h" #include "qemu/accel.h" #include "qemu/error-report.h" @@ -1438,7 +1439,7 @@ static void riscv_cpu_add_misa_properties(Object *cpu= _obj) continue; } =20 - object_property_add(cpu_obj, name, "bool", + object_property_add_qapi(cpu_obj, name, &bool_type_info, cpu_get_misa_ext_cfg, cpu_set_misa_ext_cfg, NULL, (void *)misa_cfg); @@ -1492,7 +1493,7 @@ static void riscv_cpu_add_profiles(Object *cpu_obj) for (int i =3D 0; riscv_profiles[i] !=3D NULL; i++) { RISCVCPUProfile *profile =3D riscv_profiles[i]; =20 - object_property_add(cpu_obj, profile->name, "bool", + object_property_add_qapi(cpu_obj, profile->name, &bool_type_info, cpu_get_profile, cpu_set_profile, NULL, (void *)profile); =20 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 a7c977d0c44..014061f0fa0 100644 --- a/ui/console.c +++ b/ui/console.c @@ -28,6 +28,7 @@ #include "ui/vgafont.h" #include "hw/core/qdev.h" #include "qapi/error.h" +#include "qapi/qapi-builtin-type-infos.h" #include "qapi/qapi-commands-ui.h" #include "qapi/visitor.h" #include "qemu/coroutine.h" @@ -509,7 +510,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 Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556127; cv=none; d=zohomail.com; s=zohoarc; b=KkkUDO+S7LvXsY/3yyEkZyKjhOT8d/ciz1PTSaT7R50I5fIOdPjOj7MVIU+SmforokgZEYvc6+g/EdRRXeZPvYuW+rriqVgAuQkG1BdAKLHLyZgbqmEMPRxNlThsX0rt2B3NeQZa1LlS4Q7UT9mvOC59mhNx1Mdv6/66MqQ2Kd4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556127; h=Content-Type:Content-Transfer-Encoding:Cc: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=VDdHV+u5xVOm5TX5OuF03EeIEtdxGVK2RRenyTDI5LA=; b=KgD2R0MOgrxS5l/F1T/CzfYPpFBe8lfuJud5jUna+GX1OVAk5ofqq7XgCUCWH7WyHz/LFHnpV3D5ppBTQ2cMQ3ZMJ9lzLBuXWQiHDoaCsm4Yu3i2LygUvo2nyKoFvdOvmlIjmT+SPb8xPhjcA1GPPeD5cVdr8LSMhgvKhsV0tt8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556127621639.4033633301348; Mon, 15 Jun 2026 13:42:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE6p-0003mT-PX; Mon, 15 Jun 2026 16:40: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 1wZE6o-0003fz-NK for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40: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 1wZE6n-0002z1-6V for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40:38 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-553-jiPscIUcOdyQYCM7YZNKhA-1; Mon, 15 Jun 2026 16:40:33 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8399719540C8; Mon, 15 Jun 2026 20:40:32 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 35105175F; Mon, 15 Jun 2026 20:40:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VDdHV+u5xVOm5TX5OuF03EeIEtdxGVK2RRenyTDI5LA=; b=V90nJRy9b3XFAKz+/Z1htzze1an2167w7AVMP9x6cVsxYQmDoeaZ/OGk6G8Mv0326pLoXq S720fw+Y34dfUnOqCO3GRmaz1em4588keJnMAfWSsm6hD/3E/zYy8IIaHfEQHfkQ1fPray HCFRqwCAksd4fX4GIgSVJKLaQUTZorw= X-MC-Unique: jiPscIUcOdyQYCM7YZNKhA-1 X-Mimecast-MFC-AGG-ID: jiPscIUcOdyQYCM7YZNKhA_1781556032 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:58 +0400 Subject: [PATCH v2 32/53] 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: <20260616-qom-qapi-v2-32-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=853; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=pRtghQRGIgiJRIEH4EbO7vUwTGl/maCWO7Fl2qaxKGo=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKPFZpnkh0CneUTj3gPQ33HKKYd0SU6vhBwE kkeIIzRxBGJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijwAKCRDa6OEJdZac 5RJ4D/9rXM1D7Cpw2A0icaUPtsHmWGBDuXXftAZWgcZp3YDU+PY4UK6lbrTibGmFwoqyxrYC+6A rB5INdgWtTn1kkwkK23gGSZBqBUFmPqaA2kPdwIJ084DqV/R+JUt++z8ad+NrEeX+9dqzuioquz XpuS+gLBVBjteWjMgIl2dyXhr3J1dO2Xpv1swZeuCgxg4pRaaB8udFWohNbHf2AF2/IDfHWLahq 8dhhtr/3kRzAvJXFbBDeQQeF7I8WpydGeVk0RzX0HgeKoKImiZldHPnmL38R1Xfez+P3v4p4VOP Fwncsf4XRfywnt7WYjfOsdBk51M0DYl2lw6z3XoXeE6mJUnTzgzSxROfsmxnT8bP7D5uyJxZbw6 O90AdUXvVBPS/s6tKNmQaSTJpSy8m2cyKZFwe5fbmU7Qx5pUPpsjb5lEWUzTcj1mY1iDpJPQ4K3 AdFmtcIuUvDzy6/wQ3EVHz7Pxc5mjLlOCwHKHK5fgJvWWDpvJM9jr8E8uBFKBKRk9kloScoxBJV 1pF4Wrz6C0cYbJNA1iBeLYEieor7q5EaNcV/Bg79hQ0hX1/OIW7p1Yk857y/Wtm24D4Pnh4Ltws 6YVBt2tLEfyXSEAjdwrqXh3V1h9BADUrVGnItK+Ki8qfS/GxsAKtaTQRW9LSOWcr0fg+stQg0xk G/uAxxA+3warXtQ== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556128496158500 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 58c78a8c607..7a3ca9af02b 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 Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556234; cv=none; d=zohomail.com; s=zohoarc; b=n0Pn9F9QdJ00N23w6vUh0kKU6sqLhJerqZDyr0fGrnmbidpBHZF4iBPe5NvPgbMUgNu1hjvHmRazqTcDqw1YZTnyMt3b7UTxrKq+8oNs/U/4bGLTDLj4rmHJw0GpT2biDWcmRY1XLT9+OONlTDBXLPI8wz52SHuO12Ehbt6AqFQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556234; h=Content-Type:Content-Transfer-Encoding:Cc: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=dBhMCb44FvPRsTO+Hcltdx6c/0ZsV3fwnABdFzfrQDXHdB94gwiCNAE2uFdwe61+TRyYGgcdbKk5eKmX9tRc/Q2c+FCgspIfJiM/Y8M6HHc9TRfmAWumAyrIhHhl4YewjnOL1BxZpUsoUdE04cypnqhO+gHAdDTM33vcbyGqd+U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556234113148.01657833452157; Mon, 15 Jun 2026 13:43:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE6t-0003x3-EO; Mon, 15 Jun 2026 16:40: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 1wZE6s-0003vT-1O for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40: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 1wZE6q-0002zH-J8 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40:41 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-34-35_JXF_2NR2qM7PL5vYFhw-1; Mon, 15 Jun 2026 16:40:38 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CB4D61956094; Mon, 15 Jun 2026 20:40:37 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8C5713008B3C; Mon, 15 Jun 2026 20:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=ipO+kkNo7KYSDM6BkKGyyn73iqcNajE1RIY75njYKELcpG9tOCc11qJlylA3Lcj1RpYsdU 79M9du0kJpP65tUHkAAJycSUMYmYscdaqg02sfNpEfCJNKrtijHAhQf+if3Q4JAgzVZGx9 TlbnvvgEQr5z1zCDAkcmdkRgEbFicVA= X-MC-Unique: 35_JXF_2NR2qM7PL5vYFhw-1 X-Mimecast-MFC-AGG-ID: 35_JXF_2NR2qM7PL5vYFhw_1781556037 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:37:59 +0400 Subject: [PATCH v2 33/53] 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: <20260616-qom-qapi-v2-33-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2484; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=iwbaeAoF/33Kw17kEtq0TnwDPZ2R6UiTQZltouoz2ZI=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKPRRqPfaz6YVQYXpFxXByJt8GkUmnR3s82u ZUKm8RghguJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijwAKCRDa6OEJdZac 5cRlEACrOO7TPqev9hqrri9eFUuoqoyKdNMfVqXfWDl+kJXQ/dL/j306tFjkUPc8EPNIFXpE1ci Gmn8cZwmwPjuOdH6ynK77tk06JJO4nx1xQILcrf1vfa1nGNN1JJSK/J2VoCy0QIrqZ1AKy72U2N T/IBT8MNUT5xPR43YT8MmuSjw5NExmMjSh/eJq784ZRBM16b5pzXQRAR4ZNRU0kPNqSGQLxi86p ZmPzSMGPHl/wpPveUiZPZK8bCmhmWiTTGPoqIWY+rQpxosssyMMBR0WLbOgtxzHCpQP1zB+/Dcw Ff2+iMoQrdGrjtipZSSeLNzoiYQvgsAEeIi35V4TU1ksseejz+hYLLro9H9tSHS7MbC8sglvwAV u0drRVJW0XL+mxQQPsY352EkmU5jXS6dvB0DX2w2AojMFMtqcQiw8QD/rdIbJj36b2G7spmo4lE tQRMO+srb1Y5wH0pQ9FIW/RmfwOuZ/47pwQsVe5+5qLOcQzKXCeKNvz8nIx/c/8jg4hMtEf4u4s qizHZPxjzmGrCf6jFB4Qup7cDF3QXXP9Lh2LBErApxAlQRiRVIBnIeD3Ro8fMCF1xoIHMz0nNug zd66mJWS+IKxsyxoKkjK8alUEl9tTg+kKwKQ1I+H0AGeHIk/VMFWY/jSvIOseF/UXE6mri9ok8b YqdcG+s/VnqVJsw== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556235054158500 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 Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556057; cv=none; d=zohomail.com; s=zohoarc; b=CQbrV5bSj/6EbKFpTS414SYAx23c3s/OnwUDiAWGe8qeBFzzeOmq5KE7N4I78fCoPkJjyQuYaV9zzPc/d91Iycm/dLz9rBinb04EXiYBloBsDLbubf8z1+kNBgAbvp9PhxDwBt3oI2uzhtGPoF2tTogM4biUYaBf/JbLSZSYGx8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556057; h=Content-Type:Content-Transfer-Encoding:Cc: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=r1i/ELmR6ce5TxH25PBTsw4TXMlPSKUoUmXgW6eSf8w=; b=VWB7coIyuOh8DYC5uglaafh2yAbw81f2/YhynBDCaHGgAD7/IwuFK5Z50SwyoSnh154J+RdKL4Bsy/2IWGt5m0Ks6Rc7v769bMiAD9/rFZouVvJenA7N2Lub/8ckK71T1/MXsZ6xXIKVnPw9BdiCbqC55klSM6ZX36fQHe0mPeA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556057837725.6964907598807; Mon, 15 Jun 2026 13:40:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE70-00040L-SK; Mon, 15 Jun 2026 16:40:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE6z-000406-FC for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE6x-0002zU-TI for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40:49 -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-59-9h122AkRMQeY5zbb3eC9nA-1; Mon, 15 Jun 2026 16:40:44 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1A7AA1800D9C; Mon, 15 Jun 2026 20:40:43 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D48A6180057F; Mon, 15 Jun 2026 20:40:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r1i/ELmR6ce5TxH25PBTsw4TXMlPSKUoUmXgW6eSf8w=; b=AVHbfzdfj22l0T5vsYT0HdwA+8sugKmeqXA0GYdQOBAmxTgjsgHmekaonFfHtNKUx8QsdH Iz4uo2FxNNBsIyJD01srdWSLk14U/Q9PoCpibHO1ArhYGh5HWSBWn2Gj3HbZZEZ+45Pqia btpqF2Ha22iTBiWfRcU/rqjefyNDIYU= X-MC-Unique: 9h122AkRMQeY5zbb3eC9nA-1 X-Mimecast-MFC-AGG-ID: 9h122AkRMQeY5zbb3eC9nA_1781556043 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:00 +0400 Subject: [PATCH v2 34/53] 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: <20260616-qom-qapi-v2-34-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1048; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=WUngJgOCn0YUIU7MxgXyN/pm0PMoj0Z05vKbkI0PuA8=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKP5QaPq7BY8nlvJmtV8mrLHX9wudNT1OFjl UUFMabGCpuJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijwAKCRDa6OEJdZac 5RCRD/0QzuiTIkjF+mIQJbSuVZR5PNZ3xdRmfk5lUbvmh6/Q3Ft9THyMghksROUA55WssZ4aaPr bLNVLKGbiRmKTEex43AaE8gzdRUHjNszKd8xXpb2Tz8DDhe9nKfPkjxlBUErw3IHG4hIUS9h6DD JaP5GsuiI5SM0t3fCZLkBo6jGvZw3GevRxv+ZD3pIt5FYWBh+O/G8xMHFNsEMXU5sRtc9vMMqqu N+WEnUtXtb1Li5sTwGRleBw+RLe8HdKASYG4h8S8XjdTVtufx46uzAh/yoGBvozRFm/kJjlhDcv okXAHcCGdiTjSg4R/gssWCvZM90+9R4Zym8xeUIA+w0ikwIf5R2mg3ukBFrL+a23MjbIeJ8TiG4 aH5HefActUh5IJRXRqJuPT7iCuisBDc7fLUAKyiVzCVUBvl8Ittinzjvrk2wb6k5+hVOSdSnoQJ CJbxAIRU1LpztB/sPOMjME+YGXgxtaSaYvtBsNLv+FNWuqduAF3gn6KaqWVHpYEHmFWAGgJpQ4j 806/nKXAyBXCRSKZkMosIpWx7ldr5CAsx5qtgXXyDlhuuUoRdtGE+i6Kd+YpGel0XfU6IoV6VMj v5khBbD+QKLd7np3qZKQq70z8AayCzVRTvLDZwjro8qSQFiKmtD0GC2HHNvVP9cJaM7U5803OS8 alg/yRDRqD8Iwqw== 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556058146158500 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 361286019f5..6cfa4e03269 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -25,6 +25,7 @@ #include "qemu/units.h" #include "qapi/error.h" #include "qapi/qapi-type-infos-common.h" +#include "qapi/qapi-type-infos-machine.h" #include "qapi/qapi-visit-machine.h" #include "qapi/visitor.h" #include "system/qtest.h" @@ -426,7 +427,7 @@ static void x86_machine_class_init(ObjectClass *oc, con= st void *data) object_class_property_set_description(oc, X86_MACHINE_BUS_LOCK_RATELIM= IT, "Set the ratelimit for the bus locks acquired in VMs"); =20 - object_class_property_add(oc, "sgx-epc", "SgxEPC", + object_class_property_add_qapi(oc, "sgx-epc", &SgxEPCList_type_info, machine_get_sgx_epc, machine_set_sgx_epc, NULL, NULL); object_class_property_set_description(oc, "sgx-epc", --=20 2.54.0 From nobody Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556146; cv=none; d=zohomail.com; s=zohoarc; b=MNH5z31R6abSUZcYS9etHBDiYUsDDn0lmZprBkar+tC/k5zkWPkEVP3Ai5NPvwkMno1NtrypRqDl+EQ2a7T1A4KcREUXXnsgzsqJoMjOt7599pKzwoh/7DdyjzoTyH8Ct25+Yh4le5r9w6B7iUbLyCdLZe8eSGVBANOBZ8QYW6c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556146; h=Content-Type:Content-Transfer-Encoding:Cc: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=AUzBfrxGeJi/2qrykWaQqZiA0Tu2WvAruIx3xhmA8TjheEP+Qh4DuOt3Epf5Hr4TukWZ6CGet5fJoyRq7p0Kw3faRRHs+Sfnu8hrGsZayZ0vGpYvIvlN2G2A3Qy2t6G/22rXA86rFCvxWh/0iSEOdPf/TzFm5LDG9hkgFGSwZao= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556146691984.109844229776; Mon, 15 Jun 2026 13:42:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE76-000410-79; Mon, 15 Jun 2026 16:40: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 1wZE75-00040d-8z for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40:55 -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 1wZE73-000304-9z for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:40:55 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-558-inQYq1bTMJ2fpN__Qhc1Nw-1; Mon, 15 Jun 2026 16:40:49 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A20D91800345; Mon, 15 Jun 2026 20:40:48 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7160719560B2; Mon, 15 Jun 2026 20:40:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=E7AsSsetThPklIfo9/q5SaBejVBsmIngq+mnk38MpLkLEC1X5259tXZJU+lyrbJsEOPF19 Xn7rkI56XzD6hDeOWOonjJ0XxgCU43yWZ0f2ig6pUVQA606arzHWgXkkDA2EH1CAheu247 BFma1Pl4F6c7LH+67Mg7pAHF73+2z08= X-MC-Unique: inQYq1bTMJ2fpN__Qhc1Nw-1 X-Mimecast-MFC-AGG-ID: inQYq1bTMJ2fpN__Qhc1Nw_1781556048 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:01 +0400 Subject: [PATCH v2 35/53] 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: <20260616-qom-qapi-v2-35-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=10057; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=XCk/M4Otn8oLL/1a9v9H08MZ1uICAg0OSwJBeYuC2LI=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKPt/eOowbKeYty/ipPETkYX6tMK5d2yTCmk 1o9EzvIpC6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijwAKCRDa6OEJdZac 5a87D/0aONkurI0Istem1lRgIKaiFnHFN12tNFuSf1vTqYNpaAjFZqmjuGaPCPQjshun9Dngmab 0NOUupnhDySe1KbHMLIKdiA4sTkud6TRbp4uEkmUICxbcrEZu7uhb2qY/meuutgtwpbYafv7Ijs tFs10HGk/Wty3ekImgWjyasSedp3D+8W+KHn5yMjOcp8oRToxMqMt1uuXponV7NX2vnwec9Od8J s/9Q4annZs9Vk2l74EgExiYxb7coWGK0XQ5cLJkia+EsF526ISRFDzmplDcAvCiE4TMzr9dxLD7 Hty4Rme2sYS4LFVZxq55775I0ExA9VIdj4on0BSndJr/DMhbKZCBnE4jCdQUC4ROf3qhuy3Phiy Fnc41x3RiPfJJzDEKxY5jeZBAe9CkWCvholdffar/yLnKKae8o5ly/oZ3Q2hwlHun5Q9E1EW9iu BiFBXqwd0+RIfM7L8c1hHxq7lrOO9jKO+7f0dh9hEX5BCKugr9kocVovpIh/hL3ffmm8gY4x8I7 mANrKlpIheQ6s7tNJast6tQl3WZQXD9eHg1Zs6AQ7vxNxbmsZf6eObopOH/ZHxOHhwOPcbbAeAJ mx1yO7g/kyFqqPBaWLs1vYUTrzyq+BY1kMgY0+ffbZcj5W26N5RRcIlllqQiMYjLIVkyKf1rsRE riR3yh3l649dWrg== 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: 1781556148708158500 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 Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556097; cv=none; d=zohomail.com; s=zohoarc; b=KhOLYR+7jJMTFgwQSOnu31vOaVVVNyeFUihYXi+fN0eBlVTKLRjF61PVH9wwx7znVtAH+G/kTxZUXPOFlax+twO6fD7XACVxsDyxOmYylQCYWbBa4p6T9FyG/ciAnv9tFhesiXOcExrtgdkO2oU321HgfUs2QG2OvjAhGoG8t58= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556097; h=Content-Type:Content-Transfer-Encoding:Cc: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=06BCxWIgvVZIr0RIZijKZ4A5cFtpiYIWJJpG8SUXkHw=; b=HMIbXlJ501EliIse6J2gKOgASRaf9E1ZDrej+IvHuV50ic/SrX8nqC7u6009FYgWHZUBp1f1YaYIQliIHRvCRHbTCt4d6X09dVcU7Kx8ZVTLlaCS9/D7k8t8s/Gjd7+B/phUG5J+PEVWNm85Z+HjVcRPxSmDNdllvXSukfFvTFI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556097517795.1197595589392; Mon, 15 Jun 2026 13:41:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE7C-00044g-Dw; Mon, 15 Jun 2026 16:41: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 1wZE7A-00044J-Ly for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE78-00030K-RA for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41: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-463-8CUqazM_NPCvTC60RqCLDg-1; Mon, 15 Jun 2026 16:40:54 -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 803E819560B8; Mon, 15 Jun 2026 20:40:53 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6BB6C180057F; Mon, 15 Jun 2026 20:40:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=06BCxWIgvVZIr0RIZijKZ4A5cFtpiYIWJJpG8SUXkHw=; b=grPUqWCqHlHVmkOY+lmsz3wh20tUwlOpDYrMVnxol/LxKdOLLzwPUuwqLoU7JrkgvGhhjQ SviNp3xg7VD8hkJOTRZto4U924sfAwU37e0e/aqS9SpvGja3hB7o+edmmcvtBu1mjn8ADv 9o0Q3nYo7EaC9CsToBxFmlpfNGl8u0w= X-MC-Unique: 8CUqazM_NPCvTC60RqCLDg-1 X-Mimecast-MFC-AGG-ID: 8CUqazM_NPCvTC60RqCLDg_1781556053 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:02 +0400 Subject: [PATCH v2 36/53] 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: <20260616-qom-qapi-v2-36-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=9338; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=IWOqXUOtSMStje4zEKM118mgSywsW8pyRXQ1/sw2sqQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKPNhk9xJPOfkHyQn4e/0rIhMFjo+UOxCK9R FCB8THOWi6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijwAKCRDa6OEJdZac 5SV/D/9N8ezyMX0catPcG7ZFFR1Yt27mv9qPuCmCyGNQLPFP+V0a3daammDpqop+Tx7k4cVk6Q8 QqPtuF5NqyZFjkIET6C4bJhk8QlQjtfYIEIkf5s7vyzJNuBspNOU8bMUXnf//i/ai147+oOClkK qE+GudoDGGe4M1b1aEn+bjF6JowWCZq6jdJz+ltT+amVdK7Y1fb7e3YlLt9fxNHnJKh1ZGAPhOg 0vriA2x3ijp/hb4m3CO8Ho5PQgoT9gIpSc7p6nsu3BhzGrjwBs3i74AguWSCgnp8k2Lv6uIvWPQ weJS3/vDDIZhjoaF4fkNcRFnXg4At4NqylUDhhkYwB8fHafjtl/XIOtGcN5uPO8vRNr3+kBEuOG r5ma/RnB34W627AMyF9oEUxdAIpWwAahaWWrq32xPNmsw6TjEscySg+a/64eIsiVQxsrPMT+3sx WVNR/GKvB//xsOcs+/1vJMeixX5YygGwSR0GkQLjhFNxMrTMiFZ7XeMtD2/5TF4wejZ3HAnEGA2 jp+y8tWqXZdCJtG96X9kANWxotsSdEoprKPO0fcYHPRLqMfcXqKHg/8yhnF9+xynSFZQxmuyXve 2oV5q6gMvA3cmj2nE/MVe3OZsyt957JHPe/VoqNNDLULXJuoLZNoHmUfcDBgM6ta3ibQLKJWans HYS++FVngz2/H5Q== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556098562158500 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 0b2089bb9ac..c8dc9d5bd2d 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1993,24 +1993,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 bcab018c7cd..8f371ef6867 100644 --- a/hw/rtc/mc146818rtc.c +++ b/hw/rtc/mc146818rtc.c @@ -42,6 +42,8 @@ #include "migration/vmstate.h" #include "qapi/error.h" #include "qapi/qapi-events-misc.h" +#include "qapi/qapi-type-infos-common.h" +#include "qapi/qapi-visit-common.h" #include "qapi/visitor.h" #include "trace.h" =20 @@ -854,12 +856,19 @@ static const MemoryRegionOps cmos_ops =3D { .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 -static void rtc_get_date(Object *obj, struct tm *current_tm, Error **errp) +static void rtc_get_date(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { MC146818RtcState *s =3D MC146818_RTC(obj); + struct tm value; + StructTm tm, *tmp =3D &tm; =20 rtc_update_time(s); - rtc_get_time(s, current_tm); + rtc_get_time(s, &value); + + tm =3D (StructTm) { value.tm_year, value.tm_mon, value.tm_mday, + value.tm_hour, value.tm_min, value.tm_sec }; + visit_type_StructTm(v, name, &tmp, errp); } =20 static void rtc_realizefn(DeviceState *dev, Error **errp) @@ -920,7 +929,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 f5d3e1e1e00..486c36e1cd9 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2643,75 +2643,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 Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556142; cv=none; d=zohomail.com; s=zohoarc; b=Nx9NtMnAdnz+5EcC0kDgZJEaesI1jxrwJnxjPayW1jDyFG+B53QpYuy2reF1PIFmhczPgo7n8TzN23qp6OLpgU4sxN/0izlfgxPL/V39Wr2R9rxtGzgGnQU9uQL7WurDCCEvP/nAfT/nlbzWo7tsJE/B4ZBlvl3/jpizAHkZ+z8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556142; h=Content-Type:Content-Transfer-Encoding:Cc: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=kgGY6MTGpzXYbT83f8SAaAkfBnpjN/b05QGGWn+iQQi8sKXBiNBuYVBujoflC9QxQBp4rP6PkwDHYZfSayPEGfnGD5hvpeN409l9WRsv9rj2GfJjSehAQ6/PNKRr7ctASmDCbND3O0bxiQlThg1H9uL1SIR3pfkom//C+wAqUnM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556142681130.04495222123398; Mon, 15 Jun 2026 13:42:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE7H-0004Et-RQ; Mon, 15 Jun 2026 16:41:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE7G-000482-H3 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE7F-000313-1B for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41:06 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-371-c_2yxKOgOKKx18auCeWlPA-1; Mon, 15 Jun 2026 16:41:00 -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 ECA351800350; Mon, 15 Jun 2026 20:40:58 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BCC321800347; Mon, 15 Jun 2026 20:40:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=RQ78+68nreHBizpA4WLyc6J+/VdqF47WqMPTyVRCLamFWtIY9L1U9PUmRKTITOnEjyix97 5+0wYAb2WhhTI9BZIveOhy6sWQQlK8Juckg3e3aHMg+ejUSUMnF+3WuTtg0pTUG5Nkl4gG tcroJPdFr7ZsOpdmt08EnjoT4ITArTU= X-MC-Unique: c_2yxKOgOKKx18auCeWlPA-1 X-Mimecast-MFC-AGG-ID: c_2yxKOgOKKx18auCeWlPA_1781556059 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:03 +0400 Subject: [PATCH v2 37/53] 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: <20260616-qom-qapi-v2-37-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2291; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=fjqQ6W0fz1f2OTCsCzNtLVDoI46ZtMBL144FqIZ8uxQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKPFLDMxrAkxtSWda8csDteRsEai2Gr6mM+0 bn0BGHRQ/6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijwAKCRDa6OEJdZac 5VewD/0cfnXBQdr2gidDt2F1WRZZdT1YsbNayWFJK1NDAFYl8LxZvQs60M8TXdE4pRrPBmGxVKM axn1HCB9Ikyk8a8W/Tst2HoEiNmGuha0cpmkJtsWJ6Wva2vWRIatxPjPXDje72Nhu9xr1tFVYvx 1bf6J/3NqyNWXD4IJVfmocH1QRFdkISjkXynfUTkb8V54+sV7RSqrSd+pMI1I2QG0Dcua/rkCwu mJlclqaUPpgXT+84ZCOdxeoIivH5TSdWLuBY6KphY35a74D44hdlGgaS1cYXmdIoyL3OgOo7+zo PLYOlTqnh7pbuUN8QyUDjMDryYL5rlBOp3V1Wp2m02JIqLZCVRm1tU8EuWgVWNvQrs8oe2Ag0lU /IZPdq5bXEODpK+7fwrEm+8mvtHgXCFw7drnkgRQ3IOadkgpaLB1ghVGE0XfTZ9lC2KIsyk4Egs 7K123xXhpq6LEDq49SMO84zcTZQjQq1Mv7HnYS4CEeE0bwMEHx62hOQK05MJCOIqNG833ca55MO XO6xxDSdtUYwTK04vvB3jbA06P0+QQgmlQQHVjaC+L7S2ZL5Ex7a4+DaP2Ue4UJTjF1fhgBoxOy q3ywutEt+39OaVuQHtDZEqsW8yEMHiwHAn/2aXAQmkC3vu+YfSkGGG55NL9YjPItHq5JbOlqKbb EK6HSKx1H9tL2SQ== 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556144599158500 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 Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556185; cv=none; d=zohomail.com; s=zohoarc; b=cS3N67Ic/8Ow4mY14rCkbkS0GIbI+ckyaOKF59p6fzgHCpOCNatt0sZQuxPMKPRYZpwCTdaZ4/7E69dxeOSpnmWbOdhiwamkZz1ZnIf3ZUW7bhCkuYA7/kRloFzTBS+KKDGBXodW1n7bdlOjPJbh4YVoc78vPvDCb5wKV1WnZ+4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556185; h=Content-Type:Content-Transfer-Encoding:Cc: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=tRTIuFaXKBodOo6whbv5vzHQonso1L+1FMqyIqbmFbU=; b=CEdpIkpU1oXzb+gNpYImrwcY1jti/MtRd6ryZ+hvFIzByOmmWdm7Gjf3viCsHEx+grK2SoKG7P9RwPGmXqXV5P8Xqj8oc3KEu+leLcpZR9nO/IK175QAQW0taE9dPXWfgNKarkDDbAkonGQmT9z5xJOk+5EEqdgzf1dnnLkcCzo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556185000383.2105565871402; Mon, 15 Jun 2026 13:43:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE7M-0004PR-Mp; Mon, 15 Jun 2026 16:41: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 1wZE7K-0004P5-QS for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE7J-00031H-Eg for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41: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-270-xhwX5otyMmSzbSGLTTcWyA-1; Mon, 15 Jun 2026 16:41:05 -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 28B8718002FB; Mon, 15 Jun 2026 20:41:04 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0747D3008B37; Mon, 15 Jun 2026 20:41:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tRTIuFaXKBodOo6whbv5vzHQonso1L+1FMqyIqbmFbU=; b=gu+wFi8oOr/ZoJgwiu5ZJNgA6WjX/O0uR3f3DNK7Gqfz/Pp+YFIA7LazFnwIp0ZH6xbhQa bDGWciTxZyoO3zFa7TBI93Rl5BEnl3s99W/P4We4x5a1SxpCpdnRiBrfLSavPLUxB1IJEx qkUnmbJfw+6tMRdkykYmRXTBFnICg1I= X-MC-Unique: xhwX5otyMmSzbSGLTTcWyA-1 X-Mimecast-MFC-AGG-ID: xhwX5otyMmSzbSGLTTcWyA_1781556064 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:04 +0400 Subject: [PATCH v2 38/53] 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: <20260616-qom-qapi-v2-38-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1348; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=Gr//4i4oILxW+6Clh3DeXOPUNZCuh9dYC0ICaQZD5Tk=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKPFUDXY7sdmhgo3we7h1QbrF7nYmdYHOFMW lo4AqMTvLyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijwAKCRDa6OEJdZac 5XiREACvMUNq4MJ5XzmnmpfsjQe1VgvDamGoJCaC21rU+hkSDt79GESNdCghZ25KdDogbLC8bDS aea3FZX8d7/ON9TQ0WEcDfIApc3cHd+XdDGDgXnx0Jdu8d4xsmB9lQSKmR+ntkV/A3Ho+JUVjt3 2cd2C3h+ivnn8IaLLwKFM8H5rUtXkTMXWnyf3W6ZwAdY1GY0I9Eon6BFQsxjMb5/qNIb9oAkaSZ WVTMedy/3FkhrCCN0Q+C50+v9yysFvozno+w1ZsMxKy7Gu2ECHFz20Wpd1JMDv2gHVFmb1rXtbI lcB29HnfJxYWp7C50xOgPR0MiGQBOhX4L3SznsMrTjtfzPeB0hxwr8CueWuz454/rDGm/Xy26kt 9c0gvDJc9L18LzlcGmryw+jf1IU4O2gF3IoxMl2CwK0gFEsnuW3WEjIy3fv2T7MVxRonFJW4jrX YtCJ5FPb9lsN+HZcMz4lhxWDXNmL99baM2/xLN0D+jAj3hCD53xD4/PFW56u+DBc/pG6KRxJcWa 7KbXWtXPh6L1r65So8qe+9WWCHwERJNwhSo3p+4H36bxlTS4P9Gnn5ZxFXaI/H5FD0a/lGuY008 fWqc0VZXVhscLEuwffCA0G4Gsmx20XTqtAM8zVhE7dDxqqcDWTMlIgY/N4Xc1U35j/R8Fp4WQGO AVN3P0Lm9fAdqVw== 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: 1781556186792158500 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 25a9fa49554..dcfa9819afa 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 Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556102; cv=none; d=zohomail.com; s=zohoarc; b=Q/XWananGz236xxHJJ25+G/NuCv7p3ogJKChy8ykN01Arvx/nShOpgOWNvNlZBKDY8HYogov5LCM+qB4I7i5kCkv5ElRKqL0iJVbJUEcFTB2eMvu4oB6q05N64nF8mXXo1sYoydCahCzLIh26/Re4UsBemKDP2OHb2fd8BCTDHQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556102; h=Content-Type:Content-Transfer-Encoding:Cc: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=cJlxsNX3gxrr6BmedAinwKDiCODpnkoZ1lF2Kor+ZFvsYUGwMytVLXNn59MkbgmyLjleWgTm7JnHHPGTeBTnVcPvRqyk4uHcdatbDW7iNXgnl1nZEFBT5PavseqqG3m1UxAbnBAyfN5gQOSXoygYi18UIaWpzOEJ7k//TLHSt9k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17815561022331003.5039160972053; Mon, 15 Jun 2026 13:41:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE7R-0004Sx-80; Mon, 15 Jun 2026 16:41: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 1wZE7P-0004QD-D1 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41:15 -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 1wZE7O-000328-4y for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41:15 -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-294-Fft2Kzg6P7eiqot1M-F3OQ-1; Mon, 15 Jun 2026 16:41:10 -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 5EC651955F56; Mon, 15 Jun 2026 20:41:09 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 679621800347; Mon, 15 Jun 2026 20:41:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=cy9iHhsKLbDmQdQ1ZsW1JBxmbkz7yDcCNYiJHsXl4Yb4ricLI9HB9anbJ2naIkcCS47MDU jXRPgUZuTCHLjCVJ9lmyT3mZgtiTzo2xGC1bg7e89IVZyxhza0tdRVDa2GWVGK/WIWxm9m eKRL+BmCIICFtk1HHBeba6fx3Bl7bnc= X-MC-Unique: Fft2Kzg6P7eiqot1M-F3OQ-1 X-Mimecast-MFC-AGG-ID: Fft2Kzg6P7eiqot1M-F3OQ_1781556069 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:05 +0400 Subject: [PATCH v2 39/53] 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: <20260616-qom-qapi-v2-39-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=998; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=oNnnydeZ+Z/4woqlL+ZtQDVgVy8svDVrLv4Ho4BK3Dc=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKPLUUzLYyhdg548zPry+0u+0kN0Le3M8Sdi cxQix+SONWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijwAKCRDa6OEJdZac 5SV8D/9sl2cPw4Z0pXKEb7jejdoHdIimdegvEMFFb2Yyk9X/MR3BZC+6GP0EfivszZ0C1JDaeG2 VdMnNBZ+76am+m5Xon1Sg5ZV9VFYMfOpBUMD1RpBeMm0hoN0nLYELw0gXXKeoZN/ctsL4xOTm5T 1e0qaDs9fdUPa2sCccd6khrHWmPXw9EnS1E0mVFLnh7+TTRgnZf/Ae72qz4Yjixc20dmWZbYkJV jhohw5o7Iguz/Y+S9pRoiVIiiXBWzJlHitAfStOtQeBpLp0aFybfr6ISFWaL+gKcAaUf5+/bD2n 52pWf4Y3nXMZwp6XmicY3tkVbBizeCKdhrkYCKEg7MCODwhnLNvCHUgtqcwLdAl2iyrTyMTNutG YYdLD6HNaF+fl0orEuY/qsoF95YepTQAlF9GUbk67jv2+yplRPyGgPq7clCQWD8QtGhiBpA8L1W QmfFoh5K/1ax5wt5+opt0hJPSrpHlph1kjArsPytT0NNfta5an46SPkgXyGsxKnFAKAEFIGDNYo 6UNnaJMhAYTP+FOK1d5f+P8bzwb0FsYMo5cKHJwquAx9DkWpsSsohh3BtoFN1F8/e133UV7/orC JToLGhxvRg70SotXOkzd3nPpedDo0S/avhWREvBJdZerVGWCcZiguV/hq2un6mbtyo6ZejeD9vo cPijSQFNbshzplA== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556104367158500 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 Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556126; cv=none; d=zohomail.com; s=zohoarc; b=I4r4+XtJDPE7/Ju/nHupK5e47utPwsbQGtbZmQbMokCsXcyCKJ32fdTgaHaT86++qg2V5w3IZGQpZK9WMv7UgwYrUht45FgPR9MU1ZaHSD90XYU4CvT453tbSCEJ2FM6yKOtUZUC6W5f432KVM3I/8mViZIcIzgQ0Go2rz1V7Wk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556126; h=Content-Type:Content-Transfer-Encoding:Cc: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=TlBvYj+L74XBHte9Lw5CSLfaAdOG9a76OSnz9AiLf8g=; b=ie5hD8pO0SHNnbZprFLmj/3zycbfXerqLCOtUzj9hLrvLiZzFvO/qxjWfSLKDiIX6LmEE8/aYKYT95TsiVqQqeYGO4YRSzrA0D8cpTTVNfG0JwaNxBbEhd/ob7eDsp3cCWr8vlUHXRQ/0VMZ54//JCIcAGxOkrdMWL3trqiBrvc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556126471888.9394330247897; Mon, 15 Jun 2026 13:42:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE7X-000524-Ew; Mon, 15 Jun 2026 16:41:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE7V-0004pQ-QK for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41: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 1wZE7T-00037M-IS for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41: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-250-EX9iBvm_NTC95kmlYHtMMQ-1; Mon, 15 Jun 2026 16:41: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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C4F051800609; Mon, 15 Jun 2026 20:41:14 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 52D471800347; Mon, 15 Jun 2026 20:41:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TlBvYj+L74XBHte9Lw5CSLfaAdOG9a76OSnz9AiLf8g=; b=b6d213MQNNpHl8Rwt7j8EX4EZm3DbrsGTT/TAwLw+PPOVFNPw5wxEDEOgqY/XgcH5t4/1S bxMVFYl3DlsMUQQ9EUh6d+GNskGSVfbSxH8LurtSfXWQZCcLSgyAy5sNqW22V90432Jim5 edAnrq6Z3ORpTMnmB+7hYa8KG+2LYxc= X-MC-Unique: EX9iBvm_NTC95kmlYHtMMQ-1 X-Mimecast-MFC-AGG-ID: EX9iBvm_NTC95kmlYHtMMQ_1781556074 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:06 +0400 Subject: [PATCH v2 40/53] 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: <20260616-qom-qapi-v2-40-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=13513; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=zd30vdAVYIVKIw83z5E+9puCmRisNRW1efq6cjofhck=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKPdbIdMTXKY89jbLfhdI/2rLrIZNxzv5Pvo Rw9lYgjfe6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijwAKCRDa6OEJdZac 5e43D/4n/URQNw85A/y2wk0YgQpkYP5Ld07XmIHhsQKlGzw+AHlsC00qt7FhHEu3B2DojY/g6dz 2k/vQAfEt2xs9Fuc1LgT74tiEegoiaiQJXDRCeO8FXG+8uW9cRvIclOnVKCvZrWP/7RPFRGlOM3 S3p2fOE0F7i0X70g+o3Hf4vCbeHZSsr/6iy2CcXlLtr18+PBNFbLtfMz8X5VN864Vqka6+W7Nvq lxL15jk6q2K7E9mGbSK6rvJXK4i5HW7wuVD+gRORNjO6UcUTwx/vVkpnR3mJvGa9TjTPTit+QiP JxkbRXJJDs4eSs3mwJmGPR1xocFbcExKoYyklVqz8s0nXZPVia2gGlKTKSn2z4NMsu0th2v19FD tyMSH45gKbWC1YmtN4iSid7fXFrDuuSHBnAwOfyS/FJ2FJeV+uebIbCK61v2/Wa6lG86s8JI8SL NrsQxcIusOynxHIQ4rpqNLJv8PBUeQ7uWBXHrOY/bHs4BRdwUlKu/bbc6+TPUXMW3v5BZvA93Ak 35vYGVvZ/6/DH6Oqh4tExL6iaXLDScIMesnuFhQ7sOsrlcNPVgzZ3q7HUoJnRazJ9CPZH0ng3Mx eQA6ShTazixyjBE0T74r8cBaImoajDu0AhosXWkVHAlCohFUtEUsgB37d4tolAMczVU1JhZ/vge KCqRGpCRolmDHrg== 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: 1781556128666158501 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 74f209946a2..f6073baedcb 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -7365,14 +7365,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 @@ -7428,14 +7428,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) { @@ -7455,7 +7455,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; @@ -8948,7 +8948,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 @@ -9050,7 +9050,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; } @@ -9065,7 +9065,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; @@ -9370,10 +9370,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) { @@ -9431,7 +9431,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), @@ -9509,7 +9509,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); @@ -9522,7 +9522,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 Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556155; cv=none; d=zohomail.com; s=zohoarc; b=Ci/mNbF7hPHBgoiePoD8h5MDdSmgbBQ3JOFDwmVhNsF5cvLbYGjLgTOa3GFgt5dOhO0J03sMSM0qlz8cg3R/pUbWU8TrcoYDQHBc0xr9H5T5qNAqL/F0/f/kRWQ2//btvnpqrdWwTx7C131rwNF8Bgdocm5Y1jX4uqkl8hM//PA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556155; h=Content-Type:Content-Transfer-Encoding:Cc: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=6bGigmdJZgyNOl3LkpIRvOYBbdXgYNU54ak2Hxfhna0=; b=gSnK/eqJIrHXWB5r0WVJ10QHXjsbS05LLFP2DpHBz9wXgUl91nXqqMmKCxCeMmZywhz35bP1zZNwwSaBNny3wt0htLVSt1ob1ED4rOGb4EU+YUqP4VAIcFaEYB3be94NtJYbhHFRMgxOSDCtCkts61lUXLsIq5FzxwoRn4K8tBU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178155615511422.479868036884113; Mon, 15 Jun 2026 13:42:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE7c-0005EL-Tv; Mon, 15 Jun 2026 16:41:28 -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 1wZE7b-0005Dl-Cq for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41: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 1wZE7a-00039A-2l for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41:27 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-544-JdzPDkJmPA2GJQZFpJm7fQ-1; Mon, 15 Jun 2026 16:41: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 383A11955EA2; Mon, 15 Jun 2026 20:41:20 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E91AA19541B2; Mon, 15 Jun 2026 20:41:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6bGigmdJZgyNOl3LkpIRvOYBbdXgYNU54ak2Hxfhna0=; b=Ww1JHy+gHFEUQLfUgEqR0VSixMfwD+RxmUg12/LL2h6hLmYTXec9sPpSg8LOUXVnl1T+Ya XeIt0cM2It/HULOcPrDpe+A56dQIop2YJGJctJLlg75qQlfnyqHY8rR3zXzeUI0NXQRzR8 WeGgk21BflDiTlH3+InTPfjOp6tLMrg= X-MC-Unique: JdzPDkJmPA2GJQZFpJm7fQ-1 X-Mimecast-MFC-AGG-ID: JdzPDkJmPA2GJQZFpJm7fQ_1781556080 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:07 +0400 Subject: [PATCH v2 41/53] 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: <20260616-qom-qapi-v2-41-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=602; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=EYBqSG3xvEIb1ghvXPs3JqG5/u7tCYGIpzqM19FRqzQ=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKPTvv93DhZTCZl+KZULhKPLB8k4zz0f8FGZ puDuYX+nfCJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijwAKCRDa6OEJdZac 5fnoD/4vtwgc0TL3zbQYE8xdknja0VmZDxbxl6syGKArbO0YO75dlA1CfI2GEkruKm07W1ZL4Kl 7A6Gbq+iHqpBX5qiRMIbnJwPrQMWI5OOal/BIgv/ppzJhlgy+r7DAXTcNtreJW0t4sie3BOGRb/ HdHQxm304QkbgKuLsUZSRuR7zydFf4WSGlZy9UaKULCungSQIhxcHF4knnabpLGmcAe8TEurS/i QMtu3iY+KquG1ueu5e0njqzPB4LasmAX5m2ccc2qZzOf603ayT++7HdgoRp4m1Uc1kgbqn/B7/l hU1qqa8AUfVU7v8laAB38crM1ztHKo/JiPudTMjK1O67dGiYWuj+foxpcKZij+L2RfRyCK9UL/e Saehf7gb/YoiV6B1TDxA5b6d8f5KIXAdfxsnHhq2ct3IzTrVO3z8TKXZ+1ykPsjhKaq2LxZwzx0 b5TRCbh8Lx51fuIBnssNFYjx6etbUWcwkxonBKbTwip36V7eTOodsbbu7QJ6b5iCs83WLJi9P1J m81PeheWLApnindJTjHOxtw5IRWjjM0XLRrViRdvvS8D4f7EbU2ferCImbozMg3JHfkszXsJL2U /OPz+bH+d4AjkP2tIS85/XQkkDhsIQIg5lKHOmldWAhI0i7plgRmhCFd+NkWkEnr9RsN+dHTBmv cGvQEolt60UO4Uw== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556156634158500 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 cec065d108f..3bb7ab0cb86 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -79,7 +79,7 @@ static void prop_pci_busnr_get(Object *obj, Visitor *v, c= onst char *name, } =20 static const PropertyInfo prop_pci_busnr =3D { - .type =3D "busnr", + .type =3D "uint8", .get =3D prop_pci_busnr_get, }; =20 --=20 2.54.0 From nobody Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556109; cv=none; d=zohomail.com; s=zohoarc; b=oF+PaQnSlGTCzvLuLpoChwOWBHBeMYoBZKZiyI48b189ehcZ/3OlQISbTLEyt4UEYJgLo1YLICNACK7mPXkIL6/kxmB22J/dibVWz8bN+hDtM1THjaNadDSXCHYb8IHwRCgatnqH969HLfma1Com8yicNOPHdNdDpJpURTkxcqE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556109; h=Content-Type:Content-Transfer-Encoding:Cc: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=uWdGXwIyNbTrVNJtaN8PpZgAfNP2DgFTH5IaS3ncjZ4=; b=Lq4hwt4Q1rOFK0XFHC4EZUuHZWQLpYqbpK5r4Bex86CJu2DixPb2TutNwwjRWw0ftWCdmpc4wRvKCHFmvtcVYqTV7Fda4uZcSuwYBSA+1pCNB/SUq2sUS7VsTwCVoUFShHAckt1915yuXdBi66UR8RvdL3tbJXNalpznNu0FG3A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556109620893.0450508970275; Mon, 15 Jun 2026 13:41:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE7h-0005Md-AI; Mon, 15 Jun 2026 16:41:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE7f-0005FK-Na for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41: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 1wZE7e-00039u-4m for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41:31 -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-217-Ozp0K4XxO1SsyjOdz_H7bg-1; Mon, 15 Jun 2026 16:41:26 -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 0D0C519540C8; Mon, 15 Jun 2026 20:41:25 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1D05A1800347; Mon, 15 Jun 2026 20:41:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uWdGXwIyNbTrVNJtaN8PpZgAfNP2DgFTH5IaS3ncjZ4=; b=Dlicx1RKlzh/xWJ+8igxgPonaBVM7qrpBjgV1kkU7buRE99KsTtORJShm0+sJFEoujP8kX Mf6XgD/23kGV8kwj1wqL1DHJ0QW4SIwrgjueGS0pkBIdXGwMivQCGJQFMO4TCddHYZ4bLZ YGr3sH/BaPgjn8a1LCNrn056i1zOVG8= X-MC-Unique: Ozp0K4XxO1SsyjOdz_H7bg-1 X-Mimecast-MFC-AGG-ID: Ozp0K4XxO1SsyjOdz_H7bg_1781556085 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:08 +0400 Subject: [PATCH v2 42/53] 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: <20260616-qom-qapi-v2-42-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=7075; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=ihOMSGfmerocP/uWGqL/8cFJcxxgdAYw+vXojYuEHLo=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKPYvSeUENp4pcBvMJtX6TffmHl45cOCbaCG ZyApxgdOcKJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBijwAKCRDa6OEJdZac 5R5iD/47Tz5fuoxPrJQDBW955QGQs6V6dNKtcAsPbdZ9XLoFlxirTTbdYtcWhcO37Smm+xKEAVy Trb01Jklpu50UGqFjl+ptVZGUKbD1IOJnrcHhn6oraJOmcxjB1O99TcNg3El3cy4DOqMn2thGHq aF12Z3PQSn6cK1lSJ/nTtIkTPKvleiCY8FIwMsNFG/6ZvzhLPkZPCQRp2pEhzTqSNWnjAWwVhWF NsZ0Kh6i6ONZf90tEIUL5iCdWPHIdQhJaAcJms5kEsAGyTpB2uogaVkvg5KowKBgELrQleAyFy3 garCY6SsILXw0oCI0sRWQZ4XDOzf6yGXkj1oKSopVjRn9UqqRksl3jAS1/sSp05WxUWQ8qYEzUQ +OzyUbhlMiox7R24Y2ssBT3WKF187kBiPvo+yfnaJ9LiuDJwqKJueO8taZje2vvmHM/H70FCJSS 2CzUTVB811DZPpCGNmJB+xABWPC24bIUjbWgCvpDctXesjf5y0OlH+rmryB7MzCOs/W9HOIdrra ohzbgrME6sUpsGsPJHZTG0MEbrwGJEhuf85f15sDdYLtixRUnbzwzFwy+WbEVBXtr/uEhPGzS6v SlxuIuSUtHoBlcl2lc7O8JfRHFhb3Lo136iO6lD7JzAvKsTkmaRx7UjGeNmPL31UCELkmhuIm0k TKNHj8bB0Yp65kQ== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556110483158500 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 eba5436e53b..1ea2ba66bb3 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 34d7b26a730..b3d5abd5053 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -99,13 +99,22 @@ static ObjectPropertyAccessor *field_prop_setter(const = PropertyInfo *info) return info->set ? field_prop_set : NULL; } =20 +static const QEnumLookup *qdev_propinfo_enum_lookup(const PropertyInfo *in= fo) +{ + if (info->qapi_type) { + assert(info->qapi_type->lookup); + return info->qapi_type->lookup; + } + return info->enum_table; +} + void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { const Property *prop =3D opaque; int *ptr =3D object_field_prop_ptr(obj, prop); =20 - visit_type_enum(v, name, ptr, prop->info->enum_table, errp); + visit_type_enum(v, name, ptr, qdev_propinfo_enum_lookup(prop->info), e= rrp); } =20 void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name, @@ -114,14 +123,14 @@ void qdev_propinfo_set_enum(Object *obj, Visitor *v, = const char *name, const Property *prop =3D opaque; int *ptr =3D object_field_prop_ptr(obj, prop); =20 - visit_type_enum(v, name, ptr, prop->info->enum_table, errp); + visit_type_enum(v, name, ptr, qdev_propinfo_enum_lookup(prop->info), e= rrp); } =20 void qdev_propinfo_set_default_value_enum(ObjectProperty *op, const Property *prop) { object_property_set_default_str(op, - qapi_enum_lookup(prop->info->enum_table, prop->defval.i)); + qapi_enum_lookup(qdev_propinfo_enum_lookup(prop->info), prop->defv= al.i)); } =20 /* Bit */ @@ -941,8 +950,8 @@ void qdev_prop_set_enum(DeviceState *dev, const char *n= ame, int value) =20 prop =3D qdev_prop_find(dev, name); object_property_set_str(OBJECT(dev), name, - qapi_enum_lookup(prop->info->enum_table, value= ), - &error_abort); + qapi_enum_lookup(qdev_propinfo_enum_lookup(prop->info), value), + &error_abort); } =20 void qdev_prop_set_array(DeviceState *dev, const char *name, QList *values) @@ -1143,18 +1152,33 @@ const PropertyInfo qdev_prop_link =3D { .set =3D set_link, }; =20 +static const QAPITypeInfo *qdev_prop_qapi_type(const Property *prop) +{ + /* this will be later extended to cope with QAPI array properties */ + return prop->info->qapi_type; +} + void qdev_property_add_static(DeviceState *dev, const Property *prop) { Object *obj =3D OBJECT(dev); ObjectProperty *op; + const QAPITypeInfo *qapi_type =3D qdev_prop_qapi_type(prop); =20 assert(!prop->info->create); =20 - op =3D object_property_add(obj, prop->name, prop->info->type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); + if (qapi_type) { + op =3D object_property_add_qapi(obj, prop->name, qapi_type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); + } else { + op =3D object_property_add(obj, prop->name, prop->info->type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); + } =20 object_property_set_description(obj, prop->name, prop->info->description); @@ -1176,12 +1200,23 @@ static void qdev_class_add_property(DeviceClass *kl= ass, const char *name, if (prop->info->create) { op =3D prop->info->create(oc, name, prop); } else { - op =3D object_class_property_add(oc, - name, prop->info->type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); + const QAPITypeInfo *qapi_type =3D qdev_prop_qapi_type(prop); + + if (qapi_type) { + op =3D object_class_property_add_qapi(oc, + name, qapi_type, + field_prop_getter(prop->inf= o), + field_prop_setter(prop->inf= o), + prop->info->release, + (Property *)prop); + } else { + op =3D object_class_property_add(oc, + name, prop->info->type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); + } } if (prop->set_default) { prop->info->set_default_value(op, prop); --=20 2.54.0 From nobody Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556120; cv=none; d=zohomail.com; s=zohoarc; b=h8jMLCS/nRxYl+whVAcjvzgCb7rx9DSh6kdGWvqKOvOWV9LeL3wNGOM13br8ueXnkKb99dFVUaGMU/OKjS5J7TE9Jc1maxOs7YcJoFzAQPy0LD4l17QyvaunhjpPhI3iuZUIsV0R4jKs2WK0i35lW4qNuRoxyLa+4ysaLGqyD9Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556120; h=Content-Type:Content-Transfer-Encoding:Cc: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=cHW1IJ+eoU0mx1TK3LSTmgoix624p+QtD/GS7m9+4P4=; b=CMg8I6rAaQNoNhnKQyYIApK6uquF5CpYo/rq3WtDkTd+oybsclaomk/6cHJbdX55I7/7pnWzBkR5egt0NL2M3v5tPhNiAYRPxLF2zoJ/8VNXPPm8RHDDIC5V7APfGLqeHsuTTmKGiCxg02hwWCxNAhKZXXNdpOQDARz6TfibZGY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556120139384.31047323826806; Mon, 15 Jun 2026 13:42:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE7k-0005l2-MI; Mon, 15 Jun 2026 16:41: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 1wZE7i-0005YU-Us for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE7h-0003A7-1N for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41:34 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-496-eb6nSNU2N_6833mhheS0sg-1; Mon, 15 Jun 2026 16:41:31 -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 2D1FF18002FB; Mon, 15 Jun 2026 20:41:30 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EE0B419560B2; Mon, 15 Jun 2026 20:41:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cHW1IJ+eoU0mx1TK3LSTmgoix624p+QtD/GS7m9+4P4=; b=jVgnYqyzWrJpYFWbDxH6owZu+Ml6RbHvDn3EB+2PA8WqLXNaWxLKthxG/znfcUEzk8Hfz2 v7K1Z//bAYpxnDHXoCFv59H9obewsTEcr8yeLBrfWk6LTMtGwRAGS2AD2LypF7v5yWGqOW SpPhVbEibmPWt9f3oi6Hr/Eao+ysnHc= X-MC-Unique: eb6nSNU2N_6833mhheS0sg-1 X-Mimecast-MFC-AGG-ID: eb6nSNU2N_6833mhheS0sg_1781556090 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:09 +0400 Subject: [PATCH v2 43/53] 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: <20260616-qom-qapi-v2-43-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=6885; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=tHhcM1FVEXcDcG4TGrZLROFbMeeibNZs1O1Pz0IKt74=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKQtTa+STywJQpkrdhuyTsKGENAhMFHPf6mL 9TRzMTdeEaJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBikAAKCRDa6OEJdZac 5Q+kD/47zXmT9RjRvNURw2TIn9VoTnWlxP0ETFjJPv5kYrNwXJ7L0lOvfmjoUuBiVPrV+aANqet rj4Do1a/5AJX2Y5oa2LQ49S8ScPtO0hJwPg9vIVN4zeKMWX4k5RWl9lv+KjNkBsWw7AtinA0zhh T5mtZuC1gQiI2yvBKIsi1unDCfpd3ucbegUC4e358Nrgzt1HczZmH52ldqC7H2ghUuF6AaruCvP t86dq6Fm1OFklMWCBPgTJmOy7zW7/3lT620aVP+NLKHOHcZU+vDEoefMIGGFMbr0sS0mY9+mT8S OQ1IRrtr/8gVXfRu46Q3jjdYfOnmB8isSAdLs/vjCZ7pZ/P0uZoEw5lWGJin2BMP5VoXyhJ+sJC KuF74Z8AA0LzJhpfTaBRjNccXeVLC+/SOlmyKH5GUz+v91hFR1/NhSSlCHp5XuZrdDX5+U8/gK2 Ucmw8ORoM4GEz/YTjM8D2hAQdpTFjh86TqpyM8oaz4Bhm81YpB63j2xXMhZpS4ixuJizAaKkB56 epEE0a7mGurz7ZehpXVKoGjcEmaRRylyNbef2CH2AyxNFUmfcSC6E5YoKDmlGcs7toW8YGyGcks EhdaG273PL2dIwFiLDr3cPp8+RTfzon3HBifpNKVF5FqFHFrX80gK2oZYUiqPIWox8gPv4Sh8jJ 4fLRwPv8O/Var9A== 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: 1781556120572158500 Replace .type string with .qapi_type pointer on all core PropertyInfo definitions in qdev-properties.c. Remove .enum_table from enum definitions, since the lookup is now accessed through .qapi_type->lookup via the qdev_propinfo_enum_lookup() fallback helper. Note that qdev_prop_usize now reports "uint32" or "uint64" depending on the host. If usize is worth preserving, it should be added as a QAPI builtin type. Or perhaps we should simply use "size" everywhere (u64)? It's also strange to use type "size" for both u32 (prop_size32) and u64 (prop_size). Link property are actually strings. The "full type name" is set when the property is added, as "link". Array property will be refactored in a subsequent patch. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-properties.c | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index b3d5abd5053..e924b040687 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -12,6 +12,8 @@ #include "qdev-prop-internal.h" #include "qom/compat-properties.h" #include "qom/qom-qobject.h" +#include "qapi/qapi-builtin-type-infos.h" +#include "qapi/qapi-type-infos-common.h" =20 void qdev_prop_set_after_realize(DeviceState *dev, const char *name, Error **errp) @@ -180,7 +182,7 @@ static void set_default_value_bool(ObjectProperty *op, = const Property *prop) } =20 const PropertyInfo qdev_prop_bit =3D { - .type =3D "bool", + .qapi_type =3D &bool_type_info, .description =3D "on/off", .get =3D prop_get_bit, .set =3D prop_set_bit, @@ -230,7 +232,7 @@ static void prop_set_bit64(Object *obj, Visitor *v, con= st char *name, } =20 const PropertyInfo qdev_prop_bit64 =3D { - .type =3D "bool", + .qapi_type =3D &bool_type_info, .description =3D "on/off", .get =3D prop_get_bit64, .set =3D prop_set_bit64, @@ -292,9 +294,8 @@ static void prop_set_on_off_auto_bit64(Object *obj, Vis= itor *v, } =20 const PropertyInfo qdev_prop_on_off_auto_bit64 =3D { - .type =3D "OnOffAuto", + .qapi_type =3D &OnOffAuto_type_info, .description =3D "on/off/auto", - .enum_table =3D &OnOffAuto_lookup, .get =3D prop_get_on_off_auto_bit64, .set =3D prop_set_on_off_auto_bit64, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -321,7 +322,7 @@ static void set_bool(Object *obj, Visitor *v, const cha= r *name, void *opaque, } =20 const PropertyInfo qdev_prop_bool =3D { - .type =3D "bool", + .qapi_type =3D &bool_type_info, .description =3D "on/off", .get =3D get_bool, .set =3D set_bool, @@ -361,7 +362,7 @@ void qdev_propinfo_set_default_value_uint(ObjectPropert= y *op, } =20 const PropertyInfo qdev_prop_uint8 =3D { - .type =3D "uint8", + .qapi_type =3D &uint8_type_info, .get =3D get_uint8, .set =3D set_uint8, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -388,7 +389,7 @@ static void set_uint16(Object *obj, Visitor *v, const c= har *name, } =20 const PropertyInfo qdev_prop_uint16 =3D { - .type =3D "uint16", + .qapi_type =3D &uint16_type_info, .get =3D get_uint16, .set =3D set_uint16, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -433,14 +434,14 @@ static void set_int32(Object *obj, Visitor *v, const = char *name, void *opaque, } =20 const PropertyInfo qdev_prop_uint32 =3D { - .type =3D "uint32", + .qapi_type =3D &uint32_type_info, .get =3D get_uint32, .set =3D set_uint32, .set_default_value =3D qdev_propinfo_set_default_value_uint, }; =20 const PropertyInfo qdev_prop_int32 =3D { - .type =3D "int32", + .qapi_type =3D &int32_type_info, .get =3D qdev_propinfo_get_int32, .set =3D set_int32, .set_default_value =3D qdev_propinfo_set_default_value_int, @@ -485,14 +486,14 @@ static void set_int64(Object *obj, Visitor *v, const = char *name, } =20 const PropertyInfo qdev_prop_uint64 =3D { - .type =3D "uint64", + .qapi_type =3D &uint64_type_info, .get =3D get_uint64, .set =3D set_uint64, .set_default_value =3D qdev_propinfo_set_default_value_uint, }; =20 const PropertyInfo qdev_prop_int64 =3D { - .type =3D "int64", + .qapi_type =3D &int64_type_info, .get =3D get_int64, .set =3D set_int64, .set_default_value =3D qdev_propinfo_set_default_value_int, @@ -514,7 +515,7 @@ static void set_uint64_checkmask(Object *obj, Visitor *= v, const char *name, } =20 const PropertyInfo qdev_prop_uint64_checkmask =3D { - .type =3D "uint64", + .qapi_type =3D &uint64_type_info, .get =3D get_uint64, .set =3D set_uint64_checkmask, }; @@ -550,7 +551,11 @@ static void set_usize(Object *obj, Visitor *v, const c= har *name, void *opaque, } =20 const PropertyInfo qdev_prop_usize =3D { - .type =3D "usize", +#if HOST_LONG_BITS =3D=3D 32 + .qapi_type =3D &uint32_type_info, +#else + .qapi_type =3D &uint64_type_info, +#endif .get =3D get_usize, .set =3D set_usize, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -594,7 +599,7 @@ static void set_string(Object *obj, Visitor *v, const c= har *name, } =20 const PropertyInfo qdev_prop_string =3D { - .type =3D "str", + .qapi_type =3D &str_type_info, .release =3D release_string, .get =3D get_string, .set =3D set_string, @@ -603,9 +608,8 @@ const PropertyInfo qdev_prop_string =3D { /* --- on/off/auto --- */ =20 const PropertyInfo qdev_prop_on_off_auto =3D { - .type =3D "OnOffAuto", + .qapi_type =3D &OnOffAuto_type_info, .description =3D "on/off/auto", - .enum_table =3D &OnOffAuto_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, .set_default_value =3D qdev_propinfo_set_default_value_enum, @@ -646,7 +650,7 @@ static void set_size32(Object *obj, Visitor *v, const c= har *name, void *opaque, } =20 const PropertyInfo qdev_prop_size32 =3D { - .type =3D "size", + .qapi_type =3D &size_type_info, .get =3D qdev_propinfo_get_size32, .set =3D set_size32, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -1059,7 +1063,7 @@ static void set_size(Object *obj, Visitor *v, const c= har *name, void *opaque, } =20 const PropertyInfo qdev_prop_size =3D { - .type =3D "size", + .qapi_type =3D &size_type_info, .get =3D get_size, .set =3D set_size, .set_default_value =3D qdev_propinfo_set_default_value_uint, @@ -1141,7 +1145,7 @@ static void set_link(Object *obj, Visitor *v, const c= har *name, void *opaque, } =20 const PropertyInfo qdev_prop_link =3D { - .type =3D "link", + .qapi_type =3D &str_type_info, .create =3D create_link_property, /* * Since we have a create method, the get and set are used --=20 2.54.0 From nobody Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556186; cv=none; d=zohomail.com; s=zohoarc; b=cqfpLxLj96nbwm91Q1GmI217Bcn5gUlOIVEvMhXPiBYdZz8z9lyBBNf36h2GBFWEz5BOecyx7/+CV3ERnQdE+yM++IZKz2wZI+Em0VZ+9vU+Y5iPFIUwdolSbqlhUCDp5RAOzrpqHwumxqOnhSU4Y/YfQ+Ik3dVdiQeeUP5VrY8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556186; h=Content-Type:Content-Transfer-Encoding:Cc: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=tYjNyguvXCR5JfwvQU9w4XkNwgWnIZiLxT5yLtma1/k=; b=dsfQlORtaMnyGtO2IhsylMtgr84GDga/E5vNP79n0vkuHgXqMLCHzLVWhj5flMIwbLBYgbUtSZgvVY4vm/EcU7Ov8+UHKsmHepnD4yCMXAsVcsFAl7HPcB1ZSA3VD1+z24ErUf3W/2Yvjj0BW73EVOu6YFnDRcIpcxsDbVIpGkg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556186397900.5224003405166; Mon, 15 Jun 2026 13:43:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE7v-0006rm-2p; Mon, 15 Jun 2026 16:41: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 1wZE7s-0006hJ-HC for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41: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 1wZE7q-0003CR-1t for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41:44 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-314-bnqTqm3uPXi3BbrHADbH3A-1; Mon, 15 Jun 2026 16:41:37 -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 DAE41195608E; Mon, 15 Jun 2026 20:41:35 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 582C6195419D; Mon, 15 Jun 2026 20:41:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tYjNyguvXCR5JfwvQU9w4XkNwgWnIZiLxT5yLtma1/k=; b=J5lAXclYISZltPYKC1geLPx9ycL2yHajPWctvydlO6YrGirpxoaXnQVS2XIkrsA7a8UrgB LLd7krAMlE/EeXX1LAgIiFPJVAFuEZ8g3lMK9ggBBAP9hy2VBDrMH79N9Wh6EcGkWjYULo KjFvfzZGcgo/7xy3kodpCKV+U66+qqU= X-MC-Unique: bnqTqm3uPXi3BbrHADbH3A-1 X-Mimecast-MFC-AGG-ID: bnqTqm3uPXi3BbrHADbH3A_1781556096 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:10 +0400 Subject: [PATCH v2 44/53] 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: <20260616-qom-qapi-v2-44-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=16328; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=hSMgxxaXufh9QfsuOg2k6PCThQwxwUBRWsfgnoO8BV4=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKQh2jzEHYkMluN1jWkijXnuh+pOMDMHCR8m tLbIeECU9eJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBikAAKCRDa6OEJdZac 5cqGD/9N3uUXna15uKdlfDgqwcNI4EDFDi1B1MftxOn9oEecflCdc2dcVdmtVipfIdkLhR7p+4s bkvbjqlDQSmPUdiJztPeBpAKItLin77zjaA2JIP9hUHMLhLU3M4g5cwLYWwA1F4NOYBPk5UWsAv 1YgqdB/7+dDrOje17qG3TOxfTYwwasXUy2rhXd/diD3KAFHrru66WKH3XcZXOvjZ56GWEhVqH1e tCBEAFnndI+At/ClY3mdvpyCWZCtpgZPoUQ+i1E23qiO3BacWZfEaRWNzzXnz8kcpT8h3tGxz7o r3LcNEUo2DAEe5pzEtcCCdQvfhuQcDMrRJDraxcCwa+zbbRiMjfIpcnUH/TLR3jn3EVE9NzNKIY DhoMlAO9mza72w6yjcBcbvHiCz2xhnqAjUMp8L4Ln0vV8dbz1/9XtyZ6/wHMujgD6wYXkk3jfm+ PkTbbV54vb1pxCoD5lVvfTkhRBX+mgPiXvUsWgXKw6c1M2I5KOPD3ECQsa9zj0UHOnK0zY0oI/r i8a3YQ3kLdD4e1mjZ1/oDViRNCMT0vLogd7XHtizvLnR3vldndxnaCV3U0C6MmVdlKh8D46u30E URb3zlScAFfhzyg0VcJwdYlUrDfmJ/zt5Y3uUvfKdOly1PjnSc56Fc7mfxvxAy+1wfy9d5m19+k Kieo/yw0mIo1/2Q== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556186783158500 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 e924b040687..c2980c36afa 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 Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556243; cv=none; d=zohomail.com; s=zohoarc; b=PIUTQJudPOlz5Tnecnkg80JHS3WOX49KgqJ3FZNyVqLyNDsbIxNiHaiQwoqyTOWBFyq7g4v/l8QSki0ox5AHnR5rMT0KeKcDKgG33Er5Qpr+SyFXLsO5GvNtJWdl7uTujE8vScXAvbKzPlqoPwO4rZntp4t2F7rGyElDkMIt050= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556243; h=Content-Type:Content-Transfer-Encoding:Cc: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=OaRY/jUcRVQS+0kqMk+f2r96IhSS7NkiLw7F+Npkow8=; b=Xp8K/PDDb+Y/Ye4+MpR7mba/vYQFa6QRMkHT6qD51ppuH5QPy1Zu+6hJwqtdwKRJqjpg01m3hoXfrtt2rHXegZqRrfx9kn36WX2jzbXRE3v74ZrJvn3fl2R25TH9s1T3P8YY7hrnFBXyvI/XRf7Nrp5K2yJXAarw0Urk49xrM9A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556243694498.0189656220042; Mon, 15 Jun 2026 13:44:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE7y-00074M-EC; Mon, 15 Jun 2026 16:41:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE7x-0006yX-21 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE7u-0003Cm-WB for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41:48 -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-641-Gf6lYNugOTmjRCVxVu8eEg-1; Mon, 15 Jun 2026 16:41:42 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 07AA3195608D; Mon, 15 Jun 2026 20:41:41 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C1DFC1800361; Mon, 15 Jun 2026 20:41:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OaRY/jUcRVQS+0kqMk+f2r96IhSS7NkiLw7F+Npkow8=; b=LV1rmmlc0XGcw6rGFmFDE/JontCITtyZbaUWiWJIVKMM7qT9+iNzAxHUMUFBm4vyavAdxI Hberkga7FdbzgkWg9H9N3641TvVdIt52Z9j/XqzFZE9S/Q3fLMiF/LHbIWgeCkOQ16t/qA bDGbUp02mL1aVdsM92Tmi49sv3R74Rw= X-MC-Unique: Gf6lYNugOTmjRCVxVu8eEg-1 X-Mimecast-MFC-AGG-ID: Gf6lYNugOTmjRCVxVu8eEg_1781556101 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:11 +0400 Subject: [PATCH v2 45/53] 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: <20260616-qom-qapi-v2-45-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=8639; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=13OjH4Jv1Cy4m5GEP+CXU8X9alHiaj7k8yL+23y+6y0=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKQSpiL/NYc+IuO6Mfjat8xDrzC9PRPW8DkK thPvcGV71mJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBikAAKCRDa6OEJdZac 5YjJEACWpYsyVCB+0faKDfPIYSDMhDlAihzdat8UB31bUsFvQ6O+fU2K6NpjhALaTSb5ObRZbJ2 5qQ34edX6lZZT5P8Ay3D1XrTTrFIWlP+4bxx8SbgS1tVG9QiD2bZ7BZamAaj+oAzQt+eDaPn9kn InbFOQqVe9Iwgq3Ya34OPiyv9VzVLhYL8EwfwKXWU9tUrpa3pUvAW4MWCFA4Gt8lYRi3i8qh1Vg 7DKchp0C1PyrDQ4GONRRX9/7hN8mGTowXnMW6s19H9ENG1PNYs3j2k9MQwsi2aehTawBoldh+0n lahlWYCrHy1oftkbVJES27dpNLPyQOAW40zodrQkRk2ztPxxP7Ea85mAhthg5FRBV4C7CN642E0 jFePDM8voCaxSpy1U75DMP5VyHDFI4SbLHq2+U8+QDU5Kkv6giPpmp54UPrcaI8Ij/Od8iK7p6Y 4BQoH5FgsN0UmpkCzKHUCNzOmN4qAEVfq5L/LWtosLaJPRj0aQMIEEKwTld8rMxV1flXvlznmdI Y6QvgMwwCoTPKIkPF6QYKihfmP7Hl0eMXWKfvSXeXvUP9HeP+ioNcCiK8COJa7WqaaFHiqXQQ/I Jv2VQjiUPhNutyJEI7bb15xvbWRvcP6ieu7uOV9v4BiA31A/7kwNP409VtHDAlXzbNYicdv0CwE 6McWOejaB8uaytQ== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556245258158500 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 3bb7ab0cb86..812ebe0452b 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -52,6 +52,7 @@ #include "qapi/error.h" #include "qemu/cutils.h" #include "pci-internal.h" +#include "qapi/qapi-builtin-type-infos.h" =20 #include "hw/xen/xen.h" #include "hw/i386/kvm/xen_evtchn.h" @@ -79,7 +80,7 @@ static void prop_pci_busnr_get(Object *obj, Visitor *v, c= onst char *name, } =20 static const PropertyInfo prop_pci_busnr =3D { - .type =3D "uint8", + .qapi_type =3D &uint8_type_info, .get =3D prop_pci_busnr_get, }; =20 diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c index 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 eb2b6185db0..e9f087ae4c8 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 be0061b9db2..77c420b3000 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 Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556162; cv=none; d=zohomail.com; s=zohoarc; b=F+9vTnBQXtAvLo2AeCULaBfwqML1TkQ0AOAUZfSta1WFmU0w6UHH0FeVc3PetEl05eGij+fgnHxarw+M6pGH2N1LTkpiSTxWdSHrU/DsX5OQ/HN5XVyb/UhvLH1NkM6vvXHV91+RQym+8SG7u+WNXCqlxLHyOkN+XCfbxB5dh40= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556162; h=Content-Type:Content-Transfer-Encoding:Cc: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=JDnRIYDmCQzkNAdvHZNUWhsspIQuDKZRpI03XIdLc70=; b=YvFF+Iw78EqKGAWml//ycHfhPEsGz/okGK05/3VzjZbduQ9ILihZgeHRGcrVfzij3oEJ6BVSupWf+Jk+WAG9kdFYeXsVkC1Sy5BVX5SCwFOlqqdn9FpXHciSv5u3OzQ1Bftg7eUBDzC8IE6X/VBvHWky2yAQ2Rlw8+R6yS3lNUQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556162380908.35902275743; Mon, 15 Jun 2026 13:42:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE81-0007R5-VL; Mon, 15 Jun 2026 16:41: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 1wZE80-0007Gn-G7 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41:52 -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 1wZE7z-0003DK-1o for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41: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-572-WicGFW68NG-3WqQVDSEEwQ-1; Mon, 15 Jun 2026 16:41:47 -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 52A4218009E6; Mon, 15 Jun 2026 20:41:46 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 21B5B3008B37; Mon, 15 Jun 2026 20:41:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JDnRIYDmCQzkNAdvHZNUWhsspIQuDKZRpI03XIdLc70=; b=YDRLE/ooXUFkZhMZNfUQ35CUvsC/rbN05BLs3kvS/qhcmxRco6Larz0fly15MqpFZu8RDj BDSK21jK3JXectk8oXcTvmv+DUL9L7W2Mpc7khVdGyXzjcQa3N0f7mAJksG8ylzYnv+jlb TcMBHNDZBcgNUh+vuQ7ULfvCCk4iNKk= X-MC-Unique: WicGFW68NG-3WqQVDSEEwQ-1 X-Mimecast-MFC-AGG-ID: WicGFW68NG-3WqQVDSEEwQ_1781556106 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:12 +0400 Subject: [PATCH v2 46/53] 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: <20260616-qom-qapi-v2-46-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1618; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=WMsLOFqLBsKEif+Q77QREwp32vagjtu8h/lM/vi0C2Q=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKQSKVzq0Clv4uxKspWrjxT+/4YGlV/2v+x8 p7cfCAywsSJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBikAAKCRDa6OEJdZac 5RWkD/9cdR+P3XKSEx+vTX5/8SGfSLDFRnkzfcmaopxqG+O5HXKXeIIm6urjHIaWytaBjVVPJju Gcyr6ToNF6DRJtE3xbYKsl6HjQPYMKxP9Rwk6wrZ4hCqQXEJujYganNI76Rr+cl4AMYwqlVlUCt 0Vue+nWPTAdB3wWnaXOl/ANTGDu8zCRgtp+uUvjmU+P9kJ9+d6IIGBC24vw7/XXBDmhXVPKjXLm ApCOxU9Tzxi2lv8E79Vb4yeaMilQDpl2OHziAVIKlPS5rb8V2E8doYaR9Gj1xz8VfKwbp9bCCyM PScdN2mzzCt29Yob2tvChiELO2cfC/K/nRJs0xbeNeqfeu29YV2Cf3994n6ZxFK1P5KVvtf94YK rd7BFQRdm/YHlFUwalmmj8k7hG1gCCmsGHYeZM07TqwxmU6YsxQpL9sUVTbAP693r36c7bkFgjo UDNb5WDGmA5GsMbA3rY000xLsSneQd3J6bfs6TS2yazn01rmElQISr4B+KQRBT2/klbjMgw1+J6 EwAAM3zRhIxQ6S4Eu4Uf7GQB2T20pd1Sktv8zeFsBU8cdV4kTmipLPAfxPRcXGwbkvnUDOgtFj6 ahnhE4Qnp7NtxbkdJl4IOyySauaBsXFcTL8tQTRBUvZrYOOgSIwD2uLYs/bSaFZd2e/Ji73a5hs EEjhHI21YXINW7g== 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: 1781556164643158500 "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 a63961bb713..98c9ebd791c 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1302,7 +1302,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, @@ -1338,13 +1338,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, @@ -1486,6 +1486,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 Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556153; cv=none; d=zohomail.com; s=zohoarc; b=n2/3QV1BYlm3lJmMEdI/KZUzg/9Jgmw7iaYSsFaJohznRo3j3J28ZAP4+dxBpYBxQmdyqTjnyjFjRfzIN6QmRqF8TqSX0IcdOXGYyWZIPrphOJ+Cl5cvcpwAXOwQhZOpwOjkOYeyOIZgDld7P0ZTRaDw4qgx+gp04UlfDpTREXs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556153; h=Content-Type:Content-Transfer-Encoding:Cc: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=d/kcsoy8xvLl2yTq/W4Pjs4gVgv8DwhZDAf1GbAxzZE=; b=TvbqwFd5kTNVu4zpq15LX5vZrtwX6htdUIBHu/JI5q9JxtFEYJ5mBBcnCxY4D7Yh7pISU9F0DfZp5jz+x0xadYnGG0RRPZ8/SyxxhqIU7b/IhW5UesyAqy4Fkpa3Uv8FzuXvAdMKfiNDv3AlnjLQX2mzjG+RtXeTYp/kaDWNqd4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556153073326.5113697155259; Mon, 15 Jun 2026 13:42:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE87-0007qj-Sm; Mon, 15 Jun 2026 16:41: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 1wZE86-0007hm-0R for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41:58 -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 1wZE84-0003Di-BH for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:41:57 -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-341-7oJh80VINfmv0ImtiV3KDA-1; Mon, 15 Jun 2026 16:41:52 -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 79E0D18002C2; Mon, 15 Jun 2026 20:41:51 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 604021955BCE; Mon, 15 Jun 2026 20:41:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=d/kcsoy8xvLl2yTq/W4Pjs4gVgv8DwhZDAf1GbAxzZE=; b=TlfaE9AstUE0Vy2TscD0tciqXRXqCxxx/uL5Y8qQWSLxkUD8nXFli0halTsUNJ6BCNExHB 4vPXdTJ6Pz1jRUG+FCsQuZKViwpk5QZ476Z+5U7fGlW1KRYedsuaWhufJrldAOgR6EK8nQ oH2DNDA3xvtJBPfxslwIvFqEmAGgpqM= X-MC-Unique: 7oJh80VINfmv0ImtiV3KDA-1 X-Mimecast-MFC-AGG-ID: 7oJh80VINfmv0ImtiV3KDA_1781556111 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:13 +0400 Subject: [PATCH v2 47/53] 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: <20260616-qom-qapi-v2-47-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=5356; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=vFYjRBJkELU7QsiVEKFdbWqa1O19eePNiBTYHdrRF8g=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKQ1nXO21sXNAPcBMvQ/baxOq1Ohk4UkHjd9 w6IOkTb5kyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBikAAKCRDa6OEJdZac 5X/TEAC4pXFRfn/Cvybwj8Bws8FqIN/IFhDUuAr8cKh69cQiUwc57tgY7TPqfueDkxA8wa5Zhzu xG/Ly2TmtqCljzGyrkshG9BU0nI/PyPTAdlUV5fayEtaPVwpiQ6vqfugQl+7sR1zif2nEaLDp6x VoS/g1x2Qkg5roct4UyE4E41kuoBKua6HVU65txh3Oy3HfT+8olrsxij5XGcLaZgx3t2Ug9E6u+ 4xDtzLpi83EQK97a/KutGNyt//zrB6N/UCB1001+uhZe73kSdFUpj8U6gDZzNy7WJnGryTDIHY+ NLt9gFq5JohobQpjlrZWUStOKiMYpz+Tfjwof1nMuM7dfV4kYGu7dpRntQAO4RUijqmF45jWEEL UhVuTyF23BmZEeNqNpqdigSXOkTdy8ec/PcisAy3lwyE+mRnTQLAwS/6GFl01vj2xX46M26kfon 49PEiB+SQFvV81nSLQ/yfqUhXsubWYiYziZVpDGl2YfQftsIAhnDGMMT9EYExeM6FVQzYWO+lXg s3TruiiY6xXvhQcacfYHS7jt19VYxU2CFnMDg5QhWlAAhziPiwjrw4amRbQKyISqOdM3x6WNE3Q QYWiiMsbGDHKnOTBf6DcRtyykDnZhQ3jkwCMaGlawyXgUts+ilmYh7y6WwfxHnDrWfhtdX9VDJz /qYgmgfhSxTX02Q== 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556154621158500 Mechanical conversion of all local PropertyInfo definitions in target/riscv/cpu.c Signed-off-by: Marc-Andr=C3=A9 Lureau --- target/riscv/cpu.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 98c9ebd791c..31fad255660 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1302,7 +1302,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, @@ -1344,7 +1344,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, @@ -1376,7 +1376,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, @@ -1408,7 +1408,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, @@ -1448,7 +1448,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, @@ -1486,7 +1486,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, @@ -1561,7 +1561,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, @@ -1594,7 +1594,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, @@ -1637,7 +1637,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, @@ -1678,7 +1678,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, @@ -1714,7 +1714,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, @@ -1750,7 +1750,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, @@ -1786,7 +1786,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, @@ -1822,7 +1822,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, @@ -1858,7 +1858,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, @@ -1915,7 +1915,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 Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556126; cv=none; d=zohomail.com; s=zohoarc; b=nAXOnvlq4zg53zL0fOpTMxUn4yPVWbq1AZYVcReJHp4DHuU/mbtOD7AOEaz12A3p9koS5FSr08pysJCydKyLyGG+Ue2xtsoeamPflZfIkPjpnQ7Y87D4p5hv/Q+JRiBP4ckyYWrCagv2aEAvbSxdC7F15rVUXUG3i0uv8noU48w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556126; h=Content-Type:Content-Transfer-Encoding:Cc: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=t6t4ezBII96+6a4HKBzL0lTlaoFSEHOBhFAsvczVhhE=; b=BiwG4LKoEqXcmHu61k1S0oH1P6v67H5oPgkA/rnkICRPoC9VuGWE02RD84Q/+AaJBzPCqz6eNOs9deMaSqGxv1H+zvH5qMqvVeJtvVVLWevvsI7j15OGbvk1fxO9iGfRVV2h7p1VMG9gzO6zag9BN9PQi/d+T5EpQE5CTgniDqs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556126223386.5640689138686; Mon, 15 Jun 2026 13:42:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE8C-0008E7-FC; Mon, 15 Jun 2026 16:42: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 1wZE8B-00088k-BB for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:42: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 1wZE89-0003EN-Ib for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:42: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-501-bGjaS12ZPIGewgstS_vGXA-1; Mon, 15 Jun 2026 16:41:57 -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 78C4B1801BE4; Mon, 15 Jun 2026 20:41:56 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 83A251955BCE; Mon, 15 Jun 2026 20:41:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t6t4ezBII96+6a4HKBzL0lTlaoFSEHOBhFAsvczVhhE=; b=JnlLuM5PkyUJCtwHnCSt9sseOdG1jbP4fwqevgoQ4Uo255Lx2guOtmm6uHrEjobFgHKnGR qTKZMR8SdPx/kGKJybjnznzav09DaydeseFyC9EfGK86oO51WLKWVttDAwwcP8Y0/C8YoW xffe5h31Xg/1Hj2n743U93Urk//m7U0= X-MC-Unique: bGjaS12ZPIGewgstS_vGXA-1 X-Mimecast-MFC-AGG-ID: bGjaS12ZPIGewgstS_vGXA_1781556116 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:14 +0400 Subject: [PATCH v2 48/53] 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: <20260616-qom-qapi-v2-48-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=3532; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=9TgmgvfPgDdjfPn6bWSLOx+EZ+pfq0srXNVDVFpMZW0=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKQDM63BOF96yAwYTENKWCv2C8W/aELQrVGk bO+RzU90TWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBikAAKCRDa6OEJdZac 5ZnrD/4ywGqCi1knIV1L40DuALZBUq5ObI8AEAOlzarExinqfadzPJVKEF/qogiejGCFFJQrn5i ZojpqjVIuLK9PXIj3ZWj+qrGk4Gteo/IUw38S9FKmk2zURGAzwtgeLhyCz1t0B8VQFvjWJpLkS3 d6Q23Q809bfLQIdRyI3vhdwW9XjhLAOcikiyd4e+fzjiBM+VIj98mBY6iasMzIaY1e4m8UNTynH ypYixYclX7lI2ox+ewrBWLj22D1BdOrBm6Vp7jaZAnsrFgllEkVK+fm1ACB8raeAGny/AqX2Y97 6KyKNtLueuc3Od0JPo+Y2HI8Alqr9D2G2e7N2PeeSu7AMv519qh0QOOc3SLds4mc9c6v6sUm3pS K4HW4PkkEN/7s0jpttxoUDGjC4i9Ogq+Mhc+pfhPIblQSJNe71f+1Fmv/Sk/+YANd+Su3qHrJ/h NhuaN5GbYnuPbgLzCVaqSwEmBbQ2SsKjhrEV36RCgv3Cb1UxSyGxKxBec5VKwpgvWSRfnAzp9J8 XSLqXJsPpOR1Q0E6nBKkPBBbVYOWb9Vmo0FMxvy3wj+qnp4h6jjsN3M4D/JuEOKycuiaKcgcmAg UB8++3f96+CMgaqOfcUFT4pHFe3GSbwFHWDnjk/ZhxAPXACu7FsnmUrT/Enyncnq7iBElXGZViA /0DSpP3vOR+0Obg== 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556126520158500 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 3df199ada7b..0122d8fef8a 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 Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556165; cv=none; d=zohomail.com; s=zohoarc; b=mFvlKoDDm3vQYn6h4cAa4H25tA99A5UuaLxZeyxIJ/E2DNBrx5c27Vr2Wm9xnLM/MYkSsFv+u4IPZ0Bs+TdaNP1P5BPJZfqmQNz6B3vRQQ5MIM8WOcmEkCeTKwvkqGuxxxLTdf5cJCX0cpGehksq6oXJYgEwoPBtmrxmCsMDzpk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556165; h=Content-Type:Content-Transfer-Encoding:Cc: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=8WtDrdFUR6gHhtA1AsiQ6rqVgnAFi31Hz+IUc2WR7PA=; b=fXL054nuVxzvpxyYqgE1iNXUlY8FhhyTN9wNMuTAomw6Xn628CpfJ/XRVIYyUy1IlUmgeqo02Zc42QhbOwnCpeKmMddBi+BXSENMrFGne/+vP5xjxcIljyxPb7D91sWc/CN+6Vx+BzfRS8cboKn6K1W8enWIDWvVJ/or5TA/Aic= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556165405577.7372578292253; Mon, 15 Jun 2026 13:42:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE8K-0000Ur-6q; Mon, 15 Jun 2026 16:42: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 1wZE8I-0000M9-K4 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:42: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 1wZE8G-0003FA-6b for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:42:10 -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-261--oGBrSpWNpGIArSFrP0V4g-1; Mon, 15 Jun 2026 16:42:03 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2521E19560B7; Mon, 15 Jun 2026 20:42:02 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 52E7019541B2; Mon, 15 Jun 2026 20:41:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8WtDrdFUR6gHhtA1AsiQ6rqVgnAFi31Hz+IUc2WR7PA=; b=Quud0vqMH/8SjgGq490ynJtXtwD+YNlfj/j+FI7MvtMHb+hg4iC8VPDNWxE9yyzqIyus+6 SSl6AByecJDuAm8/WtE9h9VHDYvxoU29/wH6sKNEl9AOLYeV40MaOHXHTJR0IJr/QM5qnF KTxjW0El5w2yu7AnL2maMz6ANT2Iyrc= X-MC-Unique: -oGBrSpWNpGIArSFrP0V4g-1 X-Mimecast-MFC-AGG-ID: -oGBrSpWNpGIArSFrP0V4g_1781556122 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:15 +0400 Subject: [PATCH v2 49/53] qdev: introduce typed array PropertyInfos MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260616-qom-qapi-v2-49-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=14525; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=3/AgzK+h7ESeYZoIrVzUByl4EpxsZ83pmJfX++jxz0k=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKQpXuSwpBKgaFW2dGzPGDxvZ5pl9dQuzYH8 wvVLcweqjyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBikAAKCRDa6OEJdZac 5et9D/9xUWL3HdQEc0LWzzNVFzUth7QhuJB1CcN/ChKGWCpe89OMR2XNehpRJZm3OcN4ZizvPpK rOVI7J8UnKxqSBa8UAmluUswP0h5VlU1v1OicI/ptifl5RSVDvSCC5/uTFUlb1MUM6m08dUeMoh cWWpkDH0LF1ZnWXtcPLeHQzNKMWeVaVDQjrUeiFLo//RRJJWUScK9lXa0mC2vhei77RWaTMvbrF IWIYg1ppr8zqCrZWYYdi21Jy8/YqiP6eCm73aYuC6nA5YeH/Y9wmzz66zOnmWVKXhsgX+MX2ezC BJmsRIKGjTR614XNPs+AEhjMLvEW6GyZwgVBpM4hM/Xc3BxnriUiX5MA3j6hn4T6ul8nDDY5RFD gYpiuxZyU9FK/TIBPHpH55zUNnnTFinSK4LSJpCSATmBCIOlA5VLulifqYhq/ZrPvJ34ZEB/fHG 3aEZS5ceVNRI4pJz+p/yknNpbs1Nwko6Ajf0uDXRcbtquKAKGLQa3LrWJ3IdmNqFCBkm52dJ9yX Hg5SKVPo+iLcvGjCq9WggYaI9KzmQSD0e4+12xsK0UOLDBs1t1APsFKN+WNRijK7GqLLllVsNFc uQO0UFt8yQCwbUufcIGgD81GFlpS4zotcDyPJadQwWZ47HpDo0g1g+1CiJaEyj8y58LkJinqHIL yrs9MbqibZl/+jA== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556166822158500 Add element_info and element_size fields to PropertyInfo, and extend qdev_prop_qapi_type() to derive QAPI types for array properties via element_info->qapi_type->list. Add typed list PropertyInfo definitions that replace the generic qdev_prop_array. Each typed list PropertyInfo knows its element type at compile time through the element_info and element_size fields, which allows the QAPI type to be derived automatically. Infrastructure changes: - Add prop_array_info() and prop_array_elem_size() helpers that prefer the new element_info/element_size fields with fallback to the old arrayinfo/arrayfieldsize fields for compatibility - Make get_prop_array, set_prop_array, release_prop_array, and default_prop_array non-static so they can be used by DEFINE_PROP_ARRAY_INFO in other translation units - Add DEFINE_PROP_ARRAY_INFO macro in qdev-prop-internal.h The array of links needs special care for its "full type name" to follow the "linkList" pattern used by link properties ("link"). The old qdev_prop_array and DEFINE_PROP_ARRAY macro are preserved for compatibility; they will be replaced in the next patch. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-prop-internal.h | 18 ++++++ include/hw/core/qdev-properties-system.h | 2 + include/hw/core/qdev-properties.h | 8 +++ hw/core/qdev-properties-system.c | 5 ++ hw/core/qdev-properties.c | 103 ++++++++++++++++++++++++---= ---- 5 files changed, 115 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 1ea2ba66bb3..0c067170079 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -35,6 +35,8 @@ struct PropertyInfo { const char *description; const QEnumLookup *enum_table; const QAPITypeInfo *qapi_type; + const struct PropertyInfo *element_info; + int element_size; bool realized_set_allowed; /* allow setting property on realized devic= e */ char *(*print)(Object *obj, const Property *prop); void (*set_default_value)(ObjectProperty *op, const Property *prop); @@ -75,7 +77,13 @@ extern const PropertyInfo qdev_prop_string; extern const PropertyInfo qdev_prop_on_off_auto; extern const PropertyInfo qdev_prop_size32; extern const PropertyInfo qdev_prop_array; +extern const PropertyInfo qdev_prop_uint8_list; +extern const PropertyInfo qdev_prop_uint16_list; +extern const PropertyInfo qdev_prop_uint32_list; +extern const PropertyInfo qdev_prop_uint64_list; +extern const PropertyInfo qdev_prop_string_list; extern const PropertyInfo qdev_prop_link; +extern const PropertyInfo qdev_prop_link_list; =20 #define DEFINE_PROP(_name, _state, _field, _prop, _type, ...) { \ .name =3D (_name), \ 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 c2980c36afa..a9ca8e4a03d 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -665,6 +665,22 @@ struct ArrayElementList { void *value; }; =20 +static const PropertyInfo *prop_array_info(const Property *prop) +{ + if (prop->info->element_info) { + return prop->info->element_info; + } + return prop->arrayinfo; +} + +static int prop_array_elem_size(const Property *prop) +{ + if (prop->info->element_size) { + return prop->info->element_size; + } + return prop->arrayfieldsize; +} + /* * Given an array property @parent_prop in @obj, return a Property for a * specific element of the array. Arrays are backed by an uint32_t length = field @@ -674,7 +690,7 @@ static Property array_elem_prop(Object *obj, const Prop= erty *parent_prop, const char *name, char *elem) { return (Property) { - .info =3D parent_prop->arrayinfo, + .info =3D prop_array_info(parent_prop), .name =3D name, /* * This ugly piece of pointer arithmetic sets up the offset so @@ -692,19 +708,21 @@ static Property array_elem_prop(Object *obj, const Pr= operty *parent_prop, * underlying element's property release hook for each element and free the * property array. */ -static void release_prop_array(Object *obj, const char *name, void *opaque) +void release_prop_array(Object *obj, const char *name, void *opaque) { const Property *prop =3D opaque; uint32_t *alenptr =3D object_field_prop_ptr(obj, prop); void **arrayptr =3D (void *)obj + prop->arrayoffset; char *elem =3D *arrayptr; int i; + const PropertyInfo *elem_info =3D prop_array_info(prop); + int elem_size =3D prop_array_elem_size(prop); =20 - if (prop->arrayinfo->release) { + if (elem_info->release) { for (i =3D 0; i < *alenptr; i++) { Property elem_prop =3D array_elem_prop(obj, prop, name, elem); - prop->arrayinfo->release(obj, NULL, &elem_prop); - elem +=3D prop->arrayfieldsize; + elem_info->release(obj, NULL, &elem_prop); + elem +=3D elem_size; } } =20 @@ -718,8 +736,8 @@ static void release_prop_array(Object *obj, const char = *name, void *opaque) * (a pointer to which is stored in the additional field described by * prop->arrayoffset). */ -static void set_prop_array(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +void set_prop_array(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { ERRP_GUARD(); const Property *prop =3D opaque; @@ -727,6 +745,8 @@ static void set_prop_array(Object *obj, Visitor *v, con= st char *name, void **arrayptr =3D (void *)obj + prop->arrayoffset; ArrayElementList *list, *elem, *next; const size_t size =3D sizeof(*list); + const PropertyInfo *elem_info =3D prop_array_info(prop); + int elem_size =3D prop_array_elem_size(prop); char *elemptr; bool ok =3D true; =20 @@ -745,9 +765,9 @@ static void set_prop_array(Object *obj, Visitor *v, con= st char *name, while (elem) { Property elem_prop; =20 - elem->value =3D g_malloc0(prop->arrayfieldsize); + elem->value =3D g_malloc0(elem_size); elem_prop =3D array_elem_prop(obj, prop, name, elem->value); - prop->arrayinfo->set(obj, v, NULL, &elem_prop, errp); + elem_info->set(obj, v, NULL, &elem_prop, errp); if (*errp) { ok =3D false; goto out_obj; @@ -769,8 +789,8 @@ out_obj: for (elem =3D list; elem; elem =3D next) { Property elem_prop =3D array_elem_prop(obj, prop, name, elem->value); - if (prop->arrayinfo->release) { - prop->arrayinfo->release(obj, NULL, &elem_prop); + if (elem_info->release) { + elem_info->release(obj, NULL, &elem_prop); } next =3D elem->next; g_free(elem->value); @@ -783,19 +803,19 @@ out_obj: * Now that we know how big the array has to be, move the data over to= a * linear array and free the temporary list. */ - *arrayptr =3D g_malloc_n(*alenptr, prop->arrayfieldsize); + *arrayptr =3D g_malloc_n(*alenptr, elem_size); elemptr =3D *arrayptr; for (elem =3D list; elem; elem =3D next) { - memcpy(elemptr, elem->value, prop->arrayfieldsize); - elemptr +=3D prop->arrayfieldsize; + memcpy(elemptr, elem->value, elem_size); + elemptr +=3D elem_size; next =3D elem->next; g_free(elem->value); g_free(elem); } } =20 -static void get_prop_array(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +void get_prop_array(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { ERRP_GUARD(); const Property *prop =3D opaque; @@ -805,6 +825,8 @@ static void get_prop_array(Object *obj, Visitor *v, con= st char *name, ArrayElementList *list =3D NULL, *elem; ArrayElementList **tail =3D &list; const size_t size =3D sizeof(*list); + const PropertyInfo *elem_info =3D prop_array_info(prop); + int elem_size =3D prop_array_elem_size(prop); int i; bool ok; =20 @@ -812,7 +834,7 @@ static void get_prop_array(Object *obj, Visitor *v, con= st char *name, for (i =3D 0; i < *alenptr; i++) { elem =3D g_new0(ArrayElementList, 1); elem->value =3D elemptr; - elemptr +=3D prop->arrayfieldsize; + elemptr +=3D elem_size; =20 *tail =3D elem; tail =3D &elem->next; @@ -825,7 +847,7 @@ static void get_prop_array(Object *obj, Visitor *v, con= st char *name, elem =3D list; while (elem) { Property elem_prop =3D array_elem_prop(obj, prop, name, elem->valu= e); - prop->arrayinfo->get(obj, v, NULL, &elem_prop, errp); + elem_info->get(obj, v, NULL, &elem_prop, errp); if (*errp) { goto out_obj; } @@ -847,7 +869,7 @@ out_obj: } } =20 -static void default_prop_array(ObjectProperty *op, const Property *prop) +void default_prop_array(ObjectProperty *op, const Property *prop) { object_property_set_default_list(op); } @@ -860,6 +882,38 @@ const PropertyInfo qdev_prop_array =3D { .set_default_value =3D default_prop_array, }; =20 +const PropertyInfo qdev_prop_uint8_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint8, uint8_t); +const PropertyInfo qdev_prop_uint16_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint16, uint16_t); +const PropertyInfo qdev_prop_uint32_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint32, uint32_t); +const PropertyInfo qdev_prop_uint64_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint64, uint64_t); +const PropertyInfo qdev_prop_string_list =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_string, char *); + +static ObjectProperty *create_link_list_property(ObjectClass *oc, + const char *name, + const Property *prop) +{ + g_autofree char *full_type =3D g_strdup_printf("link<%s>List", prop->l= ink_type); + + return object_class_property_add(oc, name, full_type, + get_prop_array, set_prop_array, + release_prop_array, (Property *)prop); +} + +const PropertyInfo qdev_prop_link_list =3D { + .element_info =3D &qdev_prop_link, + .element_size =3D sizeof(void *), + .create =3D create_link_list_property, + .get =3D get_prop_array, + .set =3D set_prop_array, + .release =3D release_prop_array, + .set_default_value =3D default_prop_array, +}; + /* --- public helpers --- */ =20 static const Property *qdev_prop_walk(DeviceClass *cls, const char *name) @@ -1158,8 +1212,15 @@ const PropertyInfo qdev_prop_link =3D { =20 static const QAPITypeInfo *qdev_prop_qapi_type(const Property *prop) { - /* this will be later extended to cope with QAPI array properties */ - return prop->info->qapi_type; + if (prop->info->qapi_type) { + return prop->info->qapi_type; + } + if (prop->info->element_info) { + assert(prop->info->element_info->qapi_type); + assert(prop->info->element_info->qapi_type->list); + return prop->info->element_info->qapi_type->list; + } + return NULL; } =20 void qdev_property_add_static(DeviceState *dev, const Property *prop) --=20 2.54.0 From nobody Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556163; cv=none; d=zohomail.com; s=zohoarc; b=TJULnhAqo3WKT3My031Lx1nu4t08am3N8m7/7+IRFWFez4PvCRVRa0zsLngpiclEZftAUJyjVNn+rugZoEbHezmQcuMrkGxQBNfTgMG+KOccc7SPybHaIMi4FaVbvQEk2ZdH4wrBJ9OSWuUbWBRmIqkHWgqm4M7cd6H1ftbrBHU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556163; h=Content-Type:Content-Transfer-Encoding:Cc: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=cNn2CddowpIBpSIl95l69NtEfVsCFeRbsjqaync4Su4=; b=klG67+HSHTJea8cyUhw2psxxUBT7Xn/MJYOj59AF1MCrRJchPb3+PNG9JJULH53o+R9wUkCtTRMAp4CuivZqN0RUdY7xoP81altL99ryEp5V88HA5ED0YPTNw3x8Zh/8RtBiBUjVYCXopugn0TvWt9s8tKfo41C/aLqclCT6PGo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556163013257.36914970599173; Mon, 15 Jun 2026 13:42:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE8Q-00013F-Fj; Mon, 15 Jun 2026 16:42: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 1wZE8O-0000vL-A4 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:42: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 1wZE8L-0003GY-Mu for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:42:16 -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-605-JKSXxvftMrm17CowXNDMUA-1; Mon, 15 Jun 2026 16:42:08 -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 A3E9F1955E7E; Mon, 15 Jun 2026 20:42:07 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id ED5B5180058F; Mon, 15 Jun 2026 20:42:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cNn2CddowpIBpSIl95l69NtEfVsCFeRbsjqaync4Su4=; b=Jmw/k/7LKyAL3x84CLX0qKLIeiqlejI6kCp3iuM5TjcftV2MVyX7cHPFPm7jk+jzJjKxXg K8tv7CH9H66U+ZWdwx2+Gy0/Z50ix1ELD5KzTk5NpSTOLRtwa2g40luQHvzEzW3SsWPNWM rHg2sj5koCAW6e/00nRV9edVFQ4cjyw= X-MC-Unique: JKSXxvftMrm17CowXNDMUA-1 X-Mimecast-MFC-AGG-ID: JKSXxvftMrm17CowXNDMUA_1781556127 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:16 +0400 Subject: [PATCH v2 50/53] 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: <20260616-qom-qapi-v2-50-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=18734; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=EKnaOHXDsjZXdHPfw/0i0/BqqrMNUi3fu5/FWY1Ft4Y=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKQzC9QNQWlc/XcfVTTjArW2o3bgFUltWZE3 V3EZKl8OyqJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBikAAKCRDa6OEJdZac 5WJvD/43V5J+HvGiyc5kjFuYX9Uf/TtVNkT0+KwcvJb7BNX5u855WDZIajKPvBLfkwuBOpo8JWX slfnIXsJ3WbC3UHU2k4p0ngVhWpKtmch4O9Gh0vnWcA1F+rdb0Hd68AGlSTsOO8QzJxcMcJ2G5f UKBkB7jrySL5Vv0Dk8yNCGkXBE1bfHt/LLhkHTasaqZd23JRH2MvC7G2sAqHXFf/Pz5xUUidwT7 AexQXvWH8QMaIlzoz2x3CvHZ+Oyh8ndVQVkAb3VYMoVerr7+Un/wC9jWLmQJkvFyAqY60O6u3e5 l+KSm8TAwouU6tAyIuLphPfZRl4v3+TOe3y17uc9BcuTPV+Kh756gpD8zHmqnb6GhgXKxI79kZ9 hzYyXcGCW1Dalg+fCD7cigAB7nmnbYhDtgrCmIAA8roiyJCXZHZausqcGzms/pYZudH/SItwhvl bWN+Ut+YNpKrxpP7DVLBDLe/jghoUOOMFmKoQJapQsSLJvidQtHhJMAh5a6CErKYs8HmAYZd0s5 E8Jpv6TuiFPQXa5niWRqrt48xKU0CCeAGEnmNbERIyFCXXUo60eZZhDUDrUKu+8wJvH3Vl2/9s8 AHpfO4/EZBSpTIzKJhsXf0gXChOLbtNbRd1bZ3tC1S09jexbL1s3TvTGExUXM3loXzKrP1RHWT9 xc002c8RpzBsjYA== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556164831158500 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 | 27 ++++++++++----------------- hw/core/qdev-properties.c | 8 -------- hw/input/stellaris_gamepad.c | 2 +- hw/intc/arm_gicv3_common.c | 2 +- hw/intc/arm_gicv5_common.c | 4 ++-- hw/intc/rx_icu.c | 4 ++-- hw/misc/arm_sysctl.c | 4 ++-- hw/misc/mps2-scc.c | 2 +- hw/net/rocker/rocker.c | 2 +- hw/net/virtio-net.c | 2 +- hw/nvram/xlnx-efuse.c | 2 +- hw/nvram/xlnx-versal-efuse-ctrl.c | 2 +- hw/riscv/riscv_hart.c | 6 ++---- hw/virtio/virtio-iommu-pci.c | 2 +- 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 ++++ 20 files changed, 35 insertions(+), 47 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 df941df19f2..70bf03a8de7 100644 --- a/include/hw/block/block.h +++ b/include/hw/block/block.h @@ -83,7 +83,7 @@ static inline unsigned int get_physical_block_exp(BlockCo= nf *conf) _conf.account_failed, ON_OFF_AUTO_AUTO), \ DEFINE_PROP_ARRAY("stats-intervals", _state, \ _conf.num_stats_intervals, _conf.stats_intervals, \ - qdev_prop_uint32, uint32_t) + qdev_prop_uint32) =20 #define DEFINE_BLOCK_PROPERTIES(_state, _conf) \ DEFINE_PROP_DRIVE("drive", _state, _conf.blk), \ diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-prope= rties.h index 0c067170079..39f95ce7a3c 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -76,7 +76,6 @@ extern const PropertyInfo qdev_prop_size; extern const PropertyInfo qdev_prop_string; extern const PropertyInfo qdev_prop_on_off_auto; extern const PropertyInfo qdev_prop_size32; -extern const PropertyInfo qdev_prop_array; extern const PropertyInfo qdev_prop_uint8_list; extern const PropertyInfo qdev_prop_uint16_list; extern const PropertyInfo qdev_prop_uint32_list; @@ -148,15 +147,15 @@ extern const PropertyInfo qdev_prop_link_list; * @_name: name of the array * @_state: name of the device state structure type * @_field: uint32_t field in @_state to hold the array length - * @_arrayfield: field in @_state (of type '@_arraytype *') which - * will point to the array - * @_arrayprop: PropertyInfo defining what property the array elements have - * @_arraytype: C type of the array elements + * @_arrayfield: field in @_state which will point to the array + * @_arrayprop: PropertyInfo for the array elements (e.g. qdev_prop_uint32= ); + * a corresponding list PropertyInfo named @_arrayprop##_list + * must exist * * Define device properties for a variable-length array _name. The array = is * represented as a list in the visitor interface. * - * @_arraytype is required to be movable with memcpy(). + * The element type must be movable with memcpy(). * * When the array property is set, the @_field member of the device * struct is set to the array length, and @_arrayfield is set to point @@ -166,12 +165,10 @@ extern const PropertyInfo qdev_prop_link_list; * @_arrayfield memory. */ #define DEFINE_PROP_ARRAY(_name, _state, _field, \ - _arrayfield, _arrayprop, _arraytype) \ - DEFINE_PROP(_name, _state, _field, qdev_prop_array, uint32_t, \ + _arrayfield, _arrayprop) \ + DEFINE_PROP(_name, _state, _field, _arrayprop##_list, uint32_t, \ .set_default =3D true, \ .defval.u =3D 0, \ - .arrayinfo =3D &(_arrayprop), \ - .arrayfieldsize =3D sizeof(_arraytype), \ .arrayoffset =3D offsetof(_state, _arrayfield)) =20 #define DEFINE_PROP_LINK(_name, _state, _field, _type, _ptr_type) \ @@ -183,10 +180,8 @@ extern const PropertyInfo qdev_prop_link_list; * @_name: name of the array * @_state: name of the device state structure type * @_field: uint32_t field in @_state to hold the array length - * @_arrayfield: field in @_state (of type '@_arraytype *') which - * will point to the array + * @_arrayfield: field in @_state which will point to the array * @_linktype: QOM type name of the link type - * @_arraytype: C type of the array elements * * Define device properties for a variable-length array _name of links * (i.e. this is the array version of DEFINE_PROP_LINK). @@ -195,12 +190,10 @@ extern const PropertyInfo qdev_prop_link_list; * where each string is the QOM path of the object to be linked. */ #define DEFINE_PROP_LINK_ARRAY(_name, _state, _field, _arrayfield, \ - _linktype, _arraytype) \ - DEFINE_PROP(_name, _state, _field, qdev_prop_array, uint32_t, \ + _linktype) \ + DEFINE_PROP(_name, _state, _field, qdev_prop_link_list, uint32_t, \ .set_default =3D true, \ .defval.u =3D 0, \ - .arrayinfo =3D &qdev_prop_link, \ - .arrayfieldsize =3D sizeof(_arraytype), \ .arrayoffset =3D offsetof(_state, _arrayfield), \ .link_type =3D _linktype) =20 diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index a9ca8e4a03d..b5a9eb97e7d 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -874,14 +874,6 @@ void default_prop_array(ObjectProperty *op, const Prop= erty *prop) object_property_set_default_list(op); } =20 -const PropertyInfo qdev_prop_array =3D { - .type =3D "list", - .get =3D get_prop_array, - .set =3D set_prop_array, - .release =3D release_prop_array, - .set_default_value =3D default_prop_array, -}; - const PropertyInfo qdev_prop_uint8_list =3D DEFINE_PROP_ARRAY_INFO(qdev_prop_uint8, uint8_t); const PropertyInfo qdev_prop_uint16_list =3D diff --git a/hw/input/stellaris_gamepad.c b/hw/input/stellaris_gamepad.c index 25769fc2616..4baa3956a9c 100644 --- a/hw/input/stellaris_gamepad.c +++ b/hw/input/stellaris_gamepad.c @@ -71,7 +71,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/arm_gicv5_common.c b/hw/intc/arm_gicv5_common.c index b155486af65..61c8ae49302 100644 --- a/hw/intc/arm_gicv5_common.c +++ b/hw/intc/arm_gicv5_common.c @@ -191,9 +191,9 @@ static void gicv5_common_realize(DeviceState *dev, Erro= r **errp) =20 static const Property arm_gicv5_common_properties[] =3D { DEFINE_PROP_LINK_ARRAY("cpus", GICv5Common, num_cpus, - cpus, TYPE_ARM_CPU, ARMCPU *), + cpus, TYPE_ARM_CPU), DEFINE_PROP_ARRAY("cpu-iaffids", GICv5Common, num_cpu_iaffids, - cpu_iaffids, qdev_prop_uint32, uint32_t), + cpu_iaffids, qdev_prop_uint32), DEFINE_PROP_UINT32("irsid", GICv5Common, irsid, 0), DEFINE_PROP_UINT32("spi-range", GICv5Common, spi_range, 0), DEFINE_PROP_UINT32("spi-base", GICv5Common, spi_base, 0), diff --git a/hw/intc/rx_icu.c b/hw/intc/rx_icu.c index 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 77c420b3000..592d692d793 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 Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556187; cv=none; d=zohomail.com; s=zohoarc; b=acFvXJBCIHN8uTvRulK3x4crlAEqo5Gjyg5/JEJ7WKR1JQrlPX+nXVdDtPMiChU1hWRcYS2YYXcH0PinFTzyM+EJW7yimaLzeREdk38HSQtAzHVBFVKWP8/7lMliEYVCvSUDJAUZPwXu6ckTpZ8UXia7sqOiZsYtBYqD+HkEdYA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556187; h=Content-Type:Content-Transfer-Encoding:Cc: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=ilsylrs01yNLIo+fywZHDpLolI7Hfnqi73bGfbNipbQ=; b=LBz9QbbR3DQ68foPpb7LCpjrcTpEguk3Mx1DeH+9D4eELmPWaAWqmhnscSso0KOSqbpVg/cJNVujVzr8yrTbd+7+13GFdc3XIcqGv2sNs9g0wv+JlKtJSlSh5zRxpdmtf6S6ZpITB5IBdFTLIMrHzTwyFVnGTuqT0o6IRkoK92k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178155618752588.10205888424662; Mon, 15 Jun 2026 13:43:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE8U-0001Iy-6Y; Mon, 15 Jun 2026 16:42: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 1wZE8S-0001CT-AR for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:42: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 1wZE8Q-0003HG-F7 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:42:20 -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-665-n2NlV0--M5OYbkybH27wpg-1; Mon, 15 Jun 2026 16:42:14 -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 10614180064B; Mon, 15 Jun 2026 20:42:13 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C4EC53008B37; Mon, 15 Jun 2026 20:42:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ilsylrs01yNLIo+fywZHDpLolI7Hfnqi73bGfbNipbQ=; b=AXIiEmoT1+iMOq1WmZgdGywQphHIv9fyRIVhSJcfpX5iA1xiJNwcLWS/I0dNdEZFORrViD 3ZWkxf/RqCHSFr+pbh9gpfxgeg9emGgvTgs6qyUiXsHHcZyToWmUSKHOkGgHppCM0scZrM B6wlnptFu0c+neOnZXjyzMKcnfvpkks= X-MC-Unique: n2NlV0--M5OYbkybH27wpg-1 X-Mimecast-MFC-AGG-ID: n2NlV0--M5OYbkybH27wpg_1781556133 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:17 +0400 Subject: [PATCH v2 51/53] 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: <20260616-qom-qapi-v2-51-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=5580; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=hZy2Pabp/CPjyH6vbOTPzfXaX5flh/lxJzHVmVPyE08=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKQSnxwHIOtsP4U0/6wcMpoOVKfwMpClgnQm TwqWlPfAUqJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBikAAKCRDa6OEJdZac 5TfXD/9bA8d6pprxPDcZrehm//j7jmh+Fc8l7kMe2LKmw6+UJoIN9O6Q6g6sI49GUU96nxF0dvk V9KtDKAEhjeK0MIMC2fQ8L3ZrbDpq1Z4SUuLgoQ4W86Tt0CPo/eFgXdVOZ+Fih110pbWq9MMM6Q uIWGIRrYYTlxA/sip7Kxl+8oUiFQ8WkmvAYaU3WhNHaxWGwiVv1YMSZr5VT0oVVfb5TBswo9/1N ad19dpOFuhNl9YKcuqcoRc/DxmWifJq/nC8LT/6Iw65rUk5OnPQH5BPrm4dEOJuljnK06EgxZK5 fay+xKXnCP5y69o3BVrlU+v9AoMY3YTqZ8Uv67OuZ42tiY7etTItLvx3chCqCcIPBFpmrFoFjAO 9HBm5rvKUTGAyn2YM4lNw7+iAzovzbqZCNXjzDMSiDEt3HnH/aDVqFVI+fg8/bzQDsD/GhvtMnX CYkme0FJfVADZy2PPCoIcn/z5rYwYabuB7VGkhOeJ5VLd0KBoAhYjkd3bZceYBL7YryIvfDtfRf pyrevmLXmuMm9VSS1qmPng/VwbmRUTGQXMUCEfIvy9bnJUyQ2DHfK+DrAA0PitP5fXQw4wnUGJi vjTNnJDuNJ4l+7kimdTj38PqXyOQ5jSejvx28vAPqxtZOsFNMjpHE7T2sol2pZiRJq7USGNhMqY eGqir4Dfof/3DYg== 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556188871158500 Now that all PropertyInfo definitions use .qapi_type, remove the legacy .type (string) and .enum_table fields from PropertyInfo, and the .arrayinfo/.arrayfieldsize fields from Property. Remove fallback branches in qdev_property_add_static() and qdev_class_add_property() that used object_property_add() with prop->info->type: these always use the QAPI-aware registration path now. Simplify qdev_propinfo_enum_lookup(), prop_array_info() and prop_array_elem_size() to use the new fields directly. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/hw/core/qdev-properties.h | 4 --- hw/core/qdev-properties.c | 58 ++++++++++++-----------------------= ---- 2 files changed, 17 insertions(+), 45 deletions(-) diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-prope= rties.h index 39f95ce7a3c..2267e734d1f 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 b5a9eb97e7d..585982f60f5 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -103,11 +103,8 @@ static ObjectPropertyAccessor *field_prop_setter(const= PropertyInfo *info) =20 const QEnumLookup *qdev_propinfo_enum_lookup(const PropertyInfo *info) { - if (info->qapi_type) { - assert(info->qapi_type->lookup); - return info->qapi_type->lookup; - } - return info->enum_table; + assert(info->qapi_type->lookup); + return info->qapi_type->lookup; } =20 void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, @@ -667,18 +664,12 @@ struct ArrayElementList { =20 static const PropertyInfo *prop_array_info(const Property *prop) { - if (prop->info->element_info) { - return prop->info->element_info; - } - return prop->arrayinfo; + return prop->info->element_info; } =20 static int prop_array_elem_size(const Property *prop) { - if (prop->info->element_size) { - return prop->info->element_size; - } - return prop->arrayfieldsize; + return prop->info->element_size; } =20 /* @@ -1222,20 +1213,13 @@ void qdev_property_add_static(DeviceState *dev, con= st Property *prop) const QAPITypeInfo *qapi_type =3D qdev_prop_qapi_type(prop); =20 assert(!prop->info->create); + assert(qapi_type); =20 - if (qapi_type) { - op =3D object_property_add_qapi(obj, prop->name, qapi_type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); - } else { - op =3D object_property_add(obj, prop->name, prop->info->type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); - } + op =3D object_property_add_qapi(obj, prop->name, qapi_type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); =20 object_property_set_description(obj, prop->name, prop->info->description); @@ -1259,21 +1243,13 @@ static void qdev_class_add_property(DeviceClass *kl= ass, const char *name, } else { const QAPITypeInfo *qapi_type =3D qdev_prop_qapi_type(prop); =20 - if (qapi_type) { - op =3D object_class_property_add_qapi(oc, - name, qapi_type, - field_prop_getter(prop->inf= o), - field_prop_setter(prop->inf= o), - prop->info->release, - (Property *)prop); - } else { - op =3D object_class_property_add(oc, - name, prop->info->type, - field_prop_getter(prop->info), - field_prop_setter(prop->info), - prop->info->release, - (Property *)prop); - } + assert(qapi_type); + op =3D object_class_property_add_qapi(oc, + name, qapi_type, + field_prop_getter(prop->info), + field_prop_setter(prop->info), + prop->info->release, + (Property *)prop); } if (prop->set_default) { prop->info->set_default_value(op, prop); --=20 2.54.0 From nobody Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556200; cv=none; d=zohomail.com; s=zohoarc; b=jEDs6TCYMU7cW3qZ94cD1RHOw33T+3yOv6XjpxV5/r6jTdLPwpDbYm9kZ2GSRfmRpSJmTkUGP5kbkYJlsSN4G6DlDqlV3oLPYgmdgCIpTzJqVGQELWfBdGvCKWO6TCmnRrnilkFwnf+J+v3LBtEl8XOJkJ/VL3q6GdYz5bblSVQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556200; h=Content-Type:Content-Transfer-Encoding:Cc: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=NCpYzzFfRLn/bDIA8NVh6qt0sPVB4g9t4vEWZhRt5xs=; b=AO1M3AbidYuGHEz/OjWX63iPhFfS3HBDCUQSOqdzWGtnEDlXH9rIC5kFumEUDCeTIp8GJLKml1/uGvqxgjZ1+o/eo0SpDKT9c6oKOmdwe3UPd6O0IbDfPAz7vT+6LVzsJ7nWRtyigAT7iTikB8D79uKE3obBP0a6JEqzLHRqzz0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556200562205.96638831354755; Mon, 15 Jun 2026 13:43:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE8X-0001gc-N4; Mon, 15 Jun 2026 16:42: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 1wZE8W-0001by-Mc for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:42:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE8V-0003Hk-7o for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:42: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-220-b5CzKcXxMuOo_J7i1eLDIw-1; Mon, 15 Jun 2026 16:42:19 -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 0B9741955F56; Mon, 15 Jun 2026 20:42:18 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 20E523008B37; Mon, 15 Jun 2026 20:42:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NCpYzzFfRLn/bDIA8NVh6qt0sPVB4g9t4vEWZhRt5xs=; b=UlVXHFblsTrp5Lo9xgMMpOL6an1QjQXPQvyeYZQpZkAg3FSJbAb5NrYG9ROSm7UxngNx+S hB2kWs2HQNRhawcse7j2S1onu35UZhQb4/TcWbO3Q8X+lAvlSvnxPc4Qq9GfWkmHyHEh1S pELGwCnQqNpaWNtDUWBROKKkdC2XoaI= X-MC-Unique: b5CzKcXxMuOo_J7i1eLDIw-1 X-Mimecast-MFC-AGG-ID: b5CzKcXxMuOo_J7i1eLDIw_1781556138 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:18 +0400 Subject: [PATCH v2 52/53] 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: <20260616-qom-qapi-v2-52-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=2953; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=4Zmyoj53ITDcDim3Jbb45V8LSIPOURlFf4iisCH4NYs=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKQBy8BYODs8Rx1ENCdlFhuN0/ewajWU0+F6 bk+dpqUTziJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBikAAKCRDa6OEJdZac 5d59EAC6+SG1dWMcP5TrO2Fh4dOKikFWtvCCVIrx4Sd6Ae/vrXK81r8lzKAIEk5pB0Rz41ov/VT uhTbsNtkRqlVipmzwC860KuaJHi3cQoX+sHS2efFK7x1wP1GUjJ9TOA1CGehTcLBWGr6ANUPkXM lfUgaj0vChImow9f+mtEBQSkQ8mGBf6CepO1rzBBR8PM5RRP0F0WdfL7iVgu2ao+yJ6/3NeRJ6P /EEOou2Hj35gBuPxSdAXewO9cwiCvgogEsmXbCRZWX+HcybMGRONXQkkLYDswhy+t+/z8Jhakxf 5j9bmptR0qnr1Fa3rfp4I+3ZJVG34KkwcMvPBaEejUm+aHHgc6wDNLapMeZxtX2PxYQgpVVUkpB grvJnnOI1IJ3Jjs5OF2ezlj3k9qFI9pYSOO3L7t4iwi3zwHVpOw1cmR+3/PBfnaiIl1n9RQLQYa u3B1f1jEShVShJrhhEGUDKXI1J51RUKcegD4nrhHX5V1rXbJ8jYJlS6q/MK9DU2nbM+23AVB2dm sdwlYS5yIORAhixAldT/nhqL7mRgcfp3Vf5bSJ75WxkLqPb41iGjUvWRzyTAi6b+BvDKP+gTIRy Nt0hAEws/ahJlMd7kdO4sipyAq8WY16czdi0yNSZvOIjYTGysGjmGmFVFSt+i+fVvWX3IcLUtVG yFlJiglikAnvO6w== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556200920158500 Replace the hand-rolled container property with object_property_add_link(). With check=3DNULL the link has no setter (read-only), matching the existing behaviour. The built-in link getter and resolver are functionally identical to the removed memory_region_get_container() and memory_region_resolve_container(). The non-STRONG flag avoids refcount interference: mr->container is managed externally by memory_region_add/del_subregion(). Signed-off-by: Marc-Andr=C3=A9 Lureau --- 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 Fri Jun 19 17:25:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1781556161; cv=none; d=zohomail.com; s=zohoarc; b=Rgf3l17yoICH2V1znF6cnhLCBfNgv6oTSHSRVfD/AAUiDLFeBONWvGMq5mOslmPe8kawgr1DBlETzXm8i/OR/W4Qy2b2EQzhjb+3pe1EHqgvNmBqIhRVgOBQmUFquRFI0tOU4Gr3Eaxj17EzoEPbSarm+2o1DFKFRtU9BWTtyns= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781556161; h=Content-Type:Content-Transfer-Encoding:Cc: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=CchrLjPFhZL+2KlQGU6T1CSqkzB7rOe0NMGG7vf3ry8=; b=IjV8HylzaeYwebs9BJs2vPCP4WqcPeQXEz+Q/IyxOKe9fEoRnvgjtaRg9bWLSXVtxPJkf1NPOYKqw64H+AbtaDI9nj/nub7o6pJmFg7dV4ywW6I/bKegI/uFI8V4J6/dBOduJd5Kcf8ONEACvn5HTVL/yVJgGUO2CM6h9/7jM60= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781556161171761.162545710372; Mon, 15 Jun 2026 13:42:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZE8e-0002MJ-7w; Mon, 15 Jun 2026 16:42: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 1wZE8c-0002A7-Qc for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:42:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZE8b-0003IA-4G for qemu-devel@nongnu.org; Mon, 15 Jun 2026 16:42: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-353-WqUwXXfOPoSRTmjZ1Xuy3A-1; Mon, 15 Jun 2026 16:42:24 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3C7BD19560AD; Mon, 15 Jun 2026 20:42:23 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0C3E61800361; Mon, 15 Jun 2026 20:42:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781556148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CchrLjPFhZL+2KlQGU6T1CSqkzB7rOe0NMGG7vf3ry8=; b=Sz0txBnikqUVTeEG/sXIW003FBaxar9ZAWFnRWDG3FzIomus5XlUVIs9OLa0/Pm+tS6+p9 vYPY8jQw5vnr0h4IJsDOq+rBT3864F2tbz8Mxd8vsRKwEe0LSUKAeY7imRqPgK6KmMxSTi QYF66RHHxi04coD9JWOQ1DGI5lgYTSU= X-MC-Unique: WqUwXXfOPoSRTmjZ1Xuy3A-1 X-Mimecast-MFC-AGG-ID: WqUwXXfOPoSRTmjZ1Xuy3A_1781556143 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Tue, 16 Jun 2026 00:38:19 +0400 Subject: [PATCH v2 53/53] 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: <20260616-qom-qapi-v2-53-cc9396b9c18c@redhat.com> References: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> In-Reply-To: <20260616-qom-qapi-v2-0-cc9396b9c18c@redhat.com> To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Roth , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=4649; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=rmXKh8NaHOlNOo20yrV9ADdc3zaw1LReiSMNRI3yDvA=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqMGKQrmqGH6xOQMq6CdjAYGCFs92KWgpXoj3LM mw77FkZRVqJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCajBikAAKCRDa6OEJdZac 5QEHD/4/Dh6R0qecWZHGcJ6qWgZCgbj8/UMPVAiyPEbhUd6QK7x+vEftjHZN8bgeG9aEz8Eack2 aQsV+aiFKuVGsw3p7qAZBjguEsdo8GOiXBfxRKswo+B1Wxhv+m2itwlmSw4VfxAO7/X3nM2ltzC mp8wKzyXFB+sGUCwO7Z4jC3jgn09DC9VN/fIOetldOi+3OPpf5jpt7JZj1YaYwvyOzEv/9K23bw MRJ3tWnekoES2CpUIIclaan4+mRlvaskcMO/+mjN+iuSJbmw9Z37cy+eOpV/l6aWL/0nW4AssZZ HrbK2psLo6Ww/0990MYh0Ydy9Wb54ZG1vNfKQmv4qMMafiAWNJvv7UL9mBoggX3NdZJWeXQzTXm YKD/X1AYcnfTx2RpSRAhITN8T4I6m5VFmNb8SfA7IuIjy0Ck+gGhu/5U/+/4zQpEUOfRbf2SbpO vsOglFIPNzselwvE8zGSZTiuzGsp1MgKZKHI45tANxbUoKnieHyMiz3/TE3eCZUiE6iZ+D37gTF TYcrEHNVIyvUQ9U+PCQ+xy0OL9xfXEAVQP+To2A1yao0Zoe9u1Hi6RjOjVpiJaynJT1KLYGoOxk w8cWkq/5TjIfCG4I8JC71vQIZwNHC1VOHe3ecZjE5Qk+wnB8ikLhFZmxqRn++NpKxErub46+DKN LRVLeJ86gx6yKrg== 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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1781556162713158500 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 c8dc9d5bd2d..80c0b2e71f4 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1529,7 +1529,7 @@ uint64_t object_property_get_uint(Object *obj, const = char *name, * object_property_get_enum: * @obj: the object * @name: the name of the property - * @typename: the name of the enum data type + * @type_info: the QAPITypeInfo of the enum * @errp: returns an error if this function fails * * Returns: the value of the property, converted to an integer (which @@ -1537,7 +1537,7 @@ uint64_t object_property_get_uint(Object *obj, const = char *name, * value is not an enum). */ int object_property_get_enum(Object *obj, const char *name, - const char *typename, Error **errp); + const QAPITypeInfo *type_info, Error **errp); =20 /** * object_property_set: diff --git a/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 486c36e1cd9..527e1354ae8 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1774,7 +1774,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; @@ -1784,10 +1784,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 b053237f0b2..cb8328d0f45 100644 --- a/tests/unit/check-qom-proplist.c +++ b/tests/unit/check-qom-proplist.c @@ -583,14 +583,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); @@ -598,7 +598,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