Re: [PATCH v2 50/53] qdev: simplify DEFINE_PROP_ARRAY and remove generic array PropertyInfo
Markus Armbruster <[email protected]>
| Newsgroups | gmane.comp.emulators.qemu |
|---|---|
| Message-ID | <[email protected]> |
Marc-André Lureau <[email protected]> writes: > 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é Lureau <[email protected]> [...] > 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, Error **errp) > > static const Property arm_gicv5_common_properties[] = { > 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), Doesn't compile for me. I applied the series at merge commit 8333dba732. If it compiles for you, could you push it to where I can pull? FAILED: [code=1] libsystem.a.p/hw_intc_arm_gicv5_common.c.o cc -m64 -Ilibsystem.a.p -I. -I.. -Isubprojects/libvduse -I../subprojects/libvduse -Iui -Iqapi -Itrace -Iui/shader -I/usr/include/p11-kit-1 -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/spice-server -I/usr/include/spice-1 -I/usr/include/opus -I/usr/include/cacard -I/usr/include/nss3 -I/usr/include/nspr4 -I/usr/include/PCSC -I/usr/include/gstreamer-1.0 -I/usr/include/libdrm -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-6 -I/usr/include/orc-0.4 -I/usr/include/libusb-1.0 -I/usr/include/SDL2 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/slirp -I/usr/local/include -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/cloudproviders -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glycin-2 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/atk-1.0 -I/usr/lib64/pkgconfig/../../include/dbus-1.0 -I/usr/lib64/pkgconfig/../../lib64/dbus-1.0/include -I/usr/include/fribidi -I/usr/include/libxml2 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/vte-2.91 -I/usr/include/rav1e -I/usr/include/svt-av1 -I/usr/include/libvmaf -I/usr/include/webp -I/usr/include/virgl -I/usr/include/fuse3 -I/usr/include/uuid -I/usr/include/pipewire-0.3 -I/usr/include/spa-0.2 -fdiagnostics-color=auto -Wall -Winvalid-pch -Werror -std=gnu11 -O2 -g -mcx16 -msse2 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-common -fwrapv -ftrivial-auto-var-init=zero -fzero-call-used-regs=used-gpr -fstack-protector-strong -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wformat-overflow=2 -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit-fallthrough=2 -Winit-self -Wmissing-format-attribute -Wmissing-prototypes -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wredundant-decls -Wshadow=local -Wstrict-prototypes -Wtype-limits -Wundef -Wvla -Wwrite-strings -Wno-missing-include-dirs -Wno-psabi -Wno-shift-negative-value -isystem /work/armbru/qemu/linux-headers -isystem linux-headers -iquote . -iquote /work/armbru/qemu -iquote /work/armbru/qemu/include -iquote /work/armbru/qemu/host/include/x86_64 -iquote /work/armbru/qemu/host/include/generic -iquote /work/armbru/qemu/tcg/x86_64 -pthread -DSTAP_SDT_V2 -fPIE -D_FILE_OFFSET_BITS=64 -D__USE_FILE_OFFSET64 -D__USE_LARGEFILE64 -DUSE_POSIX_ACLS=1 -DHWY_SHARED_DEFINE -DAVIF_DLL -DEB_DLL -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DNCURSES_WIDECHAR=1 -D_GNU_SOURCE=1 -D_REENTRANT -DSTRUCT_IOVEC_DEFINED -DWITH_GZFILEOP -DCONFIG_SOFTMMU -DCOMPILING_SYSTEM_VS_USER -MD -MQ libsystem.a.p/hw_intc_arm_gicv5_common.c.o -MF libsystem.a.p/hw_intc_arm_gicv5_common.c.o.d -o libsystem.a.p/hw_intc_arm_gicv5_common.c.o -c ../hw/intc/arm_gicv5_common.c In file included from ../hw/intc/arm_gicv5_common.c:12: /work/armbru/qemu/include/hw/core/qdev-properties.h:195:40: error: ‘qdev_prop_array’ undeclared here (not in a function); did you mean ‘qdev_prop_set_array’? 195 | DEFINE_PROP(_name, _state, _field, qdev_prop_array, uint32_t, \ | ^~~~~~~~~~~~~~~ /work/armbru/qemu/include/hw/core/qdev-properties.h:88:24: note: in definition of macro ‘DEFINE_PROP’ 88 | .info = &(_prop), \ | ^~~~~ ../hw/intc/arm_gicv5_common.c:193:5: note: in expansion of macro ‘DEFINE_PROP_LINK_ARRAY’ 193 | DEFINE_PROP_LINK_ARRAY("cpus", GICv5Common, num_cpus, | ^~~~~~~~~~~~~~~~~~~~~~ ../hw/intc/arm_gicv5_common.c:196:62: error: macro ‘DEFINE_PROP_ARRAY’ passed 6 arguments, but takes just 5 196 | cpu_iaffids, qdev_prop_uint32, uint32_t), | ^ /work/armbru/qemu/include/hw/core/qdev-properties.h:166:9: note: macro ‘DEFINE_PROP_ARRAY’ defined here 166 | #define DEFINE_PROP_ARRAY(_name, _state, _field, \ | ^~~~~~~~~~~~~~~~~ ../hw/intc/arm_gicv5_common.c:195:5: error: ‘DEFINE_PROP_ARRAY’ undeclared here (not in a function) 195 | DEFINE_PROP_ARRAY("cpu-iaffids", GICv5Common, num_cpu_iaffids, | ^~~~~~~~~~~~~~~~~ [...]