From nobody Mon Nov 23 04:26:40 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794913238; cv=none; d=zohomail.com; s=zohoarc; b=B28gofCdasVYaAnnGBg26j4gdns5i0NolEfGhFw1Y5YEmRZ6LQZ4kYXd+GbaI+QKyBSNOUGvpCTOUlUWhAYy4b2NWSXvoroCccglZG8FvLK5X0nDtDi7mNPKMgfLLIO9WEudFONIKZcVSuEBo7H90ttdf6Z6jFLIFdU/70NWMCw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794913238; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0f2UqZeuugNHiZQqquVzQgpwDw1Qi7QYVm8VrOi63kg=; b=NG7vGBIW526tHM1tsKKYfrA5Gy9ZoBiXpfaWw9cVs0YmH6THC0NT02KFkYOKuZtnFzpVNbENLXj8R7qshfY+0SRtVRQ0+01sPADX2kSnxWF+1Ektjhdm6DfGpAZHst+2sKg3s6D6aCbv9fWtJnjCp9+R99joI3HvfTI1XPOCOzM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794913238459549.0860897647458; Tue, 17 Nov 2026 03:00:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xTGur-00063F-0d; Tue, 17 Nov 2026 05:59:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xTGup-00062R-7g for qemu-devel@nongnu.org; Tue, 17 Nov 2026 05:59:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xTGum-0006h6-7c for qemu-devel@nongnu.org; Tue, 17 Nov 2026 05:59:54 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-224--_UczyWDPm-FcwdLxshWDQ-1; Tue, 17 Nov 2026 05:59:49 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DF166195608F for ; Tue, 17 Nov 2026 10:59:48 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.3]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 589421956088 for ; Tue, 17 Nov 2026 10:59:48 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id AFB3F21E692D; Tue, 17 Nov 2026 11:59:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794913191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0f2UqZeuugNHiZQqquVzQgpwDw1Qi7QYVm8VrOi63kg=; b=imqQ77Cc7YetRWuJ4Y0FD/2OLMuHfyAOfR0AQTW/mJcYjal2/hStO9/7279dqR4/CCbh47 9RrHWjucUWr8UNpHNoRfqy2YzZXDF45x7j9O3Ul1KOka26wX5GMSjJnxt2fFgyATe6c+T8 Mo3RgS/XOxUPGWextQu4xQIKS+8Fibw= X-MC-Unique: -_UczyWDPm-FcwdLxshWDQ-1 X-Mimecast-MFC-AGG-ID: -_UczyWDPm-FcwdLxshWDQ_1794913189 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v3 1/3] qdev: Convert array properties to QAPI-aware registration Date: Tue, 17 Nov 2026 11:59:43 +0100 Message-ID: <20261117105945.2802923-2-armbru@redhat.com> In-Reply-To: <20261117105945.2802923-1-armbru@redhat.com> References: <20261117105945.2802923-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794913241391158500 From: Marc-Andr=C3=A9 Lureau Add element_info and element_size fields to PropertyInfo. Add typed array PropertyInfo definitions. Each one knows its element type at compile time through the new element_info and element_size fields of PropertyInfo. Update DEFINE_PROP_ARRAY() to use them instead of the generic qdev_prop_array. Use PropertyInfo fields element_info and element_size instead of Property fields arrayinfo and arrayfieldsize. Remove arrayinfo and arrayfieldsize. Infrastructure changes: - 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 Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- hw/core/qdev-prop-internal.h | 19 +++++++ hw/display/apple-gfx.h | 1 + include/hw/core/qdev-properties-system.h | 2 + include/hw/core/qdev-properties.h | 23 +++++---- hw/core/qdev-properties-system.c | 6 +++ hw/core/qdev-properties.c | 64 ++++++++++++++---------- hw/display/apple-gfx.m | 6 +++ 7 files changed, 85 insertions(+), 36 deletions(-) diff --git a/hw/core/qdev-prop-internal.h b/hw/core/qdev-prop-internal.h index d7b77844fe0..4f89964c8fc 100644 --- a/hw/core/qdev-prop-internal.h +++ b/hw/core/qdev-prop-internal.h @@ -25,4 +25,23 @@ 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); + +#define DEFINE_PROP_ARRAY_INFO(_prop_info, _c_type, _type_info) \ + { \ + .type =3D "list", \ + .qapi_type =3D (_type_info), \ + .element_info =3D &(_prop_info), \ + .element_size =3D sizeof(_c_type), \ + .get =3D get_prop_array, \ + .set =3D set_prop_array, \ + .release =3D release_prop_array, \ + .set_default_value =3D default_prop_array, \ + } + #endif diff --git a/hw/display/apple-gfx.h b/hw/display/apple-gfx.h index 3197bd853da..652f158223c 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_array; =20 #endif =20 diff --git a/include/hw/core/qdev-properties-system.h b/include/hw/core/qde= v-properties-system.h index 2cbea16d615..b20039ae55c 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_array; +extern const PropertyInfo qdev_prop_reserved_region_array; 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 a57291a5a1e..36a448be208 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -23,9 +23,7 @@ struct Property { int64_t i; uint64_t u; } defval; - const PropertyInfo *arrayinfo; int arrayoffset; - int arrayfieldsize; uint8_t bitnr; bool set_default; }; @@ -34,6 +32,8 @@ struct PropertyInfo { const char *type; const char *description; const QAPITypeInfo *qapi_type; + const struct PropertyInfo *element_info; + size_t 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); @@ -73,8 +73,13 @@ 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_array; +extern const PropertyInfo qdev_prop_uint16_array; +extern const PropertyInfo qdev_prop_uint32_array; +extern const PropertyInfo qdev_prop_uint64_array; +extern const PropertyInfo qdev_prop_string_array; extern const PropertyInfo qdev_prop_link; +extern const PropertyInfo qdev_prop_link_array; =20 #define DEFINE_PROP(_name, _state, _field, _prop, _type, ...) { \ .name =3D (_name), \ @@ -141,7 +146,9 @@ extern const PropertyInfo qdev_prop_link; * @_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 + * @_arrayprop: PropertyInfo for the array elements (e.g. qdev_prop_uint32= ); + * a corresponding array PropertyInfo named @_arrayprop##_arr= ay + * must exist * @_arraytype: C type of the array elements * * Define device properties for a variable-length array _name. The array = is @@ -158,11 +165,9 @@ extern const PropertyInfo qdev_prop_link; */ #define DEFINE_PROP_ARRAY(_name, _state, _field, \ _arrayfield, _arrayprop, _arraytype) \ - DEFINE_PROP(_name, _state, _field, qdev_prop_array, uint32_t, \ + DEFINE_PROP(_name, _state, _field, _arrayprop##_array, 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) \ @@ -187,11 +192,9 @@ extern const PropertyInfo qdev_prop_link; */ #define DEFINE_PROP_LINK_ARRAY(_name, _state, _field, _arrayfield, \ _linktype, _arraytype) \ - DEFINE_PROP(_name, _state, _field, qdev_prop_array, uint32_t, \ + DEFINE_PROP(_name, _state, _field, qdev_prop_link_array, 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-system.c b/hw/core/qdev-properties-sys= tem.c index d5b227dbecb..d70336a1dd0 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -486,6 +486,8 @@ const PropertyInfo qdev_prop_netdev =3D { .set =3D set_netdev, }; =20 +const PropertyInfo qdev_prop_netdev_array =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_netdev, NICPeers, &strList_type_info); =20 /* --- audiodev --- */ static void get_audiodev(Object *obj, Visitor *v, const char* name, @@ -837,6 +839,10 @@ const PropertyInfo qdev_prop_reserved_region =3D { .set =3D set_reserved_region, }; =20 +const PropertyInfo qdev_prop_reserved_region_array =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_reserved_region, ReservedRegion, + &strList_type_info); + /* --- pci address --- */ =20 /* diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index e2ea8945956..7152ba0d0ab 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -681,7 +681,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 parent_prop->info->element_info, .name =3D name, /* * This ugly piece of pointer arithmetic sets up the offset so @@ -699,19 +699,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->info->element_info; + size_t elem_size =3D prop->info->element_size; =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 @@ -725,8 +727,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; @@ -734,6 +736,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->info->element_info; + size_t elem_size =3D prop->info->element_size; char *elemptr; bool ok =3D true; =20 @@ -752,9 +756,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; @@ -776,8 +780,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); @@ -790,19 +794,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; @@ -812,6 +816,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->info->element_info; + size_t elem_size =3D prop->info->element_size; int i; bool ok; =20 @@ -819,7 +825,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; @@ -832,7 +838,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; } @@ -854,18 +860,24 @@ 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); } =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_array =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint8, uint8_t, &uint8List_type_info); +const PropertyInfo qdev_prop_uint16_array =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint16, uint16_t, &uint16List_type_in= fo); +const PropertyInfo qdev_prop_uint32_array =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint32, uint32_t, &uint32List_type_in= fo); +const PropertyInfo qdev_prop_uint64_array =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_uint64, uint64_t, &uint64List_type_in= fo); +const PropertyInfo qdev_prop_string_array =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_string, char *, &strList_type_info); + +const PropertyInfo qdev_prop_link_array =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_link, void *, &strList_type_info); =20 /* --- public helpers --- */ =20 diff --git a/hw/display/apple-gfx.m b/hw/display/apple-gfx.m index 4db80f0b107..0e91a5adce6 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" @@ -880,3 +881,8 @@ 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_array =3D + DEFINE_PROP_ARRAY_INFO(qdev_prop_apple_gfx_display_mode, + AppleGFXDisplayMode, + &strList_type_info); --=20 2.55.0 From nobody Mon Nov 23 04:26:40 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794913244; cv=none; d=zohomail.com; s=zohoarc; b=Fj5+bV9X0XivEh8CvfMkAtwFqn7CZDGv6pSoNQuavx6rRxxxyyBnh30/5J+jzznLzhcz/p3XjIgsJTVwU+lp8sZQBYFwBAf/Km7Q6ZBUw8vafrjmjTE6g8N2aCQGzZcjI8xENxI47h/LLHHh0aWesqStHANXcbXTM4FJbBVx648= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794913244; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=g/vhY7ox4/MCn2RQABiHieJur0g1VMBVpfS8YfN9iYo=; b=HcXr+Lao3FNr2Bnt+qGytYQQP65HbZBJBRnwrCvYDVe7IAtqkywkgXn0cTzjf7mYhlSOkK/tJOugXbSmFdb5zxpXWVqSyeFVoI4JTsXX2FUAEeTJH0mAhLmXzmKpJAo7fP1gm1txvJ+Mwx2Nd8s0GuVRB844+OL5RgHNtVMUPoQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794913244551868.5001888724346; Tue, 17 Nov 2026 03:00:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xTGuo-00062C-Ow; Tue, 17 Nov 2026 05:59:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xTGun-00061q-Mc for qemu-devel@nongnu.org; Tue, 17 Nov 2026 05:59:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xTGul-0006gs-FW for qemu-devel@nongnu.org; Tue, 17 Nov 2026 05:59:53 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-54-qkjHGWxYNtycpbGwFF_Exg-1; Tue, 17 Nov 2026 05:59:49 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B4992195605A for ; Tue, 17 Nov 2026 10:59:48 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.3]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 36DB930001A2 for ; Tue, 17 Nov 2026 10:59:48 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id B486A21E6880; Tue, 17 Nov 2026 11:59:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794913191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g/vhY7ox4/MCn2RQABiHieJur0g1VMBVpfS8YfN9iYo=; b=hsZaz7y8yMTV0VOUSsRZ/clJ6TyVyEMCNJW6LEXxGCTKPqY96Ut3iUSgmoS/G8Q0XvzcfW fqhWZry2B1Sv0bkyx1nLs2VORtmaWdMYcD+4Txm0xqdHQ8CprS6zghZ0sFV2STqYF2i5C0 4cNAm6Denmoe6pz0PEsuAKknHL8c66w= X-MC-Unique: qkjHGWxYNtycpbGwFF_Exg-1 X-Mimecast-MFC-AGG-ID: qkjHGWxYNtycpbGwFF_Exg_1794913188 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v3 2/3] qdev: Remove unused DEFINE_PROP_ARRAY parameter _arraytype Date: Tue, 17 Nov 2026 11:59:44 +0100 Message-ID: <20261117105945.2802923-3-armbru@redhat.com> In-Reply-To: <20261117105945.2802923-1-armbru@redhat.com> References: <20261117105945.2802923-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794913245510158500 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- include/hw/block/block.h | 2 +- include/hw/core/qdev-properties.h | 14 +++++--------- 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 +- 17 files changed, 25 insertions(+), 31 deletions(-) diff --git a/include/hw/block/block.h b/include/hw/block/block.h index c0a8b84df1f..4a4c5f92920 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 36a448be208..7187df02163 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -144,17 +144,15 @@ extern const PropertyInfo qdev_prop_link_array; * @_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 * @_arrayprop: PropertyInfo for the array elements (e.g. qdev_prop_uint32= ); * a corresponding array PropertyInfo named @_arrayprop##_arr= ay * must exist - * @_arraytype: C type of the array elements * * 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 @@ -164,7 +162,7 @@ extern const PropertyInfo qdev_prop_link_array; * @_arrayfield memory. */ #define DEFINE_PROP_ARRAY(_name, _state, _field, \ - _arrayfield, _arrayprop, _arraytype) \ + _arrayfield, _arrayprop) \ DEFINE_PROP(_name, _state, _field, _arrayprop##_array, uint32_t, \ .set_default =3D true, \ .defval.u =3D 0, \ @@ -179,10 +177,8 @@ extern const PropertyInfo qdev_prop_link_array; * @_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). @@ -191,7 +187,7 @@ extern const PropertyInfo qdev_prop_link_array; * where each string is the QOM path of the object to be linked. */ #define DEFINE_PROP_LINK_ARRAY(_name, _state, _field, _arrayfield, \ - _linktype, _arraytype) \ + _linktype) \ DEFINE_PROP(_name, _state, _field, qdev_prop_link_array, uint32_t, \ .set_default =3D true, \ .defval.u =3D 0, \ diff --git a/hw/input/stellaris_gamepad.c b/hw/input/stellaris_gamepad.c index 376d91abad7..20613f64997 100644 --- a/hw/input/stellaris_gamepad.c +++ b/hw/input/stellaris_gamepad.c @@ -80,7 +80,7 @@ static void stellaris_gamepad_reset_enter(Object *obj, Re= setType type) =20 static const Property stellaris_gamepad_properties[] =3D { DEFINE_PROP_ARRAY("keycodes", StellarisGamepad, num_buttons, - keycodes, qdev_prop_uint32, uint32_t), + keycodes, qdev_prop_uint32), }; =20 static void stellaris_gamepad_class_init(ObjectClass *klass, const void *d= ata) diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c index 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 cfadfee4f05..7d49dc141ec 100644 --- a/hw/intc/arm_gicv5_common.c +++ b/hw/intc/arm_gicv5_common.c @@ -194,9 +194,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 554b504c720..32f9e166fee 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 36edb768b17..93bde28b94f 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -4380,7 +4380,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 7d2030f7aa1..c75704662a5 100644 --- a/hw/nvram/xlnx-efuse.c +++ b/hw/nvram/xlnx-efuse.c @@ -267,7 +267,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 32fd39737ff..132cf873700 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), DEFINE_PROP_LINK("memory", RISCVHartArrayState, memory, TYPE_MEMORY_REGION, MemoryRegion *), }; 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 77c3eee7171..8cd004b1efa 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) --=20 2.55.0 From nobody Mon Nov 23 04:26:40 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794913238; cv=none; d=zohomail.com; s=zohoarc; b=ip3whKO9for90RtwG7zWGXAA8FagPLJSOFuV21GRkrRvS/Ua52CEfBYrdn9PNO7v93CofMPyddVG091u0VLF/7TKZb0u66RDBSTwrvP2CmDkgY2xYFmhbrgKi5J4Y8INTuQPv+5A6VNo+iWY9aSSp5wu4fs2CGR+HpkiQM4BMPk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794913238; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=h5puhipFiQLi4MBnetR1Vp4RZQ31wFRB/pPjtJPIeW8=; b=O7kmVfduS4gFrMXZ99ubB9QU9TiSRWMiwWyGBrpjil9SBpqNgkASRkUxbtUr6kD5KZNp372k548SqcFlq1HPS+KcOM9Q4Yg4/bHEn+OfFTwkGa8x5G8eusYeLQCyuOw8oo2t+akTJ+dqcBtre+9JJQSLxX8qUPUiBvrJtEc0svs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794913238340120.33393385516865; Tue, 17 Nov 2026 03:00:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xTGup-00062U-Fw; Tue, 17 Nov 2026 05:59:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xTGuo-000620-AU for qemu-devel@nongnu.org; Tue, 17 Nov 2026 05:59:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xTGul-0006gu-Pw for qemu-devel@nongnu.org; Tue, 17 Nov 2026 05:59:54 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-465-1Aphr17dNf-7D0pmTmdSBg-1; Tue, 17 Nov 2026 05:59:49 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9DA3C180034A for ; Tue, 17 Nov 2026 10:59:48 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.3]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 59D8C1956047 for ; Tue, 17 Nov 2026 10:59:48 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id B8B9A21E6882; Tue, 17 Nov 2026 11:59:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794913190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h5puhipFiQLi4MBnetR1Vp4RZQ31wFRB/pPjtJPIeW8=; b=Zr8DA6x0b6mkxfKyawDevuDSyuwvdItc97lMMB818gWFGHKQWYSLJhTFLnSDxjic3if+n2 pYlaPSuaVGjhWBgEYbmIxu2WnFSycb/DgXRcw49Bx+Hv0aWK73CvPwUywSI7YbvIyojqao zZJfTlyVjljLvlKIbmtcVDcXn4BTVwo= X-MC-Unique: 1Aphr17dNf-7D0pmTmdSBg-1 X-Mimecast-MFC-AGG-ID: 1Aphr17dNf-7D0pmTmdSBg_1794913188 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com Subject: [PATCH v3 3/3] qapi/qom: Make @qapi-type mandatory in output of qom-list etc. Date: Tue, 17 Nov 2026 11:59:45 +0100 Message-ID: <20261117105945.2802923-4-armbru@redhat.com> In-Reply-To: <20261117105945.2802923-1-armbru@redhat.com> References: <20261117105945.2802923-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794913241423158500 Commit 0eee31cf108 (qapi/qom: add qapi-type to qom-list, qom-list-properties, qom-list-get) had to make @qapi-type optional to enable incremental conversion to QAPI-aware property registration. This conversion is now complete: @qapi-type is always present. Make it mandatory. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau --- qapi/qom.json | 10 ++++------ tests/qtest/qmp-cmd-test.c | 9 +-------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/qapi/qom.json b/qapi/qom.json index 32a59269361..cc642c7ba97 100644 --- a/qapi/qom.json +++ b/qapi/qom.json @@ -36,8 +36,7 @@ # graph. # # @qapi-type: the name of the property's type as it appears in the -# output of ``query-qmp-schema``. Absent if the type does not -# occur there. (since 11.2) +# output of ``query-qmp-schema``. (since 11.2) # # @description: if specified, the description of the property. # @@ -52,7 +51,7 @@ { 'struct': 'ObjectPropertyInfo', 'data': { 'name': 'str', 'type': 'str', - '*qapi-type': { 'type': 'str', 'features': [ 'unstable' ] }, + 'qapi-type': { 'type': 'str', 'features': [ 'unstable' ] }, '*description': 'str', '*default-value': 'any' } } =20 @@ -65,8 +64,7 @@ # `ObjectPropertyInfo`. # # @qapi-type: the name of the property's type as it appears in the -# output of ``query-qmp-schema``. Absent if the type does not -# occur there. (since 11.2) +# output of ``query-qmp-schema``. (since 11.2) # # @value: the value of the property. Absent when the property cannot # be read. @@ -80,7 +78,7 @@ { 'struct': 'ObjectPropertyValue', 'data': { 'name': 'str', 'type': 'str', - '*qapi-type': { 'type': 'str', 'features': [ 'unstable' ] }, + 'qapi-type': { 'type': 'str', 'features': [ 'unstable' ] }, '*value': 'any' } } =20 ## diff --git a/tests/qtest/qmp-cmd-test.c b/tests/qtest/qmp-cmd-test.c index 5138582bb3f..c93120a194c 100644 --- a/tests/qtest/qmp-cmd-test.c +++ b/tests/qtest/qmp-cmd-test.c @@ -379,15 +379,8 @@ static void test_qapi_type(void) QLIST_FOREACH_ENTRY(props, prop_entry) { QDict *prop =3D qobject_to(QDict, qlist_entry_obj(prop_entry)); const char *qapi_type =3D qdict_get_try_str(prop, "qapi-type"); - const char *propname =3D qdict_get_str(prop, "name"); - const char *ty =3D qdict_get_str(prop, "type"); =20 - if (qapi_type) { - g_assert_nonnull(qmp_schema_lookup(&schema, qapi_type)); - } else { - g_test_message("%s.%s %s has no associated qapi-type", - name, propname, ty); - } + g_assert_nonnull(qmp_schema_lookup(&schema, qapi_type)); } } qtest_quit(qts); --=20 2.55.0