]> git.proxmox.com Git - mirror_qemu.git/commit
qdev: Convert bus-less devices to qdev_realize() with Coccinelle
authorMarkus Armbruster <armbru@redhat.com>
Wed, 10 Jun 2020 05:32:45 +0000 (07:32 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 15 Jun 2020 20:06:04 +0000 (22:06 +0200)
commitce189ab230bd3472ada876bf7568221342ee6dbb
treee1a1c5287c96cdd7b9100c06df7bc9ea4daa18ab
parent464a22c7570d53518da5bd492b70bae1800a6556
qdev: Convert bus-less devices to qdev_realize() with Coccinelle

All remaining conversions to qdev_realize() are for bus-less devices.
Coccinelle script:

    // only correct for bus-less @dev!

    @@
    expression errp;
    expression dev;
    @@
    -    qdev_init_nofail(dev);
    +    qdev_realize(dev, NULL, &error_fatal);

    @ depends on !(file in "hw/core/qdev.c") && !(file in "hw/core/bus.c")@
    expression errp;
    expression dev;
    symbol true;
    @@
    -    object_property_set_bool(OBJECT(dev), true, "realized", errp);
    +    qdev_realize(DEVICE(dev), NULL, errp);

    @ depends on !(file in "hw/core/qdev.c") && !(file in "hw/core/bus.c")@
    expression errp;
    expression dev;
    symbol true;
    @@
    -    object_property_set_bool(dev, true, "realized", errp);
    +    qdev_realize(DEVICE(dev), NULL, errp);

Note that Coccinelle chokes on ARMSSE typedef vs. macro in
hw/arm/armsse.c.  Worked around by temporarily renaming the macro for
the spatch run.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-57-armbru@redhat.com>
80 files changed:
hw/arm/allwinner-a10.c
hw/arm/allwinner-h3.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/bcm2836.c
hw/arm/cubieboard.c
hw/arm/digic.c
hw/arm/digic_boards.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/imx25_pdk.c
hw/arm/integratorcp.c
hw/arm/kzm.c
hw/arm/mcimx6ul-evk.c
hw/arm/mcimx7d-sabre.c
hw/arm/mps2-tz.c
hw/arm/mps2.c
hw/arm/musca.c
hw/arm/orangepi.c
hw/arm/raspi.c
hw/arm/realview.c
hw/arm/sabrelite.c
hw/arm/sbsa-ref.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.c
hw/arm/xlnx-zcu102.c
hw/arm/xlnx-zynqmp.c
hw/block/nand.c
hw/char/serial-isa.c
hw/char/serial-pci-multi.c
hw/char/serial-pci.c
hw/char/serial.c
hw/core/cpu.c
hw/hyperv/hyperv.c
hw/i386/x86.c
hw/ide/microdrive.c
hw/intc/pnv_xive.c
hw/intc/spapr_xive.c
hw/intc/xics.c
hw/intc/xive.c
hw/microblaze/petalogix_ml605_mmu.c
hw/microblaze/petalogix_s3adsp1800_mmu.c
hw/microblaze/xlnx-zynqmp-pmu.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/pnv.c
hw/ppc/pnv_bmc.c
hw/ppc/pnv_core.c
hw/ppc/pnv_psi.c
hw/ppc/spapr.c
hw/ppc/spapr_cpu_core.c
hw/ppc/spapr_drc.c
hw/ppc/spapr_iommu.c
hw/ppc/spapr_irq.c
hw/riscv/opentitan.c
hw/riscv/riscv_hart.c
hw/riscv/sifive_e.c
hw/riscv/sifive_u.c
hw/s390x/s390-skeys.c
hw/s390x/s390-stattrib.c
hw/s390x/s390-virtio-ccw.c
hw/s390x/sclp.c
hw/s390x/tod.c
target/i386/cpu.c
tests/test-qdev-global-props.c