]> git.proxmox.com Git - mirror_qemu.git/commit
qom: Put name parameter before value / visitor parameter
authorMarkus Armbruster <armbru@redhat.com>
Tue, 7 Jul 2020 16:05:54 +0000 (18:05 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Fri, 10 Jul 2020 13:18:08 +0000 (15:18 +0200)
commit5325cc34a2ca985283134c7e264be7851b112d4e
treeba4fb68122e2dcf8860552167c56f97dc962cb00
parent1c94a351644fb2555f34e63c8ddc29f70bd4803a
qom: Put name parameter before value / visitor parameter

The object_property_set_FOO() setters take property name and value in
an unusual order:

    void object_property_set_FOO(Object *obj, FOO_TYPE value,
                                 const char *name, Error **errp)

Having to pass value before name feels grating.  Swap them.

Same for object_property_set(), object_property_get(), and
object_property_parse().

Convert callers with this Coccinelle script:

    @@
    identifier fun = {
        object_property_get, object_property_parse, object_property_set_str,
        object_property_set_link, object_property_set_bool,
        object_property_set_int, object_property_set_uint, object_property_set,
        object_property_set_qobject
    };
    expression obj, v, name, errp;
    @@
    -    fun(obj, v, name, errp)
    +    fun(obj, name, v, errp)

Chokes on hw/arm/musicpal.c's lcd_refresh() with the unhelpful error
message "no position information".  Convert that one manually.

Fails to convert hw/arm/armsse.c, because Coccinelle gets confused by
ARMSSE being used both as typedef and function-like macro there.
Convert manually.

Fails to convert hw/rx/rx-gdbsim.c, because Coccinelle gets confused
by RXCPU being used both as typedef and function-like macro there.
Convert manually.  The other files using RXCPU that way don't need
conversion.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-27-armbru@redhat.com>
[Straightforwad conflict with commit 2336172d9b "audio: set default
value for pcspk.iobase property" resolved]
138 files changed:
backends/cryptodev.c
backends/rng.c
bootdevice.c
crypto/secret.c
crypto/secret_keyring.c
crypto/tlscredsanon.c
crypto/tlscredspsk.c
crypto/tlscredsx509.c
hw/acpi/cpu_hotplug.c
hw/acpi/ich9.c
hw/acpi/piix4.c
hw/arm/allwinner-a10.c
hw/arm/armsse.c
hw/arm/armv7m.c
hw/arm/aspeed.c
hw/arm/aspeed_ast2600.c
hw/arm/aspeed_soc.c
hw/arm/bcm2835_peripherals.c
hw/arm/bcm2836.c
hw/arm/cubieboard.c
hw/arm/digic.c
hw/arm/exynos4210.c
hw/arm/fsl-imx25.c
hw/arm/fsl-imx31.c
hw/arm/fsl-imx6.c
hw/arm/fsl-imx6ul.c
hw/arm/fsl-imx7.c
hw/arm/highbank.c
hw/arm/integratorcp.c
hw/arm/mcimx6ul-evk.c
hw/arm/microbit.c
hw/arm/mps2-tz.c
hw/arm/mps2.c
hw/arm/msf2-soc.c
hw/arm/musca.c
hw/arm/musicpal.c
hw/arm/nrf51_soc.c
hw/arm/orangepi.c
hw/arm/raspi.c
hw/arm/realview.c
hw/arm/sbsa-ref.c
hw/arm/stellaris.c
hw/arm/stm32f205_soc.c
hw/arm/stm32f405_soc.c
hw/arm/versatilepb.c
hw/arm/vexpress.c
hw/arm/virt.c
hw/arm/xilinx_zynq.c
hw/arm/xlnx-versal-virt.c
hw/arm/xlnx-versal.c
hw/arm/xlnx-zcu102.c
hw/arm/xlnx-zynqmp.c
hw/block/xen-block.c
hw/core/bus.c
hw/core/numa.c
hw/core/qdev-properties-system.c
hw/core/qdev-properties.c
hw/core/qdev.c
hw/display/virtio-gpu-pci.c
hw/display/virtio-vga.c
hw/dma/sparc32_dma.c
hw/dma/xilinx_axidma.c
hw/i386/pc.c
hw/i386/pc_piix.c
hw/i386/pc_q35.c
hw/i386/x86.c
hw/ide/qdev.c
hw/intc/pnv_xive.c
hw/intc/spapr_xive.c
hw/intc/xics.c
hw/intc/xive.c
hw/m68k/q800.c
hw/mem/pc-dimm.c
hw/microblaze/petalogix_ml605_mmu.c
hw/microblaze/petalogix_s3adsp1800_mmu.c
hw/microblaze/xlnx-zynqmp-pmu.c
hw/mips/boston.c
hw/mips/cps.c
hw/mips/jazz.c
hw/mips/malta.c
hw/misc/iotkit-sysctl.c
hw/misc/macio/macio.c
hw/net/ne2000-isa.c
hw/net/xilinx_axienet.c
hw/pci-host/pnv_phb3.c
hw/pci-host/pnv_phb4.c
hw/pci-host/pnv_phb4_pec.c
hw/pci-host/prep.c
hw/ppc/mac_newworld.c
hw/ppc/mac_oldworld.c
hw/ppc/pnv.c
hw/ppc/pnv_psi.c
hw/ppc/spapr.c
hw/ppc/spapr_irq.c
hw/ppc/spapr_pci.c
hw/riscv/opentitan.c
hw/riscv/sifive_e.c
hw/riscv/sifive_u.c
hw/riscv/spike.c
hw/riscv/virt.c
hw/rx/rx-gdbsim.c
hw/s390x/ipl.c
hw/s390x/s390-pci-bus.c
hw/s390x/s390-skeys.c
hw/s390x/s390-stattrib.c
hw/s390x/s390-virtio-ccw.c
hw/s390x/virtio-ccw-crypto.c
hw/s390x/virtio-ccw-rng.c
hw/scsi/scsi-bus.c
hw/sd/aspeed_sdhci.c
hw/sd/ssi-sd.c
hw/sparc/sun4m.c
hw/sparc64/sun4u.c
hw/usb/dev-storage.c
hw/virtio/virtio-crypto-pci.c
hw/virtio/virtio-iommu-pci.c
hw/virtio/virtio-mem-pci.c
hw/virtio/virtio-pmem-pci.c
hw/virtio/virtio-rng-pci.c
hw/virtio/virtio-rng.c
include/hw/audio/pcspk.h
include/qom/object.h
include/qom/qom-qobject.h
linux-user/syscall.c
net/filter.c
net/net.c
qdev-monitor.c
qom/object.c
qom/object_interfaces.c
qom/qom-hmp-cmds.c
qom/qom-qmp-cmds.c
qom/qom-qobject.c
softmmu/vl.c
target/arm/monitor.c
target/i386/cpu.c
target/ppc/translate_init.inc.c
target/s390x/cpu_models.c
ui/console.c